/* ==========================================================================
   CITY RIDE TAXI Partner Hub — vendor dispatch console
   Dark by default, light theme via <html data-theme="light">.
   ========================================================================== */

:root {
    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', 'Inter', system-ui, sans-serif;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-w: 248px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 64px;
    --bottom-nav-h: 60px;

    /* Dark palette (default) */
    --bg: #0a0f0c;
    --bg-elev: #0e1410;
    --surface: #121914;
    --surface-2: #172019;
    --surface-3: #1e2921;
    --seg-active: #243128;
    --border: rgba(214, 235, 220, 0.08);
    --border-strong: rgba(214, 235, 220, 0.15);
    --text: #e8f0ea;
    --text-2: #b4c3b9;
    --muted: #7d9185;

    --accent: #9ed36a;
    --accent-strong: #b5e38a;
    --accent-ink: #0c1a08;
    --accent-soft: rgba(158, 211, 106, 0.12);
    --accent-ring: rgba(158, 211, 106, 0.32);

    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.13);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.13);
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
    --overlay: rgba(3, 6, 4, 0.7);
    --route: #a3e635;
    --map-filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.6);

    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f3f6f2;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #f5f8f4;
    --surface-3: #eaf0e8;
    --seg-active: #ffffff;
    --border: #e2e9e0;
    --border-strong: #cfd9cc;
    --text: #15231a;
    --text-2: #34473b;
    --muted: #637468;

    --accent: #4f8f2b;
    --accent-strong: #3f7a1f;
    --accent-ink: #ffffff;
    --accent-soft: rgba(79, 143, 43, 0.1);
    --accent-ring: rgba(79, 143, 43, 0.26);

    --success: #15803d;
    --success-soft: rgba(21, 128, 61, 0.1);
    --warning: #b45309;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.09);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.09);
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.09);

    --shadow-sm: 0 1px 2px rgba(16, 24, 18, 0.06);
    --shadow: 0 8px 24px rgba(16, 24, 18, 0.08);
    --shadow-lg: 0 24px 60px rgba(16, 24, 18, 0.18);
    --overlay: rgba(15, 25, 18, 0.45);
    --route: #2f7d1f;
    --map-filter: none;

    color-scheme: light;
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; }
[hidden] { display: none !important; }
.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.text-accent { color: var(--accent); }

svg.i {
    width: 18px; height: 18px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
svg.i-sm { width: 15px; height: 15px; }
svg.i-lg { width: 22px; height: 22px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- App shell ---------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky; top: 0;
    width: var(--sidebar-w); height: 100vh; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    transition: width 0.22s ease;
    z-index: 50;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-top {
    height: var(--topbar-h); flex-shrink: 0;
    display: flex; align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.brand img { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; background: #fff; padding: 3px; flex-shrink: 0; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text span { color: var(--accent); }

.profile {
    display: flex; align-items: center; gap: 12px;
    margin: 14px 12px 4px; padding: 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    min-width: 0;
}
.avatar {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink);
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
}
.profile-meta { min-width: 0; }
.profile-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-sub .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 14px 10px 6px; white-space: nowrap; }
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    width: 100%; height: 40px; padding: 0 12px;
    border: 0; border-radius: 10px;
    background: transparent; color: var(--text-2);
    font-weight: 500; font-size: 13.5px; text-align: left;
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .nav-item.active::before {
    content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item.danger { color: var(--danger); }
.nav-item.danger:hover { background: var(--danger-soft); }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
    display: inline-grid; place-items: center;
    border-radius: 999px; background: var(--warning); color: #1c1403;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav-badge.info { background: var(--info); color: #fff; }

.sidebar-foot { padding: 10px 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.sidebar-toggle svg { transition: transform 0.22s ease; }

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .profile-meta { display: none; }
.sidebar.collapsed .sidebar-top { justify-content: center; padding: 0; }
.sidebar.collapsed .profile { justify-content: center; margin: 14px 10px 4px; padding: 8px; background: transparent; border-color: transparent; }
.sidebar.collapsed .nav, .sidebar.collapsed .sidebar-foot { padding-left: 10px; padding-right: 10px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-item.active::before { left: -10px; }
.sidebar.collapsed .nav-badge { position: absolute; top: 3px; right: 5px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .nav-item[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none;
    background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; z-index: 100;
}

.main { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 40;
    min-height: var(--topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 10px 28px;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.topbar-title p { margin: 1px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.live-chip {
    display: inline-flex; align-items: center; gap: 8px;
    height: 30px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--border-strong);
    color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.live-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live-chip.is-live { color: var(--success); border-color: var(--success-soft); background: var(--success-soft); }
.live-chip.is-live .dot { background: var(--success); animation: pulse 2s ease-in-out infinite; }

.content { flex: 1; padding: 24px 28px; }
.tab-content { animation: fadeIn 0.2s ease; }

.mobile-bar, .bottom-nav { display: none; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px;
    border: 1px solid transparent; border-radius: 10px;
    background: transparent; color: var(--text);
    font-weight: 600; font-size: 13.5px; white-space: nowrap;
    cursor: pointer; text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary, .btn-submit { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled), .btn-submit:hover:not(:disabled) { background: var(--accent-strong); }
.btn-outline, .btn-secondary { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-outline:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger-outline, .btn.danger { border-color: var(--danger-soft); background: transparent; color: var(--danger); }
.btn-danger-outline:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm, .ride-action-btn { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-sm svg.i, .ride-action-btn svg.i { width: 14px; height: 14px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }

.icon-btn {
    width: 36px; height: 36px; flex-shrink: 0;
    display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 10px;
    background: transparent; color: var(--muted);
    cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.bordered { border-color: var(--border-strong); background: var(--surface); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-ring); }

/* --- Form controls ------------------------------------------------------ */
.label, .input-group > label {
    display: block; margin-bottom: 6px;
    font-size: 12px; font-weight: 600; color: var(--text-2);
}
.input-group { display: flex; flex-direction: column; min-width: 0; }

/* :where() keeps this base rule at element specificity so component classes (e.g. .search input) can override it */
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])), select, textarea {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface-2); color: var(--text);
    font-size: 14px; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d9185' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
input[type="date"], input[type="time"] { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.field-hint, .dispatch-hint { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.field-hint strong, .dispatch-hint strong { color: var(--text); }
.hint-warning { color: var(--warning); }
.form-error {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 12px; border-radius: 10px;
    background: var(--danger-soft); color: var(--danger);
    font-size: 13px; font-weight: 500;
}

.switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.switch-title { font-weight: 600; font-size: 13.5px; }
.switch-sub { font-size: 12px; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.2s, border-color 0.2s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Address suggestions & driver search */
.field { position: relative; flex: 1; min-width: 0; }
.suggestions {
    display: none;
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
    max-height: 280px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 12px; box-shadow: var(--shadow-lg);
}
.suggestion-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; cursor: pointer;
    font-size: 13px; color: var(--text-2); line-height: 1.4;
    border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover { background: var(--surface-2); color: var(--text); }
.suggestion-item > svg.i { margin-top: 1px; color: var(--muted); }
.suggestion-item.is-blocked { opacity: 0.5; cursor: not-allowed; }
.suggestion-hint { padding: 8px 12px; font-size: 12px; color: var(--muted); background: var(--warning-soft); border-bottom: 1px solid var(--border); }
.suggestion-hint strong { color: var(--warning); }
.suggestion-empty { padding: 12px; font-size: 12.5px; color: var(--muted); }
.driver-option { flex: 1; min-width: 0; }
.driver-option-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.driver-option-top strong { color: var(--text); letter-spacing: 0.02em; }
.driver-option-sub { font-size: 12px; color: var(--muted); }
.tag {
    display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
    border-radius: 6px; background: var(--surface-3); color: var(--text-2);
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.tag.warning { background: var(--warning-soft); color: var(--warning); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.avail { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.avail::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.avail-online { color: var(--success); }
.avail-offline { color: var(--muted); }
.avail-busy { color: var(--warning); }

/* --- Cards -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* KPI strip */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-width: 0; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-icon.info { background: var(--info-soft); color: var(--info); }
.kpi-icon.warning { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.violet { background: var(--violet-soft); color: var(--violet); }
.kpi-icon.success { background: var(--success-soft); color: var(--success); }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.is-attention { border-color: var(--warning-soft); background: linear-gradient(0deg, var(--warning-soft), var(--warning-soft)), var(--surface); cursor: pointer; }
.kpi.is-attention .kpi-value { color: var(--warning); }

/* --- Booking ------------------------------------------------------------ */
/* Desktop: trip + passenger on the left; map, vehicles and fare on the right, pinned to the viewport height
   so the whole booking fits one screen (the map absorbs whatever height is left). */
.booking-layout { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(400px, 1.05fr); gap: 16px; align-items: start; }
.booking-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.booking-side {
    position: sticky; top: calc(var(--topbar-h) + 24px);
    height: calc(100vh - var(--topbar-h) - 48px); min-height: 540px;
    display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.form-card { position: relative; }
.step { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: 0; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step-num {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--surface-3); color: var(--text-2);
    font-size: 11.5px; font-weight: 700;
}
.step-title { font-weight: 600; font-size: 14px; }
.step-aside { margin-left: auto; }
.step-note { font-size: 12px; color: var(--muted); font-weight: 400; }

.attention-bar {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; padding: 8px 10px 8px 14px; border-radius: 12px;
    background: var(--warning-soft); color: var(--warning);
    font-size: 13px; font-weight: 600;
}
.attention-bar .btn { margin-left: auto; }

.segmented {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
    padding: 4px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.category-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 36px; border: 0; border-radius: 9px;
    background: transparent; color: var(--text-2);
    font-weight: 600; font-size: 13.5px; cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.category-btn:hover { color: var(--text); }
.category-btn.active { background: var(--seg-active); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border-strong); }
.category-btn.active svg.i { color: var(--accent); }

/* Route timeline */
.route { position: relative; display: flex; flex-direction: column; gap: 8px; }
.route::before {
    content: ''; position: absolute; left: 6px; top: 20px; bottom: 20px; width: 2px;
    background: repeating-linear-gradient(to bottom, var(--border-strong) 0 4px, transparent 4px 8px);
}
.route-row { position: relative; display: flex; align-items: center; gap: 10px; }
.route-dot { position: relative; z-index: 1; width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%; border: 3.5px solid; background: var(--surface); }
.route-dot.pickup { border-color: var(--success); }
.route-dot.stop { border-color: var(--warning); }
.route-dot.drop { border-color: var(--danger); border-radius: 4px; }
#extra-drops-container { flex-direction: column; gap: 8px; }
.extra-drop-row { animation: fadeIn 0.2s ease; }
.route-actions { display: flex; gap: 4px; }
.map-picking-active input { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-ring) !important; }
.add-stop { margin: 0; }
/* "Add stop" and the pickup date/time share one row under the route */
.route-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px; padding-left: 18px; }
.schedule-inline { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.inline-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.schedule-inline input[type="date"] { width: 150px; height: 36px; }
.schedule-inline input[type="time"] { width: 112px; height: 36px; }
#return-date-group, #round-trip-toggle-group { margin-top: 10px; }
#round-trip-toggle-group .switch-row { padding: 8px 12px; }

.switch-row .return-inline { margin-left: auto; width: 160px; }
.switch-row .return-inline input { height: 34px; }
.passenger-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.parcel-grid { margin-top: 12px; }
.label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-row label { display: block; margin: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.driver-search { margin-top: 12px; }
.details-card .dispatch-hint { margin-top: 6px; font-size: 12px; }

/* Vehicles: compact tiles, two or three per row */
.vehicle-card { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.vehicle-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 4px 16px; flex-shrink: 0; }
.vehicle-card .vehicle-options-grid { padding: 4px 12px 12px; overflow-y: auto; min-height: 0; }
.vehicle-options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.vehicle-options-grid > .empty, .vehicle-options-grid > .dispatch-empty { grid-column: 1 / -1; padding: 18px 14px; }
.vehicle-options-grid > .skeleton { height: 56px; }
.vehicle-card-item {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 8px 10px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface);
    cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.vehicle-card-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.vehicle-card-item.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.vehicle-card-item.vehicle-disabled { opacity: 0.45; cursor: not-allowed; }
.vehicle-card-item.vehicle-disabled:hover { background: var(--surface); border-color: var(--border); }
.v-icon { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); transition: background 0.15s, color 0.15s; }
.v-icon svg { width: 24px; height: 24px; }
.vehicle-card-item.selected .v-icon { background: var(--accent); color: var(--accent-ink); }
.v-main { flex: 1; min-width: 0; }
.v-top, .v-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.v-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.v-fare { font-family: var(--font-display); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.v-margin { font-size: 11px; font-weight: 600; color: var(--success); white-space: nowrap; }
.v-margin.plain { color: var(--muted); font-weight: 500; }
.v-margin.blocked { color: var(--warning); }

.driver-chip {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px; padding: 8px 10px 8px 12px; border-radius: 10px;
    background: var(--accent-soft); border: 1px solid var(--accent-ring);
    font-size: 13px;
}
.driver-chip .icon-btn { margin-left: auto; }
.driver-chip strong { color: var(--text); }

/* Fare summary + confirm */
.summary { flex: none; padding: 12px 16px 14px; }
.summary-line { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 12.5px; color: var(--muted); }
.summary-line b { margin-left: 4px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-line b.margin { color: var(--success); }
.summary-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.summary-total { min-width: 0; }
.summary-total-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.summary .amount { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.summary-cta .btn { flex: 0 1 240px; }
.info-tip { display: inline-flex; color: var(--muted); cursor: help; border-radius: 50%; }
.info-tip svg.i { width: 14px; height: 14px; }

/* Map */
.map-panel { position: relative; flex: 1 1 0; min-height: 200px; overflow: hidden; }
#live-route-map, #track-map { width: 100%; height: 100%; background: var(--surface-2); }
#live-route-map .leaflet-tile-pane, #track-map .leaflet-tile-pane { filter: var(--map-filter); }
.map-overlay { position: absolute; top: 58px; left: 60px; right: 14px; z-index: 501; display: flex; justify-content: center; pointer-events: none; }
.map-banner {
    pointer-events: auto;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 6px 6px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--accent);
    box-shadow: var(--shadow); font-weight: 600; font-size: 13px;
    animation: fadeIn 0.2s ease;
}
.map-banner svg.i { color: var(--accent); }
.map-legend {
    position: absolute; right: 12px; top: 12px; z-index: 500;
    display: flex; gap: 14px; align-items: center;
    padding: 7px 12px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); font-size: 12px; color: var(--text-2);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.leaflet-container { font-family: var(--font-ui); }
.leaflet-bar { border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow-sm) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface) !important; color: var(--text) !important; border-bottom-color: var(--border) !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; }
.leaflet-control-attribution { background: var(--surface) !important; color: var(--muted) !important; opacity: 0.85; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 10px 14px; font-weight: 600; }

.pin-wrap { background: none; border: 0; }
.pin {
    width: 28px; height: 28px;
    border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    display: grid; place-items: center;
    border: 2.5px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.pin span { transform: rotate(45deg); color: #fff; font-size: 11.5px; font-weight: 800; font-family: var(--font-ui); }
.pin-pickup { background: #16a34a; }
.pin-drop { background: #dc2626; }
.pin-stop { background: #d97706; }
.car-marker {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink);
    border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.car-marker svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* --- Empty & loading states -------------------------------------------- */
.empty, .dispatch-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 28px 16px; text-align: center;
    color: var(--muted); font-size: 13px;
    border: 1px dashed var(--border-strong); border-radius: 12px;
}
.empty svg.i, .dispatch-empty svg.i { width: 26px; height: 26px; opacity: 0.7; }
.empty.is-error, .dispatch-empty.is-error { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.empty-title { font-weight: 600; color: var(--text); font-size: 14px; }
.skeleton { height: 64px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Tables ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table, .history-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th, .history-table th {
    text-align: left; white-space: nowrap;
    padding: 10px 16px;
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--muted); background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.table td, .history-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:not(.empty-row):hover td { background: var(--surface-2); }
.table .empty-row td { padding: 40px 16px; text-align: center; color: var(--muted); }
.table .right { text-align: right; }

.ride-id { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.cell-sub { font-size: 12px; color: var(--muted); }
.cell-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.route-cell { display: flex; flex-direction: column; gap: 4px; min-width: 200px; max-width: 320px; }
.route-cell .leg { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.route-cell .leg i { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--success); }
.route-cell .leg.to i { background: var(--danger); border-radius: 2px; }
.route-cell .leg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stops-badge { margin-left: 6px; }
.person { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.person-name { font-weight: 600; }
.phone-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--info); font-weight: 500; }
.phone-link svg.i { width: 13px; height: 13px; }
.ride-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.ride-note svg.i { width: 14px; height: 14px; margin-top: 1px; }
.ride-note.warning { color: var(--warning); }
.ride-note.danger { color: var(--danger); }
.ride-note.live svg.i { animation: pulse 1.6s ease-in-out infinite; color: var(--violet); }
.driver-line { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.fare-cell { display: flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.margin-line { font-size: 12px; color: var(--success); font-weight: 600; white-space: nowrap; }
.otp-chip {
    display: inline-flex; align-items: center; height: 30px; padding: 0 10px;
    border-radius: 8px; border: 1px dashed var(--accent);
    background: var(--accent-soft); color: var(--accent);
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 15px; font-weight: 700; letter-spacing: 0.18em;
}
.ride-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Status pills */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 10px; border-radius: 999px;
    background: var(--surface-3); color: var(--text-2);
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-completed, .status-finished, .status-paid, .status-success, .payout-paid { background: var(--success-soft); color: var(--success); }
.status-assigned, .status-ongoing, .status-active, .status-vendor_assigned { background: var(--info-soft); color: var(--info); }
.status-pending { background: var(--violet-soft); color: var(--violet); }
.status-pending::before, .status-vendor_assigned::before { animation: pulse 1.4s ease-in-out infinite; }
.status-pending_vendor_assignment, .status-cancel_requested, .payout-requested { background: var(--warning-soft); color: var(--warning); }
.status-cancelled, .status-rejected, .payout-rejected { background: var(--danger-soft); color: var(--danger); }
.pill-plain::before { display: none; }

/* Rides toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    height: 32px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: transparent;
    color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip .count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.active .count { background: rgba(127, 127, 127, 0.28); color: var(--bg); }
.chip.attention .count { background: var(--warning); color: #1c1403; }
.search { position: relative; margin-left: auto; width: 280px; max-width: 100%; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 16px; height: 16px; }
.search input { padding-left: 34px; height: 36px; }

/* --- Earnings ----------------------------------------------------------- */
.wallet-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    padding: 24px 26px; margin-bottom: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent-ring);
    background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 60%), var(--surface);
}
.wallet-hero .kpi-label { font-size: 12.5px; }
.wallet-hero-amount { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wallet-hero-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.wallet-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.sub-tabs { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.sub-tab { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sub-tab.active { background: var(--seg-active); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border-strong); }
.amount-in { color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-out { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.truncate { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Tariffs ------------------------------------------------------------ */
.info-banner {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 16px 20px; margin-bottom: 20px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: var(--surface);
}
.info-banner .kpi-icon { width: 40px; height: 40px; }
.info-banner-text { flex: 1; min-width: 240px; font-size: 13px; color: var(--text-2); }
.info-banner-text strong { color: var(--text); }
.info-banner-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tariff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.tariff-grid > .card { min-width: 0; }
.tariff-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.tariff-card-head .v-icon { width: 40px; height: 40px; }
.tariff-card-head .v-icon svg { width: 24px; height: 24px; }
.tariff-card-head h3 { font-size: 14.5px; font-weight: 600; }
.tariff-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tariff-row:last-child { border-bottom: 0; }
.tariff-row-main { flex: 1; min-width: 0; }
.tariff-row-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.tariff-row-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate-sheet td:first-child { font-weight: 600; white-space: nowrap; }
.rate-sheet td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rules { margin-top: 18px; padding: 16px 18px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.rules h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.rules ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.fieldset-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--text); }
.fieldset-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* --- Modals ------------------------------------------------------------- */
.modal, .map-modal {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    align-items: center; justify-content: center;
    padding: 20px;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-card {
    width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow-lg); overflow: hidden;
    animation: modalIn 0.18s ease;
}
.modal-card.wide { max-width: 960px; }
.modal-card.medium { max-width: 640px; }
.modal-card.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-head .icon-btn:last-child { margin-left: auto; }
.modal-head-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.modal-head-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }

/* Dispatch confirmation */
.success-hero { text-align: center; padding: 4px 0 16px; }
.success-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.success-icon svg.i { width: 26px; height: 26px; }
.success-ref { font-size: 13px; color: var(--muted); }
.otp-block { margin: 14px 0 6px; padding: 16px; border-radius: 14px; border: 1px dashed var(--accent); background: var(--accent-soft); text-align: center; }
.otp-block .cell-label { color: var(--text-2); }
.otp-display { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 2.3rem; font-weight: 800; letter-spacing: 0.32em; color: var(--accent); margin: 4px 0 2px; padding-left: 0.32em; }
.kv { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; }
.kv-row > span:first-child { color: var(--muted); }
.kv-row > strong, .kv-row > span:last-child { text-align: right; font-weight: 600; }
.kv-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }
.kv-total strong:last-child { font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); line-height: 1.5; }
.callout svg.i { margin-top: 1px; color: var(--info); }
.callout.success svg.i { color: var(--success); }
.share-text { width: 100%; margin-top: 10px; font-size: 13px; }
.section-gap { margin-top: 16px; }

/* Invoice */
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.invoice-head h4 { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.invoice-section { padding: 14px 0; border-top: 1px solid var(--border); }
.invoice-section:first-of-type { border-top: 0; padding-top: 0; }
.otp-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }

/* Tracking */
.track-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); min-height: 440px; }
.track-map-wrap { position: relative; min-height: 440px; }
#track-map { position: absolute; inset: 0; }
#track-details { padding: 20px; overflow-y: auto; max-height: 72vh; border-left: 1px solid var(--border); }
.track-driver { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin: 12px 0; }
.track-driver .avatar { background: var(--info-soft); color: var(--info); }
.track-section { margin-top: 16px; }

/* Toasts */
#vendor-toast-stack { position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.vendor-toast {
    pointer-events: auto;
    display: flex; gap: 12px; padding: 14px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 14px;
    box-shadow: var(--shadow-lg);
    font-size: 13px; line-height: 1.45;
    animation: modalIn 0.2s ease;
}
.vendor-toast .t-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: var(--info-soft); color: var(--info); }
.vendor-toast-success .t-icon { background: var(--success-soft); color: var(--success); }
.vendor-toast-warning .t-icon { background: var(--warning-soft); color: var(--warning); }
.vendor-toast-error .t-icon { background: var(--danger-soft); color: var(--danger); }
.vendor-toast .t-body { flex: 1; min-width: 0; }
.vendor-toast strong { display: block; margin-bottom: 2px; font-size: 13.5px; }
.vendor-toast .t-msg { color: var(--text-2); }
.vendor-toast-actions { display: flex; gap: 8px; margin-top: 10px; }
.vendor-toast-actions button { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.vendor-toast-actions button:first-child:not(:only-child) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1280px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .booking-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .booking-main, .booking-side { display: contents; }
    .trip-card { order: 1; }
    .map-panel { order: 2; flex: none; height: 260px; min-height: 0; }
    .vehicle-card { order: 3; overflow: visible; }
    .vehicle-card .vehicle-options-grid { overflow: visible; }
    .details-card { order: 4; }
    .summary { order: 5; position: sticky; bottom: 12px; z-index: 20; box-shadow: 0 -8px 28px -10px rgba(0, 0, 0, 0.45); }
    .track-layout { grid-template-columns: minmax(0, 1fr); }
    .track-map-wrap { min-height: 300px; }
    #track-details { border-left: 0; border-top: 1px solid var(--border); max-height: none; }
}
@media (max-width: 900px) {
    .app { flex-direction: column; }
    .sidebar { display: none; }
    .main { height: auto; overflow: visible; }
    .mobile-bar {
        display: flex; align-items: center; gap: 6px;
        position: sticky; top: 0; z-index: 60;
        height: 56px; padding: 0 10px 0 14px;
        background: var(--bg-elev); border-bottom: 1px solid var(--border);
    }
    .mobile-bar .brand { margin-right: auto; }
    .mobile-bar .brand img { width: 30px; height: 30px; }
    .topbar { position: static; min-height: 0; padding: 18px 16px 4px; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .topbar-actions { display: none; }
    .topbar-title p { white-space: normal; }
    .content { padding: 12px 16px calc(var(--bottom-nav-h) + 32px + env(safe-area-inset-bottom)); }
    .bottom-nav {
        display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-elev); border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
    }
    .bottom-nav .nav-item { flex-direction: column; justify-content: center; gap: 3px; height: var(--bottom-nav-h); padding: 0; border-radius: 0; font-size: 11px; font-weight: 600; text-align: center; }
    .bottom-nav .nav-item.active { background: transparent; }
    .bottom-nav .nav-item.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
    .bottom-nav .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; min-width: 17px; height: 17px; font-size: 10px; padding: 0 5px; }
    .summary { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px); }
    .search { width: 100%; margin-left: 0; }
    .stat-row { grid-template-columns: minmax(0, 1fr); }
    #vendor-toast-stack { top: 64px; }
}
@media (max-width: 760px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody { display: block; width: 100%; }
    .table-stack tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack td { display: block; min-width: 0; padding: 4px 0; border: 0 !important; background: transparent !important; }
    .table-stack td.span-all, .table-stack .empty-row td { grid-column: 1 / -1; }
    .table-stack td.is-empty { display: none; }
    .table-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
    .table-stack td.cell-status { position: absolute; top: 12px; right: 16px; width: auto; padding: 0; }
    .table-stack td.cell-status::before { display: none; }
    .table-stack .route-cell, .table-stack .person { max-width: none; min-width: 0; }
    .table-stack .empty-row td { padding: 32px 0; }
    .ride-actions { margin-top: 6px; }
}
@media (max-width: 600px) {
    .kpi-grid { gap: 10px; }
    .kpi { padding: 12px; gap: 10px; }
    .kpi-icon { width: 34px; height: 34px; border-radius: 10px; }
    .kpi-icon svg.i { width: 16px; height: 16px; }
    .kpi-value { font-size: 1.2rem; }
    .kpi-sub { display: none; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .step, .summary { padding-left: 16px; padding-right: 16px; }
    .summary { padding: 10px 12px 10px 16px; }
    .summary-line { display: none; }
    .summary-cta { margin-top: 0; padding-top: 0; border-top: 0; gap: 12px; }
    .summary .amount { font-size: 1.35rem; }
    .summary-total-label { font-size: 11.5px; }
    .summary-cta .btn { flex: 0 1 auto; padding: 0 16px; }
    .map-panel { height: 200px; }
    .switch-row { flex-wrap: wrap; }
    .route-footer { padding-left: 0; }
    .schedule-inline { margin-left: 0; width: 100%; }
    .schedule-inline input[type="date"], .schedule-inline input[type="time"] { flex: 1; width: auto; min-width: 0; }
    .switch-row .return-inline { order: 3; width: 100%; margin-left: 0; }
    .map-legend { display: none; }
    #vendor-toast-stack { top: 64px; }
    .modal, .map-modal { align-items: flex-end; padding: 0; }
    .modal-card { max-width: none !important; max-height: 92vh; border-radius: 20px 20px 0 0; border-bottom: 0; }
    .modal-foot .btn { flex: 1; }
    .wallet-hero { padding: 20px; }
    .wallet-hero-amount { font-size: 2rem; }
    .wallet-hero-actions, .wallet-hero-actions .btn { width: 100%; }
    .sub-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
    .sub-tab { height: auto; min-height: 34px; padding: 6px 8px; white-space: normal; line-height: 1.2; font-size: 12.5px; }
    .tariff-grid { grid-template-columns: minmax(0, 1fr); }
    .card-head { padding: 14px 16px; }
}

.search.full { width: 100%; margin-left: 0; }
.modal-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.text-success { color: var(--success); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }

@media (min-width: 1101px) and (max-height: 760px) {
    .map-panel { min-height: 150px; }
    .booking-side { min-height: 480px; }
    .category-btn { height: 34px; }
    .step { padding-top: 12px; padding-bottom: 12px; }
}
