/* ============================================================
   NC Autotech — Design System
   Premium Dark Automotive Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Apply Outfit font to all heading/brand styles globally */
h1, h2, h3, h4, h5, h6, .brand, .stat-value, .card-title, .logo-text .brand, .navbar-title, .user-name {
  font-family: 'Outfit', sans-serif !important;
}

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg-primary:       #04060c; /* Premium deep obsidian dark */
  --bg-secondary:     #090c15; /* Refined dark slate */
  --bg-card:          #0e1220; /* Glossy carbon card void */
  --bg-card-hover:    #151b30; /* High-contrast card hover state */
  --bg-sidebar:       #060911; /* Carbon black sidebar */
  --color-primary:    #3b82f6; /* Modern BMW blue */
  --color-primary-h:  #2563eb; /* Deeper hover blue */
  --color-primary-glow: rgba(59,130,246,.25);
  --color-accent:     #f59e0b; /* Audi/Porsche performance gold */
  --color-accent-h:   #d97706;
  --text-primary:     #f8fafc; /* Crisp white body */
  --text-secondary:   #cbd5e1; /* Elegant readable gray */
  --text-muted:       #94a3b8; /* Highly legible slate gray (WCAG AA compliant) */
  --border:           #1e293b;
  --border-light:     #334155;
  --success:          #10b981;
  --danger:           #ef4444;
  --warning:          #f59e0b;
  --info:             #3b82f6;
  --sidebar-width:    260px;
  --navbar-h:         64px;
  --radius:           12px;
  --radius-sm:        8px;
  --radius-xs:        6px;
  --shadow-card:      0 4px 24px rgba(0,0,0,.55);
  --shadow-glow:      0 0 24px rgba(59,130,246,.3);
  --shadow-sm:        0 2px 8px rgba(0,0,0,.4);
  --transition:       all .2s ease;

  /* Aliases to bridge template variables */
  --color-border:             var(--border);
  --color-border-light:       var(--border-light);
  --color-dark-surface:       var(--bg-secondary);
  --color-dark-surface-hover: var(--bg-card-hover);
  --color-muted:              var(--text-muted);
  --color-text-primary:       var(--text-primary);
  --color-text-secondary:     var(--text-secondary);
}

[data-theme="light"] {
  --bg-primary:       #f8fafc;
  --bg-secondary:     #ffffff;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f1f5f9;
  --bg-sidebar:       #ffffff;
  --color-primary:    #2563eb;
  --color-primary-h:  #1d4ed8;
  --color-primary-glow: rgba(37,99,235,.12);
  --color-accent:     #d97706;
  --color-accent-h:   #b45309;
  --text-primary:     #000000; /* Absolute black */
  --text-secondary:   #000000; /* Absolute black */
  --text-muted:       #000000; /* Absolute black for complete readability */
  --border:           #cbd5e1;
  --border-light:     #94a3b8;
  --shadow-card:      0 4px 20px rgba(0,0,0,.06);
  --shadow-glow:      0 0 20px rgba(37,99,235,.15);
  --shadow-sm:        0 2px 6px rgba(0,0,0,.04);

  /* Aliases to bridge template variables */
  --color-border:             var(--border);
  --color-border-light:       var(--border-light);
  --color-dark-surface:       var(--bg-secondary);
  --color-dark-surface-hover: var(--bg-card-hover);
  --color-muted:              var(--text-muted);
  --color-text-primary:       var(--text-primary);
  --color-text-secondary:     var(--text-secondary);
}

/* Global Light Mode Readability & Contrast Overrides */
[data-theme="light"] .text-white,
[data-theme="light"] .text-light,
[data-theme="light"] .text-secondary,
[data-theme="light"] .text-muted,
[data-theme="light"] .text-white-50,
[data-theme="light"] .text-black-50,
[data-theme="light"] .text-body {
  color: #000000 !important;
}

/* Gracefully convert dark containers to clean light gray in Light Theme */
[data-theme="light"] .bg-dark,
[data-theme="light"] .bg-dark-subtle,
[data-theme="light"] .badge.bg-dark,
[data-theme="light"] .badge.bg-dark-subtle,
[data-theme="light"] .timeline-body.bg-dark,
[data-theme="light"] .p-3.bg-dark,
[data-theme="light"] .p-2.bg-dark {
  background-color: #f1f5f9 !important;
  background: #f1f5f9 !important;
  color: #000000 !important;
  border-color: #cbd5e1 !important;
}

/* Light Mode Overrides for UI Elements */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] .form-control-dark,
[data-theme="light"] .form-select-dark {
  background: #ffffff !important;
  border-color: #94a3b8 !important;
  color: #000000 !important;
}
[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
}
[data-theme="light"] .dropdown-menu {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05) !important;
}
[data-theme="light"] .dropdown-item {
  color: #000000 !important;
  font-weight: 500 !important;
}
[data-theme="light"] .dropdown-item:hover {
  background-color: #f1f5f9 !important;
  color: #2563eb !important;
}
[data-theme="light"] .top-navbar {
  background: #ffffff !important;
  border-bottom-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
[data-theme="light"] .top-navbar .navbar-garage {
  background: #f1f5f9 !important;
  color: #000000 !important;
  font-weight: 600 !important;
}
[data-theme="light"] .top-navbar .navbar-icon-btn {
  color: #000000 !important;
}
[data-theme="light"] .top-navbar .navbar-icon-btn:hover {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}
[data-theme="light"] .card-dark {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.05) !important;
}
[data-theme="light"] .card-dark:hover {
  border-color: #94a3b8 !important;
}
[data-theme="light"] .stat-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.05) !important;
}
[data-theme="light"] .stat-card:hover {
  border-color: #94a3b8 !important;
}
[data-theme="light"] .table-dark-custom th {
  background: #f8fafc !important;
  color: #000000 !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #94a3b8 !important;
}
[data-theme="light"] .table-dark-custom td {
  border-bottom: 1px solid #cbd5e1 !important;
  color: #000000 !important;
  font-weight: 500 !important;
}
[data-theme="light"] .table-dark-custom tr:hover td {
  background: #f8fafc !important;
}
[data-theme="light"] .modal-content {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #000000 !important;
}
[data-theme="light"] .modal-header {
  border-bottom-color: #cbd5e1 !important;
}
[data-theme="light"] .modal-header .modal-title {
  color: #000000 !important;
  font-weight: 700 !important;
}
[data-theme="light"] .modal-header .btn-close {
  filter: none !important;
}
[data-theme="light"] .modal-footer {
  border-top-color: #cbd5e1 !important;
}

/* Light Mode Sidebar Overrides */
[data-theme="light"] .sidebar {
  background: #ffffff !important;
  border-right-color: #cbd5e1 !important;
}
[data-theme="light"] .sidebar .nav-link {
  color: #000000 !important;
  font-weight: 600 !important;
}
[data-theme="light"] .sidebar .nav-link:hover {
  color: #2563eb !important;
  background: rgba(0,0,0,.03) !important;
  border-left-color: #94a3b8 !important;
}
[data-theme="light"] .sidebar .nav-link.active {
  color: #2563eb !important;
  background: rgba(37,99,235,.08) !important;
  border-left-color: #2563eb !important;
}
[data-theme="light"] .sidebar-user {
  background: #f1f5f9 !important;
  color: #000000 !important;
}
[data-theme="light"] .sidebar-logo {
  border-bottom-color: #cbd5e1 !important;
}
[data-theme="light"] .sidebar-footer {
  border-top-color: #cbd5e1 !important;
}
[data-theme="light"] .sidebar .logo-text .brand {
  color: #000000 !important;
}
[data-theme="light"] .sidebar-logo .logo-icon {
  box-shadow: none !important;
}
[data-theme="light"] .sidebar-footer .ms-auto {
  color: #4b5563 !important;
}

/* Button Readability Overrides in Light Mode */
[data-theme="light"] .btn-accent {
  background: #d97706 !important;
  color: #ffffff !important;
}
[data-theme="light"] .btn-accent:hover {
  background: #b45309 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}
[data-theme="light"] .btn-ghost {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] .btn-ghost:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
[data-theme="light"] .btn-danger-custom {
  background: rgba(239,68,68,.1) !important;
  border-color: rgba(239,68,68,.2) !important;
  color: #dc2626 !important;
}
[data-theme="light"] .btn-danger-custom:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
}



/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-h); }
h1,h2,h3,h4,h5,h6 { color: var(--text-primary); font-weight: 600; }
hr { border-color: var(--border); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Layout ─────────────────────────────────────────────────── */
.layout-wrapper { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s ease;
}

.page-content {
  flex: 1;
  padding: 24px;
  margin-top: var(--navbar-h);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .3s ease;
}

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

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--color-primary), #1e40af);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo .logo-text { flex: 1; }
.sidebar-logo .logo-text .brand { font-size: 14px; font-weight: 700; color: var(--text-primary); letter-spacing: .02em; }
.sidebar-logo .logo-text .tagline { font-size: 10px; color: var(--text-muted); font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section-label {
  padding: 8px 20px 4px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase;
}

.sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 450;
  border-radius: 0;
  transition: var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.sidebar .nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.04);
  border-left-color: var(--border-light);
}

.sidebar .nav-link.active {
  color: var(--color-primary);
  background: rgba(37,99,235,.12);
  border-left-color: var(--color-primary);
  font-weight: 500;
}

.sidebar .nav-link .nav-icon { font-size: 16px; opacity: .8; flex-shrink: 0; }
.sidebar .nav-link.active .nav-icon { opacity: 1; }

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

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
}

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

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 10px; color: var(--text-muted); text-transform: capitalize; }

/* ── Top Navbar ─────────────────────────────────────────────── */
.top-navbar {
  position: fixed; top: 0;
  left: var(--sidebar-width); right: 0;
  height: var(--navbar-h);
  background: rgba(10,14,26,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 999;
  transition: left .3s ease;
}

.navbar-toggle { display: none; background: none; border: none; color: var(--text-secondary); font-size: 20px; cursor: pointer; }
.navbar-title { font-size: 16px; font-weight: 600; color: var(--text-primary); flex: 1; }
.navbar-garage { font-size: 12px; color: var(--text-muted); }

.navbar-actions { display: flex; align-items: center; gap: 8px; }

.navbar-icon-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 16px;
  cursor: pointer; transition: var(--transition);
}
.navbar-icon-btn:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }

.user-nav-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px 6px 8px;
  cursor: pointer; transition: var(--transition);
}
.user-nav-btn:hover { background: rgba(255,255,255,.09); }

.user-avatar-nav {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card-dark {
  background: rgba(20,28,46,.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.card-dark:hover { border-color: var(--border-light); }
.card-dark .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-dark .card-body { padding: 20px; }
.card-dark .card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: rgba(20,28,46,.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: var(--transition);
  cursor: default;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  opacity: 0; transition: opacity .3s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-light); box-shadow: var(--shadow-card); }
.stat-card:hover::after { opacity: 1; }

.stat-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-icon.blue   { background: rgba(37,99,235,.15); color: var(--color-primary); }
.stat-icon.green  { background: rgba(16,185,129,.15); color: var(--success); }
.stat-icon.amber  { background: rgba(245,158,11,.15); color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,.15);  color: var(--danger); }
.stat-icon.purple { background: rgba(139,92,246,.15); color: #8b5cf6; }
.stat-icon.teal   { background: rgba(20,184,166,.15); color: #14b8a6; }

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.stat-trend { font-size: 11px; margin-top: 6px; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--color-primary);
  color: white; border: none;
  padding: 9px 20px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary-custom:hover { background: var(--color-primary-h); box-shadow: var(--shadow-glow); color: white; }

.btn-accent {
  background: var(--color-accent); color: #0a0e1a; border: none;
  padding: 9px 20px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-accent:hover { background: var(--color-accent-h); color: #0a0e1a; transform: translateY(-1px); }

.btn-ghost {
  background: rgba(255,255,255,.05);
  color: var(--text-secondary); border: 1px solid var(--border);
  padding: 8px 18px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 400;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { background: rgba(255,255,255,.09); color: var(--text-primary); border-color: var(--border-light); }

.btn-danger-custom {
  background: rgba(239,68,68,.15); color: var(--danger);
  border: 1px solid rgba(239,68,68,.3);
  padding: 8px 18px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger-custom:hover { background: var(--danger); color: white; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-control-dark, .form-select-dark,
.form-control, .form-select {
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-xs) !important;
  font-size: 13.5px;
  padding: 9px 12px;
  transition: var(--transition);
}
.form-control::placeholder { color: var(--text-muted) !important; }
.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,.07) !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-primary-glow) !important;
  outline: none;
}
.form-label { color: var(--text-secondary); font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.form-select option { background: var(--bg-secondary); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-dark-custom {
  color: var(--text-primary);
  border-collapse: separate; border-spacing: 0;
  width: 100%;
}
.table-dark-custom thead th {
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 11px;
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 16px; white-space: nowrap;
}
.table-dark-custom tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,41,59,.6);
  font-size: 13.5px; vertical-align: middle;
}
.table-dark-custom tbody tr { transition: background .15s; }
.table-dark-custom tbody tr:hover { background: rgba(255,255,255,.03); }
.table-dark-custom tbody tr:last-child td { border-bottom: none; }

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.status-vehicle_received  { background: rgba(59,130,246,.15); color: #60a5fa; }
.status-vehicle_received::before { background: #60a5fa; }
.status-inspection_started{ background: rgba(139,92,246,.15); color: #a78bfa; }
.status-inspection_started::before { background: #a78bfa; }
.status-diagnosis_done    { background: rgba(20,184,166,.15); color: #2dd4bf; }
.status-diagnosis_done::before { background: #2dd4bf; }
.status-estimate_prepared { background: rgba(245,158,11,.15); color: #fbbf24; }
.status-estimate_prepared::before { background: #fbbf24; }
.status-approval_pending  { background: rgba(239,68,68,.15); color: #f87171; }
.status-approval_pending::before { background: #f87171; animation: pulse-dot 1.5s infinite; }
.status-work_in_progress  { background: rgba(37,99,235,.15); color: #60a5fa; }
.status-work_in_progress::before { background: #60a5fa; animation: pulse-dot 1.5s infinite; }
.status-on_hold           { background: rgba(107,114,128,.15); color: #9ca3af; }
.status-on_hold::before { background: #9ca3af; }
.status-final_inspection  { background: rgba(16,185,129,.15); color: #34d399; }
.status-final_inspection::before { background: #34d399; }
.status-ready_for_delivery{ background: rgba(16,185,129,.25); color: #10b981; }
.status-ready_for_delivery::before { background: #10b981; }
.status-delivered         { background: rgba(16,185,129,.1); color: #6ee7b7; }
.status-delivered::before { background: #6ee7b7; }
.status-closed            { background: rgba(100,116,139,.12); color: #94a3b8; }
.status-closed::before { background: #94a3b8; }

/* Priority badges */
.priority-badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.priority-low    { background: rgba(16,185,129,.1); color: var(--success); }
.priority-medium { background: rgba(245,158,11,.1); color: var(--warning); }
.priority-high   { background: rgba(239,68,68,.1); color: var(--danger); }
.priority-urgent { background: rgba(239,68,68,.25); color: var(--danger); animation: pulse-glow 1.5s infinite; }

/* ── Job Status Timeline ─────────────────────────────────────── */
.status-timeline {
  display: flex; align-items: flex-start;
  gap: 0; overflow-x: auto; padding-bottom: 8px;
}
.status-step {
  flex: 1; min-width: 70px;
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.status-step::before {
  content: ''; position: absolute;
  top: 14px; left: 50%; right: -50%;
  height: 2px; background: var(--border);
}
.status-step:last-child::before { display: none; }
.status-step.done::before { background: var(--color-primary); }

.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
  position: relative; z-index: 1; transition: var(--transition);
}
.status-step.done .step-dot    { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.status-step.current .step-dot { background: var(--color-accent); border-color: var(--color-accent); color: #0a0e1a; box-shadow: 0 0 12px rgba(245,158,11,.4); }
.step-label { font-size: 9px; color: var(--text-muted); text-align: center; margin-top: 6px; font-weight: 500; line-height: 1.2; }
.status-step.done .step-label    { color: var(--color-primary); }
.status-step.current .step-label { color: var(--color-accent); font-weight: 600; }

/* ── Subscription Banner ─────────────────────────────────────── */
.subscription-banner {
  padding: 10px 24px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-top: var(--navbar-h);
}
.subscription-banner.danger  { background: rgba(239,68,68,.12); border-bottom: 1px solid rgba(239,68,68,.25); color: #f87171; }
.subscription-banner.warning { background: rgba(245,158,11,.1); border-bottom: 1px solid rgba(245,158,11,.2); color: #fbbf24; }
.subscription-banner.info    { background: rgba(37,99,235,.1); border-bottom: 1px solid rgba(37,99,235,.2); color: #60a5fa; }
.subscription-banner + .page-content { margin-top: 0; }

/* ── Auth Layout ─────────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative; overflow: hidden;
  transition: background-color 0.4s ease;
}
.auth-layout::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(59, 130, 246, 0.1), transparent),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(245, 158, 11, 0.05), transparent);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(14, 18, 32, 0.85); /* Premium carbon glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 40px 36px;
  position: relative; z-index: 1;
  box-shadow: 0 16px 48px rgba(0,0,0,.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-circle {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--color-primary), #1e40af);
  border-radius: var(--radius);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: white;
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.4);
}
.auth-logo h1 { font-size: 22px; font-weight: 700; margin: 0; color: var(--text-primary); }
.auth-logo p  { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* Light Mode Overrides for Auth Layout and Card */
[data-theme="light"] .auth-layout {
  background: #f1f5f9;
}
[data-theme="light"] .auth-layout::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(37,99,235,0.06), transparent),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(245,158,11,0.04), transparent);
}
[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .auth-logo h1 {
  color: #0f172a !important;
}
[data-theme="light"] .auth-logo p {
  color: #4b5563 !important;
}
[data-theme="light"] .auth-card .form-label {
  color: #334155 !important;
  font-weight: 650;
}
[data-theme="light"] .auth-card .input-group-text {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #4b5563 !important;
}
[data-theme="light"] .auth-card .form-control {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
[data-theme="light"] .auth-card .form-control:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15) !important;
}
[data-theme="light"] .auth-card .text-muted {
  color: #4b5563 !important; /* Full contrast slate-black text in Light Mode */
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm) !important;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(16,185,129,.12) !important; border-color: rgba(16,185,129,.25) !important; color: #34d399 !important; }
.alert-danger  { background: rgba(239,68,68,.12)  !important; border-color: rgba(239,68,68,.25)  !important; color: #f87171 !important; }
.alert-warning { background: rgba(245,158,11,.1)  !important; border-color: rgba(245,158,11,.2)  !important; color: #fbbf24 !important; }
.alert-info    { background: rgba(37,99,235,.1)   !important; border-color: rgba(37,99,235,.2)   !important; color: #60a5fa !important; }
.btn-close { filter: invert(1) opacity(.6); }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
  position: relative;
  z-index: 10;
}
.page-header h1 { font-size: 22px; font-weight: 700; margin: 0; }
.page-header .sub { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

/* ── AI Response ─────────────────────────────────────────────── */
#aiContainer {
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: var(--radius);
  padding: 20px; margin-top: 16px;
}
.ai-response { font-size: 13.5px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; }
.ai-disclaimer { font-size: 11px; color: var(--text-muted); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }

/* ── Voice Recorder ──────────────────────────────────────────── */
#recordBtn {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(239,68,68,.15);
  border: 2px solid rgba(239,68,68,.4);
  color: var(--danger); font-size: 28px;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
#recordBtn:hover { background: rgba(239,68,68,.25); transform: scale(1.05); }
#recordBtn.recording {
  background: var(--danger); color: white;
  box-shadow: 0 0 0 0 rgba(239,68,68,.4);
  animation: recording-pulse 1.5s infinite;
}

/* ── Loading & Spinners ──────────────────────────────────────── */
.spinner-custom {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--color-primary);
  animation: spin .7s linear infinite;
  display: inline-block;
}

.skeleton-loader {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,.04) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-xs);
}

/* ── Breadcrumbs ─────────────────────────────────────────────── */
.breadcrumb { background: none; margin-bottom: 16px; padding: 0; }
.breadcrumb-item a { color: var(--text-muted); font-size: 12.5px; }
.breadcrumb-item.active { color: var(--text-secondary); font-size: 12.5px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ── Brand Tags ──────────────────────────────────────────────── */
.brand-bmw       { background: rgba(28,105,212,.15); color: #5b9bf5; }
.brand-mercedes  { background: rgba(180,180,180,.12); color: #c0c0c0; }
.brand-audi      { background: rgba(187,10,33,.15);  color: #f87171; }
.brand-porsche   { background: rgba(213,0,28,.15);   color: #f87171; }
.brand-vw        { background: rgba(26,92,161,.15);  color: #60a5fa; }
.brand-tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary);
}
.modal-header { border-bottom: 1px solid var(--border) !important; }
.modal-footer { border-top: 1px solid var(--border) !important; }
.modal-title  { font-size: 15px; font-weight: 600; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination .page-link {
  background: rgba(255,255,255,.05); border-color: var(--border);
  color: var(--text-secondary); font-size: 13px;
}
.pagination .page-link:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }
.pagination .page-item.active .page-link { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.pagination .page-item.disabled .page-link { background: transparent; color: var(--text-muted); }

/* ── Keyframe Animations ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-primary-glow); }
  50%       { box-shadow: 0 0 12px 3px var(--color-primary-glow); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
@keyframes recording-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  100% { box-shadow: 0 0 0 16px rgba(239,68,68,0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-in { animation: fadeInUp .35s ease both; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }
  .sidebar.sidebar-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .main-content { margin-left: 0; }
  .top-navbar   { left: 0; }
  .navbar-toggle { display: flex; }
  .page-content { padding: 16px; }
}

@media (max-width: 575.98px) {
  .stat-value { font-size: 22px; }
  .page-header h1 { font-size: 18px; }
  .auth-card { padding: 28px 20px; }
}
