/**
 * CarCollector - High-Octane Motorsport & Supercar Dark Theme
 * 
 * Precision-engineered dark aesthetic with carbon textures, telemetry consoles,
 * and high-contrast racing crimson accents.
 */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,500;0,600;0,700;1,600;1,700&family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Racing Dark & Crimson */
    --color-bg: #090c10;
    --color-surface: #121620;
    --color-surface-elevated: #181d2a;
    --color-surface-hover: #1f2636;
    --color-border: #222a38;
    --color-border-subtle: #19202c;
    --color-border-glow: rgba(225, 6, 0, 0.4);
    
    --color-text: #f1f5f9;
    --color-text-muted: #8b99ae;
    --color-text-dim: #546274;
    
    /* Motorsport Accents */
    --color-primary: #e10600;            /* F1 / Brembo Racing Red */
    --color-primary-hover: #ff2019;
    --color-primary-dark: #a80500;
    --color-primary-contrast: #ffffff;
    --color-primary-glow: rgba(225, 6, 0, 0.4);
    
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-danger-border: rgba(239, 68, 68, 0.35);
    
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-success-border: rgba(16, 185, 129, 0.35);

    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-warning-border: rgba(245, 158, 11, 0.35);

    --color-badge-bg: #1c2432;

    /* Typography */
    --font-sans: 'Rajdhani', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Chakra Petch', 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Spacing & Radii (Crisp, precision-engineered) */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;

    /* Shadows & Glows */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-glow-red: 0 0 24px rgba(225, 6, 0, 0.45);
    --shadow-cockpit: 0 12px 36px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* Layout */
    --container-max-width: 1560px;
    --auth-max-width: 420px;
}

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

html {
    color-scheme: dark;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-text);
    background-color: var(--color-bg);
    /* Subtle carbon-composite speed weave pattern */
    background-image: 
        radial-gradient(ellipse at 50% -15%, rgba(225, 6, 0, 0.16) 0%, transparent 65%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%),
        linear-gradient(315deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%);
    background-size: 100% 100%, 16px 16px, 16px 16px, 16px 16px, 16px 16px;
    background-attachment: fixed;
    line-height: 1.55;
    min-height: 100vh;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
}

/* Custom Motorsport Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #090c10;
}
::-webkit-scrollbar-thumb {
    background: #202737;
    border-radius: 4px;
    border: 1px solid #141822;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.page-content {
    padding-top: 2.25rem;
    padding-bottom: 2.5rem;
}

/* Header & Navigation (Cockpit Telemetry Bar) */
.app-header {
    background: rgba(13, 17, 24, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(225, 6, 0, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(225, 6, 0, 0.2);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    font-style: italic;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.brand::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 1.15em;
    background: var(--color-primary);
    transform: skewX(-18deg);
    box-shadow: 0 0 10px var(--color-primary);
    border-radius: 1px;
}

.brand:hover {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(225, 6, 0, 0.8);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(225, 6, 0, 0.3);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(225, 6, 0, 0.2) 0%, rgba(225, 6, 0, 0.04) 100%);
    border: 1px solid rgba(225, 6, 0, 0.6);
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.25), inset 0 0 8px rgba(225, 6, 0, 0.15);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.user-meta strong {
    color: #ffffff;
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
}

/* Cards & Surfaces (Precision Composite Panels) */
.card {
    background: linear-gradient(145deg, #131722 0%, #0d1017 100%);
    border: 1px solid #222938;
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-cockpit);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6));
    pointer-events: none;
}

.card h1 {
    font-size: var(--font-size-2xl);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2 {
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
    color: #f8fafc;
}

.section {
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid #1e2634;
}

/* Authentication Screen */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background-color: var(--color-bg);
    background-image: 
        radial-gradient(circle at 50% 25%, rgba(225, 6, 0, 0.22) 0%, transparent 60%),
        radial-gradient(circle at 10% 85%, rgba(225, 6, 0, 0.1) 0%, transparent 45%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.014) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255, 255, 255, 0.014) 25%, transparent 25%),
        linear-gradient(315deg, rgba(255, 255, 255, 0.014) 25%, transparent 25%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.014) 25%, transparent 25%);
    background-size: 100% 100%, 100% 100%, 16px 16px, 16px 16px, 16px 16px, 16px 16px;
}

.auth-wrapper {
    width: 100%;
    max-width: var(--auth-max-width);
    display: flex;
    flex-direction: column;
}

.auth-card {
    width: 100%;
    background: linear-gradient(155deg, #141824 0%, #0c0f16 100%);
    border: 1px solid #242c3b;
    border-top: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 30px rgba(225, 6, 0, 0.2);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
    position: relative;
}

.auth-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.auth-header p {
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
}

.auth-footer {
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.auth-footer .dot {
    color: var(--color-primary);
    font-size: 0.9rem;
    line-height: 1;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
    color: #cbd5e1;
}

.form-group input,
.form-control {
    width: 100%;
    padding: 0.65rem 0.95rem;
    border: 1px solid #252d3c;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: #ffffff;
    background-color: #090c12;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input:focus,
.form-control:focus {
    border-color: var(--color-primary);
    background-color: #0c0f17;
    box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.25), 0 0 12px rgba(225, 6, 0, 0.2);
}

.form-group input::placeholder,
.form-control::placeholder {
    color: #4b5768;
    font-weight: 400;
}

/* Buttons (High-Performance Ergonomics) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-size-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #e10600 0%, #aa0500 100%);
    color: #ffffff;
    border: 1px solid #ff3d35;
    box-shadow: 0 4px 14px rgba(225, 6, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff1e18 0%, #cc0600 100%);
    box-shadow: 0 6px 20px rgba(225, 6, 0, 0.7), 0 0 15px rgba(225, 6, 0, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(225, 6, 0, 0.5);
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: #2b3547;
    color: #cbd5e1;
}

.btn-outline:hover {
    background-color: rgba(225, 6, 0, 0.12);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.25);
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: var(--font-size-xs);
}

.btn-xs {
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-danger {
    color: #f87171;
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-warn {
    color: #fbbf24;
    background-color: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
}

.btn-warn:hover {
    background-color: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.btn-success {
    color: #34d399;
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    background-color: rgba(16, 185, 129, 0.22);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Alerts (Track Condition Flags) */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.35rem;
    font-size: var(--font-size-sm);
    font-family: var(--font-body);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background-color: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    color: #fca5a5;
    box-shadow: inset 3px 0 0 #ef4444;
}

.alert-success {
    background-color: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: #86efac;
    box-shadow: inset 3px 0 0 #10b981;
}

.alert-info {
    background-color: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #7dd3fc;
    box-shadow: inset 3px 0 0 #0ea5e9;
}

/* Info Grid & Telemetry Items */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 600px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-item {
    padding: 1rem 1.15rem;
    background: linear-gradient(145deg, #0f131c 0%, #131824 100%);
    border-radius: var(--radius-md);
    border: 1px solid #1f2737;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.info-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.info-item:hover {
    border-color: rgba(225, 6, 0, 0.45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(225, 6, 0, 0.15);
    transform: translateY(-2px);
}

.info-item:hover::before {
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}

.info-label {
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.info-value {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #ffffff;
    word-break: break-all;
    letter-spacing: 0.02em;
}

/* Badges (Racing Telemetry Chips) */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    background-color: #1a2230;
    color: #cbd5e1;
    border: 1px solid #283344;
    white-space: nowrap;
}

.text-nowrap {
    white-space: nowrap !important;
}

.badge-primary {
    background-color: rgba(225, 6, 0, 0.2);
    color: #ff4d47;
    border-color: rgba(225, 6, 0, 0.55);
    box-shadow: 0 0 8px rgba(225, 6, 0, 0.25);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.45);
}

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

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

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #1a2230;
}

.page-header h1 {
    font-size: var(--font-size-2xl);
    letter-spacing: 0.05em;
}

/* User Form Grid & Cards */
.form-card {
    margin-bottom: 2rem;
    border: 1px solid rgba(225, 6, 0, 0.35);
    border-top: 3px solid var(--color-primary);
    background: linear-gradient(145deg, #131722 0%, #0d1017 100%);
    box-shadow: var(--shadow-cockpit);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.35rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #1f2738;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 600px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    padding-top: 1.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #e2e8f0;
}

.checkbox-label input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    accent-color: var(--color-primary);
    border-radius: var(--radius-sm);
}

.form-actions {
    display: flex;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

/* Data Table / Grid (Telemetry Datatable) */
.grid-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid #222938;
    border-top: 3px solid var(--color-primary);
    background: #0f131b;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    background: #0d1118;
    scrollbar-width: thin;
    scrollbar-color: #283448 #090c12;
}

/* Fixed viewport height on desktop for fixed grid size */
@media (min-width: 769px) {
    .table-responsive {
        height: calc(100vh - 320px);
        max-height: calc(100vh - 320px);
        min-height: 360px;
    }

    .brands-grid-card .table-responsive {
        height: calc(100vh - 340px);
        max-height: calc(100vh - 340px);
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        height: auto;
        max-height: 55vh;
        min-height: 260px;
    }
}

/* Custom scrollbar for grid table matching dark cockpit theme */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #090c12;
    border-left: 1px solid #1a2230;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #283448;
    border-radius: 4px;
    border: 2px solid #090c12;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary, #e10600);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: var(--font-size-sm);
}

.table th {
    padding: 0.95rem 1.15rem;
    background-color: #0b0e14;
    border-bottom: 2px solid #202837;
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table td {
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid #1a212e;
    vertical-align: middle;
    color: #cbd5e1;
    font-family: var(--font-body);
}

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

.table tr {
    transition: background-color 0.15s ease;
}

.table tr:hover td {
    background-color: rgba(225, 6, 0, 0.04);
    color: #ffffff;
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

/* Roles & Permissions 2-Column Cockpit Layout */
.roles-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 800px) {
    .roles-layout {
        grid-template-columns: 290px 1fr;
    }
}

.sidebar-card {
    padding: 1.35rem;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #1f2738;
    color: #ffffff;
}

.roles-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.role-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #2b3547;
}

.role-item.active {
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.18) 0%, rgba(225, 6, 0, 0.04) 100%);
    border: 1px solid rgba(225, 6, 0, 0.5);
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.15);
}

.role-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
    color: #cbd5e1;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.03em;
    gap: 0.5rem;
}

.role-item.active .role-link {
    color: #ffffff;
}

.role-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-count-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background-color: #1a2230;
    color: var(--color-text-muted);
    border: 1px solid #283344;
}

.role-delete-form {
    margin-left: 0.25rem;
}

.permissions-header {
    margin-bottom: 1.35rem;
}

.col-header-bulk {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.bulk-select {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border: 1px solid #283345;
    border-radius: var(--radius-sm);
    background-color: #121620;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bulk-select:hover {
    background-color: #1c2332;
    border-color: var(--color-primary);
    color: #ffffff;
}

.form-control-sm {
    padding: 0.35rem 0.55rem;
    border: 1px solid #262e3d;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    background-color: #0b0e14;
    color: #ffffff;
    outline: none;
    width: 100%;
    transition: border-color 0.15s ease;
}

.form-control-sm:focus {
    border-color: var(--color-primary);
}

.form-control-sm:disabled {
    background-color: #131720;
    color: var(--color-text-dim);
    border-color: #1c222e;
    cursor: not-allowed;
}

.screen-key {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    font-weight: normal;
    color: var(--color-text-dim);
    margin-left: 0.35rem;
}

/* =============================================================================
   Cockpit Layout, Header, Sliding Sidebar, & Telemetry Footer
   ============================================================================= */

/* Cockpit Page Wrapper */
body.has-cockpit-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.has-cockpit-layout > .page-content {
    flex: 1 0 auto;
}

body.sidebar-active {
    overflow: hidden;
}

/* -----------------------------------------------------------------------------
   Header & Telemetry Console
   ----------------------------------------------------------------------------- */
.header-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    font-style: italic;
    color: #ffffff;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-divider {
    color: rgba(225, 6, 0, 0.6);
    font-weight: 300;
    font-size: 1.1rem;
    user-select: none;
}

.brand-tagline {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Hamburger Sandwich Button */
.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(225, 6, 0, 0.35);
    border-radius: var(--radius-sm);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.sidebar-toggle-btn:hover {
    background: rgba(225, 6, 0, 0.2);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(225, 6, 0, 0.6);
    transform: translateY(-1px);
}

.sidebar-toggle-btn:active {
    transform: translateY(0);
}

/* Collection Telemetry Badges */
.header-badges {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: 0.5rem;
}

.collection-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.collection-badge.badge-primary {
    background: linear-gradient(135deg, rgba(35, 14, 18, 0.95) 0%, rgba(18, 22, 32, 0.95) 100%);
    border: 1px solid rgba(225, 6, 0, 0.45);
}

.collection-badge.badge-secondary {
    background: linear-gradient(135deg, rgba(22, 28, 40, 0.9) 0%, rgba(14, 18, 26, 0.9) 100%);
    border: 1px solid rgba(40, 52, 70, 0.8);
}

.collection-badge .badge-icon {
    display: flex;
    align-items: center;
    color: var(--color-primary);
}

.collection-badge .badge-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
}

.collection-badge .badge-count,
.collection-badge .badge-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(225, 6, 0, 0.6);
}

.collection-badge .badge-unit {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-dim);
}

.badge-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}

/* User Avatar & Dropdown Menu */
.user-avatar-container {
    position: relative;
}

.user-avatar-trigger {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    outline: none;
}

.user-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.4);
    transition: all 0.2s ease;
}

.user-avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #320c0c 0%, #171d29 100%);
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-avatar-trigger:hover .user-avatar-img,
.user-avatar-trigger:hover .user-avatar-initials {
    box-shadow: 0 0 18px rgba(225, 6, 0, 0.8);
    transform: scale(1.05);
}

.user-dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 220px;
    background: rgba(14, 18, 26, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #232c3d;
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
    padding: 0.85rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-profile {
    padding: 0 1rem 0.65rem 1rem;
}

.user-dropdown-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    font-size: 0.95rem;
}

.user-dropdown-username {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

.user-dropdown-role {
    margin-top: 0.4rem;
    display: flex;
    gap: 0.35rem;
}

.dropdown-divider {
    height: 1px;
    background: #1e2636;
    margin: 0.5rem 0;
}

.user-dropdown-links {
    display: flex;
    flex-direction: column;
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.user-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.user-dropdown-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

/* -----------------------------------------------------------------------------
   Sliding Sidebar Navigation Drawer
   ----------------------------------------------------------------------------- */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 86vw;
    background: #0d1118;
    border-right: 1px solid rgba(225, 6, 0, 0.35);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.85), inset -1px 0 0 rgba(255, 255, 255, 0.04);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid #1a2230;
    background: linear-gradient(180deg, rgba(22, 28, 40, 0.8) 0%, rgba(13, 17, 24, 0.8) 100%);
}

.sidebar-brand-group {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    font-style: italic;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.sidebar-brand-tagline {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* X Close Button replacing sandwich icon */
.sidebar-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #232c3d;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-close-btn:hover {
    color: #ffffff;
    background: rgba(225, 6, 0, 0.25);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.6);
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Line Separators for Each Category */
.sidebar-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(225, 6, 0, 0.4) 25%, rgba(40, 52, 70, 0.8) 75%, transparent 100%);
    margin: 0.75rem 0.4rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-left: 3px solid transparent;
    background: transparent;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(225, 6, 0, 0.5);
}

.sidebar-nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.18) 0%, rgba(225, 6, 0, 0.04) 100%);
    border-left-color: var(--color-primary);
    box-shadow: inset 0 0 10px rgba(225, 6, 0, 0.15);
}

.sidebar-icon-box {
    display: flex;
    align-items: center;
    color: var(--color-text-dim);
    transition: color 0.18s ease;
}

.sidebar-nav-link:hover .sidebar-icon-box,
.sidebar-nav-link.active .sidebar-icon-box {
    color: var(--color-primary);
}

/* Category Grouping with Collapsible Header & Indented Items */
.sidebar-category-block {
    margin: 0.25rem 0;
}

.sidebar-category-header.sidebar-category-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-category-header.sidebar-category-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-category-header.sidebar-category-toggle:hover .sidebar-category-title {
    color: #ffffff;
}

.sidebar-category-header.sidebar-category-toggle:hover .sidebar-category-chevron {
    color: var(--color-primary);
}

.sidebar-category-title {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--color-primary);
    transition: color 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-category-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-category-count {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-dim);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.18s ease;
}

.sidebar-category-chevron {
    color: var(--color-text-dim);
    transform: rotate(0deg);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s ease;
}

/* Category Items Container */
.sidebar-category-items {
    padding-left: 0.5rem;
    margin-left: 0.85rem;
    border-left: 1px dashed rgba(225, 6, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 800px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, margin 0.2s ease, padding 0.2s ease;
}

/* Collapsed State (Default) */
.sidebar-category-block.is-collapsed .sidebar-category-items {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-left-color: transparent;
    pointer-events: none;
}

.sidebar-category-block.is-collapsed .sidebar-category-chevron {
    transform: rotate(-90deg);
}

/* Visual indication when category contains active child while collapsed */
.sidebar-category-block.is-collapsed.has-active-child .sidebar-category-header {
    background: rgba(225, 6, 0, 0.08);
    border-color: rgba(225, 6, 0, 0.22);
}

.sidebar-category-block.is-collapsed.has-active-child .sidebar-category-count {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(225, 6, 0, 0.35);
}

.sidebar-grouped-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.9rem 1.15rem;
    border-top: 1px solid #1a2230;
    background: #090c10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-primary);
}

.sidebar-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a0b0b 0%, #151a24 100%);
    border: 1px solid var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    font-size: 0.85rem;
}

.sidebar-user-role {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-dim);
}

.sidebar-logout-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #232c3d;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* -----------------------------------------------------------------------------
   Telemetry Footer
   ----------------------------------------------------------------------------- */
.app-footer {
    background: rgba(11, 14, 20, 0.96);
    border-top: 1px solid rgba(225, 6, 0, 0.35);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(225, 6, 0, 0.12);
    padding: 1.15rem 0;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
}

.footer-brand {
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-style: italic;
}

.footer-sub {
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-copyright {
    color: var(--color-text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.footer-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Database Online/Offline Telemetry Status Pill */
.db-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid;
    transition: all 0.2s ease;
}

.db-status-pill.is-online {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.db-status-pill.is-offline {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.db-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.db-status-pill.is-online .db-status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: statusPulse 2s infinite ease-in-out;
}

.db-status-pill.is-offline .db-status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(0.85);
    }
}

.footer-date {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #cbd5e1;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
}

.footer-date-icon {
    color: var(--color-primary);
}

.footer-meta-bottom {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

.version-item strong {
    color: #94a3b8;
    font-weight: 600;
}

.version-separator {
    color: var(--color-primary);
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .header-badges {
        display: none;
    }
    .brand-tagline {
        display: none;
    }
    .brand-divider {
        display: none;
    }
    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-right {
        align-items: flex-start;
    }
}

/* =============================================================================
   Reusable Grid Component (Filtering, Sorting, Pagination & Per-Page controls)
   ============================================================================= */
.grid-container {
    background: linear-gradient(145deg, #121620 0%, #0d1017 100%);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-top: 1.25rem;
}

.grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.15rem;
    background: rgba(18, 23, 33, 0.75);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-wrap: wrap;
    gap: 0.85rem;
}

.grid-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.grid-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.grid-search-form {
    display: flex;
    align-items: center;
}

.grid-toolbar-filters-form {
    display: flex;
    align-items: center;
}

.grid-toolbar-filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
}

.grid-search-wrap {
    display: flex;
    align-items: center;
    position: relative;
    width: 240px;
    max-width: 100%;
}

.grid-toolbar-filters .grid-search-wrap {
    width: 195px;
    min-width: 130px;
    flex: 0 1 auto;
}

.grid-search-icon {
    position: absolute;
    right: 0.75rem;
    left: auto;
    color: var(--color-text-dim);
    pointer-events: none;
    z-index: 1;
}

.grid-search-wrap.has-clear .grid-search-icon,
.grid-search-wrap:has(.grid-search-clear) .grid-search-icon {
    right: 2rem;
}

.grid-search-input {
    width: 100%;
    padding: 0.4rem 2.2rem 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid #283344;
    background: #090c10;
    color: #ffffff;
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.grid-search-wrap.has-clear .grid-search-input,
.grid-search-wrap:has(.grid-search-clear) .grid-search-input {
    padding-right: 3.4rem;
}

.grid-search-clear {
    position: absolute;
    right: 0.65rem;
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.15s ease;
    z-index: 2;
}

.grid-search-clear:hover {
    color: var(--color-primary);
}

.grid-reset-btn {
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
    font-weight: 600;
}

.grid-per-page-form {
    display: inline-flex;
    align-items: center;
}

.grid-per-page-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.grid-per-page-select {
    padding: 0.32rem 0.65rem;
    border: 1px solid #283344;
    border-radius: var(--radius-sm);
    background: #090c10;
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.grid-per-page-select:focus,
.grid-per-page-select:hover {
    border-color: var(--color-primary);
}

/* Grid Table Styling */
.grid-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.grid-header-row th {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0.75rem 1rem;
    background: #141924;
    border-bottom: 1px solid #222b3a;
    box-shadow: 0 1px 0 #222b3a;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #cbd5e1;
    white-space: nowrap;
}

.grid-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.grid-sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s ease;
}

.grid-sort-link:hover {
    color: #ffffff;
}

.grid-sort-link.active-sort {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(225, 6, 0, 0.4);
}

.grid-sort-icon {
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.grid-sort-idle {
    opacity: 0.35;
    font-size: 0.8rem;
}

/* Filter Row Under Headers */
.grid-filter-row th {
    padding: 0.4rem 0.65rem;
    background: #0e121a;
    border-bottom: 2px solid #1f2736;
    font-weight: normal;
}

.grid-filter-input {
    width: 100%;
    padding: 0.32rem 0.55rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    background: #080a0f;
    border: 1px solid #242d3d;
    border-radius: var(--radius-sm);
    color: #ffffff;
    outline: none;
    transition: all 0.15s ease;
}

.grid-filter-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 6px rgba(225, 6, 0, 0.3);
}

.grid-filter-select {
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.78rem;
}

.grid-data-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.grid-data-row:hover {
    background-color: rgba(255, 255, 255, 0.035);
}

.grid-data-row.is-clickable {
    cursor: pointer;
    user-select: none;
}

.grid-data-row.is-clickable:hover {
    background-color: rgba(225, 6, 0, 0.09) !important;
}

.grid-data-row.is-clickable:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.grid-data-row.is-selected {
    background-color: rgba(225, 6, 0, 0.14) !important;
}

.grid-data-row.is-selected td:first-child {
    border-left: 3px solid var(--color-primary);
}

.brand-grid-name {
    color: var(--color-text);
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
}

.grid-data-row.is-clickable:hover .brand-grid-name {
    color: #ffffff;
}

.grid-empty-cell {
    padding: 3rem 1rem !important;
}

.grid-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-dim);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Pagination Bar */
.grid-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.15rem;
    background: rgba(13, 17, 24, 0.95);
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.825rem;
    font-family: var(--font-body);
}

.grid-pagination-info {
    color: var(--color-text-muted);
}

.text-highlight {
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
}

.grid-pagination-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.grid-page-nav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.grid-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid #242d3d;
    background: #11151f;
    color: #cbd5e1;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: all 0.15s ease;
}

.grid-page-btn:hover:not(.disabled):not(.active) {
    background: #1c2332;
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(225, 6, 0, 0.35);
}

.grid-page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.55);
    font-weight: 700;
}

.grid-page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.grid-page-ellipsis {
    color: var(--color-text-dim);
    padding: 0 0.2rem;
    font-weight: bold;
}

/* Jump Form */
.grid-jump-form {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.grid-jump-input {
    width: 52px;
    height: 32px;
    text-align: center;
    border: 1px solid #283344;
    background: #090c10;
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.grid-jump-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 6px rgba(225, 6, 0, 0.35);
}

.grid-jump-btn {
    height: 32px;
    padding: 0 0.7rem;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .grid-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .grid-search-wrap {
        width: 100%;
    }
    .grid-pagination-container {
        flex-direction: column;
        align-items: stretch;
    }
    .grid-pagination-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .grid-page-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .grid-jump-form {
        justify-content: center;
    }
}

/* =============================================================================
   Brands Catalog Master-Detail Layout & Image Upload Dropzone
   ============================================================================= */
.brands-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.brands-form-col {
    flex: 0 0 460px;
    width: 460px;
    max-width: 460px;
    position: sticky;
    top: 1rem;
    box-sizing: border-box;
}

.brands-grid-col {
    flex: 1;
    min-width: 0;
}

.brand-card {
    background: #11151f;
    border: 1px solid #1f2737;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.brand-card .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #1a2230;
    min-height: 48px;
    box-sizing: border-box;
}

.brand-card-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-card-header-info .card-title {
    margin: 0;
    line-height: 1.25;
}

/* Top timestamps placed directly under the brand card title (unboxed, small muted font, stable height) */
.brand-top-timestamps {
    font-family: var(--font-mono);
    font-size: 0.70rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
    letter-spacing: 0.02em;
    line-height: 1.35;
    word-break: break-all;
    min-height: 1.15rem;
    background: none;
    border: none;
    padding: 0;
}

.brand-timestamps-empty {
    color: var(--color-text-dim);
    font-style: italic;
    opacity: 0.75;
}

.brand-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Group Boxes & Legends */
.form-group-box {
    border: 1px solid #232c3d;
    border-radius: var(--radius-sm);
    background: rgba(10, 14, 21, 0.55);
    padding: 0.6rem 0.75rem 0.65rem;
    margin: 0;
    transition: border-color 0.15s ease;
}

.form-group-box:focus-within {
    border-color: #3b485f;
}

.form-group-legend {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    padding: 0 0.4rem;
    margin-left: 0.25rem;
}

.form-group-box .form-group {
    margin-bottom: 0.45rem;
}

.form-group-box .form-group:last-child {
    margin-bottom: 0;
}

.form-group-box .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: block;
    color: #cbd5e1;
}

.form-group-box .form-control {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
}

/* Fixed Higher Description Textbox (cannot be resized, stays fixed) */
#brand-description,
#maker-description {
    height: 95px;
    min-height: 95px;
    max-height: 95px;
    resize: none;
    overflow-y: auto;
    line-height: 1.45;
    font-family: var(--font-body);
    box-sizing: border-box;
}

/* Brand Logo Dropzone - Strict Fixed Dimensions */
.brand-logo-dropzone {
    height: 135px;
    min-height: 135px;
    max-height: 135px;
    border: 2px dashed #242e40;
    background: #090c12;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.brand-logo-dropzone:hover,
.brand-logo-dropzone:focus-visible {
    border-color: var(--color-primary);
    background: rgba(225, 6, 0, 0.04);
}

.brand-logo-dropzone.is-dragover {
    border-color: var(--color-primary);
    background: rgba(225, 6, 0, 0.09);
    box-shadow: 0 0 16px rgba(225, 6, 0, 0.35);
}

.brand-logo-hidden-input {
    display: none;
}

.brand-logo-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Persistent Empty Placeholder with Icon */
.brand-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.brand-logo-icon {
    color: #38bdf8;
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.25));
    margin-bottom: 0.2rem;
}

.brand-logo-upload-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
}

.brand-logo-upload-sub {
    font-size: 0.70rem;
    color: var(--color-text-dim);
}

/* Image preview container with fixed dimensions */
.brand-logo-current-wrap {
    width: 100%;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.brand-logo-preview-image {
    max-height: 80px;
    max-width: 95%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.brand-logo-hint {
    display: block;
    height: 18px;
    line-height: 18px;
    font-size: 0.70rem;
    color: var(--color-text-dim);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

/* Brand Logo Button Controls (Browse & Remove) directly below dropzone */
.brand-logo-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.brand-media-btn {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.80rem;
    letter-spacing: 0.03em;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    padding: 0 0.75rem;
}

.brand-browse-btn {
    background: #141923;
    border: 1px solid #283448;
    color: #cbd5e1;
}

.brand-browse-btn:hover {
    background: #1d2535;
    border-color: #3f516d;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(63, 81, 109, 0.25);
}

.brand-remove-btn {
    background: rgba(225, 6, 0, 0.08);
    border: 1px solid rgba(225, 6, 0, 0.3);
    color: #f87171;
}

.brand-remove-btn:hover:not(:disabled):not(.is-disabled) {
    background: rgba(225, 6, 0, 0.2);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.35);
}

.brand-remove-btn:disabled,
.brand-remove-btn.is-disabled {
    background: #0f131a;
    border-color: #1a222f;
    color: #4b586e;
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* Button hierarchy */
.brand-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.brand-save-btn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.90rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-sub-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.brand-sub-btn {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.brand-new-btn {
    text-decoration: none;
}

.brand-delete-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Brands Grid specific thumbnail & links */
.brand-grid-logo-wrap {
    width: 48px;
    height: 30px;
    background: #090c12;
    border: 1px solid #1c2332;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    padding: 2px;
}

.brand-grid-logo {
    max-width: 44px;
    max-height: 26px;
    object-fit: contain;
}

.brand-grid-no-logo {
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

.brand-grid-link {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.brand-grid-link:hover {
    color: var(--color-primary);
}

.brand-grid-desc {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.brands-grid-card .grid-container {
    margin-top: 0.65rem;
}

/* =============================================================================
   Responsive Layout & Phone View Adjustments
   ============================================================================= */
@media (max-width: 960px) {
    .brands-layout {
        flex-direction: column;
        gap: 1.25rem;
    }
    .brands-form-col {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        position: static;
    }
    .brands-grid-col {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .page-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .brand-card,
    .brands-grid-card {
        padding: 0.85rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .brand-card .card-header-row,
    .brands-grid-card .card-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        min-height: auto;
    }

    .brands-count-badge {
        align-self: flex-start;
    }

    /* Grid Toolbar on Phone */
    .grid-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .grid-toolbar-left,
    .grid-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .grid-toolbar-filters-form {
        width: 100%;
    }

    .grid-toolbar-filters {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.65rem;
        width: 100%;
        flex-wrap: wrap;
    }

    .grid-toolbar-filters .grid-search-wrap {
        flex: 1 1 150px;
        min-width: 130px;
        width: auto;
    }

    .grid-search-input {
        width: 100%;
        font-size: 0.85rem;
        box-sizing: border-box;
    }

    .grid-per-page-form {
        width: 100%;
        justify-content: flex-end;
    }

    /* Touch-friendly buttons on phone */
    .brand-logo-btn-row {
        gap: 0.5rem;
    }

    .brand-media-btn {
        height: 36px;
        font-size: 0.82rem;
    }

    .brand-save-btn {
        height: 42px;
    }

    .brand-sub-btn {
        height: 38px;
    }

    /* Grid Pagination on Phone */
    .grid-pagination-container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        padding: 0.75rem;
    }

    .grid-pagination-controls {
        flex-direction: column;
        gap: 0.6rem;
        width: 100%;
    }

    .grid-page-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .grid-jump-form {
        justify-content: center;
        width: 100%;
    }
}

/* =============================================================================
   Models Collection Master-Detail Layout, Color Picker & Camera Styles
   ============================================================================= */
.models-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.models-form-col {
    flex: 0 0 490px;
    width: 490px;
    max-width: 490px;
    position: sticky;
    top: 1rem;
    box-sizing: border-box;
}

.models-grid-col {
    flex: 1;
    min-width: 0;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

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

/* Interactive Color Picker Widget */
.model-color-picker-widget {
    position: relative;
}

.model-color-picker-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-align: left;
    background: #141923;
    border: 1px solid #283448;
    color: #e2e8f0;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.model-color-picker-trigger:hover,
.model-color-picker-trigger:focus-visible {
    border-color: #38bdf8;
    outline: none;
}

.model-color-swatch-box {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    display: inline-block;
    box-sizing: border-box;
}

.model-color-swatch-box.is-empty {
    border: 1px dashed rgba(255, 255, 255, 0.35);
    background: transparent !important;
}

.model-color-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-color-chevron {
    color: var(--color-text-dim);
    margin-left: auto;
}

.model-color-picker-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 230px;
    max-height: 230px;
    overflow-y: auto;
    background: #0f141d;
    border: 1px solid #283448;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: none;
    padding: 4px;
    box-sizing: border-box;
}

.model-color-picker-popover.is-open {
    display: block;
}

.model-color-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    color: #e2e8f0;
    transition: background 0.1s ease;
}

.model-color-picker-item:hover {
    background: #1e293b;
}

.model-color-picker-item.is-selected {
    background: rgba(56, 189, 248, 0.15);
    font-weight: 600;
    color: #38bdf8;
}

.model-color-item-name {
    flex: 1;
}

.model-color-item-hex {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-dim);
}

/* Color in Grid */
.model-color-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.model-color-swatch-sm {
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: inline-block;
}

/* Thumbnail in Grid */
.model-grid-thumb-wrap {
    width: 44px;
    height: 30px;
    background: #090c12;
    border: 1px solid #1c2332;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    padding: 1px;
}

.model-grid-thumb {
    max-width: 42px;
    max-height: 28px;
    object-fit: cover;
    border-radius: 2px;
}

.model-grid-thumb-empty {
    color: var(--color-text-dim);
}

/* Photo Upload and Mobile Camera */
.model-photo-btn-row {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.model-camera-btn {
    background: #1e293b;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.model-camera-btn:hover {
    background: rgba(56, 189, 248, 0.18);
    color: #ffffff;
    border-color: #7dd3fc;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.model-upload-status {
    margin-top: 0.35rem;
    text-align: center;
    font-family: var(--font-mono);
}

.model-description-area {
    height: 80px;
    min-height: 80px;
    max-height: 80px;
    resize: none;
    overflow-y: auto;
    line-height: 1.45;
    font-family: var(--font-body);
    box-sizing: border-box;
}

.input-with-action {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.input-link-btn {
    padding: 0 0.5rem;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-link-btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Model Grid Condition Badge (Compact & Red) */
.model-condition-badge {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.45rem !important;
    font-weight: 600 !important;
    vertical-align: middle;
    margin-left: 0.4rem;
    color: #ff4d47 !important;
    background-color: rgba(225, 6, 0, 0.16) !important;
    border: 1px solid rgba(225, 6, 0, 0.45) !important;
    border-radius: var(--radius-sm);
    letter-spacing: 0.04em;
    display: inline-block;
}

/* =============================================================================
   Custom Collections & Collection Models Manager
   ============================================================================= */
.collection-models-box {
    margin-top: 1rem;
}

.collection-models-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    flex-wrap: nowrap;
}

.collection-models-header-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.collection-models-header .btn,
#btn-open-add-models-modal {
    width: auto !important;
    min-width: unset;
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
}

.collection-models-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.collection-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.45rem 0.65rem;
    background: #090c12;
    border: 1px solid #1a2230;
    border-radius: var(--radius-sm);
    transition: all 0.18s ease;
}

.collection-model-item:hover {
    border-color: rgba(225, 6, 0, 0.4);
    background: #0f141d;
}

.collection-model-item-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.collection-model-thumb {
    width: 48px;
    height: 36px;
    min-width: 48px;
    border-radius: 3px;
    object-fit: cover;
    background: #141923;
    border: 1px solid #232c3d;
}

.collection-model-thumb-fallback {
    width: 48px;
    height: 36px;
    min-width: 48px;
    border-radius: 3px;
    background: #141923;
    border: 1px solid #232c3d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dim);
}

.collection-model-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.collection-model-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-model-sub {
    font-size: 0.70rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-model {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
}

.btn-remove-model:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.collection-models-empty {
    padding: 1.25rem 0.75rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed #1e2636;
    border-radius: var(--radius-sm);
    color: var(--color-text-dim);
    font-size: 0.78rem;
}

/* =============================================================================
   Add Models Modal / Popup
   ============================================================================= */
.collection-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 6, 9, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-modal-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

.collection-modal {
    background: #0e1219;
    border: 1px solid #232d3f;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(225, 6, 0, 0.15);
    width: 860px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(12px);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-modal-backdrop.is-active .collection-modal {
    transform: scale(1) translateY(0);
}

.collection-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid #1a2230;
    background: linear-gradient(180deg, rgba(22, 28, 40, 0.8) 0%, rgba(14, 18, 25, 0.8) 100%);
}

.collection-modal-header-info h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.collection-modal-header-info p {
    margin: 0.15rem 0 0 0;
    font-size: 0.74rem;
    color: var(--color-text-muted);
}

.collection-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #232c3d;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.collection-modal-close:hover {
    color: #ffffff;
    background: rgba(225, 6, 0, 0.25);
    border-color: var(--color-primary);
}

/* Modal Toolbar & Filters */
.collection-modal-toolbar {
    padding: 0.85rem 1.35rem;
    background: #090c12;
    border-bottom: 1px solid #19202c;
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.collection-modal-search {
    flex: 1 1 200px;
}

.collection-modal-filter {
    flex: 0 1 180px;
}

/* Modal Cards Grid Container */
.collection-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.35rem;
    min-height: 240px;
    max-height: 52vh;
    display: flex;
    flex-direction: column;
}

.collection-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
}

/* Model Card inside Modal */
.modal-model-card {
    background: #121620;
    border: 1px solid #1e2636;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.modal-model-card:hover {
    border-color: rgba(225, 6, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.modal-model-card.is-selected {
    border-color: var(--color-primary);
    background: rgba(225, 6, 0, 0.08);
    box-shadow: 0 0 14px rgba(225, 6, 0, 0.45);
}

.modal-model-card-img-wrap {
    width: 100%;
    height: 105px;
    background: #090c10;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-model-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modal-model-card-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(9, 12, 16, 0.8);
    border: 2px solid #3a475d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.18s ease;
    z-index: 2;
}

.modal-model-card.is-selected .modal-model-card-check {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(225, 6, 0, 0.6);
}

.modal-model-card-body {
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.modal-model-card-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-model-card-meta {
    font-size: 0.70rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.modal-empty-state svg {
    margin-bottom: 0.75rem;
    color: var(--color-text-dim);
}

/* Modal Footer & Pagination Controls */
.collection-modal-footer {
    padding: 0.85rem 1.35rem;
    background: #090c12;
    border-top: 1px solid #1a2230;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.collection-modal-pagination {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.modal-page-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    background: #141923;
    border: 1px solid #232c3d;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-page-btn:hover:not(:disabled) {
    color: #ffffff;
    border-color: var(--color-primary);
}

.modal-page-btn.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.modal-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.collection-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* -------------------------------------------------------------------------
 * Grid Table Logo Thumbnails & Fallbacks
 * ------------------------------------------------------------------------- */
.table-logo-cell {
    width: 54px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.table-thumb-logo {
    max-width: 48px;
    max-height: 36px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #0d1118;
    border: 1px solid #1f2737;
    border-radius: var(--radius-sm, 4px);
    padding: 2px;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.table-logo-fallback {
    width: 38px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    background: #141923;
    border: 1px dashed #263245;
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text-dim, #667);
    font-size: 0.82rem;
    font-weight: 700;
    display: block;
}

/* =========================================================================
 * Garage Gallery Showcase Styles (garage.php)
 * ========================================================================= */
.garage-page {
    padding-bottom: 3rem;
}

/* 1. Filter Section (Top) */
.garage-filter-section {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.garage-filter-grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr) auto;
    gap: 1rem;
    align-items: flex-end;
}

.garage-filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.garage-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 12px;
    color: var(--color-text-dim);
    pointer-events: none;
}

.input-with-icon .form-control {
    padding-left: 36px;
    padding-right: 32px;
}

.input-clear-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.input-clear-btn:hover {
    color: var(--color-primary);
}

.garage-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 1rem;
    white-space: nowrap;
    font-weight: 600;
}

/* 2. Sticky Alphabet Bar */
.garage-alphabet-wrapper {
    position: sticky;
    top: 64px;
    z-index: 30;
    margin-bottom: 1.25rem;
}

.garage-alphabet-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: rgba(14, 18, 26, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.garage-alphabet-bar::-webkit-scrollbar {
    height: 4px;
}

.garage-alphabet-bar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.alpha-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-shrink: 0;
    user-select: none;
}

.alpha-btn:hover:not(.is-disabled) {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.alpha-btn.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 0 12px var(--color-primary-glow);
}

.alpha-btn.is-disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
    color: var(--color-text-dim);
    pointer-events: none;
}

/* 3. Content Header */
.garage-content-header {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.garage-header-list-mode,
.garage-header-detail-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.garage-header-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.garage-showing-label {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.garage-showing-letter {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-left: 0.2rem;
}

.garage-showing-count {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.garage-sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.4rem 0.85rem;
}

/* Breadcrumb in Detail Mode */
.garage-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.garage-breadcrumb-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.garage-breadcrumb-link:hover {
    color: var(--color-primary-hover);
}

.garage-breadcrumb-separator {
    color: var(--color-text-dim);
    font-weight: 400;
}

.garage-breadcrumb-current {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.garage-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
}

/* 4. List Mode: Cards Grid */
.garage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.35rem;
    margin-bottom: 2rem;
}

.garage-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-sm);
    outline: none;
}

.garage-card:hover,
.garage-card:focus-visible {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 16px rgba(225, 6, 0, 0.25);
}

.garage-card-img-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #090c12;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
    padding: 0.35rem;
}

.garage-card-img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease;
}

.garage-card:hover .garage-card-img {
    transform: scale(1.06);
}

.garage-card-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-text-dim);
    background: #090c12;
}

.garage-card-scale-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(14, 18, 26, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.garage-card-info {
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    justify-content: space-between;
}

.garage-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.garage-card:hover .garage-card-title {
    color: #ffffff;
}

.garage-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.garage-card-brand {
    color: var(--color-primary);
    font-weight: 600;
}

.garage-card-bullet {
    color: var(--color-text-dim);
}

.garage-card-year {
    color: var(--color-text-muted);
}

/* Empty State */
.garage-empty-state {
    text-align: center;
    padding: 4.5rem 1.5rem;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.garage-empty-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-dim);
    margin-bottom: 1.25rem;
}

.garage-empty-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.garage-empty-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    max-width: 440px;
    margin: 0 auto 1.5rem auto;
}

/* 5. Detail Mode (Showcase) */
.garage-detail-showcase {
    position: relative;
    padding: 1.75rem 2rem 2rem 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: block;
}

/* Title Bar (Integrated Header: Model Name Left, Badges Right) */
.garage-detail-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.garage-detail-model-name {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0;
}

.garage-detail-badges {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.badge-condition {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge-scale {
    background: rgba(225, 6, 0, 0.16);
    border: 1px solid rgba(225, 6, 0, 0.45);
    color: #ff6b6b;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

/* Main Layout Grid: Photo Column Left, Clean Specs Right */
.garage-detail-body {
    display: grid;
    grid-template-columns: minmax(340px, 460px) 1fr;
    gap: 2.25rem;
    align-items: start;
    margin-bottom: 1.75rem;
}

/* Photo Showcase Box (Left) */
.garage-detail-media-col {
    width: 100%;
}

.garage-detail-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #090c12;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-cockpit);
    padding: 0.65rem;
}

.garage-detail-img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.garage-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    color: var(--color-text-dim);
    background: #090c12;
}

/* Specs Column (Right of Car Image: Logos on Top, Linear Specs Below) */
.garage-detail-specs-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Clean Pure Logos Strip (smaller, above all info, NO text on them) */
.garage-detail-logos-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-bottom: 0.25rem;
}

.clean-logo-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    background: #090c12;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.clean-logo-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.clean-logo-img {
    height: 28px;
    max-width: 80px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    display: block;
}

/* Clean Linear Car Information Grid (No groupboxes, no subtitles, no receipt look) */
.garage-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 1.15rem 1.75rem;
}

.spec-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spec-cell-link {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
}

.spec-cell-collections {
    grid-column: 1 / -1;
}

.spec-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.spec-value {
    font-size: 0.95rem;
    color: var(--color-text);
    word-break: break-word;
}

.spec-value.font-semibold {
    color: #ffffff;
    font-weight: 600;
}

.spec-value-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-badge-swatch {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.garage-ext-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    color: var(--color-primary);
    border-color: rgba(225, 6, 0, 0.4);
}

.garage-ext-link:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.spec-collections-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.spec-collection-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.25rem 0.65rem;
    font-size: 0.82rem;
    color: var(--color-text);
}

/* Notes & Description (Clean Section below main layout) */
.garage-detail-notes-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.garage-notes-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
}

.garage-notes-title svg {
    width: 13px;
    height: 13px;
    color: var(--color-text-dim);
    opacity: 0.85;
}

/* Markdown Rendered Styling inside Gallery */
.garage-markdown-body {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: #e2e8f0;
}

.garage-markdown-body h1,
.garage-markdown-body h2,
.garage-markdown-body h3,
.garage-markdown-body h4,
.garage-markdown-body h5,
.garage-markdown-body h6 {
    font-family: var(--font-heading);
    color: #ffffff;
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.garage-markdown-body h1:first-child,
.garage-markdown-body h2:first-child,
.garage-markdown-body h3:first-child {
    margin-top: 0;
}

.garage-markdown-body h1 { font-size: 1.6rem; }
.garage-markdown-body h2 { font-size: 1.4rem; }
.garage-markdown-body h3 { font-size: 1.2rem; }
.garage-markdown-body h4 { font-size: 1.05rem; }

.garage-markdown-body p {
    margin-bottom: 0.85rem;
}

.garage-markdown-body p:last-child {
    margin-bottom: 0;
}

.garage-markdown-body ul,
.garage-markdown-body ol {
    margin-left: 1.5rem;
    margin-bottom: 0.85rem;
}

.garage-markdown-body li {
    margin-bottom: 0.35rem;
}

.garage-markdown-body blockquote {
    border-left: 3px solid var(--color-primary);
    background: rgba(225, 6, 0, 0.06);
    padding: 0.65rem 1rem;
    border-radius: 0 4px 4px 0;
    margin: 1rem 0;
    color: #cbd5e1;
    font-style: italic;
}

.garage-markdown-body pre {
    background: #090c12;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin: 1rem 0;
}

.garage-markdown-body code {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: #ff9b9b;
}

.garage-markdown-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.garage-markdown-body a:hover {
    color: var(--color-primary-hover);
}

.garage-markdown-body hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

/* =========================================================================
 * Mobile & Tablet Responsiveness
 * ========================================================================= */
@media (max-width: 1080px) {
    .garage-filter-grid {
        grid-template-columns: repeat(3, 1fr) auto;
    }
    .garage-filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .garage-filter-grid {
        grid-template-columns: 1fr;
    }

    .garage-detail-title-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .garage-detail-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .garage-detail-media-col {
        width: 100%;
        max-width: 100%;
    }

    .garage-specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.9rem 1.25rem;
    }

    .garage-detail-model-name {
        font-size: 1.6rem;
    }

    .garage-alphabet-wrapper {
        top: 56px;
    }

    .brands-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

/* =============================================================================
   Brands Gallery Styles & Cross-Navigation
   ============================================================================= */
.brands-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.brand-card-logo-box {
    aspect-ratio: 16 / 10;
    padding: 1.25rem;
    background: #090c12;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-card-logo,
.maker-card-logo,
.collection-card-logo {
    max-height: 80px;
    max-width: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    transition: transform 0.3s ease;
}

.brand-card:hover .brand-card-logo,
.maker-card:hover .maker-card-logo,
.brand-card:hover .collection-card-logo {
    transform: scale(1.06);
}

.brand-card-title,
.maker-card-title,
.collection-card-title {
    font-size: 1.15rem;
    font-weight: 700;
}

/* Brands, Makers & Collections Detail View */
.brand-detail-body,
.maker-detail-body,
.collection-detail-body {
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: 2.5rem;
    align-items: center;
}

.brand-detail-logo-box,
.maker-detail-logo-box,
.collection-detail-logo-box {
    aspect-ratio: 16 / 10;
    max-height: 210px;
    padding: 1.25rem 1.5rem;
    background: #090c12;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.brand-detail-logo-img,
.maker-detail-logo-img,
.collection-detail-logo-img {
    max-height: 120px;
    max-width: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.brand-specs-grid,
.maker-specs-grid,
.collection-specs-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.25rem 2rem;
}

/* Your Models interactive link in Brands, Makers & Collections Detail */
.brand-models-nav-link,
.maker-models-nav-link,
.collection-models-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.brand-models-nav-link:hover,
.maker-models-nav-link:hover,
.collection-models-nav-link:hover {
    color: var(--color-primary-hover, #ff4d4d);
}

.brand-models-arrow-icon,
.maker-models-arrow-icon,
.collection-models-arrow-icon {
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.brand-models-nav-link:hover .brand-models-arrow-icon,
.maker-models-nav-link:hover .maker-models-arrow-icon,
.collection-models-nav-link:hover .collection-models-arrow-icon {
    transform: translateX(3px);
}

/* Interactive collection tags in Garage detail mode */
.spec-collection-tag.is-link {
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.spec-collection-tag.is-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(225, 6, 0, 0.12);
}

/* Garage cross-navigation link */
.garage-brand-nav-link,
.garage-maker-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.garage-brand-nav-link:hover,
.garage-maker-nav-link:hover {
    color: var(--color-primary-hover, #ff4d4d);
}

.garage-nav-arrow-icon {
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.garage-brand-nav-link:hover .garage-nav-arrow-icon,
.garage-maker-nav-link:hover .garage-nav-arrow-icon {
    transform: translateX(3px);
}

.garage-brand-nav-link:not([href]),
.garage-maker-nav-link:not([href]) {
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: default;
}

.garage-brand-nav-link:not([href]) .garage-nav-arrow-icon,
.garage-maker-nav-link:not([href]) .garage-nav-arrow-icon {
    display: none !important;
}

.clean-logo-link {
    cursor: pointer;
    text-decoration: none;
}

.clean-logo-link:hover {
    border-color: rgba(225, 6, 0, 0.6);
    box-shadow: 0 4px 14px rgba(225, 6, 0, 0.35);
    transform: translateY(-2px);
}

/* =============================================================================
   Collection Analytics Dashboard Styles
   ============================================================================= */

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding-bottom: 3rem;
}

/* Hero Launchpad */
.dashboard-hero {
    background: linear-gradient(135deg, rgba(18, 22, 32, 0.95) 0%, rgba(24, 29, 42, 0.98) 100%),
                radial-gradient(circle at 90% 20%, rgba(225, 6, 0, 0.12) 0%, transparent 60%);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, #ff8a00 50%, var(--color-primary) 100%);
}

.dashboard-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.dashboard-hero-title-group {
    max-width: 680px;
}

.dashboard-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #10b981;
    margin-bottom: 0.75rem;
}

.pulse-indicator {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.dashboard-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.dashboard-subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
}

/* KPI Telemetry Grid */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.dashboard-kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--color-border);
    transition: background 0.2s ease;
}

.dashboard-kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(225, 6, 0, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(225, 6, 0, 0.15);
}

.dashboard-kpi-card:hover::after {
    background: var(--color-primary);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.kpi-label {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.kpi-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.kpi-icon-box.text-primary { color: var(--color-primary); }
.kpi-icon-box.text-warning { color: #f59e0b; }
.kpi-icon-box.text-info { color: #0ea5e9; }
.kpi-icon-box.text-purple { color: #a855f7; }
.kpi-icon-box.text-emerald { color: #10b981; }

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.kpi-number {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}

.kpi-unit {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-dim);
    text-transform: uppercase;
}

.kpi-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.6rem;
    color: var(--color-text-dim);
}

.kpi-status-badge {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.kpi-link-hint {
    color: var(--color-primary);
    font-weight: 600;
    opacity: 0.85;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dashboard-kpi-card:hover .kpi-link-hint {
    opacity: 1;
    transform: translateX(3px);
}

/* Two-Column Grid */
.dashboard-grid-2col {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .dashboard-grid-2col {
        grid-template-columns: 1fr;
    }
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

.dashboard-card-tag {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
}

.dashboard-card-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
}

.dashboard-card-desc {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

/* =============================================================================
   Brand Distribution Donut Pie Chart & Legend
   ============================================================================= */

.dashboard-donut-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .dashboard-donut-container {
        flex-direction: column;
        align-items: stretch;
    }
}

.donut-svg-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 210px;
    margin: 0 auto;
}

.dashboard-donut-svg {
    width: 200px;
    height: 200px;
    overflow: visible;
}

.donut-slice {
    cursor: pointer;
    transition: stroke-width 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease,
                filter 0.2s ease;
}

.donut-slice:hover,
.donut-slice.is-active {
    stroke-width: 32;
    filter: drop-shadow(0 0 8px currentColor);
}

.donut-slice.is-dimmed {
    opacity: 0.25;
}

.donut-center-group {
    pointer-events: none;
    user-select: none;
}

.donut-center-metric {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    fill: var(--color-text);
    transition: fill 0.2s ease;
}

.donut-center-label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    fill: var(--color-text-muted);
}

.donut-center-sub {
    font-family: var(--font-body);
    font-size: 0.72rem;
    fill: var(--color-text-dim);
}

/* Brand Legend Table */
.dashboard-brand-legend {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

.legend-header {
    display: grid;
    grid-template-columns: 1fr 60px 65px;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-dim);
}

.legend-col-count { text-align: center; }
.legend-col-pct { text-align: right; }

.legend-rows {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
}

.dashboard-legend-row {
    display: grid;
    grid-template-columns: 1fr 60px 65px;
    align-items: center;
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.dashboard-legend-row:hover,
.dashboard-legend-row.is-active {
    background: var(--color-surface-hover);
}

.legend-brand-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.legend-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-brand-logo {
    width: 22px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}

.legend-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-arrow-icon {
    opacity: 0;
    color: var(--color-primary);
    transform: translateX(-4px);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dashboard-legend-row:hover .legend-brand-link {
    color: var(--color-primary);
}

.dashboard-legend-row:hover .legend-arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

.legend-brand-count {
    text-align: center;
}

.count-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.legend-brand-pct {
    text-align: right;
}

.pct-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 9999px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Empty Chart State */
.dashboard-empty-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.empty-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

/* =============================================================================
   Scale Distribution Bars & Condition Meters
   ============================================================================= */

.scale-bar-list,
.condition-meter-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.scale-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.scale-bar-item:hover {
    background: var(--color-surface-hover);
}

.scale-meta-row,
.condition-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.scale-tag-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: #38bdf8;
}

.scale-counts,
.condition-counts {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.scale-count-text,
.condition-count-num {
    color: var(--color-text-dim);
    font-size: 0.8rem;
}

.scale-pct-text,
.condition-pct-badge {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text);
}

.scale-link-arrow {
    color: var(--color-primary);
    transform: translateX(-3px);
    opacity: 0;
    transition: all 0.15s ease;
}

.scale-bar-item:hover .scale-link-arrow {
    opacity: 1;
    transform: translateX(0);
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.scale-fill {
    background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
}

.condition-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.condition-meter-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
}

.condition-name {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
}

/* =============================================================================
   Color Spectrum & Finishes
   ============================================================================= */

.color-spectrum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.65rem;
}

.color-spectrum-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.color-spectrum-chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.color-swatch-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.color-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.color-chip-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-chip-count {
    font-size: 0.72rem;
    color: var(--color-text-dim);
}

/* =============================================================================
   Curated Custom Collections Mini Showcase
   ============================================================================= */

.dashboard-collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dashboard-col-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.dashboard-col-item:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.col-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.col-item-logo {
    width: 32px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.col-item-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    flex-shrink: 0;
}

.col-item-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.col-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-item-desc {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.col-item-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(225, 6, 0, 0.15);
    color: var(--color-primary);
}

.col-arrow-icon {
    color: var(--color-text-dim);
    transition: color 0.15s ease;
}

.dashboard-col-item:hover .col-arrow-icon {
    color: var(--color-primary);
}

/* =============================================================================
   Recent Additions Garage Spotlight Grid
   ============================================================================= */

.dashboard-spotlight-card {
    margin-top: 0.5rem;
}

.dashboard-recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.recent-car-card {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-car-card:hover {
    transform: translateY(-3px);
    border-color: rgba(225, 6, 0, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.recent-car-media-wrap {
    display: block;
    position: relative;
    width: 100%;
    height: 150px;
    background: #090c10;
    overflow: hidden;
    text-decoration: none;
}

.recent-car-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.recent-car-card:hover .recent-car-img {
    transform: scale(1.04);
}

.recent-car-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
}

.recent-car-scale-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: #38bdf8;
    backdrop-filter: blur(4px);
}

.recent-car-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.recent-car-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.recent-car-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0.1rem 0;
}

.recent-car-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.recent-car-title a:hover {
    color: var(--color-primary);
}

.recent-car-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--color-text-dim);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.recent-car-view-link {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: gap 0.15s ease;
}

.recent-car-view-link:hover {
    gap: 0.55rem;
    color: var(--color-primary-hover);
}

.dashboard-empty-spotlight {
    text-align: center;
    padding: 2rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}



