/* ============================================
   BusConnect Design System v2
   Bold, dark-glass UI — zero Bootstrap
   ============================================ */

:root {
    /* Brand */
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;

    --accent-400: #f472b6;
    --accent-500: #ec4899;
    --violet-500: #8b5cf6;

    /* Semantic */
    --success: #34d399;
    --success-strong: #10b981;
    --warning: #fbbf24;
    --warning-strong: #f59e0b;
    --danger: #f87171;
    --danger-strong: #ef4444;
    --info: #60a5fa;
    --info-strong: #3b82f6;

    /* Dark canvas */
    --bg-0: #070a1a;
    --bg-1: #0b1024;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-2: rgba(255, 255, 255, 0.08);
    --surface-solid: #10162e;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* Text */
    --text-1: #f1f5fd;
    --text-2: #b6c0dd;
    --text-3: #74819e;

    /* Effects */
    --glass-blur: blur(18px) saturate(140%);
    --shadow-md: 0 6px 18px -6px rgba(2, 6, 23, 0.55);
    --shadow-lg: 0 18px 40px -12px rgba(2, 6, 23, 0.7);
    --glow-primary: 0 0 28px rgba(99, 102, 241, 0.35);
    --glow-success: 0 0 28px rgba(52, 211, 153, 0.3);

    --grad-brand: linear-gradient(120deg, #818cf8 0%, #c084fc 55%, #f472b6 100%);
    --grad-primary: linear-gradient(135deg, var(--primary-500), var(--violet-500));

    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1.125rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Base
   ============================================ */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-1);
    background:
        radial-gradient(1100px 600px at 85% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
        radial-gradient(900px 520px at -10% 20%, rgba(79, 70, 229, 0.14), transparent 55%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1) 40%, var(--bg-0));
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-1);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1.02rem; }
h6 { font-size: 0.95rem; }

p { color: var(--text-2); }

a { color: var(--primary-400); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-300); }

hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

img, svg { display: inline-block; vertical-align: middle; }

::selection { background: rgba(99, 102, 241, 0.45); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: var(--radius-full); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

/* ============================================
   Layout & grid
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.container-fluid { width: 100%; padding-inline: 1.5rem; }

.row { display: flex; flex-wrap: wrap; margin-inline: -0.75rem; }
.row > * { padding-inline: 0.75rem; min-width: 0; }

[class*="col-"] { width: 100%; }
.col-auto { width: auto; }
.col-12 { width: 100%; }

@media (min-width: 768px) {
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.3334%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.6667%; }
}

@media (min-width: 992px) {
    .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.3334%; }
    .col-lg-5 { width: 41.6667%; }
    .col-lg-6 { width: 50%; }
    .col-lg-8 { width: 66.6667%; }
    .col-lg-9 { width: 75%; }
}

.g-2 { gap: 0.5rem 0; }
.g-3 { gap: 0.75rem 0; }
.g-4 { gap: 1rem 0; }
.row.g-3 > *, .row.g-4 > * { margin-bottom: 0.75rem; }
.row.g-4 > * { margin-bottom: 1rem; }

.section { padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 5vw, 3rem); }
.page-content { padding-block: 2rem; }

/* ============================================
   Utilities
   ============================================ */

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2.5rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-auto { margin-left: auto; }
.mx-auto { margin-inline: auto; }
.my-4 { margin-block: 1.5rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.75rem; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }
.py-4 { padding-block: 1.5rem; }
.py-5 { padding-block: 2.75rem; }
.h-100 { height: 100%; }
.w-100 { width: 100%; }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }
.text-1 { color: var(--text-1); }
.text-2 { color: var(--text-2); }
.muted, .text-muted { color: var(--text-3); }
.text-primary { color: var(--primary-400); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-white { color: #fff; }
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 0.875rem; }
.small { font-size: 0.82rem; }
.display-6 { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.1; }
.text-wrap { white-space: normal; }
.text-nowrap { white-space: nowrap; }
.text-decoration-none { text-decoration: none; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

.mw-450 { max-width: 450px; }
.mw-560 { max-width: 560px; }
.overflow-auto { overflow: auto; }
.rounded { border-radius: var(--radius); }
.d-stretch { width: 100%; }

.text-gradient {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.bg-glass { background: var(--surface); backdrop-filter: var(--glass-blur); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.bg-surface { background: var(--surface-solid); border-radius: var(--radius-lg); }

/* ============================================
   Buttons
   ============================================ */

.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.72rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-md), var(--glow-primary);
}
.btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 38px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #0ea5a0);
    color: #04241a;
    font-weight: 700;
    box-shadow: var(--shadow-md), var(--glow-success);
}
.btn-success:hover { color: #04241a; transform: translateY(-2px); box-shadow: var(--shadow-lg), 0 0 34px rgba(52, 211, 153, 0.45); }

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn-danger:hover { color: #fff; transform: translateY(-2px); }

.btn-ghost {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-1);
    backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.3); color: #fff; }

.btn-light {
    background: #fff;
    color: var(--primary-700);
    box-shadow: var(--shadow-lg);
}
.btn-light:hover { transform: translateY(-2px); color: var(--primary-600); }

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary-500);
    color: var(--primary-300);
}
.btn-outline-primary:hover { background: rgba(99, 102, 241, 0.16); color: #fff; border-color: var(--primary-400); transform: translateY(-2px); }

.btn-outline-light {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    backdrop-filter: blur(8px);
}
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.15); border-color: #fff; color: #fff; transform: translateY(-2px); }

.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.02rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-icon { padding: 0.5rem; width: 2.2rem; height: 2.2rem; }

.close-x {
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 1.45rem;
    line-height: 1;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.close-x:hover { background: var(--surface-2); color: var(--text-1); }

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(8, 11, 26, 0.72);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    padding-block: 0.85rem;
}

.navbar .container, .navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.navbar-brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.navbar-brand:hover { transform: none; }

.brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.6rem;
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.32);
    vertical-align: middle;
}
.brand-mark-lg { width: 3.2rem; height: 3.2rem; border-radius: 0.9rem; margin-bottom: 0.65rem; }
.brand-bus { color: var(--text-1); }

.nav-collapse { display: flex; align-items: center; gap: 0.25rem; }
.nav-list { display: flex; align-items: center; gap: 0.25rem; list-style: none; }

.nav-link {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-2);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link:hover { background: var(--surface); color: var(--text-1); }
.nav-link.active { background: rgba(99, 102, 241, 0.16); color: var(--primary-300); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.55rem;
    cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text-1); transition: var(--transition); }
.nav-toggle:hover span { background: var(--primary-300); }

@media (max-width: 991px) {
    .nav-toggle { display: flex; }
    .nav-collapse { display: none; width: 100%; }
    .nav-collapse.is-open { display: flex; flex-direction: column; align-items: stretch; padding-top: 0.75rem; border-top: 1px solid var(--border); }
    .nav-list { flex-direction: column; align-items: stretch; width: 100%; gap: 0.35rem; }
    .nav-list .nav-item { width: 100%; }
    .nav-link { display: flex; }
    .nav-item .btn { width: 100%; }
}

/* Dropdown (user menu) */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    list-style: none;
    padding: 0.4rem;
    margin: 0;
    background: rgba(14, 19, 42, 0.92);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1040;
}
.dropdown-menu.show { display: block; animation: pop-in 0.18s ease-out; }
.dropdown-item {
    display: block;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 500;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text-1); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 0.4rem 0.3rem; }

@keyframes pop-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    color: var(--text-1);
}

.card.lift { transition: var(--transition); }
.card.lift:hover {
    transform: translateY(-4px);
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.18);
}

.card-body { padding: 1.4rem; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.4rem 0;
    border: none;
    background: none;
}
.card-title { font-family: var(--font-display); font-weight: 700; color: var(--text-1); margin-bottom: 0.4rem; }
.card-text { color: var(--text-2); }

.stat-line { display: flex; justify-content: space-between; align-items: center; padding-block: 0.3rem; color: var(--text-2); }
.stat-line strong { font-family: var(--font-display); font-size: 1.05rem; }

/* ============================================
   Forms
   ============================================ */

.form-control, .form-select {
    width: 100%;
    padding: 0.78rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    transition: var(--transition);
    appearance: none;
}

.form-control::placeholder { color: var(--text-3); }

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-500);
    background: rgba(99, 102, 241, 0.07);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.form-control-sm { padding: 0.5rem 0.75rem; font-size: 0.85rem; }

.form-select {
    /* Native arrow only — a background-image chevron leaks into every
       dropdown option row on Windows Chrome/Edge */
}
.form-select option { background: var(--surface-solid); color: var(--text-1); }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--text-2);
    margin-bottom: 0.45rem;
}

.form-text { font-size: 0.8rem; color: var(--text-3); margin-top: 0.35rem; }

.input-icon { position: relative; }
.input-icon > svg:first-child {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}
.input-icon .form-control { padding-left: 2.9rem; }
.input-icon .input-icon-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-3);
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.input-icon .input-icon-btn:hover { color: var(--primary-300); background: var(--surface); }

.input-append { display: flex; gap: 0.5rem; }
.input-append .form-control { flex: 1; }

/* Checkbox pills (day picker) */
.day-pill { position: relative; }
.day-pill .form-check-input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.day-pill .form-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-2);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.day-pill .form-check-label:hover { border-color: var(--primary-500); color: var(--text-1); }
.day-pill:has(input:checked) .form-check-label {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--glow-primary);
}

/* Switch-style checkbox (remember me / consent) */
.form-check { display: flex; align-items: center; gap: 0.55rem; }
.form-check-input {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    place-content: center;
    flex-shrink: 0;
}
.form-check-input::after {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    transform: scale(0);
    transition: 0.15s transform;
    box-shadow: inset 1em 1em #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.form-check-input:checked { background: var(--grad-primary); border-color: transparent; }
.form-check-input:checked::after { transform: scale(1); }
.form-check-label { font-weight: 500; font-size: 0.9rem; color: var(--text-2); cursor: pointer; }

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 650;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.badge-primary { background: rgba(99, 102, 241, 0.16); color: var(--primary-300); border-color: rgba(99, 102, 241, 0.35); }
.badge-success { background: rgba(52, 211, 153, 0.13); color: var(--success); border-color: rgba(52, 211, 153, 0.32); }
.badge-warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); border-color: rgba(251, 191, 36, 0.32); }
.badge-danger  { background: rgba(248, 113, 113, 0.13); color: var(--danger); border-color: rgba(248, 113, 113, 0.32); }
.badge-info    { background: rgba(96, 165, 250, 0.13); color: var(--info); border-color: rgba(96, 165, 250, 0.32); }
.badge-secondary { background: rgba(255, 255, 255, 0.07); color: var(--text-2); border-color: var(--border-strong); }

.badge-live::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* ============================================
   Tables
   ============================================ */

.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.92rem; }

.table th {
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}

.table td {
    padding: 0.95rem 1rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.table tbody tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-3); }

.spinner {
    width: 2rem;
    height: 2rem;
    margin-inline: auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary-400);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   Alerts
   ============================================ */

.alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid;
    border-radius: var(--radius);
    padding: 0.9rem 3rem 0.9rem 1.1rem;
    font-weight: 500;
    font-size: 0.92rem;
    margin-bottom: 1rem;
    animation: slide-down 0.25s ease-out;
}

.alert-success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
.alert-danger  { background: rgba(248, 113, 113, 0.1);  border-color: rgba(248, 113, 113, 0.35); color: #fecaca; }
.alert-warning { background: rgba(251, 191, 36, 0.1);   border-color: rgba(251, 191, 36, 0.35); color: #fde68a; }
.alert-info    { background: rgba(96, 165, 250, 0.1);   border-color: rgba(96, 165, 250, 0.35); color: #bfdbfe; }

.alert .close-x { position: absolute; top: 0.45rem; right: 0.45rem; font-size: 1.2rem; color: inherit; opacity: 0.7; }
.alert .close-x:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

/* ============================================
   Modals
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    overflow-y: auto;
    padding: 1.5rem;
}
.modal.show { display: block; }

.modal::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 16, 0.72);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal.show::before { opacity: 1; }

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 540px;
    margin: 3.5vh auto;
    z-index: 1;
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.modal.show .modal-dialog { opacity: 1; transform: none; }
.modal-lg { max-width: 780px; }

.modal-content {
    background: linear-gradient(165deg, rgba(22, 28, 56, 0.97), rgba(12, 16, 36, 0.97));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(2, 6, 23, 0.6);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.3rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.modal-body { padding: 1.5rem; }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}
body.modal-open { overflow: hidden; }

/* ============================================
   Progress
   ============================================ */

.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-500), var(--accent-400));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar.bg-success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar.bg-warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ============================================
   Hero (landing)
   ============================================ */

.hero {
    position: relative;
    padding-block: clamp(4.5rem, 9vw, 7rem) clamp(3.5rem, 7vw, 5rem);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #0a0f24, #0b1029);
}

/* Lusaka street scene — Wikimedia Commons, "Traffic in Lusaka" by Johanneke Kroesbergen, CC BY-SA 4.0.
   This licence requires visible attribution; none is rendered on the page, so credit must be added
   back (footer line or a /credits page) before public deployment. */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('../images/hero-bg.jpg') center 38% / cover no-repeat;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(7, 10, 26, 0.88) 0%, rgba(7, 10, 26, 0.62) 38%, rgba(7, 10, 26, 0.28) 72%, rgba(7, 10, 26, 0.45) 100%),
        linear-gradient(180deg, rgba(7, 10, 26, 0.5) 0%, rgba(11, 16, 41, 0.1) 45%, rgba(11, 16, 41, 0.72) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="8" height="8" patternUnits="userSpaceOnUse"><path d="M 8 0 L 0 0 0 8" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    top: -35%;
    right: -10%;
    width: 55rem;
    height: 55rem;
    z-index: 1;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 62%);
    filter: blur(30px);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }
.hero h1 { color: #fff; margin-bottom: 1.4rem; text-shadow: 0 2px 22px rgba(2, 6, 23, 0.65); }
.hero .lead { font-size: 1.14rem; color: var(--text-2); margin-bottom: 2rem; max-width: 560px; }

.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 2.75rem; margin-top: 2.75rem; flex-wrap: wrap; }
.stat-item { text-align: left; }
.stat-number {
    font-family: var(--font-display);
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.1;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-top: 0.2rem;
}

/* ============================================
   Feature cards (landing)
   ============================================ */

.feature-card { text-align: center; padding: 2rem 1.5rem; }
.feature-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 1.4rem;
    font-size: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgba(129, 140, 248, 0.22), rgba(236, 72, 153, 0.12));
    border: 1px solid rgba(129, 140, 248, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px -8px rgba(99, 102, 241, 0.4);
}

.step-num {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    width: 44px;
    height: 44px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: var(--glow-primary);
}

/* CTA band */
.cta-band {
    position: relative;
    text-align: center;
    padding-block: clamp(3.5rem, 7vw, 5rem);
    border-block: 1px solid var(--border);
    background:
        radial-gradient(700px 320px at 50% 0%, rgba(99, 102, 241, 0.28), transparent 65%),
        linear-gradient(180deg, #0c1128, #0a0f22);
    overflow: hidden;
}
.cta-band h2, .cta-band p { max-width: 640px; margin-inline: auto; }

/* ============================================
   Auth pages
   ============================================ */

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem 1.25rem;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 44rem;
    height: 44rem;
    top: -20%;
    left: -10%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 62%);
    filter: blur(20px);
}
.auth-page::after {
    content: '';
    position: absolute;
    width: 40rem;
    height: 40rem;
    bottom: -25%;
    right: -12%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.14), transparent 62%);
    filter: blur(20px);
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 2.4rem;
    background: linear-gradient(165deg, rgba(24, 30, 60, 0.8), rgba(13, 17, 38, 0.88));
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 70px rgba(99, 102, 241, 0.12);
}
.auth-card.wide { max-width: 560px; }

.auth-header { text-align: center; margin-bottom: 1.9rem; }
.auth-logo {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.3rem;
}
.auth-subtitle { color: var(--text-3); font-size: 0.95rem; }
.auth-footer { text-align: center; color: var(--text-3); font-size: 0.92rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-3); font-size: 0.9rem; position: relative; z-index: 1; }
.back-link:hover { color: var(--text-1); }

/* ============================================
   Maps
   ============================================ */

.map-container {
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg), 0 0 45px rgba(2, 6, 23, 0.55);
}

#public-map { height: 420px; width: 100%; }
#clusters-map { height: 300px; width: 100%; }
#adminMap { height: 600px; width: 100%; }

/* Route picker inside modal */
.picker-map { height: 300px; }
#route-picker-map { height: 100%; width: 100%; }

.picker-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.picker-modes {
    display: inline-flex;
    background: var(--bg-2, #141b38);
    border: 1px solid var(--border);
    border-radius: var(--radius-full, 999px);
    padding: 0.25rem;
    gap: 0.25rem;
}

.picker-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full, 999px);
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.picker-mode.active {
    background: var(--primary-600, #4f46e5);
    color: #fff;
}

.picker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot-pickup { background: #22c55e; }
.dot-dest { background: #ef4444; }

.picker-hint { font-size: 0.8rem; color: var(--text-3); }

/* Map pin markers */
.picker-marker { background: none; border: none; }
.pin {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    border: 2.5px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45);
    position: relative;
}
.pin::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: inherit;
    border-bottom: 0;
}
.pin-pickup { background: #22c55e; }
.pin-pickup::after { border-top-color: #22c55e; }
.pin-dest { background: #ef4444; }
.pin-dest::after { border-top-color: #ef4444; }

/* Geocode suggestion dropdown */
.suggest-box {
    position: relative;
    z-index: 1001;
}
.suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.8rem;
    background: var(--bg-1, #0d1329);
    border: 1px solid var(--border);
    border-top: none;
    color: var(--text-2);
    font-size: 0.85rem;
    cursor: pointer;
}
.suggest-item:first-child { border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.suggest-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.suggest-item:hover { background: var(--bg-2, #141b38); color: var(--text-1); }
.input-append { position: relative; }
.input-append .suggest-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 40px;
    margin-top: 4px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.input-append .suggest-item {
    border: 1px solid var(--border);
    border-top: none;
}
.input-append .suggest-item:first-child { border-top: 1px solid var(--border); border-radius: 0; }
.input-append .suggest-item:last-child { border-radius: 0; }

/* Leaflet dark theme */
.leaflet-container { background: #0d1329; font-family: var(--font-body); }
.leaflet-bar a, .leaflet-bar a:hover {
    background: #141b38;
    color: var(--text-1);
    border-bottom: 1px solid var(--border);
}
.leaflet-bar a:hover { background: #1c2547; }
.leaflet-control-attribution {
    background: rgba(8, 11, 26, 0.7) !important;
    color: var(--text-3) !important;
    backdrop-filter: blur(6px);
    font-size: 10px;
    border-radius: 6px 0 0 0;
}
.leaflet-control-attribution a { color: var(--primary-300) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: rgba(18, 24, 48, 0.97);
    color: var(--text-1);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
}
.leaflet-popup-content { margin: 14px 16px; color: var(--text-2); line-height: 1.55; }
.leaflet-popup-content strong, .leaflet-popup-content b { color: var(--text-1); }
.leaflet-popup-content-wrapper .popup-title { font-family: var(--font-display); font-weight: 700; color: var(--text-1); margin-bottom: 0.4rem; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-3); }

/* Admin cluster markers */
.cluster-marker {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.cluster-ready { animation: pulse 2s infinite; }
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.12); opacity: 0.82; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: #05070f;
    border-top: 1px solid var(--border);
    color: var(--text-2);
    padding: 3.5rem 0 2rem;
    margin-top: 4rem;
}
.footer h5, .footer h6 { color: var(--text-1); margin-bottom: 1rem; }
.footer p { color: var(--text-3); }
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--text-1); }
.footer .list-unstyled { list-style: none; display: grid; gap: 0.5rem; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    text-align: center;
    color: var(--text-3);
    font-size: 0.85rem;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}

.animate-fade-in { animation: fade-up 0.65s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    #public-map { height: 340px; }
    #adminMap { height: 420px; }
    .hero-stats { gap: 1.75rem; }
    .stat-number { font-size: 1.9rem; }
    .auth-card { padding: 1.75rem; }
    .hero-bg { background-position: center 25%; }
    .hero-bg::after { background: linear-gradient(180deg, rgba(7, 10, 26, 0.84), rgba(11, 16, 41, 0.62) 55%, rgba(11, 16, 41, 0.88)); }
}

@media (max-width: 576px) {
    .hero-cta { flex-direction: column; }
    .hero-cta .btn { width: 100%; }
    .hero-stats { flex-direction: column; gap: 1.25rem; }
    .stat-item { display: flex; align-items: baseline; gap: 0.6rem; }
    .d-flex:not(.flex-column) { }
    .btn-lg { width: 100%; }
}

/* ============================================
   Settings page extras
   ============================================ */

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-500, #6366f1), var(--accent-500, #ec4899));
}

.border-danger { border: 1px solid rgba(239, 68, 68, 0.4) !important; }
.bg-danger-subtle { background: rgba(239, 68, 68, 0.08) !important; }

.form-check-input:checked { background-color: var(--primary-600, #4f46e5); border-color: var(--primary-600, #4f46e5); }

.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

/* Fleet management tabs */
.fleet-tabs {
    display: inline-flex;
    background: var(--bg-2, #141b38);
    border: 1px solid var(--border);
    border-radius: var(--radius-full, 999px);
    padding: 0.25rem;
    gap: 0.25rem;
}

.fleet-tab {
    padding: 0.45rem 1.1rem;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-full, 999px);
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.fleet-tab.active {
    background: var(--primary-600, #4f46e5);
    color: #fff;
}

/* Anchor offset for sticky navbar */
#fleet { scroll-margin-top: 90px; }

/* Dashboard stat blocks */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: var(--radius-md, 12px);
    background: var(--bg-2, #141b38);
    border: 1px solid var(--border);
}

.stat-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.5rem;
}
.stat-icon-blue { background: rgba(59,130,246,.15); color: #60a5fa; }
.stat-icon-amber { background: rgba(245,158,11,.15); color: #fbbf24; }
.stat-icon-green { background: rgba(16,185,129,.15); color: #34d399; }

.stat-value {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3, #94a3b8);
    margin-top: 0.4rem;
}

@media (max-width: 576px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* Admin stat grid variant (4 tiles, 2 cols) */
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-icon-violet { background: rgba(139,92,246,.15); color: #a78bfa; }

/* Auth pages — photo background */
body.auth-photo {
    background:
        linear-gradient(rgba(7, 10, 26, 0.68), rgba(7, 10, 26, 0.82)),
        url('https://thumb.wikimedia.org/wikipedia/commons/thumb/2/2d/Lusaka_City_Transport.jpg/1920px-Lusaka_City_Transport.jpg')
        center / cover no-repeat fixed;
    min-height: 100vh;
}
body.auth-photo::after {
    content: 'Photo: Wikimedia Commons, CC BY-SA 4.0';
    position: fixed;
    right: 12px;
    bottom: 10px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    z-index: 1;
    pointer-events: none;
}
body.auth-photo .auth-card {
    background: rgba(16, 22, 46, 0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ============================================
   Theme "Daylight" — admin dashboard
   Enabled by <html class="theme-light">. Most components follow
   automatically because they read these tokens; the rules below
   only patch the hard-coded dark literals.
   ============================================ */

html.theme-light {
    color-scheme: light;

    --bg-0: #f5f7fc;
    --bg-1: #ffffff;
    --bg-2: #eef2f9;
    --surface: #ffffff;
    --surface-2: #f1f5fb;
    --surface-solid: #ffffff;
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.16);

    --text-1: #0f172a;
    --text-2: #3d4a63;
    --text-3: #5b6b84;

    --success: #047857;
    --warning: #b45309;
    --danger: #be123c;
    --info: #1d4ed8;

    --primary-300: #4338ca;
    --primary-400: #4f46e5;
    --primary-500: #4f46e5;
    --primary-600: #4338ca;
    --violet-500: #7c3aed;

    --shadow-md: 0 6px 18px -8px rgba(15, 23, 42, 0.16);
    --shadow-lg: 0 22px 46px -16px rgba(15, 23, 42, 0.26);
    --glow-primary: 0 0 24px rgba(79, 70, 229, 0.18);
    --glow-success: 0 0 22px rgba(5, 150, 105, 0.16);
    --glass-blur: blur(14px) saturate(150%);

    --grad-brand: linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
    --grad-primary: linear-gradient(135deg, #4f46e5, #7c3aed);
}

html.theme-light body {
    background:
        radial-gradient(1100px 600px at 85% -10%, rgba(124, 58, 237, 0.10), transparent 60%),
        radial-gradient(900px 520px at -10% 20%, rgba(79, 70, 229, 0.09), transparent 55%),
        linear-gradient(180deg, #f7f9fd, #eef2fa 45%, #f7f9fd);
    background-attachment: fixed;
}

html.theme-light ::selection { background: rgba(79, 70, 229, 0.22); color: #111827; }

html.theme-light,
html.theme-light body { scrollbar-color: rgba(15, 23, 42, 0.22) transparent; }

html.theme-light::-webkit-scrollbar-thumb,
html.theme-light body::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); background-clip: content-box; border: 2px solid transparent; }

html.theme-light::-webkit-scrollbar-thumb:hover,
html.theme-light body::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.32); background-clip: content-box; }

/* Chrome */
html.theme-light .navbar { background: rgba(255, 255, 255, 0.86); }
html.theme-light .nav-link:hover { background: var(--surface-2); }
html.theme-light .nav-link.active { background: rgba(79, 70, 229, 0.10); }
html.theme-light .nav-toggle span { background: #334155; }
html.theme-light .dropdown-menu { background: rgba(255, 255, 255, 0.97); }
html.theme-light .dropdown-item:hover { background: var(--surface-2); }

/* Cards */
html.theme-light .card { background: #ffffff; backdrop-filter: none; }
html.theme-light .card.lift:hover { border-color: rgba(79, 70, 229, 0.32); box-shadow: var(--shadow-lg), 0 0 26px rgba(79, 70, 229, 0.10); }

/* Forms */
html.theme-light .form-control,
html.theme-light .form-select { background-color: #ffffff; }
html.theme-light .form-control:focus,
html.theme-light .form-select:focus { background-color: #f8faff; }
html.theme-light .form-select {
    /* Native arrow only — see .form-select note above */
}
html.theme-light .form-check-input { background-color: #ffffff; }

/* Buttons */
html.theme-light .btn-ghost { color: #1e293b; }
html.theme-light .btn-ghost:hover { background: var(--surface-2); border-color: rgba(15, 23, 42, 0.28); color: var(--text-1); }
html.theme-light .btn-outline-primary { color: #4338ca; }
html.theme-light .btn-outline-primary:hover { background: var(--grad-primary); border-color: transparent; color: #fff; }

/* Badges */
html.theme-light .badge-primary { background: rgba(79, 70, 229, 0.10); color: #4338ca; border-color: rgba(79, 70, 229, 0.26); }
html.theme-light .badge-success { background: rgba(5, 150, 105, 0.10); color: #047857; border-color: rgba(5, 150, 105, 0.26); }
html.theme-light .badge-warning { background: rgba(180, 83, 9, 0.10); color: #92400e; border-color: rgba(180, 83, 9, 0.26); }
html.theme-light .badge-danger { background: rgba(190, 18, 60, 0.10); color: #be123c; border-color: rgba(190, 18, 60, 0.26); }
html.theme-light .badge-info { background: rgba(29, 78, 216, 0.10); color: #1d4ed8; border-color: rgba(29, 78, 216, 0.26); }
html.theme-light .badge-secondary { background: #eef2f7; color: #334155; border-color: rgba(15, 23, 42, 0.12); }

/* Tables, progress, modals */
html.theme-light .table tbody tr:hover { background: rgba(79, 70, 229, 0.05); }
html.theme-light .spinner { border-color: rgba(15, 23, 42, 0.12); border-top-color: var(--primary-500); }
html.theme-light .progress { background: rgba(15, 23, 42, 0.10); }
html.theme-light .modal::before { background: rgba(15, 23, 42, 0.45); }
html.theme-light .modal-content { background: #ffffff; box-shadow: var(--shadow-lg); }

/* Alerts */
html.theme-light .alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
html.theme-light .alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
html.theme-light .alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
html.theme-light .alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
html.theme-light .alert .close-x:hover { background: rgba(15, 23, 42, 0.06); }

/* Stat tiles */
html.theme-light .stat-icon-blue { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
html.theme-light .stat-icon-amber { background: rgba(180, 83, 9, 0.12); color: #b45309; }
html.theme-light .stat-icon-green { background: rgba(5, 150, 105, 0.12); color: #047857; }
html.theme-light .stat-icon-violet { background: rgba(124, 58, 237, 0.12); color: #6d28d9; }

/* Map */
html.theme-light .map-container { box-shadow: var(--shadow-lg); }
html.theme-light .leaflet-container { background: #e9eef6; }
html.theme-light .leaflet-bar a { background: #ffffff; color: #334155; border-bottom-color: rgba(15, 23, 42, 0.08); }
html.theme-light .leaflet-bar a:hover { background: var(--surface-2); color: var(--text-1); }
html.theme-light .leaflet-control-attribution { background: rgba(255, 255, 255, 0.88) !important; color: #5b6b84 !important; }
html.theme-light .leaflet-control-attribution a { color: #4338ca !important; }
html.theme-light .leaflet-popup-content-wrapper,
html.theme-light .leaflet-popup-tip { background: #ffffff; color: var(--text-2); border-color: rgba(15, 23, 42, 0.12); box-shadow: var(--shadow-lg); }
html.theme-light .leaflet-popup-content { color: var(--text-2); }
html.theme-light .leaflet-popup-content strong,
html.theme-light .leaflet-popup-content b,
html.theme-light .leaflet-popup-content .popup-title { color: var(--text-1); }
html.theme-light .leaflet-container a.leaflet-popup-close-button { color: #94a3b8; }
html.theme-light .cluster-marker { border-color: #ffffff; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.3); }

/* Theme switch button — sun in dark mode, moon in light mode */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: var(--transition);
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--primary-500); color: var(--primary-300); }
.theme-toggle .icon-moon { display: none; }
html.theme-light .theme-toggle .icon-sun { display: none; }
html.theme-light .theme-toggle .icon-moon { display: inline; }

@media (max-width: 991px) {
    .nav-item > .theme-toggle { width: 100%; }
}

/* Anchor offset for sticky navbar (customer dashboard) */
#my-routes { scroll-margin-top: 90px; }

/* Customer routes grid */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.route-card {
    background: var(--bg-2, #141b38);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition, all 0.2s ease);
}

.route-card:hover { border-color: var(--primary-500, #6366f1); transform: translateY(-2px); }

.route-card-active {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15), var(--shadow-md);
}

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

.route-status-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--text-3, #64748b);
    display: inline-block;
}
.route-status-dot.on {
    background: var(--success, #34d399);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.route-od { display: flex; flex-direction: column; gap: 0.15rem; }

.route-point { display: flex; align-items: flex-start; gap: 0.55rem; }

.route-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}
.route-dot-pickup { background: #34d399; }
.route-dot-dest { background: #f87171; }

.route-addr {
    font-size: 0.85rem;
    color: var(--text-1, #f1f5f9);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: box;
    overflow: hidden;
}

.route-line {
    width: 2px;
    height: 12px;
    margin-left: 4px;
    background: linear-gradient(var(--border-strong), transparent);
}

.route-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.78rem;
    color: var(--text-3, #94a3b8);
}

.route-card-foot {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Footer social icons */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    color: var(--text-2);
    transition: var(--transition);
}
.social-icon:hover { color: var(--primary-600); background: var(--surface-2); }

/* Tracking popup passenger list */
.popup-pax-head { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.popup-pax-list { max-height: 160px; overflow-y: auto; margin-top: 4px; }
.popup-pax { font-size: 0.8rem; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.popup-pax small { color: var(--text-3); }
.leaflet-popup-content { min-width: 220px; }
