:root {
    color-scheme: light;
    --bg: #0b1220;
    --bg-soft: #121b2e;
    --card: #1a2438;
    --card-soft: #222e46;
    --border: rgba(255, 255, 255, 0.08);
    --text: #eef2ff;
    --muted: rgba(238, 242, 255, 0.64);
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --accent-warm: #fb923c;
    --danger: #f97316;
    --success: #22c55e;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.45);
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: radial-gradient(circle at top left, #182238 0%, #0b1220 45%, #070b12 100%);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--accent), var(--accent-warm));
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 500;
}

.nav-links a {
    opacity: 0.85;
}

.nav-links .primary-link {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--accent-strong);
    color: #0b1220;
}

.page {
    flex: 1;
    padding: 24px 64px 64px;
}

.hero {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    align-items: center;
    margin-top: 32px;
}

.hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    margin-bottom: 16px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.subtext {
    color: var(--muted);
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    background: linear-gradient(120deg, var(--accent-strong), var(--accent-warm));
    color: #0b1220;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
}

.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hero-panel {
    background: var(--card);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card {
    background: var(--card-soft);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
}

.stat-detail {
    color: var(--muted);
    font-size: 0.85rem;
}

.map-preview {
    position: relative;
    height: 220px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(251, 146, 60, 0.2));
    overflow: hidden;
}

.map-lines {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

.pulse-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
    animation: pulse 2.4s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(56, 189, 248, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 48px;
}

.feature-card {
    background: var(--card);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid var(--border);
}

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--muted);
    line-height: 1.6;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.auth-card {
    width: min(420px, 100%);
    background: var(--card);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.field {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
}

.field input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(11, 18, 32, 0.7);
    color: var(--text);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

.alert {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fecaca;
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 12px;
}

.inline-form {
    display: inline-flex;
}

.link-button {
    background: transparent;
    border: none;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.driver-shell,
.admin-shell {
    display: grid;
    gap: 24px;
}

.driver-header,
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.status-pill {
    background: rgba(148, 163, 184, 0.2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pill.success {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
}

.driver-grid,
.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 24px;
}

.admin-grid.single {
    grid-template-columns: 2.2fr 1.2fr;
}

.panel {
    background: var(--card);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid var(--border);
}

.status-card {
    display: grid;
    gap: 12px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted);
}

.status-row strong {
    color: var(--text);
    font-weight: 600;
}

.action-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.map-card {
    padding: 0;
    overflow: hidden;
}

.map {
    height: 420px;
    width: 100%;
}

.info-card h3 {
    margin-bottom: 12px;
}

.list {
    display: grid;
    gap: 8px;
    padding-left: 18px;
}

.list li {
    color: var(--muted);
    line-height: 1.5;
}

.driver-list {
    display: grid;
    gap: 12px;
}

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

.list-body {
    display: grid;
    gap: 12px;
}

.driver-item,
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--card-soft);
    border: 1px solid var(--border);
}

.driver-item:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.driver-name {
    font-weight: 600;
}

.driver-meta {
    text-align: right;
}

.driver-history {
    max-height: 420px;
    overflow-y: auto;
}

.history-item {
    background: rgba(15, 23, 42, 0.7);
}

.mobile-nav {
    display: none;
}

.tiny {
    font-size: 0.75rem;
}

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

    .features {
        grid-template-columns: 1fr;
    }

    .driver-grid,
    .admin-grid,
    .admin-grid.single {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .topbar {
        padding: 16px 20px;
    }

    .page {
        padding: 16px 20px 100px;
    }

    .nav-links {
        display: none;
    }

    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(9, 13, 20, 0.92);
        backdrop-filter: blur(12px);
        display: flex;
        justify-content: space-around;
        padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
    }

    .mobile-tab {
        color: var(--text);
        font-size: 0.85rem;
        font-weight: 600;
        background: transparent;
        border: none;
    }

    .mobile-tab.danger {
        color: var(--danger);
        background: transparent;
        border: none;
    }

    .map {
        height: 320px;
    }

    .driver-header,
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px;
    }
}
