/* ============================================================
   ACE AUTOCENTRE — DESIGN SYSTEM v4
   Premium industrial / automotive · dark + light themes
   ============================================================ */

/* -------- THEME TOKENS -------- */
[data-theme="dark"], :root {
    --bg-base: #060709;
    --bg-app: #0b0d11;
    --bg-surface: #13161c;
    --bg-surface-2: #1c2028;
    --bg-surface-3: #252a34;
    --bg-elevated: #323845;
    --bg-hover: rgba(255,255,255,0.04);
    --bg-subtle: rgba(255,255,255,0.02);
    --text-primary: #eef0f5;
    --text-secondary: #cdd1db;
    --text-tertiary: #9aa0ae;
    --text-muted: #6b7385;
    --text-faint: #4a5161;
    --line: rgba(255,255,255,0.06);
    --line-strong: rgba(255,255,255,0.1);
    --line-accent: rgba(245,147,33,0.25);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 48px rgba(0,0,0,0.6);
    --topbar-bg: rgba(11,13,17,0.85);
    --overlay-bg: rgba(6,7,9,0.75);
    --blue-bg: rgba(96,165,250,0.12); --blue-fg: #60a5fa;
    --green-bg: rgba(52,211,153,0.12); --green-fg: #34d399;
    --amber-bg: rgba(251,191,36,0.12); --amber-fg: #fbbf24;
    --red-bg: rgba(248,113,113,0.12); --red-fg: #f87171;
    --purple-bg: rgba(168,85,247,0.12); --purple-fg: #c084fc;
    --pink-bg: rgba(244,114,182,0.12); --pink-fg: #f472b6;
    --teal-bg: rgba(45,212,191,0.12); --teal-fg: #2dd4bf;
}

[data-theme="light"] {
    --bg-base: #f8f9fb;
    --bg-app: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-2: #f4f5f8;
    --bg-surface-3: #e8eaf0;
    --bg-elevated: #ffffff;
    --bg-hover: rgba(0,0,0,0.03);
    --bg-subtle: rgba(0,0,0,0.015);
    --text-primary: #0b0d11;
    --text-secondary: #323845;
    --text-tertiary: #4a5161;
    --text-muted: #6b7385;
    --text-faint: #9aa0ae;
    --line: rgba(0,0,0,0.08);
    --line-strong: rgba(0,0,0,0.12);
    --line-accent: rgba(199,116,14,0.3);
    --shadow-sm: 0 1px 2px rgba(10,14,20,0.05);
    --shadow-md: 0 4px 16px rgba(10,14,20,0.08);
    --shadow-lg: 0 20px 48px rgba(10,14,20,0.15);
    --topbar-bg: rgba(255,255,255,0.85);
    --overlay-bg: rgba(248,249,251,0.7);
    --blue-bg: rgba(37,99,235,0.1); --blue-fg: #2563eb;
    --green-bg: rgba(5,150,105,0.1); --green-fg: #059669;
    --amber-bg: rgba(217,119,6,0.1); --amber-fg: #d97706;
    --red-bg: rgba(220,38,38,0.1); --red-fg: #dc2626;
    --purple-bg: rgba(147,51,234,0.1); --purple-fg: #9333ea;
    --pink-bg: rgba(219,39,119,0.1); --pink-fg: #db2777;
    --teal-bg: rgba(13,148,136,0.1); --teal-fg: #0d9488;
}

/* -------- CONSTANTS -------- */
:root {
    --amber-500: #f59321;
    --amber-400: #ffb34d;
    --amber-600: #c7740e;
    --amber-700: #9a5809;
    --font-display: 'Fraunces', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snap: cubic-bezier(0.4, 0.0, 0.2, 1);
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* -------- RESET -------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    font-feature-settings: 'ss01', 'cv11';
    -webkit-tap-highlight-color: transparent;
    transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
[data-theme="dark"] body {
    background-image: radial-gradient(ellipse 80% 60% at 15% 0%, rgba(245,147,33,0.04), transparent 60%), radial-gradient(ellipse 80% 60% at 85% 100%, rgba(96,165,250,0.03), transparent 60%);
    background-attachment: fixed;
}
[data-theme="light"] body {
    background-image: radial-gradient(ellipse 80% 60% at 15% 0%, rgba(245,147,33,0.05), transparent 60%);
    background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-surface-3); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-elevated); background-clip: padding-box; }

/* -------- LAYOUT -------- */
.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--bg-app);
    border-right: 1px solid var(--line);
    padding: 24px 0 0;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex; flex-direction: column;
    transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out), transform 0.3s var(--ease-snap);
    z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 24px 24px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.brand-logo {
    width: 42px; height: 42px; border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--amber-400) 0%, var(--amber-500) 55%, var(--amber-600) 100%);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 600; font-size: 22px;
    color: #1a0f00;
    letter-spacing: -0.03em;
    position: relative; overflow: hidden;
    box-shadow: 0 2px 8px rgba(245,147,33,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
    animation: brandPulse 4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes brandPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(245,147,33,0.25), inset 0 1px 0 rgba(255,255,255,0.3); }
    50% { box-shadow: 0 2px 16px rgba(245,147,33,0.4), inset 0 1px 0 rgba(255,255,255,0.3); }
}
.brand-logo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 60%); }
.brand-text h1 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; line-height: 1.1; }
.brand-text span { font-family: var(--font-mono); font-size: 9.5px; color: var(--amber-500); text-transform: uppercase; letter-spacing: 0.2em; margin-top: 3px; font-weight: 600; display: block; }

.nav-section { padding: 0 12px; margin-bottom: 18px; }
.nav-section-title { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.2em; font-weight: 700; padding: 0 12px 8px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: all 0.2s var(--ease-out);
    position: relative; margin-bottom: 2px; overflow: hidden;
}
.nav-item::before { content: ''; position: absolute; left: 0; top: 50%; transform: translate(-100%, -50%); width: 3px; height: 18px; background: var(--amber-500); border-radius: 0 2px 2px 0; transition: transform 0.3s var(--ease-elastic); }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(90deg, rgba(245,147,33,0.08), transparent); color: var(--text-primary); }
.nav-item.active::before { transform: translate(-3px, -50%); }
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; transition: transform 0.3s var(--ease-out); }
.nav-item:hover .icon { transform: scale(1.1) rotate(-3deg); }
.nav-item.active .icon { color: var(--amber-500); }
.nav-item span.label { flex: 1; }
.nav-item .badge-count { background: var(--amber-500); color: #1a0f00; font-size: 10px; font-weight: 700; font-family: var(--font-mono); padding: 2px 7px; border-radius: var(--r-full); min-width: 20px; text-align: center; }

.user-card { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: var(--bg-subtle); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #1a0f00;
    flex-shrink: 0;
    position: relative;
}
.avatar.has-presence::after {
    content: ''; position: absolute; bottom: -1px; right: -1px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--green-fg);
    border: 2px solid var(--bg-app);
}
.avatar.presence-away::after { background: var(--amber-fg); }
.avatar.presence-offline::after { background: var(--text-faint); }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-role { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }

/* -------- MAIN + TOPBAR -------- */
.main { min-width: 0; }
.topbar {
    background: var(--topbar-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--line);
    padding: 14px 32px;
    display: flex; align-items: center; gap: 20px;
    position: sticky; top: 0; z-index: 20;
}
.page-title { flex: 1; min-width: 0; }
.page-title small { font-family: var(--font-mono); font-size: 10px; color: var(--amber-500); text-transform: uppercase; letter-spacing: 0.22em; font-weight: 700; display: block; margin-bottom: 2px; }
.page-title strong, .page-title > span { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.cmd-trigger {
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 12.5px;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-family: var(--font-sans);
    min-width: 240px;
}
.cmd-trigger:hover { border-color: var(--line-strong); background: var(--bg-surface-2); color: var(--text-tertiary); }
.cmd-trigger .icon { width: 14px; height: 14px; flex-shrink: 0; }
.cmd-trigger .label { flex: 1; text-align: left; }
.cmd-trigger .kbd { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line); font-weight: 600; }

.icon-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--line); background: transparent;
    border-radius: var(--r-sm); color: var(--text-secondary);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s var(--ease-out); position: relative;
    text-decoration: none;
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--line-strong); color: var(--text-primary); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 17px; height: 17px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: var(--amber-500); border-radius: 50%; border: 2px solid var(--bg-app); animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,147,33,0.6); } 50% { box-shadow: 0 0 0 5px rgba(245,147,33,0); } }

.theme-toggle { position: relative; width: 56px; height: 30px; border-radius: var(--r-full); background: var(--bg-surface-3); border: 1px solid var(--line); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--line-strong); }
.theme-toggle-knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--amber-400), var(--amber-600)); transition: transform 0.4s var(--ease-elastic); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.theme-toggle-knob svg { width: 12px; height: 12px; color: #1a0f00; stroke-width: 2.5; fill: none; stroke: currentColor; }
[data-theme="light"] .theme-toggle-knob { transform: translateX(26px); }

/* -------- CONTENT -------- */
.content { padding: 32px; max-width: 1400px; animation: fadeUp 0.5s var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.eyebrow { font-family: var(--font-mono); font-size: 10px; color: var(--amber-500); text-transform: uppercase; letter-spacing: 0.25em; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--amber-500); }
.page-head h1 { font-family: var(--font-display); font-size: 2.75rem; font-weight: 500; line-height: 1.05; letter-spacing: -0.03em; color: var(--text-primary); }
.page-head h1 em { font-style: italic; color: var(--amber-500); font-weight: 400; }
.page-head p { color: var(--text-tertiary); font-size: 14px; margin-top: 12px; max-width: 600px; line-height: 1.6; }

/* -------- ICONS -------- */
.icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.75; fill: none; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* -------- BUTTONS -------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid transparent; font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s var(--ease-out); text-decoration: none; line-height: 1; white-space: nowrap; position: relative; overflow: hidden; }
.btn .icon { width: 15px; height: 15px; stroke-width: 2; }
.btn-primary { background: linear-gradient(180deg, var(--amber-400), var(--amber-500)); color: #1a0f00; box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.15); }
.btn-primary:hover { background: linear-gradient(180deg, #ffc467, var(--amber-400)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 8px rgba(245,147,33,0.25), 0 0 0 4px rgba(245,147,33,0.1); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transition: left 0.6s var(--ease-out); }
.btn-primary:hover::after { left: 100%; }
.btn-secondary { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-faint); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-danger { background: var(--red-bg); color: var(--red-fg); border-color: rgba(248,113,113,0.25); }
.btn-danger:hover { background: rgba(248,113,113,0.18); }
.btn-lg { padding: 12px 22px; font-size: 13.5px; }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }
.btn-sm .icon { width: 13px; height: 13px; }

/* -------- CARDS -------- */
.card { background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; transition: all 0.3s var(--ease-out); position: relative; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); pointer-events: none; }
.card:hover { border-color: var(--line-strong); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-head h3 { font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; }
.card-head .meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-head .meta.live::before { content: ''; width: 6px; height: 6px; background: var(--green-fg); border-radius: 50%; animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.card-body { padding: 20px; }

/* -------- HERO METRICS (with sparklines) -------- */
.hero-metrics, .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric, .stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 20px;
    position: relative; overflow: hidden;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
}
.metric::before, .stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.metric:hover, .stat-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.metric.is-featured, .stat-card.is-featured {
    background: linear-gradient(135deg, rgba(245,147,33,0.05), var(--bg-surface));
    border-color: rgba(245,147,33,0.18);
}
.metric.is-featured::after, .stat-card.is-featured::after {
    content: ''; position: absolute; right: -50px; top: -50px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(245,147,33,0.12), transparent 70%);
    pointer-events: none;
    animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.7; } }

.metric-head, .stat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.metric-label, .stat-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; }
.metric-icon, .stat-icon { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--bg-surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); transition: all 0.3s var(--ease-out); }
.metric-icon .icon, .stat-icon .icon { width: 16px; height: 16px; }
.metric.is-featured .metric-icon, .stat-card.is-featured .stat-icon { background: rgba(245,147,33,0.12); color: var(--amber-500); }
.metric:hover .metric-icon, .stat-card:hover .stat-icon { transform: rotate(-6deg) scale(1.05); }
.metric-value, .stat-value { font-family: var(--font-display); font-size: 2.4rem; font-weight: 500; letter-spacing: -0.035em; line-height: 1; color: var(--text-primary); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.metric.is-featured .metric-value, .stat-card.is-featured .stat-value { color: var(--amber-500); }
.metric-sparkline, .stat-sparkline { height: 32px; margin-bottom: 10px; position: relative; z-index: 1; }
.metric-sparkline svg, .stat-sparkline svg { width: 100%; height: 100%; display: block; overflow: visible; }
.metric-footer, .stat-meta { font-size: 12px; color: var(--text-tertiary); display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }

.trend { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 4px; }
.trend .icon { width: 10px; height: 10px; stroke-width: 2.5; }
.trend-up, .stat-trend.up { background: var(--green-bg); color: var(--green-fg); }
.trend-down, .stat-trend.down { background: var(--red-bg); color: var(--red-fg); }
.trend-neutral { background: var(--bg-hover); color: var(--text-tertiary); }

/* -------- PULSE STRIP -------- */
.pulse-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 24px; }
.pulse { background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; transition: all 0.25s var(--ease-out); text-decoration: none; color: inherit; display: flex; align-items: center; gap: 12px; }
.pulse:hover { border-color: var(--line-accent); background: var(--bg-surface-2); transform: translateY(-1px); }
.pulse-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.3s var(--ease-elastic); }
.pulse:hover .pulse-icon { transform: scale(1.1) rotate(-4deg); }
.pulse-icon .icon { width: 16px; height: 16px; }
.pulse-meta { display: flex; flex-direction: column; min-width: 0; }
.pulse-label { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; margin-bottom: 2px; }
.pulse-value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.ic-blue { background: var(--blue-bg); color: var(--blue-fg); }
.ic-amber { background: var(--amber-bg); color: var(--amber-fg); }
.ic-green { background: var(--green-bg); color: var(--green-fg); }
.ic-purple { background: var(--purple-bg); color: var(--purple-fg); }
.ic-red { background: var(--red-bg); color: var(--red-fg); }
.ic-teal { background: var(--teal-bg); color: var(--teal-fg); }
.ic-pink { background: var(--pink-bg); color: var(--pink-fg); }

/* -------- TABLES -------- */
.table-wrap, .table-container { background: var(--bg-surface); overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg-surface-2); padding: 10px 16px; text-align: left; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
tbody td { padding: 14px 16px; font-size: 13px; color: var(--text-primary); border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; cursor: pointer; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr.selected { background: var(--amber-bg); }
tbody tr.selected td { box-shadow: inset 3px 0 0 var(--amber-500); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Row checkbox for bulk actions */
.row-check { width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 3px; background: transparent; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; }
.row-check.checked { background: var(--amber-500); border-color: var(--amber-500); }
.row-check.checked::after { content: '✓'; color: #1a0f00; font-size: 11px; font-weight: 700; }

/* -------- BADGES & CHIPS -------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-xs); font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; line-height: 1; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-dot { display: none; }
.badge-green, .badge-emerald, .badge-success { background: var(--green-bg); color: var(--green-fg); }
.badge-amber, .badge-warn, .badge-warning { background: var(--amber-bg); color: var(--amber-fg); }
.badge-red, .badge-danger { background: var(--red-bg); color: var(--red-fg); }
.badge-blue, .badge-info { background: var(--blue-bg); color: var(--blue-fg); }
.badge-purple { background: var(--purple-bg); color: var(--purple-fg); }
.badge-pink { background: var(--pink-bg); color: var(--pink-fg); }
.badge-teal { background: var(--teal-bg); color: var(--teal-fg); }
.badge-neutral, .badge-slate, .badge-gray { background: var(--bg-hover); color: var(--text-tertiary); border-color: var(--line-strong); }

.priority { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--r-xs); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; line-height: 1; }
.priority svg { width: 9px; height: 9px; fill: currentColor; }
.priority-vip { background: var(--purple-bg); color: var(--purple-fg); }
.priority-urgent { background: var(--red-bg); color: var(--red-fg); }
.priority-high { background: var(--amber-bg); color: var(--amber-fg); }
.priority-normal { background: var(--bg-hover); color: var(--text-tertiary); }
.priority-low { background: var(--bg-hover); color: var(--text-faint); }

.reg-plate { display: inline-block; font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; padding: 3px 9px; background: linear-gradient(180deg, rgba(245,147,33,0.06), rgba(245,147,33,0.03)); color: var(--amber-500); border-radius: var(--r-xs); border: 1px solid rgba(245,147,33,0.2); letter-spacing: 0.05em; cursor: pointer; }
.reg-plate:hover { background: rgba(245,147,33,0.1); }

/* -------- FORMS -------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea {
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13.5px;
    transition: all 0.2s var(--ease-out);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--amber-500);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(245,147,33,0.12);
}
textarea { resize: vertical; min-height: 72px; font-family: var(--font-sans); }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.section-title { font-family: var(--font-mono); font-size: 10px; color: var(--amber-500); text-transform: uppercase; letter-spacing: 0.22em; font-weight: 700; margin: 20px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* -------- TIMELINE -------- */
.timeline { padding: 8px 20px; }
.timeline-item { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); animation: slideIn 0.4s var(--ease-out) backwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.timeline-item:last-child { border-bottom: none; }
.timeline-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); min-width: 54px; padding-top: 3px; font-weight: 600; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber-500); margin-top: 6px; flex-shrink: 0; border: 2px solid var(--bg-surface); box-shadow: 0 0 0 3px var(--amber-bg); }
.timeline-dot.blue { background: var(--blue-fg); box-shadow: 0 0 0 3px var(--blue-bg); }
.timeline-dot.green { background: var(--green-fg); box-shadow: 0 0 0 3px var(--green-bg); }
.timeline-dot.red { background: var(--red-fg); box-shadow: 0 0 0 3px var(--red-bg); }
.timeline-dot.purple { background: var(--purple-fg); box-shadow: 0 0 0 3px var(--purple-bg); }
.timeline-body { flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.timeline-body strong { color: var(--text-primary); font-weight: 600; }

/* -------- STAGE STEPPER -------- */
.stepper { display: flex; align-items: center; gap: 0; padding: 16px 20px; overflow-x: auto; }
.step { display: flex; align-items: center; flex-shrink: 0; }
.step-circle { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; transition: all 0.3s var(--ease-out); flex-shrink: 0; }
.step.done .step-circle { background: var(--green-fg); color: var(--bg-app); }
.step.done .step-circle::after { content: '✓'; font-family: var(--font-sans); font-weight: 700; font-size: 13px; }
.step.done .step-circle-num { display: none; }
.step.current .step-circle { background: var(--amber-500); color: #1a0f00; box-shadow: 0 0 0 4px rgba(245,147,33,0.2); animation: stepPulse 2s ease-in-out infinite; }
@keyframes stepPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(245,147,33,0.2); } 50% { box-shadow: 0 0 0 8px rgba(245,147,33,0.1); } }
.step.pending .step-circle { background: var(--bg-surface-3); color: var(--text-muted); border: 1px solid var(--line-strong); }
.step-label { margin-left: 8px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.step.done .step-label { color: var(--text-secondary); }
.step.current .step-label { color: var(--text-primary); font-weight: 600; }
.step.pending .step-label { color: var(--text-muted); }
.step-line { flex: 1; height: 2px; margin: 0 12px; min-width: 24px; background: var(--bg-surface-3); border-radius: 1px; position: relative; overflow: hidden; }
.step-line.done { background: var(--green-fg); }
.step-line.active::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--green-fg) 0%, var(--amber-500) 100%); animation: lineFlow 2s linear infinite; }
@keyframes lineFlow { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* -------- STACKED BAR -------- */
.stacked-bar { display: flex; height: 32px; border-radius: var(--r-sm); overflow: hidden; margin-bottom: 14px; background: var(--bg-surface-2); }
.stacked-seg { transition: flex 0.5s var(--ease-out); position: relative; cursor: pointer; }
.stacked-seg:hover { filter: brightness(1.2); }
.stacked-seg + .stacked-seg { border-left: 2px solid var(--bg-surface); }
.stacked-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-label { color: var(--text-secondary); flex: 1; }
.legend-value { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

/* -------- RING GAUGE -------- */
.ring-gauge-card { display: flex; align-items: center; gap: 20px; }
.ring-gauge { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.ring-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-gauge circle.track { fill: none; stroke: var(--bg-surface-3); stroke-width: 10; }
.ring-gauge circle.progress { fill: none; stroke: var(--amber-500); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-value { font-family: var(--font-display); font-size: 2rem; font-weight: 500; color: var(--text-primary); line-height: 1; }
.ring-label { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; margin-top: 4px; }
.ring-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.ring-stat { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.ring-stat-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ring-stat-label { flex: 1; color: var(--text-secondary); }
.ring-stat-value { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

/* -------- ACTIVITY HEATMAP -------- */
.heatmap { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; padding: 16px 20px; overflow-x: auto; }
.heatmap-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--bg-surface-3); transition: transform 0.15s; cursor: pointer; }
.heatmap-cell:hover { transform: scale(1.4); }
.heatmap-cell.l1 { background: rgba(245,147,33,0.2); }
.heatmap-cell.l2 { background: rgba(245,147,33,0.4); }
.heatmap-cell.l3 { background: rgba(245,147,33,0.7); }
.heatmap-cell.l4 { background: var(--amber-500); }

/* -------- GRID LAYOUTS -------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flex { display: flex; }
.flex.gap-1 { gap: 4px; } .flex.gap-2 { gap: 8px; } .flex.gap-3 { gap: 12px; } .flex.gap-4 { gap: 16px; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.w-full { width: 100%; }

/* -------- EMPTY STATES -------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.empty-state .icon { width: 32px; height: 32px; stroke-width: 1.5; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-surface-3)); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); margin-bottom: 16px; position: relative; animation: emptyFloat 4s ease-in-out infinite; }
@keyframes emptyFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.empty-icon::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 50px; height: 6px; border-radius: 50%; background: rgba(0,0,0,0.2); filter: blur(4px); animation: shadowBreathe 4s ease-in-out infinite; }
@keyframes shadowBreathe { 0%, 100% { opacity: 0.4; width: 50px; } 50% { opacity: 0.2; width: 40px; } }
.empty-title, .empty-state h3 { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.empty-desc, .empty-state p { font-size: 13px; color: var(--text-tertiary); line-height: 1.6; max-width: 320px; margin-bottom: 20px; }

/* -------- SKELETONS -------- */
.skeleton { background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface-3) 50%, var(--bg-surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-xs); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-line { height: 12px; margin-bottom: 8px; }
.sk-line:last-child { margin-bottom: 0; }
.sk-circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.sk-rect { border-radius: var(--r-sm); }

/* -------- COMMAND PALETTE -------- */
.cmd-overlay { position: fixed; inset: 0; background: var(--overlay-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 1000; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: overlayFade 0.2s var(--ease-out); }
.cmd-overlay.open { display: flex; }
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
.cmd-panel { width: 100%; max-width: 600px; background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: cmdIn 0.3s var(--ease-out); margin: 0 16px; }
@keyframes cmdIn { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: none; } }
.cmd-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmd-input-wrap .icon { width: 18px; height: 18px; color: var(--text-muted); stroke-width: 2; flex-shrink: 0; }
.cmd-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-family: var(--font-sans); font-size: 15px; font-weight: 400; padding: 0; }
.cmd-input::placeholder { color: var(--text-muted); }
.cmd-input:focus { box-shadow: none; }
.cmd-esc { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--bg-hover); padding: 3px 7px; border-radius: 3px; border: 1px solid var(--line); font-weight: 600; }
.cmd-results { max-height: 440px; overflow-y: auto; padding: 8px; }
.cmd-section-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; padding: 10px 12px 6px; }
.cmd-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; transition: background 0.12s; user-select: none; text-decoration: none; color: inherit; }
.cmd-item.selected { background: var(--bg-surface-2); }
.cmd-item.selected .cmd-item-arrow { opacity: 1; transform: translateX(0); }
.cmd-item-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cmd-item-icon .icon { width: 16px; height: 16px; }
.cmd-item-text { flex: 1; min-width: 0; }
.cmd-item-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.cmd-item-desc { font-size: 11.5px; color: var(--text-tertiary); }
.cmd-item-kbd { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 5px; border-radius: 3px; border: 1px solid var(--line); font-weight: 600; }
.cmd-item-arrow { width: 14px; height: 14px; color: var(--amber-500); opacity: 0; transform: translateX(-4px); transition: all 0.2s var(--ease-out); stroke-width: 2; }
.cmd-footer { padding: 10px 18px; border-top: 1px solid var(--line); display: flex; gap: 18px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--bg-subtle); }
.cmd-footer-item { display: flex; align-items: center; gap: 6px; }
.cmd-footer-kbd { background: var(--bg-hover); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); font-weight: 600; }

/* -------- TOASTS -------- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: 380px; }
.toast { background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; animation: toastIn 0.3s var(--ease-elastic); position: relative; overflow: hidden; max-width: 380px; }
.toast.toast-out { animation: toastOut 0.25s var(--ease-out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(100%); } }
.toast-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon .icon { width: 16px; height: 16px; stroke-width: 2.25; }
.toast.success .toast-icon { background: var(--green-bg); color: var(--green-fg); }
.toast.error .toast-icon { background: var(--red-bg); color: var(--red-fg); }
.toast.warning .toast-icon { background: var(--amber-bg); color: var(--amber-fg); }
.toast.info .toast-icon { background: var(--blue-bg); color: var(--blue-fg); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.toast-message { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; flex-shrink: 0; transition: color 0.15s; }
.toast-close:hover { color: var(--text-primary); }
.toast-close .icon { width: 14px; height: 14px; stroke-width: 2; }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--amber-500); width: 100%; transform-origin: left; animation: toastProgress 7s linear forwards; }
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.success .toast-progress { background: var(--green-fg); }
.toast.error .toast-progress { background: var(--red-fg); }
.toast.warning .toast-progress { background: var(--amber-fg); }
.toast.info .toast-progress { background: var(--blue-fg); }

/* -------- HOVER PREVIEW -------- */
.hover-preview { position: absolute; background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-lg); min-width: 280px; max-width: 360px; z-index: 900; opacity: 0; transform: translateY(4px); transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out); pointer-events: none; font-family: var(--font-sans); }
.hover-preview.show { opacity: 1; transform: none; pointer-events: auto; }
.hover-preview-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hover-preview-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.hover-preview-sub { font-size: 11.5px; color: var(--text-tertiary); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.hover-preview-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; }
.hover-preview-row .label { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.hover-preview-row .value { color: var(--text-primary); font-weight: 500; }

/* -------- BULK ACTION BAR -------- */
.bulk-bar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); z-index: 90; background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 10px 14px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-lg); transition: transform 0.3s var(--ease-elastic); }
.bulk-bar.active { transform: translateX(-50%) translateY(0); }
.bulk-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-primary); font-weight: 600; padding: 4px 10px; background: var(--amber-bg); color: var(--amber-fg); border-radius: var(--r-sm); }
.bulk-actions { display: flex; gap: 6px; border-left: 1px solid var(--line); padding-left: 10px; }

/* -------- ALERTS (compat) -------- */
.alert { padding: 12px 16px; border-radius: var(--r-md); display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; font-size: 13px; line-height: 1.5; border: 1px solid transparent; }
.alert .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg); color: var(--green-fg); border-color: rgba(52,211,153,0.18); }
.alert-danger, .alert-error { background: var(--red-bg); color: var(--red-fg); border-color: rgba(248,113,113,0.18); }
.alert-warn, .alert-warning { background: var(--amber-bg); color: var(--amber-fg); border-color: rgba(251,191,36,0.18); }
.alert-info { background: var(--blue-bg); color: var(--blue-fg); border-color: rgba(96,165,250,0.18); }

/* -------- MOBILE -------- */
.mobile-only { display: none; }
.mobile-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--topbar-bg); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border-top: 1px solid var(--line); padding: 8px 0 max(8px, env(safe-area-inset-bottom)); display: none; grid-template-columns: repeat(5, 1fr); z-index: 50; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; text-decoration: none; color: var(--text-tertiary); font-size: 10px; font-weight: 600; transition: color 0.2s; position: relative; }
.mobile-nav-item .icon { width: 22px; height: 22px; transition: transform 0.3s var(--ease-elastic); }
.mobile-nav-item.active { color: var(--amber-500); }
.mobile-nav-item.active .icon { transform: scale(1.1); }
.mobile-nav-item.active::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 2px; background: var(--amber-500); border-radius: 0 0 2px 2px; }
.mobile-nav-item.fab-slot .icon { display: none; }
.mobile-fab { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--amber-400), var(--amber-500)); color: #1a0f00; display: flex; align-items: center; justify-content: center; margin: -16px auto 0; box-shadow: 0 4px 16px rgba(245,147,33,0.4); border: none; cursor: pointer; }
.mobile-fab .icon { width: 22px; height: 22px; stroke-width: 2.5; display: block; }

@media (max-width: 900px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 0; left: 0; width: 280px; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .mobile-bottom-nav { display: grid; }
    .hero-metrics, .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .metric, .stat-card { padding: 16px; }
    .metric-value, .stat-value { font-size: 2rem; }
    .pulse-row { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content { padding: 20px 16px 100px; }
    .topbar { padding: 10px 16px; gap: 10px; }
    .topbar .cmd-trigger { min-width: 0; flex: 1; }
    .topbar .cmd-trigger .label { display: none; }
    .topbar .theme-toggle { display: none; }
    .page-head h1 { font-size: 1.75rem; }
    .page-title > span, .page-title strong { font-size: 16px; }
    .ring-gauge-card { flex-direction: column; align-items: stretch; }
    .ring-gauge { margin: 0 auto; }
    .card-body { padding: 16px; }
    .card-head { padding: 14px 16px; }
    .mobile-only { display: block; }
    .desktop-only { display: none; }
    table.responsive thead { display: none; }
    table.responsive tbody, table.responsive tr, table.responsive td { display: block; }
    table.responsive tbody tr { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; padding: 12px; background: var(--bg-surface); }
    table.responsive tbody td { border: none; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
    table.responsive tbody td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
    .toast-container { left: 16px; right: 16px; max-width: none; top: 16px; }
    .bulk-bar { left: 16px; right: 16px; transform: translateY(100px); width: auto; }
    .bulk-bar.active { transform: translateY(0); }
    .cmd-panel { margin: 0 8px; }
}

/* -------- PRINT -------- */
@media print {
    .sidebar, .topbar, .mobile-bottom-nav, .toast-container, .bulk-bar, .cmd-overlay { display: none !important; }
    .app-layout { grid-template-columns: 1fr; }
    .content { padding: 0; max-width: none; }
    body { background: white !important; color: black !important; }
    .card { border: 1px solid #ddd !important; box-shadow: none !important; background: white !important; }
    .card-head h3 { color: black !important; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } .no-print { display: none !important; } }

/* ============================================================
   v4 PHASE 2/3 — NOTIFICATION PANEL, HEATMAP, AUDIT, PRINT-DARK
   ============================================================ */

/* NOTIF PANEL */
.notif-panel {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    width: 340px;
    max-height: 480px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: cmdIn 0.25s var(--ease-out);
}
.notif-panel.open { display: flex; }
.notif-list { flex: 1; overflow-y: auto; padding: 4px; }
.notif-item {
    padding: 10px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--line);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; display: flex; align-items: center; }
.notif-msg { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; margin-bottom: 4px; }
.notif-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); letter-spacing: 0.05em; }

/* PRINT-DARK OPTION (opt-in via .print-dark on html/body) */
@media print {
    .print-dark body { background: var(--bg-app) !important; color: var(--text-primary) !important; }
    .print-dark .card, .print-dark .metric, .print-dark .stat-card { background: var(--bg-surface) !important; border-color: var(--line-strong) !important; }
    .print-dark .card-head h3, .print-dark .metric-value, .print-dark .stat-value { color: var(--text-primary) !important; }
}

/* CELEBRATION GLOW */
@keyframes celebrationGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,147,33,0); }
    50% { box-shadow: 0 0 40px 8px rgba(245,147,33,0.35); }
}
.celebration-glow { animation: celebrationGlow 2s ease-in-out 2; }

/* AUDIT TRAIL CARD */
.audit-trail-card { margin-top: 16px; }
.audit-trail-card .timeline-item { padding: 8px 0; }
.audit-trail-card .timeline-time { font-size: 10px; min-width: 58px; }
.audit-trail-card .timeline-body { font-size: 12px; }

/* SAVED VIEWS SIDEBAR ADDITION */
.saved-views-list { padding: 0 12px; }
.saved-view {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px; border-radius: var(--r-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: 12.5px; font-weight: 500;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.15s;
}
.saved-view:hover { background: var(--bg-hover); color: var(--text-primary); }
.saved-view-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--amber-500); flex-shrink: 0; }
.saved-view-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-view-remove { opacity: 0; font-size: 14px; color: var(--text-muted); background: none; border: none; cursor: pointer; }
.saved-view:hover .saved-view-remove { opacity: 1; }

/* CELEBRATION BANNER */
.celebration-banner {
    background: linear-gradient(135deg, rgba(245,147,33,0.12), rgba(245,147,33,0.04));
    border: 1px solid var(--line-accent);
    border-radius: var(--r-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    animation: celebrationIn 0.5s var(--ease-elastic);
}
@keyframes celebrationIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.celebration-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 50%, rgba(245,147,33,0.15), transparent 50%);
    pointer-events: none;
}

/* ============================================================
   v4.1 — CHAT, WORKFLOW TIMELINE, VEHICLE STATUS, GUIDE
   ============================================================ */

/* -------- CHAT MODULE -------- */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 150px);
    min-height: 500px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.chat-sidebar {
    border-right: 1px solid var(--line);
    background: var(--bg-app);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-sidebar > div:first-child {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-surface);
}
.chat-sidebar .eyebrow { margin-bottom: 0; }
.chat-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    position: relative;
}
.chat-user:hover { background: var(--bg-hover); }
.chat-user.active { background: linear-gradient(90deg, rgba(245,147,33,0.08), transparent); }
.chat-user.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--amber-500); }
.chat-user .avatar { width: 36px; height: 36px; font-size: 12px; }
.chat-user > div:nth-child(2) { flex: 1; min-width: 0; }
.chat-user .name, .chat-user div:first-of-type { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-user .preview { font-size: 11.5px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-user .time { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.05em; flex-shrink: 0; align-self: flex-start; }
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green-fg);
    position: absolute; bottom: 12px; left: 38px;
    border: 2px solid var(--bg-app);
}
.chat-main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-surface); }
.chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    flex-shrink: 0;
}
.chat-header .avatar { width: 38px; height: 38px; font-size: 13px; }
.chat-header strong, .chat-header div:nth-child(2) > div:first-child { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--text-primary); }
.chat-header small, .chat-header div:nth-child(2) > div:last-child { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin-top: 2px; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-base);
}
.chat-message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: var(--r-lg);
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: msgIn 0.25s var(--ease-out);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chat-message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    color: #1a0f00;
    border-bottom-right-radius: var(--r-xs);
}
.chat-message.received {
    align-self: flex-start;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--line);
    border-bottom-left-radius: var(--r-xs);
}
.chat-message .time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    opacity: 0.7;
}
.chat-message.sent .time { color: rgba(26,15,0,0.7); }
.chat-message.received .time { color: var(--text-muted); }
.chat-input-bar {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--bg-surface);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.chat-input-bar input, .chat-input-bar textarea {
    flex: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    padding: 9px 16px;
    font-size: 13.5px;
}
.chat-input-bar button { flex-shrink: 0; border-radius: var(--r-full); padding: 9px 18px; }
.chat-user .badge { font-size: 9px; padding: 2px 6px; }

@media (max-width: 900px) {
    .chat-container { grid-template-columns: 1fr; height: calc(100vh - 130px); }
    .chat-sidebar { display: none; }
    .chat-sidebar.show-mobile { display: flex; }
    .chat-main.hidden-mobile { display: none; }
}

/* -------- WORKFLOW TIMELINE (on job card view) -------- */
.workflow-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    position: relative;
}
.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    min-width: 80px;
    z-index: 1;
}
.workflow-step .dot {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-surface-3);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--line-strong);
    transition: all 0.3s var(--ease-out);
    position: relative;
    z-index: 2;
}
.workflow-step .dot .icon { width: 18px; height: 18px; stroke-width: 2; display: block; }
.workflow-step .dot .step-num { display: none; }
.workflow-step .label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.01em;
}
.workflow-step.done .dot {
    background: linear-gradient(135deg, var(--green-fg), #10b981);
    color: white;
    border-color: var(--green-fg);
    box-shadow: 0 2px 8px rgba(52,211,153,0.25);
}
.workflow-step.done .dot .icon { display: none; }
.workflow-step.done .dot::after {
    content: '✓';
    font-size: 18px;
    font-weight: 700;
}
.workflow-step.done .dot .step-num { display: none; }
.workflow-step.done .label { color: var(--text-secondary); }
.workflow-step.active .dot {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: #1a0f00;
    border-color: var(--amber-500);
    transform: scale(1.12);
    box-shadow: 0 0 0 5px rgba(245,147,33,0.18), 0 2px 12px rgba(245,147,33,0.3);
    animation: workflowActivePulse 2.5s ease-in-out infinite;
}
@keyframes workflowActivePulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(245,147,33,0.18), 0 2px 12px rgba(245,147,33,0.3); }
    50% { box-shadow: 0 0 0 10px rgba(245,147,33,0.08), 0 2px 16px rgba(245,147,33,0.45); }
}
.workflow-step.active .label {
    color: var(--amber-500);
    font-weight: 700;
}
.workflow-step.active::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%;
    width: 40px;
    height: 2px;
    background: var(--amber-500);
    transform: translateX(-50%);
    border-radius: 1px;
}
.workflow-timeline .line {
    flex: 1;
    height: 3px;
    background: var(--bg-surface-3);
    margin: 0 -6px;
    position: relative;
    z-index: 1;
    border-radius: 1.5px;
    margin-bottom: 28px;  /* align to dots not labels */
    align-self: flex-start;
    margin-top: 30px;
}
.workflow-timeline .line.done {
    background: linear-gradient(90deg, var(--green-fg), var(--green-fg));
}
.workflow-timeline .line.active {
    background: linear-gradient(90deg, var(--green-fg), var(--amber-500));
    position: relative;
    overflow: hidden;
}
.workflow-timeline .line.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: lineFlowV2 2s linear infinite;
}
@keyframes lineFlowV2 { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* -------- VEHICLE STATUS PILLS -------- */
.veh-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
    white-space: nowrap;
}
.veh-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.veh-status-in-workshop { background: var(--amber-bg); color: var(--amber-fg); }
.veh-status-in-workshop::before { animation: vehPulse 1.8s ease-in-out infinite; }
@keyframes vehPulse { 0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; } 50% { box-shadow: 0 0 0 4px transparent; opacity: 0.5; } }
.veh-status-checked-in { background: var(--blue-bg); color: var(--blue-fg); }
.veh-status-awaiting-lpo { background: var(--pink-bg); color: var(--pink-fg); }
.veh-status-awaiting-inspection { background: var(--purple-bg); color: var(--purple-fg); }
.veh-status-ready { background: var(--green-bg); color: var(--green-fg); }
.veh-status-ready::before { animation: vehPulse 2s ease-in-out infinite; }
.veh-status-checked-out { background: var(--bg-hover); color: var(--text-tertiary); border: 1px solid var(--line-strong); }
.veh-status-available { background: var(--teal-bg); color: var(--teal-fg); }

/* Vehicle fleet summary tiles */
.fleet-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.fleet-tile {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fleet-tile:hover { transform: translateY(-2px); border-color: var(--line-accent); box-shadow: var(--shadow-md); }
.fleet-tile.active-filter { border-color: var(--amber-500); background: linear-gradient(135deg, rgba(245,147,33,0.06), var(--bg-surface)); }
.fleet-tile-label { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.fleet-tile-count { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.fleet-tile.warn .fleet-tile-count { color: var(--amber-500); }

/* Inline progress bar for active jobs (in tables) */
.stage-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.stage-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-surface-3);
    border-radius: 2px;
    overflow: hidden;
    max-width: 100px;
}
.stage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-fg) 0%, var(--amber-500) 100%);
    border-radius: 2px;
    transition: width 0.6s var(--ease-out);
}
.stage-progress-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* -------- GUIDE (silent assistant) -------- */
.guide-card {
    background: linear-gradient(135deg, rgba(96,165,250,0.08), var(--bg-surface));
    border: 1px solid rgba(96,165,250,0.2);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    overflow: hidden;
    animation: guideIn 0.4s var(--ease-out);
}
@keyframes guideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.guide-card.tone-next {
    background: linear-gradient(135deg, rgba(245,147,33,0.06), var(--bg-surface));
    border-color: rgba(245,147,33,0.22);
}
.guide-card.tone-wait {
    background: linear-gradient(135deg, rgba(168,85,247,0.06), var(--bg-surface));
    border-color: rgba(168,85,247,0.2);
}
.guide-card.tone-warn {
    background: linear-gradient(135deg, rgba(251,191,36,0.08), var(--bg-surface));
    border-color: rgba(251,191,36,0.25);
}
.guide-card.tone-done {
    background: linear-gradient(135deg, rgba(52,211,153,0.08), var(--bg-surface));
    border-color: rgba(52,211,153,0.22);
}
.guide-icon {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    background: rgba(96,165,250,0.12);
    color: var(--blue-fg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.guide-icon .icon { width: 18px; height: 18px; }
.guide-card.tone-next .guide-icon { background: rgba(245,147,33,0.12); color: var(--amber-500); }
.guide-card.tone-wait .guide-icon { background: rgba(168,85,247,0.12); color: var(--purple-fg); }
.guide-card.tone-warn .guide-icon { background: rgba(251,191,36,0.14); color: var(--amber-fg); }
.guide-card.tone-done .guide-icon { background: rgba(52,211,153,0.12); color: var(--green-fg); }
.guide-body { flex: 1; min-width: 0; }
.guide-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.guide-card.tone-next .guide-label { color: var(--amber-500); }
.guide-card.tone-wait .guide-label { color: var(--purple-fg); }
.guide-card.tone-warn .guide-label { color: var(--amber-fg); }
.guide-card.tone-done .guide-label { color: var(--green-fg); }
.guide-title { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; letter-spacing: -0.01em; }
.guide-message { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.guide-message strong { color: var(--text-primary); font-weight: 600; }
.guide-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.guide-actions .btn { padding: 6px 12px; font-size: 12px; }
.guide-dismiss { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; align-self: flex-start; transition: color 0.15s; }
.guide-dismiss:hover { color: var(--text-primary); }
.guide-dismiss .icon { width: 14px; height: 14px; }

/* Validation pill (inline warnings on forms) */
.validation-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--amber-bg);
    color: var(--amber-fg);
    border-radius: var(--r-sm);
    font-size: 12px;
    margin-top: 6px;
    animation: guideIn 0.3s var(--ease-out);
}
.validation-hint .icon { width: 14px; height: 14px; }
.validation-hint.tone-ok { background: var(--green-bg); color: var(--green-fg); }
.validation-hint.tone-err { background: var(--red-bg); color: var(--red-fg); }

/* ============================================================
   v4.3 — COMMENTS, LIGHT MODE POLISH, INSPECTION, INVOICE
   ============================================================ */

/* -------- COMMENTS THREAD -------- */
.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 4px;
}
.comment-thread::before {
    content: '';
    display: block;
    height: 1px;
    background: var(--line);
    margin-bottom: 4px;
}
.comment {
    display: flex;
    gap: 12px;
    padding: 14px 4px;
    border-radius: var(--r-md);
    position: relative;
    animation: commentIn 0.3s var(--ease-out);
}
@keyframes commentIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
.comment .avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-fg), var(--purple-fg));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.comment.owner .avatar {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
    color: #1a0f00;
}
.comment-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    position: relative;
}
.comment-content::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 14px;
    width: 14px;
    height: 14px;
    background: var(--bg-surface-2);
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(-45deg);
}
.comment.owner .comment-content {
    background: linear-gradient(135deg, rgba(245,147,33,0.06), var(--bg-surface-2));
    border-color: rgba(245,147,33,0.25);
}
.comment.owner .comment-content::before {
    background: rgba(245,147,33,0.06);
    border-color: rgba(245,147,33,0.25);
}
.comment-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.comment-author {
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.comment-role {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: var(--bg-hover);
    padding: 2px 7px;
    border-radius: var(--r-xs);
    font-weight: 600;
}
.comment.owner .comment-role {
    background: var(--amber-bg);
    color: var(--amber-fg);
}
.comment-time {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.comment-stage {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--purple-fg);
    background: var(--purple-bg);
    padding: 2px 7px;
    border-radius: var(--r-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.comment-body {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    word-wrap: break-word;
}
.comment-body strong { color: var(--text-primary); font-weight: 600; }
.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
.comment-action {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.comment-action:hover { color: var(--amber-500); }
.comment-action .icon { width: 12px; height: 12px; }

/* Reply thread indent */
.comment-replies {
    margin-top: 12px;
    margin-left: 52px;
    padding-left: 14px;
    border-left: 2px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment-replies .comment {
    padding: 8px 0;
}
.comment-replies .comment .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
}
.comment-replies .comment-content::before { top: 10px; }

/* Reply form inline */
.reply-form {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    display: none;
}
.reply-form.open { display: block; animation: commentIn 0.25s var(--ease-out); }
.reply-form textarea {
    width: 100%;
    min-height: 60px;
    font-size: 13px;
    margin-bottom: 8px;
}
.reply-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Comment composer (top of thread) */
.comment-composer {
    background: var(--bg-surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 18px;
}
.comment-composer textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-primary);
    resize: vertical;
    min-height: 72px;
    font-family: var(--font-body);
}
.comment-composer textarea:focus {
    outline: none;
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px rgba(245,147,33,0.1);
}
.comment-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.comment-composer-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* -------- LIGHT MODE REFINEMENTS (warmer, softer) -------- */
html[data-theme="light"] {
    --bg-app: #fafaf7;              /* warm off-white, not harsh #fff */
    --bg-base: #f5f4ef;             /* soft cream base */
    --bg-surface: #ffffff;          /* cards pop against cream */
    --bg-surface-2: #fbfaf5;        /* secondary surface */
    --bg-surface-3: #f0eee6;        /* tertiary */
    --bg-hover: #f7f5ee;            /* gentle hover */
    --bg-subtle: #f9f7f1;           /* subtle surface */

    --text-primary: #1f1d18;        /* warmer black */
    --text-secondary: #3d3a32;      /* warmer dark grey */
    --text-tertiary: #6d6a60;       /* warmer medium grey */
    --text-muted: #8f8b80;          /* softer mute */
    --text-faint: #b8b4a9;          /* faint */

    --line: rgba(120, 110, 90, 0.12);        /* warmer divider */
    --line-strong: rgba(120, 110, 90, 0.22);
    --line-accent: rgba(245, 147, 33, 0.3);

    --shadow-sm: 0 1px 2px rgba(70, 55, 30, 0.05);
    --shadow-md: 0 3px 10px rgba(70, 55, 30, 0.08), 0 1px 3px rgba(70, 55, 30, 0.05);
    --shadow-lg: 0 10px 30px rgba(70, 55, 30, 0.12), 0 4px 10px rgba(70, 55, 30, 0.06);

    /* Semantic colors: warmer, deeper in light mode */
    --amber-bg: rgba(245, 147, 33, 0.10);
    --amber-fg: #c97508;
    --blue-bg: rgba(37, 99, 235, 0.08);
    --blue-fg: #1e40af;
    --green-bg: rgba(16, 185, 129, 0.10);
    --green-fg: #047857;
    --red-bg: rgba(239, 68, 68, 0.08);
    --red-fg: #b91c1c;
    --purple-bg: rgba(147, 51, 234, 0.08);
    --purple-fg: #7c3aed;
    --pink-bg: rgba(236, 72, 153, 0.08);
    --pink-fg: #be185d;
    --teal-bg: rgba(20, 184, 166, 0.08);
    --teal-fg: #0f766e;
}

/* Sidebar in light mode — don't just mirror dark, give it warmth */
html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f8f6ef 0%, #f3f0e6 100%);
    border-right: 1px solid rgba(120, 110, 90, 0.15);
}
html[data-theme="light"] .sidebar-section-title {
    color: #8f8b80;
}
html[data-theme="light"] .nav-item {
    color: #3d3a32;
}
html[data-theme="light"] .nav-item:hover {
    background: rgba(245, 147, 33, 0.06);
    color: #1f1d18;
}
html[data-theme="light"] .nav-item.active {
    background: linear-gradient(90deg, rgba(245, 147, 33, 0.12), transparent);
    color: #c97508;
}

/* Topbar in light mode */
html[data-theme="light"] .topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(120, 110, 90, 0.12);
}

/* Inputs in light mode — less sterile */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #fbfaf5;
    border: 1px solid rgba(120, 110, 90, 0.2);
    color: #1f1d18;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
    background: #ffffff;
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px rgba(245, 147, 33, 0.12);
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #a8a49a;
}

/* Make the app bg warmer, less clinical */
html[data-theme="light"] body {
    background: #fafaf7;
    color: #1f1d18;
}
html[data-theme="light"] .card {
    background: #ffffff;
    border: 1px solid rgba(120, 110, 90, 0.12);
    box-shadow: 0 1px 3px rgba(70, 55, 30, 0.04);
}
html[data-theme="light"] .card:hover {
    box-shadow: 0 4px 14px rgba(70, 55, 30, 0.08);
}

/* Reg plate in light mode — keep contrast */
html[data-theme="light"] .reg-plate {
    background: #1f1d18;
    color: #f5c06c;
    border: 1px solid #1f1d18;
}

/* -------- INVOICE FORM — FIX VISIBILITY IN BOTH MODES -------- */
.invoice-items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.invoice-items-table th {
    background: var(--bg-surface-3);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line-strong);
}
.invoice-items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    background: var(--bg-surface);
    color: var(--text-primary);
}
.invoice-items-table tr:hover td { background: var(--bg-hover); }
.invoice-items-table input,
.invoice-items-table select,
.invoice-items-table textarea {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 8px;
    width: 100%;
    border-radius: var(--r-sm);
    transition: border-color 0.15s, background 0.15s;
}
.invoice-items-table input:focus,
.invoice-items-table select:focus {
    background: var(--bg-surface-2);
    border-color: var(--amber-500);
    outline: none;
}
.invoice-items-table .item-amount {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}
.invoice-totals {
    background: var(--bg-surface-2);
    border-radius: var(--r-md);
    padding: 16px 20px;
    margin-top: 16px;
}
.invoice-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13.5px;
}
.invoice-totals-row.label { color: var(--text-tertiary); }
.invoice-totals-row.value { font-family: var(--font-mono); color: var(--text-primary); }
.invoice-totals-grand {
    border-top: 2px solid var(--line-strong);
    margin-top: 10px;
    padding-top: 10px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--amber-500);
}
.invoice-toggles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--bg-surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-sm);
    margin-bottom: 14px;
}
.invoice-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.invoice-toggle input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--amber-500);
}

/* Payment tracker */
.payment-tracker {
    background: var(--bg-surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px;
    margin-top: 14px;
}
.payment-bar {
    height: 8px;
    background: var(--bg-surface-3);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}
.payment-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-fg), #10b981);
    transition: width 0.5s var(--ease-out);
    border-radius: 4px;
}
.payment-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12.5px;
}
.payment-row.paid { color: var(--green-fg); }
.payment-row.balance { color: var(--amber-500); font-weight: 600; }

/* ============================================================
   v4.5 — LIGHT MODE VIBRANCY (richer, more alive)
   ============================================================ */

html[data-theme="light"] {
    /* Slightly cooler warm white for better screen comfort */
    --bg-app: #f7f5ef;
    --bg-base: #f1eee3;
    --bg-surface: #ffffff;
    --bg-surface-2: #fdfcf7;
    --bg-surface-3: #eae6d9;
    --bg-hover: #f4f1e7;

    /* Stronger brand-accent shadows so cards feel dimensional */
    --shadow-sm: 0 1px 2px rgba(80, 55, 20, 0.06);
    --shadow-md: 0 4px 14px rgba(120, 80, 30, 0.10), 0 2px 4px rgba(120, 80, 30, 0.06);
    --shadow-lg: 0 18px 40px rgba(120, 80, 30, 0.14), 0 6px 16px rgba(120, 80, 30, 0.08);
}

/* Canvas gets subtle noise-paper texture for warmth */
html[data-theme="light"] body {
    background:
        radial-gradient(ellipse at top left, rgba(245,147,33,0.04), transparent 40%),
        radial-gradient(ellipse at bottom right, rgba(168,85,247,0.03), transparent 40%),
        #f7f5ef;
    background-attachment: fixed;
}

/* Sidebar: warm gradient with an amber glow at top */
html[data-theme="light"] .sidebar {
    background:
        linear-gradient(180deg, #faf7ec 0%, #f1ecda 100%);
    box-shadow: inset -1px 0 0 rgba(120, 80, 30, 0.08);
    border-right: none;
}
html[data-theme="light"] .sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 180px;
    background: radial-gradient(ellipse at top, rgba(245,147,33,0.10), transparent 70%);
    pointer-events: none;
}
html[data-theme="light"] .brand {
    border-bottom: 1px solid rgba(120, 80, 30, 0.12);
}
html[data-theme="light"] .brand-name {
    color: #1f1d18;
}

/* Active nav gets amber gradient blade */
html[data-theme="light"] .nav-item.active {
    background: linear-gradient(90deg, rgba(245,147,33,0.18), rgba(245,147,33,0.04) 80%, transparent);
    color: #b45309;
    font-weight: 600;
}
html[data-theme="light"] .nav-item.active::before {
    background: linear-gradient(180deg, #f59321, #c97508);
    width: 3px;
    box-shadow: 0 0 8px rgba(245,147,33,0.4);
}

/* Topbar with warm frosted glass */
html[data-theme="light"] .topbar {
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(253,252,247,0.85));
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid rgba(120, 80, 30, 0.1);
    box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}

/* Cards: subtle gradient + colored left-edge for visual pop */
html[data-theme="light"] .card {
    background: linear-gradient(180deg, #ffffff 0%, #fefdf9 100%);
    border: 1px solid rgba(120, 80, 30, 0.1);
    box-shadow:
        0 1px 2px rgba(80, 55, 20, 0.04),
        0 4px 10px rgba(80, 55, 20, 0.04);
    transition: all 0.25s var(--ease-out);
}
html[data-theme="light"] .card:hover {
    border-color: rgba(245, 147, 33, 0.2);
    box-shadow:
        0 2px 4px rgba(80, 55, 20, 0.05),
        0 10px 28px rgba(80, 55, 20, 0.09);
    transform: translateY(-1px);
}

/* Card heads get a warm divider */
html[data-theme="light"] .card-head {
    border-bottom: 1px solid rgba(120, 80, 30, 0.09);
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(250,246,236,0.5) 100%);
}

/* Metric cards get richer treatment */
html[data-theme="light"] .metric {
    background: linear-gradient(135deg, #ffffff 0%, #fbfaf3 100%);
    border: 1px solid rgba(120, 80, 30, 0.1);
}
html[data-theme="light"] .metric.is-featured {
    background:
        linear-gradient(135deg, rgba(245,147,33,0.12) 0%, rgba(245,147,33,0.04) 100%),
        #ffffff;
    border-color: rgba(245, 147, 33, 0.3);
    box-shadow:
        0 0 0 1px rgba(245, 147, 33, 0.08),
        0 6px 20px rgba(245, 147, 33, 0.1);
}
html[data-theme="light"] .metric:hover {
    border-color: rgba(245, 147, 33, 0.25);
    transform: translateY(-2px);
}
html[data-theme="light"] .metric-value {
    color: #1f1d18;
    background: linear-gradient(180deg, #2a2620 0%, #5a4530 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Semantic color backgrounds — bolder in light mode */
html[data-theme="light"] {
    --amber-bg: rgba(245, 147, 33, 0.14);
    --amber-fg: #a5510a;
    --blue-bg: rgba(37, 99, 235, 0.12);
    --blue-fg: #1d4ed8;
    --green-bg: rgba(16, 185, 129, 0.14);
    --green-fg: #047857;
    --red-bg: rgba(239, 68, 68, 0.12);
    --red-fg: #b91c1c;
    --purple-bg: rgba(147, 51, 234, 0.12);
    --purple-fg: #6d28d9;
    --pink-bg: rgba(236, 72, 153, 0.12);
    --pink-fg: #be185d;
    --teal-bg: rgba(20, 184, 166, 0.12);
    --teal-fg: #0f766e;
}

/* Pulse-row tiles: colored icon backgrounds are more vivid */
html[data-theme="light"] .pulse {
    background: linear-gradient(180deg, #ffffff 0%, #fdfbf4 100%);
    border: 1px solid rgba(120, 80, 30, 0.1);
}
html[data-theme="light"] .pulse:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 147, 33, 0.25);
    box-shadow: 0 6px 18px rgba(120, 80, 30, 0.1);
}

/* Fleet summary tiles have nicer lift */
html[data-theme="light"] .fleet-tile {
    background: linear-gradient(180deg, #ffffff 0%, #fdfbf4 100%);
    border: 1px solid rgba(120, 80, 30, 0.1);
}
html[data-theme="light"] .fleet-tile:hover {
    border-color: rgba(245, 147, 33, 0.3);
    box-shadow: 0 6px 18px rgba(120, 80, 30, 0.1);
    transform: translateY(-2px);
}
html[data-theme="light"] .fleet-tile.active-filter {
    background:
        linear-gradient(135deg, rgba(245, 147, 33, 0.14), rgba(245, 147, 33, 0.05)),
        #ffffff;
    border-color: rgba(245, 147, 33, 0.4);
    box-shadow:
        inset 0 0 0 1px rgba(245, 147, 33, 0.1),
        0 4px 14px rgba(245, 147, 33, 0.15);
}

/* Badges: keep readable + vibrant */
html[data-theme="light"] .badge {
    font-weight: 700;
    letter-spacing: 0.04em;
}
html[data-theme="light"] .badge-blue    { background: rgba(37, 99, 235, 0.14); color: #1e40af; }
html[data-theme="light"] .badge-green   { background: rgba(16, 185, 129, 0.14); color: #047857; }
html[data-theme="light"] .badge-amber   { background: rgba(245, 147, 33, 0.18); color: #a5510a; }
html[data-theme="light"] .badge-red     { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }
html[data-theme="light"] .badge-purple  { background: rgba(147, 51, 234, 0.14); color: #6d28d9; }
html[data-theme="light"] .badge-pink    { background: rgba(236, 72, 153, 0.14); color: #be185d; }
html[data-theme="light"] .badge-teal    { background: rgba(20, 184, 166, 0.14); color: #0f766e; }
html[data-theme="light"] .badge-neutral { background: rgba(107, 114, 128, 0.12); color: #4b5563; }

/* Buttons: primary gets a richer amber gradient */
html[data-theme="light"] .btn-primary {
    background: linear-gradient(180deg, #f59321 0%, #d97706 100%);
    color: #fff;
    border: 1px solid #c97508;
    box-shadow:
        0 1px 2px rgba(245, 147, 33, 0.35),
        inset 0 1px 0 rgba(255,255,255,0.25);
}
html[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(180deg, #fba03d 0%, #e08819 100%);
    box-shadow:
        0 4px 12px rgba(245, 147, 33, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-1px);
}
html[data-theme="light"] .btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #faf7ed 100%);
    color: #3d3a32;
    border: 1px solid rgba(120, 80, 30, 0.18);
    box-shadow: 0 1px 2px rgba(80, 55, 20, 0.05);
}
html[data-theme="light"] .btn-secondary:hover {
    background: linear-gradient(180deg, #faf7ed 0%, #f4efe0 100%);
    border-color: rgba(245, 147, 33, 0.3);
    color: #1f1d18;
}
html[data-theme="light"] .btn-ghost {
    color: #4b4840;
}
html[data-theme="light"] .btn-ghost:hover {
    background: rgba(245, 147, 33, 0.08);
    color: #a5510a;
}

/* Sparklines: deeper colors in light mode */
html[data-theme="light"] .metric-sparkline svg path[fill] {
    opacity: 0.18;
}
html[data-theme="light"] .metric-sparkline svg path[stroke] {
    stroke-width: 2.5;
}

/* Reg plate: deeper contrast */
html[data-theme="light"] .reg-plate {
    background: #1a1814;
    color: #ffc36b;
    border: 1px solid #1a1814;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.2),
        inset 0 0 0 1px rgba(255,195,107,0.15);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* Inputs: softer fill, stronger focus */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #fdfcf7;
    border: 1px solid rgba(120, 80, 30, 0.16);
    color: #1f1d18;
    box-shadow: inset 0 1px 2px rgba(80, 55, 20, 0.04);
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
    background: #ffffff;
    border-color: #f59321;
    box-shadow:
        0 0 0 3px rgba(245, 147, 33, 0.15),
        inset 0 1px 2px rgba(80, 55, 20, 0.03);
}

/* Tables: warmer zebra + highlight */
html[data-theme="light"] table {
    background: #ffffff;
}
html[data-theme="light"] table thead th {
    background: linear-gradient(180deg, #faf7ed 0%, #f4efe0 100%);
    color: #5a4530;
    border-bottom: 1px solid rgba(120, 80, 30, 0.15);
}
html[data-theme="light"] table tbody tr {
    border-bottom: 1px solid rgba(120, 80, 30, 0.07);
}
html[data-theme="light"] table tbody tr:hover {
    background: rgba(245, 147, 33, 0.04);
}

/* Toasts: warmer shadows in light */
html[data-theme="light"] .toast {
    background: #ffffff;
    border: 1px solid rgba(120, 80, 30, 0.12);
    box-shadow:
        0 20px 50px rgba(120, 80, 30, 0.18),
        0 6px 16px rgba(120, 80, 30, 0.1);
}

/* Timeline dots have richer glow */
html[data-theme="light"] .timeline-dot {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(120, 80, 30, 0.08);
}
html[data-theme="light"] .timeline-dot.amber  { background: #f59321; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(245,147,33,0.3); }
html[data-theme="light"] .timeline-dot.blue   { background: #2563eb; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(37,99,235,0.3); }
html[data-theme="light"] .timeline-dot.green  { background: #10b981; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(16,185,129,0.3); }
html[data-theme="light"] .timeline-dot.red    { background: #ef4444; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(239,68,68,0.3); }
html[data-theme="light"] .timeline-dot.purple { background: #9333ea; box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(147,51,234,0.3); }

/* Page head (hero) gets richer in light */
html[data-theme="light"] .page-head h1 {
    color: #1a1814;
}
html[data-theme="light"] .page-head h1 em {
    background: linear-gradient(135deg, #f59321, #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
}
html[data-theme="light"] .page-head p {
    color: #5a5648;
}

/* Guide cards: more color, still gentle */
html[data-theme="light"] .guide-card {
    background:
        linear-gradient(135deg, rgba(96,165,250,0.12), rgba(96,165,250,0.04)),
        #ffffff;
    border: 1px solid rgba(37,99,235,0.2);
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}
html[data-theme="light"] .guide-card.tone-next {
    background:
        linear-gradient(135deg, rgba(245,147,33,0.12), rgba(245,147,33,0.04)),
        #ffffff;
    border-color: rgba(245,147,33,0.3);
    box-shadow: 0 2px 8px rgba(245,147,33,0.12);
}
html[data-theme="light"] .guide-card.tone-wait {
    background:
        linear-gradient(135deg, rgba(168,85,247,0.12), rgba(168,85,247,0.04)),
        #ffffff;
    border-color: rgba(168,85,247,0.25);
}
html[data-theme="light"] .guide-card.tone-warn {
    background:
        linear-gradient(135deg, rgba(251,191,36,0.14), rgba(251,191,36,0.05)),
        #fffbeb;
    border-color: rgba(217,119,6,0.3);
}
html[data-theme="light"] .guide-card.tone-done {
    background:
        linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04)),
        #ffffff;
    border-color: rgba(16,185,129,0.25);
}

/* Comments: richer cards in light */
html[data-theme="light"] .comment-content {
    background: #fdfcf7;
    border: 1px solid rgba(120,80,30,0.12);
    box-shadow: 0 1px 2px rgba(80,55,20,0.04);
}
html[data-theme="light"] .comment-content::before {
    background: #fdfcf7;
    border-color: rgba(120,80,30,0.12);
}
html[data-theme="light"] .comment.owner .comment-content {
    background:
        linear-gradient(135deg, rgba(245,147,33,0.09), rgba(245,147,33,0.02)),
        #fffcf4;
    border-color: rgba(245,147,33,0.28);
}
html[data-theme="light"] .comment.owner .comment-content::before {
    background: rgba(255,249,235,1);
    border-color: rgba(245,147,33,0.28);
}

/* Workflow stepper: amber glow in light too */
html[data-theme="light"] .workflow-step.active .dot {
    box-shadow:
        0 0 0 5px rgba(245,147,33,0.16),
        0 4px 16px rgba(245,147,33,0.4);
}
html[data-theme="light"] .workflow-step.done .dot {
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

/* Chat: warmer bubbles */
html[data-theme="light"] .chat-message.received {
    background: #ffffff;
    border: 1px solid rgba(120,80,30,0.12);
    box-shadow: 0 1px 2px rgba(80,55,20,0.05);
}
html[data-theme="light"] .chat-messages {
    background: linear-gradient(180deg, #f7f4ea 0%, #f1ecda 100%);
}
html[data-theme="light"] .chat-sidebar {
    background: #f7f4ea;
}
html[data-theme="light"] .chat-user.active {
    background: linear-gradient(90deg, rgba(245,147,33,0.12), transparent);
}
html[data-theme="light"] .chat-user.active::before {
    background: linear-gradient(180deg, #f59321, #d97706);
}

/* Stat card overrides (older style still used some places) */
html[data-theme="light"] .stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #fbfaf3 100%);
    border: 1px solid rgba(120,80,30,0.1);
}

/* Section dividers slightly more visible */
html[data-theme="light"] .section-title {
    color: #5a4530;
    border-bottom: 1px solid rgba(120,80,30,0.12);
}

/* Eyebrow text gets warmer */
html[data-theme="light"] .eyebrow {
    color: #8c6a3a;
}

/* Ring gauge: richer background arc in light */
html[data-theme="light"] .ring-gauge-card svg circle:first-of-type {
    stroke: rgba(120,80,30,0.1);
}
