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

:root {
    /* Brand Tokens (original map aliases) */
    --primary: #005BFF;
    --primary-dark: #0042BD;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --navy: #0F172A;
    --navy2: #1E293B;
    --text: #0F172A;
    --text2: #334155;
    --text3: #64748B;
    --border: #E2E8F0;
    --success: #16A34A;
    --warning: #D97706;
    --error: #DC2626;
    --divider: #F1F5F9;
    
    /* Modern Layout tokens */
    --primary-hover: #0042BD;
    --primary-light: #EFF6FF;
    --bg-main: #F1F5F9;
    --bg-sidebar: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #475569;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --success-light: #F0FDF4;
    --success-border: #BBF7D0;
    --warning-light: #FEF3C7;
    --error-light: #FEF2F2;
    --error-border: #FECACA;
    
    /* Elevation & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    
    /* Border Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, 'Inter', BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── MAIN DASHBOARD LAYOUT ─── */
.dashboard-content {
    --sidebar-width: 380px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
}

.map-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* ─── WHITE TOP BAR HEADER ─── */
.header {
    background: #FFFFFF;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

.header-logo {
    height: 52px; /* Scaled perfectly to look prominent yet fit inside the header */
    width: auto; /* Allow natural aspect ratio width */
    object-fit: contain;
    mix-blend-mode: multiply;
    display: block;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

.header-org {
    background: var(--primary-light);
    border: 1px solid rgba(0, 91, 255, 0.15);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-org:empty {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-clock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    padding: 0 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    height: 38px;
    box-sizing: border-box;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
    height: 38px;
    box-sizing: border-box;
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--error);
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

.status-dot.connected {
    background: var(--success);
    animation: none;
}

@keyframes pulse-dot {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.header-btn, .logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-all);
    height: 38px;
    box-sizing: border-box;
    white-space: nowrap;
}

.header-btn:hover {
    background: var(--bg-main);
    border-color: var(--text-light);
    color: var(--text-main);
}

.logout-btn {
    color: var(--error);
    border-color: var(--error-border);
    background: var(--error-light);
}

.logout-btn:hover {
    background: var(--error);
    color: #FFFFFF;
    border-color: var(--error);
}

/* ─── BOTTOM PANEL & SIDEBAR ─── */
.bottom-panel {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bus-cards {
    display: flex;
    gap: 12px;
    padding-bottom: 4px;
}

/* ─── METRIC COUNTERS ─── */
.bus-counters {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #FFFFFF;
    width: fit-content;
}

.counter-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
}

.counter-badge:last-child {
    border-right: none;
}

.counter-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.counter-dot.total { background: var(--primary); }
.counter-dot.live { background: var(--success); }
.counter-dot.offline { background: var(--error); }

/* ─── SEARCH CONTAINER ─── */
.search-container {
    position: relative;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    color: var(--text-main);
    background: #FFFFFF;
    transition: var(--transition-all);
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* ─── BUS CARD ─── */
.bus-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-all);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bus-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.bus-card.offline-card {
    opacity: 0.8;
    border-color: var(--border-color);
    background: var(--bg-main);
}

.bus-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bus-card .name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
}

.bus-card .live-badge {
    background: var(--success-light);
    color: var(--success);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--success-border);
}

.bus-card .offline-badge {
    background: var(--error-light);
    color: var(--error);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--error-border);
}

.bus-card .coords {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bus-card .driver-name {
    font-weight: 500;
}

.bus-card .speed-text {
    font-weight: 700;
    color: var(--primary);
}

.bus-card .time {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px;
    font-weight: 500;
    width: 100%;
}

/* ─── LOGIN OVERLAY ─── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    transition: opacity 0.4s ease;
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-box {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-logo {
    display: block;
    margin: 0 auto 16px auto;
    height: 120px;
    width: auto;
    object-fit: contain;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 28px;
    font-weight: 500;
}

.login-box label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
}

.login-box input,
.login-box select {
    width: 100%;
    padding: 11px 14px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 16px;
    outline: none;
    transition: var(--transition-all);
}

.login-box input:focus,
.login-box select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.1);
}

.pass-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

.pass-wrapper input {
    margin-bottom: 0 !important;
    padding-right: 44px !important;
}

.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition-all);
    padding: 4px;
}

.eye-btn:hover {
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-all);
}

.login-btn:hover {
    background: var(--primary-hover);
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.captcha-canvas-element {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    cursor: pointer;
}

.captcha-refresh-btn {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    height: 40px;
    width: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-all);
}

.captcha-refresh-btn:hover {
    background: var(--bg-main);
    border-color: var(--text-light);
}

.login-error {
    color: var(--error);
    background: var(--error-light);
    border: 1px solid var(--error-border);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: center;
    margin-top: 16px;
    display: none;
    font-weight: 600;
}

/* ─── UI MODALS ─── */
.ui-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ui-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ui-modal-box {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.ui-modal-overlay.active .ui-modal-box {
    transform: translateY(0);
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.ui-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.ui-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition-all);
}

.ui-modal-close:hover {
    color: var(--text-main);
}

.ui-modal-box label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
}

.ui-modal-box select,
.ui-modal-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 16px;
    outline: none;
    color: var(--text-main);
    background: #FFFFFF;
    transition: var(--transition-all);
}

.ui-modal-box select:focus,
.ui-modal-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.1);
}

.speed-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.speed-preset-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-all);
}

.speed-preset-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.ui-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.ui-btn-primary, .ui-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-all);
    outline: none;
}

.ui-btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    border: 1px solid var(--primary);
}

.ui-btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.ui-btn-secondary {
    background: #FFFFFF;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.ui-btn-secondary:hover {
    background: var(--bg-main);
    color: var(--text-main);
    border-color: var(--text-light);
}

.ui-btn-secondary.btn-danger {
    color: var(--error);
    border-color: var(--error-border);
    background: var(--error-light);
}

.ui-btn-secondary.btn-danger:hover {
    background: var(--error);
    color: #FFFFFF;
    border-color: var(--error);
}

/* ─── FLOATING ROUTE BADGE & CONTROLS ─── */
#mapRouteClearBadge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: var(--text-main);
    color: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    align-items: center;
    gap: 12px;
    border: 1px solid #334155;
    transition: var(--transition-all);
}

#mapRouteClearBadge button {
    background: var(--error);
    border: none;
    color: #FFFFFF;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: var(--transition-all);
}

#mapRouteClearBadge button:hover {
    background: #D32F2F;
}

.map-controls-box {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #FFFFFF;
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.map-sq-btn {
    width: 36px;
    height: 36px;
    background: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-all);
    color: var(--text-muted);
}

.map-sq-btn:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.map-sq-btn svg {
    stroke: currentColor;
}

.map-sq-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ─── MODAL SPECIFICS ─── */
.modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-danger {
    color: var(--error) !important;
    border-color: var(--error-border) !important;
    background: var(--error-light) !important;
}

.btn-danger:hover {
    background: var(--error) !important;
    color: #FFFFFF !important;
    border-color: var(--error) !important;
}

.modal-form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    margin-bottom: 0 !important;
}

.form-group input {
    margin-bottom: 0 !important;
}

.modal-error-message {
    display: none;
    color: var(--error);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    background: var(--error-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--error-border);
}

.modal-success-message {
    display: none;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    background: var(--success-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--success-border);
}

.submit-btn {
    width: 100%;
    padding: 12px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
}

/* ─── CUSTOM BUS MARKER PULSE ─── */
.bus-marker-pulse {
    width: 22px;
    height: 22px;
    background: rgba(0, 91, 255, 0.2);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: -5px;
    animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* ─── RESPONSIVE LAYOUT SWITCHES ─── */
@media (max-width: 1023px) {
    .bottom-panel {
        max-height: 260px;
    }

    .bus-cards {
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .bus-cards::-webkit-scrollbar {
        display: none;
    }

    .bus-card {
        width: 240px;
        flex-shrink: 0;
    }
    
    .sidebar-toggle-btn {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .dashboard-content {
        flex-direction: row-reverse;
    }

    .bottom-panel {
        width: var(--sidebar-width);
        height: 100%;
        border-top: none;
        border-right: 1px solid var(--border-color);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.02);
        padding: 24px;
        transition: var(--transition-all);
    }
    
    .dashboard-content.sidebar-collapsed {
        --sidebar-width: 0px;
    }
    
    .dashboard-content.sidebar-collapsed .bottom-panel {
        padding: 24px 0;
        border: none;
        overflow: hidden;
    }

    .bus-cards {
        flex-direction: column;
        overflow-y: auto;
        flex: 1;
        padding-right: 4px;
    }

    .bus-card {
        width: 100%;
    }
    
    .bus-cards::-webkit-scrollbar {
        width: 6px;
    }
    
    .bus-cards::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .bus-cards::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
    
    .bus-cards::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }
    
    /* Sleek absolute positioned handle for collapsing sidebar */
    .sidebar-toggle-btn {
        display: flex;
        position: absolute;
        top: 50%;
        left: var(--sidebar-width);
        transform: translateY(-50%);
        width: 34px;
        height: 68px;
        background: #296ca2;
        border: 2px solid var(--border-color);
        border-left: none;
        border-radius: 0 8px 8px 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-left 0.3s, background-color 0.2s;
        color: white;
    }
    
    .sidebar-toggle-btn:hover {
        background: var(--primary-light);
        color: var(--primary);
    }
    
    .sidebar-toggle-btn svg {
        transition: transform 0.3s ease;
    }
    
    .dashboard-content.sidebar-collapsed .sidebar-toggle-btn svg {
        transform: rotate(180deg);
    }
    
    .dashboard-content.sidebar-collapsed .sidebar-toggle-btn {
        border-left: 1px solid var(--border-color);
    }
}

@media (max-width: 1150px) {
    .btn-text {
        display: none !important;
    }
    #statusText {
        display: none !important;
    }
    .header-btn, .logout-btn {
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }
    .status-badge {
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 60px;
    }
    
    .header-logo {
        height: 44px; /* Slightly larger on mobile/tablet viewports */
    }
    
    .header-divider {
        display: none;
    }
    
    .header-org {
        display: none;
    }
    
    .header-clock {
        display: none;
    }
    
    .login-box {
        padding: 30px 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 12px;
    }
    
    .header-logo {
        height: 38px; /* Slightly larger on small screens */
    }
    
    .header-right {
        gap: 6px;
    }
    
    .header-btn, .logout-btn, .status-badge {
        width: 34px;
        height: 34px;
    }
    
    .header-btn svg, .logout-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 1023px) {
    .bus-counters {
        display: none !important;
    }
}

/* ─── GEOFENCE MANAGER MODAL STYLES ─── */
.geofence-modal-box {
    max-width: 840px !important;
    width: 90% !important;
}

.geofence-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 28px;
    margin-top: 8px;
}

.geofence-list-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.geofence-list {
    flex: 1;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.geofence-list::-webkit-scrollbar {
    width: 6px;
}

.geofence-list::-webkit-scrollbar-track {
    background: transparent;
}

.geofence-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.geofence-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: var(--transition-all);
}

.geofence-item:hover {
    border-color: var(--text-light);
    background: #FFFFFF;
}

.geofence-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.geofence-item-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geofence-item-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.geofence-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.geofence-badge.perimeter {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(0, 91, 255, 0.15);
}

.geofence-badge.arrival {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.geofence-delete-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.geofence-delete-btn:hover {
    background: var(--error-light);
    color: var(--error);
}

.fill-coords-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    align-self: flex-start;
    margin-top: -6px;
    gap: 6px;
}

@media (max-width: 768px) {
    .geofence-modal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .geofence-list-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 20px;
    }
    
    .geofence-list {
        max-height: 200px;
    }
}

/* ─── MAP SELECTION BANNER ─── */
.map-selection-banner {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 13.5px;
    animation: bannerSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-selection-banner button {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

@keyframes bannerSlideDown {
    from {
        top: -60px;
        opacity: 0;
    }
    to {
        top: 24px;
        opacity: 1;
    }
}

/* ─── DRAW TYPE TABS ─── */
.draw-type-tabs {
    display: flex;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 16px;
}

.draw-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition-all);
}

.draw-tab.active {
    background: #FFFFFF;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
