/* ==========================================================================
   VELOCE AUTO GROUP - DEALERSHIP AUCTION-TO-SALE SUITE
   Premium Design System | Dark Obsidian & Bright Showroom Light Themes
   ========================================================================== */

:root, [data-theme="dark"] {
    --bg-root: #080606;
    --bg-card: rgba(20, 15, 16, 0.82);
    --bg-card-solid: #151011;
    --bg-card-hover: rgba(32, 20, 22, 0.94);
    --bg-glass: rgba(16, 11, 12, 0.88);
    --bg-input: #0d0809;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(229, 9, 20, 0.5);
    
    --accent-primary: #e50914;
    --accent-primary-hover: #b80710;
    --accent-glow: rgba(229, 9, 20, 0.45);
    
    /* Stage Specific Vibrant Colors */
    --stage-1: #ff4d4d; /* Purchased - Vibrant Red */
    --stage-2: #fb7185; /* In Transit - Rose Red */
    --stage-3: #f87171; /* Received - Coral Red */
    --stage-4: #facc15; /* Inspection - Amber */
    --stage-5: #fb923c; /* Reconditioning - Orange */
    --stage-6: #e879f9; /* Detailing - Magenta */
    --stage-7: #34d399; /* Ready for Sale - Emerald Green */
    --stage-8: #94a3b8; /* Sold - Slate (off the lot) */
    --bg-surface: var(--bg-card-solid);

    --color-danger: #ef4444;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 25px rgba(229, 9, 20, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg-root: #f8f6f6;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-solid: #ffffff;
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-input: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --border-color: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(220, 38, 38, 0.4);
    
    --accent-primary: #dc2626;
    --accent-primary-hover: #b91c1c;
    --accent-glow: rgba(220, 38, 38, 0.25);
    
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 18px rgba(220, 38, 38, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-root);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 148, 158, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 148, 158, 0.6);
}

/* ==========================================================================
   TOP HEADER
   ========================================================================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), #ff4d4d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.brand-accent {
    background: linear-gradient(90deg, #e50914, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-success);
    letter-spacing: 0.05em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.45);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

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

.btn-ghost:hover {
    background: rgba(139, 148, 158, 0.1);
    color: var(--text-primary);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-danger-outline {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
}

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

/* ==========================================================================
   KPI HERO RIBBON
   ========================================================================== */
.kpi-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    padding: 20px 28px 12px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.kpi-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.kpi-icon-wrap.bg-blue { background: rgba(229, 9, 20, 0.18); color: #ff4d4d; border: 1px solid rgba(229, 9, 20, 0.3); }
.kpi-icon-wrap.bg-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.kpi-icon-wrap.bg-amber { background: rgba(245, 158, 11, 0.15); color: #facc15; }
.kpi-icon-wrap.bg-purple { background: rgba(225, 29, 72, 0.18); color: #fb7185; border: 1px solid rgba(225, 29, 72, 0.3); }
.kpi-icon-wrap.bg-cyan { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2px 0;
}

.kpi-subtext {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ==========================================================================
   TOOLBAR & FILTER PILLS
   ========================================================================== */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    gap: 20px;
    flex-wrap: wrap;
}

.view-switchers {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-btn:hover {
    color: var(--text-primary);
    background: rgba(139, 148, 158, 0.1);
}

.view-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.35);
}

.search-wrap {
    position: relative;
    width: 320px;
    max-width: 100%;
}

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

.search-wrap input {
    width: 100%;
    padding: 9px 36px 9px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25);
}

.btn-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

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

.filter-pills-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 28px 16px;
    overflow-x: auto;
    white-space: nowrap;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 6px;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.filter-pill.active {
    background: rgba(229, 9, 20, 0.18);
    border-color: var(--accent-primary);
    color: #ff4d4d;
}

/* ==========================================================================
   MAIN WORKSPACE AREA
   ========================================================================== */
.main-workspace {
    flex: 1;
    padding: 0 28px 32px;
    display: flex;
    flex-direction: column;
}

.workspace-view {
    display: none;
    flex: 1;
}

.workspace-view.active {
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   1. KANBAN PIPELINE BOARD
   ========================================================================== */
#kanban-container {
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-board {
    display: flex;
    gap: 16px;
    min-height: 560px;
    align-items: flex-start;
}

.kanban-column {
    flex: 0 0 310px;
    width: 310px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
    transition: border-color 0.2s ease;
}

.kanban-column.drag-over {
    border-color: var(--accent-primary);
    background: rgba(229, 9, 20, 0.08);
}

.kanban-col-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.kanban-col-header:hover {
    background: rgba(229, 9, 20, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.25);
}

.kanban-col-header.filter-active {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.3), rgba(185, 28, 28, 0.2));
    border-bottom: 2px solid var(--accent-primary);
    box-shadow: inset 0 0 15px rgba(229, 9, 20, 0.25);
}

.card-timestamp-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    border: 1px solid var(--border-color);
}

.btn-work-report {
    background: rgba(229, 9, 20, 0.18);
    color: #ff4d4d;
    border: 1px solid rgba(229, 9, 20, 0.35);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-work-report:hover {
    background: var(--accent-primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.35);
}

.step-timestamp {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-primary);
    margin-top: 4px;
    font-weight: 600;
}

/* Work Report Modal */
.report-section {
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
}

.report-section h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.report-table th {
    text-align: left;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 700;
    font-family: var(--font-mono);
    border-bottom: 1px solid var(--border-color);
}

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

.report-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.timestamp-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(229, 9, 20, 0.18);
    color: #ff4d4d;
    border: 1px solid rgba(229, 9, 20, 0.35);
    white-space: nowrap;
}

.col-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.col-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.col-count-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.col-financial-summary {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.kanban-card-list {
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

/* Kanban Vehicle Card */
.vehicle-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.card-image-wrap {
    position: relative;
    width: 100%;
    height: 135px;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

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

.vehicle-card:hover .card-image-wrap img {
    transform: scale(1.05);
}

.card-days-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.card-stock-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(229, 9, 20, 0.9);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-vin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.vin-code {
    font-family: var(--font-mono);
}

.card-metrics {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.highlight {
    color: var(--color-success);
}

.card-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.btn-card-advance {
    background: rgba(229, 9, 20, 0.18);
    border: 1px solid rgba(229, 9, 20, 0.35);
    color: #ff4d4d;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* ==========================================================================
   2. FLEET GRID CARDS VIEW
   ========================================================================== */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ==========================================================================
   3. COMPLIANCE & COST LEDGER TABLE VIEW
   ========================================================================== */
.ledger-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ledger-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.ledger-table th {
    text-align: left;
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
}

.ledger-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.ledger-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.check-icon {
    color: var(--color-success);
    font-weight: bold;
}

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

/* ==========================================================================
   MODAL 1: READINESS PASSPORT DRAWER
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.25s ease;
}

#passport-backdrop {
    justify-content: flex-end !important;
}

.passport-drawer {
    width: 900px;
    max-width: 95vw;
    height: 100vh;
    margin-left: auto;
    margin-right: 0;
    background: var(--bg-card-solid);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.15);
}

.stock-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(229, 9, 20, 0.18);
    padding: 3px 8px;
    border-radius: 4px;
}

.drawer-vehicle-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 6px 0 8px;
}

.drawer-subline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vin-badge, .auction-badge, .days-badge {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.btn-close-drawer {
    background: transparent;
    border: none;
    font-size: 26px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.btn-close-drawer:hover {
    color: var(--text-primary);
}

/* 7-Stage Progress Stepper */
.readiness-stepper-wrap {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

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

.readiness-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.readiness-stepper::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    width: 100px;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-card-solid);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.stepper-item.completed .step-circle {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.stepper-item.active .step-circle {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 16px rgba(229, 9, 20, 0.7);
    transform: scale(1.15);
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

.stepper-item.active .step-label {
    color: var(--text-primary);
    font-weight: 700;
}

/* Navigation Tabs */
.drawer-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    gap: 16px;
}

.drawer-tab {
    padding: 12px 6px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.drawer-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Drawer Content & Tab Panes */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.tab-pane {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.overview-photo-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 280px;
    border: 1px solid var(--border-color);
}

.passport-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay-specs {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.overview-financial-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.overview-financial-summary h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.cost-breakdown-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.total-row {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.profit-row {
    font-size: 15px;
    font-weight: 700;
}

.text-accent { color: var(--accent-primary) !important; }
.text-emerald { color: #34d399 !important; }

/* Timeline Notes */
.timeline-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.notes-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.timeline-note-item {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-primary);
}

.note-author-time {
    font-size: 11px;
    color: var(--text-muted);
}

.note-text {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
}

.add-note-form {
    display: flex;
    gap: 10px;
}

.add-note-form input {
    flex: 1;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
}

/* Tab 2: Compliance Checklist */
.compliance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.compliance-progress-pill {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    font-weight: 700;
    font-size: 13px;
}

.compliance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.compliance-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compliance-item-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.compliance-item-card.checked {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.06);
}

.compliance-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    transition: all 0.2s ease;
}

.compliance-item-card.checked .compliance-checkbox {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.compliance-item-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.compliance-item-info p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Tab 3: Recon Ledger */
.recon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recon-total-badge {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    padding: 8px 16px;
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border-radius: var(--radius-sm);
}

.recon-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.recon-add-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, .form-group select {
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.flex-1 { flex: 1; min-width: 120px; }
.flex-2 { flex: 2; min-width: 220px; }
.btn-col { justify-content: flex-end; }

/* Drawer Footer */
.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left, .footer-right {
    display: flex;
    gap: 12px;
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: #fff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5);
}

/* ==========================================================================
   MODAL 2: ADD NEW AUCTION VEHICLE WIZARD
   ========================================================================== */
.modal-dialog {
    width: 680px;
    max-width: 95vw;
    margin: auto;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeInScale 0.25s ease;
}

@keyframes fadeInScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

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

.modal-form {
    padding: 24px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   MODAL 3: PRINTABLE COMPLIANCE DOSSIER (LOT JACKET)
   ========================================================================== */
.print-dialog {
    width: 820px;
    max-width: 95vw;
    max-height: 90vh;
    margin: auto;
    background: #fff;
    color: #0f172a;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInScale 0.25s ease;
}

.print-toolbar {
    padding: 16px 24px;
    background: #1e293b;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dossier-sheet {
    padding: 40px;
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
    color: #0f172a;
}

.dossier-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.dossier-title h1 {
    font-size: 24px;
    font-weight: 800;
}

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

.dossier-section h3 {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUpToast 0.3s ease;
}

@keyframes slideUpToast {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   DEALERSHIP SETTINGS & PERMANENT LINKS PORTAL STYLES
   ========================================================================== */
.settings-section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.settings-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.settings-section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 650px;
    line-height: 1.5;
}

.dealership-profile-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: center;
}

@media (max-width: 768px) {
    .dealership-profile-grid {
        grid-template-columns: 1fr;
    }
}

.dealer-logo-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.dealer-logo-img {
    max-height: 90px;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}

.dealer-logo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

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

.detail-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item-full {
    grid-column: 1 / -1;
}

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

.detail-val {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.15);
}

.link-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-icon-wrap {
    font-size: 22px;
    background: var(--bg-surface);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.link-category-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.link-card-actions {
    display: flex;
    gap: 4px;
}

.btn-icon-link {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.link-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.link-name-anchor {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.link-name-anchor:hover {
    color: var(--accent-primary);
}

.external-icon {
    font-size: 13px;
    opacity: 0.6;
}

.link-url-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.link-card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.link-visit-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* ==========================================================================
   II — DEALERSHIP QUICK-COPY VAULT STYLES (PROTECTED)
   ========================================================================== */
.ii-vault-card {
    border: 2px solid rgba(229, 9, 20, 0.45);
    background: linear-gradient(145deg, rgba(20, 15, 16, 0.96), rgba(12, 10, 11, 0.98));
    box-shadow: 0 8px 30px rgba(229, 9, 20, 0.2);
    position: relative;
    overflow: hidden;
}

.ii-vault-card.unlocked {
    border-color: var(--color-success);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
}

.ii-vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ii-category-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ii-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.ii-category-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0;
}

.ii-copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.ii-copy-row:hover {
    background: rgba(229, 9, 20, 0.08);
    border-color: rgba(229, 9, 20, 0.3);
}

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

.ii-row-value-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ii-val-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    user-select: all;
}

.btn-ii-copy {
    background: rgba(229, 9, 20, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(229, 9, 20, 0.35);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-ii-copy:hover {
    background: var(--accent-primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.35);
}

.btn-ii-copy.copied {
    background: var(--color-success) !important;
    color: #ffffff !important;
    border-color: var(--color-success) !important;
}

.btn-ii-edit {
    background: rgba(255, 255, 255, 0.08);
    color: #e1e7ef;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    margin-left: 4px;
}

.btn-ii-edit:hover {
    background: rgba(229, 9, 20, 0.25);
    color: #ffffff;
    border-color: rgba(229, 9, 20, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.25);
}

/* Header Links Shortcut Dropdown Styles */
.header-shortcut-link-item:hover {
    background: rgba(229, 9, 20, 0.15) !important;
    border-color: rgba(229, 9, 20, 0.5) !important;
    transform: translateX(3px);
}

/* ==========================================================================
   RECEIPTS, LISTING, SALE & RECONCILIATION
   ========================================================================== */

/* --- Expense form extras --- */
.recon-form-heading {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.recon-add-form .form-row + .form-row {
    margin-top: 12px;
}

.field-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.recon-add-form input[type="file"] {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px;
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    width: 100%;
    cursor: pointer;
}

.recon-add-form input[type="file"]::file-selector-button {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
}

.recon-add-form.editing {
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- Receipt thumbnails & viewer --- */
.receipt-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    background: var(--bg-input);
}

.receipt-thumb:hover {
    transform: scale(1.15);
    border-color: var(--accent-primary);
}

.receipt-thumb-row {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.no-receipt-flag {
    font-size: 11px;
    color: var(--color-warning);
    white-space: nowrap;
}

.receipt-viewer-dialog {
    margin: auto;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 92vw;
    max-height: 92vh;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.receipt-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
}

#receipt-viewer-img {
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #fff;
}

/* --- Row action buttons (expenses table) --- */
.row-action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 7px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: all 0.15s ease;
}

.row-action-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(229, 9, 20, 0.1);
}

.row-action-btn.danger:hover {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.12);
}

/* --- Vehicle photo upload --- */
.overview-photo-card {
    position: relative;
}

.photo-upload-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.photo-upload-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* --- Listing badge on cards --- */
.listing-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.16);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* --- Sale modal --- */
.sale-basis-callout {
    background: rgba(229, 9, 20, 0.07);
    border: 1px solid rgba(229, 9, 20, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.sale-basis-callout strong {
    color: var(--text-primary);
}

/* --- Spend report --- */
.range-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.range-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    font-family: var(--font-body);
}

.spend-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 18px 0 24px;
}

.spend-summary-tile {
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafafa;
}

.spend-summary-tile .tile-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #666;
    margin-bottom: 4px;
}

.spend-summary-tile .tile-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.spend-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 8px;
}

.spend-report-table th {
    background: #f0f0f0;
    color: #111;
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ccc;
}

.spend-report-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e5e5;
    color: #222;
    vertical-align: middle;
}

.spend-report-table tfoot td {
    font-weight: 700;
    border-top: 2px solid #999;
    background: #f7f7f7;
}

.spend-report-table .num {
    text-align: right;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.spend-report-table tr.unreconciled td:first-child {
    border-left: 3px solid var(--color-warning);
}

.spend-subgroup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 12px;
}

.spend-acq-method {
    font-size: 11px;
    padding: 3px 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #222;
    max-width: 110px;
}

/* --- Shell for the modals declared inside the Settings view --- */
.modal-card {
    margin: auto;
    width: 100%;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

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

.modal-card .modal-header h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-card .modal-body {
    padding: 22px;
}

.modal-card .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.btn-close-modal:hover {
    color: var(--accent-primary);
}

.form-input,
.modal-card input[type="text"],
.modal-card input[type="url"],
.modal-card select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 14px;
}

.form-input:focus,
.modal-card input:focus,
.modal-card select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.text-error {
    color: var(--accent-primary);
}

/* --- Settings: backup & danger zone --- */
.danger-zone-card {
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.05);
}

.danger-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

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

.danger-action-row .danger-copy {
    flex: 1;
    min-width: 240px;
}

.danger-action-row .danger-copy strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 3px;
}

.danger-action-row .danger-copy span {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.backup-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 16px;
}

.backup-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-input);
}

.backup-panel h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.backup-panel p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.backup-panel input[type="file"] {
    font-size: 12px;
    color: var(--text-secondary);
    width: 100%;
    margin-bottom: 10px;
}

.vault-optin-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--color-warning);
    margin-bottom: 12px;
    cursor: pointer;
    line-height: 1.5;
}

/* --- Automatic backups list --- */
.autobackup-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autobackup-loading,
.autobackup-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 14px 4px;
}

.autobackup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    background: var(--bg-input);
}

.autobackup-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-primary);
}

.autobackup-slot-badge {
    background: rgba(229, 9, 20, 0.14);
    color: var(--accent-primary);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
}

.autobackup-meta {
    color: var(--text-muted);
    font-size: 12px;
}

.autobackup-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   PRINT MEDIA STYLES
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    /* Every document-style modal prints, not just the lot jacket. Hidden backdrops stay
       out of the way because .hidden is display:none, which beats visibility:visible. */
    #print-dialog-area, #print-dialog-area *,
    #work-report-dialog-area, #work-report-dialog-area *,
    #kpi-modal-dialog, #kpi-modal-dialog *,
    #spend-report-dialog-area, #spend-report-dialog-area * {
        visibility: visible;
    }
    #print-dialog-area,
    #work-report-dialog-area,
    #kpi-modal-dialog,
    #spend-report-dialog-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-height: none;
        box-shadow: none;
    }
    #kpi-modal-content, #spend-report-content, #work-report-content {
        background: #fff !important;
        color: #111 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .no-print {
        display: none !important;
    }
}

/* ==========================================================================
   AUTH GATE - covers the whole page until an authorized owner is signed in
   ========================================================================== */
.auth-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-root);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-gate-overlay.hidden {
    display: none;
}
.auth-gate-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
    text-align: center;
}
.auth-gate-card .auth-gate-logo {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 16px;
}
.auth-gate-card h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.auth-gate-card p.auth-gate-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.auth-gate-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}
.auth-gate-form label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}
.auth-gate-error {
    color: var(--color-danger);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    min-height: 16px;
}
.auth-gate-status {
    color: var(--text-muted);
    font-size: 13px;
}
.auth-gate-signout-btn {
    margin-top: 16px;
}

/* ==========================================================================
   MIGRATE-TO-CLOUD BANNER
   ========================================================================== */
.migrate-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.35);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin: 0 24px 16px;
}
.migrate-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.migrate-banner-text strong {
    color: var(--text-primary);
    font-size: 14px;
}
.migrate-banner-text span {
    color: var(--text-secondary);
    font-size: 12px;
    max-width: 640px;
}
.migrate-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ==========================================================================
   MECHANIC APPROVAL QUEUE + SHOP UPLOADS (Phase 6)
   ========================================================================== */

.approvals-btn { position: relative; }
.approvals-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-root);
}

.approvals-dialog { width: 820px; display: flex; flex-direction: column; max-height: 88vh; }
.approvals-body { overflow-y: auto; padding: 8px 24px 24px; }

.approvals-empty { text-align: center; padding: 44px 20px; color: var(--text-secondary); }
.approvals-empty p { margin: 4px 0; }

.approval-row {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 18px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.approval-row:last-child { border-bottom: none; }
.approval-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.approval-type {
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: var(--accent-primary);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.approval-when { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.approval-vehicle { font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.approval-detail { font-size: 14px; color: var(--text-secondary); margin-bottom: 5px; }
.approval-by { font-size: 12px; color: var(--text-muted); }
.approval-warn { margin-top: 7px; font-size: 12px; color: var(--color-warning); }

.approval-actions { display: flex; flex-direction: column; gap: 9px; }
.approval-note-input { font-size: 13px; }
.approval-buttons { display: flex; gap: 8px; }
.approval-buttons .btn { flex: 1; justify-content: center; font-size: 13px; padding: 8px 12px; }

/* ---- Shop uploads inside the vehicle passport ---- */
.shop-uploads { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--border-color); }
.shop-uploads-loading { margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.shop-uploads-head h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    margin: 0 0 4px;
    color: var(--text-primary);
}
.shop-uploads-count {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: var(--color-warning);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
}
.shop-uploads-head p { font-size: 12px; margin: 0 0 14px; }

.shop-uploads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.shop-upload-card {
    margin: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.shop-upload-card.is-merged { opacity: 0.62; }
.shop-upload-img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: var(--bg-input);
    cursor: zoom-in;
}
.shop-upload-card figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.shop-upload-title { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.shop-upload-cost { color: var(--color-success); font-weight: 700; }
.shop-upload-note { font-size: 12px; color: var(--text-secondary); }
.shop-upload-meta { font-size: 11px; color: var(--text-muted); }
.shop-upload-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.shop-upload-merged { font-size: 12px; color: var(--color-success); font-weight: 600; }
.btn-xs { font-size: 11px !important; padding: 5px 9px !important; }
