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

        :root {

            --ink: #0E1B33; --ink-soft: #5C6B8A; --ink-faint: #93A2C2;
            --primary: #2451C4; --primary-dark: #15306B; --primary-soft: #EAF0FC;
            --surface: #F8FAFC; --card: #FFFFFF; --border: #E2E8F0;
            --success: #10B981; --success-soft: #D1FAE5;
            --danger: #EF4444; --danger-soft: #FEE2E2; --accent: #F59E0B; --accent-soft: #FEF3C7;
            --radius-sm: 10px; --radius-md: 16px; --radius-lg: 24px;
            --shadow-sm: 0 4px 12px rgba(14, 27, 51, 0.04); 
            --shadow-md: 0 12px 32px rgba(14, 27, 51, 0.08);
            --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

            /* 💧 Liquid Glass Variables (For Floating UIs Only) */
            --glass-bg: rgba(255, 255, 255, 0.75);
            --glass-blur: blur(24px) saturate(180%);
            --glass-border: 1px solid rgba(255, 255, 255, 0.6);
        
            --drawer-bg: rgba(255, 255, 255, 0.98);
            --bottom-nav-bg: rgba(255, 255, 255, 0.45);
            --bottom-nav-border: 1px solid rgba(255, 255, 255, 0.55);
            --icon-btn-bg: rgba(255, 255, 255, 0.5);
            --drawer-item-border: 1px solid rgba(14, 27, 51, 0.05);
        }

        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }

        body { 
            font-family: var(--font-body); color: var(--ink); background: var(--surface); 
            min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; 
            -webkit-tap-highlight-color: transparent;
        }

        /* ===================== HEADER ===================== */
        .dash-header {
            background: #FFFFFF !important;
            padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border) !important;
            box-shadow: var(--shadow-sm); z-index: 1200; flex-shrink: 0; height: 60px; position: relative;
        }
        .brand { display: flex; align-items: center; gap: 12px; }
        .brand-mark {
            display: flex; align-items: center; justify-content: center;
            border-radius: 10px; box-shadow: 0 4px 10px rgba(36, 81, 196, 0.35);
        }
        .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
        .brand-text .title { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
        .brand-text .live-badge { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--success); }
        .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); position: relative; }
        .live-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid var(--success); opacity: 0.6; animation: liveDotPulse 1.8s ease-out infinite; }
        @keyframes liveDotPulse { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(2.2); opacity: 0; } }
        
        .header-actions { display: flex; align-items: center; gap: 16px; }
        .desktop-nav { display: flex; gap: 6px; }
        .desktop-nav .nav-btn {
            text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-soft);
            padding: 10px 16px; border-radius: 10px; transition: 0.2s; cursor: pointer; display: flex; align-items: center; gap: 8px;
        }
        .desktop-nav .nav-btn:hover { background: var(--primary-soft); color: var(--primary); }
        .desktop-nav .nav-btn.active { background: #FFFFFF; color: var(--primary); box-shadow: 0 4px 12px rgba(36,81,196,0.08); border: 1px solid rgba(36, 81, 196, 0.1); }
        .desktop-nav svg { width: 18px; height: 18px; }

        .icon-btn { background: var(--icon-btn-bg); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--border); transition: all 0.2s ease; position: relative; }
        .icon-btn:hover { background: var(--border); }

        /* ===================== WORKSPACE ===================== */
        .dash-content { flex: 1; padding: 24px; overflow-y: auto; background: transparent; -ms-overflow-style: none; scrollbar-width: none; }
        .dash-content::-webkit-scrollbar { display: none; }

        .main-wrapper { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

        /* TOP STATS */
        .stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

        .compact-stat-card {
            background: var(--card); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border);
            box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .compact-stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-soft); }
        .compact-stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 6px; height: 100%; background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%); }
        .compact-stat-card.green::before { background: linear-gradient(180deg, var(--success) 0%, #059669 100%); }

        .compact-stat-card h4 { font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; font-weight: 700; }
        .compact-stat-card h2 { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: var(--ink); line-height: 1; }
        
        .stat-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); opacity: 0.05; }
        .stat-icon svg { width: 80px; height: 80px; color: var(--primary); }

        /* SECONDARY GRID (Support & Legend) */
        .secondary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

        /* WhatsApp Support Card */
        .support-card {
            background: linear-gradient(135deg, #10B981 0%, #059669 100%);
            padding: 24px; border-radius: var(--radius-lg); display: flex; flex-direction: column; justify-content: center;
            box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25); position: relative; overflow: hidden;
        }
        .support-card::after { content: ''; position: absolute; right: -20px; bottom: -20px; width: 120px; height: 120px; background: rgba(255,255,255,0.1); border-radius: 50%; }
        .support-card h3 { color: #FFF; font-size: 18px; margin-bottom: 6px; font-family: var(--font-display); z-index: 1; }
        .support-card p { color: rgba(255,255,255,0.85); font-size: 13px; margin-bottom: 16px; line-height: 1.4; z-index: 1; }
        
        .support-buttons { display: flex; gap: 12px; flex-wrap: wrap; z-index: 1; position: relative; }
        .wa-btn {
            background: #FFF; color: #059669; text-decoration: none; font-weight: 700; font-size: 13px;
            padding: 10px 16px; border-radius: 100px; display: inline-flex; align-items: center; gap: 8px; flex: 1; justify-content: center; white-space: nowrap;
            transition: transform 0.2s, box-shadow 0.2s, background 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        .wa-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
        .wa-btn.secondary { background: rgba(255,255,255,0.2); color: #FFF; border: 1px solid rgba(255,255,255,0.4); box-shadow: none; }
        .wa-btn.secondary:hover { background: rgba(255,255,255,0.3); }

        /* Map Legend Card */
        .legend-card {
            background: var(--card); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }
        .legend-card h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
        .legend-list { display: flex; flex-direction: column; gap: 12px; }
        .legend-item { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
        .l-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
        .l-dot.moving { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
        .l-dot.idle { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
        .l-dot.inactive { background: #94A3B8; box-shadow: 0 0 0 3px #F1F5F9; }

        /* FOOTER */
        .footer-area {
            text-align: center; margin-top: 20px; padding-top: 24px; border-top: 1px dashed var(--border);
            color: var(--ink-faint); font-size: 12px; font-weight: 500; padding-bottom: 24px;
        }
        .footer-area span { display: block; margin-bottom: 6px; }
        .footer-area b { color: var(--primary); font-weight: 700; }
        .app-version { display: inline-block; background: var(--surface); border: 1px solid var(--border); padding: 4px 10px; border-radius: 100px; font-size: 10px; margin-top: 8px; font-weight: 600; }

        /* ===================== BOTTOM NAV (Desktop Fallback) ===================== */
        .bottom-nav { display: none; }

        /* ===================== MOBILE RESPONSIVE ===================== */
        @media (max-width: 768px) {
            .desktop-nav { display: none !important; }
            .bottom-nav { display: none !important; }
        }
    
        :root.dark-theme {
            --ink: #FFFFFF; --ink-soft: #A1A1AA; --ink-faint: #71717A;
            --surface: #000000; --card: #0D0D11; --border: rgba(255, 255, 255, 0.12);
            --primary-soft: rgba(36, 81, 196, 0.2);
            --danger-soft: rgba(224, 72, 59, 0.15);
            --success-soft: rgba(21, 165, 103, 0.15);
            --accent-soft: rgba(245, 166, 35, 0.15);
            --glass-bg: rgba(0, 0, 0, 0.85); --glass-border: 1px solid rgba(255, 255, 255, 0.12);
            --drawer-bg: rgba(6, 6, 8, 0.96);
            --bottom-nav-bg: rgba(0, 0, 0, 0.65);
            --bottom-nav-border: 1px solid rgba(255, 255, 255, 0.15);
            --icon-btn-bg: rgba(255, 255, 255, 0.08);
            --drawer-item-border: 1px solid rgba(243, 246, 252, 0.05);
        }
    
        .menu-btn-top { display: none !important; }
        .drawer-backdrop {
            position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
            opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 9998;
        }
        .drawer-backdrop.active { opacity: 1; pointer-events: auto; }
        .floating-header-menu {
            position: fixed; top: 0; right: -280px; width: 280px; height: 100%;
            background: var(--drawer-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border-left: 1px solid var(--border); box-shadow: -4px 0 24px rgba(0,0,0,0.15); 
            padding: 24px 16px 80px; z-index: 9999; display: flex; flex-direction: column; gap: 4px;
            transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); overflow-y: auto;
            -ms-overflow-style: none; scrollbar-width: none;
        }
        .floating-header-menu::-webkit-scrollbar { display: none; }
        .floating-header-menu.active { right: 0 !important; }
        .floating-header-menu .menu-item {
            display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px;
            cursor: pointer; transition: all 0.2s; text-decoration: none;
            border-bottom: var(--drawer-item-border);
            margin-bottom: 4px;
        }
        .floating-header-menu .menu-item:hover {
            background: var(--surface);
        }
        .floating-header-menu .menu-icon {
            width: 36px; height: 36px; background: var(--surface); border-radius: 10px;
            display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
            transition: 0.2s; flex-shrink: 0;
        }
        .floating-header-menu .menu-item svg {
            transition: color 0.2s;
        }
        .floating-header-menu .menu-item:hover .menu-icon {
            background: var(--primary-soft); color: var(--primary);
        }
        .floating-header-menu .menu-text {
            flex: 1; font-size: 14px; font-weight: 600; color: var(--ink);
        }
        .floating-header-menu .menu-item.active {
            background: var(--primary-soft);
            border-bottom-color: transparent;
        }
        .floating-header-menu .menu-item.active .menu-icon {
            background: var(--primary); color: white;
        }
        .floating-header-menu .menu-item.active .menu-text {
            color: var(--primary); font-weight: 700;
        }
        
        .floating-header-menu .sub-item {
            padding: 10px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
            background: transparent; border-radius: 8px;
        }
        .floating-header-menu .sub-item:hover {
            background: rgba(14, 27, 51, 0.04); color: var(--ink);
        }
        .floating-header-menu .sub-item.danger-item {
            color: var(--danger);
        }
        .floating-header-menu .sub-item.danger-item:hover {
            background: var(--danger-soft);
        }

        @media (min-width: 769px) { .bottom-nav { display: none !important; } .menu-btn-top { display: none !important; } body { padding-bottom: 20px; } .floating-header-menu { display: none !important; } }
        @media (max-width: 768px) { .desktop-nav { display: none !important; } .menu-btn-top { display: flex !important; } }

    
        /* Premium Dark mode bottom nav overrides */
        .dark-theme .bottom-nav .nav-item {
            color: rgba(255, 255, 255, 0.45) !important;
        }
        .dark-theme .bottom-nav .nav-item.active {
            color: #FFFFFF !important;
        }
        .dark-theme .bottom-nav .nav-item.active::before {
            background: rgba(255, 255, 255, 0.14) !important;
        }

    
        @media (max-width: 768px) {
            /* desktop-theme-btn removed */
        }

    
        /* Premium active/hover navigation button overrides for dark theme */
        .dark-theme .desktop-nav .nav-btn:hover {
            background: var(--primary-soft) !important;
            color: var(--primary) !important;
        }
        .dark-theme .desktop-nav .nav-btn.active {
            background: var(--primary) !important;
            color: #FFFFFF !important;
            box-shadow: 0 4px 14px rgba(36, 81, 196, 0.4) !important;
            border: none !important;
        }

    
        /* Dark theme header glassmorphism override */
        .dark-theme .dash-header {
            background: var(--glass-bg) !important;
            border-bottom: var(--glass-border) !important;
            backdrop-filter: var(--glass-blur) !important;
            -webkit-backdrop-filter: var(--glass-blur) !important;
        }

    
        /* Prevent transitions on page load */
        .preload * {
            -webkit-transition: none !important;
            -moz-transition: none !important;
            -ms-transition: none !important;
            -o-transition: none !important;
            transition: none !important;
        }

        @media (max-width: 480px) {
            .dash-header { padding: 10px 12px; }
            .brand { min-width: 0; gap: 8px; }
            .brand-text { min-width: 0; }
            .brand-text .title { max-width: 176px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
            .brand-text .live-badge { font-size: 10px; }
            .header-actions { gap: 8px; }
            .dash-content { padding: 14px 12px calc(76px + env(safe-area-inset-bottom, 10px)) !important; }
            .main-wrapper { gap: 14px; }
            .page-title-section { margin-bottom: 8px; }
            .page-title-section h2 { font-size: 19px !important; }
            .page-title-section p { font-size: 12px !important; }
            .privacy-card { padding: 16px 14px !important; gap: 14px !important; font-size: 12.5px !important; border-radius: 16px !important; }
            .privacy-card h3 { font-size: 14px !important; margin-bottom: 6px !important; }
            .privacy-card p { font-size: 12.5px !important; line-height: 1.55 !important; }
            .footer-area { padding-bottom: 12px; }
        }

        @media (max-width: 360px) {
            .page-title-section h2 { font-size: 17px !important; }
            .page-title-section p { font-size: 11px !important; }
            .privacy-card { padding: 12px 10px !important; font-size: 11.5px !important; }
            .privacy-card h3 { font-size: 13px !important; }
            .privacy-card p { font-size: 11.5px !important; }
        }
