/* ===== R.BattCheck Customer Portal - Main Styles ===== */

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

:root {
    /* Dark Theme (default) */
    --bg-primary: #000915;
    --bg-secondary: #0a1628;
    --bg-tertiary: #0F294D;
    --bg-card: rgba(15, 41, 77, 0.4);
    --bg-card-hover: rgba(15, 41, 77, 0.6);
    --bg-sidebar: rgba(0, 9, 21, 0.95);
    --bg-input: rgba(15, 41, 77, 0.3);
    --bg-input-focus: rgba(15, 41, 77, 0.5);
    --sv-frozen-hover: #12243f;

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #3b82f6;

    --border-color: rgba(59, 130, 246, 0.15);
    --border-hover: rgba(59, 130, 246, 0.3);
    --border-focus: rgba(59, 130, 246, 0.5);

    --accent-primary: #3b82f6;
    --accent-secondary: #1d4ed8;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 68px;
    --sidebar-collapsed: 72px;
    --header-height: 0px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8edf3;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-sidebar: rgba(255, 255, 255, 0.98);
    --bg-input: rgba(0, 0, 0, 0.04);
    --bg-input-focus: rgba(0, 0, 0, 0.06);
    --sv-frozen-hover: #eef3f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-accent: #2563eb;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-focus: rgba(37, 99, 235, 0.4);

    --accent-primary: #2563eb;
    --accent-secondary: #1e40af;
    --accent-glow: rgba(37, 99, 235, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.08);
}

/* Gray — neutral, desaturated dark theme (easy on the eyes, low chroma) */
[data-theme="gray"] {
    --bg-primary: #17181b;
    --bg-secondary: #1f2023;
    --bg-tertiary: #2a2b2f;
    --bg-card: rgba(42, 43, 47, 0.4);
    --bg-card-hover: rgba(42, 43, 47, 0.6);
    --bg-sidebar: rgba(23, 24, 27, 0.95);
    --bg-input: rgba(42, 43, 47, 0.3);
    --bg-input-focus: rgba(42, 43, 47, 0.5);
    --sv-frozen-hover: #26272b;

    --text-primary: #f2f2f3;
    --text-secondary: #a8abb2;
    --text-muted: #71757d;
    --text-accent: #9aa4b2;

    --border-color: rgba(255, 255, 255, 0.10);
    --border-hover: rgba(255, 255, 255, 0.20);
    --border-focus: rgba(148, 163, 184, 0.5);

    --accent-primary: #64748b;
    --accent-secondary: #475569;
    --accent-glow: rgba(100, 116, 139, 0.22);
    --accent-success: #22c55e;
    --accent-warning: #eab308;
    --accent-danger: #ef4444;
    --accent-info: #38bdf8;

    --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.45);
}

/* Contrast — high-contrast accessibility theme (WCAG-friendly) */
[data-theme="contrast"] {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #141414;
    --bg-card: #000000;
    --bg-card-hover: #101010;
    --bg-sidebar: #000000;
    --bg-input: #000000;
    --bg-input-focus: #141414;
    --sv-frozen-hover: #141414;

    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #e6e6e6;
    --text-accent: #4dabff;

    --border-color: rgba(255, 255, 255, 0.85);
    --border-hover: #ffff00;
    --border-focus: #ffff00;

    --accent-primary: #2b8cff;
    --accent-secondary: #0a6ae0;
    --accent-glow: rgba(43, 140, 255, 0.35);
    --accent-success: #00e000;
    --accent-warning: #ffb000;
    --accent-danger: #ff4d4d;
    --accent-info: #16d6ff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.8);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.9);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 1);
    --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Space — deep cosmic dark theme (indigo/violet, nebula accents) */
[data-theme="space"] {
    --bg-primary: #05060f;
    --bg-secondary: #0d1030;
    --bg-tertiary: #171a45;
    --bg-card: rgba(23, 26, 69, 0.4);
    --bg-card-hover: rgba(23, 26, 69, 0.6);
    --bg-sidebar: rgba(5, 6, 15, 0.95);
    --bg-input: rgba(23, 26, 69, 0.3);
    --bg-input-focus: rgba(23, 26, 69, 0.5);
    --sv-frozen-hover: #14173a;

    --text-primary: #ecebff;
    --text-secondary: #a9a7d6;
    --text-muted: #6f6ca0;
    --text-accent: #a78bfa;

    --border-color: rgba(139, 92, 246, 0.18);
    --border-hover: rgba(139, 92, 246, 0.35);
    --border-focus: rgba(167, 139, 250, 0.6);

    --accent-primary: #8b5cf6;
    --accent-secondary: #6d28d9;
    --accent-glow: rgba(139, 92, 246, 0.25);
    --accent-success: #34d399;
    --accent-warning: #fbbf24;
    --accent-danger: #fb7185;
    --accent-info: #38bdf8;

    --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.28);
}

/* Battery — energetic green theme (fits the EV/battery domain) */
[data-theme="battery"] {
    --bg-primary: #0e1210;
    --bg-secondary: #171b18;
    --bg-tertiary: #212722;
    --bg-card: rgba(33, 39, 34, 0.4);
    --bg-card-hover: rgba(33, 39, 34, 0.6);
    --bg-sidebar: rgba(14, 18, 16, 0.95);
    --bg-input: rgba(33, 39, 34, 0.3);
    --bg-input-focus: rgba(33, 39, 34, 0.5);
    --sv-frozen-hover: #232a25;

    --text-primary: #eef1ef;
    --text-secondary: #a6afa9;
    --text-muted: #6f7a73;
    --text-accent: #34d17c;

    --border-color: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-focus: rgba(34, 197, 94, 0.5);

    --accent-primary: #16a34a;
    --accent-secondary: #12833c;
    --accent-glow: rgba(34, 197, 94, 0.18);
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.16);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(196deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%) no-repeat fixed !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--accent-primary);
    color: white;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* Theme-aware accent link: brighter blue in dark mode so small inline links
   stay legible against the navy surface; deeper blue in light mode. */
.link-accent {
    color: #60a5fa;
}

.link-accent:hover {
    color: #93c5fd;
    text-decoration: underline;
}

[data-theme="light"] .link-accent {
    color: #1d4ed8;
}

[data-theme="light"] .link-accent:hover {
    color: #1e40af;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
    position: relative;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}

/* Dashboard: das obere Padding von .main-content entfernen, damit die Appbar
   bündig am oberen Rand sitzt. Gilt via :has() NUR für die Dashboard-Seite
   (nur dort existiert .appbar) – alle anderen Seiten behalten ihr Top-Padding. */
.main-content:has(.appbar) {
    padding-top: 0;
}

/* Appbar braucht dann kein negatives Top-Margin mehr; die Seiten werden
   weiterhin bündig gezogen, damit die Leiste die volle Breite einnimmt. */
.main-content .appbar {
    margin-top: 0;
    margin-left: -32px;
    margin-right: -32px;
}

@media (max-width: 768px) {
    .main-content .appbar {
        margin-left: -16px;
        margin-right: -16px;
    }
}

/* ── Company switch overlay ── */
.company-switch-overlay {
    position: fixed;
    inset: 0;
    left: var(--sidebar-width);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: csoFadeIn 0.25s ease forwards;
}

@media (max-width: 768px) {
    .company-switch-overlay { left: 0; }
}

.company-switch-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 36px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    animation: csoCardIn 0.35s ease forwards;
}

.company-switch-text {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.company-switch-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes csoFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes csoCardIn {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all var(--transition-normal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

.sidebar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: filter var(--transition-fast);
}

.sidebar-logo.branding-logo {
    filter: none;
}

.sidebar-branding-logo .sidebar-logo {
    filter: none;
}

[data-theme="light"] .sidebar-branding-logo .sidebar-logo {
    filter: brightness(0);
}

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

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 12px 14px 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    margin-bottom: 1px;
}

.nav-item:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-item.active .nav-icon {
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    position: relative;
}

/* ===== Navigation notification badge ===== */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent-danger, #e5484d);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Inline badge: pushed to the right edge of the nav item (expanded sidebar) */
.nav-badge-inline {
    margin-left: auto;
}

/* "Prototype" marker badge (amber, uppercase) for beta nav items */
.nav-badge-proto {
    padding: 1px 6px;
    border-radius: 5px;
    background: color-mix(in srgb, #f59e0b 22%, transparent);
    color: #b45309;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}

/* Badge anchored to the icon: only shown when the sidebar is collapsed */
.nav-icon .nav-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    box-shadow: 0 0 0 2px var(--bg-card);
    display: none;
}

.nav-sub-items {
    padding-left: 16px;
}

.nav-sub-items .nav-item {
    font-size: 13px;
    padding: 8px 14px;
}

.sidebar-branding-logo {
    padding: 8px 16px 4px;
    display: flex;
    align-items: center;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Sidebar Collapse Toggle ===== */
.sidebar-collapse-btn {
    position: absolute;
    top: 28px;
    right: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
    opacity: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.sidebar:hover .sidebar-collapse-btn { opacity: 1; }
.sidebar-collapse-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.sidebar-collapse-btn svg {
    transition: transform var(--transition-fast);
}

.sidebar.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* ===== Nav Label (for collapse hiding) ===== */
.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Logo variants ===== */
.sidebar-logo-small {
    display: none;
}

/* ===== Footer structure ===== */
.sidebar-footer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 10px;
}

.sidebar-logout-btn {
    color: var(--text-muted);
    font-size: 18px;
}

.sidebar-logout-collapsed {
    display: none;
    color: var(--text-muted);
    font-size: 20px;
    width: 100%;
    justify-content: center;
    padding: 10px 0;
    cursor: pointer;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-logout-collapsed:hover {
    color: var(--accent-primary);
    background: var(--accent-glow);
}

/* ===== Collapsed Sidebar ===== */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar-is-collapsed .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }

    /* ── Header: swap to small logo ── */
    .sidebar.collapsed .sidebar-header {
        padding: 16px 8px;
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-logo-full {
        display: none;
    }

    .sidebar.collapsed .sidebar-logo-small {
        display: block;
        height: 30px;
        width: auto;
    }

    .sidebar.collapsed .sidebar-nav {
        padding: 8px 6px;
    }

    /* ── Hide text elements ── */
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .nav-label {
        display: none;
    }

    /* ── Notification badge: switch from inline to icon-anchored ── */
    .sidebar.collapsed .nav-badge-inline {
        display: none;
    }
    .sidebar.collapsed .nav-icon .nav-badge {
        display: inline-flex;
    }

    /* Company switcher & company name */
    .sidebar.collapsed div[style*="padding: 0 12px"],
    .sidebar.collapsed div[style*="padding: 0 16px"] {
        display: none;
    }

    /* ── Nav items: icon only, centered ── */
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 10px;
        gap: 0;
        position: relative;
    }

    .sidebar.collapsed .nav-icon {
        width: 22px;
        height: 22px;
    }

    /* ── CSS Tooltip on hover ── */
    .sidebar.collapsed .nav-item::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-card);
        color: var(--text-primary);
        font-size: 12px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.15s;
        z-index: 9999;
    }

    .sidebar.collapsed .nav-item:hover::after {
        opacity: 1;
    }

    /* ── Footer: hide everything except logout icon ── */
    .sidebar.collapsed .sidebar-footer {
        padding: 8px 6px;
    }

    .sidebar.collapsed .sidebar-footer-expanded {
        display: none;
    }

    .sidebar.collapsed .sidebar-logout-collapsed {
        display: flex;
    }
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Back link for admin sub-pages (return to organization structure) */
.page-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-bottom: 12px;
    padding: 5px 12px 5px 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.page-back:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-glow, rgba(59, 130, 246, 0.08));
}

.page-back svg { transition: transform 0.15s; }
.page-back:hover svg { transform: translateX(-2px); }

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Stat Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--accent-primary));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
    background: var(--accent-glow);
    color: var(--accent-primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 20px;
}

.stat-trend.up {
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-trend.down {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ===== Tables ===== */
.data-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 20px;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Compact variant for admin management tables (denser rows, more columns) */
.data-table.compact th {
    padding: 8px 12px;
    font-size: 10.5px;
    letter-spacing: 0.6px;
}

.data-table.compact td {
    padding: 7px 12px;
    font-size: 12.5px;
    white-space: nowrap;
}

.data-table.compact th { white-space: nowrap; }

/* Let a compact table scroll horizontally when it has many columns */
.data-table-wrapper:has(> .data-table.compact) {
    overflow-x: auto;
}

.compact-muted { color: var(--text-muted); }

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--accent-glow);
}

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

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #ffffff !important;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
    color-scheme: dark;
}

[data-theme="light"] .form-control {
    color: #0f172a !important;
}

[data-theme="light"] .form-control {
    color-scheme: light;
}

.form-control:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
    transition: background-color 5000s ease-in-out 0s;
}

textarea.form-control {
    color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--accent-glow);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-danger {
    background: transparent;
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--accent-danger);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--accent-glow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

/* Dark theme (default): lighter tint-300 text pops off the dark navy surface.
   Blue-on-blue was the worst case, so primary gets the strongest lift. */
.badge-success {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.32);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.32);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.32);
}

.badge-info {
    background: rgba(6, 182, 212, 0.18);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.32);
}

.badge-primary {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.42);
}

/* Light theme: darker tint-700 text for contrast on the pale surface. */
[data-theme="light"] .badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.28);
}

[data-theme="light"] .badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.28);
}

[data-theme="light"] .badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.28);
}

[data-theme="light"] .badge-info {
    background: rgba(6, 182, 212, 0.12);
    color: #0e7490;
    border-color: rgba(6, 182, 212, 0.28);
}

[data-theme="light"] .badge-primary {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.28);
}

/* ===== SOH Gauge ===== */
.soh-value {
    font-weight: 700;
    font-size: 14px;
}

.soh-good { color: #10b981; }
.soh-warning { color: #f59e0b; }
.soh-critical { color: #ef4444; }

.soh-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    overflow: hidden;
    margin-top: 4px;
}

.soh-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-slow);
}

/* ===== Search Bar ===== */
.search-bar {
    position: relative;
    max-width: 320px;
}

.search-bar .form-control {
    padding-left: 40px;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(196deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%) no-repeat fixed;
    position: relative;
    overflow: hidden;
}

.login-bg-overlay {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 1;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-copyright {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    text-align: center;
    color: var(--text-secondary);
}

.login-copyright a {
    color: var(--text-secondary);
    text-decoration: none;
}

.login-copyright a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.login-copyright-sep {
    opacity: 0.6;
    margin: 0 4px;
}

.login-card {
    background: rgba(10, 22, 40, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.85);
}

/* Header strip that always stays dark so the (light) logo is visible in both themes */
.login-card-header {
    margin: -48px -40px 32px;
    padding: 36px 40px;
    background: rgba(10, 22, 40, 0.92);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.login-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.login-logo {
    display: block;
    height: 48px;
    margin: 0 auto 32px;
}

.login-card-header .login-logo {
    margin: 0 auto;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 36px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
}

.password-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

/* ===== SOH Check (public) ===== */
.soh-check-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.soh-check-divider::before,
.soh-check-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color, rgba(255, 255, 255, 0.12));
}

.soh-check-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.soh-check-cta:hover {
    background: var(--accent-primary);
    color: #fff;
    text-decoration: none;
}

/* Tooltip shown above the SOH-Check button */
.soh-check-tooltip-wrap {
    position: relative;
}

.soh-check-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: max-content;
    max-width: 260px;
    padding: 9px 13px;
    background: var(--bg-elevated, #0f294d);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.4;
    text-align: center;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.soh-check-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-elevated, #0f294d);
}

.soh-check-tooltip-wrap:hover .soh-check-tooltip,
.soh-check-tooltip-wrap:focus-within .soh-check-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.soh-info-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.soh-result {
    padding: 18px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 16px;
    text-align: center;
}

.soh-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-success);
}

.soh-result.notfound {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* Darker amber for readability on the light (white) card background. */
[data-theme="light"] .soh-result.notfound {
    color: #b45309;
}

.soh-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.soh-result-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.soh-vin-input {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

.soh-support-toggle {
    display: block;
    width: 100%;
    margin-top: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    padding: 6px;
}

.soh-support-toggle:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.soh-support-panel {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    text-align: left;
}

/* ===== SOH Tracking (admin) ===== */
/* ===== SOH-Tracking (kompakt, Light/Dark-fähig) ===== */
.soh-tracking .page-header {
    margin-bottom: 16px;
}

.soh-tracking .page-title {
    font-size: 22px;
}

/* Panels kompakter als der globale .card-Standard */
.soh-tracking .card {
    padding: 15px 16px;
}

.soh-tracking .card-header {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.soh-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.soh-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.soh-stat:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.soh-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    letter-spacing: -0.5px;
}

.soh-stat-label {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.soh-track-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.soh-tracking .soh-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 92px;
    padding: 4px 2px 0;
}

.soh-tracking .soh-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.soh-tracking .soh-bar {
    width: 100%;
    max-width: 22px;
    background: linear-gradient(180deg, var(--accent-primary), rgba(59, 130, 246, 0.55));
    border-radius: 4px 4px 0 0;
    transition: height 0.2s ease, filter 0.15s ease;
}

.soh-tracking .soh-bar:hover {
    filter: brightness(1.12);
}

.soh-bar-x {
    font-size: 9.5px;
    color: var(--text-muted);
    transform: rotate(-45deg);
    white-space: nowrap;
}

.soh-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.soh-mini-table td {
    padding: 6px 4px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.soh-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.soh-log-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.soh-log-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.soh-log-table tbody tr {
    transition: background var(--transition-fast);
}

.soh-log-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.soh-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
}

.soh-badge.ok {
    background: rgba(16, 185, 129, 0.16);
    color: var(--accent-success);
}

.soh-badge.warn {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

/* Dunkleres Amber für Lesbarkeit auf hellem Badge-Hintergrund */
[data-theme="light"] .soh-badge.warn {
    color: #b45309;
}

.soh-badge.danger {
    background: rgba(239, 68, 68, 0.16);
    color: var(--accent-danger);
}

/* ===== Login Loading Overlay ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(196deg, #000915 0%, #0a1e3d 50%, #0F294D 100%);
    animation: loginOverlayIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-overlay--out {
    animation: loginOverlayOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: loginContentIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

/* Battery SVG */
.login-batt-svg {
    width: 96px;
    height: 45px;
    filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.25));
}

.login-batt-body {
    fill: none;
    stroke: rgba(148, 163, 184, 0.35);
    stroke-width: 2.5;
}

.login-batt-cap {
    fill: rgba(148, 163, 184, 0.3);
}

/* Battery cell segments */
.login-batt-cell {
    fill: var(--accent-primary);
    opacity: 0;
    transform-origin: center bottom;
}

.login-batt-cell-1 { animation: loginCellCharge 2.4s ease-in-out infinite 0s; }
.login-batt-cell-2 { animation: loginCellCharge 2.4s ease-in-out infinite 0.3s; }
.login-batt-cell-3 { animation: loginCellCharge 2.4s ease-in-out infinite 0.6s; }
.login-batt-cell-4 { animation: loginCellCharge 2.4s ease-in-out infinite 0.9s; }

/* Text */
/* Overlay background is always dark, so the text must stay light in both themes */
.login-overlay-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.04em;
}

.login-overlay-sub {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    animation: loginSubPulse 2.4s ease-in-out infinite;
}

/* Keyframes */
@keyframes loginOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes loginOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes loginContentIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes loginCellCharge {
    0%        { opacity: 0;    transform: scaleY(0.7); }
    15%, 65%  { opacity: 0.9;  transform: scaleY(1); }
    80%, 100% { opacity: 0;    transform: scaleY(0.7); }
}

@keyframes loginSubPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px;
}

.theme-toggle-track {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all var(--transition-normal);
}

.theme-toggle-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle.light .theme-toggle-thumb {
    left: 22px;
    background: var(--accent-warning);
}

/* ===== Language Selector ===== */
/* ===== Language Selector Dropdown ===== */
.lang-selector {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-family: inherit;
}

.lang-current:hover {
    border-color: var(--border-hover);
}

.lang-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.1);
}

.lang-code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lang-chevron {
    opacity: 0.4;
    transition: transform 0.2s;
}

.lang-chevron--open {
    transform: rotate(180deg);
}

.lang-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.lang-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    width: 200px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    z-index: 100;
    padding: 4px;
}

/* On the auth pages (registration top bar, login) the menu must open downward
   (not upward as in the sidebar) and scroll when there are many languages. */
.register-topbar .lang-dropdown,
.login-lang .lang-dropdown,
.login-topbar .lang-dropdown {
    top: calc(100% + 6px);
    bottom: auto;
    max-height: min(320px, 60vh);
    overflow-y: auto;
}

[data-theme="light"] .lang-dropdown {
    background: #ffffff;
}

.lang-dropdown {
    background: #0f1d33;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    transition: background 0.1s;
    text-align: left;
}

.lang-option:hover {
    background: var(--bg-secondary);
}

.lang-option--active {
    background: var(--accent-glow);
}

.lang-option-name {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
}

.lang-option-code {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Collapsed sidebar: hide code text, compact layout */
.sidebar.collapsed .lang-code,
.sidebar.collapsed .lang-chevron {
    display: none;
}

.sidebar.collapsed .lang-current {
    padding: 5px 7px;
}

.sidebar.collapsed .lang-dropdown {
    left: calc(var(--sidebar-collapsed-width) - 12px);
    bottom: auto;
    right: auto;
}

/* ===== Loading ===== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 14px;
    gap: 12px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

/* Global floating tooltip (positioned by js/floating-tip.js, appended to body) */
.app-floating-tip {
    position: fixed;
    z-index: 99990;
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 11px 13px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.app-floating-tip--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-floating-tip strong {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12px;
}

.app-floating-tip a {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.app-floating-tip a:hover {
    text-decoration: underline;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    /* Column layout so header/footer stay pinned and only the body scrolls */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

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

.modal-body {
    padding: 28px;
    /* Only the body scrolls; header and footer remain visible */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ===== Form section title (grouped modal fields) ===== */
.form-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}
.form-section-title:first-child {
    margin-top: 0;
}

/* ===== Grid Helpers ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ===== Mobile Sidebar ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(20px);
}

.mobile-header .sidebar-logo {
    height: 28px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease forwards;
}

/* ===== Vehicle Card Grid ===== */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-normal);
}

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

.vehicle-make {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.vehicle-model {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.vehicle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.vehicle-tests {
    display: flex;
    gap: 6px;
}

.test-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all var(--transition-fast);
}

.test-badge svg {
    flex-shrink: 0;
}

.test-badge.drivetest {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.test-badge.drivetest:hover {
    background: rgba(16, 185, 129, 0.22);
}

.test-badge.readout {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.test-badge.readout:hover {
    background: rgba(99, 102, 241, 0.22);
}

/* ===== Profile Page ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 28px;
    flex-shrink: 0;
}

/* ===== Settings Toggle ===== */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 500;
    color: var(--text-primary);
}

.settings-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* A settings row that stacks (label on top, wide control below) */
.settings-row--stacked {
    display: block;
    padding: 18px 0;
}
.settings-row--stacked > div:first-child {
    margin-bottom: 14px;
}

/* ===== Theme picker (Profile › Darstellung) ===== */
.theme-picker {
    width: 100%;
}

.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.theme-preset {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .12s;
    font-family: inherit;
}

.theme-preset:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.theme-preset.is-active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.theme-swatch {
    position: relative;
    width: 100%;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.theme-swatch-surface {
    position: absolute;
    left: 10px;
    top: 12px;
    width: 62%;
    height: 26px;
    border-radius: 5px;
    border: 1px solid transparent;
}

.theme-swatch-accent {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.theme-swatch-brush {
    position: absolute;
    left: 10px;
    bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
}

.theme-preset-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-preset-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Custom theme editor --- */
.theme-custom-editor {
    margin-top: 16px;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    animation: orgFadeUp .22s ease both;
}

.theme-custom-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.theme-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.theme-base-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.theme-seg {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.theme-seg button {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.theme-seg button.is-on {
    background: var(--accent-primary);
    color: #fff;
}

.theme-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.theme-color-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    cursor: pointer;
}

.theme-color-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.theme-color-input input[type="color"] {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
}
.theme-color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.theme-color-input input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.2); border-radius: 7px; }
.theme-color-input input[type="color"]::-moz-color-swatch { border: 1px solid rgba(0,0,0,.2); border-radius: 7px; }

.theme-color-hex {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.theme-custom-reset {
    margin-top: 16px;
}

/* ===== Detail Sidebar (global) ===== */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999;
}

.detail-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-sidebar.open {
    transform: translateX(0);
}

.detail-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.detail-sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.detail-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-section:has(.detail-section-title) {
    align-items: stretch;
}

.detail-avatar {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.detail-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.detail-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.detail-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 7px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.detail-row + .detail-row {
    border-top: 1px solid color-mix(in srgb, var(--border-color) 50%, transparent);
}

.detail-row-label {
    font-size: 13px;
    color: var(--text-muted);
}

.detail-row-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.detail-linked-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.detail-linked-item:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
}

.detail-linked-item + .detail-linked-item {
    margin-top: 5px;
}

/* ===== Toolbar area above content ===== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

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

/* ===== Footer / Version ===== */
.sidebar-version {
    padding: 8px 20px 16px;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ===== Blazor overrides ===== */
#blazor-error-ui {
    display: none;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    outline: none;
    border-color: var(--accent-danger) !important;
}

.validation-message {
    color: var(--accent-danger);
    font-size: 12px;
    margin-top: 4px;
}

/* ===== Dashboard ===== */

.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-grid {
    display: grid;
    gap: 16px;
    transition: all var(--transition-normal);
}

.dash-grid.edit-mode {
    gap: 12px;
    padding: 8px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(59,130,246,0.015) 20px,
        rgba(59,130,246,0.015) 40px
    );
}

.dash-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dash-widget:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.dash-widget.editable {
    border-style: dashed;
    border-color: rgba(59,130,246,0.3);
}

.dash-widget.editable:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

/* Drag Handle */
.drag-grip {
    cursor: grab;
    padding: 2px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    flex-shrink: 0;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.drag-grip:hover {
    color: var(--accent-primary);
    background: rgba(59,130,246,0.1);
}

.drag-grip:active {
    cursor: grabbing;
}

/* Drag States
   Das gezogene Widget wird aus dem Grid-Fluss genommen (position: absolute + 0-Größe),
   damit ausschließlich der Placeholder einen Slot belegt und die übrigen Widgets
   sofort und eindeutig aufrücken. Das Drag-Bild wird vom Browser separat gezeichnet. */
.dash-widget.dragging {
    position: absolute;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

/* Drop Placeholder */
.dash-widget--placeholder {
    border: 2px dashed var(--accent-primary) !important;
    border-radius: var(--radius-md);
    background: rgba(59,130,246,0.05);
    box-shadow: inset 0 0 30px rgba(59,130,246,0.06);
    min-height: 60px;
    pointer-events: none;
    overflow: hidden;
    position: relative;
    animation: placeholderAppear 0.25s cubic-bezier(0.2, 0, 0.2, 1) both;
}

.dash-widget--placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59,130,246,0.08) 50%,
        transparent 100%
    );
    animation: placeholderShimmer 2s ease-in-out infinite;
}

@keyframes placeholderAppear {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes placeholderShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.widget-edit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(59,130,246,0.08);
    border-bottom: 1px solid rgba(59,130,246,0.15);
    gap: 8px;
    flex-shrink: 0;
}

.widget-edit-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-edit-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.widget-edit-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-fast);
    padding: 0;
}

.widget-edit-btn:hover {
    background: rgba(59,130,246,0.15);
    color: var(--accent-primary);
}

.widget-edit-btn.danger:hover {
    background: rgba(239,68,68,0.15);
    color: var(--accent-danger);
}

.widget-edit-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.widget-size-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
    font-family: monospace;
}

.widget-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Stat Widget */
.widget-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px 16px;
    text-align: center;
    gap: 8px;
}

.widget-stat-icon {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .38s cubic-bezier(.2,.85,.25,1), box-shadow .38s ease;
    will-change: transform;
}

/* Dezenter, pulsierender Ring hinter dem Icon (Idle) — kollidiert nicht mit den
   Hover-Transforms des Icon-Containers, da nur das Pseudo-Element animiert wird. */
.widget-stat-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid currentColor;
    opacity: 0;
    transform: scale(1);
    transition: opacity .4s ease, transform .4s cubic-bezier(.2,.85,.25,1);
    pointer-events: none;
}

.widget-stat-icon svg {
    transition: transform .38s cubic-bezier(.2,.85,.25,1);
}

/* Icon "atmet" leicht als Lebenszeichen */
@keyframes statIconGlow {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 22%, transparent); }
    50%      { box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 0%, transparent); }
}
.widget-stat-icon { animation: statIconGlow 3.6s ease-in-out infinite; }

/* Hover: Icon hebt sich, dreht/skaliert leicht, Glow + expandierender Ring */
.widget-stat:hover .widget-stat-icon {
    transform: translateY(-3px) scale(1.09);
    box-shadow: 0 10px 24px color-mix(in srgb, currentColor 40%, transparent);
    animation: none;
}
.widget-stat:hover .widget-stat-icon svg { transform: scale(1.14) rotate(-7deg); }
.widget-stat:hover .widget-stat-icon::after { opacity: .45; transform: scale(1.35); }

.widget-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
    transition: transform .3s cubic-bezier(.2,.85,.25,1);
}
.widget-stat:hover .widget-stat-value { transform: scale(1.05); }

.widget-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cost Widget */
.widget-cost {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 20px;
    justify-content: center;
    gap: 10px;
}

.widget-cost-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.widget-cost-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.widget-cost-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.widget-cost-count {
    color: var(--text-muted);
    font-size: 11px;
    min-width: 32px;
}

.widget-cost-price {
    color: var(--text-muted);
    font-size: 11px;
    flex: 1;
}

.widget-cost-sum {
    font-weight: 600;
    color: var(--text-primary);
    margin-left: auto;
}

/* Chart Widget */
.widget-chart {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    gap: 8px;
}

.widget-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.widget-chart-area {
    flex: 1;
    min-height: 0;
    position: relative;
}

.widget-chart-area canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Gauge Center Label */
.gauge-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.gauge-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.gauge-unit {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Table Widget */
.widget-table {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    gap: 8px;
}

.widget-table-scroll {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.data-table.compact th,
.data-table.compact td {
    padding: 6px 10px;
    font-size: 12px;
}

/* Widget Table Header & Search */
.widget-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.widget-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 10px;
    transition: border-color var(--transition-fast);
    max-width: 220px;
    flex: 1;
}

.widget-search-bar:focus-within {
    border-color: var(--border-focus);
}

.widget-search-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    width: 100%;
    padding: 2px 0;
    font-family: inherit;
}

.widget-search-input::placeholder {
    color: var(--text-muted);
}

.widget-search-clear {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    border-radius: 4px;
    flex-shrink: 0;
}

.widget-search-clear:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

/* Widget Table Footer */
.widget-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 0;
    border-top: 1px solid var(--border-color);
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.widget-table-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.widget-table-pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ranking Widget */
.widget-ranking {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    gap: 8px;
}

.widget-ranking-list {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.ranking-pos {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(59,130,246,0.12);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ranking-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.dash-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

/* Widget Catalog */
/* ===== Widget-Katalog (zentrales Popup-Dialog) ===== */
.wcat-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 960px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: wcatPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wcatPop {
    from { transform: translateY(10px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.wcat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border-color);
}

.wcat-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.wcat-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wcat-close {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* ── Kategorie-Filter-Tabs ── */
.wcat-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
}

.wcat-tabs::-webkit-scrollbar { display: none; }

.wcat-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.wcat-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.wcat-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.wcat-tab-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
}

.wcat-tab.active .wcat-tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Scrollbarer Inhalt ── */
.wcat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 26px 26px;
}

.wcat-section {
    margin-bottom: 26px;
}

.wcat-section:last-child { margin-bottom: 0; }

.wcat-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.wcat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 14px;
}

/* ── Widget-Karte ── */
.wcat-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.wcat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.wcat-card.added {
    opacity: 0.62;
}

.wcat-card.added:hover {
    opacity: 1;
}

/* ── Beispiel-Vorschau ── */
.wcat-preview {
    position: relative;
    height: 84px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    margin-bottom: 11px;
    color: var(--text-muted);
    overflow: hidden;
}

.wcat-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-success);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* ── Karten-Text ── */
.wcat-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wcat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
    flex-shrink: 0;
}

.wcat-card-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcat-card-desc {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 7px 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wcat-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.wcat-size {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.wcat-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 700;
    transition: background var(--transition-fast);
}

.wcat-card:hover .wcat-add {
    background: var(--accent-primary);
    color: #fff;
}

.wcat-card.added .wcat-add {
    background: rgba(16, 185, 129, 0.14);
    color: var(--accent-success);
}

/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 6px rgba(59,130,246,0.3);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
}

/* Clickable Row */
.clickable-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.clickable-row:hover {
    background: rgba(59,130,246,0.08) !important;
}

/* SOH Hero Card */
.soh-hero {
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid;
}

.soh-hero-good {
    background: rgba(16,185,129,0.06);
    border-color: rgba(16,185,129,0.2);
}

.soh-hero-warning {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.2);
}

.soh-hero-critical {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.25);
    animation: criticalPulse 2s ease infinite;
}

@keyframes criticalPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    50% { box-shadow: 0 0 16px 2px rgba(239,68,68,0.15); }
}

.soh-hero-left {
    flex-shrink: 0;
}

.soh-hero-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.soh-hero-value {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}

.soh-hero-good .soh-hero-value { color: #10b981; }
.soh-hero-warning .soh-hero-value { color: #f59e0b; }
.soh-hero-critical .soh-hero-value { color: #ef4444; }

.soh-hero-unit {
    font-size: 22px;
    font-weight: 700;
    opacity: 0.7;
}

.soh-hero-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
}

.soh-hero-good .soh-hero-status { color: #10b981; }
.soh-hero-warning .soh-hero-status { color: #f59e0b; }
.soh-hero-critical .soh-hero-status { color: #ef4444; }

.soh-hero-bar-wrap {
    flex: 1;
    min-width: 0;
}

.soh-hero-bar {
    height: 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.soh-hero-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
}

.soh-hero-good .soh-hero-bar-fill { background: linear-gradient(90deg, #059669, #10b981); }
.soh-hero-warning .soh-hero-bar-fill { background: linear-gradient(90deg, #d97706, #f59e0b); }
.soh-hero-critical .soh-hero-bar-fill { background: linear-gradient(90deg, #dc2626, #ef4444); }

.soh-hero-range {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: monospace;
}

/* Detail Modal */
.detail-modal {
    max-width: 720px;
    width: 95vw;
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.detail-metric-card {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    text-align: center;
}

.detail-metric-card.accent-blue { border-left: 3px solid #3b82f6; }
.detail-metric-card.accent-cyan { border-left: 3px solid #06b6d4; }
.detail-metric-card.accent-purple { border-left: 3px solid #8b5cf6; }
.detail-metric-card.accent-green { border-left: 3px solid #10b981; }

.detail-metric-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-metric-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
}

.detail-info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Cell Sections */
.cell-section {
    margin-bottom: 24px;
}

.cell-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

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

.cell-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cell-stat {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
}

.cell-stat.cold { background: rgba(59,130,246,0.12); color: #60a5fa; }
.cell-stat.hot { background: rgba(239,68,68,0.12); color: #f87171; }
.cell-stat.low { background: rgba(239,68,68,0.12); color: #f87171; }
.cell-stat.high { background: rgba(16,185,129,0.12); color: #34d399; }
.cell-stat.neutral { background: rgba(148,163,184,0.12); color: var(--text-secondary); }

/* Cell Heatmap Grid */
.cell-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
}

.cell-tile {
    position: relative;
    padding: 8px 6px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.06);
    transition: all var(--transition-fast);
    /* Gradient from blue (cold/low) to red (hot/high) via the --cell-heat custom property */
    background: color-mix(
        in srgb,
        rgba(59,130,246,0.18) calc((1 - var(--cell-heat)) * 100%),
        rgba(239,68,68,0.18)
    );
}

.cell-tile:hover {
    transform: scale(1.08);
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.15);
}

.cell-tile.cell-min {
    border: 2px solid #60a5fa;
    box-shadow: 0 0 8px rgba(96,165,250,0.25);
}

.cell-tile.cell-max {
    border: 2px solid #f87171;
    box-shadow: 0 0 8px rgba(248,113,113,0.25);
}

.cell-id {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.cell-val {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
    line-height: 1;
}

/* Cell Legend */
.cell-legend {
    margin-top: 10px;
    max-width: 200px;
}

.cell-legend-bar {
    height: 6px;
    border-radius: 3px;
}

.cell-legend-bar.temp-bar {
    background: linear-gradient(to right, #3b82f6, #f59e0b, #ef4444);
}

.cell-legend-bar.volt-bar {
    background: linear-gradient(to right, #ef4444, #10b981, #f59e0b);
}

.cell-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Light theme cell overrides */
.light-theme .cell-tile {
    border-color: rgba(0,0,0,0.06);
}

.light-theme .cell-tile:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.12);
}

/* Responsive */
@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr !important;
    }
    .dash-widget {
        grid-column: span 1 !important;
    }
    .wcat-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .detail-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .cell-heatmap {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    }
}

/* ===== Supported Vehicles Appbar ===== */

.sv-appbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 -16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-shrink: 0;
}

[data-theme="light"] .sv-appbar {
    background: var(--bg-card);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.sv-appbar-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, #06b6d4 40%, var(--accent-primary) 70%, transparent 100%);
    opacity: 0.85;
}

.sv-appbar-inner {
    padding: 12px 32px 14px;
}

.sv-appbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sv-appbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.sv-appbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    color: #fff;
}

.sv-appbar-text {
    min-width: 0;
}

.sv-appbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sv-appbar-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
    letter-spacing: 0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sv-appbar-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sv-appbar-action:hover {
    color: var(--accent-primary);
    background: var(--bg-input-focus);
    border-color: var(--border-hover);
    box-shadow: 0 0 12px var(--accent-glow);
}

.sv-appbar-action:active {
    transform: scale(0.97);
}

/* Appbar Stats Row */
.sv-appbar-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

[data-theme="light"] .sv-appbar-stats {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.sv-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 11.5px;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.sv-chip:hover {
    color: var(--text-primary);
    background: var(--bg-input-focus);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.sv-chip:active {
    transform: translateY(0) scale(0.97);
}

.sv-chip-val {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.sv-chip-lbl {
    color: var(--text-muted);
    font-weight: 400;
}

.sv-chip-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Chip color variants */
.sv-chip--green:hover, .sv-chip--green.sv-chip--active {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
}
.sv-chip--green.sv-chip--active .sv-chip-val { color: #10b981; }

.sv-chip--amber:hover, .sv-chip--amber.sv-chip--active {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
}
.sv-chip--amber.sv-chip--active .sv-chip-val { color: #f59e0b; }

.sv-chip--blue:hover, .sv-chip--blue.sv-chip--active {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.1);
}
.sv-chip--blue.sv-chip--active .sv-chip-val { color: #3b82f6; }

.sv-chip--cyan:hover, .sv-chip--cyan.sv-chip--active {
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.1);
}
.sv-chip--cyan.sv-chip--active .sv-chip-val { color: #06b6d4; }

.sv-chip--active {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .sv-appbar {
        margin: 0;
    }

    .sv-appbar-inner {
        padding: 10px 16px 12px;
    }

    .sv-appbar-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sv-appbar-title {
        font-size: 17px;
    }

    .sv-appbar-action {
        width: 100%;
        justify-content: center;
    }

    .sv-appbar-stats {
        gap: 6px;
    }

    .sv-chip {
        padding: 5px 10px;
        font-size: 11.5px;
    }

    .sv-chip-divider {
        display: none;
    }
}

/* ===== Supported Vehicles Page ===== */

.sv-stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.sv-stat strong {
    color: var(--text-primary);
    font-weight: 700;
}

.sv-stat-sep {
    opacity: 0.4;
}

.sv-table-scroll {
    overflow: auto;
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sv-table-scroll .data-table {
    min-width: 1200px;
}

.sv-table-scroll .data-table td {
    height: 36px;
    max-height: 36px;
    padding: 0 10px;
    vertical-align: middle;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1;
    box-sizing: border-box;
}

.sv-table-scroll .data-table thead th {
    padding: 6px 12px;
    font-size: 11px;
}

.sv-table-scroll .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary, var(--bg-card));
    border-bottom: 2px solid var(--border-color);
    box-shadow: none;
}

/* ── Frozen / sticky columns (table layout templates) ── */
.sv-table-scroll .data-table td.sv-frozen-col {
    position: sticky;
    z-index: 3;
    background: var(--bg-secondary);
}

.sv-table-scroll .data-table thead th.sv-frozen-col {
    z-index: 12;
    background: var(--bg-secondary, var(--bg-card));
}

.sv-table-scroll .data-table tbody tr:hover td.sv-frozen-col {
    background: var(--sv-frozen-hover);
}

.sv-table-scroll .data-table .sv-frozen-last {
    border-right: 1px solid var(--border-hover);
    box-shadow: 4px 0 6px -3px rgba(0, 0, 0, 0.45);
}

/* ── Toolbar template switcher ── */
.sv-tpl-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
}

.sv-tpl-select {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    max-width: 150px;
    cursor: pointer;
    outline: none;
}

.sv-tpl-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ── Template editor ── */
.sv-tpl-editor {
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
}

.sv-tpl-manage {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

.sv-tpl-create {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.sv-freeze-seg {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sv-freeze-opt {
    width: 44px;
    height: 34px;
    border: none;
    border-right: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sv-freeze-opt:last-child { border-right: none; }
.sv-freeze-opt:hover { background: var(--bg-input-focus); }

.sv-freeze-opt--active {
    background: var(--accent-primary);
    color: #fff;
}

.sv-col-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.sv-col-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
}

.sv-col-item--frozen {
    border-color: var(--border-hover);
    background: var(--accent-glow);
}

.sv-col-item--dragging {
    opacity: 0.4;
}

.sv-col-item--dragover {
    border-color: var(--accent-primary);
    box-shadow: inset 0 2px 0 0 var(--accent-primary);
}

.sv-col-grip {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    cursor: grab;
    flex-shrink: 0;
}

.sv-col-grip:active {
    cursor: grabbing;
}

.sv-col-item:hover .sv-col-grip {
    color: var(--text-secondary);
}

.sv-col-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sv-col-move {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: var(--bg-input-focus);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sv-col-move:hover:not(:disabled) {
    background: var(--accent-primary);
    color: #fff;
}

.sv-col-move:disabled {
    opacity: 0.35;
    cursor: default;
}

.sv-col-pin {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.sv-col-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sv-col-vis {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.sv-col-vis input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Full-height layout for SupportedVehicles page */
.sv-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: -32px;
    padding: 0 16px 0;
    overflow: hidden;
}

.sv-page > .data-table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    border-bottom: none;
    margin: 12px 0 24px;
    min-height: 0;
    overflow: hidden;
}

.sv-page > .data-table-wrapper > .data-table-header {
    flex-shrink: 0;
}

/* Compact toolbar: search + filters grouped on the left */
.sv-toolbar {
    padding: 12px 16px;
    gap: 8px;
}

.dt-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
}

.dt-header-left .search-bar {
    flex: 0 1 230px;
    max-width: 230px;
}

.dt-header-left .search-bar .form-control {
    padding: 7px 12px 7px 34px;
    font-size: 13px;
}

.dt-header-left .search-bar .search-icon {
    left: 12px;
}

.sv-filter {
    width: auto;
    min-width: 104px;
    padding: 5px 8px;
    font-size: 12px;
}

.sv-toolbar .toolbar-actions .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.sv-page > .data-table-wrapper > .sv-table-scroll {
    flex: 1;
    min-height: 0;
}

@media (max-width: 768px) {
    .sv-page {
        margin: -16px;
        height: 100vh;
    }
}

.sv-th-sort {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.sv-th-sort:hover {
    color: var(--accent-primary);
}

.sv-sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 12px;
    color: var(--accent-primary);
}

.sv-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sv-row:hover {
    background: var(--accent-glow);
}

.sv-row td:first-child {
    border-left: 3px solid transparent;
    transition: border-color var(--transition-fast);
}

.sv-row:hover td:first-child {
    border-left-color: var(--accent-primary);
}

.sv-vehicle-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    width: fit-content;
}

/* Vehicle thumbnail in table row */
.sv-car-thumb {
    width: 72px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.9;
    transition: all var(--transition-fast);
}

.sv-row:hover .sv-car-thumb {
    opacity: 1;
    transform: scale(1.05);
}

/* Vehicle hero image in detail dialog */
.sv-car-hero-wrap {
    position: relative;
    text-align: center;
    margin: -8px -8px 20px;
    padding: 16px 0 0;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
    border-radius: var(--radius-sm);
}

.sv-car-hero {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.sv-car-hero.loaded {
    opacity: 1;
}

.sv-hero-skeleton {
    width: 280px;
    height: 140px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg,
        var(--bg-tertiary) 25%,
        color-mix(in srgb, var(--bg-tertiary) 60%, var(--border-color)) 50%,
        var(--bg-tertiary) 75%);
    background-size: 400% 100%;
    animation: svShimmer 1.6s ease infinite;
}

@keyframes svShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sv-hero-disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    margin-top: 8px;
    font-size: 10.5px;
    color: var(--text-muted);
    opacity: 0.7;
}

.sv-hero-source {
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
    font-weight: 600;
}

.sv-brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
    filter: grayscale(0.2) brightness(0.9);
    transition: all var(--transition-fast);
}

.sv-brand-logo {
    filter: invert(1) grayscale(0.2);
}

[data-theme="light"] .sv-brand-logo {
    filter: grayscale(0.2) brightness(0.9);
}

.sv-row:hover .sv-brand-logo {
    opacity: 1;
    transform: scale(1.1);
}

.sv-row:hover .sv-brand-logo {
    filter: invert(1);
}

[data-theme="light"] .sv-row:hover .sv-brand-logo {
    filter: none;
}

.sv-brand-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sv-cell-make {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 3px;
}

.sv-cell-model {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.sv-cell-variant {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.2;
}

/* ── Test Labels (DRIVETEST / READOUT) ── */
.sv-test-label {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.3;
    background: none;
}

.sv-test-label--drive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.10);
}

.sv-test-label--drive:hover {
    background: rgba(16, 185, 129, 0.20);
}

.sv-test-label--readout {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.10);
}

.sv-test-label--readout:hover {
    background: rgba(99, 102, 241, 0.20);
}

/* ── Test Procedure Button ── */
.sv-procedure-btn {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    color: var(--accent-primary);
    max-width: 200px;
    line-height: 1.4;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.sv-procedure-btn:hover {
    color: var(--accent-hover);
    text-decoration-style: solid;
}

/* ── Test Info Modal ── */
.sv-test-info-modal {
    max-width: 520px;
}

.sv-info-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 20px;
}

.sv-info-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sv-info-steps li {
    counter-increment: step;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px 14px 52px;
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-left: 15px;
}

.sv-info-steps li:last-child {
    border-left-color: transparent;
}

.sv-info-steps li::before {
    content: counter(step);
    position: absolute;
    left: -15px;
    top: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-info-steps li strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sv-info-steps li span {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Test Procedure Detail Dialog ── */
.sv-procedure-detail-head {
    margin-bottom: 16px;
}

.sv-procedure-detail-vehicle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.sv-procedure-detail-body {
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.sv-val {
    font-weight: 600;
    color: var(--text-primary);
}

.sv-unit {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.sv-power-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sv-epower {
    font-size: 12px;
    color: var(--accent-info);
}

.sv-muted {
    color: var(--text-muted);
    opacity: 0.5;
}

.sv-placeholder {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 12px;
    font-style: italic;
    user-select: none;
}

/* Table loading states */
.sv-table-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    min-height: 200px;
}

/* ── Battery loading animation (shared) ── */
.batt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
    min-height: 320px;
}

.batt-loading-icon {
    position: relative;
    animation: battFloat 2.4s ease-in-out infinite;
}

.batt-body, .batt-cap { fill: none; }

.batt-fill {
    fill: var(--accent-primary);
    opacity: 0;
}

.batt-fill-1 { animation: battCellFill 2s ease-in-out infinite 0s; }
.batt-fill-2 { animation: battCellFill 2s ease-in-out infinite 0.35s; }
.batt-fill-3 { animation: battCellFill 2s ease-in-out infinite 0.7s; }

.batt-bolt {
    animation: battBoltPulse 2s ease-in-out infinite;
    transform-origin: center;
}

.batt-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.batt-loading-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes battCellFill {
    0%, 10%  { opacity: 0; transform: scaleY(0.85); }
    30%, 70% { opacity: 0.85; transform: scaleY(1); }
    90%, 100% { opacity: 0; transform: scaleY(0.85); }
}

@keyframes battBoltPulse {
    0%, 100% { opacity: 0.5; transform: scale(0.92); }
    50%      { opacity: 1; transform: scale(1.05); }
}

@keyframes battFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.sv-table-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-card) 70%, transparent);
    z-index: 5;
    pointer-events: none;
}

.sv-table-dimmed {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Pagination */
.sv-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2px;
    padding: 10px 20px;
    flex-shrink: 0;
    background: var(--bg-secondary, var(--bg-card));
    border-top: 2px solid var(--border-color);
}

.sv-page-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 10px;
}

.sv-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sv-page-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sv-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.sv-page-btn--active {
    background: var(--accent-primary);
    color: #fff;
    font-weight: 600;
}

.sv-page-btn--active:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* Detail Dialog */
.sv-detail-modal {
    max-width: 620px;
}

.sv-detail-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sv-detail-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.sv-detail-logo {
    filter: invert(1) grayscale(0.2);
}

[data-theme="light"] .sv-detail-logo {
    filter: none;
}

.sv-detail-make {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: 2px;
}

.sv-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.sv-dstat {
    text-align: center;
    padding: 16px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.sv-dstat-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sv-dstat-lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sv-sec-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.sv-specs {
    margin-bottom: 24px;
}

.sv-spec {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.sv-spec:last-child {
    border-bottom: none;
}

.sv-spec-l {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sv-spec-v {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.sv-market-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    gap: 10px;
}

/* ===== Market Value Side Panel ===== */
.sv-market-modal {
    max-width: 720px;
    width: 95vw;
}

/* Row Button */
.sv-mv-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sv-mv-row-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.sv-mv-row-btn--active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.sv-mv-row-btn:active {
    transform: scale(0.96);
}

.sv-mv-loading {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
    justify-content: center;
}

.sv-price-tag {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: svPriceReveal 0.5s ease forwards;
}

.sv-price-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #10b981);
    background-size: 200% 100%;
    animation: svShimmer 3s linear infinite;
}

@keyframes svPriceReveal {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes svShimmer {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.sv-price-tag-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.sv-price-range {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.sv-price-lo {
    color: var(--accent-success);
}

.sv-price-hi {
    color: var(--accent-primary);
}

.sv-price-sep {
    margin: 0 10px;
    color: var(--text-muted);
    font-weight: 400;
}

.sv-price-avg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.sv-price-avg-lbl {
    font-size: 13px;
    color: var(--text-secondary);
}

.sv-price-avg-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.sv-price-src {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* SOH Chart */
.sv-cert-val {
    font-size: 12.5px;
    font-weight: 600;
    color: #10b981;
}

.sv-table-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 20px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
}

.sv-table-disclaimer svg {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.6;
}

.sv-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    margin-bottom: 10px;
}

.sv-chart-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sv-chart-expand-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.sv-chart-wrap {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 8px 8px;
    margin-bottom: 20px;
}

.sv-chart-wrap--large {
    padding: 20px 12px 12px;
    margin-bottom: 16px;
}

/* SOH Chart Detail Modal */
.sv-chart-detail-modal {
    max-width: 780px;
    width: 95vw;
}

.sv-chart-detail-table {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sv-chart-detail-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.sv-chart-detail-table th {
    text-align: left;
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.sv-chart-detail-table td {
    padding: 7px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.sv-chart-detail-table tr:last-child td {
    border-bottom: none;
}

.sv-chart-detail-table .sv-soh-good td:first-child { color: #10b981; }
.sv-chart-detail-table .sv-soh-mid td:first-child { color: #f59e0b; }
.sv-chart-detail-table .sv-soh-low td:first-child { color: #ef4444; }

.sv-chart-detail-table .sv-soh-diff {
    color: #10b981;
    font-weight: 600;
}

/* ── Listings Section ── */
.sv-listings-section {
    margin-top: 24px;
}

.sv-listings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sv-listings-toggle:hover {
    background: var(--bg-secondary);
}

.sv-listings-toggle svg:first-child {
    color: var(--text-muted);
    flex-shrink: 0;
}

.sv-listings-chevron {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.sv-listings-chevron--open {
    transform: rotate(180deg);
}

.sv-listings-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 320px;
    overflow-y: auto;
}

.sv-listing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
}

.sv-listing-item:last-child {
    border-bottom: none;
}

.sv-listing-source {
    font-size: 11.5px;
    color: var(--text-muted);
}

.sv-listing-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.sv-listings-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

.sv-listings-source-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.sv-listings-source-link:hover {
    background: var(--bg-tertiary);
}

.sv-listings-source-link + .sv-listings-source-link {
    border-top: 1px solid var(--border-color);
}

/* ── VIN Decoder ── */
.sv-vin-modal {
    max-width: 480px;
}

.sv-vin-input {
    font-size: 15px !important;
    padding: 10px 14px !important;
}

.sv-vin-result {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.sv-vin-result--success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sv-vin-result--success .sv-vin-result-icon { color: #10b981; }

.sv-vin-result--warn {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sv-vin-result--warn .sv-vin-result-icon { color: #f59e0b; }

.sv-vin-result-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.sv-vin-result-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sv-vin-result-make {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.sv-vin-result-model {
    font-size: 13px;
    color: var(--text-secondary);
}

.sv-vin-result-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.sv-vin-match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.sv-vin-match-row:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.sv-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-sm);
}

.sv-deleted-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
}

/* Certificate Comparison */
.sv-cert-compare {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(16, 185, 129, 0.06) 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
}

.sv-cert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.sv-cert-cards {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sv-cert-card {
    flex: 1;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.sv-cert-card--without {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}

.sv-cert-card--with {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(16, 185, 129, 0.12) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.08);
}

.sv-cert-card-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sv-cert-card--with .sv-cert-card-label {
    color: var(--accent-primary);
}

.sv-cert-card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sv-cert-card--with .sv-cert-card-price {
    color: var(--accent-primary);
}

.sv-cert-card-range {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sv-cert-arrow {
    flex-shrink: 0;
    color: var(--accent-primary);
    opacity: 0.5;
}

.sv-cert-uplift {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 18px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.06));
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    border-radius: 14px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.06), 0 6px 20px -8px rgba(16, 185, 129, 0.4);
}

.sv-cert-uplift-hero {
    font-size: 34px;
    font-weight: 800;
    color: #10b981;
    letter-spacing: -0.5px;
    line-height: 1;
    text-shadow: 0 1px 12px rgba(16, 185, 129, 0.25);
}

.sv-cert-uplift-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.sv-cert-uplift-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
}

/* ── Premium formula transparency ── */
.sv-formula {
    margin-top: 12px;
}

.sv-formula-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sv-formula-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.sv-formula-toggle .sv-formula-chevron {
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.sv-formula-toggle--open .sv-formula-chevron {
    transform: rotate(180deg);
}

.sv-formula-body {
    margin-top: 8px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.sv-formula-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.sv-formula-row + .sv-formula-row {
    border-top: 1px solid color-mix(in srgb, var(--border-color) 50%, transparent);
}

.sv-formula-pct {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.sv-formula-row--sum {
    margin-top: 2px;
    border-top: 2px solid var(--border-color) !important;
    font-weight: 700;
    color: var(--text-primary);
}

.sv-formula-row--sum .sv-formula-pct {
    color: #10b981;
}

.sv-formula-eq {
    margin-top: 12px;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(16, 185, 129, 0.07);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.sv-formula-eq strong {
    color: #10b981;
}

.sv-formula-note {
    margin-top: 10px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .sv-cert-cards {
        flex-direction: column;
    }

    .sv-cert-arrow {
        transform: rotate(90deg);
    }

    .sv-cert-card {
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sv-detail-stats {
        grid-template-columns: 1fr;
    }
    .sv-price-range {
        font-size: 20px;
    }
}

/* ===== My R.Dongle ===== */

/* Full-height layout */
.dng-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: -32px;
    padding: 0 16px 0;
    overflow: hidden;
}

.dng-page > .data-table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    border-bottom: none;
    margin: 12px 0 24px;
    min-height: 0;
    overflow: hidden;
}

.dng-page > .data-table-wrapper > .data-table-header {
    flex-shrink: 0;
}

.dng-page > .data-table-wrapper > .sv-table-scroll {
    flex: 1;
    min-height: 0;
}

.dng-page > .data-table-wrapper > .sv-table-scroll .data-table {
    min-width: 1100px;
}

.dng-page > .data-table-wrapper > .sv-table-scroll .data-table td {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .dng-page {
        margin: -16px;
        height: 100vh;
    }
}

/* Appbar brand */
.dng-appbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 4px;
}

.dng-appbar-img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.dng-appbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Table helpers */
.dng-th-sort {
    cursor: pointer;
    user-select: none;
}

.dng-th-sort:hover {
    color: var(--text-primary);
}

.dng-sort-arrow {
    margin-left: 4px;
    font-size: 12px;
}

.dng-th-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dng-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.dng-info-btn:hover {
    opacity: 1;
    color: var(--accent-primary);
}

/* ── Edit dialog: branch picker ── */
.dng-branch-picker {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 200px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.dng-branch-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dng-branch-option:hover {
    background: var(--bg-card-hover);
}

.dng-branch-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* ── Edit dialog: toggle switch ── */
.dng-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.dng-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dng-switch-track {
    width: 40px;
    height: 22px;
    border-radius: 22px;
    background: var(--bg-input-focus);
    border: 1px solid var(--border-color);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.dng-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.dng-switch input:checked + .dng-switch-track {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.dng-switch input:checked + .dng-switch-track::after {
    transform: translateX(18px);
    background: #fff;
}

.dng-switch input:focus-visible + .dng-switch-track {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Boolean indicators */
.dng-bool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.dng-bool--on {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.dng-bool--off {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    opacity: 0.4;
}

/* Branch buttons */
.dng-branches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dng-branch-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.dng-branch-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

/* ===== Branding Admin ===== */
.brn-section {
    margin-bottom: 24px;
}

.brn-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
}

.brn-logo-preview {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.brn-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.brn-color-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brn-color-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.brn-color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brn-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.brn-color-swatch:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.brn-color-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.brn-color-text {
    font-size: 12px !important;
    padding: 4px 8px !important;
    font-family: monospace;
}

@media (max-width: 600px) {
    .brn-color-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== SearchableSelect (compact filter dropdown w/ quick search) ===== */
.ss-wrap {
    position: relative;
    display: inline-block;
}

/* Trigger button — inherits .form-control look, laid out as label + chevron */
.ss-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.ss-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.ss-chevron--open {
    transform: rotate(180deg);
}

/* Trigger styling for the SOH results toolbar (mirrors .sv-filter) */
.soh-filter-select {
    width: auto;
    min-width: 104px;
    padding: 5px 8px;
    font-size: 12px;
}

/* Click-catcher to close the panel when clicking outside */
.ss-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: transparent;
}

/* Dropdown panel */
.ss-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2101;
    min-width: 100%;
    width: max-content;
    max-width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: ss-pop 0.12s ease-out;
}

@keyframes ss-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Search box inside the panel */
.ss-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.ss-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.ss-search-input::placeholder {
    color: var(--text-muted);
}

/* Options list */
.ss-options {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}

.ss-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, var(--text-primary));
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.ss-option:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.ss-option--active {
    color: var(--accent-primary);
    font-weight: 600;
}

.ss-option--active svg {
    flex-shrink: 0;
    color: var(--accent-primary);
}

.ss-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-empty {
    padding: 14px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
}
