/* ============================================================
       RESET & VARIABLES — ORANGE-TEAL SPLIT THEME
       ============================================================ */
:root {
    /* Header Theme Colors (Orange-Teal Split) */
    --header-orange: #f97316;
    --header-orange-dark: #ea580c;
    --header-orange-light: #fb923c;
    --header-green: #059669;
    --header-green-dark: #047857;
    --header-green-light: #10b981;

    /* Sidebar Peach Theme */
    --sidebar-bg: #ffe8d6;
    --sidebar-bg-warm: #ffd8b8;
    --sidebar-text: #5c3d2e;
    --sidebar-muted: #8a6a5a;
    --sidebar-border: #f0c8a8;
    --sidebar-border-light: #f5d8c0;
    --sidebar-active-bg: linear-gradient(135deg, #ecfdf5, #d1fae5);
    --sidebar-active-text: #065f46;
    --sidebar-active-border: #10b981;
    --sidebar-hover-bg: #ffd0b0;
    --sidebar-hover-text: #7c3d1a;

    /* App Primary Colors (kept teal for body) */
    --primary-900: #022c22;
    --primary-800: #064e3b;
    --primary-700: #065f46;
    --primary-600: #059669;
    --primary-500: #10b981;
    --primary-400: #34d399;
    --primary-300: #6ee7b7;
    --primary-200: #a7f3d0;
    --primary-100: #d1fae5;
    --primary-50: #ecfdf5;
    --accent: #f59e0b;
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
    --bg: #f0f4f3;
    --surface: #ffffff;
    --surface-warm: #f4f9f7;
    --text: #0c1f1a;
    --text-secondary: #264d3f;
    --muted: #5a7a6e;
    --border: #d4e5df;
    --border-light: #e3f0ea;
    --shadow-sm: 0 1px 2px rgba(2, 44, 34, 0.06), 0 1px 4px rgba(2, 44, 34, 0.04);
    --shadow: 0 2px 8px rgba(2, 44, 34, 0.07), 0 4px 20px rgba(2, 44, 34, 0.04);
    --shadow-lg: 0 8px 30px rgba(2, 44, 34, 0.10), 0 12px 48px rgba(2, 44, 34, 0.05);
    --shadow-xl: 0 16px 56px rgba(2, 44, 34, 0.14);
    --sidebar-width: 280px;
    --topbar-height: 66px;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ----- UTILITIES ----- */
.hidden {
    display: none !important;
}
.flex {
    display: flex;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-1 {
    gap: 0.5rem;
}
.gap-2 {
    gap: 1rem;
}
.gap-3 {
    gap: 1.5rem;
}
.w-full {
    width: 100%;
}
.text-center {
    text-align: center;
}
.text-sm {
    font-size: 0.875rem;
}
.text-xs {
    font-size: 0.75rem;
}
.text-muted {
    color: var(--muted);
}
.font-semibold {
    font-weight: 600;
}
.font-bold {
    font-weight: 700;
}
.mt-1 {
    margin-top: 0.5rem;
}
.mt-2 {
    margin-top: 1rem;
}
.mb-1 {
    margin-bottom: 0.5rem;
}
.mb-2 {
    margin-bottom: 1rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ----- ANIMATIONS ----- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
@keyframes pulseRing {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.30);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(16, 185, 129, 0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.45s ease-out both;
}
.animate-fade {
    animation: fadeIn 0.3s ease-out both;
}

/* ----- SCROLLBAR ----- */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--sidebar-border-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #f0b080;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #e09060;
}

/* ============================================================
       BUTTONS
       ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.2;
    outline: none;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.btn:active {
    transform: scale(0.97);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-500) 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(6, 95, 70, 0.25);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(6, 95, 70, 0.32);
}

.btn-success {
    background: linear-gradient(135deg, #065f46 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.25);
}
.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.32);
}

.btn-warning {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent) 100%);
    color: #fff;
}
.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.30);
}

.btn-danger {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.30);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--primary-300);
}

.btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
}
.btn-xs {
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    border-radius: 6px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
}

/* ============================================================
       FORMS
       ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--font);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.10);
}
.form-control:read-only {
    background: var(--bg);
    color: var(--muted);
}
.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}
.form-hint {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.2rem;
}
.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.3rem;
    font-weight: 700;
    display: none;
}
.form-error.show {
    display: block;
}

/* ============================================================
       LOGIN SCREEN
       ============================================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #7c2d12 0%, #c2410c 30%, #059669 70%, #064e3b 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 20%, rgba(249, 115, 22, 0.20) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 80%, rgba(5, 150, 105, 0.15) 0%, transparent 45%);
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: modalPop 0.5s ease-out;
    backdrop-filter: blur(2px);
}

.login-header {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    position: relative;
}
.login-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, var(--header-orange), var(--header-green));
    border-radius: 2px;
}
.login-logo-container {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--header-orange-dark), var(--header-orange));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.35);
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
}
.login-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #7c2d12;
    letter-spacing: -0.01em;
}
.login-header p {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.4rem;
    font-weight: 500;
}

.login-body {
    padding: 2rem;
}

.login-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}
.login-input-group input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #fff;
    transition: var(--transition);
    color: var(--text);
}
.login-input-group input:focus {
    outline: none;
    border-color: var(--header-orange);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.10);
}
.login-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--muted);
    pointer-events: none;
}

.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--header-orange-dark) 0%, var(--header-orange) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 18px rgba(234, 88, 12, 0.30);
    margin-top: 0.25rem;
    letter-spacing: 0.02em;
}
.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(234, 88, 12, 0.40);
}
.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-xs);
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
}
.login-error-box.show {
    display: flex;
}
.login-error-box .text {
    font-size: 0.85rem;
    color: #991b1b;
    font-weight: 700;
}

.login-info-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-xs);
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
}
.login-info-box.show {
    display: flex;
}
.login-info-box .text {
    font-size: 0.85rem;
    color: var(--primary-800);
    font-weight: 600;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--muted);
}
.login-footer a {
    color: var(--header-orange);
    font-weight: 700;
    text-decoration: none;
}

/* Driver Acknowledge section inside login */
.driver-ack-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-light);
}
.driver-ack-section .signature-box {
    padding: 0.75rem;
}
.driver-ack-section .signature-canvas {
    height: 140px;
}

/* ============================================================
       TOPBAR — ORANGE-TEAL SPLIT HEADER
       ============================================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: linear-gradient(135deg, var(--header-orange) 0%, var(--header-orange-dark) 40%, var(--header-green) 60%, var(--header-green-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(234, 88, 12, 0.25), 0 2px 12px rgba(4, 120, 87, 0.15);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

/* Diagonal split overlay for sharper contrast */
.topbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(105deg, 
        var(--header-orange) 0%, 
        var(--header-orange-dark) 45%, 
        transparent 45%, 
        transparent 55%, 
        var(--header-green-dark) 55%, 
        var(--header-green) 100%);
    z-index: 0;
}

/* Subtle texture overlay */
.topbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255,255,255,0.06) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
    z-index: 2;
}

/* Dark icon container with orange icon — matches image */
.topbar-brand .brand-icon {
    font-size: 1.4rem;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    color: var(--header-orange-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
}

.topbar-brand h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}

/* Badges — pill style matching image */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Orange badge (e.g., MANAGER) */
.badge-role {
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Green badge (e.g., CUSTODIAN) */
.badge-custodian {
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Optional: accent badges with theme colors */
.badge-orange {
    background: rgba(249, 115, 22, 0.25);
    color: #ffedd5;
    border-color: rgba(249, 115, 22, 0.40);
}
.badge-green {
    background: rgba(5, 150, 105, 0.25);
    color: #d1fae5;
    border-color: rgba(5, 150, 105, 0.40);
}

/* User name text */
.topbar-user .user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Logout / action buttons in header */
.topbar-user .user-action {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 0.4rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.topbar-user .user-action:hover {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================================
       SIDEBAR — LIGHT ORANGE/PEACH THEME
       ============================================================ */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem;
    z-index: 90;
    overflow-y: auto;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    margin: 0.2rem 0;
    border-radius: var(--radius-xs);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}
.sidebar-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: var(--sidebar-active-border);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.sidebar-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}
.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 0.75rem 1rem;
}
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
    font-size: 0.65rem;
    color: var(--sidebar-muted);
    border-top: 1px solid var(--sidebar-border-light);
}

/* ============================================================
       BOTTOM NAV (mobile)
       ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.bottom-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    height: 100%;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    border-top: 3px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    padding: 0 0.25rem;
}
.bottom-item.active {
    color: var(--primary-700);
    border-top-color: var(--primary-500);
}
.bottom-icon {
    font-size: 1.3rem;
    line-height: 1;
}

/* ============================================================
       MAIN CONTENT
       ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    padding: 1.75rem 2rem 2rem;
    animation: fadeIn 0.3s ease-out;
}

/* ============================================================
       CARDS (Dashboard)
       ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.status-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}
.status-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}
.status-card.active-card::before {
    background: linear-gradient(90deg, var(--primary-400), var(--primary-300));
    opacity: 1;
}
.status-card.pending-card::before {
    background: linear-gradient(90deg, var(--accent), var(--primary-500));
    opacity: 1;
}
.status-card.process-card::before {
    background: linear-gradient(90deg, var(--primary-300), var(--accent));
    opacity: 1;
}
.status-card.completed-card::before {
    background: linear-gradient(90deg, #059669, #f59e0b);
    opacity: 1;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}
.card-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.card-icon {
    font-size: 1.4rem;
}
.card-count {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-700);
    line-height: 1;
    letter-spacing: -0.02em;
}
.card-footer {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ============================================================
       SECTION HEADER
       ============================================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-800);
    letter-spacing: -0.01em;
}

/* ============================================================
       ENTRY LIST
       ============================================================ */
.entry-list {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.entry-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    gap: 1rem;
}
.entry-item:last-child {
    border-bottom: none;
}
.entry-item:hover {
    background: var(--surface-warm);
}
.entry-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    flex: 1;
}
.entry-id {
    font-weight: 800;
    color: var(--primary-700);
    font-size: 0.9rem;
}
.entry-desc {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.entry-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}
.entry-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: var(--primary-700);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.entry-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.entry-status {
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.status-submitted {
    background: #ecfdf5;
    color: var(--primary-700);
}
.status-approved {
    background: #d1fae5;
    color: #065f46;
}
.status-completed {
    background: #e8f0e6;
    color: #2d6a2d;
}
.status-rejected {
    background: #fef2f2;
    color: #991b1b;
}

/* ============================================================
       FORM CONTAINER
       ============================================================ */
.form-container {
    max-width: 960px;
    margin: 0 auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    animation: fadeUp 0.4s ease-out;
}
.form-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-800);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-400);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.form-full {
    grid-column: 1 / -1;
}

/* ============================================================
       SIGNATURE
       ============================================================ */
.signature-box {
    border: 2px dashed var(--border);
    border-radius: var(--radius-xs);
    padding: 1rem;
    text-align: center;
    background: var(--bg);
    transition: var(--transition);
}
.signature-box:hover {
    border-color: var(--primary-400);
    background: var(--surface-warm);
}
.signature-canvas {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
    width: 100%;
    height: 180px;
    touch-action: none;
}
.signature-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.6rem;
    font-weight: 500;
}
.signature-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.6rem;
}

/* ============================================================
       MODAL
       ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 28, 22, 0.50);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(6px);
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalPop 0.3s ease;
    border: 1px solid var(--border-light);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-warm);
}
.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-800);
}
.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: var(--surface-warm);
}

/* ============================================================
       TRACKER (Detail)
       ============================================================ */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.detail-main {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    border: 1px solid var(--border-light);
    animation: fadeUp 0.4s ease-out;
}
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tracker-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-light);
}
.tracker-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tracker-step {
    display: flex;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 1.25rem;
}
.tracker-step:last-child {
    padding-bottom: 0;
}
.tracker-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 30px;
    width: 2px;
    height: calc(100% - 10px);
    background: var(--border-light);
}
.tracker-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
    z-index: 1;
    color: #fff;
    font-weight: 700;
    transition: var(--transition);
}
.tracker-dot.done {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.tracker-dot.active {
    background: var(--accent);
    animation: pulseRing 2s infinite;
}
.tracker-info h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}
.tracker-info p {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}
.tracker-time {
    font-size: 0.65rem;
    color: #7a9e8e;
    margin-top: 0.2rem;
    font-weight: 500;
}
.tracker-progress {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.tracker-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-400), var(--accent));
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* ============================================================
       PRINT
       ============================================================ */
.print-area {
    display: none;
}
@media print {
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        height: 100%;
    }
    body * {
        visibility: hidden;
    }
    .print-area,
    .print-area * {
        visibility: visible;
    }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        margin: 0;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
}
.print-form {
    border: none;
    padding: 0.75rem 1rem;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    font-family: "Century Gothic", Arial, sans-serif;
    box-sizing: border-box;
}
.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1.5px solid #000;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}
.print-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.print-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}
.print-title {
    font-size: 16pt;
    font-weight: 800;
    text-transform: uppercase;
}
.print-meta {
    font-size: 9pt;
    font-weight: 700;
}
.print-entry-number {
    font-size: 9pt;
    font-weight: 700;
    margin-top: 0.25rem;
}
.print-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.print-field {
    flex: 1;
    border-bottom: 1px solid #333;
    padding-bottom: 0.15rem;
}
.print-field label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.15rem;
}
.print-field-value {
    font-size: 0.85rem;
    min-height: 1.1rem;
}
.print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1.5px solid #000;
    padding-top: 0.75rem;
}
.print-sig-box {
    text-align: center;
}
.print-sig-line {
    border-bottom: 1px solid #000;
    height: 64px;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.print-sig-line img {
    max-height: 38px;
}
.print-sig-label {
    font-size: 0.65rem;
    font-weight: 700;
}

/* ============================================================
       LOADING & TOAST
       ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(4px);
}
.loading-overlay.active {
    display: flex;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-text {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    z-index: 400;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.toast.show {
    transform: translateX(0);
}
.toast-success {
    background: linear-gradient(135deg, #065f46, #059669);
}
.toast-error {
    background: linear-gradient(135deg, #991b1b, #dc2626);
}
.toast-info {
    background: linear-gradient(135deg, var(--primary-600), var(--accent));
}
.toast-warning {
    background: linear-gradient(135deg, var(--accent), #d97706);
}

/* ============================================================
       CONFIRM DIALOG
       ============================================================ */
.confirm-dialog {
    position: fixed;
    inset: 0;
    background: rgba(2, 28, 22, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 250;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.confirm-dialog.active {
    display: flex;
}
.confirm-box {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    animation: modalPop 0.25s ease;
    border: 1px solid var(--border-light);
}
.confirm-box h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-800);
    margin-bottom: 0.6rem;
}
.confirm-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ============================================================
       EMPTY STATE
       ============================================================ */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
    font-weight: 500;
}
.empty-state-icon {
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}
.empty-state-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

/* ============================================================
       RESPONSIVE
       ============================================================ */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
        margin-bottom: 72px;
    }
    .bottom-nav {
        display: flex;
    }
    .topbar-brand h1 {
        display: none;
    }
    .cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.875rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .detail-layout {
        grid-template-columns: 1fr;
    }
    .entry-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .entry-right {
        width: 100%;
        justify-content: space-between;
    }
    .login-card {
        max-width: 100%;
        border-radius: var(--radius-sm);
    }
    .login-body {
        padding: 1.5rem;
    }
    .login-header {
        padding: 1.75rem 1.5rem 1.25rem;
    }
    .form-container {
        padding: 1.25rem;
    }
    .detail-main {
        padding: 1.25rem;
    }
    .modal-box {
        max-width: 100%;
        margin: 0.5rem;
        border-radius: var(--radius-sm);
    }
    /* Mobile topbar adjustments */
    .topbar {
        padding: 0 1rem;
    }
    .topbar-user .user-name {
        display: none;
    }
    .badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.9rem;
    }
    .topbar {
        padding: 0 1rem;
    }
    .topbar-brand .brand-icon {
        font-size: 1.2rem;
        padding: 0.25rem 0.5rem;
        min-width: 36px;
        min-height: 36px;
    }
    .badge-role {
        font-size: 0.55rem;
        padding: 0.15rem 0.5rem;
    }
    .section-title {
        font-size: 1.1rem;
    }
    .card-count {
        font-size: 1.8rem;
    }
}

/* ============================================================
       MISC FIXES
       ============================================================ */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scrollable-modal-body {
    max-height: 60vh;
    overflow-y: auto;
}
.gap-0\.5 {
    gap: 0.25rem;
}
.gap-1 {
    gap: 0.5rem;
}
.gap-2 {
    gap: 1rem;
}
.flex-wrap {
    flex-wrap: wrap;
}
.items-start {
    align-items: flex-start;
}
.flex-1 {
    flex: 1;
}
.min-w-0 {
    min-width: 0;
}
.relative {
    position: relative;
}

        /* ============================================================
               ANALYSIS CHART — CANVAS + RESPONSIVE
               ============================================================ */
        .chart-wrapper {
            position: relative;
            width: 100%;
            height: 300px;
            background: #ffffff;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-light);
            overflow: hidden;
        }

        .chart-wrapper canvas {
            width: 100% !important;
            height: 100% !important;
            display: block;
        }

        .chart-legend {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            margin-top: 0.75rem;
            flex-wrap: wrap;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .chart-legend-item {
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .chart-legend-dot {
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 3px;
        }

        .chart-legend-dot.bar-dot {
            background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
        }

        .chart-legend-dot.line-dot {
            background: #c0392b;
            width: 18px;
            height: 3px;
            border-radius: 2px;
        }

        /* 5-card grid — responsive */
        .cards-grid.analysis-cards {
            grid-template-columns: repeat(5, 1fr);
        }

        @media (max-width: 1024px) {
            .cards-grid.analysis-cards {
                grid-template-columns: repeat(3, 1fr);
            }
        }

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

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

        /* Small tweak for vehicle history liter badge */
        .entry-tag.liter-tag {
            background: #e3f0e8;
            color: #1a6a3a;
        }


        /* ===== PRINT STYLES (fix for Analysis vs Request) ===== */
        @media print {
            body * {
                visibility: hidden;
            }
            .print-area,
            .print-area * {
                visibility: visible !important;
            }
            .print-area {
                position: fixed !important;
                left: 0 !important;
                top: 0 !important;
                width: 100% !important;
                height: 100% !important;
                overflow: visible !important;
                background: #fff !important;
                padding: 1.5rem !important;
                z-index: 9999 !important;
                display: block !important;
                margin: 0 !important;
                border: none !important;
                box-shadow: none !important;
                border-radius: 0 !important;
            }
            .print-area .print-header {
                display: flex !important;
                justify-content: space-between !important;
                align-items: center !important;
                border-bottom: 2px solid #0a2540 !important;
                padding-bottom: 0.75rem !important;
                margin-bottom: 1.25rem !important;
            }
            .print-area .print-header-left .print-title {
                font-size: 1.5rem !important;
                font-weight: 800 !important;
                color: #0a2540 !important;
            }
            .print-area .print-header-left .print-meta {
                font-size: 0.7rem !important;
                color: #5a7a6e !important;
            }
            .print-area .print-header-right {
                text-align: right !important;
            }
            .print-area .print-header-right .print-entry-number {
                font-size: 0.85rem !important;
                font-weight: 700 !important;
                color: #0a2540 !important;
                background: #e3f0ea !important;
                padding: 0.2rem 0.6rem !important;
                border-radius: 4px !important;
                margin-top: 0.2rem !important;
            }
            .print-area .print-row {
                display: flex !important;
                gap: 1rem !important;
                margin-bottom: 0.75rem !important;
                flex-wrap: wrap !important;
            }
            .print-area .print-field {
                flex: 1 !important;
                min-width: 140px !important;
            }
            .print-area .print-field label {
                font-size: 0.6rem !important;
                font-weight: 700 !important;
                text-transform: uppercase !important;
                letter-spacing: 0.03em !important;
                color: #5a7a6e !important;
                display: block !important;
                margin-bottom: 0.15rem !important;
            }
            .print-area .print-field .print-field-value {
                font-size: 0.9rem !important;
                font-weight: 600 !important;
                color: #0a2540 !important;
                border-bottom: 1px solid #dce8e2 !important;
                padding: 0.1rem 0 !important;
            }
            .print-area .print-signatures {
                display: flex !important;
                gap: 1.5rem !important;
                margin-top: 1.25rem !important;
                flex-wrap: wrap !important;
                border-top: 1px solid #dce8e2 !important;
                padding-top: 1.25rem !important;
            }
            .print-area .print-sig-box {
                flex: 1 !important;
                min-width: 120px !important;
                text-align: center !important;
            }
            .print-area .print-sig-line {
                height: 60px !important;
                border-bottom: 1px solid #0a2540 !important;
                display: flex !important;
                align-items: flex-end !important;
                justify-content: center !important;
                margin-bottom: 0.25rem !important;
            }
            .print-area .print-sig-line img {
                max-height: 50px !important;
                max-width: 100% !important;
            }
            .print-area .print-sig-label {
                font-size: 0.6rem !important;
                font-weight: 700 !important;
                color: #5a7a6e !important;
                text-transform: uppercase !important;
                letter-spacing: 0.03em !important;
            }

            /* Analysis print specific */
            .print-area .analysis-print-title {
                font-size: 1.6rem !important;
                font-weight: 800 !important;
                color: #0a2540 !important;
                text-align: center !important;
                margin-bottom: 0.25rem !important;
            }
            .print-area .analysis-print-sub {
                text-align: center !important;
                font-size: 0.75rem !important;
                color: #5a7a6e !important;
                margin-bottom: 1.25rem !important;
            }
            .print-area .analysis-cards-grid {
                display: grid !important;
                grid-template-columns: repeat(3, 1fr) !important;
                gap: 0.75rem !important;
                margin-bottom: 1.25rem !important;
            }
            .print-area .analysis-stat-card {
                background: #f6faf8 !important;
                border: 1px solid #dce8e2 !important;
                border-radius: 6px !important;
                padding: 0.6rem 0.8rem !important;
                text-align: center !important;
            }
            .print-area .analysis-stat-card .stat-label {
                font-size: 0.55rem !important;
                font-weight: 700 !important;
                text-transform: uppercase !important;
                letter-spacing: 0.03em !important;
                color: #5a7a6e !important;
            }
            .print-area .analysis-stat-card .stat-value {
                font-size: 1.25rem !important;
                font-weight: 800 !important;
                color: #0a2540 !important;
            }
            .print-area .analysis-table-wrap {
                margin-top: 1rem !important;
                border-top: 1px solid #dce8e2 !important;
                padding-top: 1rem !important;
            }
            .print-area .analysis-table-wrap h4 {
                font-size: 0.8rem !important;
                font-weight: 700 !important;
                color: #0a2540 !important;
                margin-bottom: 0.5rem !important;
            }
            .print-area .analysis-table {
                width: 100% !important;
                border-collapse: collapse !important;
                font-size: 0.7rem !important;
            }
            .print-area .analysis-table th {
                background: #e3f0ea !important;
                color: #0a2540 !important;
                font-weight: 700 !important;
                padding: 0.3rem 0.5rem !important;
                text-align: left !important;
                border: 1px solid #c8dcc8 !important;
            }
            .print-area .analysis-table td {
                padding: 0.25rem 0.5rem !important;
                border: 1px solid #dce8e2 !important;
            }
            .print-area .analysis-table .abnormal {
                background: #fef2f2 !important;
                color: #dc2626 !important;
                font-weight: 700 !important;
            }
            .print-area .chart-img-wrap {
                text-align: center !important;
                margin: 0.75rem 0 !important;
            }
            .print-area .chart-img-wrap img {
                max-width: 100% !important;
                border: 1px solid #dce8e2 !important;
                border-radius: 6px !important;
            }

            .no-print {
                display: none !important;
            }
            .sidebar,
            .bottom-nav,
            .topbar,
            #toast,
            #loadingOverlay,
            .modal-overlay,
            .confirm-dialog,
            .pwa-install-banner,
            .pwa-install-fab,
            .ios-install-hint {
                display: none !important;
            }
            .main-content {
                padding: 0 !important;
                margin: 0 !important;
                max-width: 100% !important;
            }
            #viewDashboard,
            #viewNew,
            #viewDetail,
            #viewArchive,
            #viewAnalysis {
                display: none !important;
            }
        }
        /* Additional style for editable fields */
        .editable-input {
            background: #fff9f0 !important;
            border: 2px solid #f59e0b !important;
            box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
        }
        .editable-input:focus {
            border-color: #d97706 !important;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
        }
        .rejected-banner {
            margin-top: 1rem;
            padding: 1rem;
            background: #fde8e8;
            border-radius: var(--radius-xs);
            border: 1px solid #fccccc;
            color: #8b0000;
        }
        .rejected-banner strong {
            display: block;
            font-size: 1rem;
        }
        .rejected-banner span {
            font-size: 0.9rem;
        }

        /* ===== ANALYSIS CARDS — 7 cards (COMP VS ACTUAL restored) ===== */
        .analysis-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .analysis-stat-card {
            background: var(--surface);
            border-radius: var(--radius);
            padding: 1rem 1.25rem;
            box-shadow: var(--shadow);
            border-left: 4px solid var(--primary-600);
            transition: var(--transition);
        }
        .analysis-stat-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }
        .analysis-stat-card .stat-label {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--text-secondary);
        }
        .analysis-stat-card .stat-value {
            font-size: 1.4rem;
            font-weight: 800;
            color: var(--primary-800);
            margin-top: 0.25rem;
            line-height: 1.3;
        }
        .analysis-stat-card .stat-sub {
            font-size: 0.65rem;
            color: var(--muted);
            font-weight: 500;
            margin-top: 0.15rem;
        }
        .analysis-stat-card.total-distance .stat-value {
            color: #c0392b;
        }
        .analysis-stat-card.total-liters .stat-value {
            color: #2563eb;
        }
        .analysis-stat-card.avg-price .stat-value {
            color: #8b5cf6;
        }
        .analysis-stat-card.computed-vs-actual .stat-value {
            color: #d97706;
        }

        /* ===== CHART LEGEND ===== */
        .chart-legend {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            flex-wrap: wrap;
            margin-top: 0.75rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .chart-legend-item {
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        .chart-legend-dot {
            display: inline-block;
            width: 14px;
            height: 14px;
            border-radius: 4px;
        }
        .chart-legend-dot.bar-dot {
            background: linear-gradient(135deg, #10b981, #065f46);
        }
        .chart-legend-dot.line-dot {
            background: #c0392b;
            border-radius: 50%;
            width: 12px;
            height: 12px;
        }
        .chart-legend-dot.actual-dot {
            background: #2563eb;
            border-radius: 50%;
            width: 12px;
            height: 12px;
            border: 2px solid #1e40af;
        }

        /* ===== DETAIL ENTRY LIST ===== */
        .entry-list .entry-item {
            cursor: pointer;
            transition: var(--transition);
        }
        .entry-list .entry-item:hover {
            background: var(--surface-hover);
            transform: translateX(4px);
        }
        .entry-list .entry-item .entry-tag.liter-tag {
            background: #dbeafe;
            color: #1e40af;
        }
        .entry-list .entry-item .entry-tag.actual-tag {
            background: #d1fae5;
            color: #065f46;
        }
        .entry-list .entry-item .entry-tag.computed-tag {
            background: #fef3c7;
            color: #92400e;
        }

        /* ===== ODO MONITORING ===== */
        .odo-abnormal {
            border-left: 4px solid #dc2626 !important;
            background: #fef2f2 !important;
        }
        .odo-abnormal .entry-id {
            color: #991b1b;
        }

        /* ===== PRINT FIXES ===== */
        .print-area .analysis-cards-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.75rem;
        }
        .print-area .analysis-stat-card {
            box-shadow: none !important;
            border: 1px solid #dce8e2;
            padding: 0.6rem 0.8rem;
        }
        .print-area .analysis-stat-card .stat-value {
            font-size: 1.2rem;
        }
        .print-area .analysis-table-wrap {
            page-break-inside: avoid;
        }
        .print-area .chart-img-wrap {
            margin: 1rem 0;
            text-align: center;
        }
        .print-area .chart-img-wrap img {
            max-width: 100%;
            border: 1px solid #dce8e2;
            border-radius: 8px;
        }

        /* ===== RESPONSIVE TWEAKS ===== */
        @media (max-width: 640px) {
            .analysis-cards-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.75rem;
            }
            .analysis-stat-card .stat-value {
                font-size: 1.1rem;
            }
            .analysis-stat-card {
                padding: 0.75rem 1rem;
            }
        }
        @media (max-width: 420px) {
            .analysis-cards-grid {
                grid-template-columns: 1fr 1fr;
                gap: 0.5rem;
            }
            .analysis-stat-card .stat-value {
                font-size: 0.95rem;
            }
            .analysis-stat-card .stat-label {
                font-size: 0.6rem;
            }
        }

        /* ===== STATUS CARD BORDER COLORS ===== */
        .status-card.total-distance-card {
            border-left: 4px solid #c0392b;
        }
        .status-card.total-liters-card {
            border-left: 4px solid #2563eb;
        }
        .status-card.avg-price-card {
            border-left: 4px solid #8b5cf6;
        }

        /* ===== SEARCHABLE DROPDOWN (combobox) ===== */
        .combobox-wrapper {
            position: relative;
            width: 100%;
        }
        .combobox-wrapper .combobox-input {
            width: 100%;
            padding-right: 2.2rem;
            cursor: pointer;
        }
        .combobox-wrapper .combobox-arrow {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
            color: var(--text-secondary);
            font-size: 0.7rem;
        }
        .combobox-wrapper .combobox-list {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            z-index: 100;
            background: #fff;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            box-shadow: var(--shadow-lg);
            max-height: 200px;
            overflow-y: auto;
            display: none;
            margin-top: 2px;
        }
        .combobox-wrapper .combobox-list.open {
            display: block;
        }
        .combobox-wrapper .combobox-list .combobox-option {
            padding: 0.5rem 0.75rem;
            cursor: pointer;
            font-size: 0.85rem;
            color: var(--text-primary);
            border-bottom: 1px solid #f1f5f9;
            transition: var(--transition);
        }
        .combobox-wrapper .combobox-list .combobox-option:last-child {
            border-bottom: none;
        }
        .combobox-wrapper .combobox-list .combobox-option:hover,
        .combobox-wrapper .combobox-list .combobox-option.active {
            background: #f0f7f4;
            color: var(--primary-700);
        }
        .combobox-wrapper .combobox-list .combobox-option .option-sub {
            font-size: 0.7rem;
            color: var(--muted);
            display: block;
            font-weight: 400;
        }
        .combobox-wrapper .combobox-list .combobox-empty {
            padding: 0.75rem;
            text-align: center;
            color: var(--muted);
            font-size: 0.8rem;
        }

        /* ===== VEHICLE HISTORY FILTERS ===== */
        .history-filters {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            align-items: flex-end;
            margin-bottom: 1rem;
            padding: 0.75rem 1rem;
            background: var(--surface);
            border-radius: var(--radius);
            border: 1px solid var(--border);
        }
        .history-filters .filter-group {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            flex: 1;
            min-width: 140px;
        }
        .history-filters .filter-group label {
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            color: var(--text-secondary);
            letter-spacing: 0.03em;
        }
        .history-filters .filter-group input,
        .history-filters .filter-group select {
            font-size: 0.85rem;
            padding: 0.4rem 0.6rem;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            background: #fff;
            width: 100%;
        }
        .history-filters .filter-actions {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
        }
        @media (max-width: 640px) {
            .history-filters .filter-group {
                min-width: 100%;
            }
            .history-filters .filter-actions {
                width: 100%;
                justify-content: flex-start;
            }
        }

        /* ===== UTILITY ===== */
        .mt-1 {
            margin-top: 0.5rem;
        }
        .mb-1 {
            margin-bottom: 0.5rem;
        }
        .text-center {
            text-align: center;
        }
        .text-xs {
            font-size: 0.7rem;
        }
        .text-muted {
            color: var(--muted);
        }
        .fw-700 {
            font-weight: 700;
        }
        .form-hint {
            font-size: 0.7rem;
            color: var(--muted);
            margin-top: 0.25rem;
        }
        .form-hint strong {
            color: var(--primary-700);
        }
        .readonly-field {
            background: #f3f6f8 !important;
            cursor: default;
            color: var(--text-secondary);
        }
        .readonly-field:focus {
            border-color: var(--border) !important;
            box-shadow: none !important;
        }
        .field-calc-badge {
            display: inline-block;
            font-size: 0.6rem;
            font-weight: 700;
            background: #e8f0e6;
            color: #1a5a1a;
            padding: 0.15rem 0.5rem;
            border-radius: 12px;
            margin-left: 0.5rem;
        }
        .field-actual-badge {
            display: inline-block;
            font-size: 0.6rem;
            font-weight: 700;
            background: #dbeafe;
            color: #1e40af;
            padding: 0.15rem 0.5rem;
            border-radius: 12px;
            margin-left: 0.5rem;
        }

        /* Comparison status */
        .compare-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.15rem 0.6rem;
            border-radius: 12px;
        }
        .compare-badge.match {
            background: #d1fae5;
            color: #065f46;
        }
        .compare-badge.warning {
            background: #fef3c7;
            color: #92400e;
        }
        .compare-badge.abnormal {
            background: #fee2e2;
            color: #991b1b;
        }

        /* ===== LITERS COMPARISON BAR ===== */
        .liters-compare-bar {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.4rem 0;
        }
        .liters-compare-bar .bar-track {
            flex: 1;
            height: 8px;
            background: #e5e7eb;
            border-radius: 4px;
            overflow: hidden;
            position: relative;
            min-width: 80px;
        }
        .liters-compare-bar .bar-track .bar-computed {
            height: 100%;
            background: #f59e0b;
            border-radius: 4px;
            transition: width 0.3s;
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0.5;
        }
        .liters-compare-bar .bar-track .bar-actual {
            height: 100%;
            background: #2563eb;
            border-radius: 4px;
            transition: width 0.3s;
            position: absolute;
            left: 0;
            top: 0;
        }
        .liters-compare-bar .bar-label {
            font-size: 0.7rem;
            font-weight: 600;
            min-width: 56px;
            text-align: right;
            color: var(--text-secondary);
        }
        .liters-compare-bar .bar-label.actual-label {
            color: #2563eb;
        }
        .liters-compare-bar .bar-label.computed-label {
            color: #f59e0b;
        }

        /* ===== CHART WRAPPER FIX ===== */
        .chart-wrapper {
            width: 100%;
            max-width: 100%;
            overflow: hidden;
            position: relative;
            min-height: 300px;
            background: #fafcfb;
            border-radius: var(--radius-xs);
            padding: 0.5rem 0;
        }
        .chart-wrapper canvas {
            display: block;
            width: 100% !important;
            height: auto !important;
            max-height: 320px;
        }
        .chart-wrapper .empty-state {
            padding: 2rem;
            height: 300px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .chart-wrapper .empty-state .empty-state-icon {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }
        .chart-wrapper .empty-state .empty-state-title {
            font-weight: 700;
            font-size: 1rem;
            color: var(--text-secondary);
        }
        .chart-wrapper .empty-state p {
            font-size: 0.85rem;
            color: var(--muted);
        }
