:root {
            /* DJP Online Theme Palette */
            --primary: #1A3166;
            /* Deep Blue from DJP NavBar */
            --primary-dark: #11224D;
            --secondary: #2C3E50;
            --accent: #FBC02D;
            /* Golden Yellow from Banner/Table Header */
            --accent-light: #FFF0C1;
            /* Lighter yellow for hover/subtle backgrounds */

            --bg-body: #F4F6F9;
            /* Softer gray background */
            --bg-card: #FFFFFF;
            --bg-sidebar: #1A3166;
            /* Matching primary blue */

            --text-main: #333333;
            --text-muted: #555555;
            --text-light: #F8F9FA;

            --border: #E0E0E0;
            --input-bg: #FFFFFF;

            --success: #28A745;
            --warning: #FFC107;
            --danger: #DC3545;
            --info: #17A2B8;

            --radius: 6px;
            /* Slightly sharper edges, more professional */
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
            --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
            --transition: all 0.2s ease-in-out;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: var(--bg-body);
            color: var(--text-main);
            line-height: 1.5;
            height: 100vh;
            display: flex;
            overflow: hidden;
            /* For sidebar layout */
        }

        /* Sidebar Styles */
        .sidebar {
            width: 280px;
            background-color: var(--bg-sidebar);
            color: var(--text-light);
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow-y: auto;
            flex-shrink: 0;
            box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
            transition: var(--transition);
            z-index: 50;
        }

        .sidebar-header {
            padding: 24px;
            background: rgba(255, 255, 255, 0.05);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
            position: relative;
        }

        .logo {
            height: 60px;
            width: auto;
            margin-bottom: 12px;
        }

        .brand-title {
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: white;
            opacity: 0.9;
        }

        .nav-menu {
            padding: 20px 0;
            flex: 1;
        }

        .nav-item {
            padding: 12px 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            color: rgba(255, 255, 255, 0.75);
            transition: var(--transition);
            font-size: 14px;
            font-weight: 500;
            border-left: 3px solid transparent;
        }

        .nav-item:hover {
            background-color: rgba(255, 255, 255, 0.05);
            color: var(--text-light);
        }

        .nav-item.active {
            background-color: rgba(255, 255, 255, 0.1);
            color: white;
            border-left-color: var(--accent);
        }

        .nav-icon {
            font-size: 16px;
            width: 20px;
            text-align: center;
        }

        /* Sidebar Footer Styles */
        .sidebar-footer {
            margin-top: auto;
            padding: 24px 20px;
            text-align: center;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .developed-by {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: rgba(255, 255, 255, 0.35);
            font-weight: 500;
        }

        .developer-name {
            color: var(--accent);
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.5px;
            cursor: default;
            transition: all 0.3s ease;
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .developer-name::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 0;
            height: 1px;
            background-color: var(--accent);
            transition: width 0.3s ease;
            opacity: 0.5;
        }

        .sidebar-footer:hover .developer-name {
            color: white;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
        }

        .sidebar-footer:hover .developer-name::after {
            width: 100%;
            background-color: white;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
            min-width: 0;
        }

        .top-bar {
            background-color: var(--primary);
            color: white;
            padding: 12px 32px;
            box-shadow: var(--shadow-md);
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 10;
            border-bottom: 4px solid var(--accent);
            /* DJP-style yellow strip */
        }

        .page-title {
            font-size: 18px;
            font-weight: 600;
            color: white;
            letter-spacing: 0.5px;
        }

        .global-actions {
            display: flex;
            gap: 12px;
        }

        .top-bar-main {
            display: flex;
            align-items: center;
            gap: 16px;
            min-width: 0;
        }

        .top-bar-titles {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }

        .page-title.brand {
            opacity: 0.85;
        }

        .page-title.context {
            padding-left: 10px;
            border-left: 1px solid rgba(255, 255, 255, 0.2);
        }

        @media (max-width: 768px) {
            body {
                height: auto;
                min-height: 100vh;
                display: block;
                overflow-y: auto;
                background:
                    linear-gradient(180deg, #dce7f8 0, #dce7f8 88px, var(--bg-body) 88px, var(--bg-body) 100%);
            }

            .main-content {
                width: 100%;
                max-width: 480px;
                margin: 0 auto;
                min-height: 100vh;
                background: #f8fbff;
                box-shadow: 0 0 0 1px rgba(26, 49, 102, 0.06), 0 18px 40px rgba(26, 49, 102, 0.14);
                overflow: visible;
            }

            /* Mobile: body handles scroll, scroll-area expands naturally */
            .scroll-area {
                overflow-y: visible;
                flex: none;
            }

            .top-bar {
                position: sticky;
                top: 0;
                padding-top: calc(12px + env(safe-area-inset-top, 0px));
                z-index: 40;
            }

            .top-bar-titles {
                flex-direction: column;
                align-items: flex-start;
                gap: 6px;
                width: 100%;
            }

            .page-title.brand,
            .page-title.context {
                width: 100%;
                white-space: normal;
            }

            .page-title.brand {
                font-size: 13px;
                line-height: 1.35;
            }

            .page-title.context {
                padding-left: 0;
                border-left: 0;
                font-size: 16px;
            }

            .global-actions {
                display: flex;
                gap: 6px;
                width: 100%;
            }

            .global-actions .btn {
                flex: 1;
                min-width: 0;
                min-height: 40px;
                padding: 6px 4px;
                font-size: 19px;
            }
        }

        @media (max-width: 480px) {
            body {
                background:
                    linear-gradient(180deg, #dce7f8 0, #dce7f8 76px, var(--bg-body) 76px, var(--bg-body) 100%);
            }

            .main-content {
                max-width: 100%;
                box-shadow: none;
                background: var(--bg-body);
                overflow: visible;
            }

            .top-bar {
                padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
                gap: 10px;
            }

            .top-bar-main {
                gap: 10px;
            }

            .top-bar-titles {
                gap: 4px;
            }

            .page-title.brand {
                font-size: 11px;
                opacity: 0.82;
            }

            .page-title.context {
                font-size: 14px;
                line-height: 1.25;
            }

            .global-actions {
                gap: 4px;
            }

            .global-actions .btn {
                min-height: 38px;
                font-size: 17px;
                padding: 4px 2px;
                border-radius: 8px;
                justify-content: center;
            }
        }

        /* ── PWA: Install Button ─────────────────────────────────────── */
        .pwa-install-btn {
            flex-shrink: 0;
            background: rgba(255, 255, 255, 0.15) !important;
            border: 1px solid rgba(255, 255, 255, 0.35) !important;
            color: white !important;
            border-radius: 8px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            animation: pwaFadeIn 0.35s ease;
        }

        .pwa-install-btn:hover {
            background: rgba(255, 255, 255, 0.28) !important;
        }

        @keyframes pwaFadeIn {
            from { opacity: 0; transform: scale(0.85); }
            to   { opacity: 1; transform: scale(1); }
        }

        /* ── PWA: iOS Install Guide (bottom sheet) ───────────────────── */
        .ios-install-guide {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 99999;
            background: rgba(0, 0, 0, 0.55);
            align-items: flex-end;
            justify-content: center;
        }

        .ios-guide-card {
            background: white;
            border-radius: 20px 20px 0 0;
            padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
            width: 100%;
            max-width: 480px;
            position: relative;
            box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
            animation: pwaSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @keyframes pwaSlideUp {
            from { transform: translateY(100%); }
            to   { transform: translateY(0); }
        }

        .ios-guide-close {
            position: absolute;
            top: 12px;
            right: 14px;
            background: #f1f5f9;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            font-size: 13px;
            cursor: pointer;
            color: #64748b;
            display: flex;
            align-items: center;
            justify-content: center;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }

        .ios-guide-icon {
            font-size: 32px;
            text-align: center;
            margin-bottom: 10px;
            line-height: 1;
        }

        .ios-guide-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--primary);
            text-align: center;
            margin: 0 0 6px;
        }

        .ios-guide-desc {
            font-size: 13px;
            color: var(--text-muted);
            text-align: center;
            margin: 0 0 14px;
            line-height: 1.5;
        }

        .ios-guide-steps {
            background: #f8fafc;
            border-radius: 10px;
            padding: 4px 0;
            margin: 0 0 16px;
            list-style: none;
            counter-reset: ios-step;
        }

        .ios-guide-steps li {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            color: var(--text-main);
            padding: 10px 14px;
            border-bottom: 1px solid var(--border);
            counter-increment: ios-step;
        }

        .ios-guide-steps li:last-child {
            border-bottom: none;
        }

        .ios-guide-steps li::before {
            content: counter(ios-step);
            background: var(--primary);
            color: white;
            min-width: 20px;
            height: 20px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            flex-shrink: 0;
        }

        .ios-guide-confirm {
            width: 100%;
            background: var(--primary);
            color: white;
            border: none;
            padding: 13px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }

        .ios-guide-confirm:active {
            opacity: 0.88;
        }

