        /* ================================================================
           MAKATIX PRO - PREMIUM DARK DASHBOARD UI
           Tokenized Color System - Blood Orange on Deep Navy
           Version: 4.0 (pipeline-centric; data flow in transition)
           ================================================================

           DESIGN SYSTEM OVERVIEW
           ──────────────────────
           Theme:     Dark Navy (Deep Blue) + Blood Orange Accent
           Font:      Poppins / Inter (Google Fonts)
           Radius:    8px (sm) → 12px (md) → 16px (lg) → 20px (xl)
           Sidebar:   260px fixed, navy gradient, orange active state
           Header:    70px fixed, frosted glass dark

           TO RE-SKIN: Change the 6 --palette-* values below.
           Everything else (buttons, glows, borders, etc.) auto-updates.

           PALETTE TOKENS:
           ├── --palette-base       → Body background
           ├── --palette-surface    → Card / panel backgrounds
           ├── --palette-primary    → Accent color (CTA, active states)
           ├── --palette-secondary  → Info color (links, secondary actions)
           ├── --palette-danger     → Destructive / error
           └── --palette-warning    → Warning / pending

           UTILITY CLASSES AVAILABLE:
           ├── .live-indicator      → Pulsing green dot
           ├── .badge-count         → Number pill (e.g. notification count)
           ├── .status-pill         → Status badge (.success/.warning/.danger/.info/.neutral)
           ├── .stat-card           → Metric card with .stat-value, .stat-label, .stat-trend
           ├── .empty-state         → Empty placeholder styling
           └── [data-tooltip]       → Hover tooltip via attribute

           INLINE STYLE OVERRIDES:
           The bottom of this stylesheet contains comprehensive overrides
           that catch hardcoded colors (#234974, #fff, #f5f5f5, #333, etc.)
           from inline styles throughout the HTML. These ensure the dark
           theme stays consistent even with legacy inline-styled elements.

           ================================================================ */

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

        :root {
            /* ============================================================
               MASTER PALETTE - Change these 6 values to re-skin the app
               Current theme: Blood Orange on Deep Navy
               ============================================================ */
            --palette-base:       #0B1426;
            --palette-surface:    #111C32;
            --palette-primary:    #E8430A;
            --palette-secondary:  #3B82F6;
            --palette-danger:     #EF4444;
            --palette-warning:    #F59E0B;

            /* === SEMANTIC: Backgrounds === */
            --bg-body:        var(--palette-base);
            --bg-card:        var(--palette-surface);
            --bg-card-hover:  #162040;
            --bg-header:      var(--palette-surface);
            --bg-input:       rgba(255,255,255,0.05);
            --bg-input-focus: rgba(255,255,255,0.08);

            /* === SEMANTIC: Accent (from --palette-primary) === */
            --accent:           var(--palette-primary);
            --accent-light:     #FF6B35;
            --accent-gradient:  linear-gradient(135deg, #E8430A 0%, #FF6B35 100%);
            --accent-glow:      rgba(232, 67, 10, 0.30);
            --accent-subtle:    rgba(232, 67, 10, 0.15);

            /* === SEMANTIC: Secondary (from --palette-secondary) === */
            --secondary:          var(--palette-secondary);
            --secondary-light:    #60A5FA;
            --secondary-gradient: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
            --secondary-glow:     rgba(59, 130, 246, 0.25);

            /* === SEMANTIC: Status Colors === */
            --success:          #22C55E;
            --success-light:    #4ADE80;
            --success-gradient: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
            --danger:           var(--palette-danger);
            --danger-light:     #F87171;
            --danger-gradient:  linear-gradient(135deg, #EF4444 0%, #F87171 100%);
            --warning:          var(--palette-warning);
            --warning-light:    #FBBF24;

            /* === SEMANTIC: Text === */
            --text-primary:   #E2E8F0;
            --text-secondary: #94A3B8;
            --text-muted:     #64748B;
            --text-on-accent: #FFFFFF;
            --text-white:     #ffffff;

            /* === SEMANTIC: Borders === */
            --border-subtle:  rgba(255,255,255,0.06);
            --border-medium:  rgba(255,255,255,0.12);
            --border-accent:  rgba(232, 67, 10, 0.30);

            /* === SEMANTIC: Shadows === */
            --shadow-soft:    0 2px 15px rgba(0, 0, 0, 0.2);
            --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.3);
            --shadow-hover:   0 8px 30px rgba(0, 0, 0, 0.4);
            --shadow-accent:  0 4px 15px rgba(232, 67, 10, 0.35);
            --shadow-sidebar: 4px 0 25px rgba(0, 0, 0, 0.3);

            /* === SEMANTIC: Sidebar (preserves gorgeous design) === */
            --sidebar-bg:           linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
            --sidebar-text:         rgba(255,255,255,0.8);
            --sidebar-category:     var(--secondary-light);
            --sidebar-hover-bg:     var(--accent-subtle);
            --sidebar-hover-border: var(--accent-light);
            --sidebar-active-bg:    var(--accent-gradient);
            --sidebar-active-glow:  var(--shadow-accent);

            /* === BACKWARD COMPAT ALIASES (keep old var names working) === */
            --brand-blue:       var(--palette-secondary);
            --brand-blue-dark:  #1E3A8A;
            --brand-blue-light: var(--secondary-light);
            --brand-red:        var(--palette-danger);
            --brand-red-dark:   #DC2626;
            --brand-red-light:  var(--danger-light);
            --brand-navy:       #0F172A;
            --brand-navy-light: #1E293B;
            --blue-gradient:    var(--secondary-gradient);
            --red-gradient:     var(--danger-gradient);
            --navy-gradient:    var(--sidebar-bg);
            --green-gradient:   var(--success-gradient);
            --orange-gradient:  var(--accent-gradient);
            --teal-gradient:    linear-gradient(135deg, #14b8a6 0%, #2dd4bf 100%);
            --bg-sidebar:       var(--sidebar-bg);
            --text-dark:        var(--text-primary);
            --text-medium:      var(--text-secondary);
            --text-light:       var(--text-muted);

            /* === LAYOUT === */
            --sidebar-width: 260px;
            --header-height: 70px;
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 20px;
        }

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

        body {
            font-family: 'Poppins', 'Inter', sans-serif;
            background: var(--bg-body);
            color: var(--text-dark);
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        /* Arrow glyph (▼) – ensure a font that has the character so it doesn’t show as a box */
        /* Arrow glyph – CSS triangle so it never shows as a box (font-independent) */
        .arrow-down {
            display: inline-block;
            width: 0;
            height: 0;
            box-sizing: content-box;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-top: 6px solid currentColor;
            margin-right: 8px;
            vertical-align: middle;
        }
        #sidebarNav .nav-category-header span.arrow-down,
        header div[onclick="toggleProfileMenu()"] > span.arrow-down {
            margin-right: 8px;
        }

        /* ========== DARK MODE (NIGHT MODE) ========== */
        /* Now the default. Token system in :root already defines dark values.
           This block kept for backward compat with the body.night-mode class. */
        body.night-mode {
            --bg-body: var(--palette-base);
            --bg-card: var(--palette-surface);
            --bg-header: var(--palette-surface);
            --text-dark: var(--text-primary);
            --text-medium: var(--text-secondary);
            --text-light: var(--text-muted);
            --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
            --shadow-soft: 0 2px 15px rgba(0, 0, 0, 0.2);
            --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
        }

        body.night-mode {
            background: var(--bg-body);
            color: var(--text-dark);
        }

        /* Dark mode for cards and sections - comprehensive coverage */
        body.night-mode .section-content,
        body.night-mode .card,
        body.night-mode div[style*="background: #fff"],
        body.night-mode div[style*="background:#fff"],
        body.night-mode div[style*="background: white"],
        body.night-mode div[style*="background:white"],
        body.night-mode div[style*="background:#ffffff"],
        body.night-mode div[style*="background: #ffffff"],
        body.night-mode div[style*="background:#fafafa"],
        body.night-mode div[style*="background: #fafafa"],
        body.night-mode div[style*="background:#f9fafb"],
        body.night-mode div[style*="background: #f9fafb"],
        body.night-mode div[style*="background:#f3f4f6"],
        body.night-mode div[style*="background: #f3f4f6"],
        body.night-mode div[style*="background:#f0f5ff"],
        body.night-mode div[style*="background: #f0f5ff"],
        body.night-mode div[style*="background:#f5f5f5"],
        body.night-mode div[style*="background: #f5f5f5"],
        body.night-mode div[style*="background:#e5e7eb"],
        body.night-mode div[style*="background: #e5e7eb"],
        body.night-mode div[style*="background:#fef2f2"],
        body.night-mode div[style*="background: #fef2f2"],
        body.night-mode div[style*="background:#eff6ff"],
        body.night-mode div[style*="background: #eff6ff"],
        body.night-mode div[style*="background:#f8fafc"],
        body.night-mode div[style*="background: #f8fafc"],
        body.night-mode div[style*="background:#fefce8"],
        body.night-mode div[style*="background: #fefce8"],
        body.night-mode div[style*="background:#ecfdf5"],
        body.night-mode div[style*="background: #ecfdf5"],
        body.night-mode div[style*="background:#f5f3ff"],
        body.night-mode div[style*="background: #f5f3ff"],
        body.night-mode div[style*="background:#e8f4f8"],
        body.night-mode div[style*="background: #e8f4f8"],
        body.night-mode div[style*="background-color: #fff"],
        body.night-mode div[style*="background-color:#fff"],
        body.night-mode div[style*="background-color: white"],
        body.night-mode div[style*="background-color:white"],
        body.night-mode div[style*="background-color:#fafafa"],
        body.night-mode div[style*="background-color: #fafafa"],
        body.night-mode div[style*="background-color:#f9fafb"],
        body.night-mode div[style*="background-color: #f9fafb"],
        body.night-mode div[style*="background-color:#f3f4f6"],
        body.night-mode div[style*="background-color: #f3f4f6"],
        body.night-mode section[style*="background"],
        body.night-mode form[style*="background"],
        body.night-mode article[style*="background"] {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for headers */
        body.night-mode h1,
        body.night-mode h2,
        body.night-mode h3,
        body.night-mode h4,
        body.night-mode h5,
        body.night-mode h6 {
            color: var(--text-dark) !important;
        }

        /* Dark mode for tables */
        body.night-mode table {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode th {
            background: rgba(59, 130, 246, 0.15) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Conditional Pricing – chips & dropdown (night mode + overflow fix) */
        .cond-pricing-value-wrap {
            background: var(--bg-card, #fff) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-dark, #333) !important;
        }
        body.night-mode .cond-pricing-value-wrap {
            background: var(--bg-card) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }
        .cond-pricing-chip {
            background: rgba(59, 130, 246, 0.25) !important;
            border-color: rgba(59, 130, 246, 0.5) !important;
            color: var(--text-dark, #333) !important;
        }
        body.night-mode .cond-pricing-chip {
            background: rgba(59, 130, 246, 0.2) !important;
            border-color: rgba(59, 130, 246, 0.4) !important;
        }
        .cond-pricing-add-btn {
            background: var(--bg-card-hover, #f0f0f0) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-dark, #333) !important;
        }
        body.night-mode .cond-pricing-add-btn {
            background: rgba(255, 255, 255, 0.08) !important;
        }
        .cond-pricing-drop-panel {
            background: var(--bg-card, #fff) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-dark, #333) !important;
        }
        body.night-mode .cond-pricing-drop-panel {
            background: var(--bg-card) !important;
        }
        .cond-pricing-drop-item:hover {
            background: rgba(255, 255, 255, 0.08) !important;
        }
        body.night-mode .cond-pricing-drop-item:hover {
            background: rgba(255, 255, 255, 0.1) !important;
        }

        body.night-mode td {
            border-color: rgba(255, 255, 255, 0.1) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode tr:hover {
            background: rgba(59, 130, 246, 0.1) !important;
        }

        /* Dark mode for forms */
        body.night-mode input[type="text"],
        body.night-mode input[type="number"],
        body.night-mode input[type="date"],
        body.night-mode input[type="email"],
        body.night-mode input[type="password"],
        body.night-mode select,
        body.night-mode textarea {
            background-color: rgba(255, 255, 255, 0.05) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }

        body.night-mode input[type="text"]:focus,
        body.night-mode input[type="number"]:focus,
        body.night-mode input[type="date"]:focus,
        body.night-mode input[type="email"]:focus,
        body.night-mode input[type="password"]:focus,
        body.night-mode select:focus,
        body.night-mode textarea:focus {
            background-color: rgba(255, 255, 255, 0.08) !important;
            border-color: var(--brand-blue-light) !important;
        }

        /* Dark mode for header */
        body.night-mode header {
            background: var(--bg-header) !important;
            border-bottom-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Profile dropdown & all dropdown theming → consolidated in DROPDOWN SYSTEM section below */

        body.night-mode .profile-dropdown-item:hover {
            background: var(--accent-subtle) !important;
        }

        .logout-item:hover {
            background: rgba(239, 68, 68, 0.15) !important;
        }

        body.night-mode .logout-item:hover {
            background: rgba(239, 68, 68, 0.15) !important;
        }

        body.night-mode .profile-dropdown-divider {
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for modals */
        body.night-mode #loginModal>div,
        body.night-mode .modal-content {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for buttons */
        body.night-mode .submit-btn {
            background: var(--blue-gradient) !important;
            color: white !important;
        }

        body.night-mode .submit-btn:hover {
            opacity: 0.9;
        }

        /* Dark mode toggle slider */
        #nightModeToggle:checked+#nightModeSlider {
            background-color: var(--brand-blue) !important;
        }

        #nightModeToggle:checked+#nightModeSlider #nightModeSliderCircle {
            transform: translateX(20px);
        }

        body.night-mode #nightModeSlider {
            background-color: rgba(255, 255, 255, 0.3) !important;
        }

        body.night-mode #nightModeToggle:checked+#nightModeSlider {
            background-color: var(--brand-blue-light) !important;
        }

        /* Dark mode for labels */
        body.night-mode label {
            color: var(--text-dark) !important;
        }

        /* Dark mode for links */
        body.night-mode a {
            color: var(--brand-blue-light) !important;
        }

        body.night-mode a:hover {
            color: var(--brand-blue) !important;
        }

        /* Dark mode for section headers */
        body.night-mode .section-header {
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for dividers */
        body.night-mode hr,
        body.night-mode div[style*="border"] {
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for code/pre blocks */
        body.night-mode code,
        body.night-mode pre {
            background: rgba(0, 0, 0, 0.3) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for alerts/notifications */
        body.night-mode .alert,
        body.night-mode .notification {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for badges/tags */
        body.night-mode span[style*="background"],
        body.night-mode .badge,
        body.night-mode .tag {
            background: rgba(59, 130, 246, 0.2) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for dropdowns */
        body.night-mode select {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color-scheme: dark;
        }

        body.night-mode select option {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode select option:checked,
        body.night-mode select option:focus,
        body.night-mode select option:hover {
            background: rgba(59, 130, 246, 0.35) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for scrollbars */
        body.night-mode ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2) !important;
        }

        body.night-mode ::-webkit-scrollbar-thumb {
            background: rgba(59, 130, 246, 0.5) !important;
        }

        body.night-mode ::-webkit-scrollbar-thumb:hover {
            background: rgba(59, 130, 246, 0.7) !important;
        }

        /* Dark mode for radio buttons */
        body.night-mode input[type="radio"] {
            accent-color: var(--accent) !important;
        }

        /* Dark mode for disabled elements */
        body.night-mode input:disabled,
        body.night-mode select:disabled,
        body.night-mode textarea:disabled,
        body.night-mode button:disabled {
            opacity: 0.5;
            background: rgba(255, 255, 255, 0.05) !important;
        }

        /* Dark mode for placeholders */
        body.night-mode ::placeholder {
            color: var(--text-light) !important;
            opacity: 0.7;
        }

        /* Dark mode for login modal */
        body.night-mode #loginModal {
            background: rgba(0, 0, 0, 0.8) !important;
        }

        /* Dark mode for tooltips */
        body.night-mode [title],
        body.night-mode .tooltip {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for all elements with light backgrounds - catch-all */
        body.night-mode *[style*="background: #f"],
        body.night-mode *[style*="background:#f"],
        body.night-mode *[style*="background: #e"],
        body.night-mode *[style*="background:#e"],
        body.night-mode *[style*="background-color: #f"],
        body.night-mode *[style*="background-color:#f"],
        body.night-mode *[style*="background-color: #e"],
        body.night-mode *[style*="background-color:#e"] {
            background: var(--bg-card) !important;
        }

        /* Dark mode for specific gradient backgrounds */
        body.night-mode *[style*="linear-gradient"][style*="#f"],
        body.night-mode *[style*="linear-gradient"][style*="#e"],
        body.night-mode *[style*="linear-gradient"][style*="white"] {
            background: var(--bg-card) !important;
        }

        /* Dark mode for padding/background combinations */
        body.night-mode div[style*="padding"][style*="background: #"],
        body.night-mode div[style*="padding"][style*="background:#"] {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for table rows and cells */
        body.night-mode tr[style*="background"],
        body.night-mode td[style*="background"],
        body.night-mode th[style*="background"] {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for spans with background colors */
        body.night-mode span[style*="background: #"],
        body.night-mode span[style*="background:#"] {
            background: rgba(59, 130, 246, 0.2) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for buttons with light backgrounds */
        body.night-mode button[style*="background: #"],
        body.night-mode button[style*="background:#"],
        body.night-mode input[type="button"][style*="background"],
        body.night-mode input[type="submit"][style*="background"] {
            background: var(--blue-gradient) !important;
            color: white !important;
        }

        /* Dark mode for specific color codes that appear frequently */
        body.night-mode *[style*="#fafafa"],
        body.night-mode *[style*="#f9fafb"],
        body.night-mode *[style*="#f3f4f6"],
        body.night-mode *[style*="#f0f5ff"],
        body.night-mode *[style*="#f5f5f5"],
        body.night-mode *[style*="#ffffff"],
        body.night-mode *[style*="#fff"],
        body.night-mode *[style*="#e5e7eb"],
        body.night-mode *[style*="#eff6ff"],
        body.night-mode *[style*="#f8fafc"],
        body.night-mode *[style*="#fefce8"],
        body.night-mode *[style*="#ecfdf5"],
        body.night-mode *[style*="#f5f3ff"],
        body.night-mode *[style*="#e8f4f8"],
        body.night-mode *[style*="#fef2f2"] {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for text colors that need to be white */
        body.night-mode *[style*="color: #333"],
        body.night-mode *[style*="color:#333"],
        body.night-mode *[style*="color: #1f"],
        body.night-mode *[style*="color:#1f"],
        body.night-mode *[style*="color: #000"],
        body.night-mode *[style*="color:#000"],
        body.night-mode *[style*="color: black"],
        body.night-mode *[style*="color:black"] {
            color: var(--text-dark) !important;
        }

        /* Dark mode for borders */
        body.night-mode *[style*="border: 1px solid #"],
        body.night-mode *[style*="border:1px solid #"],
        body.night-mode *[style*="border-color: #"],
        body.night-mode *[style*="border-color:#"] {
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        /* Dark mode for specific elements that commonly have light backgrounds */
        body.night-mode .form-group,
        body.night-mode .form-row,
        body.night-mode .content-wrapper,
        body.night-mode main,
        body.night-mode .container,
        body.night-mode .wrapper {
            background: transparent !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for nested divs with inline styles */
        body.night-mode div>div[style*="background"],
        body.night-mode section>div[style*="background"],
        body.night-mode form>div[style*="background"] {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for main content area */
        body.night-mode main,
        body.night-mode #mainContent,
        body.night-mode .main-content {
            background: var(--bg-body) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for all sections */
        body.night-mode section {
            background: transparent !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for content wrappers that don't have explicit dark backgrounds */
        body.night-mode .content-wrapper:not([style*="#234974"]):not([style*="#0F172A"]):not([style*="#1E293B"]):not([style*="#13203d"]):not([style*="#0a1628"]),
        body.night-mode .wrapper:not([style*="#234974"]):not([style*="#0F172A"]):not([style*="#1E293B"]):not([style*="#13203d"]):not([style*="#0a1628"]) {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for two-column layout */
        body.night-mode .two-column-layout {
            background: transparent !important;
        }

        /* Dark mode for person details columns */
        body.night-mode .person-details-column {
            background: var(--bg-card) !important;
            border-color: rgba(59, 130, 246, 0.3) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .person-details-column:hover {
            border-color: var(--brand-blue-light) !important;
            box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2) !important;
        }

        body.night-mode .person-details-column h3 {
            color: var(--brand-blue-light) !important;
            border-bottom-color: var(--brand-blue) !important;
        }

        /* Dark mode for invoice preview */
        body.night-mode .invoice-preview {
            background: var(--bg-card) !important;
            border-color: rgba(59, 130, 246, 0.3) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .invoice-row {
            border-bottom-color: rgba(255, 255, 255, 0.1) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .invoice-row.invoice-section-header {
            color: var(--text-dark) !important;
        }

        body.night-mode .invoice-row.invoice-breakdown {
            color: var(--text-medium) !important;
            border-bottom-color: rgba(255, 255, 255, 0.05) !important;
        }

        body.night-mode .invoice-total {
            color: var(--brand-blue-light) !important;
            border-top-color: var(--brand-blue) !important;
        }

        /* Dark mode for payment modes */
        body.night-mode .payment-modes {
            background: transparent !important;
        }

        body.night-mode .payment-mode {
            background: var(--bg-card) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .payment-mode:hover {
            border-color: var(--brand-blue-light) !important;
            background: rgba(59, 130, 246, 0.1) !important;
        }

        body.night-mode .payment-mode.selected {
            border-color: var(--brand-blue) !important;
            background: rgba(59, 130, 246, 0.2) !important;
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
        }

        body.night-mode .payment-mode strong {
            color: var(--text-dark) !important;
        }

        /* Dark mode for signature box */
        body.night-mode .signature-box {
            background: var(--bg-card) !important;
            border-color: rgba(59, 130, 246, 0.3) !important;
        }

        body.night-mode .signature-canvas {
            background: rgba(255, 255, 255, 0.05) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }

        /* Dark mode for all input types including datetime-local and tel */
        body.night-mode input[type="text"],
        body.night-mode input[type="tel"],
        body.night-mode input[type="email"],
        body.night-mode input[type="password"],
        body.night-mode input[type="number"],
        body.night-mode input[type="date"],
        body.night-mode input[type="datetime-local"],
        body.night-mode input[type="time"],
        body.night-mode input[type="month"],
        body.night-mode input[type="week"],
        body.night-mode input[type="url"],
        body.night-mode input[type="search"] {
            background: rgba(255, 255, 255, 0.05) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }

        body.night-mode input[type="text"]:focus,
        body.night-mode input[type="tel"]:focus,
        body.night-mode input[type="email"]:focus,
        body.night-mode input[type="password"]:focus,
        body.night-mode input[type="number"]:focus,
        body.night-mode input[type="date"]:focus,
        body.night-mode input[type="datetime-local"]:focus,
        body.night-mode input[type="time"]:focus {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: var(--brand-blue-light) !important;
            outline: none !important;
        }

        /* Dark mode for textarea */
        body.night-mode textarea {
            background: rgba(255, 255, 255, 0.05) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }

        body.night-mode textarea:focus {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: var(--brand-blue-light) !important;
            outline: none !important;
        }

        /* Dark mode for elements with data-original-style (tracked by JavaScript) */
        body.night-mode [data-original-style] {
            color: var(--text-dark) !important;
        }

        body.night-mode [data-original-style*="color: #234974"] {
            color: var(--brand-blue-light) !important;
        }

        body.night-mode [data-original-style*="color: #999"] {
            color: var(--text-light) !important;
        }

        /* Dark mode for status stages */
        body.night-mode .status-stage {
            background: var(--bg-card) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .status-stage.completed {
            background: rgba(34, 197, 94, 0.15) !important;
            border-left-color: #22c55e !important;
            border-color: rgba(34, 197, 94, 0.3) !important;
        }

        body.night-mode .status-stage.pending {
            background: rgba(255, 255, 255, 0.05) !important;
            border-left-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-light) !important;
        }

        /* Dark mode for table headers */
        body.night-mode th {
            background: rgba(59, 130, 246, 0.15) !important;
            color: var(--text-dark) !important;
            border-bottom-color: rgba(255, 255, 255, 0.1) !important;
        }

        body.night-mode td {
            border-bottom-color: rgba(255, 255, 255, 0.1) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode tr:hover td {
            background: rgba(59, 130, 246, 0.1) !important;
        }

        /* Dark mode for line item table */
        body.night-mode .line-item-table {
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        body.night-mode .line-item-table th {
            background: var(--blue-gradient) !important;
            color: white !important;
        }

        body.night-mode .line-item-table input,
        body.night-mode .line-item-table select {
            background: rgba(255, 255, 255, 0.05) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }

        /* Dark mode for page number buttons */
        body.night-mode .page-number-btn {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
        }

        body.night-mode .page-number-btn:hover {
            border-color: var(--brand-blue-light) !important;
        }

        /* Dark mode for file inputs - comprehensive styling */
        body.night-mode input[type="file"] {
            color: var(--text-dark) !important;
            background: rgba(255, 255, 255, 0.05) !important;
            border: 1px solid rgba(255, 255, 255, 0.2) !important;
            border-radius: 4px !important;
            padding: 8px !important;
            cursor: pointer !important;
            width: 100% !important;
        }

        body.night-mode input[type="file"]:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: var(--brand-blue-light) !important;
        }

        body.night-mode input[type="file"]:focus {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: var(--brand-blue-light) !important;
            outline: 2px solid rgba(59, 130, 246, 0.3) !important;
            outline-offset: 2px !important;
        }

        /* File selector button styling */
        body.night-mode input[type="file"]::file-selector-button {
            background: var(--blue-gradient) !important;
            color: white !important;
            border: none !important;
            padding: 8px 16px !important;
            border-radius: 4px !important;
            cursor: pointer !important;
            margin-right: 12px !important;
            font-weight: 600 !important;
            transition: all 0.2s ease !important;
        }

        body.night-mode input[type="file"]::file-selector-button:hover {
            opacity: 0.9 !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
        }

        body.night-mode input[type="file"]::file-selector-button:active {
            transform: translateY(0) !important;
        }

        /* Webkit file input button (Safari, Chrome) */
        body.night-mode input[type="file"]::-webkit-file-upload-button {
            background: var(--blue-gradient) !important;
            color: white !important;
            border: none !important;
            padding: 8px 16px !important;
            border-radius: 4px !important;
            cursor: pointer !important;
            margin-right: 12px !important;
            font-weight: 600 !important;
            transition: all 0.2s ease !important;
        }

        body.night-mode input[type="file"]::-webkit-file-upload-button:hover {
            opacity: 0.9 !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
        }

        /* File input text area */
        body.night-mode input[type="file"]::before {
            color: var(--text-dark) !important;
        }

        /* File input with inline styles */
        body.night-mode input[type="file"][style*="padding"],
        body.night-mode input[type="file"][style*="border"],
        body.night-mode input[type="file"][style*="background"] {
            background: rgba(255, 255, 255, 0.05) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-dark) !important;
        }

        /* File input labels */
        body.night-mode label:has(+ input[type="file"]),
        body.night-mode label[for*="file"],
        body.night-mode label[for*="File"],
        body.night-mode label[for*="document"],
        body.night-mode label[for*="Document"],
        body.night-mode label[for*="kyc"],
        body.night-mode label[for*="KYC"],
        body.night-mode label[for*="receipt"],
        body.night-mode label[for*="Receipt"],
        body.night-mode label[for*="photo"],
        body.night-mode label[for*="Photo"],
        body.night-mode label[for*="bl"],
        body.night-mode label[for*="BL"] {
            color: var(--text-dark) !important;
        }

        /* Dark mode for photo upload areas */
        body.night-mode .photo-upload {
            background: var(--bg-card) !important;
            border-color: rgba(59, 130, 246, 0.3) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .photo-upload:hover {
            border-color: var(--brand-blue-light) !important;
            background: rgba(59, 130, 246, 0.1) !important;
        }

        /* Dark mode for file upload containers */
        body.night-mode .file-upload,
        body.night-mode .upload-area,
        body.night-mode .dropzone {
            background: var(--bg-card) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: var(--text-dark) !important;
        }

        /* Dark mode for file input wrapper divs */
        body.night-mode div:has(> input[type="file"]),
        body.night-mode .form-group:has(input[type="file"]) {
            color: var(--text-dark) !important;
        }

        /* Dark mode for file input descriptions/text */
        body.night-mode input[type="file"]+span,
        body.night-mode input[type="file"]+div,
        body.night-mode input[type="file"]+p,
        body.night-mode input[type="file"]~small {
            color: var(--text-light) !important;
        }

        /* Dark mode for cost display areas */
        body.night-mode div[style*="background: #f8f9fa"],
        body.night-mode div[style*="background:#f8f9fa"] {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        body.night-mode #lpoInwardUnitCost,
        body.night-mode #lpoInwardTotalCost,
        body.night-mode #lpoTotalDisplay {
            color: var(--text-dark) !important;
        }

        /* Dark mode for Final Mile Live Count */
        body.night-mode .route-group-card {
            border-color: rgba(255, 255, 255, 0.1) !important;
            background: var(--bg-card) !important;
        }

        body.night-mode .route-header {
            background: var(--blue-gradient) !important;
        }

        body.night-mode .route-cargo-list {
            background: var(--bg-card) !important;
        }

        body.night-mode .cargo-card {
            background: rgba(255, 255, 255, 0.05) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
            color: var(--text-dark) !important;
        }

        body.night-mode .cargo-card strong {
            color: var(--text-dark) !important;
        }

        body.night-mode #fmLiveCountSummary {
            background: var(--bg-card) !important;
            color: var(--text-dark) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }

        body.night-mode .fmLiveCountEmpty {
            background: var(--bg-card) !important;
            color: var(--text-light) !important;
        }

        /* ================================================================
           DAY MODE - WARM BEIGE THEME
           Activated when body does NOT have .night-mode class.
           Palette: Warm Linen + Burnt Orange accent + Royal Blue text
           ================================================================ */
        body:not(.night-mode) {
            --bg-body:          #F5EDE3;
            --bg-card:          #FFFBF5;
            --bg-card-hover:    #F0E6D8;
            --bg-header:        #FFFBF5;
            --bg-input:         #FFFFFF;
            --bg-input-focus:   #FFFDF8;

            --accent:           #D4650B;
            --accent-light:     #E8780A;
            --accent-gradient:  linear-gradient(135deg, #D4650B 0%, #E89030 100%);
            --accent-glow:      rgba(212, 101, 11, 0.20);
            --accent-subtle:    rgba(212, 101, 11, 0.08);

            --secondary:        #1E3A5F;
            --secondary-light:  #2A5080;

            --text-primary:     #1C3553;
            --text-secondary:   #5A7085;
            --text-muted:       #8D9EAB;
            --text-on-accent:   #FFFFFF;
            --text-dark:        #1C3553;
            --text-medium:      #5A7085;
            --text-light:       #8D9EAB;

            --border-subtle:    #E8DDD0;
            --border-medium:    #D5C7B5;
            --border-accent:    rgba(212, 101, 11, 0.25);

            --shadow-soft:      0 1px 3px rgba(140, 100, 60, 0.06);
            --shadow-card:      0 1px 4px rgba(140, 100, 60, 0.08);
            --shadow-hover:     0 2px 8px rgba(140, 100, 60, 0.10);
            --shadow-accent:    0 2px 8px rgba(212, 101, 11, 0.15);
            --shadow-sidebar:   2px 0 12px rgba(0, 0, 0, 0.15);

            --success:          #1A8D48;
            --success-light:    #22A858;
            --danger:           #C53030;
            --danger-light:     #E04545;
            --warning:          #C07A0A;
            --warning-light:    #D4920B;

            --brand-blue:       #1E3A5F;
            --brand-blue-light: #2A5080;

            background: var(--bg-body);
            color: var(--text-dark);
        }

        /* Day mode: header */
        body:not(.night-mode) header {
            background: var(--bg-header);
            border-bottom: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-soft);
            backdrop-filter: none;
        }
        body:not(.night-mode) header h1 {
            color: var(--text-primary);
        }

        /* Day mode: cards */
        body:not(.night-mode) .section-header {
            background: var(--bg-card-hover);
            color: var(--text-primary);
            border-color: var(--border-subtle);
            border-left-color: var(--accent);
        }
        body:not(.night-mode) .section-header::before {
            background: var(--accent);
            box-shadow: none;
        }
        body:not(.night-mode) .section-content {
            background: var(--bg-card);
            border-color: var(--border-subtle);
            box-shadow: var(--shadow-card);
        }
        body:not(.night-mode) .section-content:hover {
            box-shadow: var(--shadow-hover);
        }

        /* Day mode: forms — use background-color (NOT shorthand) to preserve
           background-image / background-repeat on selects */
        body:not(.night-mode) input,
        body:not(.night-mode) select,
        body:not(.night-mode) textarea {
            background-color: var(--bg-input);
            color: var(--text-primary);
            border-color: var(--border-medium);
        }
        body:not(.night-mode) input:focus,
        body:not(.night-mode) select:focus,
        body:not(.night-mode) textarea:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px var(--accent-glow);
            background-color: var(--bg-input-focus);
        }
        body:not(.night-mode) label {
            color: var(--text-secondary);
        }

        /* Day mode: tables */
        body:not(.night-mode) table {
            background: var(--bg-card);
            border-color: var(--border-subtle);
            box-shadow: var(--shadow-card);
        }
        body:not(.night-mode) th {
            background: var(--bg-card-hover);
            color: var(--text-secondary);
            border-color: var(--border-subtle);
        }
        body:not(.night-mode) td {
            border-color: var(--border-subtle);
            color: var(--text-primary);
        }
        body:not(.night-mode) tr:hover td {
            background: var(--accent-subtle);
        }
        body:not(.night-mode) .line-item-table th {
            background: var(--accent-gradient);
            color: var(--text-on-accent);
        }

        /* Day mode: tracking number */
        body:not(.night-mode) .tracking-number-section {
            background: linear-gradient(135deg, rgba(212,101,11,0.06) 0%, var(--bg-card) 100%);
            border-color: var(--border-accent);
        }
        body:not(.night-mode) .tracking-number-section input {
            color: var(--accent);
            border-color: var(--border-accent);
            background: rgba(212,101,11,0.04);
        }

        /* Day mode: person details */
        body:not(.night-mode) .person-details-column {
            background: var(--bg-card);
            border-color: var(--border-medium);
        }
        body:not(.night-mode) .person-details-column:hover {
            border-color: var(--accent);
        }
        body:not(.night-mode) .person-details-column h3 {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

        /* Day mode: buttons */
        body:not(.night-mode) .submit-btn {
            background: var(--accent-gradient);
            color: var(--text-on-accent);
            box-shadow: var(--shadow-accent);
        }
        body:not(.night-mode) .add-item-btn {
            background: linear-gradient(135deg, #1A8D48 0%, #22A858 100%);
        }

        /* Day mode: h2 section titles */
        body:not(.night-mode) h2 {
            color: var(--text-primary);
        }
        body:not(.night-mode) section > h2::after {
            background: var(--accent-gradient);
        }

        /* Day mode: invoice preview */
        body:not(.night-mode) .invoice-preview {
            background: var(--bg-card-hover);
            border-color: var(--border-accent);
        }
        body:not(.night-mode) .invoice-total {
            color: var(--accent);
            border-top-color: var(--accent);
        }

        /* Day mode: status stages */
        body:not(.night-mode) .status-stage {
            background: var(--bg-card);
            border-color: var(--border-medium);
        }
        body:not(.night-mode) .status-stage.completed {
            background: rgba(26, 141, 72, 0.06);
            border-color: rgba(26, 141, 72, 0.2);
            border-left-color: var(--success);
        }
        body:not(.night-mode) .status-stage.current {
            background: var(--accent-gradient);
            color: white;
        }

        /* Day mode: payment mode cards */
        body:not(.night-mode) .payment-mode {
            background: var(--bg-card);
            border-color: var(--border-medium);
            color: var(--text-primary);
        }
        body:not(.night-mode) .payment-mode:hover {
            border-color: var(--accent);
            background: var(--accent-subtle);
        }
        body:not(.night-mode) .payment-mode.selected {
            border-color: var(--accent);
            background: var(--accent-subtle);
        }

        /* Day mode: page number buttons */
        body:not(.night-mode) .page-number-btn {
            background: var(--bg-card);
            color: var(--text-primary);
            border-color: var(--border-medium);
        }
        body:not(.night-mode) .page-number-btn.active {
            background: var(--accent-gradient);
            color: white;
            border-color: transparent;
        }

        /* Day mode: profile dropdown → consolidated in DROPDOWN SYSTEM section */

        /* Day mode: scrollbar */
        body:not(.night-mode) ::-webkit-scrollbar-thumb {
            background: var(--border-medium);
        }
        body:not(.night-mode) ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        /* Day mode: container background */
        body:not(.night-mode) .container {
            background: var(--bg-body) !important;
        }

        /* Day Mode: custom checkbox fine-tuning */
        body:not(.night-mode) input[type="checkbox"]:not(#nightModeToggle) {
            border-color: var(--border-medium);
            background: #FFFFFF;
        }
        body:not(.night-mode) input[type="checkbox"]:not(#nightModeToggle):hover {
            border-color: var(--accent);
            background: rgba(212,101,11,0.06);
        }
        body:not(.night-mode) input[type="checkbox"]:not(#nightModeToggle):checked {
            background: var(--accent);
            border-color: var(--accent);
        }
        body:not(.night-mode) .multi-check-item:hover,
        body:not(.night-mode) [id*="BranchFilter"] label:hover,
        body:not(.night-mode) [id*="branchFilter"] label:hover,
        body:not(.night-mode) [id*="TransferGateFilter"] label:hover {
            background: rgba(212,101,11,0.06) !important;
        }

        /* All dropdown & select theming → consolidated in DROPDOWN SYSTEM section below */

        /* Day mode: signature */
        body:not(.night-mode) .signature-box {
            background: var(--bg-card);
            border-color: var(--border-medium);
        }
        body:not(.night-mode) .signature-canvas {
            background: #FFFFFF;
            border-color: var(--border-medium);
        }

        /* Day mode: links */
        body:not(.night-mode) a {
            color: var(--secondary);
        }
        body:not(.night-mode) a:hover {
            color: var(--accent);
        }

        /* Day mode: login modal */
        body:not(.night-mode) #loginModal > div {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
        }
        body:not(.night-mode) #loginModal h2 {
            color: var(--accent);
        }
        body:not(.night-mode) #loginModal button[type="submit"] {
            background: var(--accent-gradient);
        }

        /* Day mode: modals */
        body:not(.night-mode) #cargoOrderModal > div,
        body:not(.night-mode) #awbFinalMileModal > div,
        body:not(.night-mode) #dayBookTransferExpenseModal > div {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
        }

        /* Day mode: status pills use day-appropriate colors */
        body:not(.night-mode) .status-pill.success { background: rgba(26,141,72,0.10); color: #1A8D48; }
        body:not(.night-mode) .status-pill.warning { background: rgba(192,122,10,0.10); color: #A06808; }
        body:not(.night-mode) .status-pill.danger  { background: rgba(197,48,48,0.10); color: #C53030; }
        body:not(.night-mode) .status-pill.info    { background: rgba(30,58,95,0.10); color: #1E3A5F; }

        /* Day mode: stat cards */
        body:not(.night-mode) .stat-card {
            background: var(--bg-card);
            border-color: var(--border-subtle);
            box-shadow: var(--shadow-card);
        }
        body:not(.night-mode) .stat-card .stat-value { color: var(--text-primary); }
        body:not(.night-mode) .stat-card .stat-trend.up { color: var(--success); }

        /* ================================================================
           DAY MODE: SIDEBAR - WARM LINEN THEME
           Overrides the dark navy sidebar with warm beige + orange accents
           ================================================================ */
        body:not(.night-mode) #sidebarNav {
            background: linear-gradient(180deg, #FAF3EA 0%, #F0E6D8 100%) !important;
            color: var(--text-primary) !important;
            box-shadow: 2px 0 12px rgba(140,100,60,0.10) !important;
            border-right: 1px solid var(--border-subtle) !important;
        }
        body:not(.night-mode) #sidebarNav::-webkit-scrollbar-thumb {
            background: var(--border-medium);
        }
        body:not(.night-mode) #sidebarNav::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }
        /* Day sidebar: logo area */
        body:not(.night-mode) #sidebarNav > div:first-child {
            border-bottom-color: var(--border-subtle) !important;
        }
        body:not(.night-mode) #sidebarNav > div:first-child h2,
        body:not(.night-mode) #sidebarNav > div:first-child span {
            color: var(--text-primary) !important;
        }
        /* Day sidebar: category headers */
        body:not(.night-mode) .nav-category-header {
            color: var(--text-secondary) !important;
        }
        body:not(.night-mode) .nav-category-header span {
            color: var(--text-muted) !important;
        }
        /* Day sidebar: nav buttons */
        body:not(.night-mode) #sidebarNav .nav-btn {
            background: rgba(28,53,83,0.04) !important;
            color: var(--text-primary) !important;
            border-left-color: transparent !important;
        }
        body:not(.night-mode) #sidebarNav .nav-btn:hover {
            background: rgba(212,101,11,0.08) !important;
            border-left-color: var(--accent) !important;
            color: var(--accent) !important;
        }
        body:not(.night-mode) #sidebarNav .nav-btn.active {
            background: var(--accent-gradient) !important;
            border-left-color: var(--accent) !important;
            color: #FFFFFF !important;
            box-shadow: 0 2px 8px rgba(212,101,11,0.20) !important;
        }
        /* Day sidebar: details panels */
        body:not(.night-mode) #sidebarNav details > div {
            background: transparent !important;
        }
        /* Day sidebar: footer / version text */
        body:not(.night-mode) #sidebarNav > div:last-child {
            color: var(--text-muted) !important;
            border-top-color: var(--border-subtle) !important;
        }

        /* ========== SIDEBAR - DARK NAVY THEME ========== */
        #sidebarNav {
            position: fixed !important;
            left: 0 !important;
            top: 0 !important;
            width: var(--sidebar-width) !important;
            height: 100vh !important;
            background: var(--navy-gradient) !important;
            color: var(--text-white) !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            z-index: 300 !important;
            padding: 20px 0 !important;
            display: flex !important;
            flex-direction: column !important;
            box-shadow: var(--shadow-sidebar) !important;
            border-right: none !important;
        }

        #sidebarNav::-webkit-scrollbar {
            width: 4px;
        }

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

        #sidebarNav::-webkit-scrollbar-thumb {
            background: var(--accent);
            border-radius: 4px;
        }

        /* Sidebar Logo Area */
        #sidebarNav>div:first-child {
            padding: 10px 24px 30px !important;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
            margin-bottom: 10px;
        }

        /* Navigation Categories */
        .nav-category {
            margin-bottom: 8px;
        }

        #sidebarNav details {
            margin-bottom: 0;
        }

        #sidebarNav details summary {
            cursor: pointer;
            user-select: none;
            list-style: none;
        }

        #sidebarNav details summary::-webkit-details-marker {
            display: none;
        }

        .nav-category-header {
            font-weight: 600 !important;
            font-size: 0.75rem !important;
            text-transform: uppercase !important;
            letter-spacing: 0.1em !important;
            color: var(--sidebar-category) !important;
            padding: 16px 20px 10px !important;
            background: transparent !important;
            display: flex !important;
            align-items: center !important;
        }

        .nav-category-header span {
            font-size: 0.6rem;
            margin-right: 8px;
            opacity: 0.7;
            transition: transform 0.2s ease;
        }

        #sidebarNav details[open] .nav-category-header span {
            transform: rotate(0deg);
        }

        #sidebarNav details:not([open]) .nav-category-header span {
            transform: rotate(-90deg);
        }

        #sidebarNav details>div {
            padding: 0 12px 8px !important;
            background: transparent !important;
        }

        /* Navigation Buttons - Colorful Style */
        #sidebarNav .nav-btn {
            width: 100%;
            text-align: left;
            padding: 12px 16px !important;
            margin-bottom: 4px !important;
            background: rgba(255, 255, 255, 0.05) !important;
            border: none !important;
            border-left: 3px solid transparent !important;
            color: rgba(255, 255, 255, 0.8) !important;
            cursor: pointer;
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
            font-size: 0.875rem !important;
            font-weight: 500 !important;
            font-family: inherit !important;
            transition: all 0.2s ease !important;
            display: flex !important;
            align-items: center !important;
            gap: 12px !important;
            position: relative !important;
        }

        #sidebarNav .nav-btn:hover {
            background: var(--sidebar-hover-bg) !important;
            border-left-color: var(--sidebar-hover-border) !important;
            color: white !important;
            transform: translateX(4px);
        }

        #sidebarNav .nav-btn.active {
            background: var(--sidebar-active-bg) !important;
            border-left-color: var(--accent-light) !important;
            color: var(--text-white) !important;
            font-weight: 600 !important;
            box-shadow: var(--sidebar-active-glow) !important;
        }

        nav {
            display: none;
        }

        /* ========== HEADER ========== */
        header {
            position: fixed;
            top: 0;
            left: var(--sidebar-width);
            right: 0;
            height: var(--header-height);
            background: rgba(17, 28, 50, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 32px;
            z-index: 200;
            box-shadow: 0 1px 0 var(--border-subtle), var(--shadow-soft);
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }

        header h1 {
            font-size: 1.15rem;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
            letter-spacing: -0.01em;
        }

        header span {
            font-size: 0.75rem;
            color: var(--text-muted);
            font-weight: 400;
            letter-spacing: 0.02em;
        }

        /* ========== MAIN CONTAINER ========== */
        .container {
            margin-left: var(--sidebar-width);
            margin-top: var(--header-height);
            padding: 30px;
            min-height: calc(100vh - var(--header-height));
            max-width: none;
            border-radius: 0;
            box-shadow: none;
            border: none;
            background: var(--bg-body);
        }

        /* ========== SECTIONS ========== */
        section {
            display: none;
            animation: fadeInUp 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
        }

        section#collection,
        section.active {
            display: block;
        }

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

        /* Staggered child animation for section content */
        section > .section-header,
        section > .section-content,
        section > .track-search,
        section > table,
        section > h2 {
            animation: fadeInUp 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
        }
        section > *:nth-child(1) { animation-delay: 0s; }
        section > *:nth-child(2) { animation-delay: 0.04s; }
        section > *:nth-child(3) { animation-delay: 0.08s; }
        section > *:nth-child(4) { animation-delay: 0.12s; }
        section > *:nth-child(5) { animation-delay: 0.16s; }
        section > *:nth-child(6) { animation-delay: 0.20s; }
        section > *:nth-child(7) { animation-delay: 0.24s; }
        section > *:nth-child(8) { animation-delay: 0.28s; }
        section > *:nth-child(9) { animation-delay: 0.32s; }
        section > *:nth-child(10) { animation-delay: 0.36s; }
        section > *:nth-child(n+11) { animation-delay: 0.4s; }

        /* ========== TYPOGRAPHY ========== */
        h2 {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0 0 24px 0;
            display: flex;
            align-items: center;
            gap: 14px;
        }

        /* Section page titles get the accent underline */
        section > h2 {
            position: relative;
            padding-bottom: 16px;
        }

        section > h2::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 50px;
            height: 3px;
            background: var(--accent-gradient);
            border-radius: 2px;
        }

        h3 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 0 16px 0;
        }

        /* ========== SECTION HEADERS ========== */
        .section-header {
            background: var(--bg-card-hover);
            color: var(--text-primary);
            padding: 16px 24px;
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
            margin: 28px 0 0 0;
            font-weight: 600;
            font-size: 0.8rem;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            border-left: 3px solid var(--accent);
            border-bottom: 1px solid var(--border-subtle);
            border-top: 1px solid var(--border-subtle);
            border-right: 1px solid var(--border-subtle);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .section-header::before {
            content: '';
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--accent);
            flex-shrink: 0;
        }

        .section-content {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-top: none;
            padding: 28px;
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
            margin-bottom: 24px;
            box-shadow: var(--shadow-card);
        }

        /* ========== FORMS ========== */
        .form-row {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            margin-bottom: 20px;
        }

        .form-group {
            flex: 1 1 220px;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        label {
            margin-bottom: 8px;
            font-weight: 500;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        input,
        select,
        textarea {
            padding: 14px 18px;
            border-radius: var(--radius-md);
            border: 1.5px solid var(--border-medium);
            font-size: 0.9375rem;
            font-family: inherit;
            background-color: var(--bg-input);
            color: var(--text-primary);
            transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
        }

        input:hover,
        select:hover,
        textarea:hover {
            border-color: rgba(255,255,255,0.22);
            background-color: rgba(255,255,255,0.06);
        }

        input:focus,
        select:focus,
        textarea:focus {
            outline: none;
            border-color: var(--accent);
            background-color: var(--bg-input-focus);
            box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 2px rgba(0,0,0,0.1);
        }

        /* Placeholder styling */
        input::placeholder,
        textarea::placeholder {
            color: var(--text-muted);
            opacity: 0.7;
        }

        /* ========== TRACKING NUMBER ========== */
        .tracking-number-section {
            margin-bottom: 32px;
            text-align: center;
            position: relative;
            padding: 28px;
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-accent);
            border-top: 3px solid var(--accent);
        }

        /* Tracking section top accent is handled via border-top */

        .tracking-number-section input {
            font-size: 1.5rem;
            padding: 18px 24px;
            font-weight: 700;
            text-align: center;
            color: var(--accent-light);
            letter-spacing: 0.05em;
            max-width: 450px;
            margin: 0 auto;
            border: 2px solid var(--border-accent);
            background: rgba(232, 67, 10, 0.08);
        }

        .tracking-number-section input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px var(--accent-glow);
        }

        /* ========== TWO COLUMN LAYOUT ========== */
        .two-column-layout {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 28px;
        }

        .person-details-column {
            background: var(--bg-card-hover);
            padding: 28px;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-medium);
            transition: border-color 0.2s ease;
        }

        .person-details-column:hover {
            border-color: var(--accent);
        }

        /* Person column active state */

        .person-details-column h3 {
            color: var(--accent-light);
            border-bottom: 2px solid var(--accent);
            padding-bottom: 14px;
            margin-bottom: 22px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* ========== TABLES ========== */
        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            background: var(--bg-card);
            margin-top: 20px;
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-card);
            border: 1px solid var(--border-subtle);
        }

        th,
        td {
            padding: 16px 18px;
            text-align: left;
            border-bottom: 1px solid var(--border-subtle);
        }

        th {
            background: var(--bg-card-hover);
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-secondary);
            white-space: nowrap;
        }

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

        tr {
            transition: all 0.15s ease;
        }

        tr:hover td {
            background: rgba(232, 67, 10, 0.06);
        }

        /* Zebra stripe for better readability */
        tbody tr:nth-child(even) td {
            background: rgba(255,255,255,0.015);
        }
        tbody tr:nth-child(even):hover td {
            background: rgba(232, 67, 10, 0.06);
        }

        /* ========== LINE ITEM TABLE ========== */
        .line-item-table {
            width: 100%;
            margin-top: 16px;
            border-radius: var(--radius-md);
            overflow: hidden;
            border: 1px solid var(--border-medium);
        }

        .line-item-table th {
            background: var(--accent-gradient);
            color: var(--text-on-accent);
            font-weight: 600;
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 14px 16px;
            white-space: nowrap;
        }

        .line-item-table td {
            padding: 12px 16px;
            vertical-align: middle;
        }

        .line-item-table tbody tr {
            transition: background 0.15s ease;
        }

        .line-item-table tbody tr:hover {
            background: rgba(232, 67, 10, 0.04);
        }

        /* Payment line items: amount input centered, bold, larger (arrows don't obscure value) */
        #paymentLineItemsTable td:nth-child(2) {
            text-align: center;
        }
        #paymentLineItemsTable .payment-amount-input {
            text-align: center !important;
            font-weight: bold;
            font-size: 1.2rem;
        }

        .line-item-table input,
        .line-item-table select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-sm);
            font-size: 0.875rem;
            background: var(--bg-input);
            color: var(--text-primary);
            transition: border-color 0.2s ease;
        }

        .line-item-table input:focus,
        .line-item-table select:focus {
            border-color: var(--accent);
            outline: none;
            box-shadow: 0 0 0 2px var(--accent-glow);
        }

        /* ========== BUTTONS ========== */
        .submit-btn {
            background: var(--accent-gradient);
            color: var(--text-on-accent);
            border: none;
            padding: 16px 32px;
            border-radius: var(--radius-md);
            font-size: 0.95rem;
            cursor: pointer;
            font-weight: 600;
            font-family: inherit;
            transition: all 0.2s ease;
            box-shadow: none;
        }

        .submit-btn:hover {
            filter: brightness(1.08);
        }

        .submit-btn:active {
            filter: brightness(0.95);
        }

        .add-item-btn {
            background: var(--success-gradient);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: var(--radius-md);
            cursor: pointer;
            font-weight: 600;
            font-family: inherit;
            transition: all 0.2s ease;
        }

        .add-item-btn:hover {
            filter: brightness(1.08);
        }

        .remove-item-btn {
            background: var(--danger-gradient);
            color: white;
            border: none;
            padding: 10px 16px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-weight: 600;
            font-size: 0.8rem;
            transition: all 0.2s ease;
        }

        .remove-item-btn:hover {
            filter: brightness(1.1);
        }

        /* Night mode dropdowns → consolidated in DROPDOWN SYSTEM section below */

        .invoice-preview {
            background: var(--bg-card-hover);
            padding: 28px;
            border-radius: var(--radius-lg);
            margin: 24px 0;
            border: 1px solid rgba(245, 158, 11, 0.25);
        }

        .invoice-row {
            display: flex;
            justify-content: space-between;
            padding: 14px 0;
            border-bottom: 1px dashed rgba(245, 158, 11, 0.3);
            font-size: 0.95rem;
            color: var(--text-primary);
        }

        .invoice-row.invoice-section-header {
            font-weight: 600;
            color: var(--text-primary);
            padding-bottom: 6px;
        }

        .invoice-row.invoice-breakdown {
            padding: 6px 0 6px 20px;
            font-size: 0.875rem;
            color: var(--text-secondary);
            border-bottom-color: rgba(245, 158, 11, 0.2);
        }

        .invoice-total {
            font-size: 1.35rem;
            font-weight: 700;
            color: var(--accent-light);
            margin-top: 18px;
            padding-top: 18px;
            border-top: 2px solid var(--accent);
        }

        /* ========== STATUS TRACKER ========== */
        .status-tracker {
            margin-top: 24px;
        }

        .status-stages {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 20px;
            position: relative;
        }

        /* Status stages layout */

        .status-stage {
            display: flex;
            align-items: center;
            padding: 18px 22px;
            border-radius: var(--radius-lg);
            background: var(--bg-card);
            border: 1px solid var(--border-medium);
            border-left: 4px solid var(--border-medium);
            transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
            position: relative;
            z-index: 1;
        }

        .status-stage:hover {
            border-color: var(--accent);
        }

        .status-stage.completed {
            background: rgba(34, 197, 94, 0.08);
            border-left-color: var(--success);
            border-color: rgba(34, 197, 94, 0.25);
        }

        .status-stage.current {
            background: var(--accent-gradient);
            border-left-color: var(--accent);
            color: var(--text-on-accent);
            box-shadow: var(--shadow-accent);
        }

        .status-stage.pending {
            background: var(--bg-card-hover);
            border-left-color: var(--text-muted);
            color: var(--text-muted);
            opacity: 0.7;
        }

        .status-icon {
            width: 36px;
            height: 36px;
            margin-right: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            flex-shrink: 0;
        }

        .status-stage.completed .status-icon {
            background: var(--success);
            color: white;
        }

        .status-stage.current .status-icon {
            background: rgba(255,255,255,0.2);
            color: white;
        }

        .status-stage.pending .status-icon {
            background: var(--bg-card-hover);
            color: var(--text-muted);
        }

        /* ========== PAYMENT MODES ========== */
        .payment-modes {
            display: flex;
            gap: 18px;
            margin-top: 20px;
        }

        .payment-mode {
            flex: 1;
            padding: 24px;
            border: 2px solid var(--border-medium);
            border-radius: var(--radius-lg);
            cursor: pointer;
            text-align: center;
            transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
            background: var(--bg-card);
            color: var(--text-primary);
            position: relative;
            overflow: hidden;
        }

        .payment-mode:hover {
            border-color: var(--accent);
            background: var(--accent-subtle);
        }

        .payment-mode.selected {
            border-color: var(--accent);
            background: var(--accent-subtle);
            box-shadow: var(--shadow-accent);
        }

        .payment-mode.selected::before {
            content: '✓';
            position: absolute;
            top: 8px;
            right: 12px;
            font-size: 0.75rem;
            background: var(--accent);
            color: white;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* ========== SIGNATURE ========== */
        .signature-section {
            margin-top: 32px;
        }

        .signature-box {
            border: 2px solid var(--border-medium);
            border-radius: var(--radius-lg);
            padding: 28px;
            background: var(--bg-card);
        }

        .signature-canvas {
            border: 2px dashed var(--border-medium);
            border-radius: var(--radius-md);
            background: var(--bg-input);
            cursor: crosshair;
        }

        /* ========== PAGINATION ========== */
        .pagination-btn {
            transition: all 0.2s ease;
            border-radius: var(--radius-md) !important;
        }

        .pagination-btn:hover:not(:disabled) {
            background: var(--purple-gradient) !important;
            transform: translateY(-1px);
        }

        .page-number-btn {
            padding: 12px 16px;
            background: var(--bg-card);
            color: var(--text-primary);
            border: 2px solid var(--border-medium);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-weight: 600;
            min-width: 44px;
            transition: all 0.2s ease;
        }

        .page-number-btn:hover {
            border-color: var(--accent);
        }

        .page-number-btn.active {
            background: var(--accent-gradient);
            color: var(--text-on-accent);
            border-color: transparent;
            box-shadow: var(--shadow-accent);
        }

        /* ========== MISC ========== */
        .svg-mockup {
            display: none;
        }

        .photo-upload {
            border: 2px dashed var(--border-medium);
            padding: 32px 24px;
            border-radius: var(--radius-lg);
            text-align: center;
            background: var(--bg-input);
            transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
            color: var(--text-secondary);
            cursor: pointer;
        }

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

        /* Autocomplete suggestions → consolidated in DROPDOWN SYSTEM section */

        .odd-box-dimensions {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
        }

        .odd-box-dimensions input {
            width: 100%;
        }

        .inventory {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .track-search {
            max-width: 500px;
            margin-bottom: 24px;
        }

        .status-info {
            flex: 1;
        }

        .status-date {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* ========== RESPONSIVE ========== */
        @media (max-width: 1024px) {
            .two-column-layout {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 800px) {
            :root {
                --sidebar-width: 0px;
            }

            #sidebarNav {
                transform: translateX(-100%);
            }

            header {
                left: 0;
            }

            .container {
                margin-left: 0;
                padding: 20px;
            }
        }

        /* === HQ & Day Book aligned form grids (theme-consistent) === */
        .hq-filter-card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: var(--shadow-card);
        }
        .hq-filter-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            align-items: flex-end;
        }
        .hq-filter-grid .form-group {
            flex: 1 1 180px;
            min-width: 160px;
        }
        /* Date Range needs more room for two inline inputs */
        .hq-filter-grid .form-group:has(input[type="date"]) {
            flex: 2 1 260px;
            min-width: 240px;
        }
        .hq-filter-grid .form-group label {
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 6px;
            display: block;
            font-size: 0.82rem;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .hq-filter-grid input, .hq-filter-grid select, .hq-filter-grid button[type="button"] {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            font-size: 0.9rem;
            background-color: var(--bg-input);
            color: var(--text-primary);
            height: 42px;
            box-sizing: border-box;
        }
        .hq-filter-grid select {
            background-repeat: no-repeat;
            background-position: right 14px center;
            height: 42px;
        }
        /* Date range inline wrapper: ensure inputs sit side-by-side cleanly */
        .hq-filter-grid .form-group div[style*="grid-template-columns"] {
            display: grid !important;
            grid-template-columns: 1fr auto 1fr !important;
            gap: 8px !important;
            align-items: center !important;
        }
        .hq-filter-grid .form-group div[style*="grid-template-columns"] input[type="date"] {
            height: 42px;
            padding: 8px 10px !important;
            font-size: 0.85rem;
        }

        /* ---- HQ sub-module section headings ---- */
        .hq-submodule h3 {
            color: var(--accent) !important;
            border-bottom-color: var(--accent) !important;
        }

        /* ---- Day mode: HQ ledger filter overrides ----
           Beats inline rgba(59,130,246,0.3) borders */
        body:not(.night-mode) .hq-filter-card {
            background: var(--bg-card);
            border-color: var(--border-subtle);
        }
        body:not(.night-mode) .hq-filter-grid input,
        body:not(.night-mode) .hq-filter-grid select,
        body:not(.night-mode) .hq-filter-grid button[type="button"] {
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            background-color: var(--bg-input) !important;
            color: var(--text-primary) !important;
        }
        body:not(.night-mode) .hq-filter-grid input:focus,
        body:not(.night-mode) .hq-filter-grid select:focus {
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 2px var(--accent-glow) !important;
        }

        /* Day: HQ ledger branch/transfergate filter buttons & panels */
        body:not(.night-mode) .hq-ledger-branch-filter-wrap button,
        body:not(.night-mode) .hq-ledger-transfergate-filter-wrap button {
            background-color: var(--bg-input) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            color: var(--text-primary) !important;
        }
        body:not(.night-mode) .hq-ledger-branch-filter-wrap button:hover,
        body:not(.night-mode) .hq-ledger-transfergate-filter-wrap button:hover {
            border-color: var(--accent) !important;
        }
        body:not(.night-mode) .hq-ledger-branch-filter-wrap div[style*="position: absolute"],
        body:not(.night-mode) .hq-ledger-transfergate-filter-wrap div[style*="position: absolute"] {
            background: #FFFFFF !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            box-shadow: 0 4px 16px rgba(140,100,60,0.12) !important;
        }

        /* Day: HQ summary cards (inline gradient/bg overrides) */
        body:not(.night-mode) .hq-submodule div[style*="background: linear-gradient(135deg, #234974"] {
            background: var(--accent-gradient) !important;
        }
        body:not(.night-mode) .hq-submodule div[style*="background: #e8f4f8"] {
            background: rgba(212,101,11,0.06) !important;
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm);
        }
        body:not(.night-mode) .hq-submodule div[style*="background: #e8f4f8"] div[style*="color: #234974"] {
            color: var(--accent) !important;
        }
        body:not(.night-mode) .hq-submodule div[style*="background: #ffe8e8"] {
            background: rgba(197,48,48,0.06) !important;
            border: 1px solid rgba(197,48,48,0.15);
            border-radius: var(--radius-sm);
        }

        .hq-filter-row2 {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border-subtle);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .hq-filter-row2 .hq-checkbox-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .hq-filter-row2 input[type="checkbox"] {
            /* size/styling inherited from global custom checkbox */
        }

        .daybook-banking-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 16px;
            margin-bottom: 16px;
        }
        .daybook-banking-grid-row2 {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 16px;
            margin-bottom: 16px;
        }
        @media (max-width: 900px) {
            .daybook-banking-grid { grid-template-columns: repeat(2, 1fr); }
            .daybook-banking-grid-row2 { grid-template-columns: 1fr; }
        }
        @media (max-width: 600px) {
            .daybook-banking-grid { grid-template-columns: 1fr; }
            .hq-filter-grid { flex-direction: column; }
            .hq-filter-grid .form-group { flex-basis: 100% !important; min-width: 0 !important; }
        }

        .daybook-wallet-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
        }
        @media (max-width: 900px) { .daybook-wallet-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 500px) { .daybook-wallet-grid { grid-template-columns: 1fr; } }
        .daybook-wallet-card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            padding: 16px;
            box-shadow: var(--shadow-card);
        }
        /* ================================================================
           UNIFORM CUSTOM CHECKBOX & MULTI-SELECT PANELS
           Replaces browser-native checkboxes with a flat, themed design.
           ================================================================ */

        /* --- Custom checkbox base (all checkboxes app-wide) --- */
        input[type="checkbox"]:not(#nightModeToggle) {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            min-width: 18px;
            border: 2px solid var(--border-medium);
            border-radius: 5px;
            background: var(--bg-input);
            cursor: pointer;
            position: relative;
            flex-shrink: 0;
            transition: all 0.15s ease;
            margin: 0;
            vertical-align: middle;
        }
        input[type="checkbox"]:not(#nightModeToggle):hover {
            border-color: var(--accent);
            background: var(--accent-subtle);
        }
        input[type="checkbox"]:not(#nightModeToggle):checked {
            background: var(--accent);
            border-color: var(--accent);
        }
        input[type="checkbox"]:not(#nightModeToggle):checked::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 5px;
            width: 5px;
            height: 9px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
        input[type="checkbox"]:not(#nightModeToggle):focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }
        input[type="checkbox"]:not(#nightModeToggle):disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        input[type="checkbox"]:not(#nightModeToggle):disabled:checked {
            background: var(--text-muted);
            border-color: var(--text-muted);
        }

        /* Night mode checkbox adjustments */
        body.night-mode input[type="checkbox"]:not(#nightModeToggle) {
            border-color: rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.05);
        }
        body.night-mode input[type="checkbox"]:not(#nightModeToggle):hover {
            border-color: var(--accent-light);
            background: rgba(232,67,10,0.10);
        }
        body.night-mode input[type="checkbox"]:not(#nightModeToggle):checked {
            background: var(--accent);
            border-color: var(--accent);
        }

        /* --- Multi-select dropdown panel: uniform item rows --- */
        .multi-check-item,
        [id*="BranchFilter"] label,
        [id*="branchFilter"] label,
        [id*="TransferGateFilter"] label,
        .hq-branch-filter-wrap label,
        .hq-ledger-branch-filter-wrap label,
        .hq-ledger-transfergate-filter-wrap label {
            display: flex !important;
            align-items: center !important;
            gap: 10px !important;
            padding: 7px 10px !important;
            margin: 0 -4px !important;
            border-radius: 6px !important;
            cursor: pointer !important;
            transition: background 0.15s ease !important;
            font-size: 0.88rem !important;
            color: var(--text-primary) !important;
            font-weight: 500 !important;
        }
        .multi-check-item:hover,
        [id*="BranchFilter"] label:hover,
        [id*="branchFilter"] label:hover,
        [id*="TransferGateFilter"] label:hover,
        .hq-branch-filter-wrap label:hover,
        .hq-ledger-branch-filter-wrap label:hover,
        .hq-ledger-transfergate-filter-wrap label:hover {
            background: var(--accent-subtle) !important;
        }

        /* "Select All" style - slightly different weight */
        [id*="BranchFilter"] label:first-child,
        [id*="branchFilter"] label:first-child,
        .hq-branch-filter-wrap label:first-child {
            font-weight: 600 !important;
            padding-bottom: 10px !important;
            margin-bottom: 4px !important;
            border-bottom: 1px solid var(--border-subtle) !important;
        }

        /* --- Dropdown panel itself: uniform appearance --- */
        [id*="BranchFilterPanel"],
        [id*="branchFilterPanel"],
        [id*="BranchFilterDropdown"],
        [id*="TransferGateFilterPanel"] {
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
            padding: 8px !important;
        }
        body:not(.night-mode) [id*="BranchFilterPanel"],
        body:not(.night-mode) [id*="branchFilterPanel"],
        body:not(.night-mode) [id*="BranchFilterDropdown"],
        body:not(.night-mode) [id*="TransferGateFilterPanel"] {
            background: #FFFFFF !important;
            box-shadow: 0 4px 20px rgba(140,100,60,0.12) !important;
        }

        /* --- Role / permission checkboxes (User Management) --- */
        .role-module-checkbox,
        .role-permission-read,
        .role-permission-write,
        .role-permission-delete,
        .role-sector-checkbox,
        .role-branch-checkbox {
            width: 18px !important;
            height: 18px !important;
        }

        body.night-mode .hq-filter-card,
        body.night-mode .daybook-wallet-card { border-color: var(--border-medium) !important; }

        /* Night mode: HQ ledger inline border overrides */
        body.night-mode .hq-filter-grid input,
        body.night-mode .hq-filter-grid select,
        body.night-mode .hq-filter-grid button[type="button"] {
            border-color: var(--border-medium) !important;
            background-color: var(--bg-input) !important;
            color: var(--text-primary) !important;
        }
        body.night-mode .hq-ledger-branch-filter-wrap button,
        body.night-mode .hq-ledger-transfergate-filter-wrap button {
            background-color: var(--bg-input) !important;
            border-color: var(--border-medium) !important;
            color: var(--text-primary) !important;
        }
        body.night-mode .hq-ledger-branch-filter-wrap div[style*="position: absolute"],
        body.night-mode .hq-ledger-transfergate-filter-wrap div[style*="position: absolute"] {
            background: var(--bg-card) !important;
            border-color: rgba(255,255,255,0.15) !important;
            box-shadow: 0 6px 24px rgba(0,0,0,0.4) !important;
        }

        /* === LEGACY #234974 INLINE STYLE OVERRIDES ===
           Catches all old brand-blue inline backgrounds and text colors */
        tr[style*="background: #234974"],
        tr[style*="background:#234974"],
        thead tr[style*="background: #234974"],
        thead tr[style*="background:#234974"] {
            background: var(--bg-card-hover) !important;
            color: var(--text-primary) !important;
        }
        tr[style*="background: #234974"] th,
        tr[style*="background:#234974"] th {
            background: transparent !important;
            color: var(--text-secondary) !important;
            border-color: var(--border-subtle) !important;
        }
        button[style*="background: #234974"],
        button[style*="background:#234974"] {
            background: var(--bg-card-hover) !important;
            color: var(--text-primary) !important;
            border: 1px solid var(--border-medium) !important;
            transition: all 0.2s ease !important;
        }
        button[style*="background: #234974"]:hover,
        button[style*="background:#234974"]:hover {
            background: var(--accent-subtle) !important;
            border-color: var(--accent) !important;
        }
        button[style*="background: #234974"].active,
        button[style*="background:#234974"].active,
        .hq-submodule-btn.active,
        .intl-submodule-btn.active {
            background: var(--accent-gradient) !important;
            color: var(--text-on-accent) !important;
            border-color: var(--accent) !important;
            box-shadow: var(--shadow-accent) !important;
        }
        [style*="color: #234974"],
        [style*="color:#234974"] {
            color: var(--accent-light) !important;
        }
        /* Cancel/secondary buttons */
        button[style*="background: #ddd"],
        button[style*="background:#ddd"],
        button[style*="background: #666"],
        button[style*="background:#666"] {
            background: var(--bg-card-hover) !important;
            color: var(--text-secondary) !important;
            border: 1px solid var(--border-medium) !important;
        }
        button[style*="background: #ddd"]:hover,
        button[style*="background:#ddd"]:hover,
        button[style*="background: #666"]:hover,
        button[style*="background:#666"]:hover {
            background: var(--bg-input-focus) !important;
        }

        /* ================================================================
           COMPREHENSIVE INLINE-STYLE OVERRIDES
           Catches hardcoded colors throughout the HTML body
           ================================================================ */

        /* --- Modals: Force dark theme --- */
        div[style*="background: white"],
        div[style*="background:white"],
        div[style*="background: #fff"],
        div[style*="background:#fff"],
        div[style*="background:#ffffff"] {
            background: var(--bg-card) !important;
            color: var(--text-primary) !important;
            border-color: var(--border-medium) !important;
        }

        /* Modal inner panels */
        div[style*="background: #f9fafb"],
        div[style*="background:#f9fafb"],
        div[style*="background: #f5f5f5"],
        div[style*="background:#f5f5f5"],
        div[style*="background: #f8f9fa"],
        div[style*="background:#f8f9fa"],
        div[style*="background: #fafafa"],
        div[style*="background:#fafafa"],
        div[style*="background-color: #f9fafb"] {
            background: var(--bg-card-hover) !important;
            color: var(--text-primary) !important;
        }

        /* Table header overrides in modals */
        tr[style*="background: #f5f5f5"],
        tr[style*="background:#f5f5f5"],
        tr[style*="background: #e8f4f8"],
        tr[style*="background:#e8f4f8"],
        tr[style*="background: #fafafa"],
        tr[style*="background:#fafafa"] {
            background: var(--bg-card-hover) !important;
            color: var(--text-secondary) !important;
        }
        tr[style*="background: #f5f5f5"] th,
        tr[style*="background:#f5f5f5"] th,
        tr[style*="background: #e8f4f8"] th,
        tr[style*="background:#e8f4f8"] th {
            background: transparent !important;
            color: var(--text-secondary) !important;
        }

        /* Labels and text inside modals */
        label[style*="color: #234974"],
        label[style*="color:#234974"] {
            color: var(--accent-light) !important;
        }

        h2[style*="color: #234974"],
        h2[style*="color:#234974"],
        h4[style*="color: #234974"],
        h4[style*="color:#234974"],
        div[style*="color: #234974"],
        div[style*="color:#234974"],
        span[style*="color: #234974"],
        span[style*="color:#234974"] {
            color: var(--accent-light) !important;
        }

        /* Text color overrides for light-theme remnants */
        [style*="color: #333"],
        [style*="color:#333"] {
            color: var(--text-primary) !important;
        }
        [style*="color: #666"],
        [style*="color:#666"],
        [style*="color: #555"],
        [style*="color:#555"] {
            color: var(--text-secondary) !important;
        }
        [style*="color: #999"],
        [style*="color:#999"],
        [style*="color: #888"],
        [style*="color:#888"] {
            color: var(--text-muted) !important;
        }

        /* Input border overrides */
        input[style*="border: 2px solid #bcd"],
        input[style*="border:2px solid #bcd"],
        input[style*="border: 1px solid #bcd"],
        input[style*="border:1px solid #bcd"],
        input[style*="border: 1px solid #ccc"],
        input[style*="border:1px solid #ccc"],
        select[style*="border: 1px solid #bcd"],
        select[style*="border:1px solid #bcd"],
        select[style*="border: 1px solid #ccc"],
        select[style*="border:1px solid #ccc"],
        textarea[style*="border: 1px solid #ccc"],
        textarea[style*="border:1px solid #ccc"] {
            border-color: var(--border-medium) !important;
            background: var(--bg-input) !important;
            color: var(--text-primary) !important;
        }

        /* Table cell borders in modals */
        td[style*="border: 1px solid #ddd"],
        td[style*="border:1px solid #ddd"],
        th[style*="border: 1px solid #ddd"],
        th[style*="border:1px solid #ddd"] {
            border-color: var(--border-subtle) !important;
        }

        /* Red close buttons - keep them but nicer */
        button[style*="background: #f44336"],
        button[style*="background:#f44336"] {
            background: var(--danger-gradient) !important;
            border: none !important;
            border-radius: var(--radius-sm) !important;
            transition: all 0.2s ease !important;
        }
        button[style*="background: #f44336"]:hover,
        button[style*="background:#f44336"]:hover {
            filter: brightness(1.1) !important;
            transform: scale(1.05) !important;
        }

        /* Green add buttons */
        button[style*="background: #4caf50"],
        button[style*="background:#4caf50"] {
            background: var(--success-gradient) !important;
            border: none !important;
            border-radius: var(--radius-sm) !important;
            transition: all 0.2s ease !important;
        }

        /* Divider lines in modals */
        div[style*="border-top: 1px solid #eee"],
        div[style*="border-top:1px solid #eee"],
        [style*="border-bottom: 1px solid #eee"],
        [style*="border-bottom:1px solid #eee"] {
            border-color: var(--border-subtle) !important;
        }

        /* Profile dropdown dark mode */
        /* Profile dropdown → consolidated in DROPDOWN SYSTEM section */

        /* Login modal dark mode */
        #loginModal > div {
            background: var(--bg-card) !important;
            color: var(--text-primary) !important;
            border: 1px solid var(--border-medium) !important;
        }
        #loginModal h2 {
            color: var(--accent-light) !important;
        }
        #loginModal label {
            color: var(--text-secondary) !important;
        }
        #loginModal input {
            background: var(--bg-input) !important;
            color: var(--text-primary) !important;
            border-color: var(--border-medium) !important;
        }
        #loginModal button[type="submit"] {
            background: var(--accent-gradient) !important;
            box-shadow: var(--shadow-accent) !important;
            border-radius: var(--radius-md) !important;
            transition: all 0.2s ease !important;
        }
        #loginModal button[type="submit"]:hover {
            filter: brightness(1.1) !important;
            transform: translateY(-1px) !important;
        }

        /* Cargo order modal & AWB modals dark mode */
        #cargoOrderModal > div,
        #awbFinalMileModal > div,
        #dayBookTransferExpenseModal > div {
            background: var(--bg-card) !important;
            color: var(--text-primary) !important;
            border: 1px solid var(--border-medium) !important;
        }
        #cargoOrderModal h2,
        #awbFinalMileModal h2,
        #dayBookTransferExpenseModal h2 {
            color: var(--accent-light) !important;
        }

        /* Dest city dropdown → consolidated in DROPDOWN SYSTEM section */

        /* Pagination info text */
        div[style*="color: #666"][id*="Pagination"],
        [id*="PaginationInfo"] {
            color: var(--text-muted) !important;
        }

        /* Payment total display */
        #paymentTotalDisplay {
            background: var(--bg-card-hover) !important;
            color: var(--accent-light) !important;
            border: 1px solid var(--border-accent) !important;
        }

        /* File input styling */
        input[type="file"] {
            padding: 10px !important;
            background: var(--bg-input) !important;
            border: 2px dashed var(--border-medium) !important;
            border-radius: var(--radius-md) !important;
            cursor: pointer !important;
            transition: all 0.2s ease !important;
        }
        input[type="file"]:hover {
            border-color: var(--accent) !important;
            background: var(--accent-subtle) !important;
        }

        /* ================================================================
           UTILITY CLASSES & ENHANCEMENTS
           ================================================================ */

        /* ---- TABLE CELL TAGS / PILLS ----
           Flat tag components for recurring data types in tables.
           Usage: <span class="cell-tag tracking">MKX-001</span> */

        .cell-tag {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 600;
            line-height: 1.4;
            white-space: nowrap;
            vertical-align: middle;
            letter-spacing: 0.01em;
        }

        /* Tracking number: monospace, accent-tinted */
        .cell-tag.tracking {
            font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
            background: var(--accent-subtle);
            color: var(--accent);
            border: 1px solid var(--border-accent);
            font-size: 0.78rem;
            letter-spacing: 0.03em;
        }

        /* Mode: Sea Cargo (blue), Air Cargo (teal), Prime (purple) */
        .cell-tag.mode-sea {
            background: rgba(30, 58, 95, 0.10);
            color: #1E3A5F;
            border: 1px solid rgba(30, 58, 95, 0.20);
        }
        .cell-tag.mode-air {
            background: rgba(14, 165, 197, 0.10);
            color: #0E7490;
            border: 1px solid rgba(14, 165, 197, 0.20);
        }
        .cell-tag.mode-prime {
            background: rgba(124, 58, 237, 0.10);
            color: #6D28D9;
            border: 1px solid rgba(124, 58, 237, 0.20);
        }

        /* Branch: subtle outlined pill */
        .cell-tag.branch {
            background: rgba(100, 116, 139, 0.08);
            color: var(--text-secondary);
            border: 1px solid rgba(100, 116, 139, 0.18);
            font-size: 0.78rem;
        }

        /* Origin / Destination location pill */
        .cell-tag.location {
            background: rgba(212, 101, 11, 0.06);
            color: var(--accent);
            border: 1px solid rgba(212, 101, 11, 0.15);
            font-size: 0.78rem;
        }
        .cell-tag.location::before {
            content: '📍 ';
            font-size: 0.7rem;
        }

        /* Person name: bold with subtle tint */
        .cell-tag.name {
            background: rgba(30, 58, 95, 0.06);
            color: var(--text-primary);
            border: 1px solid rgba(30, 58, 95, 0.12);
            font-weight: 600;
            font-size: 0.8rem;
        }

        /* Payment status: full / partial / unpaid */
        .cell-tag.pay-full {
            background: rgba(22, 163, 74, 0.10);
            color: #15803D;
            border: 1px solid rgba(22, 163, 74, 0.20);
        }
        .cell-tag.pay-partial {
            background: rgba(245, 124, 0, 0.10);
            color: #C05621;
            border: 1px solid rgba(245, 124, 0, 0.20);
        }
        .cell-tag.pay-unpaid {
            background: rgba(220, 38, 38, 0.10);
            color: #B91C1C;
            border: 1px solid rgba(220, 38, 38, 0.20);
        }

        /* Payment mode: Cash / GCash / Bank */
        .cell-tag.pay-mode {
            background: rgba(100, 116, 139, 0.06);
            color: var(--text-secondary);
            border: 1px solid rgba(100, 116, 139, 0.15);
            font-size: 0.75rem;
            font-weight: 500;
        }

        /* Status / exception tags */
        .cell-tag.status-ok {
            background: rgba(22, 163, 74, 0.10);
            color: #15803D;
            border: 1px solid rgba(22, 163, 74, 0.20);
        }
        .cell-tag.status-warn {
            background: rgba(245, 124, 0, 0.10);
            color: #C05621;
            border: 1px solid rgba(245, 124, 0, 0.20);
        }
        .cell-tag.status-error {
            background: rgba(220, 38, 38, 0.10);
            color: #B91C1C;
            border: 1px solid rgba(220, 38, 38, 0.20);
        }

        /* Box count badge */
        .cell-tag.count {
            background: var(--accent-subtle);
            color: var(--accent);
            border: 1px solid var(--border-accent);
            min-width: 28px;
            text-align: center;
            font-weight: 700;
            font-size: 0.82rem;
            border-radius: 8px;
        }

        /* Night mode: adjust tag colors for contrast */
        body.night-mode .cell-tag.mode-sea {
            background: rgba(59, 130, 246, 0.15);
            color: #93C5FD;
            border-color: rgba(59, 130, 246, 0.25);
        }
        body.night-mode .cell-tag.mode-air {
            background: rgba(14, 165, 197, 0.15);
            color: #67E8F9;
            border-color: rgba(14, 165, 197, 0.25);
        }
        body.night-mode .cell-tag.mode-prime {
            background: rgba(124, 58, 237, 0.15);
            color: #C4B5FD;
            border-color: rgba(124, 58, 237, 0.25);
        }
        body.night-mode .cell-tag.branch {
            background: rgba(148, 163, 184, 0.12);
            color: #CBD5E1;
            border-color: rgba(148, 163, 184, 0.20);
        }
        body.night-mode .cell-tag.name {
            background: rgba(148, 163, 184, 0.10);
            color: #E2E8F0;
            border-color: rgba(148, 163, 184, 0.15);
        }
        body.night-mode .cell-tag.pay-full {
            background: rgba(34, 197, 94, 0.15);
            color: #86EFAC;
            border-color: rgba(34, 197, 94, 0.25);
        }
        body.night-mode .cell-tag.pay-partial {
            background: rgba(251, 146, 60, 0.15);
            color: #FDBA74;
            border-color: rgba(251, 146, 60, 0.25);
        }
        body.night-mode .cell-tag.pay-unpaid {
            background: rgba(248, 113, 113, 0.15);
            color: #FCA5A5;
            border-color: rgba(248, 113, 113, 0.25);
        }
        body.night-mode .cell-tag.status-ok {
            background: rgba(34, 197, 94, 0.15);
            color: #86EFAC;
            border-color: rgba(34, 197, 94, 0.25);
        }
        body.night-mode .cell-tag.status-warn {
            background: rgba(251, 146, 60, 0.15);
            color: #FDBA74;
            border-color: rgba(251, 146, 60, 0.25);
        }
        body.night-mode .cell-tag.status-error {
            background: rgba(248, 113, 113, 0.15);
            color: #FCA5A5;
            border-color: rgba(248, 113, 113, 0.25);
        }

        /* Subtle pulse animation for live indicators */
        @keyframes livePulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .live-indicator {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            animation: livePulse 2s ease-in-out infinite;
            box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
        }

        /* Better scrollbar for the main container */
        .container::-webkit-scrollbar {
            width: 6px;
        }
        .container::-webkit-scrollbar-track {
            background: transparent;
        }
        .container::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.1);
            border-radius: 3px;
        }
        .container::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.2);
        }

        /* Invoice preview dark mode enhancement */
        .invoice-preview {
            background: var(--bg-card-hover) !important;
            border-color: rgba(232, 67, 10, 0.2) !important;
        }
        .invoice-preview h4 {
            color: var(--accent-light) !important;
        }

        /* Typography note: section > h2 accent underline is defined in the Typography section above */

        /* Better focus state for all interactive elements */
        button:focus-visible,
        a:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        /* Selection color */
        ::selection {
            background: var(--accent-subtle);
            color: var(--text-primary);
        }

        /* Smooth scroll behavior */
        html {
            scroll-behavior: smooth;
        }

        /* Select arrow → consolidated in DROPDOWN SYSTEM section */

        /* Empty state styling */
        .empty-state {
            text-align: center;
            padding: 48px 24px;
            color: var(--text-muted);
        }
        .empty-state svg,
        .empty-state span[class*="material"] {
            font-size: 3rem;
            opacity: 0.3;
            margin-bottom: 12px;
        }

        /* Link styling */
        a {
            color: var(--secondary-light);
            text-decoration: none;
            transition: color 0.15s ease;
        }
        a:hover {
            color: var(--accent-light);
        }

        /* Tooltip base */
        [data-tooltip] {
            position: relative;
            cursor: help;
        }
        [data-tooltip]::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(-4px);
            background: var(--bg-card);
            color: var(--text-primary);
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s, transform 0.2s;
            border: 1px solid var(--border-medium);
            box-shadow: var(--shadow-card);
            z-index: 1000;
        }
        [data-tooltip]:hover::after {
            opacity: 1;
            transform: translateX(-50%) translateY(-8px);
        }

        /* Number badge (for sidebar notification count, etc.) */
        .badge-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 20px;
            height: 20px;
            padding: 0 6px;
            border-radius: 10px;
            background: var(--accent);
            color: white;
            font-size: 0.7rem;
            font-weight: 700;
        }

        /* Status pill badges */
        .status-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .status-pill.success {
            background: rgba(34, 197, 94, 0.15);
            color: var(--success-light);
        }
        .status-pill.warning {
            background: rgba(245, 158, 11, 0.15);
            color: var(--warning-light);
        }
        .status-pill.danger {
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger-light);
        }
        .status-pill.info {
            background: rgba(59, 130, 246, 0.15);
            color: var(--secondary-light);
        }
        .status-pill.neutral {
            background: rgba(148, 163, 184, 0.15);
            color: var(--text-secondary);
        }

        /* Stat cards (can be used in Directors Dashboard, etc.) */
        .stat-card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            padding: 20px;
            box-shadow: var(--shadow-card);
            transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
        }
        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-hover);
            border-color: var(--accent);
        }
        .stat-card .stat-value {
            font-size: 1.75rem;
            font-weight: 800;
            color: var(--text-primary);
            margin: 8px 0 4px;
        }
        .stat-card .stat-label {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
        }
        .stat-card .stat-trend {
            font-size: 0.8rem;
            font-weight: 600;
        }
        .stat-card .stat-trend.up {
            color: var(--success);
        }
        .stat-card .stat-trend.down {
            color: var(--danger);
        }

        /* ================================================================
           UI CONSISTENCY PATCH – Feb 2026 (v2)
           Fixes: Directors Dashboard header overlap, tab buttons via
           classes, User/Barcode module containers, forms, selects,
           autofill. CSS + minimal JS class toggles (no data changes).
           ================================================================ */

        /* ── 0. DIRECTORS DASHBOARD – FIX HEADER OVERLAP ──────
           The <header class="dir-dash-header"> inside the dashboard
           section inherits global `header { position: fixed }`.
           Reset it so it flows normally within its section. */
        .dir-dash-header,
        #directors-dashboard header,
        .dir-dash-section header {
            position: static !important;
            top: auto !important;
            left: auto !important;
            right: auto !important;
            height: auto !important;
            width: auto !important;
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            z-index: auto !important;
            box-shadow: none !important;
            border-bottom: 1px solid var(--border-medium) !important;
            display: block !important;
            padding: 0 0 20px 0 !important;
            margin-bottom: 24px !important;
        }
        .dir-dash-title {
            font-size: 1.5rem !important;
            font-weight: 700 !important;
            color: var(--text-primary) !important;
            margin: 0 0 8px 0 !important;
        }
        .dir-dash-subtitle {
            color: var(--text-muted) !important;
            font-size: 0.88rem !important;
            margin: 0 !important;
        }

        /* ── 1. TAB BUTTONS (class-driven) ────────────────────
           JS now toggles .mkx-tab-active / .mkx-tab-inactive
           and clears inline background so these classes win. */
        #rolesTabBtn, #usersTabBtn,
        #barcodeGenTabBtn, #barcodeLedgerTabBtn {
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
            padding: 12px 28px !important;
            font-size: 0.9rem !important;
            font-weight: 600 !important;
            font-family: inherit !important;
            cursor: pointer !important;
            transition: all 0.2s ease !important;
        }
        /* Active tab */
        .mkx-tab-active,
        #rolesTabBtn.mkx-tab-active,
        #usersTabBtn.mkx-tab-active,
        #barcodeGenTabBtn.mkx-tab-active,
        #barcodeLedgerTabBtn.mkx-tab-active {
            background: var(--accent-gradient) !important;
            color: var(--text-on-accent) !important;
            border-color: var(--accent) !important;
            border-bottom-color: var(--accent) !important;
            box-shadow: var(--shadow-accent) !important;
        }
        /* Inactive tab */
        .mkx-tab-inactive,
        #rolesTabBtn.mkx-tab-inactive,
        #usersTabBtn.mkx-tab-inactive,
        #barcodeGenTabBtn.mkx-tab-inactive,
        #barcodeLedgerTabBtn.mkx-tab-inactive {
            background: var(--bg-card-hover) !important;
            color: var(--text-secondary) !important;
            border-color: var(--border-medium) !important;
            border-bottom-color: transparent !important;
            box-shadow: none !important;
        }
        .mkx-tab-inactive:hover {
            background: var(--accent-subtle) !important;
            color: var(--text-primary) !important;
            border-bottom-color: var(--accent) !important;
        }
        /* Tab container bar */
        #users > h2 ~ div[style*="border-bottom"],
        #barcode-management > h2 ~ div[style*="border-bottom"] {
            border-bottom-color: var(--border-medium) !important;
            margin-bottom: 24px !important;
        }
        /* Fallback: initial page load before JS runs (inline #234974 / #666) */
        #rolesTabBtn[style*="background"],
        #usersTabBtn[style*="background"],
        #barcodeGenTabBtn[style*="background"],
        #barcodeLedgerTabBtn[style*="background"] {
            background: var(--bg-card-hover) !important;
            color: var(--text-secondary) !important;
        }

        /* ── 2. SECTION SUB-HEADERS (h3/h4 inline #234974) ─── */
        section h3[style*="color"],
        section h4[style*="color"] {
            color: var(--accent-light) !important;
            border-bottom-color: var(--accent) !important;
        }

        /* ── 3. FORM CARD PANELS (#fafafa backgrounds) ──────── */
        #users div[style*="background: #fafafa"],
        #users div[style*="background:#fafafa"],
        #barcode-management div[style*="background: #fafafa"],
        #barcode-management div[style*="background:#fafafa"] {
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-md) !important;
            padding: 24px !important;
        }

        /* ── 4. INPUTS & SELECTS with inline #bcd / #ccc ───── */
        input[style*="border"][style*="#bcd"],
        input[style*="border"][style*="#ccc"],
        select[style*="border"][style*="#bcd"],
        select[style*="border"][style*="#ccc"],
        textarea[style*="border"][style*="#ccc"] {
            padding: 12px 16px !important;
            border: 1.5px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            background-color: var(--bg-input) !important;
            color: var(--text-primary) !important;
            font-size: 0.9rem !important;
            font-family: inherit !important;
            transition: all 0.25s ease !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        input[style*="border"][style*="#bcd"]:focus,
        select[style*="border"][style*="#bcd"]:focus,
        textarea[style*="border"][style*="#ccc"]:focus {
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 3px var(--accent-glow) !important;
            background-color: var(--bg-input-focus) !important;
            outline: none !important;
        }

        /* ── 5. SELECT / DROPDOWN POLISH ───────────────────── */
        select {
            appearance: none !important;
            -webkit-appearance: none !important;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
            background-repeat: no-repeat !important;
            background-position: right 14px center !important;
            background-size: 12px !important;
            padding-right: 38px !important;
            cursor: pointer !important;
        }
        select option {
            background: var(--bg-card) !important;
            color: var(--text-primary) !important;
            padding: 10px 14px !important;
        }
        select optgroup {
            background: var(--bg-card) !important;
            color: var(--text-secondary) !important;
            font-weight: 600 !important;
            font-style: normal !important;
        }

        /* ── 6. AUTOFILL / AUTOCOMPLETE ────────────────────── */
        input:-webkit-autofill,
        input:-webkit-autofill:hover,
        input:-webkit-autofill:focus,
        select:-webkit-autofill {
            -webkit-text-fill-color: var(--text-primary) !important;
            -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
            box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
            border-color: var(--border-medium) !important;
            transition: background-color 5000s ease-in-out 0s !important;
        }
        input::-webkit-calendar-picker-indicator {
            filter: invert(0.7) !important;
            cursor: pointer !important;
        }
        .autocomplete-suggestions {
            position: absolute !important;
            top: 100% !important;
            left: 0 !important;
            right: 0 !important;
            z-index: 10001 !important;
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
            box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
            max-height: 260px !important;
            overflow-y: auto !important;
        }
        .autocomplete-suggestion {
            padding: 10px 16px !important;
            cursor: pointer !important;
            font-size: 0.875rem !important;
            color: var(--text-primary) !important;
            border-bottom: 1px solid var(--border-subtle) !important;
            transition: background 0.15s ease !important;
        }
        .autocomplete-suggestion:last-child { border-bottom: none !important; }
        .autocomplete-suggestion:hover,
        .autocomplete-suggestion.highlighted {
            background: var(--accent-subtle) !important;
            color: var(--accent-light) !important;
        }
        .autocomplete-suggestion strong { color: var(--accent-light) !important; }
        .autocomplete-suggestion small { color: var(--text-muted) !important; }

        /* ── 7. HELPER TEXT ─────────────────────────────────── */
        small[style*="color: #666"],
        small[style*="color:#666"] {
            color: var(--text-muted) !important;
        }

        /* ── 8. USER MODULE – layout & containers ──────────── */
        #users {
            max-width: 100% !important;
            overflow-x: hidden !important;
        }
        #users .users-submodule {
            max-width: 100% !important;
            overflow: hidden !important;
        }
        /* All forms inside Users must respect container */
        #users form,
        #users form[style*="max-width"] {
            max-width: 100% !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        /* Form rows */
        #users .form-row,
        #users div[class="form-row"],
        #users .form-row[style] {
            display: flex !important;
            flex-wrap: wrap !important;
            gap: 16px !important;
            margin-bottom: 16px !important;
        }
        /* Form groups – prevent min-width overflow */
        #users .form-group,
        #users .form-group[style] {
            flex: 1 1 240px !important;
            min-width: 0 !important;
            max-width: 100% !important;
        }
        /* Labels inside Users module */
        #users label[style*="font-weight"] {
            font-weight: 600 !important;
            font-size: 0.82rem !important;
            color: var(--text-secondary) !important;
            text-transform: uppercase !important;
            letter-spacing: 0.04em !important;
            margin-bottom: 8px !important;
        }
        /* Section label headings (Module Permissions, Branch/Sector) */
        #users label[style*="font-size: 1.1rem"] {
            font-size: 0.95rem !important;
            font-weight: 700 !important;
            color: var(--text-primary) !important;
            text-transform: none !important;
            letter-spacing: 0 !important;
        }
        /* Module permissions grid */
        #roleModulesPermissions,
        #roleModulesPermissions[style] {
            display: grid !important;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
            gap: 12px !important;
            max-width: 100% !important;
        }
        #roleModulesPermissions > div {
            background: var(--bg-card-hover) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            padding: 14px !important;
            transition: border-color 0.2s ease !important;
        }
        #roleModulesPermissions > div:hover {
            border-color: var(--accent) !important;
        }
        /* Restriction options */
        #roleRestrictionOptions {
            max-width: 100% !important;
        }
        /* Users table */
        #usersTable,
        #usersTable[style] {
            border-collapse: separate !important;
            border-spacing: 0 !important;
            border-radius: var(--radius-md) !important;
            overflow: hidden !important;
            width: 100% !important;
            table-layout: auto !important;
            border: 1px solid var(--border-medium) !important;
        }
        #usersTable thead tr,
        #usersTable thead tr[style] {
            background: var(--bg-card-hover) !important;
        }
        #usersTable th,
        #usersTable th[style] {
            background: var(--bg-card-hover) !important;
            color: var(--text-secondary) !important;
            font-size: 0.75rem !important;
            text-transform: uppercase !important;
            letter-spacing: 0.05em !important;
            font-weight: 600 !important;
            padding: 14px 14px !important;
            border: none !important;
            border-bottom: 2px solid var(--border-medium) !important;
            white-space: nowrap !important;
        }
        #usersTable td,
        #usersTable td[style] {
            padding: 12px 14px !important;
            border: none !important;
            border-bottom: 1px solid var(--border-subtle) !important;
            color: var(--text-primary) !important;
            font-size: 0.85rem !important;
            word-break: break-word !important;
        }
        #usersTable tbody tr:hover td {
            background: var(--accent-subtle) !important;
        }

        /* ── 9. BARCODE MODULE ─────────────────────────────── */
        #barcode-management form,
        #barcode-management form[style] {
            max-width: 100% !important;
            width: 100% !important;
        }
        #barcode-management .form-group,
        #barcode-management .form-group[style] {
            flex: 1 1 220px !important;
            min-width: 0 !important;
            max-width: 100% !important;
        }
        #barcode-management div[style*="background: #e3f2fd"] {
            background: var(--accent-subtle) !important;
            border-color: var(--accent) !important;
            color: var(--text-primary) !important;
            border-radius: var(--radius-sm) !important;
        }
        #barcodePreview {
            color: var(--accent) !important;
            font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace !important;
            font-weight: 600 !important;
        }

        /* ── 10. DIRECTORS DASHBOARD – cards & filters ─────── */
        .dir-dash-section {
            font-family: inherit !important;
        }
        .dir-dash-kpi-card {
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-md) !important;
            padding: 20px !important;
            box-shadow: var(--shadow-card) !important;
            transition: all 0.25s ease !important;
        }
        .dir-dash-kpi-card:hover {
            transform: translateY(-2px) !important;
            box-shadow: var(--shadow-hover) !important;
            border-color: var(--accent) !important;
        }
        .dir-dash-filters {
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-md) !important;
            padding: 18px 20px !important;
            box-shadow: var(--shadow-card) !important;
        }
        .dir-dash-input,
        .dir-dash-select {
            border: 1.5px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            background-color: var(--bg-input) !important;
            color: var(--text-primary) !important;
            font-family: inherit !important;
        }
        .dir-dash-input:focus,
        .dir-dash-select:focus {
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 3px var(--accent-glow) !important;
            outline: none !important;
        }
        .dir-dash-drop-btn {
            border: 1.5px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
            background-color: var(--bg-input) !important;
            color: var(--text-primary) !important;
            cursor: pointer !important;
        }
        .dir-dash-drop-btn:hover {
            border-color: var(--accent) !important;
            background-color: var(--accent-subtle) !important;
        }
        #dir-dash-apply-btn,
        button[id="dir-dash-apply-btn"],
        .dir-dash-apply-btn {
            background: var(--accent-gradient) !important;
            color: var(--text-on-accent) !important;
            border: none !important;
            border-radius: var(--radius-sm) !important;
            font-weight: 600 !important;
            cursor: pointer !important;
            box-shadow: var(--shadow-accent) !important;
        }
        .dir-dash-chart-card {
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-md) !important;
            box-shadow: var(--shadow-card) !important;
        }
        .dir-dash-table-card {
            background: var(--bg-card) !important;
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-md) !important;
            box-shadow: var(--shadow-card) !important;
        }
        .dir-dash-table-wrap {
            border: 1px solid var(--border-medium) !important;
            border-radius: var(--radius-sm) !important;
        }
        .dir-dash-recent-list li {
            border-color: var(--border-subtle) !important;
            color: var(--text-primary) !important;
        }

        /* ── 11. GLOBAL CONTAINER FIT ──────────────────────── */
        section form[style*="max-width"] {
            max-width: 100% !important;
        }
        section .form-group[style*="min-width: 250px"],
        section .form-group[style*="min-width:250px"],
        section .form-group[style*="min-width: 200px"],
        section .form-group[style*="min-width:200px"] {
            min-width: 0 !important;
            flex: 1 1 220px !important;
        }

        /* ── 12. LABEL & BUTTON CONSISTENCY ──────────────── */
        section label[style*="font-weight: bold"] {
            font-weight: 600 !important;
            font-size: 0.82rem !important;
            color: var(--text-secondary) !important;
        }

        /* ── END UI CONSISTENCY PATCH v2 ── */



/* ----- Directors Dashboard (extracted from inline) ----- */

                /* Directors Dashboard – layout and visuals (Claude-style) */
                .dir-dash-section { background: var(--dir-dash-bg, #f5f5f4); min-height: 100%; }
                .dir-dash-root { max-width: 1400px; margin: 0 auto; padding: 28px 24px 40px; box-sizing: border-box; }
                .dir-dash-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--dir-dash-border, rgba(0,0,0,0.08)); }
                .dir-dash-title { margin: 0 0 8px 0; font-size: 1.5rem; font-weight: 600; color: var(--dir-dash-title, #1e293b); letter-spacing: -0.02em; }
                .dir-dash-subtitle { margin: 0; font-size: 0.9rem; color: var(--dir-dash-muted, #64748b); line-height: 1.45; max-width: 56ch; }
                .dir-dash-filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-bottom: 16px; padding: 16px 20px; background: var(--bg-card, #fff); border: 1px solid var(--border-medium, rgba(0,0,0,0.08)); border-radius: 12px; box-sizing: border-box; }
                .dir-dash-filter-item { display: flex; flex-direction: column; gap: 4px; }
                .dir-dash-filter-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary, #64748b); text-transform: uppercase; letter-spacing: 0.04em; }
                .dir-dash-input, .dir-dash-select { width: 100%; min-width: 130px; max-width: 180px; padding: 10px 12px; height: 42px; box-sizing: border-box; border: 1px solid var(--border-medium, rgba(0,0,0,0.1)); border-radius: 8px; font-size: 0.875rem; background: var(--bg-input, #fff); color: var(--text-primary, #1e293b); font-family: inherit; }
                .dir-dash-input:focus, .dir-dash-select:focus { border-color: var(--accent, #234974); outline: none; box-shadow: 0 0 0 2px var(--accent-glow, rgba(35,73,116,0.2)); }
                .dir-dash-drop-wrap { position: relative; }
                .dir-dash-drop-btn { min-width: 140px; max-width: 200px; padding: 10px 32px 10px 12px; height: 42px; box-sizing: border-box; border: 1px solid var(--border-medium, rgba(0,0,0,0.1)); border-radius: 8px; font-size: 0.875rem; background: var(--bg-input, #fff); color: var(--text-primary, #1e293b); font-family: inherit; text-align: left; cursor: pointer; }
                .dir-dash-drop-btn:hover { border-color: var(--accent, #234974); }
                .dir-dash-drop-panel { position: absolute; top: 100%; left: 0; margin-top: 6px; min-width: 200px; max-height: 260px; overflow-y: auto; padding: 8px; background: var(--bg-card, #fff); border: 1px solid var(--border-medium, rgba(0,0,0,0.1)); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); z-index: 200; }
                .dir-dash-drop-panel label { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 0 -4px; border-radius: 6px; cursor: pointer; font-size: 0.88rem; color: var(--text-primary); font-weight: 500; }
                .dir-dash-drop-panel label:hover { background: var(--accent-subtle, rgba(35,73,116,0.08)); }
                .dir-dash-apply-btn { padding: 10px 20px; height: 42px; background: var(--accent-gradient, linear-gradient(135deg, #234974 0%, #1e3a5f 100%)); color: var(--text-on-accent, #fff); border: none; border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; font-family: inherit; }
                .dir-dash-apply-btn:hover { filter: brightness(1.08); }
                .dir-dash-scope-p { font-size: 0.8rem; color: var(--dir-dash-muted, #64748b); margin: 0 0 20px 0; }
                .dir-dash-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 28px; }
                @media (max-width: 1100px) { .dir-dash-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
                @media (max-width: 560px) { .dir-dash-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
                .dir-dash-kpi-card { padding: 20px 16px; text-align: center; border-radius: 12px; border: 1px solid var(--dir-dash-border, rgba(0,0,0,0.08)); background: var(--bg-card, #fff); box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: box-shadow 0.2s ease; }
                .dir-dash-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
                .dir-dash-kpi-value { font-size: 1.35rem; font-weight: 700; color: var(--text-primary, #1e293b); letter-spacing: -0.02em; }
                .dir-dash-kpi-income { color: #16a34a; }
                .dir-dash-kpi-boxes { color: #234974; }
                .dir-dash-kpi-new { color: #e8430a; }
                .dir-dash-kpi-repeat { color: #3b82f6; }
                .dir-dash-kpi-empty { color: #7c3aed; }
                .dir-dash-kpi-label { font-size: 0.7rem; color: var(--dir-dash-muted, #64748b); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 4px; }
                .dir-dash-charts-row { display: grid; gap: 20px; margin-bottom: 24px; }
                .dir-dash-charts-row-1 { grid-template-columns: repeat(3, 1fr); }
                @media (max-width: 1000px) { .dir-dash-charts-row-1 { grid-template-columns: 1fr; } }
                .dir-dash-charts-row-2 { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
                @media (max-width: 900px) { .dir-dash-charts-row-2 { grid-template-columns: 1fr; } }
                .dir-dash-chart-card { background: var(--bg-card, #fff); border: 1px solid var(--dir-dash-border, rgba(0,0,0,0.08)); border-radius: 14px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
                .dir-dash-chart-card-mode { grid-column: span 2; }
                @media (max-width: 900px) { .dir-dash-chart-card-mode { grid-column: span 1; } }
                .dir-dash-chart-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary, #1e293b); margin-bottom: 4px; }
                .dir-dash-chart-sub { font-size: 0.75rem; color: var(--dir-dash-muted, #64748b); margin-bottom: 14px; }
                .dir-dash-chart-body { min-height: 200px; padding: 10px 0; }
                .dir-dash-chart-body-flex { display: flex; flex-direction: column; align-items: stretch; }
                .dir-dash-mode-select-wrap { margin-bottom: 12px; }
                .dir-dash-mode-select-wrap .dir-dash-select { min-width: 160px; max-width: 200px; }
                #dir-dash-root .dir-dash-line-wrap { position: relative; width: 100%; height: 180px; }
                #dir-dash-root .dir-dash-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; min-height: 200px; }
                #dir-dash-root .dir-dash-donut-ring { border-radius: 50%; }
                .dir-dash-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 0.75rem; color: var(--dir-dash-muted, #64748b); }
                .dir-dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
                .dir-dash-legend .dot { width: 10px; height: 10px; border-radius: 50%; }
                .dir-dash-tables-section { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
                @media (max-width: 900px) { .dir-dash-tables-section { grid-template-columns: 1fr; } }
                .dir-dash-tables-col { display: flex; flex-direction: column; gap: 20px; }
                .dir-dash-table-card { background: var(--bg-card, #fff); border: 1px solid var(--dir-dash-border, rgba(0,0,0,0.08)); border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
                .dir-dash-table-title { margin: 0 0 12px 0; font-size: 0.95rem; font-weight: 600; color: var(--text-primary, #1e293b); }
                .dir-dash-table-wrap { overflow: auto; max-height: 320px; border-radius: 8px; border: 1px solid var(--dir-dash-border, rgba(0,0,0,0.06)); }
                .dir-dash-table-wrap .line-item-table { margin: 0; width: 100%; }
                .dir-dash-recent-card .dir-dash-recent-list { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; max-height: 280px; overflow-y: auto; }
                .dir-dash-recent-list li { padding: 12px 0; border-bottom: 1px solid var(--dir-dash-border, rgba(0,0,0,0.08)); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
                .dir-dash-recent-list li:last-child { border-bottom: none; }
                .dir-dash-recent-list .num.negative { color: var(--danger, #dc2626); }
                body.night-mode .dir-dash-section { --dir-dash-bg: var(--bg-body); --dir-dash-border: var(--border-medium); --dir-dash-title: var(--text-primary); --dir-dash-muted: var(--text-secondary); }
                body.night-mode .dir-dash-filters { background: var(--bg-card); border-color: var(--border-medium); }
                body.night-mode .dir-dash-input, body.night-mode .dir-dash-drop-btn, body.night-mode .dir-dash-select { background: var(--bg-input); border-color: var(--border-medium); color: var(--text-primary); }
                body.night-mode .dir-dash-drop-panel { background: var(--bg-card); border-color: var(--border-medium); box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
                body.night-mode .dir-dash-filter-label { color: var(--text-secondary); }
                body.night-mode .dir-dash-kpi-card, body.night-mode .dir-dash-chart-card, body.night-mode .dir-dash-table-card { background: var(--bg-card); border-color: var(--border-medium); }
                body.night-mode .dir-dash-chart-title, body.night-mode .dir-dash-table-title { color: var(--text-primary); }
                body.night-mode .dir-dash-chart-sub, body.night-mode .dir-dash-kpi-label, body.night-mode .dir-dash-legend { color: var(--text-secondary); }
                body.night-mode .dir-dash-table-wrap { border-color: var(--border-medium); }
                body.night-mode .dir-dash-recent-list li { border-color: var(--border-medium); }
