/* ========================================
   Azaiba2 Workshop Dashboard
   Professional Automotive Dashboard
   ======================================== */

:root {
    /* Core Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #1e293b;
    --bg-hover: #273549;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-yellow: #f59e0b;
    --accent-yellow-glow: rgba(245, 158, 11, 0.3);
    --accent-orange: #f97316;
    --accent-orange-glow: rgba(249, 115, 22, 0.3);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.3);
    --accent-purple: #8b5cf6;
    
    /* Status Colors */
    --status-fleet: #06b6d4;
    --status-leasing: #8b5cf6;
    --status-critical: #ef4444;
    --status-warning: #f59e0b;
    --status-repeat: #f97316;
    
    /* Borders & Shadows */
    --border-color: #2d3a4f;
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
    
    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   Login Screen
   ======================================== */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 9999;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 30%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: loginAppear 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--accent-blue-glow);
}

.login-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-group svg {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.login-input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.login-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.login-input-group input::placeholder {
    color: var(--text-muted);
}

.login-error {
    color: var(--accent-red);
    font-size: 0.875rem;
    text-align: center;
    min-height: 20px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-blue-glow);
}

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

.login-btn svg {
    width: 20px;
    height: 20px;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-footer svg {
    width: 16px;
    height: 16px;
    color: var(--accent-green);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    box-shadow: none;
}

.login-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: none;
    box-shadow: none;
}

/* User info in navbar */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-left: 0.5rem;
}

.user-avatar {
    font-size: 1.1rem;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #ef4444;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-left: 0.5rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* User Management Section */
.user-management-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.add-user-card,
.users-list-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
}

.add-user-card {
    max-width: 700px;
}

.add-user-card h3,
.users-list-card h3 {
    margin: 0 0 1.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.add-user-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.add-user-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-user-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.add-user-form input,
.add-user-form select {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.add-user-form input:focus,
.add-user-form select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.users-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.users-list-header h3 {
    margin: 0;
}

.users-table-container {
    overflow-x: auto;
}

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

.users-table th,
.users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.users-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.users-table tbody tr.current-user {
    background: rgba(59, 130, 246, 0.05);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-cell-avatar {
    font-size: 1.25rem;
}

.user-cell-name {
    font-weight: 500;
}

.user-you-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--accent-blue);
    color: white;
    border-radius: var(--radius-sm);
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.role-badge.workshop-controller {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.role-badge.warranty-admin {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.role-badge.manager {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.role-badge.advisor {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.role-badge.technician {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.role-badge.viewer {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.disabled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions .btn-sm {
    padding: 0.35rem 0.5rem;
}

.users-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.users-empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.users-empty-state p {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.users-empty-state span {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .add-user-card {
        max-width: 100%;
    }
    
    .add-user-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .user-info {
        display: none;
    }
    
    .logout-btn {
        margin-left: 0.25rem;
    }
}

.login-screen.hidden {
    display: none;
}

.main-app {
    display: none;
}

.main-app.visible {
    display: block;
}

/* ========================================
   Navigation
   ======================================== */

.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

body.tv-display-mode .main-nav,
body.tv-display-mode .critical-alert-banner,
body.tv-display-mode .urgent-alert-banner {
    display: none !important;
}

body.tv-display-mode #tvSlideshowIndicator {
    display: none !important;
}

body.tv-display-mode #dashboardView {
    padding: 0;
}

/* =======================================================
   TV-ONLY COMPACT MODE
   Scoped to body.tv-display-mode so the desktop dashboard
   is completely unaffected. Shrinks padding, font sizes,
   and gaps so more content fits on a wall-mounted TV.
   ======================================================= */
body.tv-display-mode .tv-dashboard {
    padding: 0.75rem 1rem;
    gap: 0.6rem;
    min-height: 100vh;
    height: 100vh;
}

body.tv-display-mode .tv-header {
    padding: 0.45rem 1rem;
}

body.tv-display-mode .tv-title h1 { font-size: 1.4rem; line-height: 1.1; }
body.tv-display-mode .tv-subtitle { font-size: 0.75rem; }

/* Datetime */
body.tv-display-mode .tv-date { font-size: 0.8rem; }
body.tv-display-mode .tv-time { font-size: 1.4rem; }

/* Weather tile */
body.tv-display-mode .tv-weather { padding: 0.35rem 0.7rem; min-width: 100px; }
body.tv-display-mode .tv-weather-icon { font-size: 1.3rem; }
body.tv-display-mode .tv-weather-temp { font-size: 1rem; }
body.tv-display-mode .tv-weather-desc { font-size: 0.6rem; }

/* Target strip */
body.tv-display-mode .tv-target-strip { padding: 0.45rem 0.9rem; min-width: 280px; }
body.tv-display-mode .tv-target-icon { font-size: 1.25rem; }
body.tv-display-mode .tv-target-line { font-size: 0.7rem; }
body.tv-display-mode .tv-target-value,
body.tv-display-mode .tv-target-current { font-size: 0.9rem; }

/* Slideshow container should fill remaining viewport */
body.tv-display-mode .tv-slideshow-container {
    flex: 1;
    min-height: 0;
    display: flex;
}
body.tv-display-mode .tv-slide {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
}
body.tv-display-mode .tv-slide.active { display: flex; }
body.tv-display-mode .tv-slide-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Big cards — smaller padding, icon, number */
body.tv-display-mode .tv-priority-row { gap: 0.5rem; }
body.tv-display-mode .tv-big-card { padding: 0.55rem 0.7rem; border-radius: 10px; }
body.tv-display-mode .tv-big-icon { font-size: 1.5rem; }
body.tv-display-mode .tv-big-number { font-size: 1.9rem; }
body.tv-display-mode .tv-big-label { font-size: 0.58rem; }
body.tv-display-mode .tv-sub-item { font-size: 0.65rem; }
body.tv-display-mode .tv-sub-icon { font-size: 0.62rem; }

/* Medium cards */
body.tv-display-mode .tv-secondary-row { gap: 0.6rem; }
body.tv-display-mode .tv-medium-card { padding: 0.75rem; border-radius: 12px; }
body.tv-display-mode .tv-medium-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
body.tv-display-mode .tv-medium-number { font-size: 2.1rem; }
body.tv-display-mode .tv-medium-label { font-size: 0.65rem; letter-spacing: 0.08em; }
body.tv-display-mode .tv-medium-bar { margin-top: 0.45rem; }

/* Slide headers shared style */
body.tv-display-mode .tv-slide-header h2 { font-size: 1.3rem; margin: 0; }
body.tv-display-mode .tv-slide-subtitle { font-size: 0.75rem; }

/* Ultra-wide TV tweak (1080p+ at distance) — bump sizes a bit */
@media (min-width: 1600px) {
    body.tv-display-mode .tv-big-number { font-size: 2.3rem; }
    body.tv-display-mode .tv-medium-number { font-size: 2.6rem; }
    body.tv-display-mode .tv-big-icon { font-size: 1.8rem; }
    body.tv-display-mode .tv-medium-icon { font-size: 1.8rem; }
    body.tv-display-mode .tv-title h1 { font-size: 1.7rem; }
    body.tv-display-mode .tv-time { font-size: 1.7rem; }
}

/* =============================================================
   TV-FIT: Force the Operations Main slide to fit in one screen.
   The cards had hard min-heights that caused the bottom rows
   to be clipped when the browser chrome takes vertical space.
   Here we switch to flex:1 / min-height:0 everywhere, and make
   the heatmap grid distribute rows as equal fractions of whatever
   vertical space is left, so nothing spills off-screen.
   ============================================================= */
body.tv-display-mode #slideMain,
body.tv-display-mode .tv-ops-main-slide {
    min-height: 0;
    overflow: hidden;
}

/* KPI row — stays its natural size but with tighter packing */
body.tv-display-mode .tv-ops-kpi-row {
    gap: 0.55rem;
    flex: 0 0 auto;
}

body.tv-display-mode .tv-ops-card {
    padding: 0.55rem 0.75rem;
    gap: 0.55rem;
    border-radius: 12px;
}

body.tv-display-mode .tv-ops-card-icon   { font-size: 1.3rem; }
body.tv-display-mode .tv-ops-card-number { font-size: 1.85rem; }
body.tv-display-mode .tv-ops-card-label  { font-size: 0.62rem; letter-spacing: 0.05em; }
body.tv-display-mode .tv-ops-card-meta   { font-size: 0.6rem; }

/* Heatmap grid — rows size to CONTENT, not to available space.
   align-content: start packs them at the top so any leftover
   vertical space falls below the last row (as empty slide area)
   instead of being absorbed by stretching the cards themselves.
   overflow: hidden still guards against spill if content is huge. */
body.tv-display-mode .tv-heatmap-grid {
    /* 5 columns on TV instead of the default 4. With the alert-card
       hard cap at 16 we still get at most 4 rows, but in the common
       case of 8-12 alerts we drop from 3 rows down to 2-3, which
       keeps the last row from spilling below the visible TV area. */
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    flex: 1 1 auto;
    min-height: 0;
    grid-auto-rows: auto;
    align-content: start;
    overflow: hidden;
}

/* Cards never stretch to fill a row slot — they own only the height
   of their content */
body.tv-display-mode .tv-heatmap-card,
body.tv-display-mode .tv-heatmap-card.qc-failed-detail,
body.tv-display-mode .tv-heatmap-card.qc-failed-detail.qc-failed-overflow,
body.tv-display-mode .tv-heatmap-card.repeat-detail,
body.tv-display-mode .tv-heatmap-card.urgent-detail,
body.tv-display-mode .tv-heatmap-card.urgent-detail.urgent-overflow {
    align-self: start;
}

body.tv-display-mode .tv-heatmap-card,
body.tv-display-mode .tv-heatmap-card.qc-failed-detail,
body.tv-display-mode .tv-heatmap-card.qc-failed-detail.qc-failed-overflow,
body.tv-display-mode .tv-heatmap-card.repeat-detail,
body.tv-display-mode .tv-heatmap-card.urgent-detail,
body.tv-display-mode .tv-heatmap-card.urgent-detail.urgent-overflow {
    min-height: 0;
    padding: 0.55rem 0.7rem;
    gap: 0.3rem;
    border-radius: 11px;
    overflow: hidden;
}

body.tv-display-mode .tv-heatmap-range { font-size: 0.58rem; letter-spacing: 0.06em; }
body.tv-display-mode .tv-heatmap-count { font-size: 1.5rem; }
body.tv-display-mode .tv-heatmap-meta  { font-size: 0.6rem; }

/* Urgent/QC/repeat detail cards — smaller inner text so they fit */
body.tv-display-mode .tv-urgent-card-eyebrow { font-size: 0.52rem; }
body.tv-display-mode .tv-urgent-card-reg     { font-size: 1rem; }
body.tv-display-mode .tv-urgent-card-name    { font-size: 0.62rem; min-height: 0; line-height: 1.2; }
body.tv-display-mode .tv-urgent-card-chip    { font-size: 0.55rem; padding: 0.1rem 0.35rem; }
body.tv-display-mode .tv-urgent-card-meta-row { gap: 0.25rem; }

/* Further-compressed header on TVs so it doesn't steal vertical space */
body.tv-display-mode .tv-title h1 { font-size: 1.15rem; letter-spacing: 0.06em; }
body.tv-display-mode .tv-subtitle { font-size: 0.58rem; letter-spacing: 0.08em; }
body.tv-display-mode .tv-courtesy-hbadge      { padding: 0.18rem 0.5rem; }
body.tv-display-mode .tv-courtesy-hbadge-label { font-size: 0.5rem; }
body.tv-display-mode .tv-courtesy-hbadge-count { font-size: 0.8rem; }

/* Also shrink right-header tiles (weather, time, appts) a touch */
body.tv-display-mode .tv-appt-badge { padding: 0.3rem 0.6rem; min-width: 84px; }
body.tv-display-mode .tv-appt-count { font-size: 1.25rem; }
body.tv-display-mode .tv-appt-label { font-size: 0.55rem; }
body.tv-display-mode .tv-weather    { padding: 0.3rem 0.6rem; min-width: 90px; }
body.tv-display-mode .tv-weather-icon { font-size: 1.1rem; }
body.tv-display-mode .tv-weather-temp { font-size: 0.9rem; }
body.tv-display-mode .tv-weather-desc { font-size: 0.55rem; }
body.tv-display-mode .tv-date { font-size: 0.7rem; }
body.tv-display-mode .tv-time { font-size: 1.15rem; }

/* Target strip in header centre — compact */
body.tv-display-mode .tv-target-strip { padding: 0.35rem 0.75rem; min-width: 260px; }
body.tv-display-mode .tv-target-icon  { font-size: 1.1rem; }
body.tv-display-mode .tv-target-line  { font-size: 0.62rem; }
body.tv-display-mode .tv-target-value,
body.tv-display-mode .tv-target-current { font-size: 0.8rem; }

/* Header padding trim */
body.tv-display-mode .tv-header { padding: 0.35rem 0.85rem; }
body.tv-display-mode .tv-dashboard { padding: 0.5rem 0.9rem; gap: 0.5rem; }

/* ─────────────────────────────────────────────────────────────
   Fix oversized gaps inside the alert cards (QC Failed / Repeat
   Repair / Urgent Vehicle). They were using justify-content:
   space-between, which stretches content across the whole card
   height. With auto-sized grid rows the cards are tall, so that
   produced the big vertical gaps between the eyebrow, reg#, name
   and the chips. Switch to flex-start + tighter gaps so the
   content hugs the top — the card stays a compact visual block.
   ───────────────────────────────────────────────────────────── */
body.tv-display-mode .tv-heatmap-card.qc-failed-detail,
body.tv-display-mode .tv-heatmap-card.repeat-detail,
body.tv-display-mode .tv-heatmap-card.urgent-detail {
    justify-content: flex-start;
    gap: 0.2rem;
    padding: 0.4rem 0.5rem;
}

/* Inside-card elements: smaller gaps / line heights */
body.tv-display-mode .tv-urgent-card-meta-row {
    gap: 0.25rem;
    margin-top: 0.1rem;
}

/* Eyebrow ("URGENT VEHICLE" / "QC FAILED" / "REPEAT REPAIR") sits
   right on top — no margin eating space */
body.tv-display-mode .tv-urgent-card-eyebrow { margin: 0; line-height: 1; }
body.tv-display-mode .tv-urgent-card-reg     { margin: 0; line-height: 1.05; }
body.tv-display-mode .tv-urgent-card-name    { margin: 0; }

/* Also — heatmap card inner gap pulled tighter so fresh/watch/warning
   cards (4-col ageing row) don't have cavernous gaps either */
body.tv-display-mode .tv-heatmap-card { justify-content: flex-start; gap: 0.25rem; }

body.wash-checkin-mode .main-nav,
body.wash-checkin-mode .critical-alert-banner,
body.wash-checkin-mode .urgent-alert-banner {
    display: none !important;
}

body.qc-checkin-mode .main-nav,
body.qc-checkin-mode .critical-alert-banner,
body.qc-checkin-mode .urgent-alert-banner {
    display: none !important;
}

body.wash-checkin-mode {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(14, 165, 233, 0.16), transparent 36%),
        linear-gradient(180deg, #08111f 0%, #101b31 100%);
}

body.qc-checkin-mode {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.15), transparent 34%),
        linear-gradient(180deg, #08111f 0%, #101b31 100%);
}

.utility-nav-tab {
    display: none !important;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow);
}

.brand-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.375rem;
    border-radius: var(--radius-lg);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.nav-tab svg {
    width: 18px;
    height: 18px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 10px var(--accent-blue-glow);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.nav-separator {
    color: var(--border-color);
    margin: 0 0.25rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-yellow);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.connected {
    background: var(--accent-green);
}

.status-dot.disconnected {
    background: var(--accent-red);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ========================================
   Views
   ======================================== */

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

#dashboardView.active {
    display: block;
    width: 100%;
}

#washcheckinView.active {
    display: block;
    width: 100%;
}

#qccheckinView.active {
    display: block;
    width: 100%;
}

.wash-checkin-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.wash-checkin-card {
    width: min(100%, 760px);
    background: rgba(9, 17, 32, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
}

.wash-checkin-header h1 {
    margin: 0.2rem 0 0.5rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #fff;
}

.wash-checkin-header p {
    margin: 0;
    color: rgba(226, 232, 240, 0.75);
    font-size: 1rem;
    line-height: 1.6;
}

.wash-checkin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(74, 222, 128, 0.24);
    color: #bbf7d0;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wash-checkin-form {
    margin-top: 1.75rem;
}

.wash-checkin-form label {
    display: block;
    margin-bottom: 0.7rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
}

.wash-checkin-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
}

.wash-checkin-input-row input {
    min-height: 58px;
    padding: 0 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wash-checkin-input-row .btn {
    min-width: 170px;
    min-height: 58px;
}

.wash-checkin-hint {
    margin: 0.8rem 0 0;
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.88rem;
    line-height: 1.5;
}

.wash-checkin-feedback {
    margin-top: 1rem;
    min-height: 24px;
}

.wash-checkin-message {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
}

.wash-checkin-message.info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: #bfdbfe;
}

.wash-checkin-message.success {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.24);
    color: #bbf7d0;
}

.wash-checkin-message.error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.24);
    color: #fecaca;
}

.wash-checkin-matches {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.wash-checkin-match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.74);
}

.wash-checkin-match-title {
    display: block;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.wash-checkin-match-meta {
    display: block;
    margin-top: 0.35rem;
    color: rgba(226, 232, 240, 0.68);
    font-size: 0.88rem;
}

.wash-checkin-match-action {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: stretch;
    min-width: 180px;
}

.wash-checkin-match-action .btn {
    min-width: 180px;
    justify-content: center;
}

.btn.btn-early-wash {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f1205;
    border: 1px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 10px 22px -14px rgba(245, 158, 11, 0.8);
    font-weight: 700;
}

.btn.btn-early-wash:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f1205;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -14px rgba(245, 158, 11, 0.95);
}

.btn.btn-early-wash:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.qc-checkin-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.qc-checkin-result-actions .btn {
    min-width: 160px;
}

.wash-checkin-footer {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wash-checkin-footer-label {
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wash-checkin-footer a {
    color: #7dd3fc;
    font-size: 0.92rem;
    word-break: break-all;
}

@media (max-width: 720px) {
    .wash-checkin-shell {
        padding: 1rem;
    }

    .wash-checkin-card {
        padding: 1.25rem;
        border-radius: 22px;
    }

    .wash-checkin-input-row,
    .wash-checkin-match-card {
        grid-template-columns: 1fr;
    }

    .wash-checkin-input-row .btn,
    .wash-checkin-match-action .btn {
        width: 100%;
    }
}

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

/* ========================================
   Entry View - Form Styles
   ======================================== */

.entry-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.vehicle-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.label-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.label-icon svg {
    width: 16px;
    height: 16px;
    color: var(--accent-blue);
}

.label-icon.critical-icon svg {
    color: var(--accent-red);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-base);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.repeat-warning {
    font-size: 0.85rem;
    color: var(--accent-orange);
    min-height: 20px;
}

.fleet-availability-hint {
    font-size: 0.85rem;
    color: var(--accent-green);
    min-height: 20px;
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    flex: 1;
    min-width: 140px;
}

.radio-option:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all var(--transition-base);
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--accent-blue);
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.radio-option input:checked + .radio-custom {
    border-color: var(--accent-blue);
}

.radio-option input:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-option input:checked + .radio-custom.critical {
    border-color: var(--accent-red);
}

.radio-option input:checked + .radio-custom.critical::after {
    background: var(--accent-red);
}

.radio-option input:checked + .radio-custom.repeat {
    border-color: var(--status-repeat);
}

.radio-option input:checked + .radio-custom.repeat::after {
    background: var(--status-repeat);
}

.radio-option input:checked + .radio-custom.warning {
    border-color: var(--accent-yellow);
}

.radio-option input:checked + .radio-custom.warning::after {
    background: var(--accent-yellow);
}

.radio-option input:checked + .radio-custom.fleet {
    border-color: var(--status-fleet);
}

.radio-option input:checked + .radio-custom.fleet::after {
    background: var(--status-fleet);
}

.radio-option input:checked + .radio-custom.leasing {
    border-color: var(--status-leasing);
}

.radio-option input:checked + .radio-custom.leasing::after {
    background: var(--status-leasing);
}

/* Daily Inflow radio options */
.inflow-icon {
    color: var(--accent-blue);
}

.inflow-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.radio-option input:checked + .radio-custom.appointment {
    border-color: #10b981;
}

.radio-option input:checked + .radio-custom.appointment::after {
    background: #10b981;
}

.radio-option input:checked + .radio-custom.non-appointment {
    border-color: #f59e0b;
}

.radio-option input:checked + .radio-custom.non-appointment::after {
    background: #f59e0b;
}

.radio-option input:checked + .radio-custom.pms {
    border-color: #8b5cf6;
}

.radio-option input:checked + .radio-custom.pms::after {
    background: #8b5cf6;
}

.radio-option input:checked + .radio-custom.repair {
    border-color: #ef4444;
}

.radio-option input:checked + .radio-custom.repair::after {
    background: #ef4444;
}

/* Daily Inflow badges */
.inflow-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.inflow-badge.appointment {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.inflow-badge.non-appointment {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.inflow-badge.pms {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.inflow-badge.repair {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

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

.critical-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .critical-options {
        grid-template-columns: 1fr;
    }
}

.radio-label {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-blue-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    box-shadow: 0 4px 15px var(--accent-green-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-green-glow);
}

/* ========================================
   Dashboard View - TV Display
   ======================================== */

.dashboard-container {
    padding: 1.5rem;
    min-height: calc(100vh - 60px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow);
}

.title-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.dashboard-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.dashboard-time #currentDate {
    font-size: 1rem;
    color: var(--text-secondary);
}

.dashboard-time #currentTime {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-blue);
}

/* Job Status Summary Bar */
.job-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.job-status-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.job-status-icon {
    font-size: 1rem;
}

.job-status-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.job-status-count {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    min-width: 28px;
    text-align: center;
}

.job-status-item.in-progress .job-status-count {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.job-status-item.waiting-parts .job-status-count {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.job-status-item.qc .job-status-count {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.job-status-item.pacp .job-status-count {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

.job-status-item.ready .job-status-count {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.job-status-item.technicians-duty .job-status-count {
    background: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
}

.job-status-item.advisors-duty .job-status-count {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.job-status-divider {
    color: var(--border-color);
    font-size: 1rem;
    margin: 0 0.25rem;
}

@media (max-width: 1200px) {
    .job-status-bar {
        display: none;
    }
}

@media (min-width: 1920px) {
    .job-status-bar {
        padding: 0.75rem 1.5rem;
        gap: 0.75rem;
    }
    
    .job-status-icon {
        font-size: 1.25rem;
    }
    
    .job-status-label {
        font-size: 1rem;
    }
    
    .job-status-count {
        font-size: 1.25rem;
        padding: 0.25rem 0.625rem;
    }
}

/* Daily Inflow Stats Grid (TV Dashboard) */
.inflow-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.inflow-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

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

.inflow-stat-icon {
    font-size: 1.75rem;
}

.inflow-stat-content {
    display: flex;
    flex-direction: column;
}

.inflow-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.inflow-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.inflow-stat-card.appointment {
    border-left: 4px solid #10b981;
}

.inflow-stat-card.appointment .inflow-stat-value {
    color: #10b981;
}

.inflow-stat-card.non-appointment {
    border-left: 4px solid #f59e0b;
}

.inflow-stat-card.non-appointment .inflow-stat-value {
    color: #f59e0b;
}

.inflow-stat-card.pms {
    border-left: 4px solid #8b5cf6;
}

.inflow-stat-card.pms .inflow-stat-value {
    color: #8b5cf6;
}

.inflow-stat-card.repair {
    border-left: 4px solid #ef4444;
}

.inflow-stat-card.repair .inflow-stat-value {
    color: #ef4444;
}

@media (max-width: 1200px) {
    .inflow-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1920px) {
    .inflow-stat-value {
        font-size: 2.25rem;
    }
    
    .inflow-stat-label {
        font-size: 1rem;
    }
    
    .inflow-stat-icon {
        font-size: 2rem;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-card.courtesy-fleet .stat-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--status-fleet);
}

.stat-card.courtesy-leasing .stat-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--status-leasing);
}

.stat-card.critical .stat-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-critical);
}

/* Critical Cases Card - Subtle Border & Number Glow */
.stat-card.critical {
    position: relative;
    background: var(--bg-card) !important;
    background-color: #1e293b !important;
    border: 2px solid rgba(239, 68, 68, 0.4);
    animation: criticalBorderPulse 2s ease-in-out infinite;
}

.stat-card.critical .stat-value {
    color: var(--status-critical);
    animation: criticalNumberGlow 2s ease-in-out infinite;
}

@keyframes criticalBorderPulse {
    0%, 100% { 
        border-color: rgba(239, 68, 68, 0.3);
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
    }
    50% { 
        border-color: rgba(239, 68, 68, 0.8);
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    }
}

@keyframes criticalNumberGlow {
    0%, 100% { 
        text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    }
    50% { 
        text-shadow: 0 0 15px rgba(239, 68, 68, 0.8),
                     0 0 25px rgba(239, 68, 68, 0.4);
    }
}

.stat-card.repeat .stat-icon {
    background: rgba(249, 115, 22, 0.15);
    color: var(--status-repeat);
}

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

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.stat-card.courtesy-fleet .stat-value { color: var(--status-fleet); }
.stat-card.courtesy-leasing .stat-value { color: var(--status-leasing); }
.stat-card.critical .stat-value { color: var(--status-critical); }
.stat-card.repeat .stat-value { color: var(--status-repeat); }

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-days {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.stat-card.courtesy-fleet .stat-days {
    color: var(--status-fleet);
    background: rgba(6, 182, 212, 0.15);
}

.stat-card.courtesy-leasing .stat-days {
    color: var(--status-leasing);
    background: rgba(139, 92, 246, 0.15);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.25rem;
}

.dashboard-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.courtesy-section {
    grid-column: span 2;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header h2 svg {
    width: 22px;
    height: 22px;
    color: var(--accent-blue);
}

.section-badge {
    padding: 0.375rem 0.875rem;
    background: var(--accent-blue);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.section-badge.critical-badge {
    background: var(--status-critical);
}

.section-badge.repeat-badge {
    background: var(--status-repeat);
}

/* Courtesy Table */
.courtesy-table-container {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

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

.courtesy-table th,
.courtesy-table td {
    padding: 0.875rem 1rem;
    text-align: left;
}

.courtesy-table th {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.courtesy-table td {
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.courtesy-table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* Source Badge */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.source-badge.fleet {
    background: rgba(6, 182, 212, 0.15);
    color: var(--status-fleet);
}

.source-badge.leasing {
    background: rgba(139, 92, 246, 0.15);
    color: var(--status-leasing);
}

/* Days Badge */
.days-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
}

.days-badge.ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.days-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.days-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    animation: criticalPulse 2s ease-in-out infinite;
}

.status-badge.inactive {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

@keyframes criticalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Job Status Badges */
.job-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.job-status-badge.in-progress {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.job-status-badge.waiting-parts {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.waiting-parts-workshop {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.job-status-badge.waiting-parts-delivered {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.job-status-badge.waiting-customer {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.waiting-warranty {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.waiting-technical {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.qc {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.job-status-badge.pacp {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.job-status-badge.washing {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.job-status-badge.washing-done {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.job-status-badge.waiting-allotment {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.service-done-pending {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.job-status-badge.job-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.job-status-badge.vehicle-delivered {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.job-status-badge.waiting-for-customer {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.wip-submitted-wty {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.job-status-badge.wty-wip-received {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.job-status-badge.wty-invoicing-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.wty-invoiced {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.job-status-badge.wty-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.job-status-badge.ready {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Critical & Repeat Cards */
.critical-cards,
.repeat-cards {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.critical-card,
.repeat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.critical-card {
    border-left-color: var(--status-critical);
}

.repeat-card {
    border-left-color: var(--status-repeat);
}

.card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.critical-card .card-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-critical);
}

.repeat-card .card-icon {
    background: rgba(249, 115, 22, 0.15);
    color: var(--status-repeat);
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-details {
    flex: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.repeat-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: rgba(249, 115, 22, 0.2);
    color: var(--status-repeat);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1rem;
}

.empty-state span {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ========================================
   Warranty View
   ======================================== */

.warranty-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.warranty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.warranty-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.warranty-header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.warranty-actions {
    display: flex;
    gap: 0.75rem;
}

/* Warranty Stats Grid */
.warranty-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.warranty-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

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

.warranty-stat-icon {
    font-size: 1.5rem;
}

.warranty-stat-content {
    display: flex;
    flex-direction: column;
}

.warranty-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.warranty-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.warranty-stat-card.wip-submitted {
    border-left: 4px solid #3b82f6;
}
.warranty-stat-card.wip-submitted .warranty-stat-value {
    color: #3b82f6;
}

.warranty-stat-card.wip-received {
    border-left: 4px solid #8b5cf6;
}
.warranty-stat-card.wip-received .warranty-stat-value {
    color: #8b5cf6;
}

.warranty-stat-card.invoicing-pending {
    border-left: 4px solid #f59e0b;
}
.warranty-stat-card.invoicing-pending .warranty-stat-value {
    color: #f59e0b;
}

.warranty-stat-card.invoiced {
    border-left: 4px solid #10b981;
}
.warranty-stat-card.invoiced .warranty-stat-value {
    color: #10b981;
}

.warranty-stat-card.rejected {
    border-left: 4px solid #ef4444;
}
.warranty-stat-card.rejected .warranty-stat-value {
    color: #ef4444;
}

/* Warranty Table */
.warranty-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.warranty-table th,
.warranty-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.warranty-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.warranty-table tbody tr:hover {
    background: var(--bg-secondary);
}

.warranty-table tbody tr.has-remark {
    background: rgba(239, 68, 68, 0.05);
}

.warranty-table tbody tr.has-remark:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Warranty Remark Display */
.warranty-remark-cell {
    max-width: 200px;
}

.warranty-remark-text {
    display: block;
    padding: 0.35rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #ef4444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.warranty-remark-text:hover {
    white-space: normal;
    overflow: visible;
}

.no-remark {
    color: var(--text-muted);
    font-style: italic;
}

/* Warranty Remark Modal */
.warranty-remark-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.warranty-remark-info p {
    margin: 0.25rem 0;
}

#warrantyRemarkText {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
}

#warrantyRemarkText:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 1.5rem;
}

@media (max-width: 1200px) {
    .warranty-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .warranty-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .warranty-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .warranty-table-container {
        overflow-x: auto;
    }
}

/* ========================================
   Reports & Analytics View
   ======================================== */

.reports-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
}

.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.reports-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.reports-header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.reports-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Quick Jump Menu */
.quick-jump-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    position: sticky;
    top: 80px;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.quick-jump-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quick-jump-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-jump-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

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

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

.quick-jump-icon {
    font-size: 1rem;
}

.report-section-anchor {
    scroll-margin-top: 160px;
}

@media (max-width: 1200px) {
    .quick-jump-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .quick-jump-buttons {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .quick-jump-menu {
        position: relative;
        top: 0;
    }
    
    .quick-jump-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .quick-jump-btn span.quick-jump-icon {
        display: none;
    }
}

.report-filter {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 28px;
    height: 28px;
}

.kpi-icon.total {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.kpi-icon.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.kpi-icon.avg-days {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.kpi-icon.courtesy {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

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

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    color: var(--text-primary);
}

.kpi-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.kpi-change {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    width: fit-content;
}

.kpi-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.kpi-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-row:first-of-type {
    grid-template-columns: 2fr 1fr;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
}

.chart-card:hover {
    box-shadow: var(--shadow-lg);
}

.chart-card.large {
    grid-column: span 1;
}

.chart-header {
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chart-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.chart-body {
    position: relative;
    height: 280px;
}

.chart-body canvas {
    max-height: 100%;
}

/* Report Table */
.report-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.report-table th,
.report-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.report-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.report-table td {
    font-family: 'JetBrains Mono', monospace;
}

.report-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.metric-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

/* Report Sections */
.report-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Turnaround Time Analysis */
.turnaround-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.turnaround-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.turnaround-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.turnaround-icon {
    font-size: 2rem;
}

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

.turnaround-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.turnaround-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.turnaround-card.overall {
    border-left: 4px solid #3b82f6;
}
.turnaround-card.overall .turnaround-value {
    color: #3b82f6;
}

.turnaround-card.service {
    border-left: 4px solid #10b981;
}
.turnaround-card.service .turnaround-value {
    color: #10b981;
}

.turnaround-card.repair {
    border-left: 4px solid #f59e0b;
}
.turnaround-card.repair .turnaround-value {
    color: #f59e0b;
}

.turnaround-card.fastest {
    border-left: 4px solid #8b5cf6;
}
.turnaround-card.fastest .turnaround-value {
    color: #8b5cf6;
    font-size: 1.25rem;
}

/* Aging Report */
.aging-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.aging-card {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.aging-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.aging-card {
    cursor: pointer;
    position: relative;
}

.aging-card::after {
    content: 'Click to filter';
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.aging-card:hover::after {
    opacity: 1;
}

.aging-card.selected {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.aging-card.selected::after {
    content: '✓ Selected';
    opacity: 1;
    color: var(--accent-primary);
    font-weight: 600;
}

.aging-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.aging-icon {
    font-size: 1.25rem;
}

.aging-range {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.aging-count {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.aging-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.aging-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.aging-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.aging-card.safe .aging-count { color: #10b981; }
.aging-bar-fill.safe { background: #10b981; }

.aging-card.moderate .aging-count { color: #84cc16; }
.aging-bar-fill.moderate { background: #84cc16; }

.aging-card.warning .aging-count { color: #f59e0b; }
.aging-bar-fill.warning { background: #f59e0b; }

.aging-card.critical .aging-count { color: #f97316; }
.aging-bar-fill.critical { background: #f97316; }

.aging-card.severe .aging-count { color: #ef4444; }
.aging-bar-fill.severe { background: #ef4444; }

/* Aging Table */
.aging-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.aging-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.aging-table-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.aging-table-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ef4444;
}

.aging-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.aging-filter-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(59, 130, 246, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--accent-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.aging-filter-clear:hover {
    background: var(--accent-primary);
    color: white;
}

.aging-table-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

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

.aging-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.aging-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.aging-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.aging-table .days-critical {
    color: #ef4444;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.aging-table .days-severe {
    color: #ef4444;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.aging-empty {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.aging-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.aging-empty p {
    font-size: 1.1rem;
    margin: 0;
}

/* Warranty Analysis */
.warranty-analysis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.warranty-kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.warranty-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.warranty-kpi-icon {
    font-size: 2.5rem;
}

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

.warranty-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.warranty-kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.warranty-kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.warranty-kpi-card.total {
    border-left: 4px solid #3b82f6;
}
.warranty-kpi-card.total .warranty-kpi-value {
    color: #3b82f6;
}

.warranty-kpi-card.approved {
    border-left: 4px solid #10b981;
}
.warranty-kpi-card.approved .warranty-kpi-value {
    color: #10b981;
}

.warranty-kpi-card.rejected {
    border-left: 4px solid #ef4444;
}
.warranty-kpi-card.rejected .warranty-kpi-value {
    color: #ef4444;
}

.warranty-kpi-card.processing {
    border-left: 4px solid #f59e0b;
}
.warranty-kpi-card.processing .warranty-kpi-value {
    color: #f59e0b;
}

/* Rejection Reasons List */
.rejection-reasons-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.rejection-reasons-list {
    width: 100%;
    padding: 1rem;
}

.rejection-reason-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all var(--transition-base);
}

.rejection-reason-item:hover {
    background: var(--bg-secondary);
}

.rejection-reason-item:last-child {
    margin-bottom: 0;
}

.rejection-reason-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
}

.rejection-reason-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.rejection-reasons-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.rejection-reasons-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Warranty Aging Table */
.warranty-aging-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
}

.warranty-aging-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.warranty-aging-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f59e0b;
}

.warranty-aging-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

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

.warranty-aging-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.warranty-aging-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.warranty-aging-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.warranty-aging-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.warranty-aging-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

@media (max-width: 1400px) {
    .warranty-analysis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Repeat Repair Tracker */
.repeat-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.repeat-kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.repeat-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.repeat-kpi-icon {
    font-size: 2.5rem;
}

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

.repeat-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.repeat-kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.repeat-kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.repeat-kpi-card.total {
    border-left: 4px solid #f59e0b;
}
.repeat-kpi-card.total .repeat-kpi-value {
    color: #f59e0b;
}

.repeat-kpi-card.rate {
    border-left: 4px solid #ef4444;
}
.repeat-kpi-card.rate .repeat-kpi-value {
    color: #ef4444;
}

.repeat-kpi-card.days30 {
    border-left: 4px solid #dc2626;
}
.repeat-kpi-card.days30 .repeat-kpi-value {
    color: #dc2626;
}

.repeat-kpi-card.avgdays {
    border-left: 4px solid #3b82f6;
}
.repeat-kpi-card.avgdays .repeat-kpi-value {
    color: #3b82f6;
}

/* Repeat Filter Cards */
.repeat-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.repeat-filter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.repeat-filter-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.repeat-filter-card.selected {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.repeat-filter-card.critical.selected {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.repeat-filter-card.warning.selected {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.repeat-filter-card.moderate.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.repeat-filter-card.all.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.repeat-filter-icon {
    font-size: 1.5rem;
}

.repeat-filter-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.repeat-filter-count {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.repeat-filter-card.critical .repeat-filter-count { color: #ef4444; }
.repeat-filter-card.warning .repeat-filter-count { color: #f97316; }
.repeat-filter-card.moderate .repeat-filter-count { color: #f59e0b; }
.repeat-filter-card.all .repeat-filter-count { color: #3b82f6; }

/* Repeat Table */
.repeat-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
}

.repeat-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.repeat-table-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.repeat-table-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f59e0b;
}

.repeat-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.repeat-table-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

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

.repeat-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.repeat-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.repeat-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.repeat-days-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.repeat-days-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.repeat-days-badge.warning {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.repeat-days-badge.moderate {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.repeat-empty {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.repeat-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.repeat-empty p {
    font-size: 1.1rem;
    margin: 0;
}

/* Early Washing Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.checkbox-label:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    background: var(--bg-card);
}

.checkbox-custom svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-base);
    stroke: white;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #06b6d4;
    border-color: #06b6d4;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom.early-wash {
    background: #06b6d4;
    border-color: #06b6d4;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.checkbox-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.early-wash-label input[type="checkbox"]:checked ~ .checkbox-text .checkbox-title {
    color: #06b6d4;
}

/* Early Washing Badge for tables */
.early-wash-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    animation: earlyWashPulse 2s ease-in-out infinite;
}

@keyframes earlyWashPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }
    50% {
        box-shadow: 0 0 8px 2px rgba(6, 182, 212, 0.3);
    }
}

.early-wash-badge-icon {
    font-size: 0.85rem;
}

/* Appointment Analysis */
.appointment-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.date-filter-group {
    display: flex;
    gap: 0.5rem;
}

.date-filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.date-filter-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.custom-date-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.custom-date-picker input[type="date"] {
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.custom-date-picker span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* Appointment KPI Grid */
.appointment-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.appointment-kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.appointment-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.appointment-kpi-icon {
    font-size: 2.5rem;
}

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

.appointment-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.appointment-kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.appointment-kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.appointment-kpi-card.total {
    border-left: 4px solid #3b82f6;
}
.appointment-kpi-card.total .appointment-kpi-value {
    color: #3b82f6;
}

.appointment-kpi-card.appointment {
    border-left: 4px solid #10b981;
}
.appointment-kpi-card.appointment .appointment-kpi-value {
    color: #10b981;
}

.appointment-kpi-card.non-appointment {
    border-left: 4px solid #f59e0b;
}
.appointment-kpi-card.non-appointment .appointment-kpi-value {
    color: #f59e0b;
}

.appointment-kpi-card.compliance {
    border-left: 4px solid #8b5cf6;
}
.appointment-kpi-card.compliance .appointment-kpi-value {
    color: #8b5cf6;
}

/* Appointment Table */
.appointment-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
}

.appointment-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.appointment-table-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.appointment-table-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
}

.appointment-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.appointment-table-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.appointment-table-actions select {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}

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

.appointment-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.appointment-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.appointment-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.appointment-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.appointment-type-badge.appointment {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.appointment-type-badge.non-appointment {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.appointment-empty {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.appointment-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.appointment-empty p {
    font-size: 1.1rem;
    margin: 0;
}

.chart-card.wide {
    grid-column: span 2;
}

@media (max-width: 1400px) {
    .appointment-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-card.wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .appointment-kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .appointment-filter-controls {
        align-items: stretch;
    }
    
    .date-filter-group {
        flex-wrap: wrap;
    }
    
    .custom-date-picker {
        flex-wrap: wrap;
    }
    
    .appointment-table-container {
        overflow-x: auto;
    }
    
    .appointment-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 1400px) {
    .repeat-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .repeat-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .repeat-kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .repeat-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .repeat-table-container {
        overflow-x: auto;
    }
}

/* Responsive for new sections */
@media (max-width: 1400px) {
    .turnaround-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aging-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .turnaround-grid {
        grid-template-columns: 1fr;
    }
    
    .aging-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aging-table-container {
        overflow-x: auto;
    }
}

/* Responsive */
@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row:first-of-type {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .charts-row:first-of-type {
        grid-template-columns: 1fr;
    }
    
    .reports-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   Warranty Management View
   ======================================== */

.warranty-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

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

.warranty-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.warranty-header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.warranty-actions {
    display: flex;
    gap: 1rem;
}

/* Warranty Stats Grid */
.warranty-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.warranty-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

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

.warranty-stat-icon {
    font-size: 1.75rem;
}

.warranty-stat-content {
    display: flex;
    flex-direction: column;
}

.warranty-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.warranty-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.warranty-stat-card.wip-submitted {
    border-left: 4px solid #3b82f6;
}

.warranty-stat-card.wip-submitted .warranty-stat-value {
    color: #3b82f6;
}

.warranty-stat-card.wip-received {
    border-left: 4px solid #8b5cf6;
}

.warranty-stat-card.wip-received .warranty-stat-value {
    color: #8b5cf6;
}

.warranty-stat-card.invoicing-pending {
    border-left: 4px solid #f59e0b;
}

.warranty-stat-card.invoicing-pending .warranty-stat-value {
    color: #f59e0b;
}

.warranty-stat-card.invoiced {
    border-left: 4px solid #10b981;
}

.warranty-stat-card.invoiced .warranty-stat-value {
    color: #10b981;
}

.warranty-stat-card.rejected {
    border-left: 4px solid #ef4444;
}

.warranty-stat-card.rejected .warranty-stat-value {
    color: #ef4444;
}

/* Warranty Table */
.warranty-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.warranty-table thead {
    background: var(--bg-tertiary);
}

.warranty-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.warranty-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.warranty-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

/* Warranty Remark Display */
.warranty-remark-cell {
    max-width: 200px;
}

.warranty-remark-text {
    display: block;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #ef4444;
    white-space: pre-wrap;
    word-break: break-word;
    animation: remarkPulse 2s ease-in-out infinite;
}

.warranty-remark-text.info-remark {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    animation: remarkPulseBlue 2s ease-in-out infinite;
}

@keyframes remarkPulse {
    0%, 100% {
        background: rgba(239, 68, 68, 0.1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    50% {
        background: rgba(239, 68, 68, 0.25);
        box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.3);
    }
}

@keyframes remarkPulseBlue {
    0%, 100% {
        background: rgba(59, 130, 246, 0.1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
    50% {
        background: rgba(59, 130, 246, 0.25);
        box-shadow: 0 0 8px 2px rgba(59, 130, 246, 0.3);
    }
}

/* Warranty Remark Modal */
.warranty-remark-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.warranty-remark-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

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

@media (max-width: 1200px) {
    .warranty-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .warranty-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .warranty-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .warranty-table-container {
        overflow-x: auto;
    }
}

/* ========================================
   Critical Complaints View
   ======================================== */

.complaints-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.complaints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.complaints-header-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.complaints-header-text p {
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
}

.complaints-stats {
    display: flex;
    gap: 1rem;
}

.complaint-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 100px;
}

.complaint-stat.open {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.complaint-stat.solved {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.complaint-stat.escalated {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.complaint-stat-number {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.complaint-stat.open .complaint-stat-number {
    color: #ef4444;
}

.complaint-stat.solved .complaint-stat-number {
    color: #10b981;
}

.complaint-stat.escalated .complaint-stat-number {
    color: #f59e0b;
}

.complaint-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    display: block;
}

.complaints-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.complaint-form-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.complaints-list-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.complaint-form-panel .panel-header,
.complaints-list-panel .panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.complaint-form-panel .panel-header h2,
.complaints-list-panel .panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.complaint-form {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.complaint-form .form-row {
    display: contents;
}

.complaint-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.complaint-form .form-group.full-width {
    grid-column: span 4;
}

.complaint-form .form-group.span-2 {
    grid-column: span 2;
}

/* Escalation Notes Styling */
.complaint-form .form-group.escalation-notes {
    padding: 1rem;
    border-radius: 10px;
    margin-top: 0.5rem;
}

.complaint-form #jetourNotesGroup {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.complaint-form #jetourNotesGroup label {
    color: #f59e0b;
    font-weight: 600;
}

.complaint-form #technicalNotesGroup {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.complaint-form #technicalNotesGroup label {
    color: #3b82f6;
    font-weight: 600;
}

.complaint-form #solutionNotesGroup {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem;
    border-radius: 10px;
}

.complaint-form #solutionNotesGroup label {
    color: #10b981;
    font-weight: 600;
}

.complaint-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.complaint-form input[type="text"],
.complaint-form input[type="tel"],
.complaint-form input[type="date"],
.complaint-form textarea,
.complaint-form select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.complaint-form input:focus,
.complaint-form textarea:focus,
.complaint-form select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.complaint-form .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.complaint-form .radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.complaint-form .radio-option:hover {
    border-color: var(--primary-color);
}

.complaint-form .radio-option input {
    accent-color: var(--primary-color);
}

.complaint-form .radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.complaint-form .form-row.checkboxes {
    grid-column: span 4;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.complaint-form .checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    transition: all 0.2s ease;
}

.complaint-form .checkbox-option:hover {
    border-color: var(--primary-color);
}

.complaint-form .checkbox-option input {
    width: 22px;
    height: 22px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Solved option - Green */
.complaint-form .checkbox-option.solved-option:has(input:checked) {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Escalate to Jetour - Orange */
.complaint-form .checkbox-option.escalate-option:has(input:checked) {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* Escalate to Technical - Blue */
.complaint-form .checkbox-option.technical-option:has(input:checked) {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.complaint-form .form-actions {
    grid-column: span 2;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 1200px) {
    .complaint-form {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .complaint-form .form-group.full-width {
        grid-column: span 2;
    }
    
    .complaint-form .form-row.checkboxes,
    .complaint-form .form-actions {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .complaint-form {
        grid-template-columns: 1fr;
    }
    
    .complaint-form .form-group.full-width,
    .complaint-form .form-row.checkboxes,
    .complaint-form .form-actions {
        grid-column: span 1;
    }
    
    .complaint-form .form-row.checkboxes {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Complaints List */
.complaints-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.complaints-table-container {
    overflow-x: auto;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

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

.complaints-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.complaints-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.complaints-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

.complaint-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.complaint-status-badge.open {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.complaint-status-badge.solved {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.complaint-status-badge.escalated {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.complaint-age {
    font-weight: 600;
}

.complaint-age.critical {
    color: #ef4444;
}

.complaint-age.warning {
    color: #f59e0b;
}

.complaint-age.ok {
    color: #10b981;
}

.complaint-actions {
    display: flex;
    gap: 0.5rem;
}

.complaint-actions .btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.complaint-actions .btn-icon svg {
    width: 16px;
    height: 16px;
}

/* View button - Blue */
.complaint-actions .btn-icon.view,
.complaint-actions .btn-icon:first-child {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.complaint-actions .btn-icon.view:hover,
.complaint-actions .btn-icon:first-child:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

/* Solve button - Green */
.complaint-actions .btn-icon.solve {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.complaint-actions .btn-icon.solve:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

/* Delete button - Red */
.complaint-actions .btn-icon.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.complaint-actions .btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* Edit button - Orange/Amber */
.complaint-actions .btn-icon.edit {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.complaint-actions .btn-icon.edit:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

/* Edit Complaint Modal */
.edit-complaint-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.edit-complaint-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.edit-complaint-checkboxes .checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.edit-complaint-checkboxes .checkbox-option:hover {
    border-color: var(--primary-color);
}

.edit-complaint-checkboxes .checkbox-option input {
    width: 18px;
    height: 18px;
}

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

/* Complaint Modal Overlay (for View and Edit) */
.complaint-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 2rem;
    box-sizing: border-box;
}

.complaint-modal-overlay .complaint-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
}

.complaint-modal-overlay .complaint-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.complaint-modal-overlay .complaint-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.complaint-modal-overlay .complaint-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.complaint-modal-overlay .complaint-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.complaint-modal-overlay .complaint-modal-body {
    padding: 1.5rem;
}

.complaint-modal-overlay .form-group {
    margin-bottom: 1rem;
}

.complaint-modal-overlay .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.complaint-modal-overlay .form-group input,
.complaint-modal-overlay .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}

.complaint-modal-overlay .form-group input:focus,
.complaint-modal-overlay .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.complaint-modal-overlay .complaint-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Complaint Modal */
.complaint-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.complaint-modal.active {
    opacity: 1;
    visibility: visible;
}

.complaint-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 100000;
}

.complaint-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
}

.complaint-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.complaint-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.complaint-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.complaint-modal-close svg {
    width: 18px;
    height: 18px;
}

.complaint-modal-body {
    padding: 1.5rem;
}

@media (max-width: 1200px) {
    .complaints-content {
        grid-template-columns: 1fr;
    }
    
    .complaint-form-panel {
        order: 1;
    }
    
    .complaints-list-panel {
        order: 2;
    }
}

@media (max-width: 768px) {
    .complaints-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .complaints-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .complaint-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .complaint-form .form-group.full-width {
        grid-column: span 1;
    }
}

/* ========================================
   Storage Monitor View
   ======================================== */

.storage-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

.storage-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.storage-header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Storage Overview Card */
.storage-overview {
    margin-bottom: 2rem;
}

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

.storage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.storage-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.storage-status {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.storage-status.ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.storage-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.storage-status.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.storage-progress-container {
    margin-bottom: 1rem;
}

.storage-progress-bar {
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.storage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    border-radius: var(--radius-md);
    transition: width 0.5s ease;
    width: 0%;
}

.storage-progress-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.storage-progress-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.storage-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.storage-warning {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    font-weight: 500;
}

/* Storage Breakdown */
.storage-breakdown {
    margin-bottom: 2rem;
}

.storage-breakdown h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.storage-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.storage-breakdown-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.storage-breakdown-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.storage-breakdown-icon svg {
    width: 24px;
    height: 24px;
}

.storage-breakdown-icon.vehicles {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.storage-breakdown-icon.attendance {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.storage-breakdown-icon.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--status-fleet);
}

.storage-breakdown-icon.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.storage-breakdown-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.storage-breakdown-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.storage-breakdown-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.storage-breakdown-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Data Cleanup Section */
.storage-cleanup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.storage-cleanup h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cleanup-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cleanup-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cleanup-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cleanup-option-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cleanup-option-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cleanup-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* Storage Tips */
.storage-tips {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.storage-tips h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.storage-tips ul {
    list-style: none;
    padding: 0;
}

.storage-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.storage-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.storage-tips li strong {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .storage-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .cleanup-option {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ========================================
   Staff Attendance View
   ======================================== */

.attendance-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.attendance-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.attendance-header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.attendance-date {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-weight: 600;
}

.attendance-date svg {
    width: 20px;
    height: 20px;
    color: var(--accent-blue);
}

/* Attendance Summary Cards */
.attendance-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.attendance-summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.attendance-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.attendance-summary-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.attendance-summary-icon svg {
    width: 28px;
    height: 28px;
}

.attendance-summary-card.on-duty .attendance-summary-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.attendance-summary-card.absent .attendance-summary-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.attendance-summary-card.total .attendance-summary-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.attendance-summary-content {
    display: flex;
    flex-direction: column;
}

.attendance-summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.attendance-summary-card.on-duty .attendance-summary-value { color: var(--accent-green); }
.attendance-summary-card.absent .attendance-summary-value { color: var(--accent-red); }
.attendance-summary-card.total .attendance-summary-value { color: var(--accent-purple); }

.attendance-summary-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Attendance Sections */
.attendance-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.attendance-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.attendance-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.attendance-section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.attendance-section-count {
    padding: 0.35rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-blue);
}

/* Attendance Grid */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.attendance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.attendance-card:hover {
    background: var(--bg-hover);
}

.attendance-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attendance-card-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.attendance-card-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Attendance Toggle Switch */
.attendance-toggle {
    position: relative;
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    gap: 0.25rem;
}

.attendance-toggle-btn {
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    background: transparent;
    color: var(--text-muted);
}

.attendance-toggle-btn.on-duty {
    color: var(--text-muted);
}

.attendance-toggle-btn.absent {
    color: var(--text-muted);
}

.attendance-toggle-btn.active.on-duty {
    background: var(--accent-green);
    color: white;
}

.attendance-toggle-btn.active.absent {
    background: var(--accent-red);
    color: white;
}

.attendance-card.is-absent {
    opacity: 0.6;
    border-color: rgba(239, 68, 68, 0.3);
}

.attendance-card.is-on-duty {
    border-color: rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    .attendance-summary {
        grid-template-columns: 1fr;
    }
    
    .attendance-grid {
        grid-template-columns: 1fr;
    }
    
    .attendance-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ========================================
   Fleet Inventory View
   ======================================== */

.fleet-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.fleet-header-text {
    text-align: left;
}

.fleet-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--status-fleet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fleet-header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Fleet Summary Cards */
.fleet-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.fleet-summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.fleet-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.fleet-summary-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.fleet-summary-icon svg {
    width: 28px;
    height: 28px;
}

.fleet-summary-card.available .fleet-summary-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.fleet-summary-card.in-use .fleet-summary-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--status-fleet);
}

.fleet-summary-card.total .fleet-summary-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.fleet-summary-content {
    display: flex;
    flex-direction: column;
}

.fleet-summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.fleet-summary-card.available .fleet-summary-value { color: var(--accent-green); }
.fleet-summary-card.in-use .fleet-summary-value { color: var(--status-fleet); }
.fleet-summary-card.total .fleet-summary-value { color: var(--accent-purple); }

.fleet-summary-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Fleet Cars Grid */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.fleet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.fleet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.fleet-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fleet-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.15);
    border-radius: var(--radius-md);
    color: var(--status-fleet);
}

.fleet-card-icon svg {
    width: 22px;
    height: 22px;
}

.fleet-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fleet-card-reg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.fleet-status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.fleet-status-badge.available {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.fleet-status-badge.in-use {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.fleet-card-body {
    padding: 1.25rem;
}

.fleet-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fleet-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fleet-info-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.fleet-info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.fleet-info-value.highlight {
    color: var(--status-fleet);
    font-family: 'JetBrains Mono', monospace;
}

.fleet-card-assignment {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.fleet-assignment-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.fleet-assignment-details {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius-md);
}

.fleet-assignment-vehicle {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.fleet-assignment-wip {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.fleet-assignment-days {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(6, 182, 212, 0.15);
    color: var(--status-fleet);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Fleet Assigned Section */
.fleet-assigned-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.fleet-assigned-table-container {
    padding: 1rem;
}

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

.fleet-assigned-table th,
.fleet-assigned-table td {
    padding: 0.875rem 1rem;
    text-align: left;
}

.fleet-assigned-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.fleet-assigned-table td {
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.fleet-assigned-table tbody tr:hover {
    background: var(--bg-hover);
}

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

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

/* ========================================
   Manage View
   ======================================== */

.manage-container {
    padding: 2rem;
}

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

.manage-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.manage-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 3rem;
    width: 300px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.manage-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.7rem, 1vw, 0.95rem);
}

.manage-table th,
.manage-table td {
    padding: clamp(0.4rem, 0.8vw, 1rem);
    text-align: left;
    white-space: nowrap;
}

.manage-table th {
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.manage-table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.action-btn.edit:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.action-btn.delete:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.action-btn.complaint {
    color: #f59e0b;
}

.action-btn.complaint:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.action-btn.complete:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

/* Complaint Added Success Modal */
.complaint-added-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 2rem;
    box-sizing: border-box;
}

.complaint-added-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.complaint-added-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.complaint-added-modal-content h3 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.complaint-added-details {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.complaint-added-details p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.complaint-added-message {
    text-align: left;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.complaint-added-message p {
    margin: 0 0 0.75rem;
    color: #f59e0b;
    font-size: 0.9rem;
}

.complaint-added-message ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.complaint-added-message li {
    margin-bottom: 0.25rem;
}

.complaint-added-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.complaint-added-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

#editForm {
    padding: 1.5rem;
}

.modal-grid {
    gap: 1rem;
}

.modal-grid select {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Status History Timeline */
.status-history-container {
    margin-top: 0.75rem;
}

.status-history-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.status-history-toggle:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.status-history-toggle .toggle-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.status-history-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.status-history-timeline {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.status-history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.status-history-item:last-child {
    border-bottom: none;
}

.status-history-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: 4px;
    flex-shrink: 0;
}

.status-history-item:first-child .status-history-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-history-content {
    flex: 1;
    min-width: 0;
}

.status-history-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.status-history-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-history-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-history-user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-history-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========================================
   Toast Notification
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(150%);
    opacity: 0;
    transition: all var(--transition-base);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    color: var(--accent-green);
}

.toast-message {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* ========================================
   Scrollbar Styles
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

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

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

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .courtesy-section {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .nav-tab span:not(.nav-tab svg) {
        display: none;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .manage-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .manage-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .manage-table-container {
        overflow-x: auto;
    }
    
    .manage-table {
        min-width: 800px;
    }
}

/* TV Display Optimization */
@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }
    
    .dashboard-container {
        padding: 2rem 3rem;
    }
    
    .stat-value {
        font-size: 3rem;
    }
    
    .dashboard-title h1 {
        font-size: 2.5rem;
    }
}


/* Refresh Reminder */
.refresh-reminder {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 340px;
    padding: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.1);
    z-index: 9999;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.refresh-reminder.show {
    transform: translateX(0);
    opacity: 1;
}

.refresh-reminder.hiding {
    transform: translateX(400px);
    opacity: 0;
}

.refresh-reminder-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.refresh-reminder-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.refresh-reminder-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #3b82f6;
}

.refresh-reminder-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.refresh-reminder-text kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    box-shadow: 0 2px 0 var(--border-color);
}

.refresh-reminder-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.refresh-reminder-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.refresh-reminder-close svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 480px) {
    .refresh-reminder {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ========================================
   Entry Layout with Sidebar
   ======================================== */

.entry-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.entry-form-wrapper {
    flex: 1;
}

/* Team Notification Sidebar */
.team-notification-sidebar {
    position: sticky;
    top: 100px;
}

.team-notification-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-notification-box.urgent {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.team-notification-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
}

.team-notification-box.urgent .team-notification-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(249, 115, 22, 0.1) 100%);
}

.team-notification-icon {
    font-size: 1.25rem;
}

.team-notification-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.team-notification-content {
    padding: 1.25rem;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

/* News-ticker mode: horizontal scrolling message */
.team-notification-content.ticker-mode {
    padding: 0.9rem 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

.team-notification-content.ticker-mode .ticker-wrap {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.team-notification-content.ticker-mode .ticker-text {
    display: inline-block;
    padding-left: 100%;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    animation: ticker-scroll 22s linear infinite;
    will-change: transform;
}

.team-notification-box.urgent .team-notification-content.ticker-mode .ticker-text {
    color: #ffffff;
    text-transform: uppercase;
    animation-duration: 18s;
}

.team-notification-content.ticker-mode:hover .ticker-text {
    animation-play-state: paused;
}

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

.team-notification-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.team-notification-content p.team-notification-empty {
    color: var(--text-muted);
    font-style: italic;
}

.team-notification-box.urgent .team-notification-content p {
    color: var(--text-primary);
}

.team-notification-footer {
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 1200px) {
    .entry-layout {
        grid-template-columns: 1fr;
    }
    
    .team-notification-sidebar {
        position: relative;
        top: 0;
        order: -1;
    }
}

/* ========================================
   Admin Panel
   ======================================== */

.admin-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Admin Login */
.admin-login-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    overflow: hidden;
}

.admin-login-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.admin-login-card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
}

.admin-login-card p {
    margin: 0 0 2rem 0;
    color: var(--text-secondary);
}

.admin-login-input-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-login-input-group input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.admin-login-input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.admin-login-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.admin-login-error {
    display: block;
    margin-top: 1rem;
    color: #ef4444;
    font-size: 0.85rem;
}

/* Admin Dashboard */
.admin-dashboard {
    animation: fadeIn 0.3s ease;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-header-text h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.admin-header-text p {
    margin: 0;
    color: var(--text-secondary);
}

/* Admin Section */
.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-section-header {
    margin-bottom: 1.5rem;
}

.admin-section-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.admin-section-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.wash-qr-admin-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.wash-qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    min-height: 220px;
}

.wash-qr-preview img {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
}

.wash-qr-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wash-qr-url-block label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.wash-qr-url-block input {
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.wash-qr-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.wash-qr-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .wash-qr-admin-card {
        grid-template-columns: 1fr;
    }
}

/* Notification Editor */
.notification-editor {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
}

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

.editor-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.editor-char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.notification-editor textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    resize: vertical;
}

.notification-editor textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.notification-editor textarea::placeholder {
    color: var(--text-muted);
}

.editor-options {
    margin: 1rem 0;
}

.editor-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.editor-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Notification Preview */
.notification-preview {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.notification-preview h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.preview-box {
    max-width: 300px;
}

.preview-box .team-notification-box {
    transform: scale(0.95);
    transform-origin: top left;
}

/* Admin Status Grid */
.admin-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.admin-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
}

.admin-status-icon {
    font-size: 1.5rem;
}

.admin-status-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.admin-status-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Admin Tab Style */
.nav-tab.admin-tab {
    border-left: 1px solid var(--border-color);
    margin-left: 0.5rem;
    padding-left: 1.5rem;
}

@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .admin-login-card {
        padding: 2rem 1.5rem;
        margin: 2rem auto;
    }
    
    .admin-login-input-group {
        flex-direction: column;
    }
    
    .admin-status-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-actions {
        flex-direction: column;
    }
    
    .editor-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Job Status Filter
   ======================================== */

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    min-width: 180px;
    transition: all var(--transition-base);
}

.filter-select:hover {
    border-color: var(--accent-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.filter-select option:disabled {
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-tertiary);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: var(--accent-primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
}

.filter-count:empty {
    display: none;
}

.filter-count.warning {
    background: #f59e0b;
}

.filter-count.success {
    background: #10b981;
}

/* Date Filter Styles */
.date-filter-group {
    position: relative;
}

.date-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 140px;
}

.date-filter-toggle:hover {
    border-color: var(--accent-primary);
}

.date-filter-toggle.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.date-filter-toggle svg {
    width: 16px;
    height: 16px;
}

.date-filter-toggle svg.chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.date-filter-toggle.active svg.chevron {
    transform: rotate(180deg);
}

.date-filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #1a1d2e;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    min-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.date-filter-dropdown.show {
    display: block;
}

.date-filter-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.date-preset-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-preset-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

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

.date-filter-custom label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-inputs input[type="date"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.date-inputs input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.date-inputs span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.date-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

@media (max-width: 1200px) {
    .manage-actions {
        flex-wrap: wrap;
    }
    
    .filter-group {
        order: -1;
        width: 100%;
    }
    
    .filter-select {
        flex: 1;
    }
}

/* Warranty Status Badge */
.warranty-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.warranty-status-badge.waiting-warranty {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.warranty-status-badge.wip-submitted-wty {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.warranty-status-badge.wty-wip-received {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.warranty-status-badge.wty-invoicing-pending {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.warranty-status-badge.wty-invoiced {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.warranty-status-badge.wty-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ========================================
   Revenue Report Styles
   ======================================== */

.revenue-updated-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

.revenue-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.revenue-summary-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--border-color);
}

.revenue-summary-card.total {
    border-left-color: #3b82f6;
}

.revenue-summary-card.achieved {
    border-left-color: #10b981;
}

.revenue-summary-card.pending {
    border-left-color: #f59e0b;
}

.revenue-summary-card.percentage {
    border-left-color: #8b5cf6;
}

.revenue-summary-icon {
    font-size: 2rem;
}

.revenue-summary-content {
    display: flex;
    flex-direction: column;
}

.revenue-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.revenue-summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.revenue-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.revenue-tables-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.revenue-brand-table {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.revenue-brand-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.revenue-brand-header.jetour {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    color: #3b82f6;
}

.revenue-brand-header.hongqi {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #ef4444;
}

.revenue-brand-header.mclaren {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.1));
    color: #f97316;
}

.revenue-brand-header.ineos {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
}

.brand-icon {
    font-size: 1.25rem;
}

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

.revenue-table th,
.revenue-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.revenue-table th:first-child,
.revenue-table td:first-child {
    text-align: left;
}

.revenue-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
}

.revenue-table td {
    font-size: 0.9rem;
}

.revenue-table .revenue-positive {
    color: #10b981;
}

.revenue-table .revenue-negative {
    color: #ef4444;
}

.revenue-table .revenue-percentage {
    font-weight: 600;
}

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

.revenue-table tfoot tr {
    background: var(--bg-secondary);
    font-weight: 600;
}

.revenue-progress-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.revenue-progress-section h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.revenue-progress-bars {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.revenue-progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.revenue-progress-label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.revenue-progress-value {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.revenue-progress-bar {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
}

.revenue-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.revenue-progress-fill.jetour {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.revenue-progress-fill.hongqi {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.revenue-progress-fill.mclaren {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.revenue-progress-fill.ineos {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* ========================================
   Courtesy History Report Styles
   ======================================== */

.courtesy-history-report {
    background: var(--card-bg);
}

.courtesy-report-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.courtesy-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.courtesy-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.courtesy-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.courtesy-stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
}

.courtesy-stat-card.delivered .courtesy-stat-icon {
    background: rgba(16, 185, 129, 0.15);
}

.courtesy-stat-card.returned .courtesy-stat-icon {
    background: rgba(59, 130, 246, 0.15);
}

.courtesy-stat-card.changed .courtesy-stat-icon {
    background: rgba(245, 158, 11, 0.15);
}

.courtesy-stat-card.total .courtesy-stat-icon {
    background: rgba(139, 92, 246, 0.15);
}

.courtesy-stat-content {
    display: flex;
    flex-direction: column;
}

.courtesy-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.courtesy-stat-card.delivered .courtesy-stat-value {
    color: #10b981;
}

.courtesy-stat-card.returned .courtesy-stat-value {
    color: #3b82f6;
}

.courtesy-stat-card.changed .courtesy-stat-value {
    color: #f59e0b;
}

.courtesy-stat-card.total .courtesy-stat-value {
    color: #8b5cf6;
}

.courtesy-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.courtesy-history-table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.courtesy-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.courtesy-history-table th {
    background: var(--bg-tertiary);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.courtesy-history-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.courtesy-history-table tbody tr:hover {
    background: var(--bg-hover);
}

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

.courtesy-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.courtesy-event-badge.delivered-returned {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.courtesy-event-badge.returned-early {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.courtesy-event-badge.source-changed {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.courtesy-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.courtesy-status-badge.delivered {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.courtesy-status-badge.active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.courtesy-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.courtesy-source-badge.fleet {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.courtesy-source-badge.leasing {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.courtesy-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.courtesy-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.courtesy-empty-state h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.courtesy-empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .courtesy-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .courtesy-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .courtesy-report-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .courtesy-report-actions select,
    .courtesy-report-actions button {
        width: 100%;
    }
}

/* Complaints Report in Reports View */
.complaints-report-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.complaint-report-stat {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.complaint-report-stat .stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
    line-height: 1;
    color: var(--text-primary);
}

.complaint-report-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    display: block;
}

.complaint-report-stat.open .stat-number {
    color: #ef4444;
}

.complaint-report-stat.solved .stat-number {
    color: #10b981;
}

.complaint-report-stat.escalated .stat-number {
    color: #f59e0b;
}

.complaint-report-stat.critical .stat-number {
    color: #ef4444;
}

@media (max-width: 1200px) {
    .complaints-report-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

/* Revenue Admin Styles */
.revenue-date-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.revenue-date-selector label {
    font-weight: 500;
    white-space: nowrap;
}

.revenue-date-input {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.revenue-admin-brand {
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.revenue-admin-brand-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.revenue-admin-brand-header.jetour {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    color: #3b82f6;
}

.revenue-admin-brand-header.hongqi {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #ef4444;
}

.revenue-admin-brand-header.mclaren {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.1));
    color: #f97316;
}

.revenue-admin-brand-header.ineos {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
}

.revenue-admin-grid {
    padding: 1rem;
}

.revenue-admin-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.revenue-admin-row:last-child {
    margin-bottom: 0;
}

.revenue-admin-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.revenue-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
}

.revenue-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.revenue-admin-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.admin-section-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Data Management Section */
.data-management-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-management-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.data-management-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.data-management-content {
    flex: 1;
}

.data-management-content h4 {
    margin: 0 0 0.25rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.data-management-content p {
    margin: 0 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.data-management-content .data-count {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Responsive Revenue */
@media (max-width: 1024px) {
    .revenue-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .revenue-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .revenue-tables-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .revenue-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .revenue-admin-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .revenue-date-selector {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Courtesy Return Modal */
.courtesy-return-info {
    text-align: center;
    padding: 1rem 0;
}

.courtesy-return-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.courtesy-return-info p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.courtesy-return-info p strong {
    color: var(--accent-primary);
}

.courtesy-return-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-top: 1.5rem !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

/* Completion Options Modal */
.completion-vehicle-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.completion-vehicle-info p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.completion-vehicle-info strong {
    color: var(--text-primary);
}

.completion-question {
    text-align: center;
    margin-bottom: 1.5rem;
}

.completion-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.completion-question p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.completion-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.completion-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.completion-option:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.completion-option-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.completion-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.completion-option-content strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.completion-option-content span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

#optionWarranty:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

#optionComplete:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Active Users Display */
.admin-status-card.active-users {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#adminActiveUsers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.active-users-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}

.active-users-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.admin-status-grid {
    grid-template-columns: repeat(3, 1fr);
}

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

/* ========================================
   Push Notification System
   ======================================== */

/* Admin Panel - Push Notification Editor */
.push-notification-editor {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.push-notification-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.push-notification-input-group input,
.push-notification-input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.push-notification-input-group input:focus,
.push-notification-input-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.push-notification-input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.push-notification-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.push-notification-type {
    cursor: pointer;
}

.push-notification-type input {
    display: none;
}

.push-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.push-type-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.push-type-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.push-type-badge.urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.push-notification-type input:checked + .push-type-badge {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px currentColor;
}

.push-notification-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.active-users-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.active-users-hint .active-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Push Notification Popup */
.push-notification-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.push-notification-popup.active {
    opacity: 1;
    visibility: visible;
}

.push-notification-popup-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.push-notification-popup.active .push-notification-popup-content {
    transform: scale(1) translateY(0);
}

.push-notification-popup-content.info {
    border-top: 4px solid #3b82f6;
}

.push-notification-popup-content.warning {
    border-top: 4px solid #f59e0b;
}

.push-notification-popup-content.urgent {
    border-top: 4px solid #ef4444;
    animation: urgent-pulse 1s ease-in-out infinite;
}

@keyframes urgent-pulse {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 20px 60px rgba(239, 68, 68, 0.3);
    }
}

.push-notification-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.push-notification-close:hover {
    background: var(--accent-primary);
    transform: rotate(90deg);
}

.push-notification-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.push-notification-close:hover svg {
    stroke: white;
}

.push-notification-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.push-notification-popup-content.info .push-notification-icon {
    animation: bounce-in 0.5s ease;
}

.push-notification-popup-content.warning .push-notification-icon {
    animation: shake 0.5s ease;
}

.push-notification-popup-content.urgent .push-notification-icon {
    animation: shake 0.5s ease infinite;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.push-notification-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.push-notification-message {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.push-notification-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Sound indicator */
.push-notification-popup.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: var(--accent-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 1s ease-out;
    opacity: 0;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        width: 100px;
        height: 100px;
        opacity: 0.5;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .push-notification-options {
        flex-direction: column;
    }
    
    .push-notification-actions {
        flex-direction: column;
    }
    
    .active-users-hint {
        order: 2;
    }
}

/* ========================================
   Workflow Progress Tracker
   ======================================== */

.modal-large {
    max-width: 900px;
}

.workflow-tracker {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.workflow-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.workflow-stages {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.workflow-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    min-width: 60px;
}

.workflow-stage-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.workflow-stage-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.workflow-connector {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    min-width: 20px;
    transition: all 0.3s ease;
}

/* Active and Completed States */
.workflow-stage.completed .workflow-stage-icon {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.workflow-stage.completed .workflow-stage-label {
    color: #10b981;
}

.workflow-stage.active .workflow-stage-icon {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    animation: pulse-stage 2s ease-in-out infinite;
}

.workflow-stage.active .workflow-stage-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.workflow-connector.completed {
    background: linear-gradient(90deg, #10b981, #10b981);
}

.workflow-connector.active {
    background: linear-gradient(90deg, #10b981, var(--accent-primary));
}

@keyframes pulse-stage {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* On Hold State */
.workflow-stage.on-hold .workflow-stage-icon {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.workflow-stage.on-hold .workflow-stage-label {
    color: #f59e0b;
}

/* Warranty Track */
.workflow-warranty {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.workflow-warranty-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.workflow-warranty-stages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wty-stage {
    padding: 0.35rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.wty-stage.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

.wty-stage.completed {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.wty-stage.rejected {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.wty-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .workflow-stages {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .workflow-connector {
        display: none;
    }
    
    .workflow-stage {
        width: calc(33.33% - 0.5rem);
        margin-bottom: 0.5rem;
    }
}

/* Job Status Badge Colors - Updated */
.job-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.job-status-badge.jobcard-opened,
.job-status-badge.waiting-allotment {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.job-status-badge.in-progress,
.job-status-badge.waiting-technical {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.job-status-badge.waiting-parts,
.job-status-badge.parts-reserved {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.job-status-badge.waiting-customer {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.job-status-badge.qc {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.job-status-badge.qc-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.job-status-badge.washing,
.job-status-badge.washing-done {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.job-status-badge.waiting-for-customer {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.job-status-badge.ready-parked {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    animation: ready-parked-pulse 2s ease-in-out infinite;
    will-change: box-shadow, background-color;
}

@keyframes ready-parked-pulse {
    0%, 100% {
        background: rgba(16, 185, 129, 0.15);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        background: rgba(16, 185, 129, 0.35);
        box-shadow: 0 0 12px 3px rgba(16, 185, 129, 0.55);
    }
}

/* ─── Ready-Parked Counter (vehicle entry sidebar) ───────────── */
.ready-parked-counter {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.06) 100%);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    animation: ready-parked-counter-pulse 2.4s ease-in-out infinite;
    will-change: box-shadow, background-color;
}

.ready-parked-counter-icon {
    font-size: 1.85rem;
    line-height: 1;
    flex-shrink: 0;
}

.ready-parked-counter-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.ready-parked-counter-number {
    font-size: 1.7rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1;
    letter-spacing: -0.01em;
}

.ready-parked-counter-label {
    font-size: 0.72rem;
    color: #10b981;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* When count is zero — calm grey, no pulse */
.ready-parked-counter.empty {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
    animation: none;
    box-shadow: none;
}
.ready-parked-counter.empty .ready-parked-counter-number,
.ready-parked-counter.empty .ready-parked-counter-label {
    color: #94a3b8;
}

@keyframes ready-parked-counter-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 18px 4px rgba(16, 185, 129, 0.45);
    }
}

/* Reminder note below the Ready-Parked counter */
.ready-parked-reminder {
    margin-top: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.35;
}

.ready-parked-reminder-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.ready-parked-reminder-text strong {
    color: #60a5fa;
    font-weight: 700;
}

/* Per-advisor breakdown of Ready-Parked vehicles */
.ready-parked-advisors {
    margin-top: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.ready-parked-advisors-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.ready-parked-advisors-icon {
    font-size: 0.95rem;
}

.ready-parked-advisors-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #10b981;
}

.ready-parked-advisors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ready-parked-advisor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.06);
    font-size: 0.8rem;
    transition: background 0.2s;
}

.ready-parked-advisor-item:hover {
    background: rgba(16, 185, 129, 0.12);
}

.ready-parked-advisor-name {
    color: #e2e8f0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.ready-parked-advisor-count {
    color: #10b981;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    min-width: 28px;
    text-align: center;
    font-size: 0.78rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.job-status-badge.vehicle-delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.job-status-badge.on-hold-parts,
.job-status-badge.on-hold-customer,
.job-status-badge.delivered-pending-parts {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* ========================================
   Workflow Progress Indicator
   ======================================== */

.workflow-progress-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.workflow-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 70px;
    position: relative;
    transition: all 0.3s ease;
}

.workflow-stage-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.workflow-stage-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workflow-connector {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    min-width: 20px;
}

/* Active stage */
.workflow-stage.active .workflow-stage-icon {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    animation: pulse-stage 2s ease-in-out infinite;
}

.workflow-stage.active .workflow-stage-label {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Completed stage */
.workflow-stage.completed .workflow-stage-icon {
    background: #10b981;
    border-color: #10b981;
}

.workflow-stage.completed .workflow-stage-label {
    color: #10b981;
}

.workflow-connector.completed {
    background: #10b981;
}

/* On Hold stage */
.workflow-stage.on-hold .workflow-stage-icon {
    background: #f59e0b;
    border-color: #f59e0b;
    animation: pulse-warning 1.5s ease-in-out infinite;
}

.workflow-stage.on-hold .workflow-stage-label {
    color: #f59e0b;
}

@keyframes pulse-stage {
    0%, 100% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(99, 102, 241, 0.8);
    }
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
    }
}

/* Workflow status badge in table */
.workflow-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.workflow-badge.stage-1 {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.workflow-badge.stage-2 {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.workflow-badge.stage-3 {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.workflow-badge.stage-4 {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.workflow-badge.stage-5 {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.workflow-badge.on-hold {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Stage number indicator */
.stage-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: currentColor;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    margin-right: 0.25rem;
}

.workflow-badge .stage-number {
    background: currentColor;
}

.workflow-badge .stage-number span {
    color: var(--bg-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .workflow-progress-indicator {
        padding: 0.75rem 1rem;
    }
    
    .workflow-stage-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .workflow-stage-label {
        font-size: 0.6rem;
    }
    
    .workflow-stage {
        min-width: 50px;
    }
}

/* Workflow step number in badge */
.stage-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    background: currentColor;
    color: var(--bg-primary);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-right: 0.25rem;
    padding: 0 4px;
}

.workflow-badge .stage-step {
    background: rgba(0,0,0,0.2);
    color: inherit;
}

/* Optgroup styling */
select optgroup {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

select option {
    padding: 8px;
    color: #1a1d2d;
    background: #ffffff;
}

select option:checked {
    background: #3b82f6;
    color: #ffffff;
}

/* Dark theme select styling */
select, 
.filter-select,
#complaintLocation,
#complaintLocationFilter {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

select option,
.filter-select option,
#complaintLocation option,
#complaintLocationFilter option {
    color: #1a1d2d;
    background-color: #ffffff;
    padding: 8px 12px;
}

/* Filter count danger style for critical vehicles */
.filter-count.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: pulse-danger 1.5s ease-in-out infinite;
}

@keyframes pulse-danger {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
}

/* ========================================
   Mini Workflow Indicator (Table Rows)
   ======================================== */

.mini-workflow {
    display: flex;
    align-items: center;
    gap: 2px;
}

.mini-wf-stage {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mini-wf-stage.completed {
    background: #10b981;
    border-color: #10b981;
}

.mini-wf-stage.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    animation: mini-pulse 1.5s ease-in-out infinite;
}

.mini-wf-stage.on-hold {
    background: #f59e0b;
    border-color: #f59e0b;
}

@keyframes mini-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
    50% { box-shadow: 0 0 12px rgba(99, 102, 241, 0.8); }
}

.mini-wf-connector {
    width: 8px;
    height: 2px;
    background: var(--border-color);
}

.mini-wf-connector.completed {
    background: #10b981;
}

/* ========================================
   Edit Modal Workflow Tracker
   ======================================== */

.edit-workflow-tracker {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.edit-workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.edit-workflow-title {
    font-weight: 600;
    color: var(--text-primary);
}

.edit-workflow-status {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.edit-workflow-status.stage-1 {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.edit-workflow-status.stage-2 {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.edit-workflow-status.stage-3 {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.edit-workflow-status.stage-4 {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.edit-workflow-status.stage-5 {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.edit-workflow-status.on-hold {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.edit-workflow-stages {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-wf-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 60px;
}

.edit-wf-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.edit-wf-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.edit-wf-connector {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
}

.edit-wf-stage.completed .edit-wf-icon {
    background: #10b981;
    border-color: #10b981;
}

.edit-wf-stage.completed .edit-wf-label {
    color: #10b981;
}

.edit-wf-connector.completed {
    background: #10b981;
}

.edit-wf-stage.active .edit-wf-icon {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    animation: edit-wf-pulse 2s ease-in-out infinite;
}

.edit-wf-stage.active .edit-wf-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.edit-wf-stage.on-hold .edit-wf-icon {
    background: #f59e0b;
    border-color: #f59e0b;
}

.edit-wf-stage.on-hold .edit-wf-label {
    color: #f59e0b;
}

@keyframes edit-wf-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
    50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.8); }
}

@media (max-width: 640px) {
    .edit-workflow-stages {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .edit-wf-connector {
        display: none;
    }
    
    .edit-wf-stage {
        min-width: 50px;
    }
    
    .edit-wf-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* ========================================
   Browser Notification Settings
   ======================================== */

.browser-notification-settings {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.browser-notif-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.browser-notif-icon {
    font-size: 1.5rem;
}

.browser-notif-text {
    font-weight: 500;
    color: var(--text-secondary);
}

.browser-notif-status.enabled {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.browser-notif-status.enabled .browser-notif-text {
    color: #10b981;
}

.browser-notif-status.disabled {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.browser-notif-status.disabled .browser-notif-text {
    color: #ef4444;
}

.browser-notif-status.pending {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.browser-notif-status.pending .browser-notif-text {
    color: #f59e0b;
}

.browser-notif-triggers {
    margin-bottom: 1.5rem;
}

.browser-notif-triggers h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.notif-trigger-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.notif-trigger-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.notif-trigger-option:hover {
    background: var(--bg-primary);
}

.notif-trigger-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.notif-trigger-option input[type="checkbox"]:checked + .notif-trigger-badge {
    opacity: 1;
}

.notif-trigger-option input[type="checkbox"]:not(:checked) + .notif-trigger-badge {
    opacity: 0.5;
}

.notif-trigger-badge {
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.notif-trigger-badge.ready {
    color: #10b981;
}

.notif-trigger-badge.washing {
    color: #06b6d4;
}

.notif-trigger-badge.qc {
    color: #8b5cf6;
}

.notif-trigger-badge.delivered {
    color: #3b82f6;
}

.browser-notif-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .notif-trigger-options {
        grid-template-columns: 1fr;
    }
    
    .browser-notif-actions {
        flex-direction: column;
    }
}

/* ========================================
   Responsive Manage Vehicles Table
   ======================================== */

/* Auto-scaling based on viewport */
.manage-table {
    table-layout: auto;
}

/* Compact badges for smaller screens */
.manage-table .workflow-badge,
.manage-table .status-badge,
.manage-table .source-badge,
.manage-table .days-badge,
.manage-table .warranty-status-badge,
.manage-table .inflow-badge {
    font-size: clamp(0.6rem, 0.85vw, 0.75rem);
    padding: clamp(0.2rem, 0.4vw, 0.35rem) clamp(0.4rem, 0.6vw, 0.75rem);
    white-space: nowrap;
}

.manage-table .stage-step {
    font-size: clamp(0.5rem, 0.7vw, 0.65rem);
    min-width: clamp(16px, 2vw, 22px);
    height: clamp(14px, 1.8vw, 18px);
}

/* Action buttons scaling */
.manage-table .action-btn {
    width: clamp(28px, 3vw, 36px);
    height: clamp(28px, 3vw, 36px);
}

.manage-table .action-btn svg {
    width: clamp(14px, 1.5vw, 18px);
    height: clamp(14px, 1.5vw, 18px);
}

/* Screen size breakpoints */

/* Large screens (1920px+) - Full comfort */
@media (min-width: 1920px) {
    .manage-table {
        font-size: 0.95rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 1rem;
    }
}

/* Standard desktop (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .manage-table {
        font-size: 0.85rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.75rem 0.6rem;
    }
}

/* Small desktop / laptop (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .manage-table {
        font-size: 0.8rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.6rem 0.5rem;
    }
    
    .manage-table th {
        font-size: 0.65rem;
    }
}

/* Tablet / small laptop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .manage-table {
        font-size: 0.75rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.5rem 0.4rem;
    }
    
    .manage-table th {
        font-size: 0.6rem;
    }
    
    .manage-table .workflow-badge,
    .manage-table .status-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Small tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .manage-table {
        font-size: 0.7rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.4rem 0.35rem;
    }
    
    .manage-table th {
        font-size: 0.55rem;
    }
    
    .manage-table .action-btns {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .manage-table .action-btn {
        width: 26px;
        height: 26px;
    }
}

/* Mobile - horizontal scroll mode */
@media (max-width: 767px) {
    .manage-table-container {
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .manage-table {
        min-width: 1200px;
        font-size: 0.8rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.6rem 0.5rem;
    }
}

/* Zoom level compensation */
@media (min-resolution: 120dpi) {
    .manage-table {
        font-size: 0.8rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.6rem 0.5rem;
    }
}

@media (min-resolution: 144dpi) {
    .manage-table {
        font-size: 0.75rem;
    }
    
    .manage-table th,
    .manage-table td {
        padding: 0.5rem 0.4rem;
    }
}

/* Filter bar responsiveness */
.manage-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.manage-filters .filter-group {
    flex: 1 1 auto;
    min-width: 120px;
}

.manage-filters .filter-select {
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    padding: clamp(0.4rem, 0.6vw, 0.6rem) clamp(0.6rem, 0.8vw, 1rem);
}

.manage-filters .search-input-wrapper input {
    font-size: clamp(0.75rem, 1vw, 0.95rem);
}

/* Screen size indicator (optional debug helper) */
.screen-size-indicator {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    z-index: 9999;
    display: none; /* Enable for debugging: display: block; */
}

/* Horizontal scroll hint */
.manage-table-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, var(--bg-card));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.manage-table-container.has-scroll::after {
    opacity: 1;
}

/* ========================================
   TV DASHBOARD - Complete Redesign
   Optimized for 50" TV, far viewing distance
   ======================================== */

.tv-dashboard {
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #0a0f1a 0%, #111827 50%, #0f172a 100%);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: hidden;
    box-sizing: border-box;
}

/* Header */
.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-header-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.tv-logo {
    display: none !important;
    font-size: 2.5rem;
}

.tv-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.1em;
    margin: 0;
}

.tv-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ============================================================
   Courtesy header badges (permanently visible on TV views)
   Lives in tv-header-left under the title block.
   The markup only exists inside #dashboardView → .tv-dashboard,
   so these rules automatically stay scoped to the TV experience
   (both the ?tv=1 URL AND the in-app TV Dashboard tab).
   ============================================================ */
.tv-courtesy-header {
    display: inline-flex;
    gap: 0.6rem;
    margin-left: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.tv-courtesy-hbadge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    line-height: 1;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.tv-courtesy-hbadge.fleet {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.08));
    border-color: rgba(96, 165, 250, 0.35);
}

.tv-courtesy-hbadge.leasing {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(109, 40, 217, 0.08));
    border-color: rgba(167, 139, 250, 0.35);
}

.tv-courtesy-hbadge-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.tv-courtesy-hbadge-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
}

.tv-courtesy-hbadge-count {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    min-width: 1.2em;
    text-align: right;
}

.tv-courtesy-hbadge.fleet.has-cars   { box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35); }
.tv-courtesy-hbadge.leasing.has-cars { box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35); }

/* Let header-left stack title + badges vertically so they don't squish the center strip.
   Scoped to .tv-dashboard so it applies on BOTH the ?tv=1 URL and the in-app TV Dashboard tab. */
.tv-dashboard .tv-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

.tv-dashboard .tv-courtesy-header {
    margin-left: 0;  /* it's on its own row now */
}

/* Tighten the title itself on TV so the whole left block stays compact */
.tv-dashboard .tv-title h1 {
    font-size: 1.35rem;
    letter-spacing: 0.08em;
}

.tv-dashboard .tv-subtitle {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

/* Slight sizing reduction on the badges themselves when in TV mode */
.tv-dashboard .tv-courtesy-hbadge {
    padding: 0.22rem 0.55rem;
    gap: 0.35rem;
}
.tv-dashboard .tv-courtesy-hbadge-label { font-size: 0.55rem; }
.tv-dashboard .tv-courtesy-hbadge-count { font-size: 0.9rem; }
.tv-dashboard .tv-courtesy-hbadge-icon  { font-size: 0.85rem; }

/* If the viewport gets narrow, tighten badge gap */
@media (max-width: 1280px) {
    .tv-dashboard .tv-courtesy-header {
        gap: 0.35rem;
    }
}

.tv-header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.tv-connection {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.tv-connection-dot {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.tv-target-strip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    min-width: 340px;
    max-width: 520px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.tv-target-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.tv-target-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.35rem;
}

.tv-target-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.tv-target-value,
.tv-target-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0;
}

.tv-target-current {
    color: #10b981; /* default: on-or-above target */
}

.tv-target-sep {
    color: rgba(255, 255, 255, 0.25);
}

.tv-target-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: visible;
}

.tv-target-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.6s ease, background 0.3s ease;
}

.tv-target-bar-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 1px;
    transform: translateX(-1px);
}

/* Behind-target state */
.tv-target-strip.behind {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.08);
    animation: tv-target-pulse 2.2s ease-in-out infinite;
}
.tv-target-strip.behind .tv-target-current { color: #f59e0b; }
.tv-target-strip.behind .tv-target-bar-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Far-behind (>10 points short) */
.tv-target-strip.far-behind {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.1);
    animation: tv-target-pulse-hard 1.6s ease-in-out infinite;
}
.tv-target-strip.far-behind .tv-target-current { color: #ef4444; }
.tv-target-strip.far-behind .tv-target-bar-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

@keyframes tv-target-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
@keyframes tv-target-pulse-hard {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.tv-weather {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    min-width: 120px;
}

.tv-weather-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.tv-weather-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.tv-weather-temp {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

.tv-weather-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tv-weather.tv-weather-error {
    opacity: 0.4;
}

/* --- Always-visible TV appointment badge --- */
.tv-appt-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 10px;
    min-width: 110px;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.tv-appt-badge.has-appts {
    animation: tvApptPulse 3s ease-in-out infinite;
}

@keyframes tvApptPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.25); }
    50%      { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}

.tv-appt-icon {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.4));
}

.tv-appt-info {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.tv-appt-count {
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
}

.tv-appt-label {
    font-size: 0.62rem;
    color: rgba(191, 219, 254, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

body.tv-display-mode .tv-appt-badge { padding: 0.35rem 0.7rem; min-width: 92px; }
body.tv-display-mode .tv-appt-icon { font-size: 1.25rem; }
body.tv-display-mode .tv-appt-count { font-size: 1.15rem; }
body.tv-display-mode .tv-appt-label { font-size: 0.55rem; }

/* Hide the badge when not in TV mode (it's purely a TV feature) */
body:not(.tv-display-mode) .tv-appt-badge { display: none; }

.tv-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tv-date {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.tv-time {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

/* Priority Row - Big Cards */
.tv-priority-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.tv-big-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
}

.tv-big-card:hover {
    transform: translateY(-2px);
}

.tv-big-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.tv-big-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tv-big-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 30px currentColor;
}

.tv-big-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
    white-space: nowrap;
}

.tv-big-sub {
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tv-sub-item {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.tv-sub-item.warning {
    color: #f59e0b;
}

.tv-sub-item.available {
    color: #10b981;
}

.tv-sub-item.critical-new {
    color: #f87171;
}

.tv-sub-item.critical-over {
    color: #fbbf24;
}

.tv-sub-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
}

.tv-sub-icon {
    font-size: 0.7rem;
}

.tv-big-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.tv-big-indicator.fleet {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.tv-big-indicator.leasing {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.tv-big-indicator.critical {
    background: linear-gradient(90deg, #ef4444, #f87171);
    animation: critical-glow 1.5s ease-in-out infinite;
}

.tv-big-indicator.repeat {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.tv-big-indicator.technicians {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.tv-big-indicator.advisors {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
}

@keyframes critical-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.8); }
}

/* Card specific colors */
.tv-big-card.fleet {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02));
    border-color: rgba(59, 130, 246, 0.2);
}

.tv-big-card.fleet .tv-big-number {
    color: #60a5fa;
}

.tv-big-card.leasing {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.02));
    border-color: rgba(139, 92, 246, 0.2);
}

.tv-big-card.leasing .tv-big-number {
    color: #a78bfa;
}

.tv-big-card.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.02));
    border-color: rgba(239, 68, 68, 0.2);
    animation: critical-card-pulse 2s ease-in-out infinite;
}

.tv-big-card.critical .tv-big-number {
    color: #f87171;
}

.tv-big-card.urgent-vehicle {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.04));
  border-color: rgba(245, 158, 11, 0.25);
  animation: urgent-card-pulse 1.6s ease-in-out infinite;
}

.tv-big-card.urgent-vehicle .tv-big-number {
  color: #fb923c;
}

@keyframes urgent-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 26px rgba(245, 158, 11, 0.25); }
}

.tv-big-indicator.urgent-vehicle {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.tv-urgent-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
}


@keyframes critical-card-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.2); }
}

.tv-big-card.repeat {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.02));
    border-color: rgba(245, 158, 11, 0.2);
}

.tv-big-card.repeat .tv-big-number {
    color: #fbbf24;
}

.tv-big-card.technicians {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02));
    border-color: rgba(16, 185, 129, 0.2);
}

.tv-big-card.technicians .tv-big-number {
    color: #34d399;
}

.tv-big-card.advisors {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.02));
    border-color: rgba(6, 182, 212, 0.2);
}

.tv-big-card.advisors .tv-big-number {
    color: #22d3ee;
}

/* Secondary Row - Medium Cards */
.tv-secondary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    width: 100%;
}

.tv-medium-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease;
    min-width: 0;
}

.tv-medium-card:hover {
    transform: scale(1.02);
}

.tv-medium-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tv-medium-number {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    display: block;
}

.tv-medium-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

.tv-medium-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.tv-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.tv-bar-fill.appointment { background: linear-gradient(90deg, #10b981, #34d399); }
.tv-bar-fill.non-appointment { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tv-bar-fill.active { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.tv-bar-fill.completed { background: linear-gradient(90deg, #10b981, #34d399); }
.tv-bar-fill.ready { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.tv-medium-card.appointment .tv-medium-number { color: #34d399; }
.tv-medium-card.non-appointment .tv-medium-number { color: #fbbf24; }
.tv-medium-card.active .tv-medium-number { color: #60a5fa; }
.tv-medium-card.completed .tv-medium-number { color: #34d399; }
.tv-medium-card.ready .tv-medium-number { color: #a78bfa; }

/* Main Content Grid */
.tv-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.tv-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.tv-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-panel-icon {
    font-size: 1.5rem;
}

.tv-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.tv-panel-count {
    margin-left: auto;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

/* Operations Package */
.tv-ops-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.tv-ops-card {
    position: relative;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.tv-ops-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    opacity: 0.95;
}

.tv-ops-card.active { background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.03)); }
.tv-ops-card.active::after { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.tv-ops-card.intake { background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(6, 182, 212, 0.03)); }
.tv-ops-card.intake::after { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.tv-ops-card.completed { background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.03)); }
.tv-ops-card.completed::after { background: linear-gradient(90deg, #10b981, #34d399); }
.tv-ops-card.ready { background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(139, 92, 246, 0.03)); }
.tv-ops-card.ready::after { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.tv-ops-card.parts { background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.03)); }
.tv-ops-card.parts::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tv-ops-card.urgent { background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.04)); }
.tv-ops-card.urgent::after { background: linear-gradient(90deg, #ef4444, #f87171); }

.tv-ops-card.completed,
.tv-ops-card.urgent {
    display: none;
}

.tv-ops-card-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.tv-ops-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.2rem;
}

.tv-ops-card-number {
    font-size: 2.55rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.tv-ops-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.82);
}

.tv-ops-card-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-ops-main-slide {
    position: relative;
}

.tv-lunch-banner,
.tv-lunch-corner {
    position: absolute;
    z-index: 12;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tv-lunch-banner.is-visible,
.tv-lunch-corner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tv-lunch-banner {
    top: 0.35rem;
    left: 50%;
    transform: translate(-50%, -10px);
    width: min(720px, calc(100% - 3rem));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.3rem;
    border-radius: 18px;
    border: 1px solid rgba(251, 191, 36, 0.38);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.32), rgba(120, 53, 15, 0.45)),
        rgba(15, 23, 42, 0.92);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.tv-lunch-banner.is-visible {
    transform: translate(-50%, 0);
}

.tv-lunch-eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 248, 235, 0.74);
}

.tv-lunch-title {
    font-size: 1.9rem;
    font-weight: 900;
    color: #fff7ed;
    line-height: 1.05;
}

.tv-lunch-meta {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 247, 237, 0.84);
    letter-spacing: 0.04em;
}

.tv-lunch-corner {
    top: 0.65rem;
    right: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.26);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(120, 53, 15, 0.22)),
        rgba(15, 23, 42, 0.92);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
}

.tv-lunch-corner-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff7ed;
}

.tv-lunch-corner-meta {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 247, 237, 0.75);
}

.tv-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    flex: 1;
    align-content: stretch;
}

.tv-heatmap-grid.compact-alert-grid {
    gap: 0.55rem;
    align-content: start;
}

.tv-heatmap-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
    min-height: 140px;
    padding: 1.1rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tv-heatmap-card.fresh { background: rgba(16, 185, 129, 0.08); }
.tv-heatmap-card.watch { background: rgba(59, 130, 246, 0.08); }
.tv-heatmap-card.warning { background: rgba(245, 158, 11, 0.1); }
.tv-heatmap-card.critical { background: rgba(239, 68, 68, 0.11); }
.tv-heatmap-card.qc-failed-detail {
    justify-content: space-between;
    gap: 0.45rem;
    min-height: 108px;
    padding: 0.8rem 0.85rem;
    background:
        linear-gradient(180deg, rgba(220, 38, 38, 0.24), rgba(127, 29, 29, 0.3)),
        rgba(255, 255, 255, 0.03);
    border-color: rgba(248, 113, 113, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tv-heatmap-card.qc-failed-detail.qc-failed-overflow {
    background:
        linear-gradient(180deg, rgba(153, 27, 27, 0.2), rgba(69, 10, 10, 0.28)),
        rgba(255, 255, 255, 0.03);
    border-color: rgba(252, 165, 165, 0.28);
}

.tv-heatmap-card.repeat-detail {
    justify-content: space-between;
    gap: 0.45rem;
    min-height: 108px;
    padding: 0.8rem 0.85rem;
    background:
        linear-gradient(180deg, rgba(245, 158, 11, 0.18), rgba(120, 53, 15, 0.26)),
        rgba(255, 255, 255, 0.03);
    border-color: rgba(251, 191, 36, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tv-heatmap-card.urgent-detail {
    justify-content: space-between;
    gap: 0.45rem;
    min-height: 108px;
    padding: 0.8rem 0.85rem;
    background:
        linear-gradient(180deg, rgba(239, 68, 68, 0.2), rgba(127, 29, 29, 0.26)),
        rgba(255, 255, 255, 0.03);
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tv-heatmap-card.urgent-detail.urgent-overflow {
    background:
        linear-gradient(180deg, rgba(251, 146, 60, 0.18), rgba(120, 53, 15, 0.24)),
        rgba(255, 255, 255, 0.03);
    border-color: rgba(251, 191, 36, 0.28);
}

.tv-heatmap-range {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.tv-heatmap-count {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.tv-heatmap-meta {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.62);
}

.tv-urgent-card-eyebrow {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(254, 226, 226, 0.82);
}

.tv-urgent-card-reg {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.tv-urgent-card-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.25;
    min-height: 2em;
}

.tv-urgent-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tv-urgent-card-chip {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
}

.tv-urgent-card-note {
    padding: 0.42rem 0.55rem;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.66rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ─────────────────────────────────────────────────────────────
   Flashing banner for vehicles that are BOTH urgent AND flagged
   as under-15-days-new. Applies on both the in-app TV Dashboard
   tab and the ?tv=1 URL (same alert card markup feeds both).
   ───────────────────────────────────────────────────────────── */
.tv-urgent-under15-flash {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    align-self: stretch;
    margin-top: 0.3rem;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 50%, #ef4444 100%);
    color: #1a0f04;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.05;
    border: 1px solid rgba(254, 240, 138, 0.7);
    box-shadow:
        0 0 0 0 rgba(251, 191, 36, 0.75),
        0 4px 10px rgba(239, 68, 68, 0.25) inset;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: tvUnder15Flash 1.1s ease-in-out infinite;
    /* Keep above card background, not cropped by overflow:hidden rows */
    position: relative;
    z-index: 2;
}

.tv-urgent-under15-flash-icon {
    font-size: 0.95rem;
    line-height: 1;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

.tv-urgent-under15-flash-text {
    white-space: nowrap;
}

/* Flash keyframes: pulse opacity + outward glow ring so the banner
   catches the eye without being physically jarring. */
@keyframes tvUnder15Flash {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(251, 191, 36, 0.75),
            0 4px 10px rgba(239, 68, 68, 0.25) inset;
    }
    50% {
        opacity: 0.55;
        transform: scale(0.985);
        box-shadow:
            0 0 0 8px rgba(251, 191, 36, 0),
            0 4px 6px rgba(239, 68, 68, 0.15) inset;
    }
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(251, 191, 36, 0.75),
            0 4px 10px rgba(239, 68, 68, 0.25) inset;
    }
}

/* Compressed variant for TV kiosk mode (tighter vertical rhythm) */
body.tv-display-mode .tv-urgent-under15-flash {
    padding: 0.22rem 0.4rem;
    margin-top: 0.18rem;
    font-size: 0.55rem;
    letter-spacing: 0.04em;
    border-radius: 7px;
}
body.tv-display-mode .tv-urgent-under15-flash-icon { font-size: 0.7rem; }

/* Tighter note block on TV — consumes less vertical space per card */
body.tv-display-mode .tv-urgent-card-note {
    padding: 0.28rem 0.42rem;
    font-size: 0.58rem;
    line-height: 1.2;
    border-radius: 7px;
    -webkit-line-clamp: 2;
}

/* Respect reduced-motion preferences — still visible, just static */
@media (prefers-reduced-motion: reduce) {
    .tv-urgent-under15-flash {
        animation: none;
        opacity: 1;
    }
}

.tv-queue-board,
.tv-bottleneck-list,
.tv-technician-ops-list,
.tv-delivery-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 0;
    overflow: hidden;
}

.tv-queue-stage {
    padding: 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.tv-queue-stage.reception { border-left: 4px solid #3b82f6; }
.tv-queue-stage.workshop { border-left: 4px solid #f97316; }
.tv-queue-stage.qc { border-left: 4px solid #8b5cf6; }
.tv-queue-stage.washing { border-left: 4px solid #06b6d4; }
.tv-queue-stage.delivery { border-left: 4px solid #10b981; }

.tv-queue-stage-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tv-queue-stage-icon {
    font-size: 1.15rem;
}

.tv-queue-stage-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tv-queue-stage-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

.tv-queue-stage-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.tv-queue-stage-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.tv-queue-stage-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.tv-queue-vehicle {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.tv-queue-vehicle-id,
.tv-queue-vehicle-reg,
.tv-queue-vehicle-days {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.82);
}

.tv-queue-vehicle-id {
    font-weight: 700;
}

.tv-queue-vehicle-days {
    font-weight: 800;
    color: #fff;
}

.tv-bottleneck-item,
.tv-delivery-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-bottleneck-item.warning { border-left: 4px solid #f59e0b; }
.tv-bottleneck-item.critical { border-left: 4px solid #ef4444; }
.tv-bottleneck-item.delivery { border-left: 4px solid #8b5cf6; }

.bottleneck-status {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.bottleneck-detail {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.62);
}

.bottleneck-count {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
}

.tv-tech-ops-item {
    display: grid;
    grid-template-columns: minmax(0, 140px) 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.tv-tech-ops-item.absent {
    opacity: 0.55;
}

.tv-tech-ops-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tv-tech-ops-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-tech-ops-status {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tv-tech-ops-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.tv-tech-ops-fill {
    height: 100%;
    border-radius: inherit;
}

.tv-tech-ops-fill.low { background: linear-gradient(90deg, #10b981, #34d399); }
.tv-tech-ops-fill.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tv-tech-ops-fill.high { background: linear-gradient(90deg, #ef4444, #f87171); }

.tv-tech-ops-count {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.tv-delivery-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.14rem;
}

.tv-delivery-reg {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
}

.tv-delivery-name,
.tv-delivery-status {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.68);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-delivery-days {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.18);
    color: #ddd6fe;
    font-size: 0.9rem;
    font-weight: 800;
}

.tv-empty-state.compact {
    justify-content: flex-start;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

/* Workflow Bars */
.tv-workflow-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 0.75rem;
}

.tv-workflow-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tv-workflow-label {
    width: 80px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.tv-workflow-bar-container {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.tv-workflow-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.tv-workflow-bar.reception { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.tv-workflow-bar.workshop { background: linear-gradient(90deg, #f97316, #fb923c); }
.tv-workflow-bar.qc { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.tv-workflow-bar.washing { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.tv-workflow-bar.ready { background: linear-gradient(90deg, #10b981, #34d399); }

.tv-workflow-count {
    width: 40px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-align: right;
}

/* Courtesy List */
.tv-courtesy-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tv-courtesy-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid;
}

.tv-courtesy-item.fleet { border-left-color: #3b82f6; }
.tv-courtesy-item.leasing { border-left-color: #8b5cf6; }

.tv-courtesy-item.danger { background: rgba(239, 68, 68, 0.1); }
.tv-courtesy-item.warning { background: rgba(245, 158, 11, 0.1); }

.tv-courtesy-badge {
    font-size: 1.25rem;
}

.tv-courtesy-info {
    flex: 1;
    min-width: 0;
}

.tv-courtesy-wip {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tv-courtesy-source {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tv-courtesy-source.fleet {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.tv-courtesy-source.leasing {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.tv-courtesy-vehicle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-courtesy-days {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    min-width: 50px;
    text-align: center;
}

.tv-courtesy-days.danger { color: #f87171; background: rgba(239, 68, 68, 0.2); }
.tv-courtesy-days.warning { color: #fbbf24; background: rgba(245, 158, 11, 0.2); }
.tv-courtesy-days.ok { color: #34d399; }

.tv-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
}

/* Technician Bars */
.tv-technician-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 0.5rem;
    overflow-y: auto;
}

.tv-tech-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tv-tech-name {
    width: 70px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-tech-bar-container {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.tv-tech-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.tv-tech-count {
    width: 30px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-align: right;
}

/* Notification Banner */
.tv-notification-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.tv-notification-banner.urgent {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
    animation: notification-pulse 2s ease-in-out infinite;
}

@keyframes notification-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
}

.tv-notification-icon {
    font-size: 1.5rem;
}

.tv-notification-text {
    flex: 1;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.tv-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.tv-footer-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tv-footer-icon {
    display: none !important;
    font-size: 1.25rem;
}

.tv-footer-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.tv-footer-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tv-footer-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== TV DASHBOARD SLIDESHOW ===== */

/* Header center for slideshow indicator */
.tv-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tv-slideshow-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.slideshow-dots {
    display: flex;
    gap: 0.5rem;
}

.slideshow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slideshow-dot.active {
    background: #10b981;
    transform: scale(1.2);
}

.slideshow-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.slideshow-progress {
    width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.slideshow-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    transition: width 0.1s linear;
}

/* Slideshow Container */
.tv-slideshow-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tv-slide {
    display: none;
    flex-direction: column;
    gap: 1rem;
    animation: slideIn 0.5s ease-out;
    flex: 1;
}

.tv-slide.active {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tv-slide-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Slide 2: Vehicle Lists */
.tv-vehicle-lists-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    flex: 1;
}

.tv-vehicle-list-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-vehicle-list-panel .tv-panel-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-panel-header.ready {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), transparent);
}

.tv-panel-header.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), transparent);
}

.tv-panel-header.arrivals {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), transparent);
}

.tv-panel-header.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), transparent);
}

.tv-panel-header.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), transparent);
}

.tv-panel-header.chart {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), transparent);
}

.tv-panel-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.tv-vehicle-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.tv-vehicle-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid;
}

.tv-vehicle-list-item.ready {
    border-color: #10b981;
}

.tv-vehicle-list-item.aging {
    border-color: #ef4444;
}

.tv-vehicle-list-item.arrival {
    border-color: #3b82f6;
}

.tv-vehicle-list-item .vehicle-info {
    flex: 1;
}

.tv-vehicle-list-item .vehicle-reg {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.tv-vehicle-list-item .vehicle-model {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.tv-vehicle-list-item .vehicle-days {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.tv-vehicle-list-item .vehicle-days.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Slide 3: Charts */
.tv-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    flex: 1;
}

.tv-chart-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-chart-panel.large {
    grid-row: span 1;
}

.tv-chart-panel .tv-panel-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-large-inflow-chart {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 1.5rem;
    gap: 0.5rem;
    min-height: 250px;
}

.tv-chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-service-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    gap: 0.75rem;
}

.service-type-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-type-label {
    width: 80px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.service-type-bar-container {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.service-type-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.service-type-bar.repair {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.service-type-bar.service {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.service-type-bar.warranty {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.service-type-bar.insurance {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.service-type-count {
    width: 50px;
    text-align: right;
    font-weight: 700;
    font-size: 1rem;
}

.tv-advisor-workload {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    overflow-y: auto;
}

.advisor-workload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.advisor-name {
    width: 100px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advisor-bar-container {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.advisor-bar {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.advisor-count {
    width: 30px;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Slide 4: Alerts */
.tv-alerts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    flex: 1;
}

.tv-alert-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-alert-panel .tv-panel-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-alert-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.tv-alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid;
}

.tv-alert-item.parts {
    border-color: #f59e0b;
}

.tv-alert-item.overdue {
    border-color: #ef4444;
}

.tv-alert-item.longstay {
    border-color: #dc2626;
}

.tv-alert-item .alert-info {
    flex: 1;
}

.tv-alert-item .alert-reg {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.tv-alert-item .alert-detail {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.tv-alert-item .alert-badge {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
}

.tv-alert-item .alert-badge.days {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.tv-alert-item .alert-badge.waiting {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ===== ADMIN SLIDESHOW SETTINGS ===== */

.slideshow-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.slideshow-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.slideshow-toggle-label {
    font-weight: 600;
    flex: 1;
}

.slideshow-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.slideshow-status.on {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.slideshow-status.off {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.slideshow-interval {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slideshow-interval label {
    font-weight: 600;
    color: var(--text-secondary);
}

.interval-options {
    display: flex;
    gap: 0.75rem;
}

.interval-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.interval-option:hover {
    border-color: var(--primary-color);
}

.interval-option input {
    display: none;
}

.interval-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.interval-option span {
    font-weight: 500;
}

.slideshow-views {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slideshow-views > label {
    font-weight: 600;
    color: var(--text-secondary);
}

.slideshow-view-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.slideshow-view-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slideshow-view-option:hover {
    border-color: var(--primary-color);
}

.slideshow-view-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.slideshow-view-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.view-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-badge.main {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.view-badge.vehicles {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.view-badge.charts {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.view-badge.alerts {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.view-badge.technicians {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.view-badge.courtesy {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.view-badge.weekly {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.view-badge.jobstatus {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.slideshow-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ===== NEW SLIDE STYLES ===== */

/* Slide Header */
.tv-slide-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tv-slide-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.tv-slide-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Slide 5: Technician Performance */
.tv-technician-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
}

.tv-tech-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tv-tech-card.available {
    border-color: rgba(16, 185, 129, 0.3);
}

.tv-tech-card.absent {
    border-color: rgba(239, 68, 68, 0.3);
    opacity: 0.6;
}

.tv-tech-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tv-tech-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tv-tech-card.absent .tv-tech-avatar {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.tv-tech-info {
    flex: 1;
}

.tv-tech-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.tv-tech-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    display: inline-block;
    margin-top: 0.25rem;
}

.tv-tech-status.available {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.tv-tech-status.absent {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.tv-tech-workload {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tv-tech-workload-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.tv-tech-workload-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tv-tech-workload-fill.high {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.tv-tech-workload-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.tv-tech-count {
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    min-width: 40px;
    text-align: right;
}

/* Slide 6: Courtesy Cars */
.tv-courtesy-overview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.tv-courtesy-summary {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.tv-courtesy-stat {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 2rem 3rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-courtesy-stat.fleet {
    border-color: rgba(59, 130, 246, 0.3);
}

.tv-courtesy-stat.leasing {
    border-color: rgba(139, 92, 246, 0.3);
}

.courtesy-stat-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.courtesy-stat-number {
    font-size: 4rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.tv-courtesy-stat.fleet .courtesy-stat-number {
    color: #60a5fa;
}

.tv-courtesy-stat.leasing .courtesy-stat-number {
    color: #a78bfa;
}

.courtesy-stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 0.5rem;
}

.courtesy-stat-sub {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: 0.25rem;
}

.tv-courtesy-lists {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    flex: 1;
}

.tv-courtesy-list-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-courtesy-list-panel .tv-panel-header.fleet {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), transparent);
}

.tv-courtesy-list-panel .tv-panel-header.leasing {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), transparent);
}

.tv-courtesy-full-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.tv-courtesy-full-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.tv-courtesy-full-item .item-info {
    flex: 1;
}

.tv-courtesy-full-item .item-wip {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.tv-courtesy-full-item .item-vehicle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.tv-courtesy-full-item .item-days {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
}

.tv-courtesy-full-item .item-days.ok {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.tv-courtesy-full-item .item-days.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.tv-courtesy-full-item .item-days.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ============================================================
   Courtesy Cars — Ageing Analytics (new layout)
   ============================================================ */

.tv-courtesy-row {
    display: grid;
    grid-template-columns: 1.05fr 0.9fr 1.35fr 0.7fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.tv-courtesy-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tv-courtesy-row-head {
    background: transparent;
    border: none;
    padding: 0.35rem 0.9rem;
    margin-bottom: 0.3rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.tv-courtesy-row-head:hover {
    background: transparent;
}

.tv-courtesy-wip-col {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.tv-courtesy-wip-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tv-courtesy-wip-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-courtesy-reg-col {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-courtesy-model-col {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-courtesy-days-col {
    display: flex;
    justify-content: flex-end;
}

.tv-courtesy-days-badge {
    font-size: 1rem;
    font-weight: 800;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    min-width: 54px;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
    line-height: 1;
}

.tv-courtesy-days-badge.ok {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tv-courtesy-days-badge.warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tv-courtesy-days-badge.overdue {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.tv-courtesy-days-badge.danger {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.45);
    animation: courtesyDangerPulse 2.2s ease-in-out infinite;
}

/* Thin left-edge accent on red rows so overdue ones stand out */
.tv-courtesy-row.danger {
    border-left: 3px solid rgba(239, 68, 68, 0.6);
}
.tv-courtesy-row.overdue {
    border-left: 3px solid rgba(249, 115, 22, 0.5);
}

@keyframes courtesyDangerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.tv-courtesy-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.tv-courtesy-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.tv-courtesy-legend .legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tv-courtesy-legend .legend-dot.ok       { background: #34d399; }
.tv-courtesy-legend .legend-dot.warning  { background: #fbbf24; }
.tv-courtesy-legend .legend-dot.overdue  { background: #fdba74; }
.tv-courtesy-legend .legend-dot.danger   { background: #fca5a5; }

.tv-courtesy-legend-note {
    margin-left: auto;
    font-style: italic;
    opacity: 0.65;
    font-size: 0.7rem;
}

/* ============================================================
   Compact TV-display layout for Courtesy slide
   Tuned so as many courtesy rows as possible fit on screen.
   ============================================================ */

/* Summary tiles (Fleet/Leasing counters) — shrink the whole block */
body.tv-display-mode .tv-courtesy-overview { gap: 0.6rem; }

body.tv-display-mode .tv-courtesy-summary {
    gap: 1rem;
    flex: 0 0 auto;
}

body.tv-display-mode .tv-courtesy-stat {
    padding: 0.55rem 1.2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
}

body.tv-display-mode .courtesy-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0;
    display: inline-block;
}

body.tv-display-mode .courtesy-stat-number {
    font-size: 1.9rem;
    line-height: 1;
}

body.tv-display-mode .courtesy-stat-label {
    font-size: 0.6rem;
    margin-top: 0;
    letter-spacing: 0.06em;
}

/* Panel headers inside each list */
body.tv-display-mode .tv-courtesy-list-panel .tv-panel-header {
    padding: 0.4rem 0.75rem;
}

body.tv-display-mode .tv-courtesy-list-panel .tv-panel-title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

body.tv-display-mode .tv-courtesy-list-panel .tv-panel-icon {
    font-size: 0.95rem;
}

/* Row column header */
body.tv-display-mode .tv-courtesy-row-head {
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.15rem;
    font-size: 0.55rem;
}

/* Data rows — this is the main gain */
body.tv-display-mode .tv-courtesy-row {
    padding: 0.25rem 0.55rem;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    border-radius: 7px;
}

body.tv-display-mode .tv-courtesy-wip-label {
    display: none;  /* WIP label removed — the value is self-explanatory */
}

body.tv-display-mode .tv-courtesy-wip-val { font-size: 0.78rem; }
body.tv-display-mode .tv-courtesy-reg-col  { font-size: 0.72rem; }
body.tv-display-mode .tv-courtesy-model-col { font-size: 0.68rem; }

body.tv-display-mode .tv-courtesy-days-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    min-width: 38px;
    border-radius: 999px;
}

/* Inner list padding — remove most of it so rows sit closer to the edge */
body.tv-display-mode .tv-courtesy-full-list {
    padding: 0.3rem 0.45rem;
    overflow: hidden;  /* No scrollbar — items flow into extra columns instead */
}

/* ── Multi-column overflow: split items across 2 or 3 side-by-side column
      groups so all entries fit without scrolling. JS renders one
      .tv-courtesy-colgroup per column (with its own WIP/REG/VEHICLE/AGE
      header) when it adds the tv-multi2 / tv-multi3 class.                   */
body.tv-display-mode .tv-courtesy-full-list.tv-multi2,
body.tv-display-mode .tv-courtesy-full-list.tv-multi3 {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

body.tv-display-mode .tv-courtesy-full-list.tv-multi2 .tv-courtesy-colgroup,
body.tv-display-mode .tv-courtesy-full-list.tv-multi3 .tv-courtesy-colgroup {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Per-column header inside colgroup — match the compact row styling */
body.tv-display-mode .tv-courtesy-colgroup > .tv-courtesy-row-head {
    margin-bottom: 0.1rem;
}

/* In 3-col mode the columns are narrower — tighten text a touch more */
body.tv-display-mode .tv-courtesy-full-list.tv-multi3 .tv-courtesy-wip-val   { font-size: 0.7rem; }
body.tv-display-mode .tv-courtesy-full-list.tv-multi3 .tv-courtesy-reg-col   { font-size: 0.65rem; }
body.tv-display-mode .tv-courtesy-full-list.tv-multi3 .tv-courtesy-model-col { font-size: 0.6rem; }
body.tv-display-mode .tv-courtesy-full-list.tv-multi3 .tv-courtesy-days-badge {
    font-size: 0.62rem;
    min-width: 32px;
    padding: 0.12rem 0.35rem;
}

/* Legend — compact footer */
body.tv-display-mode .tv-courtesy-legend {
    font-size: 0.58rem;
    gap: 0.75rem;
    padding: 0.35rem 0.6rem;
    margin-top: 0.35rem;
}

body.tv-display-mode .tv-courtesy-legend .legend-dot {
    width: 7px;
    height: 7px;
}

body.tv-display-mode .tv-courtesy-legend-note {
    font-size: 0.55rem;
}

/* Also shrink the slide header title for more vertical room */
body.tv-display-mode #slideCourtesy .tv-slide-header {
    margin-bottom: 0.4rem;
}

body.tv-display-mode #slideCourtesy .tv-slide-header h2 {
    font-size: 1.15rem;
    margin: 0;
}

body.tv-display-mode #slideCourtesy .tv-slide-subtitle {
    font-size: 0.7rem;
}

/* Slide 7: Weekly Summary */
.tv-weekly-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    flex: 1;
}

.tv-weekly-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tv-weekly-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.weekly-card-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 1rem;
}

.weekly-card-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.weekly-number {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.weekly-value.this-week .weekly-number {
    color: #10b981;
}

.weekly-value.last-week .weekly-number {
    color: rgba(255, 255, 255, 0.5);
}

.weekly-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: 0.25rem;
}

.weekly-vs {
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekly-change {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.weekly-change.up {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.weekly-change.down {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.weekly-change.same {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.tv-weekly-chart {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-weekly-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 1.5rem;
    gap: 1rem;
}

.weekly-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.weekly-bar-pair {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    height: 150px;
}

.weekly-bar {
    width: 20px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.weekly-bar.this-week {
    background: linear-gradient(180deg, #10b981, #059669);
}

.weekly-bar.last-week {
    background: rgba(255, 255, 255, 0.2);
}

.weekly-bar-day {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.tv-weekly-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.weekly-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.legend-dot.this-week {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #10b981;
}

.legend-dot.last-week {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
}

/* Slide 8: Job Status Overview */
.tv-jobstatus-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    flex: 1;
}

.tv-jobstatus-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-content: flex-start;
}

.tv-jobstatus-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 180px;
    flex: 1;
    text-align: center;
    position: relative;
}

.tv-jobstatus-item::after {
    content: '→';
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.2);
}

.tv-jobstatus-item:last-child::after {
    display: none;
}

.jobstatus-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.jobstatus-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    display: block;
    line-height: 1;
}

.jobstatus-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 0.5rem;
}

.tv-jobstatus-details {
    display: flex;
    flex-direction: column;
}

.tv-jobstatus-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-bottleneck-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.tv-bottleneck-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid #f59e0b;
}

.bottleneck-info {
    flex: 1;
}

.bottleneck-status {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.bottleneck-detail {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.bottleneck-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fbbf24;
}

/* Responsive adjustments for TV */
@media (min-width: 1920px) {
    .tv-dashboard {
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .tv-big-number {
        font-size: 5.5rem;
    }
    
    .tv-big-icon {
        font-size: 4rem;
    }
    
    .tv-medium-number {
        font-size: 3.5rem;
    }
    
    .tv-title h1 {
        font-size: 2rem;
    }
    
    .tv-time {
        font-size: 2.5rem;
    }
}

@media (max-width: 1600px) {
    .tv-priority-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tv-secondary-row {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .tv-main-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .tv-priority-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tv-secondary-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tv-main-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TV Dashboard - Daily Inflow Chart
   ======================================== */

.tv-panel.inflow-panel {
    display: flex;
    flex-direction: column;
}

.tv-panel-header {
    position: relative;
}

.tv-panel-subtitle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tv-inflow-chart {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.5rem;
    padding: 1rem 0;
    min-height: 200px;
}

.tv-inflow-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 80px;
    gap: 0.25rem;
}

.tv-inflow-bars {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 180px;
    justify-content: flex-end;
    position: relative;
}

.tv-inflow-bar {
    width: 100%;
    transition: height 0.5s ease;
    min-height: 0;
}

.tv-inflow-bar.appointment {
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 4px 4px 0 0;
}

.tv-inflow-bar.non-appointment {
    background: linear-gradient(180deg, #f59e0b, #d97706);
    border-radius: 0;
}

/* When appointment is at bottom and has content, round its top */
.tv-inflow-bar.appointment:first-child {
    border-radius: 4px 4px 0 0;
}

/* When non-appointment is on top, round its top */
.tv-inflow-bar.non-appointment:last-child {
    border-radius: 4px 4px 0 0;
}

.tv-inflow-bar-stack {
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: flex-end;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.tv-inflow-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-height: 1.5rem;
}

.tv-inflow-day {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.tv-inflow-day.today {
    color: #10b981;
    font-weight: 700;
}

.tv-inflow-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.tv-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.tv-legend-dot.appointment {
    background: linear-gradient(180deg, #10b981, #059669);
}

.tv-legend-dot.non-appointment {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

/* Animated glow effect for today's bar */
.tv-inflow-bar-group.today .tv-inflow-bar-stack {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Hover effect */
.tv-inflow-bar-group:hover .tv-inflow-bar-stack {
    transform: scaleY(1.02);
    transition: transform 0.2s ease;
}

.tv-inflow-bar-group:hover .tv-inflow-count {
    transform: translateX(-50%) scale(1.1);
    transition: transform 0.2s ease;
}


/* ========================================
   Quick Actions Context Menu
   ======================================== */

.quick-actions-menu {
    position: fixed;
    background: #1e2235;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 240px;
    z-index: 100000;
    display: none;
    overflow: visible;
    animation: quickActionsSlideIn 0.15s ease;
}

.quick-actions-menu.show {
    display: block;
}

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

.quick-actions-header {
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.quick-actions-vehicle-info {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.quick-actions-recent {
    padding: 0.25rem 0;
}

.quick-actions-recent:empty {
    display: none;
}

.quick-actions-recent + .quick-actions-divider {
    display: none;
}

.quick-actions-recent:not(:empty) + .quick-actions-divider {
    display: block;
}

.quick-actions-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
}

.quick-action-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.quick-action-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.quick-action-icon {
    flex: 0 0 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.35rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    text-align: center;
}

.quick-action-label {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.quick-action-shortcut {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.quick-action-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Submenu */
.quick-action-item.has-submenu {
    position: relative;
}

.quick-actions-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: #1e2235;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100001;
    padding: 0.25rem 0;
    display: none;
}

.quick-actions-submenu.show {
    display: block;
}

/* Position submenu to the left if not enough space on right */
.quick-actions-submenu.show-left {
    left: auto;
    right: 100%;
}

/* Position relative to parent menu */
#changeStatusSubmenu {
    position: absolute;
    margin-top: -40px;
}

.quick-action-subitem {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.quick-action-subitem:hover {
    background: rgba(99, 102, 241, 0.15);
}

.quick-action-subitem:first-child {
    border-radius: 8px 8px 0 0;
}

.quick-action-subitem:last-child {
    border-radius: 0 0 8px 8px;
}

/* Quick Note Modal */
.quick-note-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100002;
}

.quick-note-modal.show {
    display: flex;
}

.quick-note-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.quick-note-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-note-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.quick-note-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quick-note-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.quick-note-body {
    padding: 1.25rem;
}

.quick-note-vehicle-info {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.quick-note-body textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

.quick-note-body textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.quick-note-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Status History Modal */
.status-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100002;
}

.status-history-modal.show {
    display: flex;
}

.status-history-modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.status-history-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-history-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.status-history-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.status-history-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-history-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.status-history-timeline {
    position: relative;
    padding-left: 24px;
}

.status-history-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.status-history-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.status-history-item:last-child {
    padding-bottom: 0;
}

.status-history-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--card-bg);
}

.status-history-item:first-child .status-history-dot {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-history-content {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.status-history-status {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status-history-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Right-click indicator on table rows */
.manage-table tbody tr {
    cursor: context-menu;
}

/* Urgent flag indicator */
.urgent-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* No Permission Message */
.no-permission-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.no-permission-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-permission-message h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-permission-message p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Active Users Expanded Card */
.admin-status-card.active-users.expanded {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.active-users-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.active-users-header .admin-status-icon {
    font-size: 1.25rem;
}

.active-users-header .admin-status-label {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.active-users-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.active-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.active-user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.active-user-item:hover {
    background: rgba(16, 185, 129, 0.1);
}

.active-user-item.current {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.active-user-item.placeholder {
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

.active-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-user-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

.active-user-dot.offline {
    background: var(--text-muted);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.active-user-avatar {
    font-size: 1.1rem;
}

.active-user-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-user-role {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Scrollbar for active users list */
.active-users-list::-webkit-scrollbar {
    width: 4px;
}

.active-users-list::-webkit-scrollbar-track {
    background: transparent;
}

.active-users-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.active-users-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Edit User Modal */
.edit-user-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100002;
}

.edit-user-modal.show {
    display: flex;
}

.edit-user-modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.edit-user-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-user-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.edit-user-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-user-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.edit-user-modal-body {
    padding: 1.5rem;
}

.edit-user-modal-body .form-group {
    margin-bottom: 1.25rem;
}

.edit-user-modal-body .form-group:last-of-type {
    margin-bottom: 0;
}

.edit-user-modal-body label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.edit-user-modal-body input,
.edit-user-modal-body select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.edit-user-modal-body input:focus,
.edit-user-modal-body select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-user-modal-body input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.edit-user-modal-body .form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.edit-user-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.edit-user-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Warranty Filters */
.warranty-filters {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.warranty-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.warranty-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 160px;
}

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

.warranty-filter-select,
.warranty-filter-input {
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
}

.warranty-filter-select:focus,
.warranty-filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.warranty-filter-actions {
    flex: 0 0 auto;
    min-width: auto;
}

.warranty-filter-btns {
    display: flex;
    gap: 0.5rem;
}

.warranty-filter-btns .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.warranty-filter-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.filter-result-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: var(--accent-blue);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 12px;
}

.filter-result-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .warranty-filter-row {
        gap: 0.75rem;
    }
    
    .warranty-filter-group {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .warranty-filter-row {
        flex-direction: column;
    }
    
    .warranty-filter-group {
        width: 100%;
        min-width: 100%;
    }
}

/* TV Dashboard Revenue Panel */
.tv-panel.revenue-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tv-panel.revenue-panel .tv-panel-header {
    position: relative;
}

.tv-revenue-date {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

/* Revenue Summary Row */
.tv-revenue-summary {
    padding: 0.75rem 0;
}

.tv-revenue-total-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tv-revenue-total-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tv-revenue-total-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.tv-revenue-total-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.tv-revenue-total-item.mtd .tv-revenue-total-value {
    color: #3b82f6;
}

.tv-revenue-total-item.togo .tv-revenue-total-value {
    color: #f97316;
}

.tv-revenue-total-item.pct .tv-revenue-total-value {
    font-size: 1.2rem;
}

/* Progress Bar */
.tv-revenue-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.tv-revenue-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Per Brand Breakdown */
.tv-revenue-brands {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.75rem;
}

.tv-revenue-brand-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tv-revenue-brand-name {
    flex: 0 0 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.tv-revenue-brand-bar-container {
    flex: 1;
    height: 18px;
    background: var(--bg-tertiary);
    border-radius: 9px;
    overflow: hidden;
}

.tv-revenue-brand-bar {
    height: 100%;
    border-radius: 9px;
    transition: width 0.8s ease;
    min-width: 2px;
}

.tv-revenue-brand-bar.jetour {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.tv-revenue-brand-bar.hongqi {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.tv-revenue-brand-bar.mclaren {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.tv-revenue-brand-bar.ineos {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.tv-revenue-brand-values {
    flex: 0 0 130px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.tv-rev-mtd {
    color: #60a5fa;
    font-weight: 600;
}

.tv-rev-sep {
    color: var(--text-muted);
    margin: 0 0.15rem;
}

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

/* TV fullscreen adjustments */
.tv-dashboard.fullscreen .tv-revenue-total-value {
    font-size: 1.4rem;
}

.tv-dashboard.fullscreen .tv-revenue-brand-name {
    font-size: 1rem;
}

.tv-dashboard.fullscreen .tv-revenue-brand-bar-container {
    height: 24px;
}

.tv-dashboard.fullscreen .tv-revenue-brand-values {
    font-size: 0.95rem;
    flex: 0 0 160px;
}

/* TV Revenue - To Go per brand */
.tv-rev-togo {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f97316;
    margin-top: 0.15rem;
}

.tv-revenue-brand-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.tv-revenue-brand-values > span:first-child,
.tv-revenue-brand-values > .tv-rev-mtd {
    display: inline;
}

.tv-revenue-brand-values > .tv-rev-sep,
.tv-revenue-brand-values > .tv-rev-budget {
    display: inline;
}

/* Inline MTD / Budget row */
.tv-revenue-brand-row .tv-revenue-brand-values {
    flex: 0 0 140px;
    text-align: right;
}

.tv-dashboard.fullscreen .tv-revenue-brand-row .tv-revenue-brand-values {
    flex: 0 0 170px;
}

.tv-dashboard.fullscreen .tv-rev-togo {
    font-size: 0.85rem;
}

/* Warranty Existing Remark Display */
.warranty-existing-remark {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 3px solid #f97316;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.existing-remark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #f97316;
}

.existing-remark-date {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.existing-remark-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.existing-remark-action {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Courtesy Take Back Button */
.courtesy-cell-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.courtesy-takeback-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.courtesy-takeback-btn:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
    transform: scale(1.1);
}

/* Courtesy Taken Back Badge */
.courtesy-event-badge.courtesy-taken-back {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

/* Courtesy Taken Back Stat Card */
.courtesy-stat-card.taken-back {
    border-left-color: #f97316;
}

.courtesy-stat-card.taken-back .courtesy-stat-icon {
    background: rgba(249, 115, 22, 0.15);
}

/* ========================================
   DAILY APPOINTMENTS MODULE
   ======================================== */

.appointments-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.appointments-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.appointments-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.appointments-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.appointments-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Appointment Stats */
.appt-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.appt-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--border-color);
}

.appt-stat-card.total { border-left-color: #3b82f6; }
.appt-stat-card.arrived { border-left-color: #10b981; }
.appt-stat-card.noshow { border-left-color: #ef4444; }
.appt-stat-card.pending { border-left-color: #f59e0b; }

.appt-stat-icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.appt-stat-content {
    display: flex;
    flex-direction: column;
}

.appt-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.appt-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Upload placeholder */
.appt-upload-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.appt-upload-placeholder h3 {
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.appt-upload-placeholder p {
    color: var(--text-muted);
    margin: 0.25rem 0;
}

/* Active banner */
.appt-active-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.appt-banner-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.appt-banner-icon {
    font-size: 1.5rem;
}

.appt-banner-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
}

.appt-auto-check {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

.appt-stale-warning {
    width: 100%;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-top: 0.5rem;
}

/* Table filters */
.appt-table-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.appt-search {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.appt-filter-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Appointments Table */
.appt-table-container {
    overflow-x: auto;
}

.appt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.appt-table thead th {
    background: var(--bg-tertiary);
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.appt-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.appt-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Row highlight for status */
.appt-row-noshow {
    background: rgba(239, 68, 68, 0.08) !important;
}

.appt-row-noshow td {
    color: #fca5a5 !important;
}

.appt-row-arrived {
    background: rgba(16, 185, 129, 0.05) !important;
}

.appt-row-delivered {
    background: rgba(100, 116, 139, 0.1) !important;
}

/* Reg# code style */
.appt-reg {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

/* Status badges */
.appt-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.appt-status-badge.arrived {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.appt-status-badge.no-show {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.appt-status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.appt-status-badge.delivered {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
}

/* Matched WIP */
.appt-matched-wip {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .appt-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .appointments-header {
        flex-direction: column;
    }
    
    .appointments-header-actions {
        width: 100%;
    }
}

/* Appointment Right-Click Context Menu */
.appt-context-menu {
    display: none;
    position: fixed;
    z-index: 10000;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 0.4rem 0;
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.appt-context-menu.visible {
    display: block;
    animation: apptCtxFadeIn 0.15s ease-out;
}

@keyframes apptCtxFadeIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.appt-context-header {
    padding: 0.5rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.appt-context-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

.appt-context-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.9rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}

.appt-context-item:hover {
    background: var(--bg-tertiary);
}

.appt-context-item[data-status="arrived"]:hover {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.appt-context-item[data-status="pending"]:hover {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.appt-context-item[data-status="no-show"]:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.appt-ctx-clear:hover {
    background: rgba(107, 114, 128, 0.12) !important;
    color: #9ca3af !important;
}

.appt-ctx-icon {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

/* Highlight row being targeted */
.appt-table tbody tr.appt-row-targeted {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* Active status indicator in context menu */
.appt-context-item.appt-ctx-active {
    opacity: 0.5;
    position: relative;
}

.appt-context-item.appt-ctx-active::after {
    content: '● current';
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
    font-style: italic;
}

/* ========================================
   CRITICAL COMPLAINTS NOTIFICATION SYSTEM
   ======================================== */

/* Nav Tab Badge */
.nav-badge-alert {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
}

.nav-tab {
    position: relative;
}

/* Critical Alert Banner */
.critical-alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 0;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    animation: bannerSlideDown 0.4s ease-out;
}

@keyframes bannerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.critical-alert-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.critical-alert-icon {
    font-size: 1.3rem;
    animation: alertShake 0.5s ease-in-out infinite;
}

@keyframes alertShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.critical-alert-text {
    flex: 1;
    font-size: 0.9rem;
}

.critical-alert-text strong {
    font-size: 1.1rem;
    color: #fef08a;
}

.critical-alert-view-btn {
    background: white;
    color: #dc2626;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.critical-alert-view-btn:hover {
    background: #fef2f2;
    transform: scale(1.02);
}

.critical-alert-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.critical-alert-dismiss:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Adjust body when banner is visible */
body.has-critical-alert {
    padding-top: 52px;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .critical-alert-content {
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }
    
    .critical-alert-text {
        font-size: 0.82rem;
    }
    
    .critical-alert-view-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   CUSTOMER UPDATE TRACKER
   ======================================== */

/* Customer Update Modal */
.customer-update-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.customer-update-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: modalFadeIn 0.2s ease-out;
}

.customer-update-modal-content {
    background: #1a1d2d;
    border: 1px solid #2d3348;
    border-radius: 12px;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.customer-update-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.customer-update-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.customer-update-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.customer-update-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.customer-update-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.customer-update-vehicle-info {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-weight: 500;
    border-left: 4px solid #3b82f6;
}

.customer-update-form .form-row {
    margin-bottom: 1rem;
}

.customer-update-form .form-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.customer-update-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: vertical;
}

/* Contact Method Options */
.contact-method-options,
.contact-outcome-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contact-method-option,
.contact-outcome-option {
    flex: 1;
    min-width: 80px;
}

.contact-method-option input,
.contact-outcome-option input {
    display: none;
}

.contact-method-btn,
.contact-outcome-btn {
    display: block;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-method-option input:checked + .contact-method-btn {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

.contact-outcome-btn.reached { border-color: var(--border-color); }
.contact-outcome-btn.no-answer { border-color: var(--border-color); }
.contact-outcome-btn.voicemail { border-color: var(--border-color); }
.contact-outcome-btn.busy { border-color: var(--border-color); }

.contact-outcome-option input:checked + .contact-outcome-btn.reached {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.contact-outcome-option input:checked + .contact-outcome-btn.no-answer {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.contact-outcome-option input:checked + .contact-outcome-btn.voicemail {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
}

.contact-outcome-option input:checked + .contact-outcome-btn.busy {
    background: rgba(107, 114, 128, 0.15);
    border-color: #6b7280;
    color: #6b7280;
}

/* Update History in Modal */
.customer-update-history {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.customer-update-history h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.customer-update-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.customer-update-history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.customer-update-history-item:last-child {
    margin-bottom: 0;
}

.update-history-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.update-history-content {
    flex: 1;
}

.update-history-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.update-history-status {
    color: var(--text-primary);
}

.update-history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
    font-style: italic;
}

.customer-update-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* Last Contact Column Indicators */
.contact-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.contact-status-indicator.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    animation: contactPulse 2s ease-in-out infinite;
}

@keyframes contactPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.contact-status-indicator.due-soon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.contact-status-indicator.recent {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.contact-status-indicator.never {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

/* Contact Filter Highlight */
.filter-select.contact-filter {
    border-color: #3b82f6;
}

/* Pending Updates Widget (for dashboard) */
.pending-updates-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.pending-updates-header h4 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-updates-count {
    background: #ef4444;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pending-updates-list {
    max-height: 250px;
    overflow-y: auto;
}

.pending-update-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
}

.pending-update-item:hover {
    background: var(--bg-primary);
}

.pending-update-item.overdue {
    border-left: 3px solid #ef4444;
}

.pending-update-item.due-soon {
    border-left: 3px solid #f59e0b;
}

.pending-update-vehicle {
    font-weight: 600;
}

.pending-update-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.pending-update-time.overdue {
    color: #ef4444;
}

/* ========================================
   CUSTOMER CONTACT HISTORY MODAL
   ======================================== */

.contact-history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.contact-history-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: modalFadeIn 0.2s ease-out;
}

.contact-history-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 650px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.contact-history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.contact-history-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.contact-history-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.contact-history-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.contact-history-modal-subheader {
    padding: 0.75rem 1.25rem;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.contact-history-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    max-height: 500px;
}

.contact-history-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* History Timeline */
.contact-history-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.contact-history-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.history-timeline-item {
    position: relative;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--border-color);
}

.history-timeline-item.reached {
    border-left-color: #10b981;
}

.history-timeline-item.no-answer,
.history-timeline-item.busy {
    border-left-color: #ef4444;
}

.history-timeline-item.voicemail {
    border-left-color: #f59e0b;
}

.history-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.history-timeline-item.reached::before {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-item-method {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.history-item-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item-outcome {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.history-item-outcome.reached {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.history-item-outcome.no-answer {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.history-item-outcome.voicemail {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.history-item-outcome.busy {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.history-item-status {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

.history-item-notes {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.35rem;
}

.contact-history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.contact-history-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ========================================
   COMMUNICATION REPORT SECTION - PROFESSIONAL
   ======================================== */

.communication-report {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.comm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.comm-header-left h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.comm-subtitle {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.comm-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stats Grid - Professional Cards */
.comm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-tertiary);
}

.comm-stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.comm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comm-stat-card.total {
    border-top: 3px solid #3b82f6;
}

.comm-stat-card.reached {
    border-top: 3px solid #10b981;
}

.comm-stat-card.missed {
    border-top: 3px solid #f59e0b;
}

.comm-stat-card.overdue {
    border-top: 3px solid #ef4444;
}

.comm-stat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.comm-stat-icon {
    font-size: 1.25rem;
}

.comm-stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comm-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.comm-stat-card.total .comm-stat-value { color: #3b82f6; }
.comm-stat-card.reached .comm-stat-value { color: #10b981; }
.comm-stat-card.missed .comm-stat-value { color: #f59e0b; }
.comm-stat-card.overdue .comm-stat-value { color: #ef4444; }

.comm-stat-footer {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Two Column Layout */
.comm-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Section Styling */
.comm-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.comm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.comm-section-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Advisor Table */
.comm-advisor-table-container {
    max-height: 280px;
    overflow-y: auto;
}

.comm-advisor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.comm-advisor-table th {
    background: var(--bg-secondary);
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.comm-advisor-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.comm-advisor-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.comm-advisor-table .rate-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.comm-advisor-table .rate-badge.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.comm-advisor-table .rate-badge.warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.comm-advisor-table .rate-badge.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Recent Activity Log */
.comm-log-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
}

.comm-log-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}

.comm-log-item:hover {
    background: var(--bg-primary);
}

.comm-log-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.comm-log-content {
    flex: 1;
    min-width: 0;
}

.comm-log-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.comm-log-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.comm-log-outcome {
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
}

.comm-log-outcome.reached { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.comm-log-outcome.no-answer { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.comm-log-outcome.voicemail { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.comm-log-outcome.busy { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.comm-log-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.comm-log-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Pending Section - Full Width */
.comm-pending-section {
    margin: 0 1.5rem 1.5rem;
    border-radius: var(--radius-md);
}

.comm-pending-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comm-pending-filter {
    padding: 0.35rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.comm-pending-filter:hover {
    background: var(--bg-primary);
    border-color: var(--text-muted);
}

.comm-pending-filter.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
    font-weight: 600;
}

.comm-pending-table-container {
    max-height: 350px;
    overflow-y: auto;
}

.comm-pending-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.comm-pending-table th {
    background: var(--bg-secondary);
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.comm-pending-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.comm-pending-table tbody tr {
    transition: background 0.15s;
}

.comm-pending-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.comm-pending-table tbody tr.overdue-row {
    background: rgba(239, 68, 68, 0.05);
}

.comm-pending-table tbody tr.never-row {
    background: rgba(107, 114, 128, 0.03);
}

.comm-update-btn {
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.comm-update-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Empty State */
.comm-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
}

.comm-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.comm-empty-state h4 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.comm-empty-state p {
    margin: 0;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .comm-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .comm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
    }
    
    .comm-header {
        padding: 1rem;
    }
    
    .comm-pending-section {
        margin: 0 1rem 1rem;
    }
    
    .comm-two-col {
        padding: 1rem;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .comm-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .comm-stat-value {
        font-size: 1.75rem;
    }
}

/* ========================================
   REPORTS DATE FILTER ENHANCED
   ======================================== */

.report-date-filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.report-custom-date-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.report-date-input {
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 130px;
}

.report-date-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.report-date-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.report-date-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
}

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

.report-date-value {
    color: #3b82f6;
    font-weight: 600;
}

.reports-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .report-date-filter-group {
        width: 100%;
    }
    
    .report-custom-date-picker {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .report-date-input {
        flex: 1;
        min-width: 100px;
    }
    
    .reports-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================
   COMPLAINT REOPEN & HISTORY STYLES
   ======================================== */

.btn-icon.reopen {
    color: #f59e0b;
}

.btn-icon.reopen:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* Complaint History Timeline */
.complaint-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-color);
}

.history-item.solved {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.history-item.reopened {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.history-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.history-notes {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 0.35rem;
}

/* Repeat complaint badge in table */
.complaint-repeat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: 0.35rem;
}

/* ========================================
   CLEAR LOGS MODAL STYLES
   ======================================== */

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.clear-logs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.clear-logs-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: modalFadeIn 0.2s ease-out;
}

.clear-logs-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 450px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.clear-logs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.clear-logs-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.clear-logs-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.clear-logs-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.clear-logs-modal-body {
    padding: 1.25rem;
}

.clear-logs-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clear-logs-option {
    cursor: pointer;
}

.clear-logs-option input {
    display: none;
}

.clear-logs-option-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.clear-logs-option input:checked + .clear-logs-option-content {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.clear-logs-option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.clear-logs-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.clear-logs-option-text strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.clear-logs-option-text small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.clear-logs-warning {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: #f59e0b;
}

.clear-logs-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   REPORT CARD HEADER FIX
   ======================================== */

.report-card .report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.report-card .report-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.report-card .report-card-content {
    padding: 1.25rem;
}

.report-card.full-width {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* ========================================
   URGENT ROW PULSATING HIGHLIGHT
   ======================================== */

@keyframes urgentPulse {
    0% {
        background-color: rgba(239, 68, 68, 0.08);
        box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.18);
        box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.4);
    }
    100% {
        background-color: rgba(239, 68, 68, 0.08);
        box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
    }
}

.manage-table tbody tr.urgent-row {
    animation: urgentPulse 2s ease-in-out infinite;
    position: relative;
}

.manage-table tbody tr.urgent-row td {
    border-bottom-color: rgba(239, 68, 68, 0.3);
}

.manage-table tbody tr.urgent-row:hover {
    animation: none;
    background-color: rgba(239, 68, 68, 0.2) !important;
}

/* Urgent flag badge enhancement */
.urgent-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    animation: urgentBadgePulse 1.5s ease-in-out infinite;
    margin-left: 0.4rem;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

@keyframes urgentBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 10px rgba(239, 68, 68, 0.6);
    }
}

/* Left border indicator for urgent rows */
.manage-table tbody tr.urgent-row td:first-child {
    position: relative;
}

.manage-table tbody tr.urgent-row td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ef4444, #dc2626);
    border-radius: 0 2px 2px 0;
}

.manage-table tbody tr.inactive-row {
    background: rgba(148, 163, 184, 0.05);
}

.manage-table tbody tr.inactive-row:hover {
    background: rgba(148, 163, 184, 0.08) !important;
}

/* ========================================
   URGENT ALERT BANNER
   ======================================== */

.urgent-alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    animation: urgentBannerPulse 3s ease-in-out infinite;
    position: relative;
    flex-wrap: wrap;
}

@keyframes urgentBannerPulse {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.4);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    50% {
        border-color: rgba(239, 68, 68, 0.7);
        box-shadow: 0 0 15px 0 rgba(239, 68, 68, 0.2);
    }
}

.urgent-alert-icon {
    display: none !important;
    font-size: 1.75rem;
    animation: urgentIconShake 0.5s ease-in-out infinite;
}

@keyframes urgentIconShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.urgent-alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.urgent-alert-content strong {
    color: #ef4444;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

.urgent-alert-content span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.urgent-alert-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.urgent-alert-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.urgent-alert-item:hover {
    background: rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.urgent-alert-item strong {
    color: #ef4444;
}

.urgent-alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.urgent-alert-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

@media (max-width: 768px) {
    .urgent-alert-banner {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 2.5rem;
    }
    
    .urgent-alert-list {
        justify-content: flex-start;
        width: 100%;
    }
}

/* ========================================
   URGENT FILTER STYLING
   ======================================== */

.filter-select.urgent-filter {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(239, 68, 68, 0.05));
}

.filter-select.urgent-filter:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* TV Dashboard Urgent Card Enhancement */
.tv-big-card.urgent-vehicle {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.08));
    border-color: rgba(239, 68, 68, 0.3);
    animation: tvUrgentPulse 2.5s ease-in-out infinite;
}

@keyframes tvUrgentPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(239, 68, 68, 0.25);
        border-color: rgba(239, 68, 68, 0.5);
    }
}

.tv-big-card.urgent-vehicle .tv-big-number {
    color: #ef4444;
}

.tv-big-card.urgent-vehicle .tv-big-indicator {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.tv-urgent-sub {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 100px;
    overflow-y: auto;
}

.tv-urgent-sub .tv-sub-item {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    color: #fca5a5;
}

/* ========================================
   SERVICE TYPE CHECKBOXES
   ======================================== */

.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-group.service-type-group {
    display: flex;
    gap: 0.75rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.checkbox-option:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

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

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-option input[type="checkbox"]:checked ~ .checkbox-label {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Service Type Badge Styling */
.service-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.service-type-badge.service {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.service-type-badge.repair {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.service-type-badge.both {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(245, 158, 11, 0.15));
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ========================================
   SERVICE+REPAIR PHASE INDICATOR
   ======================================== */

.service-type-badge.both.phase-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.phase {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.phase.service-done {
    color: #10b981;
}

.phase.repair-pending {
    color: #f59e0b;
    animation: repairPulse 1.5s ease-in-out infinite;
}

@keyframes repairPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.phase-arrow {
    color: var(--text-muted);
    font-size: 0.6rem;
    margin: 0 0.1rem;
}

/* Quick action button for send to repair */
.quick-action-item.service-repair-action {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(245, 158, 11, 0.1));
    border-left: 3px solid #10b981;
}

.quick-action-item.service-repair-action:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(245, 158, 11, 0.2));
}

/* Status badge for service-done-pending-repair */
.workflow-badge.stage-2[data-status="service-done-pending-repair"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Service Done - Send to Repair submenu item styling */
.quick-action-subitem.service-repair-submenu-item {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(245, 158, 11, 0.15));
    border-left: 3px solid #10b981;
    font-weight: 600;
}

.quick-action-subitem.service-repair-submenu-item:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(245, 158, 11, 0.25));
}

/* ========================================
   REPAIR TECHNICIAN SELECTION MODAL
   ======================================== */

.repair-tech-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.repair-tech-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: modalFadeIn 0.2s ease-out;
}

.repair-tech-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.repair-tech-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(245, 158, 11, 0.15));
    border-bottom: 1px solid var(--border-color);
}

.repair-tech-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.repair-tech-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.repair-tech-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.repair-tech-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.repair-tech-vehicle-info {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.repair-tech-vehicle-info .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.repair-tech-vehicle-info .info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.repair-tech-vehicle-info .info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.repair-tech-status-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.phase-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.phase-status .phase-icon {
    font-size: 1.5rem;
}

.phase-status .phase-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.phase-status .phase-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.phase-status.completed .phase-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.phase-status.pending .phase-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    animation: pulseBadge 1.5s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.repair-tech-status-summary .phase-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.repair-tech-form {
    margin-bottom: 1rem;
}

.repair-tech-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.repair-tech-form .form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.technician-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.25rem;
}

.technician-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.technician-option:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.technician-option.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.technician-option input {
    display: none;
}

.technician-option .tech-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.technician-option.selected .tech-radio {
    border-color: #f59e0b;
    background: #f59e0b;
}

.technician-option.selected .tech-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.technician-option .tech-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.technician-option.selected .tech-name {
    color: #f59e0b;
    font-weight: 600;
}

.repair-tech-notes {
    margin-top: 1rem;
}

.repair-tech-notes label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.repair-tech-notes textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.repair-tech-notes textarea:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.repair-tech-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

@media (max-width: 480px) {
    .technician-grid {
        grid-template-columns: 1fr;
    }
    
    .repair-tech-status-summary {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .repair-tech-status-summary .phase-arrow {
        transform: rotate(90deg);
    }
}

/* ========================================
   DUAL TECHNICIAN DISPLAY (Service + Repair)
   ======================================== */

.tech-dual-display {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.75rem;
}

.tech-dual-display .tech-service {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.tech-dual-display .tech-repair {
    color: #f59e0b;
    font-weight: 600;
}

.tech-repair-active {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ========================================
   CHAT SYSTEM
   ======================================== */

/* Chat Button in Header */
.chat-btn {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-right: 0.75rem;
}

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

.chat-btn svg {
    width: 20px;
    height: 20px;
}

.chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: #1a1d2d;
    border: 1px solid #2d3348;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 999998;
    overflow: hidden;
}

.chat-panel.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: chatSlideUp 0.3s ease-out;
}

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

.chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    min-height: 56px;
}

.chat-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-new-btn,
.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.chat-new-btn:hover,
.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-new-btn svg {
    width: 18px;
    height: 18px;
}

/* Chat List View */
.chat-list-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1d2d;
}

.chat-search {
    padding: 0.75rem;
    border-bottom: 1px solid #2d3348;
    background: #1a1d2d;
}

.chat-search input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #252a3d;
    border: 1px solid #2d3348;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.chat-search input:focus {
    outline: none;
    border-color: #3b82f6;
}

.chat-conversations {
    flex: 1;
    overflow-y: auto;
    background: #1a1d2d;
}

.chat-conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #2d3348;
    transition: background 0.2s;
}

.chat-conversation-item:hover {
    background: #252a3d;
}

.chat-conversation-item.unread {
    background: rgba(59, 130, 246, 0.1);
}

.chat-conversation-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.chat-conversation-info {
    flex: 1;
    min-width: 0;
}

.chat-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.chat-conversation-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.chat-conversation-time {
    font-size: 0.7rem;
    color: #64748b;
}

.chat-conversation-preview {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation-item.unread .chat-conversation-preview {
    font-weight: 600;
    color: #e2e8f0;
}

.chat-unread-dot {
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
    background: #1a1d2d;
    min-height: 200px;
}

.chat-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-empty-state p {
    margin: 0 0 0.5rem;
    font-weight: 500;
    color: #94a3b8;
}

.chat-empty-state small {
    font-size: 0.8rem;
    color: #64748b;
}

/* Chat Conversation View */
.chat-conversation-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-conversation-view .chat-conversation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.chat-back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.chat-back-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.chat-back-btn svg {
    width: 20px;
    height: 20px;
}

.chat-recipient-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.chat-recipient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chat-recipient-details {
    display: flex;
    flex-direction: column;
}

.chat-recipient-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-recipient-status {
    font-size: 0.7rem;
    color: #10b981;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-message.sent {
    align-self: flex-end;
}

.chat-message.received {
    align-self: flex-start;
}

.chat-message-bubble {
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.chat-message.sent .chat-message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.received .chat-message-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 0.25rem;
}

.chat-message-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chat-message.sent .chat-message-time {
    text-align: right;
}

/* Chat Input */
.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.chat-input-area textarea {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    resize: none;
    max-height: 100px;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* New Chat View */
.chat-new-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-new-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.chat-new-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.chat-user-list {
    flex: 1;
    overflow-y: auto;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.chat-user-item:hover {
    background: var(--bg-tertiary);
}

.chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chat-user-info {
    flex: 1;
}

.chat-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chat Notification Popup */
.chat-notification {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    overflow: hidden;
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-notification-content {
    padding: 1rem;
}

.chat-notification-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.chat-notification-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.chat-notification-sender {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.chat-notification-message {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.chat-notification-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-notification-reply,
.chat-notification-dismiss {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.chat-notification-reply {
    background: var(--primary-color);
    color: white;
}

.chat-notification-reply:hover {
    background: #2563eb;
}

.chat-notification-dismiss {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.chat-notification-dismiss:hover {
    background: var(--bg-secondary);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-panel {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-notification {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
    }
}

/* ========================================
   LONG PARKED VEHICLES INVENTORY
   ======================================== */

.longparked-container {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.longparked-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.longparked-header-text h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.longparked-header-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.longparked-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Upload Section */
.longparked-upload-section {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.longparked-upload-card {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 4rem;
    text-align: center;
    max-width: 500px;
}

.longparked-upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.longparked-upload-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.longparked-upload-card p {
    margin: 0 0 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.longparked-upload-card .upload-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Stats Cards */
.longparked-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.longparked-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.longparked-stat-card .stat-icon {
    font-size: 2rem;
}

.longparked-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.longparked-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.longparked-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.longparked-stat-card.critical {
    border-left: 4px solid #ef4444;
}

.longparked-stat-card.warning {
    border-left: 4px solid #f59e0b;
}

.longparked-stat-card.normal {
    border-left: 4px solid #10b981;
}

.longparked-stat-card.total {
    border-left: 4px solid #3b82f6;
}

/* Toolbar */
.longparked-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.longparked-search {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.longparked-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.longparked-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.longparked-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.longparked-filters select {
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Table */
.longparked-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.longparked-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.longparked-table th {
    background: var(--bg-tertiary);
    padding: 0.85rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

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

.longparked-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

/* Ageing Badges */
.lp-ageing-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lp-ageing-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.lp-ageing-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.lp-ageing-badge.normal {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Action Buttons */
.lp-actions {
    display: flex;
    gap: 0.5rem;
}

.lp-action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.lp-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.lp-action-btn.delete:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Empty State */
.longparked-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.longparked-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.longparked-empty h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
}

.longparked-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Modal */
.longparked-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.longparked-modal.show {
    display: flex !important;
}

.longparked-modal-content {
    background: #1a1d2d;
    border: 1px solid #2d3348;
    border-radius: 12px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.longparked-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.longparked-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.longparked-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.longparked-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.longparked-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.longparked-modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.longparked-modal-body .form-group {
    margin-bottom: 1rem;
}

.longparked-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.longparked-modal-body label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.longparked-modal-body label .required {
    color: #ef4444;
}

.longparked-modal-body input,
.longparked-modal-body select,
.longparked-modal-body textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.longparked-modal-body input:focus,
.longparked-modal-body select:focus,
.longparked-modal-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.longparked-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* Row highlighting for critical */
.longparked-table tbody tr.lp-critical {
    background: rgba(239, 68, 68, 0.05);
}

.longparked-table tbody tr.lp-warning {
    background: rgba(245, 158, 11, 0.05);
}

/* Status/Reason cell */
.lp-status-cell {
    max-width: 200px;
    white-space: normal;
    line-height: 1.4;
}

.lp-remarks-cell {
    max-width: 150px;
    white-space: normal;
    line-height: 1.4;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .longparked-header {
        flex-direction: column;
    }
    
    .longparked-modal-body .form-row {
        grid-template-columns: 1fr;
    }
    
    .longparked-table-container {
        overflow-x: auto;
    }
}

/* Action Plan Badges */
.lp-action-cell {
    min-width: 150px;
}

.lp-action-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.lp-action-badge.legal {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.lp-action-badge.iom {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.lp-action-badge.used-cars {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.lp-action-badge.customer {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.lp-action-badge.insurance {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.lp-action-badge.parts {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.lp-action-badge.other {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
}

.lp-action-badge.needs-action {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    animation: pulse-action 2s infinite;
}

@keyframes pulse-action {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Action Plan hint in modal */
.action-plan-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

/* Delete Modal Styles */
.delete-vehicle-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid #ef4444;
}

.delete-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.delete-info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.delete-info-value {
    color: var(--text-primary);
    font-size: 0.85rem;
}

.delete-info-value code {
    background: var(--bg-secondary);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

/* Location Badges for Complaints */
.location-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.location-badge.azaiba {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.location-badge.mabella {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.location-badge.wadikabir {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.location-badge.sohar {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.location-badge.unknown {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
}

/* ========================================
   VAS (VALUE ADDED SERVICES) SYSTEM
   ======================================== */

/* VAS Leaderboard Button in Header */
.vas-leaderboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.vas-leaderboard-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.vas-leaderboard-label {
    font-size: 0.75rem;
}

/* VAS Traffic Light Indicator */
.vas-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vas-indicator:hover {
    transform: scale(1.15);
}

.vas-indicator.not-pitched {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid #ef4444;
    color: #ef4444;
    animation: vas-pulse 2s infinite;
}

.vas-indicator.declined {
    background: rgba(245, 158, 11, 0.15);
    border: 2px solid #f59e0b;
    color: #f59e0b;
}

.vas-indicator.partial {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #3b82f6;
    color: #3b82f6;
}

.vas-indicator.accepted {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid #10b981;
    color: #10b981;
}

@keyframes vas-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* VAS Modal */
.vas-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.vas-modal.show {
    display: flex !important;
}

.vas-modal-content {
    background: #1a1d2d;
    border: 1px solid #2d3348;
    border-radius: 12px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.vas-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border-bottom: 1px solid #2d3348;
}

.vas-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

.vas-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.vas-modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.vas-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.vas-vehicle-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid #10b981;
}

.vas-vehicle-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.vas-vehicle-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.vas-form .form-group {
    margin-bottom: 1rem;
}

.vas-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.vas-form textarea,
.vas-form input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.vas-form textarea:focus,
.vas-form input[type="text"]:focus {
    outline: none;
    border-color: #10b981;
}

/* VAS Response Options */
.vas-response-options {
    display: flex;
    gap: 0.75rem;
}

.vas-response-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.vas-response-option:hover {
    border-color: var(--text-muted);
}

.vas-response-option input {
    display: none;
}

.vas-response-option input:checked + .vas-response-icon {
    transform: scale(1.2);
}

.vas-response-option.accepted input:checked ~ * {
    color: #10b981;
}
.vas-response-option.accepted:has(input:checked) {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.vas-response-option.partial input:checked ~ * {
    color: #3b82f6;
}
.vas-response-option.partial:has(input:checked) {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.vas-response-option.declined input:checked ~ * {
    color: #ef4444;
}
.vas-response-option.declined:has(input:checked) {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.vas-response-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: transform 0.2s;
}

.vas-response-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.vas-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* VAS Leaderboard */
.vas-leaderboard-period {
    margin-bottom: 1rem;
}

.vas-leaderboard-period select {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.vas-leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vas-stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.vas-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.vas-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.vas-leaderboard-table {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.vas-leaderboard-table th {
    background: var(--bg-secondary);
    padding: 0.75rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.vas-leaderboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

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

.vas-rank {
    font-weight: 700;
    width: 50px;
}

.vas-rank.gold { color: #f59e0b; }
.vas-rank.silver { color: #94a3b8; }
.vas-rank.bronze { color: #cd7f32; }

.vas-conversion {
    font-weight: 600;
}

.vas-conversion.high { color: #10b981; }
.vas-conversion.medium { color: #f59e0b; }
.vas-conversion.low { color: #ef4444; }

/* VAS Alert Banner */
.vas-alert-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vas-alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vas-alert-icon {
    font-size: 1.25rem;
}

.vas-alert-text {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.vas-alert-text strong {
    color: #ef4444;
}

.vas-alert-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.vas-alert-btn:hover {
    background: #dc2626;
}
