/**
 * CarvinGuard — Dashboard SaaS (Light Theme)
 */

/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
  --bg:          #F8FAFC;
  --surface-1:   #FFFFFF;
  --surface-2:   #F1F5F9;
  --surface-3:   #E8EEF5;
  --border:      #E2E8F0;
  --border-2:    #CBD5E1;
  --accent:      #2563EB;
  --accent-h:    #1D4ED8;
  --accent-glow: rgba(37,99,235,.15);
  --accent-bg:   rgba(37,99,235,.06);
  --text:        #0F172A;
  --text-2:      #334155;
  --text-muted:  #64748B;
  --success:     #059669;
  --success-bg:  rgba(5,150,105,.06);
  --error:       #DC2626;
  --warning:     #D97706;
  --purple:      #7C3AED;
  --r-sm:        8px;
  --r:           10px;
  --r-lg:        14px;
  --ease:        cubic-bezier(.4,0,.2,1);
  --sidebar-w:   240px;
  --shadow-sm:   0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:      0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow-lg:   0 10px 28px rgba(15,23,42,.1), 0 2px 6px rgba(15,23,42,.05);
  /* Accents d’angle sur les boutons (pas de contour complet) */
  --btn-corner-l:     11px;
  --btn-corner-inset: 3px;
  --btn-corner-w:     2px;
}

/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body.dashboard-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. SHELL
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: transform .25s var(--ease);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
  height: 28px;
  width: auto;
}

.sidebar-logo-name {
  font-size: .9375rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 10px 10px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.nav-item svg { opacity: .7; flex-shrink: 0; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: .6875rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  margin-bottom: 6px;
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-h));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-email {
  font-size: .8125rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.btn-logout {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: none;
  border: none;
  position: relative;
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s var(--ease);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-logout::before,
.btn-logout::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: 9px;
  height: 9px;
  z-index: 1;
  box-sizing: border-box;
}
.btn-logout::before {
  bottom: 2px;
  left: 2px;
  border-left: var(--btn-corner-w) solid var(--border-2);
  border-bottom: var(--btn-corner-w) solid var(--border-2);
  border-radius: 0 0 0 2px;
}
.btn-logout::after {
  top: 2px;
  right: 2px;
  border-top: var(--btn-corner-w) solid var(--border-2);
  border-right: var(--btn-corner-w) solid var(--border-2);
  border-radius: 0 2px 0 0;
}

.btn-logout:hover {
  background: #FEF2F2;
  color: #DC2626;
}
.btn-logout:hover::before,
.btn-logout:hover::after {
  border-color: #FCA5A5;
}

/* ============================================================
   5. MAIN AREA
   ============================================================ */
.app-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 54px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.btn-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: all .15s var(--ease);
  display: flex;
  align-items: center;
}

.btn-menu:hover { background: var(--surface-2); color: var(--text); }

.topbar-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   6. SECTIONS
   ============================================================ */
.app-section {
  display: none;
  padding: 32px;
  max-width: 1100px;
  width: 100%;
  animation: fadeUp .2s var(--ease) both;
}

.app-section.active { display: block; }

.section-header { margin-bottom: 24px; }

.section-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: 4px;
  line-height: 1.2;
}

.section-sub {
  font-size: .9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   7. STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-card--credits::before { background: var(--accent); }
.stat-card--month::before   { background: var(--success); }
.stat-card--total::before   { background: var(--warning); }

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-label {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
}

.stat-hint {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================================
   8. CARDS (generic)
   ============================================================ */
.dash-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dash-card + .dash-card { margin-top: 14px; }

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.dash-card-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
}

.dash-link-btn {
  font-size: .8125rem;
  color: var(--accent);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
.dash-link-btn:hover { color: var(--accent-h); }

/* ============================================================
   9. TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 9px 18px;
  text-align: left;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.data-table td {
  padding: 13px 18px;
  font-size: .875rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

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

.data-table tbody tr:hover td { background: var(--surface-2); }

.cell-vin {
  font-family: 'Courier New', monospace;
  font-size: .8125rem;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.cell-vehicle {
  font-weight: 600;
  color: var(--text);
}

.cell-date { color: var(--text-muted); font-size: .8125rem; }

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: .9375rem;
  line-height: 1.6;
}

.empty-state svg { opacity: .25; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }

/* ============================================================
   10. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r);
  font-size: .9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: white;
  position: relative;
}
.btn--primary::before,
.btn--primary::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: var(--btn-corner-l);
  height: var(--btn-corner-l);
  z-index: 1;
  box-sizing: border-box;
}
.btn--primary::before {
  bottom: var(--btn-corner-inset);
  left: var(--btn-corner-inset);
  border-left: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-bottom: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-radius: 0 0 0 2px;
}
.btn--primary::after {
  top: var(--btn-corner-inset);
  right: var(--btn-corner-inset);
  border-top: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-right: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-radius: 0 2px 0 0;
}
.btn--primary:hover {
  background: var(--accent-h);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn--primary:hover::before,
.btn--primary:hover::after {
  border-color: rgba(255, 255, 255, 0.95);
}

.btn--secondary {
  background: var(--surface-1);
  color: var(--text-2);
  border: none;
  position: relative;
}
.btn--secondary::before,
.btn--secondary::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: var(--btn-corner-l);
  height: var(--btn-corner-l);
  z-index: 1;
  box-sizing: border-box;
}
.btn--secondary::before {
  bottom: var(--btn-corner-inset);
  left: var(--btn-corner-inset);
  border-left: var(--btn-corner-w) solid var(--border-2);
  border-bottom: var(--btn-corner-w) solid var(--border-2);
  border-radius: 0 0 0 2px;
}
.btn--secondary::after {
  top: var(--btn-corner-inset);
  right: var(--btn-corner-inset);
  border-top: var(--btn-corner-w) solid var(--border-2);
  border-right: var(--btn-corner-w) solid var(--border-2);
  border-radius: 0 2px 0 0;
}
.btn--secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn--secondary:hover::before,
.btn--secondary:hover::after {
  border-color: var(--text-muted);
}

.btn--danger {
  background: #FEF2F2;
  color: #DC2626;
  border: none;
  position: relative;
}
.btn--danger::before,
.btn--danger::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: var(--btn-corner-l);
  height: var(--btn-corner-l);
  z-index: 1;
  box-sizing: border-box;
}
.btn--danger::before {
  bottom: var(--btn-corner-inset);
  left: var(--btn-corner-inset);
  border-left: var(--btn-corner-w) solid #F87171;
  border-bottom: var(--btn-corner-w) solid #F87171;
  border-radius: 0 0 0 2px;
}
.btn--danger::after {
  top: var(--btn-corner-inset);
  right: var(--btn-corner-inset);
  border-top: var(--btn-corner-w) solid #F87171;
  border-right: var(--btn-corner-w) solid #F87171;
  border-radius: 0 2px 0 0;
}
.btn--danger:hover {
  background: #FEE2E2;
}
.btn--danger:hover::before,
.btn--danger:hover::after {
  border-color: #EF4444;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn--primary:disabled::before,
.btn--primary:disabled::after,
.btn--secondary:disabled::before,
.btn--secondary:disabled::after,
.btn--danger:disabled::before,
.btn--danger:disabled::after {
  opacity: 0.35;
}

/* ============================================================
   11. FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: .9375rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:hover { border-color: var(--border-2); }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }

.form-input--vin {
  font-family: 'Courier New', monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 1rem;
}

.form-error {
  margin-top: 10px;
  padding: 10px 13px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--r-sm);
  color: #DC2626;
  font-size: .875rem;
}

.form-success {
  margin-top: 10px;
  padding: 10px 13px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--r-sm);
  color: #15803D;
  font-size: .875rem;
}

/* ============================================================
   12. VIN SEARCH
   ============================================================ */
.vin-search-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.vin-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.vin-input-row .form-group { flex: 1; margin-bottom: 0; }

.credits-hint {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.credits-count {
  font-weight: 700;
  color: var(--accent);
}

/* VIN Result */
.vin-result-card {
  background: var(--surface-1);
  border: 1px solid #BBF7D0;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .25s var(--ease);
}

.vin-result-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F0FDF4;
}

.vin-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #D1FAE5;
  border: 1px solid #6EE7B7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  flex-shrink: 0;
}

.vin-result-vehicle {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.025em;
  line-height: 1.2;
}

.vin-result-code {
  font-size: .8125rem;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: .08em;
  margin-top: 2px;
}

.vin-result-pdf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.vin-result-pdf-row .btn--pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.vin-result-pdf-hint {
  font-size: .8125rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.vin-result-body { padding: 18px 22px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.result-field {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 13px;
}

.result-field-label {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-field-value {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
}

.result-field-value.empty { color: var(--text-muted); font-style: italic; font-weight: 400; }

/* ============================================================
   13. PRICING CARDS
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.pricing-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
  text-decoration: none;
  color: inherit;
}

.pricing-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-2);
}

.pricing-card--popular {
  border-color: var(--accent);
  background: linear-gradient(160deg, #EFF6FF 0%, #FFFFFF 50%);
}
.pricing-card--popular:hover { border-color: var(--accent-h); box-shadow: 0 6px 20px var(--accent-glow); }

.pricing-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent);
  color: white;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 999px;
  margin-bottom: 14px;
  align-self: flex-start;
}

.pricing-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.pricing-desc {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex: 1;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-unit {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.pricing-unit strong { color: var(--text-2); font-weight: 600; }

.btn-pricing {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: .9375rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .15s var(--ease);
  margin-top: auto;
  position: relative;
}

.btn-pricing--primary {
  background: var(--accent);
  color: white;
}
.btn-pricing--primary::before,
.btn-pricing--primary::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: var(--btn-corner-l);
  height: var(--btn-corner-l);
  z-index: 1;
  box-sizing: border-box;
}
.btn-pricing--primary::before {
  bottom: var(--btn-corner-inset);
  left: var(--btn-corner-inset);
  border-left: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-bottom: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-radius: 0 0 0 2px;
}
.btn-pricing--primary::after {
  top: var(--btn-corner-inset);
  right: var(--btn-corner-inset);
  border-top: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-right: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-radius: 0 2px 0 0;
}
.btn-pricing--primary:hover {
  background: var(--accent-h);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-pricing--primary:hover::before,
.btn-pricing--primary:hover::after {
  border-color: rgba(255, 255, 255, 0.95);
}

.btn-pricing--outline {
  background: transparent;
  color: var(--text-2);
  border: none;
}
.btn-pricing--outline::before,
.btn-pricing--outline::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: var(--btn-corner-l);
  height: var(--btn-corner-l);
  z-index: 1;
  box-sizing: border-box;
}
.btn-pricing--outline::before {
  bottom: var(--btn-corner-inset);
  left: var(--btn-corner-inset);
  border-left: var(--btn-corner-w) solid var(--border-2);
  border-bottom: var(--btn-corner-w) solid var(--border-2);
  border-radius: 0 0 0 2px;
}
.btn-pricing--outline::after {
  top: var(--btn-corner-inset);
  right: var(--btn-corner-inset);
  border-top: var(--btn-corner-w) solid var(--border-2);
  border-right: var(--btn-corner-w) solid var(--border-2);
  border-radius: 0 2px 0 0;
}
.btn-pricing--outline:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn-pricing--outline:hover::before,
.btn-pricing--outline:hover::after {
  border-color: var(--text-muted);
}

/* ============================================================
   14. PROFILE
   ============================================================ */
.profile-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.profile-card-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.profile-card-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
}

.profile-card-body { padding: 18px; }

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child { border-bottom: none; padding-bottom: 0; }

.profile-row-label {
  font-size: .875rem;
  color: var(--text-muted);
  min-width: 130px;
  flex-shrink: 0;
}

.profile-row-value {
  font-size: .875rem;
  color: var(--text-2);
  font-weight: 500;
}

.profile-form { max-width: 400px; }

/* ============================================================
   15. AUTH OVERLAY
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.auth-overlay.hidden { display: none; }

.auth-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .3s var(--ease) both;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-logo img { height: 28px; }

.auth-logo-text {
  font-size: .9375rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 4px;
  gap: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s var(--ease);
}

.auth-tab.active {
  background: var(--surface-1);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-input {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: .9375rem;
  font-family: inherit;
  transition: all .15s;
}
.auth-input:hover { border-color: var(--border-2); }
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-input::placeholder { color: var(--text-muted); }

.auth-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.auth-btn {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r);
  font-size: .9375rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s var(--ease);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.auth-btn::before,
.auth-btn::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: var(--btn-corner-l);
  height: var(--btn-corner-l);
  z-index: 1;
  box-sizing: border-box;
}
.auth-btn::before {
  bottom: var(--btn-corner-inset);
  left: var(--btn-corner-inset);
  border-left: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-bottom: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-radius: 0 0 0 2px;
}
.auth-btn::after {
  top: var(--btn-corner-inset);
  right: var(--btn-corner-inset);
  border-top: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-right: var(--btn-corner-w) solid rgba(255, 255, 255, 0.5);
  border-radius: 0 2px 0 0;
}

.auth-btn:hover {
  background: var(--accent-h);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.auth-btn:hover::before,
.auth-btn:hover::after {
  border-color: rgba(255, 255, 255, 0.95);
}

.auth-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.auth-btn:disabled::before,
.auth-btn:disabled::after {
  opacity: 0.35;
}

.auth-error {
  margin-top: 12px;
  padding: 10px 13px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--r-sm);
  color: #DC2626;
  font-size: .875rem;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: .8125rem;
  color: var(--text-muted);
}

.auth-link {
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link:hover { color: var(--accent-h); }

/* ============================================================
   16. INVITE OVERLAY
   ============================================================ */
.invite-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.invite-overlay.hidden { display: none; }

/* ============================================================
   17. BANNERS
   ============================================================ */
.success-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--r);
  color: #15803D;
  font-size: .9375rem;
  margin-bottom: 20px;
  animation: fadeUp .3s var(--ease);
}

.success-banner.hidden { display: none; }

.success-banner.post-pay--warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}

.info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--r);
  color: #1D4ED8;
  font-size: .9375rem;
  margin-bottom: 20px;
}

.info-banner.hidden { display: none; }

/* ============================================================
   18. MISC
   ============================================================ */
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.spinner--accent {
  border-color: var(--border);
  border-top-color: var(--accent);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px;
  color: var(--text-muted);
  font-size: .9375rem;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 700;
}

.badge--green { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.badge--blue  { background: #DBEAFE; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge--amber { background: #FEF9C3; color: #A16207; border: 1px solid #FDE047; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.3);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ============================================================
   19. ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   20. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-topbar { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(15,23,42,.15);
  }

  .app-section { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .vin-input-row { flex-direction: column; }
  .vin-input-row .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Rapport VIN complet CarAPI */
.full-report-panels { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.full-report-panel {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-1);
  overflow: hidden;
}
.full-report-panel summary {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  background: var(--surface-2);
}
.full-report-panel-title { min-width: 0; }
.full-report-panel summary::-webkit-details-marker { display: none; }
.full-report-panel summary::after { content: '▾'; color: var(--text-muted); font-size: 0.75rem; justify-self: end; }
.full-report-panel[open] summary::after { content: '▴'; }
.full-report-panel-body { padding: 0 14px 16px; }
.full-report-skip, .full-report-err { font-size: 0.8125rem; color: var(--text-muted); margin: 8px 0 0; }
.full-report-err { color: var(--error); }
.full-report-hint { font-size: 0.8125rem; color: var(--text-muted); margin: 0 0 8px; line-height: 1.45; }
.badge-full { font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--accent-bg); color: var(--accent); }

/* Détails fiche (équipements) sous la grille identité */
.vin-decode-meta {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.vin-decode-h {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.vin-decode-block + .vin-decode-block { margin-top: 18px; }
.vin-decode-plain { font-size: 0.8125rem; line-height: 1.55; color: var(--text-2); margin: 0; }

/* Pills de statut + rapport premium */
.report-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-muted);
  white-space: nowrap;
}
.report-pill--ok { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.report-pill--warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.report-pill--err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.report-pill--neutral { background: var(--surface-2); color: var(--text-muted); }

.report-lead, .report-subhead, .report-footnote { line-height: 1.5; }
.report-lead { font-size: 0.875rem; color: var(--text); margin: 0 0 12px; }
.report-subhead { font-size: 0.8rem; font-weight: 700; color: var(--text); margin: 6px 0 10px; }
.report-footnote { font-size: 0.75rem; color: var(--text-muted); margin: 12px 0 0; }
.report-context-note { font-size: 0.78rem; color: var(--text-2); line-height: 1.5; margin: 0 0 10px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--border); }
.report-sim-params { margin-bottom: 12px; }
.report-plate2vin-title { font-size: 0.85rem; font-weight: 800; margin: 0 0 8px; color: var(--text); }

.report-callout {
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0 0 12px;
}
.report-callout--info {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  color: var(--text);
}

.report-kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.report-kv--hero { margin-bottom: 4px; }
.report-kv--compact { gap: 8px; }
.report-kv-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.report-kv-label { display: block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; }
.report-kv-value { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.report-kv-mono { font-family: ui-monospace, monospace; font-size: 0.82rem; letter-spacing: 0.04em; }
.empty-val { color: var(--text-muted); font-style: italic; font-weight: 500; }

.report-card-grid { display: grid; gap: 10px; margin-top: 4px; }
.report-card-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) {
  .report-card-grid--2 { grid-template-columns: 1fr; }
}
.report-mini-card {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
}
.report-mini-card__label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.report-mini-card__val { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-top: 4px; }
.report-mini-card__hint { font-size: 0.75rem; color: var(--text-muted); margin: 8px 0 0; line-height: 1.45; }

.report-hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.report-hero--ok { background: linear-gradient(120deg, #f0fdf4, #f8fafc); border-color: #bbf7d0; }
.report-hero--alert { background: linear-gradient(120deg, #fef2f2, #fffbeb); border-color: #fecaca; }
.report-hero__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem;
  flex-shrink: 0;
}
.report-hero--ok .report-hero__icon { background: #d1fae5; color: #047857; }
.report-hero--alert .report-hero__icon { background: #fee2e2; color: #b91c1c; }
.report-hero__title { font-weight: 800; font-size: 0.95rem; color: var(--text); }
.report-hero__text { font-size: 0.8rem; color: var(--text-2); margin: 4px 0 0; line-height: 1.5; }

.report-country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.report-country-cell {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border); font-size: 0.8rem;
  background: var(--surface-2);
}
.report-country-cell.is-clear { border-color: #bbf7d0; }
.report-country-cell.is-alert { border-color: #fecaca; background: #fff7f7; }
.report-country-name { font-weight: 600; color: var(--text); }

.report-mile-stack { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.report-mile-bar__track { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.report-mile-bar__fill { height: 100%; background: linear-gradient(90deg, var(--accent), #60a5fa); border-radius: 4px; }
.report-mile-bar__meta { display: flex; justify-content: space-between; font-size: 0.75rem; margin-top: 4px; color: var(--text-2); }
.report-mile-date { color: var(--text-muted); }

.report-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); margin-top: 8px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.report-table th, .report-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.report-table th { background: var(--surface-2); font-weight: 700; color: var(--text-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.report-table td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.report-table tr:last-child td { border-bottom: none; }

.report-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; margin-top: 8px;
}
.report-photo {
  position: relative; display: block; aspect-ratio: 4/3; border-radius: var(--r-sm);
  overflow: hidden; border: 1px solid var(--border); background: var(--surface-2);
}
.report-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-photo__cap {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.8));
  color: #fff; font-size: 0.65rem; font-weight: 700; padding: 6px; text-align: center;
  opacity: 0; transition: opacity 0.15s;
}
.report-photo:hover .report-photo__cap { opacity: 1; }

.report-finance-hero { margin: 0 0 8px; }
.report-finance-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 800px) {
  .report-finance-kpis { grid-template-columns: repeat(4, 1fr); }
}
.report-finance-kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
}
.report-finance-kpi__l { display: block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.report-finance-kpi__v { display: block; font-size: 1rem; font-weight: 800; color: var(--text); margin-top: 2px; }

.report-valuation { margin: 0 0 4px; }
.report-valuation__price {
  text-align: center; padding: 16px; border-radius: var(--r);
  background: linear-gradient(140deg, #eff6ff, #f8fafc);
  border: 1px solid #bfdbfe; margin-bottom: 12px;
}
.report-valuation__n { display: block; font-size: 1.75rem; font-weight: 900; letter-spacing: -0.03em; color: var(--text); }
.report-valuation__hint { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.report-listing-stack { display: flex; flex-direction: column; gap: 10px; }
.report-listing-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-1);
  overflow: hidden;
}
.report-listing-card__head {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 8px 12px; background: var(--surface-2); color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.report-listing-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px; padding: 10px 12px; font-size: 0.8rem;
}
@media (max-width: 560px) { .report-listing-specs { grid-template-columns: 1fr; } }
.report-listing-specs .lbl { display: block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.report-listing-avail { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.report-listing-avail .tag {
  font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}

.report-skipped { padding: 4px 0; }
.report-skipped__text { font-size: 0.875rem; color: var(--text); line-height: 1.5; margin: 0; }

.report-fail {
  border: 1px dashed var(--border);
  border-radius: var(--r);
  padding: 12px 14px; background: var(--surface-2);
  margin: 0 0 8px;
}
.report-fail__title { font-weight: 800; font-size: 0.875rem; margin: 0 0 4px; color: var(--text); }
.report-fail__sub { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

.report-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.report-chip {
  font-size: 0.7rem; font-weight: 600; padding: 4px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.report-chip--more { color: var(--text-muted); font-style: italic; }

/* Mes rapports — accès au détail */
.data-table--history .cell-actions { white-space: nowrap; vertical-align: middle; }
.btn-history-detail,
.btn-history-prefill {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--accent);
  cursor: pointer;
}
.btn-history-detail:hover,
.btn-history-prefill:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}
@media (max-width: 900px) {
  .data-table--history .history-actions { font-size: 0.75rem; }
  .btn-history-detail, .btn-history-prefill { padding: 5px 8px; }
}

/* ── VehicleDatabases panel styles ── */
.status-pill { display: inline-flex; align-items: center; font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.status-pill--ok { background: #d1fae5; color: #065f46; }
.status-pill--err { background: #fee2e2; color: #991b1b; }
.status-pill--skip { background: var(--surface-2); color: var(--text-muted); }
.status-pill--na { background: var(--surface-2); color: var(--text-muted); }

.stolen-status { padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 12px; font-size: 0.875rem; }
.stolen-status--ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.stolen-status--alert { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 700; }

.mv-trim-block { margin-bottom: 16px; }
.mv-trim-title { font-size: 0.8rem; font-weight: 700; color: var(--text-2); margin: 0 0 6px; }

.recalls-list { display: flex; flex-direction: column; gap: 10px; }
.recall-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.recall-title { font-weight: 700; font-size: 0.8rem; color: var(--accent); margin-bottom: 4px; }
.recall-desc { font-size: 0.8rem; color: var(--text-2); }
.recall-remedy { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.recall-date { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.report-none { color: var(--text-muted); font-size: 0.85rem; font-style: italic; padding: 8px 0; }

.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.photo-thumb { border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 4/3; background: var(--surface-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
