/* ==========================================================================
   TradIn Pozzi - Porsche Finder Light Theme
   Inspired by finder.porsche.com
   ========================================================================== */

:root {
  /* Porsche Finder Light Palette */
  --pf-bg-base: #F5F5F5;
  --pf-bg-surface: #FFFFFF;
  --pf-bg-elevated: #F9F9F9;
  --pf-bg-hover: #EEEEEE;
  --pf-bg-input: #FFFFFF;

  --pf-text-primary: #1A1A1A;
  --pf-text-secondary: #585858;
  --pf-text-muted: #909090;

  --pf-border: #E0E0E0;
  --pf-border-light: #D0D0D0;
  --pf-divider: #EBEBEB;

  --pf-accent: #D5001C;
  --pf-accent-hover: #B00018;
  --pf-green: #04AA6D;
  --pf-green-hover: #038A58;

  --pf-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --pf-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);

  --pf-radius: 8px;
  --pf-radius-lg: 12px;
  --pf-transition: all 0.2s ease;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  background-color: var(--pf-bg-base);
  color: var(--pf-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--pf-text-secondary);
}

a:hover,
a:focus {
  color: var(--pf-text-primary);
}

/* --------------------------------------------------------------------------
   Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--pf-bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--pf-border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pf-text-muted);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background-color: var(--pf-bg-surface);
  border-right: 1px solid var(--pf-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--pf-border);
  text-align: center;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 120px;
  display: block;
  margin: 0 auto 10px;
  transition: var(--pf-transition);
}

.sidebar-logo:hover {
  opacity: 0.8;
}

.sidebar-mode {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pf-text-muted);
  background: var(--pf-bg-elevated);
  border: 1px solid var(--pf-border);
  padding: 3px 10px;
  border-radius: 10px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex-grow: 1;
  padding: 12px 0;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav ul li {
  margin: 0;
}

.sidebar-nav ul li a {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  color: var(--pf-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: var(--pf-transition);
}

.sidebar-nav ul li a:hover {
  background-color: var(--pf-bg-hover);
  color: var(--pf-text-primary);
  border-left-color: var(--pf-border-light);
  text-decoration: none;
}

.sidebar-nav ul li.active a {
  background-color: var(--pf-bg-hover);
  color: var(--pf-accent);
  font-weight: 600;
  border-left-color: var(--pf-accent);
}

.sidebar-nav ul li a .menu-item {
  position: relative;
}

/* Override bootstrap nav styles inside sidebar */
.sidebar-nav .nav > li > a:focus,
.sidebar-nav .nav > li > a:hover {
  background-color: var(--pf-bg-hover);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--pf-border);
  flex-shrink: 0;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background-color: transparent;
  border: 1px solid var(--pf-border-light);
  color: var(--pf-text-secondary) !important;
  padding: 8px 16px;
  border-radius: var(--pf-radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: var(--pf-transition);
}

.btn-logout:hover {
  background-color: var(--pf-accent);
  border-color: var(--pf-accent);
  color: #fff !important;
  text-decoration: none;
}

.btn-logout img {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.btn-logout:hover img {
  opacity: 1;
}

/* Layout: push wrapper content to the right of sidebar */
body:has(.sidebar) .wrapper {
  margin-left: 240px;
}

body:has(.sidebar) footer {
  margin-left: 240px;
}

/* Make container fluid when sidebar is present */
body:has(.sidebar) .wrapper .container {
  width: 100%;
  max-width: 100%;
  padding-left: 24px;
  padding-right: 24px;
}

/* Hide old header when sidebar is present */
.main-header {
  display: none;
}

/* --------------------------------------------------------------------------
   Banner
   -------------------------------------------------------------------------- */
.banner {
  background-color: var(--pf-bg-surface);
  border-bottom: 1px solid var(--pf-border);
  padding: 20px 0 14px;
  margin-top: 0;
  margin-bottom: 0;
}

.banner h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--pf-text-primary);
  position: relative;
  display: inline-block;
  padding-bottom: 0;
  margin-bottom: 0;
}

.banner h1::after {
  display: none;
}

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--pf-bg-base);
}

.login-page .login-card {
  background: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-lg);
  padding: 48px 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-page .login-card .login-logo {
  display: block;
  margin: 0 auto 36px;
  width: 140px;
}

.login-wrapper {
  max-width: 100%;
  margin: 0;
  padding-top: 0;
}

.login-page .login-wrapper {
  max-width: 100%;
  padding-top: 0;
}

.btn.btn-login {
  background-color: var(--pf-accent);
  color: #fff;
  border-radius: var(--pf-radius);
  height: 46px;
  line-height: 30px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  transition: var(--pf-transition);
}

.btn.btn-login:hover,
.btn.btn-login:focus {
  background-color: var(--pf-accent-hover);
  color: #fff;
  box-shadow: 0 4px 16px rgba(213, 0, 28, 0.35);
}

.login-wrapper .form-group a {
  color: var(--pf-text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-wrapper .form-group a:hover {
  color: var(--pf-text-primary);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control {
  height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--pf-text-primary);
  background-color: var(--pf-bg-input);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--pf-text-muted);
  background-color: var(--pf-bg-elevated);
  outline: 0;
  box-shadow: none;
  color: var(--pf-text-primary);
}

.form-control::placeholder,
.form-control::-webkit-input-placeholder {
  color: var(--pf-text-muted);
}

.form-control::-moz-placeholder {
  color: var(--pf-text-muted);
  opacity: 1;
}

.form-control:-ms-input-placeholder {
  color: var(--pf-text-muted);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
  background-color: var(--pf-bg-base);
  color: var(--pf-text-muted);
  border-color: var(--pf-border);
}

textarea.form-control {
  border-radius: var(--pf-radius);
}

select.form-control {
  border-radius: var(--pf-radius);
  color: var(--pf-text-primary);
  background-color: var(--pf-bg-input);
}

label,
.control-label {
  color: var(--pf-text-secondary);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--pf-radius);
  transition: var(--pf-transition);
  border: 1px solid transparent;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
  outline: none;
}

.btn:active {
  box-shadow: none;
}

.btn-primary,
.btn.btn-primary {
  background-color: var(--pf-accent);
  border-color: var(--pf-accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background-color: var(--pf-accent-hover);
  border-color: var(--pf-accent-hover);
  color: #fff;
}

.btn-default {
  background-color: transparent;
  border-color: var(--pf-border-light);
  color: var(--pf-text-secondary);
}

.btn-default:hover,
.btn-default:focus {
  background-color: var(--pf-bg-hover);
  border-color: var(--pf-text-muted);
  color: var(--pf-text-primary);
}

/* --------------------------------------------------------------------------
   Modals (Bootstrap)
   -------------------------------------------------------------------------- */
.modal-content {
  background-color: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--pf-border);
  background-color: var(--pf-bg-surface);
}

.modal-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--pf-text-primary);
}

.modal-body {
  padding: 24px;
  color: var(--pf-text-primary);
  background-color: var(--pf-bg-surface);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--pf-border);
  background-color: var(--pf-bg-elevated);
}

.modal-header .close {
  color: var(--pf-text-muted);
  font-size: 24px;
  opacity: 0.7;
  text-shadow: none;
  transition: opacity 0.2s ease;
}

.modal-header .close:hover {
  color: var(--pf-text-primary);
  opacity: 1;
}

.modal-backdrop.in {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table {
  border-collapse: separate;
  border-spacing: 0;
  color: var(--pf-text-primary);
}

.table > thead > tr > th {
  background-color: var(--pf-bg-elevated);
  border-bottom: 1px solid var(--pf-border);
  color: var(--pf-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
}

.table > tbody > tr > td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--pf-divider);
  vertical-align: middle;
  border-top: none;
  color: var(--pf-text-secondary);
}

.table > tbody > tr:last-child > td {
  border-bottom: none;
}

.table > tbody > tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

.table > tbody > tr:hover {
  background-color: var(--pf-bg-hover);
}

.table-bordered {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  overflow: hidden;
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border-color: var(--pf-border);
}

/* DataTables */
.dataTables_wrapper {
  padding: 0;
  color: var(--pf-text-secondary);
}

.dataTables_length label,
.dataTables_filter label,
.dataTables_info {
  color: var(--pf-text-muted);
}

.dataTables_length select {
  border-radius: var(--pf-radius);
  border: 1px solid var(--pf-border);
  background-color: var(--pf-bg-input);
  color: var(--pf-text-primary);
  height: 36px;
  padding: 4px 8px;
}

.dataTables_length select:focus {
  border-color: var(--pf-text-muted);
  box-shadow: none;
}

.dataTables_filter input {
  border-radius: var(--pf-radius);
  border: 1px solid var(--pf-border);
  background-color: var(--pf-bg-input);
  color: var(--pf-text-primary);
  height: 36px;
  padding: 4px 12px;
}

.dataTables_filter input:focus {
  border-color: var(--pf-text-muted);
  box-shadow: none;
}

.dataTables_paginate .paginate_button {
  border-radius: var(--pf-radius) !important;
  border: 1px solid var(--pf-border) !important;
  color: var(--pf-text-secondary) !important;
  background: transparent !important;
  margin: 0 2px;
  transition: var(--pf-transition);
}

.dataTables_paginate .paginate_button:hover {
  background: var(--pf-bg-hover) !important;
  border-color: var(--pf-text-muted) !important;
  color: var(--pf-text-primary) !important;
}

.dataTables_paginate .paginate_button.current {
  background: var(--pf-accent) !important;
  border-color: var(--pf-accent) !important;
  color: #fff !important;
}

.pagination > li > a,
.pagination > li > span {
  background-color: transparent;
  border-color: var(--pf-border);
  color: var(--pf-text-secondary);
}

.pagination > li.active > a,
.pagination > li.active > span,
.pagination > li.active > a:focus,
.pagination > li.active > span:focus,
.pagination > li.active > a:hover,
.pagination > li.active > span:hover {
  background-color: var(--pf-accent);
  border-color: var(--pf-accent);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Quill Editor (Comments)
   -------------------------------------------------------------------------- */
#editor {
  height: auto;
  padding: 0;
}

#editor .ql-editor {
  min-height: 180px;
}

/* --------------------------------------------------------------------------
   Toggle Switches
   -------------------------------------------------------------------------- */
.onoffswitch-inner:before {
  background-color: var(--pf-green);
}

.onoffswitch-inner:after {
  background-color: var(--pf-accent);
}

.onoffswitch-label {
  border-color: var(--pf-border-light);
  border-radius: 20px;
}

.onoffswitch-switch {
  border-color: var(--pf-border-light);
}

/* --------------------------------------------------------------------------
   Content Wrapper
   -------------------------------------------------------------------------- */
.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.content-wrapper {
  padding-top: 20px;
  padding-bottom: 40px;
  background-color: var(--pf-bg-base);
}

/* Demand edit: pin body to viewport so form fills exactly to footer */
body:has(#demand_page) {
  height: 100vh;
  overflow: hidden;
}

body:has(#demand_page) footer {
  flex-shrink: 0;
}

/* Demand edit form fills remaining viewport height above footer */
#demand_page {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background-color: #fff;
  padding-bottom: 40px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  background-color: var(--pf-bg-surface);
  border-top: 1px solid var(--pf-border);
  padding: 16px 0;
  text-align: center;
  color: var(--pf-text-muted);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Upload Buttons
   -------------------------------------------------------------------------- */
.button__upload {
  background: var(--pf-bg-elevated);
  border: 1px solid var(--pf-border-light);
  color: var(--pf-text-secondary);
  border-radius: var(--pf-radius);
  padding: 10px 18px;
  font-weight: 500;
  transition: var(--pf-transition);
}

.button__upload:hover {
  background: var(--pf-bg-hover);
  border-color: var(--pf-text-muted);
  color: var(--pf-text-primary);
}

/* --------------------------------------------------------------------------
   Loader
   -------------------------------------------------------------------------- */
.loader::after {
  border-color: var(--pf-accent) transparent;
}

/* --------------------------------------------------------------------------
   Statistics Time Range Selector
   -------------------------------------------------------------------------- */
.stats-time-range {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.stats-time-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pf-text-secondary);
}

.stats-time-select {
  padding: 8px 32px 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pf-text-primary);
  background-color: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  cursor: pointer;
  transition: var(--pf-transition);
  font-family: 'HelveticaNeueLTPro', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23585858' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 200px;
}

.stats-time-select:hover {
  border-color: var(--pf-border-light);
}

.stats-time-select:focus {
  border-color: var(--pf-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(213, 0, 28, 0.15);
}

/* --------------------------------------------------------------------------
   Statistics Dashboard
   -------------------------------------------------------------------------- */

/* Toolbar */
.stats-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 8px;
}

.stats-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 16px;
  background: var(--pf-accent);
  color: #fff;
  border: none;
  border-radius: var(--pf-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--pf-transition);
  white-space: nowrap;
}

.stats-export-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.stats-export-btn:hover {
  background: var(--pf-accent-hover);
}

.stats-export-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* KPI Row */
.stats-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-kpi-card {
  background: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--pf-shadow);
  transition: var(--pf-transition);
}

.stats-kpi-card:hover {
  box-shadow: var(--pf-shadow-lg);
  transform: translateY(-1px);
}

.stats-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--pf-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stats-kpi-icon svg {
  width: 20px;
  height: 20px;
}

.stats-kpi-icon--red {
  background: rgba(213, 0, 28, 0.08);
  color: var(--pf-accent);
}

.stats-kpi-icon--green {
  background: rgba(4, 170, 109, 0.08);
  color: var(--pf-green);
}

.stats-kpi-icon--dark {
  background: rgba(26, 26, 26, 0.06);
  color: var(--pf-text-primary);
}

.stats-kpi-icon--orange {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.stats-kpi-value--orange {
  color: #F59E0B;
}

.stats-kpi-card--warning {
  border-color: rgba(245, 158, 11, 0.3);
}

.stats-kpi-body {
  flex: 1;
  min-width: 0;
}

.stats-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pf-text-muted);
  margin-bottom: 4px;
}

.stats-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--pf-text-primary);
  line-height: 1.1;
}

.stats-kpi-value--accent {
  color: var(--pf-accent);
}

.stats-kpi-value--green {
  color: var(--pf-green);
}

/* Chart Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stats-card {
  background: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
  transition: var(--pf-transition);
}

.stats-card:hover {
  box-shadow: var(--pf-shadow-lg);
}

.stats-card--half {
  grid-column: span 1;
}

.stats-card--full {
  grid-column: span 2;
}

.stats-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--pf-divider);
}

.stats-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pf-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-card-header--warning {
  border-bottom-color: rgba(245, 158, 11, 0.25);
}

.stats-card-badge {
  font-size: 10px;
  font-weight: 600;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.stats-card-body {
  position: relative;
  padding: 12px 12px 8px;
  min-height: 350px;
}

/* Loader */
.stats-chart-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pf-bg-surface);
  z-index: 5;
}

.stats-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pf-border);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: stats-spin 0.7s linear infinite;
}

@keyframes stats-spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.stats-chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--pf-text-muted);
  font-size: 13px;
}

.stats-chart-empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

/* Error state */
.stats-chart-error {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--pf-text-muted);
  font-size: 13px;
}

.stats-chart-error svg {
  width: 36px;
  height: 36px;
  color: var(--pf-accent);
  opacity: 0.6;
}

.stats-retry-btn {
  margin-top: 4px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pf-accent);
  background: transparent;
  border: 1px solid var(--pf-accent);
  border-radius: var(--pf-radius);
  cursor: pointer;
  transition: var(--pf-transition);
}

.stats-retry-btn:hover {
  background: var(--pf-accent);
  color: #fff;
}

/* Chart container */
.stats-chart-wrap {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stats-chart-wrap.visible {
  opacity: 1;
}

/* Responsive */
@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-card--half,
  .stats-card--full {
    grid-column: span 1;
  }

  .stats-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .stats-kpi-row {
    grid-template-columns: 1fr;
  }

  .stats-kpi-card {
    padding: 16px;
  }

  .stats-kpi-value {
    font-size: 24px;
  }

  .stats-card-body {
    min-height: 280px;
    padding: 8px 4px 4px;
  }

  .stats-toolbar {
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   Close Button (vo-fs override)
   -------------------------------------------------------------------------- */
.close {
  color: var(--pf-text-muted);
}

.close:hover,
.close:focus {
  color: var(--pf-text-primary);
}

/* --------------------------------------------------------------------------
   Status & Price Badges (vo-fs override)
   -------------------------------------------------------------------------- */
.status {
  color: var(--pf-text-secondary);
}

.price {
  color: var(--pf-accent);
}

/* --------------------------------------------------------------------------
   Vehicle Cards (vo-fs override)
   -------------------------------------------------------------------------- */
.card-list {
  scrollbar-color: var(--pf-border-light) transparent;
  max-height: calc(100vh - 160px);
}

.vehicle-card {
  background-color: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow);
}

.vehicle-card:hover {
  box-shadow: var(--pf-shadow-lg);
}

.vehicle-card h3 {
  color: var(--pf-text-primary);
  border-bottom: 1px solid var(--pf-border);
}

.vehicle-image {
  background-color: var(--pf-bg-elevated);
}

.vehicle-card-details {
  color: var(--pf-text-secondary);
}

.vehicle-footer {
  background-color: var(--pf-bg-elevated);
  border-top: 1px solid var(--pf-border);
}

/* --------------------------------------------------------------------------
   Action Buttons (vo-fs override)
   -------------------------------------------------------------------------- */
.edit-btn {
  background: var(--pf-bg-elevated);
  color: var(--pf-text-secondary);
  border: 1px solid var(--pf-border-light);
  border-radius: var(--pf-radius);
}

.edit-btn:hover {
  background: var(--pf-green);
  border-color: var(--pf-green);
  color: #fff;
}

.close-btn {
  background: var(--pf-accent);
  border-radius: var(--pf-radius);
}

.close-btn:hover {
  background: var(--pf-accent-hover);
}

/* --------------------------------------------------------------------------
   Active Menu Highlight (vo-fs override)
   -------------------------------------------------------------------------- */
.first {
  background-color: var(--pf-accent);
  color: #fff;
  border-radius: var(--pf-radius);
}

/* --------------------------------------------------------------------------
   Carousel Scrollbar (vo-fs override)
   -------------------------------------------------------------------------- */
.carousel img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-radius: var(--pf-radius);
}

.carousel::-webkit-scrollbar-thumb {
  background: var(--pf-border-light);
}

.carousel::-webkit-scrollbar-thumb:hover {
  background: var(--pf-text-muted);
}

#carousel div img {
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
  border-radius: var(--pf-radius);
}

/* --------------------------------------------------------------------------
   Vehicle Detail Modal (vo-fs override)
   -------------------------------------------------------------------------- */
.modal-vehicle {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-vehicle-card {
  background: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-lg);
}

.modal-vehicle-card-header {
  background: var(--pf-bg-elevated);
  border-bottom: 1px solid var(--pf-border);
  color: var(--pf-text-primary);
}

.modal-vehicle-card-content {
  color: var(--pf-text-secondary);
  background: var(--pf-bg-surface);
}

.modal-vehicle-card-footer {
  background: var(--pf-bg-elevated);
  border-top: 1px solid var(--pf-border);
}

.modal-vehicle-card-category {
  color: var(--pf-text-secondary);
}

.modal-vehicle-card-category h3 {
  background: var(--pf-bg-hover);
  color: var(--pf-text-primary);
  border-bottom: 1px solid var(--pf-border);
}

/* --------------------------------------------------------------------------
   Dealer Modal (vo-fs override)
   -------------------------------------------------------------------------- */
.modal-dealer {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-dealer-body {
  background: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-lg);
}

.modal-dealer-header {
  background: var(--pf-bg-elevated);
  color: var(--pf-accent);
}

.modal-dealer-content {
  color: var(--pf-text-secondary);
  background: var(--pf-bg-surface);
}

.modal-dealer-footer {
  background: var(--pf-bg-elevated);
  border-top: 1px solid var(--pf-border);
}

/* --------------------------------------------------------------------------
   Dropdown (vo-fs override)
   -------------------------------------------------------------------------- */
#searchInput {
  background-color: var(--pf-bg-input);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  color: var(--pf-text-primary);
}

#searchInput:focus {
  border-color: var(--pf-text-muted);
}

.dropdown-content {
  background: var(--pf-bg-elevated);
  border: 1px solid var(--pf-border);
  border-top: none;
}

.dropdown-item {
  color: var(--pf-text-secondary);
}

.dropdown-item:hover {
  background-color: var(--pf-bg-hover);
  color: var(--pf-text-primary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left 0.3s ease;
    box-shadow: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: var(--pf-shadow-lg);
  }

  body:has(.sidebar) .wrapper {
    margin-left: 0;
  }

  body:has(.sidebar) footer {
    margin-left: 0;
  }

  /* Mobile menu toggle button */
  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 199;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .banner h1 {
    font-size: 20px;
  }

  .login-page .login-card {
    margin: 16px;
    padding: 32px 24px 28px;
  }

  .modal-content {
    margin: 10px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  .table > thead > tr > th,
  .table > tbody > tr > td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .vehicle-card {
    max-width: 100%;
  }

  .modal-vehicle-card,
  .modal-dealer-body {
    width: 95%;
  }
}

/* Mobile menu toggle (hidden on desktop) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 201;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--pf-bg-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  cursor: pointer;
  box-shadow: var(--pf-shadow);
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--pf-text-primary);
  position: relative;
}

.sidebar-toggle span::before,
.sidebar-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--pf-text-primary);
  position: absolute;
  left: 0;
}

.sidebar-toggle span::before {
  top: -6px;
}

.sidebar-toggle span::after {
  top: 6px;
}

@media (max-width: 480px) {
  .login-page .login-card {
    padding: 28px 20px 24px;
  }

  .login-page .login-card .login-logo {
    width: 110px;
    margin-bottom: 24px;
  }

  .btn.btn-login {
    height: 42px;
  }
}
