@font-face {
    font-family: 'Switzer';
    src: url('https://cdn.fontshare.com/wf/BLNB4FAQFNK56DWWNF7PMGTCOTZHOEII/ST3WKSSDMBK2MIQQO3MAVYWLF4FTOLFV/6IN5WOLRCYP4G4MOCOHOMXNON6Q7MDAR.woff2') format('woff2'),
         url('https://cdn.fontshare.com/wf/BLNB4FAQFNK56DWWNF7PMGTCOTZHOEII/ST3WKSSDMBK2MIQQO3MAVYWLF4FTOLFV/6IN5WOLRCYP4G4MOCOHOMXNON6Q7MDAR.woff') format('woff'),
         url('https://cdn.fontshare.com/wf/BLNB4FAQFNK56DWWNF7PMGTCOTZHOEII/ST3WKSSDMBK2MIQQO3MAVYWLF4FTOLFV/6IN5WOLRCYP4G4MOCOHOMXNON6Q7MDAR.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}
@font-face {
    font-family: 'Switzer';
    src: url('https://cdn.fontshare.com/wf/OYB4CXKJQXKTNSLJMTDQOIVUL2V5EL7S/WYO2P7DQVV5RNXGMCUO2HL4RJP4VFUAS/6XPIMU23OJVRY676OG5YVJMWEHWICATX.woff2') format('woff2'),
         url('https://cdn.fontshare.com/wf/OYB4CXKJQXKTNSLJMTDQOIVUL2V5EL7S/WYO2P7DQVV5RNXGMCUO2HL4RJP4VFUAS/6XPIMU23OJVRY676OG5YVJMWEHWICATX.woff') format('woff'),
         url('https://cdn.fontshare.com/wf/OYB4CXKJQXKTNSLJMTDQOIVUL2V5EL7S/WYO2P7DQVV5RNXGMCUO2HL4RJP4VFUAS/6XPIMU23OJVRY676OG5YVJMWEHWICATX.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
    font-style: normal;
}
@font-face {
    font-family: 'Switzer';
    src: url('https://cdn.fontshare.com/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.woff2') format('woff2'),
         url('https://cdn.fontshare.com/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.woff') format('woff'),
         url('https://cdn.fontshare.com/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.ttf') format('truetype');
    font-weight: 600;
    font-display: swap;
    font-style: normal;
}

*, *::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: #F3F6FC; --card: #FFFFFF; --border: #DCE6F5;
            --danger: #E0483B; --danger-soft: #FCEAE8;
            --success: #15A567; --success-soft: #E8F6F0;
            --accent: #F5A623; --accent-soft: #FEF6E9;
            --radius-md: 14px; --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            --shadow-sm: 0 4px 12px rgba(20, 40, 90, 0.04);
            --shadow-md: 0 8px 24px rgba(20, 40, 90, 0.08);
            --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);
        }

        :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);
        }
        body { font-family: var(--font-body); color: var(--ink); background: var(--surface); padding-bottom: 0; min-height: 100vh; min-height: 100dvh; }
        
        .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: sticky; top: 0;
            transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .brand { display: flex; align-items: center; gap: 10px; }
        .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.15; }
        .brand-text .title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
        .desktop-nav { display: flex; gap: 6px; }
        .desktop-nav .nav-btn { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 10px 16px; border-radius: 10px; transition: 0.2s; cursor: pointer; display: flex; align-items: center; gap: 6px; }
        .desktop-nav .nav-btn:hover { background: var(--primary-soft); color: var(--theme-accent-text); }
        .desktop-nav .nav-btn.active { background: #FFFFFF; color: var(--theme-accent-text); 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; }

        .container { padding: 16px 14px; max-width: 760px; margin: 0 auto; }

        /* Fleet Chips */
        .fleet-summary {
            display: flex;
            gap: 8px;
            margin-bottom: 14px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            padding-bottom: 2px;
        }
        .fleet-summary::-webkit-scrollbar {
            display: none;
        }
        .fleet-chip {
            flex-shrink: 0 !important;
            white-space: nowrap !important;
            flex: 1 1 0;
            min-width: 58px;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 9px 6px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: var(--shadow-sm);
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }
        .fleet-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
        .fleet-chip .num { font-size: 15px; font-weight: 800; font-family: var(--font-display); color: var(--ink); line-height: 1.1; }
        .fleet-chip .lbl { font-size: 8.5px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; margin-top: 3px; letter-spacing: 0.3px; }
        
        .fleet-chip.active { border-color: var(--primary); background: var(--primary-soft); }
        .fleet-chip.active .num { color: var(--theme-accent-text); }
        .fleet-chip.active .lbl { color: var(--theme-accent-text); }

        .fleet-chip#chipMoving:hover { border-color: rgba(21,165,103,0.3); }
        .fleet-chip#chipMoving.active { border-color: var(--success); background: var(--success-soft); }
        .fleet-chip#chipMoving.active .num { color: var(--status-success-text); }
        .fleet-chip#chipMoving.active .lbl { color: var(--status-success-text); }

        .fleet-chip#chipIdle:hover { border-color: rgba(217,119,6,0.3); }
        .fleet-chip#chipIdle.active { border-color: #D97706; background: rgba(245,158,11,0.12); }
        .fleet-chip#chipIdle.active .num { color: #B45309; }
        .fleet-chip#chipIdle.active .lbl { color: #B45309; }

        .fleet-chip#chipStopped:hover { border-color: rgba(37,99,235,0.3); }
        .fleet-chip#chipStopped.active { border-color: #2563EB; background: rgba(37,99,235,0.1); }
        .fleet-chip#chipStopped.active .num { color: #1D4ED8; }
        .fleet-chip#chipStopped.active .lbl { color: #1D4ED8; }

        .fleet-chip#chipOffline:hover { border-color: rgba(100,116,139,0.3); }
        .fleet-chip#chipOffline.active { border-color: #64748B; background: rgba(100,116,139,0.12); }
        .fleet-chip#chipOffline.active .num { color: #334155; }
        .fleet-chip#chipOffline.active .lbl { color: #334155; }

        /* Search Wrap */
        .directory-toolbar {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 12px;
            margin: 4px 2px 10px;
        }
        .directory-title-block { min-width: 0; }
        .directory-eyebrow {
            display: block;
            margin-bottom: 2px;
            color: var(--theme-accent-text);
            font-size: 10px;
            font-weight: 850;
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }
        .directory-title-block h2 {
            margin: 0;
            color: var(--ink);
            font-family: var(--font-display);
            font-size: 20px;
            font-weight: 750;
            letter-spacing: -0.2px;
        }
        .directory-count {
            flex-shrink: 0;
            color: var(--ink-soft);
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 6px 10px;
            font-size: 11px;
            font-weight: 800;
            box-shadow: var(--shadow-sm);
        }
        .search-wrap {
            position: relative;
            z-index: 5;
            margin-bottom: 14px;
            background: rgba(255,255,255,0.72);
            border: 1px solid rgba(255,255,255,0.7);
            border-radius: 18px;
            padding: 8px;
            box-shadow: 0 12px 30px rgba(20,40,90,0.08);
            backdrop-filter: blur(18px) saturate(170%);
            -webkit-backdrop-filter: blur(18px) saturate(170%);
        }
        .search-box {
            width: 100%;
            padding: 13px 44px 13px 42px;
            border: 1.5px solid var(--border);
            border-radius: 13px;
            font-size: 14px;
            font-weight: 650;
            outline: none;
            background: var(--card);
            box-shadow: inset 0 1px 2px rgba(14,27,51,0.03);
            color: var(--ink);
            transition: 0.2s;
        }
        .search-box:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: #fff; }
        .search-icon { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
        .search-clear-btn {
            position: absolute;
            right: 18px;
            top: 50%;
            transform: translateY(-50%);
            width: 30px;
            height: 30px;
            border: 1px solid var(--border);
            border-radius: 10px;
            display: none;
            align-items: center;
            justify-content: center;
            background: var(--surface);
            color: var(--ink-soft);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .search-clear-btn.visible { display: flex; }
        .search-clear-btn:hover { color: var(--status-danger-text); border-color: rgba(224,72,59,0.25); background: var(--danger-soft); }

        /* Bus Directory Cards */
        .bus-list { display: flex; flex-direction: column; gap: 12px; }
        .bus-card {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 14px 16px;
            box-shadow: 0 2px 8px rgba(20, 40, 90, 0.04), 0 1px 2px rgba(20, 40, 90, 0.02);
            display: flex;
            flex-direction: column;
            gap: 12px;
            transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
            position: relative;
            overflow: hidden;
        }
        .bus-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 14px;
            bottom: 14px;
            width: 3.5px;
            border-radius: 0 999px 999px 0;
            background: var(--ink-faint);
            opacity: 0.65;
            transition: background-color 0.2s ease, opacity 0.2s ease;
        }
        .bus-card.moving::before {
            background: var(--success);
            opacity: 1;
            box-shadow: 1px 0 8px rgba(21, 165, 103, 0.35);
        }
        .bus-card.idle::before {
            background: var(--accent);
            opacity: 1;
            box-shadow: 1px 0 8px rgba(245, 166, 35, 0.35);
        }
        .bus-card.stopped::before {
            background: var(--ink-soft);
            opacity: 0.85;
        }
        .bus-card.inactive::before {
            background: var(--ink-faint);
            opacity: 0.45;
        }
        .bus-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(20, 40, 90, 0.08), 0 2px 6px rgba(20, 40, 90, 0.04);
            border-color: rgba(36, 81, 196, 0.24);
        }
        
        .card-header-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
        .bus-photo-wrap {
            width: 52px;
            height: 52px;
            border-radius: 13px;
            overflow: hidden;
            position: relative;
            border: 1px solid var(--border);
            background: var(--surface);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
        }
        .bus-photo-wrap.moving { border-color: rgba(21, 165, 103, 0.25); }
        .bus-photo-wrap.idle { border-color: rgba(245, 166, 35, 0.3); }
        .bus-photo-wrap .bus-photo { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 2; }
        .bus-photo-wrap .bus-photo-fallback-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%); color: #fff; z-index: 1; font-size: 16px; }
        .bus-photo-wrap.moving .bus-photo-fallback-icon { background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%); }
        .bus-photo-wrap.idle .bus-photo-fallback-icon { background: linear-gradient(135deg, var(--accent) 0%, #D97706 100%); }
        .bus-photo-wrap.photo-toggle { cursor: pointer; }
        .bus-photo-wrap.photo-toggle:hover, .bus-photo-wrap.photo-toggle:focus-visible {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(36, 81, 196, 0.18);
            outline: none;
            transform: scale(1.02);
        }
        .bus-photo-wrap.photo-visible .bus-photo { display: block !important; }
        .bus-photo-hint { position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--theme-accent-text); box-shadow: 0 1px 4px rgba(15, 35, 75, 0.2); z-index: 3; }
        .bus-photo-wrap.photo-visible .bus-photo-hint { display: none !important; }
        
        .bus-pic-badge {
            position: absolute;
            bottom: 2.5px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(14, 27, 51, 0.88);
            color: #ffffff;
            font-size: 8px;
            font-weight: 800;
            padding: 1.5px 5.5px;
            border-radius: 999px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            white-space: nowrap !important;
            flex-shrink: 0 !important;
            pointer-events: none;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
            border: 0.5px solid rgba(255, 255, 255, 0.25);
            z-index: 5;
        }

        .bus-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .bus-title {
            font-size: 15px;
            font-weight: 800;
            color: var(--ink);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            line-height: 1.25;
        }
        .bus-title > span:first-child { min-width: 0; overflow-wrap: anywhere; letter-spacing: -0.2px; }
        .bus-title-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0 !important; }
        .plate-number {
            font-size: 11px;
            color: var(--ink-soft);
            font-weight: 600;
            letter-spacing: 0.2px;
            margin-top: 2px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        
        .status-badge {
            flex-shrink: 0 !important;
            font-size: 10px;
            font-weight: 800;
            padding: 3.5px 8.5px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            white-space: nowrap !important;
            border: 1px solid transparent;
            letter-spacing: 0.15px;
            transition: all 0.2s ease;
        }
        .status-badge .status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            display: inline-block;
            flex-shrink: 0 !important;
        }
        .status-badge.moving {
            color: var(--status-success-text);
            background: var(--success-soft);
            border-color: rgba(21, 165, 103, 0.25);
        }
        .status-badge.moving .status-dot {
            background: var(--success);
            box-shadow: 0 0 0 2px rgba(21, 165, 103, 0.2);
            animation: liveBadgePulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
        }
        .status-badge.idle {
            color: #B45309;
            background: var(--accent-soft);
            border-color: rgba(245, 166, 35, 0.3);
        }
        .status-badge.idle .status-dot {
            background: #D97706;
        }
        .status-badge.stopped {
            color: var(--ink-soft);
            background: var(--surface);
            border-color: var(--border);
        }
        .status-badge.stopped .status-dot {
            background: var(--ink-faint);
        }
        .status-badge.inactive {
            color: var(--ink-soft);
            background: var(--surface);
            border-color: var(--border);
        }
        .status-badge.inactive .status-dot {
            background: var(--ink-faint);
        }
        @keyframes liveBadgePulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.25); opacity: 0.75; }
        }

        @media (prefers-reduced-motion: reduce) {
            .status-badge.moving .status-dot {
                animation: none !important;
            }
            .bus-card, .fleet-chip, .action-btn, .bus-photo-wrap {
                transition: none !important;
            }
        }

        .detail-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px 12px;
            background: var(--surface);
            padding: 10px 12px;
            border-radius: 12px;
            font-size: 11px;
            margin-top: 2px;
            border: 1px solid rgba(14, 27, 51, 0.04);
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }
        .detail-item {
            display: flex;
            flex-direction: column;
            gap: 1.5px;
            min-width: 0;
        }
        .detail-item.detail-duration {
            text-align: right;
            align-items: flex-end;
        }
        .detail-item.detail-footer {
            grid-column: span 2;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid var(--border);
            padding-top: 5px;
            margin-top: 2px;
        }
        .detail-lbl {
            color: var(--ink-soft);
            font-weight: 650;
            font-size: 9.5px;
            text-transform: uppercase;
            letter-spacing: 0.25px;
        }
        .detail-val {
            color: var(--ink);
            font-weight: 750;
            overflow-wrap: anywhere;
        }
        .detail-phone {
            font-size: 10.5px;
            color: var(--ink-soft);
            display: flex;
            align-items: center;
            gap: 4px;
            margin-top: 2px;
            font-weight: 600;
        }
        .detail-phone svg {
            flex-shrink: 0;
        }

        .card-actions { display: flex; gap: 8px; margin-top: 2px; }
        .action-btn {
            flex: 1;
            padding: 10px 14px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 800;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
            text-decoration: none;
            min-height: 42px;
            white-space: nowrap !important;
            flex-shrink: 0 !important;
            line-height: 1;
            box-sizing: border-box;
        }
        .action-btn:active { transform: scale(0.985); }
        .btn-track {
            background: var(--primary);
            color: #ffffff;
            box-shadow: 0 4px 12px rgba(36, 81, 196, 0.25);
        }
        .btn-track:hover {
            background: var(--primary-dark);
            box-shadow: 0 6px 16px rgba(36, 81, 196, 0.32);
        }
        .btn-hist {
            background: var(--primary-soft);
            color: var(--theme-accent-text);
            border: 1px solid rgba(36, 81, 196, 0.12);
        }
        .btn-hist:hover {
            background: rgba(36, 81, 196, 0.16);
            border-color: rgba(36, 81, 196, 0.24);
        }
        .empty-state {
            text-align: center;
            padding: 44px 20px;
            color: var(--ink-soft);
            background: var(--card);
            border: 1px dashed var(--border);
            border-radius: 18px;
            box-shadow: var(--shadow-sm);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            margin: 12px 0;
        }
        .empty-state-icon {
            width: 52px;
            height: 52px;
            border-radius: 14px;
            background: var(--primary-soft);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 2px;
        }
        .empty-state-title {
            font-family: var(--font-display);
            font-size: 15px;
            font-weight: 800;
            color: var(--ink);
            letter-spacing: -0.2px;
        }
        .empty-state-desc {
            font-size: 12px;
            color: var(--ink-soft);
            font-weight: 500;
            line-height: 1.45;
            margin: 0;
            max-width: 320px;
        }
        .empty-state-reset-btn {
            margin-top: 6px;
            padding: 8px 16px;
            border-radius: 10px;
            font-size: 12px;
            font-weight: 750;
            background: var(--surface);
            color: var(--theme-accent-text);
            border: 1px solid var(--border);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .empty-state-reset-btn:hover {
            background: var(--primary-soft);
            border-color: rgba(36, 81, 196, 0.25);
        }

        /* Liquid Bottom Nav */
        .bottom-nav {
            display: flex; position: fixed; bottom: env(safe-area-inset-bottom, 12px); left: 12px; right: 12px;
            height: 64px; border-radius: 24px; background: var(--bottom-nav-bg); 
            backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%);
            border: var(--bottom-nav-border);
            box-shadow: inset 0 1px 1px rgba(255,255,255,0.8), inset 0 -1px 2px rgba(0,0,0,0.05), 0 12px 36px rgba(20,40,90,0.20);
            z-index: 1200; overflow: hidden;
        }
        .bottom-nav::before { content: ''; position: absolute; inset: 0; background: linear-gradient(165deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 45%); pointer-events: none; z-index: 0; }
        .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 11px; font-weight: 600; cursor: pointer; gap: 4px; position: relative; z-index: 1; transition: color 0.15s; }
        .nav-item.active { color: var(--theme-accent-text); font-weight: 700; }
        .nav-item.active::before { content: ''; position: absolute; inset: 6px 16px; border-radius: 16px; background: rgba(36,81,196,0.14); z-index: -1; }
        .nav-item svg { width: 22px; height: 22px; }

        .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); }
        .menu-btn-top { display: none !important; }
        .drawer-backdrop {
            position: fixed; inset: 0; background: rgba(14, 27, 51, 0.4); 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(--theme-accent-text);
        }
        .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(--theme-accent-text); 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(--status-danger-text);
        }
        .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; } 

            .container {
                max-width: 1240px !important;
                padding: 24px 32px !important;
            }
            
            .fleet-summary {
                max-width: 780px;
                margin: 0 auto 20px auto;
                gap: 16px;
            }
            
            .fleet-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
                padding: 14px 16px;
                border-radius: 18px;
            }
            .fleet-chip .num {
                font-size: 22px;
            }
            .fleet-chip .lbl {
                font-size: 11px;
            }
            
            .directory-toolbar {
                max-width: 1240px;
                margin: 0 auto 12px auto;
            }
            
            .search-wrap {
                max-width: 1240px;
                margin: 0 auto 24px auto;
                padding: 10px;
            }
            
            .bus-list {
                display: grid !important;
                grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
                gap: 20px !important;
            }
            
            .bus-card {
                height: 100%;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                padding: 18px;
                border-radius: 20px;
                transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
            }
            .bus-card:hover {
                transform: translateY(-4px);
                box-shadow: 0 12px 32px rgba(20, 40, 90, 0.12);
                border-color: var(--primary-soft);
            }
        }
        @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(--theme-accent-text) !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;
        }

        .dark-theme .search-wrap {
            background: rgba(14, 27, 51, 0.72);
            border-color: rgba(34, 55, 94, 0.72);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
        }
        .dark-theme .search-box {
            background: rgba(14, 27, 51, 0.92);
            border-color: var(--border);
            color: var(--ink);
        }
        .dark-theme .search-box:focus {
            background: var(--card);
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(36, 81, 196, 0.3);
        }
        .dark-theme .search-clear-btn {
            background: rgba(14, 27, 51, 0.9);
            border-color: var(--border);
        }
        .dark-theme .bus-card {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
        }
        .dark-theme .bus-card:hover {
            border-color: rgba(147, 197, 253, 0.3);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }
        .dark-theme .bus-photo-wrap {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(255, 255, 255, 0.1);
        }
        .dark-theme .bus-pic-badge {
            background: rgba(6, 11, 24, 0.94);
            border-color: rgba(255, 255, 255, 0.2);
        }
        .dark-theme .detail-grid {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(255, 255, 255, 0.06);
        }
        .dark-theme .detail-item.detail-footer {
            border-top-color: rgba(255, 255, 255, 0.08);
        }
        .dark-theme .empty-state {
            background: var(--card);
            border-color: var(--border);
        }
        .dark-theme .empty-state-icon {
            background: rgba(36, 81, 196, 0.2);
            color: #93C5FD;
        }
        .dark-theme .empty-state-reset-btn {
            background: rgba(255, 255, 255, 0.06);
            color: #93C5FD;
            border-color: rgba(255, 255, 255, 0.12);
        }
        .dark-theme .empty-state-reset-btn:hover {
            background: rgba(36, 81, 196, 0.25);
            border-color: rgba(147, 197, 253, 0.35);
        }
        .dark-theme .fleet-chip {
            background: #10192D;
            border-color: #1A2642;
        }
        .dark-theme .fleet-chip .num {
            color: #F1F5F9;
        }
        .dark-theme .fleet-chip .lbl {
            color: #94A3B8;
        }
        .dark-theme .fleet-chip#chipAll.active {
            border-color: #3B82F6;
            background: rgba(59, 130, 246, 0.16);
        }
        .dark-theme .fleet-chip#chipAll.active .num,
        .dark-theme .fleet-chip#chipAll.active .lbl {
            color: #60A5FA;
        }
        .dark-theme .fleet-chip#chipMoving.active {
            border-color: #10B981;
            background: rgba(16, 185, 129, 0.16);
        }
        .dark-theme .fleet-chip#chipMoving.active .num,
        .dark-theme .fleet-chip#chipMoving.active .lbl {
            color: #34D399;
        }
        .dark-theme .fleet-chip#chipIdle.active {
            border-color: #F59E0B;
            background: rgba(245, 158, 11, 0.16);
        }
        .dark-theme .fleet-chip#chipIdle.active .num,
        .dark-theme .fleet-chip#chipIdle.active .lbl {
            color: #FBBF24;
        }
        .dark-theme .fleet-chip#chipStopped.active {
            border-color: #3B82F6;
            background: rgba(59, 130, 246, 0.16);
        }
        .dark-theme .fleet-chip#chipStopped.active .num,
        .dark-theme .fleet-chip#chipStopped.active .lbl {
            color: #93C5FD;
        }
        .dark-theme .fleet-chip#chipOffline.active {
            border-color: #64748B;
            background: rgba(100, 116, 139, 0.2);
        }
        .dark-theme .fleet-chip#chipOffline.active .num,
        .dark-theme .fleet-chip#chipOffline.active .lbl {
            color: #CBD5E1;
        }

    
        /* 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;
        }

.toast-alert {
    position: fixed !important;
    top: auto !important;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(20px) !important;
    background: #1D4ED8;
    color: #FFFFFF;
    padding: 9px 18px !important;
    border-radius: 24px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: min(88vw, 360px) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-sizing: border-box !important;
}

.toast-alert #toastIcon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toast-alert #toastIcon svg {
    width: 16px;
    height: 16px;
}

.toast-alert #toastMessage {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.35;
    font-size: inherit;
    font-weight: inherit;
}

.toast-alert.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
}

.toast-alert.success {
    background: #10B981 !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35) !important;
}

.toast-alert.error {
    background: #E11D48 !important;
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.35) !important;
}

.toast-alert.warning {
    background: #D97706 !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.35) !important;
}

.toast-alert.info {
    background: #2563EB !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35) !important;
}

        .custom-modal-overlay {
            position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(8px);
            z-index: 99999; display: flex; align-items: center; justify-content: center;
            opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
        }
        .custom-modal-overlay.active { opacity: 1; pointer-events: auto; }
        .custom-modal-box {
            background: #FFFFFF; border: 1px solid #E2E8F0; border-radius: 20px;
            width: 90%; max-width: 350px; padding: 20px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
            transform: scale(0.95); transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            font-family: 'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: #0F172A;
        }
        :root.dark-theme .custom-modal-box,
        html.dark-theme .custom-modal-box,
        .dark-theme .custom-modal-box {
            background: #101624 !important;
            border-color: rgba(255, 255, 255, 0.12) !important;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
            color: #F8FAFC !important;
        }
        .custom-modal-overlay.active .custom-modal-box { transform: scale(1); }
        #crowdModalOverlay .custom-modal-box {
            max-width: 330px !important;
            padding: 16px !important;
            border-radius: 18px !important;
            box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16) !important;
        }
        #crowdModalTitle {
            font-size: 15px !important;
            line-height: 1.25 !important;
        }
        #crowdModalOverlay p {
            margin-bottom: 12px !important;
            font-size: 12px !important;
            line-height: 1.35 !important;
        }
        #crowdModalOverlay .custom-modal-box > div:first-child {
            margin-bottom: 10px !important;
        }
        #crowdModalOverlay .custom-modal-box > div:last-child {
            display: grid !important;
            grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
            gap: 7px !important;
        }
        #crowdModalOverlay button[id^="opt"] {
            min-height: 38px !important;
            padding: 8px 6px !important;
            gap: 5px !important;
            border-radius: 10px !important;
            font-size: 11px !important;
            line-height: 1 !important;
            white-space: nowrap !important;
            justify-content: center !important;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42) !important;
        }
        #crowdModalOverlay button[id^="opt"]:active {
            transform: scale(0.985);
        }

        @media (max-width: 480px) {
            body { padding-bottom: 0; overflow-x: hidden; }
            .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; }
            .header-actions { gap: 8px; }
            .container { padding: 12px 10px calc(80px + env(safe-area-inset-bottom, 12px)) !important; max-width: 100%; }
            .fleet-summary { gap: 5px; margin-bottom: 12px; }
            .fleet-chip {
                flex-shrink: 0 !important;
                white-space: nowrap !important;
                min-width: 52px;
                padding: 7px 4px;
                border-radius: 12px;
            }
            .fleet-chip .num { font-size: 13.5px; }
            .fleet-chip .lbl { font-size: 8px; letter-spacing: 0.1px; }
            .directory-toolbar { align-items: flex-start; margin-top: 2px; }
            .directory-title-block h2 { font-size: 16px; }
            .directory-count { padding: 4px 8px; font-size: 10px; }
            .search-wrap { position: relative; z-index: 5; padding: 6px; border-radius: 14px; margin-bottom: 10px; }
            .search-box { padding: 10px 36px 10px 36px; font-size: 12.5px; }
            .search-icon { left: 18px; }
            .search-clear-btn { right: 14px; }
            .bus-card { padding: 12px 14px; border-radius: 16px; }
            .card-header-row { gap: 10px; align-items: center; }
            .bus-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; min-width: 0; font-size: 14.5px; }
            .bus-title-right, .bus-title > div { display: flex; align-items: center; justify-content: flex-end; gap: 5px !important; flex-wrap: wrap; }
            .bus-photo-wrap { width: 46px; height: 46px; flex-shrink: 0; border-radius: 11px; }
            .detail-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 9px 11px; border-radius: 11px; }
            .detail-item { min-width: 0; }
            .detail-val, .detail-phone { font-size: 10.5px !important; }
            .detail-lbl { font-size: 8.5px; }
            .card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
            .action-btn { min-height: 40px; font-size: 11px; padding: 8px 6px; gap: 5px; }
            .action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
            .toast-alert {
                font-size: 11.5px !important;
                padding: 7px 14px !important;
                border-radius: 20px !important;
                max-width: min(90vw, 310px) !important;
                bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
                line-height: 1.3 !important;
            }
            .toast-alert #toastIcon svg {
                width: 14px !important;
                height: 14px !important;
            }
            .custom-modal-overlay { align-items: flex-end; padding: 12px; }
            .custom-modal-box { width: 100%; max-width: none; max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 18px; padding: 18px; }
            #crowdModalOverlay.custom-modal-overlay { align-items: center !important; padding: 16px !important; }
            #crowdModalOverlay .custom-modal-box { width: min(330px, calc(100% - 18px)) !important; max-width: 330px !important; border-radius: 16px !important; }
            .bottom-nav { left: 10px; right: 10px; height: 62px; border-radius: 20px; }
            .nav-item { font-size: 10px; gap: 3px; }
            .nav-item.active::before { inset: 6px 8px; }
        }

        @media (max-width: 360px) {
            .fleet-summary { gap: 4px; margin-bottom: 10px; }
            .fleet-chip {
                flex-shrink: 0 !important;
                white-space: nowrap !important;
                min-width: 48px;
                padding: 6px 3px;
                border-radius: 10px;
            }
            .fleet-chip .num { font-size: 12px !important; }
            .fleet-chip .lbl { font-size: 7.5px !important; letter-spacing: 0; }
            .toast-alert {
                font-size: 10.5px !important;
                padding: 6px 12px !important;
                border-radius: 18px !important;
                max-width: calc(100vw - 28px) !important;
                bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
                line-height: 1.25 !important;
            }
            .toast-alert #toastIcon svg {
                width: 13px !important;
                height: 13px !important;
            }
            .directory-title-block h2 { font-size: 14.5px !important; }
            .search-box { font-size: 11.5px !important; }
            .bus-card { padding: 10px !important; }
            .detail-val, .detail-phone { font-size: 9.5px !important; }
            .action-btn { font-size: 9.5px !important; }
        }


/* Calm directory layout: one primary action; secondary information uses the record sheet. */
.bus-card.directory-card { padding: 16px; gap: 8px; border-radius: 16px; box-shadow: none; height: auto; justify-content: flex-start; }
.bus-card.directory-card::before { display: none; }
.bus-card.directory-card:hover { transform: none; box-shadow: 0 3px 12px rgba(20,40,90,.04); border-color: var(--border); }
.directory-card .card-header-row { align-items: center; gap: 12px; margin: 0; }
.directory-bus-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: var(--theme-accent-text, var(--primary));
    background: var(--primary-soft);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
}
.directory-bus-icon:hover {
    transform: scale(1.06);
    background: var(--primary-soft);
    box-shadow: 0 3px 10px rgba(36, 81, 196, 0.18);
}
.directory-bus-icon:active {
    transform: scale(0.94);
}
.directory-bus-icon > svg { width: 28px; height: 28px; pointer-events: none; }
.directory-bus-icon:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.directory-photo-indicator {
    display: none;
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 16px;
    height: 16px;
    border-radius: 6px;
    border: 2px solid var(--bg-card, #fff);
    background: var(--primary);
    color: #fff;
    pointer-events: none;
}
.directory-bus-icon.has-photo .directory-photo-indicator { display: grid; place-items: center; }
.directory-photo-indicator svg { width: 10px; height: 10px; stroke-width: 2; }
.directory-card .bus-info { flex: 1; min-width: 0; }
.directory-card .bus-title { font-size: 15px; gap: 8px; align-items: center; }
.directory-bus-name { min-width: 0; overflow-wrap: anywhere; }
.directory-card .plate-number { margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
.directory-card .status-badge { font-size: 10px; padding: 4px 8px; white-space: nowrap !important; flex-shrink: 0 !important; }
.directory-card-meta { position: relative; border-top: 1px solid var(--border); padding-top: 6px; }
.directory-meta-row { display: flex; gap: 12px; align-items: center; min-height: 22px; font-size: 12px; }
.directory-meta-row > span { color: var(--ink-soft); flex: 0 0 68px; }
.directory-meta-row:first-child { padding-right: 44px; }
.directory-meta-row strong { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.directory-call { position: absolute; top: 0; right: 0; margin-left: auto; color: var(--theme-accent-text, var(--primary)); width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; border-radius: 10px; }
.directory-call[hidden], .bus-details-sheet [hidden] { display: none !important; }
.directory-card .card-actions { display: flex; align-items: center; gap: 16px; padding: 0; margin-top: 2px; border: 0; }
.directory-card .btn-track { flex: 1; min-height: 44px; padding: 10px 14px; border-radius: 10px; box-shadow: none; font-size: 13px; }
.directory-card .btn-track:disabled { color: var(--ink-soft); background: var(--surface); cursor: default; transform: none; }
.directory-details { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 2px 8px 12px; border: 0; background: transparent; font: 700 12px var(--font-body); color: var(--theme-accent-text, var(--primary)); cursor: pointer; }
.directory-details svg { width: 16px; height: 16px; }
.directory-card :is(button,a):focus-visible, .bus-details-sheet :is(button,a):focus-visible { outline: 2px solid var(--theme-accent-text, var(--primary)); outline-offset: 3px; }
.bus-details-sheet { position: fixed; inset: auto 0 0; margin: 0 auto; padding: 0; width: min(100%, 400px); max-width: 400px; max-height: min(52vh, 340px); max-height: min(52dvh, 340px); overflow: hidden; border: 1px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -8px 24px rgba(0,0,0,.14); }
.bus-details-sheet[open] { display: flex; flex-direction: column; animation: bus-sheet-enter .2s ease-out; }
.bus-details-sheet::backdrop { background: rgba(9,13,22,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bus-sheet-handle { width: 28px; height: 3px; border-radius: 3px; background: var(--ink-faint); opacity: .5; margin: 5px auto 1px; flex-shrink: 0; }
.bus-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px 4px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.bus-sheet-eyebrow { display: block; color: var(--ink-soft); font-size: 8.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 1px; line-height: 1; }
.bus-sheet-header h2 { margin: 0; font-size: 14.5px; font-weight: 750; line-height: 1.2; }
.bus-sheet-plate { color: var(--ink-soft); font-size: 10.5px; margin-top: 1px; line-height: 1.2; }
.bus-sheet-close { display: grid; place-items: center; width: 26px; height: 26px; min-width: 26px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: background .15s ease, color .15s ease; }
.bus-sheet-close svg { width: 13px; height: 13px; }
.bus-sheet-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 6px 14px 4px; }
#busDetailsNotice { color: var(--ink-soft); font-size: 9.5px; line-height: 1.25; margin: 0 0 4px; padding: 2.5px 6px; border-radius: 5px; background: rgba(0, 102, 255, 0.05); }
.bus-sheet-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 5px; margin: 0; }
.bus-sheet-fields > div { display: flex; flex-direction: column; justify-content: center; gap: 0.5px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); min-height: 0; }
.bus-sheet-fields dt { font-size: 8.5px; font-weight: 650; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.3px; line-height: 1.1; }
.bus-sheet-fields dd { margin: 0; font-size: 11px; font-weight: 600; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.bus-sheet-fields > div:nth-child(7), .bus-sheet-fields > div:nth-child(8) { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
.bus-sheet-fields > div:nth-child(7) dd, .bus-sheet-fields > div:nth-child(8) dd { text-align: right; }
.bus-sheet-footer { display: flex; align-items: center; gap: 6px; padding: 5px 14px calc(5px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); flex-shrink: 0; }
.bus-sheet-footer a { display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--theme-accent-text, var(--primary)); font-size: 10.5px; font-weight: 650; padding: 4px 8px; min-height: 28px; border-radius: 6px; text-decoration: none; flex: 1; }
.bus-sheet-footer a svg { width: 12px; height: 12px; }
.bus-sheet-footer a:last-child { margin-left: 0; }
.bus-sheet-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bus-sheet-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: var(--primary-soft); color: var(--theme-accent-text, var(--primary)); }
.bus-sheet-icon svg { width: 26px; height: 26px; }
.bus-sheet-heading { min-width: 0; }
.bus-sheet-header h2, .bus-sheet-plate { overflow-wrap: anywhere; }
.bus-sheet-status-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.bus-sheet-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--ink-soft); font-size: 9px; font-weight: 700; line-height: 1.25; white-space: nowrap !important; flex-shrink: 0 !important; }
.bus-sheet-status::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.bus-sheet-status[data-state="moving"] { color: var(--status-success-text, #166534); }
.bus-sheet-status[data-state="idle"] { color: var(--status-warning-text, #92400e); }
.bus-sheet-status-row #busDetailsNotice { margin: 0; background: none; padding: 2px 0; }
.bus-sheet-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin: 0; }
.bus-sheet-metrics > div { min-width: 0; border: 1px solid var(--border); border-radius: 6px; padding: 5px 6px; background: var(--surface); }
.bus-sheet-metrics dt { font-size: 8.5px; color: var(--ink-soft); line-height: 1.2; }
.bus-sheet-metrics dd { margin: 3px 0 0; font-size: 11px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.bus-sheet-section { margin-top: 9px; }
.bus-sheet-section h3 { margin: 0 0 4px; font-size: 9px; color: var(--ink-soft); font-weight: 650; letter-spacing: .4px; text-transform: uppercase; }
.bus-sheet-location { grid-template-columns: minmax(0,1fr); }
.bus-sheet-footer .bus-sheet-call { color: #fff; background: var(--primary); }
.bus-sheet-footer .bus-sheet-tracker { border: 1px solid var(--border); background: var(--surface); }
@keyframes bus-sheet-enter { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 769px) {
    .bus-details-sheet { inset: 0 !important; margin: auto !important; border-radius: 14px !important; border-bottom: 1px solid var(--border) !important; box-shadow: 0 16px 36px rgba(0,0,0,0.18) !important; width: 360px !important; max-height: min(50vh, 320px) !important; height: fit-content !important; }
    .bus-sheet-handle { display: none !important; }
    .bus-list { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 24px !important; }
}
@media (min-width: 769px) and (max-width: 1024px) { .bus-list { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }
@media (max-width: 480px) {
    .bus-card.directory-card { padding: 14px !important; border-radius: 16px; }
    .bus-list { gap: 16px; }
    .bus-sheet-header, .bus-sheet-body, .bus-sheet-footer { padding-left: 10px !important; padding-right: 10px !important; }
    .directory-card .btn-track { font-size: 12px !important; padding: 10px !important; }
}
@media (max-width: 360px) {
    .directory-card .card-header-row { gap: 8px; }
    .directory-card .bus-title { font-size: 14px; }
    .bus-sheet-fields { gap: 2px 4px !important; }
    .bus-sheet-fields > div { padding: 2px 5px !important; }
    .bus-sheet-fields dd { font-size: 10.5px !important; }
    .bus-sheet-fields dt { font-size: 8px !important; }
}
@media (prefers-reduced-motion: reduce) { .bus-details-sheet[open] { animation: none; } }


/* Favorite Buses Toggle & Summary Chip */
.btn-favorite-bus {
    background: transparent;
    border: none;
    padding: 4px;
    margin: 0 4px 0 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--ink-faint, #94a3b8);
    transition: transform 0.15s ease, color 0.15s ease;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    -webkit-tap-highlight-color: transparent;
}
.btn-favorite-bus:hover {
    color: #f59e0b;
    transform: scale(1.12);
}
.btn-favorite-bus:active {
    transform: scale(0.92);
}
.btn-favorite-bus.is-favorite {
    color: #f59e0b;
}
.btn-favorite-bus.is-favorite .star-icon {
    fill: #f59e0b;
    stroke: #f59e0b;
}
.bus-card.is-favorite {
    border-color: rgba(245, 158, 11, 0.4);
}
.dark-theme .bus-card.is-favorite {
    border-color: rgba(245, 158, 11, 0.45);
}
.fleet-chip.favorites {
    border-color: rgba(245, 158, 11, 0.35);
}
.fleet-chip.favorites .num {
    color: #d97706;
}
.fleet-chip.favorites .lbl {
    color: #d97706;
}
.fleet-chip.favorites.active {
    background: #FEF3C7;
    border-color: #F59E0B;
}
.fleet-chip.favorites.active .num {
    color: #B45309;
}
.fleet-chip.favorites.active .lbl {
    color: #B45309;
}
.dark-theme .fleet-chip.favorites {
    border-color: rgba(245, 158, 11, 0.4);
}
.dark-theme .fleet-chip.favorites .num {
    color: #FCD34D;
}
.dark-theme .fleet-chip.favorites .lbl {
    color: #FCD34D;
}
.dark-theme .fleet-chip.favorites.active {
    background: rgba(245, 158, 11, 0.22);
    border-color: #F59E0B;
}
.dark-theme .fleet-chip.favorites.active .num {
    color: #FDE68A;
}
.dark-theme .fleet-chip.favorites.active .lbl {
    color: #FDE68A;
}
@media (max-width: 480px) {
    .btn-favorite-bus { padding: 3px; }
    .fleet-chip.favorites { min-width: 58px; }
}
@media (max-width: 360px) {
    .btn-favorite-bus { padding: 2px; }
    .fleet-chip.favorites { min-width: 52px; padding: 8px 4px; }
}

/* Nighttime Tracking Notice Banner */
.night-tracking-notice {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 550;
    line-height: 1.45;
}
.night-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.night-notice-icon {
    flex-shrink: 0;
    stroke: #64748B;
}
.dark-theme .night-tracking-notice {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94A3B8;
}
.dark-theme .night-notice-icon {
    stroke: #94A3B8;
}
@media (max-width: 480px) {
    .night-tracking-notice {
        padding: 8px 12px !important;
        font-size: 11px !important;
        margin-top: 8px !important;
        margin-bottom: 10px !important;
    }
}
@media (max-width: 360px) {
    .night-tracking-notice {
        padding: 7px 10px !important;
        font-size: 10px !important;
    }
}

/* ==========================================================================
   Sticky Search & Favourite Buses Bar (Smart Scroll Hide/Reveal)
   ========================================================================== */
.directory-sticky-bar {
    position: sticky;
    top: 60px;
    z-index: 1100;
    background: var(--surface);
    padding: 8px 14px 4px;
    margin-left: -14px;
    margin-right: -14px;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.directory-sticky-bar .search-wrap {
    margin-bottom: 0;
}

.directory-sticky-bar.is-stuck {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(248, 250, 252, 0.94);
}

.dark-theme .directory-sticky-bar.is-stuck {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 13, 17, 0.94);
}

/* Hide on scroll down */
body.header-hidden .dash-header {
    transform: translateY(-100%);
}

body.header-hidden .directory-sticky-bar {
    transform: translateY(calc(-100% - 62px));
}

@media (max-width: 480px) {
    .directory-sticky-bar {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 6px;
    }
}

@media (max-width: 360px) {
    .directory-sticky-bar {
        margin-left: -8px;
        margin-right: -8px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (min-width: 769px) {
    .directory-sticky-bar {
        margin-left: -32px;
        margin-right: -32px;
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* ==========================================================================
   Favourite Buses Bar (Compact boxes directly below search bar)
   ========================================================================== */
.favorite-buses-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    margin-top: 8px;
    margin-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.favorite-buses-bar::-webkit-scrollbar {
    display: none;
}

.fav-bus-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 7px;
    border-radius: 12px;
    background: var(--card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink, #0f172a);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.fav-bus-chip:hover {
    transform: translateY(-1px);
    border-color: #F59E0B;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.fav-bus-chip:active {
    transform: scale(0.96);
}

.fav-chip-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--primary-soft, rgba(36, 81, 196, 0.08));
    color: var(--theme-accent-text, var(--primary, #2451C4));
    flex-shrink: 0;
}

.fav-chip-name {
    font-size: 12.5px;
    font-weight: 750;
    color: var(--ink, #0f172a);
    letter-spacing: -0.2px;
}

.fav-chip-star {
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

@keyframes favPulseHighlight {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.bus-card.fav-highlight {
    animation: favPulseHighlight 1.5s ease-out;
    border-color: #F59E0B !important;
}

/* Dark theme overrides */
.dark-theme .fav-bus-chip {
    background: var(--card, #111827);
    border-color: var(--border, rgba(255, 255, 255, 0.12));
    color: #F8FAFC;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.dark-theme .fav-bus-chip:hover {
    border-color: #FBBF24;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.dark-theme .fav-chip-name {
    color: #F8FAFC;
}

/* Mobile responsive breakpoints: Rule 1.1 / 1.2 */
@media (max-width: 480px) {
    .favorite-buses-bar {
        gap: 6px;
        padding-bottom: 10px;
        margin-top: 8px;
    }
    .fav-bus-chip {
        padding: 5px 10px 5px 6px;
        border-radius: 10px;
        font-size: 11.5px;
    }
    .fav-chip-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }
    .fav-chip-icon svg {
        width: 13px;
        height: 13px;
    }
    .fav-chip-name {
        font-size: 11.5px;
    }
}

@media (max-width: 360px) {
    .favorite-buses-bar {
        gap: 5px;
    }
    .fav-bus-chip {
        padding: 4px 8px 4px 5px;
    }
    .fav-chip-icon {
        width: 22px;
        height: 22px;
    }
    .fav-chip-name {
        font-size: 11px;
    }
}

/* ==========================================================================
   UI V2 THEME UNIFICATION — BATCH 1: BUS DIRECTORY PILOT
   Scoped strictly under body.ui-v2 to preserve existing behavior & other pages
   ========================================================================== */

body.ui-v2 {
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--ui-bg, #F4F7FB);
    color: var(--ui-ink, #111827);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header & Brand Identity */
body.ui-v2 .dash-header {
    background: var(--ui-surface, #FFFFFF) !important;
    border-bottom: 1px solid var(--ui-border, #E5E7EB) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.ui-v2 .brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

body.ui-v2 .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #20469c;
    box-shadow: 0 2px 8px rgba(32, 70, 156, 0.25);
    flex-shrink: 0;
}

body.ui-v2 .brand-mark svg {
    display: block;
    width: 32px !important;
    height: 32px !important;
}

body.ui-v2 .brand-text .title {
    font-family: 'Switzer', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-ink, #111827);
    letter-spacing: -0.3px;
}

body.ui-v2 .desktop-nav .nav-btn {
    font-family: 'Switzer', sans-serif;
    font-weight: 500;
    font-size: 13.5px;
    color: var(--ui-ink-muted, #6B7280);
    border-radius: 100px;
    padding: 7px 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

body.ui-v2 .desktop-nav .nav-btn:hover {
    color: var(--ui-primary, #0066FF);
    background: rgba(0, 102, 255, 0.06);
}

body.ui-v2 .desktop-nav .nav-btn.active {
    background: #EEF4FF !important;
    color: var(--ui-primary, #0066FF) !important;
    font-weight: 600;
}

/* Fleet Summary Counters */
body.ui-v2 .fleet-summary {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 10px;
}

body.ui-v2 .fleet-summary::-webkit-scrollbar {
    display: none;
}

body.ui-v2 .fleet-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 14px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

body.ui-v2 .fleet-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.ui-v2 .fleet-chip .num {
    font-family: 'Switzer', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-ink, #111827);
    line-height: 1.2;
}

body.ui-v2 .fleet-chip .lbl {
    font-family: 'Switzer', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: var(--ui-ink-muted, #6B7280);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

body.ui-v2 .fleet-chip.active {
    border-color: var(--ui-primary, #0066FF) !important;
    background: #EEF4FF !important;
}
body.ui-v2 .fleet-chip.active .num,
body.ui-v2 .fleet-chip.active .lbl {
    color: var(--ui-primary, #0066FF) !important;
}

body.ui-v2 .fleet-chip#chipMoving.active {
    border-color: #10B981 !important;
    background: #ECFDF5 !important;
}
body.ui-v2 .fleet-chip#chipMoving.active .num,
body.ui-v2 .fleet-chip#chipMoving.active .lbl {
    color: #047857 !important;
}

body.ui-v2 .fleet-chip#chipIdle.active {
    border-color: #F59E0B !important;
    background: #FFFBEB !important;
}
body.ui-v2 .fleet-chip#chipIdle.active .num,
body.ui-v2 .fleet-chip#chipIdle.active .lbl {
    color: #B45309 !important;
}

body.ui-v2 .fleet-chip#chipStopped.active {
    border-color: #EF4444 !important;
    background: #FEF2F2 !important;
}
body.ui-v2 .fleet-chip#chipStopped.active .num,
body.ui-v2 .fleet-chip#chipStopped.active .lbl {
    color: #B91C1C !important;
}

body.ui-v2 .fleet-chip#chipOffline.active {
    border-color: #6B7280 !important;
    background: #F3F4F6 !important;
}
body.ui-v2 .fleet-chip#chipOffline.active .num,
body.ui-v2 .fleet-chip#chipOffline.active .lbl {
    color: #374151 !important;
}

/* Toolbar & Search Bar */
body.ui-v2 .directory-toolbar {
    margin: 12px 0 8px;
}

body.ui-v2 .directory-eyebrow {
    font-family: 'Switzer', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ui-ink-muted, #6B7280);
}

body.ui-v2 .directory-title-block h2 {
    font-family: 'Switzer', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--ui-ink, #111827);
    letter-spacing: -0.4px;
}

body.ui-v2 .directory-count {
    font-family: 'Switzer', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-ink-muted, #6B7280);
}

body.ui-v2 .directory-sticky-bar {
    background: rgba(244, 247, 251, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body.ui-v2 .search-wrap {
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ui-v2 .search-wrap:focus-within {
    border-color: var(--ui-primary, #0066FF);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

body.ui-v2 .search-box {
    font-family: 'Switzer', sans-serif;
    font-size: 14px;
    color: var(--ui-ink, #111827);
}

body.ui-v2 .search-box::placeholder {
    color: #9CA3AF;
}

body.ui-v2 .fav-bus-chip {
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    font-family: 'Switzer', sans-serif;
}

/* Bus Directory Cards */
body.ui-v2 .bus-card.directory-card {
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

body.ui-v2 .bus-card.directory-card:hover {
    border-color: rgba(0, 102, 255, 0.35);
    box-shadow: 0 6px 18px rgba(0, 102, 255, 0.08);
    transform: translateY(-1px);
}

body.ui-v2 .directory-bus-icon {
    border-radius: 10px;
    background: #EEF4FF;
    color: var(--ui-primary, #0066FF);
    border: 1px solid rgba(0, 102, 255, 0.15);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

body.ui-v2 .directory-bus-icon:hover {
    background: #E0ECFF;
    transform: scale(1.04);
}

body.ui-v2 .directory-bus-name {
    font-family: 'Switzer', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-ink, #111827);
    letter-spacing: -0.3px;
}

body.ui-v2 .directory-card .plate-number {
    font-family: 'Switzer', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ui-ink-muted, #6B7280);
}

/* Status Badges */
body.ui-v2 .status-badge {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 100px;
    padding: 3.5px 8px;
    font-size: 10.5px;
    font-weight: 600;
    font-family: 'Switzer', sans-serif;
    letter-spacing: 0.2px;
}

body.ui-v2 .status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

body.ui-v2 .status-badge.moving {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}
body.ui-v2 .status-badge.moving .status-dot {
    background: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

body.ui-v2 .status-badge.idle {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}
body.ui-v2 .status-badge.idle .status-dot {
    background: #F59E0B;
}

body.ui-v2 .status-badge.stopped {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}
body.ui-v2 .status-badge.stopped .status-dot {
    background: #EF4444;
}

body.ui-v2 .status-badge.inactive,
body.ui-v2 .status-badge.offline {
    background: #F3F4F6;
    color: #4B5563;
    border: 1px solid #E5E7EB;
}
body.ui-v2 .status-badge.inactive .status-dot,
body.ui-v2 .status-badge.offline .status-dot {
    background: #9CA3AF;
}

body.ui-v2 .directory-card-meta {
    border-top: 1px solid var(--ui-border, #E5E7EB);
}

body.ui-v2 .directory-meta-row {
    font-family: 'Switzer', sans-serif;
}
body.ui-v2 .directory-meta-row > span {
    color: var(--ui-ink-muted, #6B7280);
    font-size: 12px;
}
body.ui-v2 .directory-meta-row strong {
    color: var(--ui-ink, #111827);
    font-size: 12.5px;
    font-weight: 600;
}

/* Card Action Buttons */
body.ui-v2 .directory-card .btn-track {
    background: var(--ui-primary, #0066FF) !important;
    color: #FFFFFF !important;
    font-family: 'Switzer', sans-serif;
    font-weight: 600;
    font-size: 13px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.22);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

body.ui-v2 .directory-card .btn-track:hover:not(:disabled) {
    background: #0052CC !important;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.32);
    transform: translateY(-1px);
}

body.ui-v2 .directory-details {
    background: #F3F4F6;
    color: #374151;
    font-family: 'Switzer', sans-serif;
    font-weight: 600;
    font-size: 12.5px;
    border-radius: 10px;
    padding: 8px 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

body.ui-v2 .directory-details:hover {
    background: #E5E7EB;
    color: #111827;
}

/* Details Bottom Sheet & Modals */
body.ui-v2 .bus-details-sheet {
    background: var(--ui-surface, #FFFFFF);
    border: 1px solid var(--ui-border, #E5E7EB);
    color: var(--ui-ink, #111827);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}

body.ui-v2 .bus-sheet-handle {
    background: #D1D5DB;
}

body.ui-v2 .bus-sheet-header {
    border-bottom: 1px solid var(--ui-border, #E5E7EB);
    padding: 6px 14px 4px;
}

body.ui-v2 .bus-sheet-header h2 {
    font-family: 'Switzer', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ui-ink, #111827);
    line-height: 1.2;
}

body.ui-v2 .bus-sheet-eyebrow {
    color: var(--ui-ink-muted, #6B7280);
    font-family: 'Switzer', sans-serif;
    font-size: 8.5px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.ui-v2 .bus-sheet-plate {
    color: var(--ui-ink-muted, #6B7280);
    font-size: 10.5px;
}

body.ui-v2 .bus-sheet-close {
    background: #F3F4F6;
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 50%;
    color: var(--ui-ink-muted, #6B7280);
    width: 26px;
    height: 26px;
    min-width: 26px;
    transition: background 0.15s ease, color 0.15s ease;
}
body.ui-v2 .bus-sheet-close:hover {
    background: #E5E7EB;
    color: var(--ui-ink, #111827);
}

body.ui-v2 .bus-sheet-fields > div {
    background: var(--ui-surface-2, #F9FAFB);
    border: 1px solid var(--ui-border, #E5E7EB);
    border-radius: 6px;
    padding: 3px 6px;
}

body.ui-v2 .bus-sheet-fields dt {
    font-family: 'Switzer', sans-serif;
    font-size: 8.5px;
    font-weight: 650;
    color: var(--ui-ink-muted, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

body.ui-v2 .bus-sheet-fields dd {
    font-family: 'Switzer', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-ink, #111827);
    line-height: 1.2;
}

body.ui-v2 .bus-sheet-call {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    border-radius: 6px;
    font-weight: 600;
    font-family: 'Switzer', sans-serif;
    font-size: 10.5px;
    min-height: 28px;
    padding: 4px 8px;
}

body.ui-v2 .bus-sheet-tracker {
    background: #EEF4FF;
    color: var(--ui-primary, #0066FF);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 6px;
    font-weight: 600;
    font-family: 'Switzer', sans-serif;
    font-size: 10.5px;
    min-height: 28px;
    padding: 4px 8px;
}

/* Floating Dock Navigation */
body.ui-v2 .dock-island-main {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(229, 231, 235, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.ui-v2 .dock-tab {
    color: #6B7280;
    transition: color 0.15s ease, background 0.15s ease;
}

body.ui-v2 .dock-tab:hover {
    color: var(--primary, #2451C4);
}

body.ui-v2 .dock-tab.active {
    background: var(--primary, #2451C4) !important;
    color: #FFFFFF !important;
    border-radius: 100px;
    box-shadow: 0 4px 14px rgba(36, 81, 196, 0.35) !important;
}

body.ui-v2 .dock-tab.active svg {
    stroke: #FFFFFF !important;
    color: #FFFFFF !important;
}

body.ui-v2 .dock-island-action {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(229, 231, 235, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.ui-v2 .dock-action-btn {
    color: #374151;
}

/* Dark Theme Overrides for UI v2 */
:root.dark-theme body.ui-v2,
html.dark-theme body.ui-v2,
body.ui-v2.dark-theme {
    background-color: var(--ui-bg, #0B0F19);
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .dash-header,
html.dark-theme body.ui-v2 .dash-header,
body.ui-v2.dark-theme .dash-header {
    background: var(--ui-surface, #111827) !important;
    border-bottom: 1px solid var(--ui-border, #1F2937) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

:root.dark-theme body.ui-v2 .brand-text .title,
html.dark-theme body.ui-v2 .brand-text .title,
body.ui-v2.dark-theme .brand-text .title {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .desktop-nav .nav-btn,
html.dark-theme body.ui-v2 .desktop-nav .nav-btn,
body.ui-v2.dark-theme .desktop-nav .nav-btn {
    color: var(--ui-ink-muted, #9CA3AF);
}

:root.dark-theme body.ui-v2 .desktop-nav .nav-btn.active,
html.dark-theme body.ui-v2 .desktop-nav .nav-btn.active,
body.ui-v2.dark-theme .desktop-nav .nav-btn.active {
    background: rgba(0, 102, 255, 0.2) !important;
    color: #60A5FA !important;
}

:root.dark-theme body.ui-v2 .fleet-chip,
html.dark-theme body.ui-v2 .fleet-chip,
body.ui-v2.dark-theme .fleet-chip {
    background: var(--ui-surface, #111827);
    border-color: var(--ui-border, #1F2937);
}

:root.dark-theme body.ui-v2 .fleet-chip .num,
html.dark-theme body.ui-v2 .fleet-chip .num,
body.ui-v2.dark-theme .fleet-chip .num {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .fleet-chip .lbl,
html.dark-theme body.ui-v2 .fleet-chip .lbl,
body.ui-v2.dark-theme .fleet-chip .lbl {
    color: var(--ui-ink-muted, #9CA3AF);
}

:root.dark-theme body.ui-v2 .fleet-chip.active,
html.dark-theme body.ui-v2 .fleet-chip.active,
body.ui-v2.dark-theme .fleet-chip.active {
    background: rgba(0, 102, 255, 0.2) !important;
    border-color: #3B82F6 !important;
}
:root.dark-theme body.ui-v2 .fleet-chip.active .num,
:root.dark-theme body.ui-v2 .fleet-chip.active .lbl,
html.dark-theme body.ui-v2 .fleet-chip.active .num,
html.dark-theme body.ui-v2 .fleet-chip.active .lbl,
body.ui-v2.dark-theme .fleet-chip.active .num,
body.ui-v2.dark-theme .fleet-chip.active .lbl {
    color: #93C5FD !important;
}

:root.dark-theme body.ui-v2 .directory-title-block h2,
html.dark-theme body.ui-v2 .directory-title-block h2,
body.ui-v2.dark-theme .directory-title-block h2 {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .directory-sticky-bar,
html.dark-theme body.ui-v2 .directory-sticky-bar,
body.ui-v2.dark-theme .directory-sticky-bar {
    background: rgba(11, 15, 25, 0.94);
}

:root.dark-theme body.ui-v2 .search-wrap,
html.dark-theme body.ui-v2 .search-wrap,
body.ui-v2.dark-theme .search-wrap {
    background: var(--ui-surface, #111827);
    border-color: var(--ui-border, #1F2937);
}

:root.dark-theme body.ui-v2 .search-box,
html.dark-theme body.ui-v2 .search-box,
body.ui-v2.dark-theme .search-box {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .bus-card.directory-card,
html.dark-theme body.ui-v2 .bus-card.directory-card,
body.ui-v2.dark-theme .bus-card.directory-card {
    background: var(--ui-surface, #111827);
    border-color: var(--ui-border, #1F2937);
    color: var(--ui-ink, #F9FAFB);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

:root.dark-theme body.ui-v2 .bus-card.directory-card:hover,
html.dark-theme body.ui-v2 .bus-card.directory-card:hover,
body.ui-v2.dark-theme .bus-card.directory-card:hover {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

:root.dark-theme body.ui-v2 .directory-bus-icon,
html.dark-theme body.ui-v2 .directory-bus-icon,
body.ui-v2.dark-theme .directory-bus-icon {
    background: rgba(0, 102, 255, 0.15);
    color: #60A5FA;
    border-color: rgba(0, 102, 255, 0.3);
}

:root.dark-theme body.ui-v2 .directory-bus-name,
html.dark-theme body.ui-v2 .directory-bus-name,
body.ui-v2.dark-theme .directory-bus-name {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .directory-card-meta,
html.dark-theme body.ui-v2 .directory-card-meta,
body.ui-v2.dark-theme .directory-card-meta {
    border-top-color: var(--ui-border, #1F2937);
}

:root.dark-theme body.ui-v2 .directory-meta-row strong,
html.dark-theme body.ui-v2 .directory-meta-row strong,
body.ui-v2.dark-theme .directory-meta-row strong {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .directory-details,
html.dark-theme body.ui-v2 .directory-details,
body.ui-v2.dark-theme .directory-details {
    background: #1F2937;
    color: #D1D5DB;
}
:root.dark-theme body.ui-v2 .directory-details:hover,
html.dark-theme body.ui-v2 .directory-details:hover,
body.ui-v2.dark-theme .directory-details:hover {
    background: #374151;
    color: #F9FAFB;
}

:root.dark-theme body.ui-v2 .bus-details-sheet,
html.dark-theme body.ui-v2 .bus-details-sheet,
body.ui-v2.dark-theme .bus-details-sheet {
    background: var(--ui-surface, #111827);
    border-color: var(--ui-border, #1F2937);
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .bus-sheet-header,
html.dark-theme body.ui-v2 .bus-sheet-header,
body.ui-v2.dark-theme .bus-sheet-header {
    border-bottom-color: var(--ui-border, #1F2937);
}

:root.dark-theme body.ui-v2 .bus-sheet-header h2,
html.dark-theme body.ui-v2 .bus-sheet-header h2,
body.ui-v2.dark-theme .bus-sheet-header h2 {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .bus-sheet-fields dd,
html.dark-theme body.ui-v2 .bus-sheet-fields dd,
body.ui-v2.dark-theme .bus-sheet-fields dd {
    color: var(--ui-ink, #F9FAFB);
}

:root.dark-theme body.ui-v2 .bus-sheet-fields dt,
html.dark-theme body.ui-v2 .bus-sheet-fields dt,
body.ui-v2.dark-theme .bus-sheet-fields dt {
    color: #9CA3AF;
}

:root.dark-theme body.ui-v2 .bus-sheet-fields > div,
html.dark-theme body.ui-v2 .bus-sheet-fields > div,
body.ui-v2.dark-theme .bus-sheet-fields > div {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ui-border, #1F2937);
}

:root.dark-theme body.ui-v2 .bus-sheet-close,
html.dark-theme body.ui-v2 .bus-sheet-close,
body.ui-v2.dark-theme .bus-sheet-close {
    background: #1F2937;
    border-color: #374151;
    color: #9CA3AF;
}

:root.dark-theme body.ui-v2 .bus-sheet-close:hover,
html.dark-theme body.ui-v2 .bus-sheet-close:hover,
body.ui-v2.dark-theme .bus-sheet-close:hover {
    background: #374151;
    color: #F9FAFB;
}

:root.dark-theme body.ui-v2 .dock-island-main,
:root.dark-theme body.ui-v2 .dock-island-action,
html.dark-theme body.ui-v2 .dock-island-main,
html.dark-theme body.ui-v2 .dock-island-action,
body.ui-v2.dark-theme .dock-island-main,
body.ui-v2.dark-theme .dock-island-action {
    background: rgba(17, 24, 39, 0.94);
    border-color: rgba(31, 41, 55, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

:root.dark-theme body.ui-v2 .dock-tab,
html.dark-theme body.ui-v2 .dock-tab,
body.ui-v2.dark-theme .dock-tab {
    color: #9CA3AF;
}

:root.dark-theme body.ui-v2 .dock-tab.active,
html.dark-theme body.ui-v2 .dock-tab.active,
body.ui-v2.dark-theme .dock-tab.active {
    background: #3B82F6 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45) !important;
}

:root.dark-theme body.ui-v2 .dock-tab.active svg,
html.dark-theme body.ui-v2 .dock-tab.active svg,
body.ui-v2.dark-theme .dock-tab.active svg {
    stroke: #FFFFFF !important;
    color: #FFFFFF !important;
}

:root.dark-theme body.ui-v2 .dock-action-btn,
html.dark-theme body.ui-v2 .dock-action-btn,
body.ui-v2.dark-theme .dock-action-btn {
    color: #D1D5DB;
}

/* Mobile responsive breakpoints: Rule 1.1 / 1.2 */
@media (max-width: 480px) {
    body.ui-v2 .container {
        padding: 14px 12px 24px;
        max-width: 100%;
    }
    body.ui-v2 .bus-card.directory-card {
        padding: 14px 12px !important;
        border-radius: 16px !important;
    }
    body.ui-v2 .dash-header {
        padding: 8px 12px;
    }
}

@media (max-width: 360px) {
    body.ui-v2 .container {
        padding: 12px 10px 20px;
    }
    body.ui-v2 .bus-card.directory-card {
        padding: 12px 10px !important;
    }
    body.ui-v2 .directory-bus-name {
        font-size: 14.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ui-v2 .status-badge.moving .status-dot {
        animation: none !important;
    }
    body.ui-v2 .bus-card.directory-card,
    body.ui-v2 .fleet-chip,
    body.ui-v2 .action-btn {
        transition: none !important;
    }
}

