/* NEMT Platform theme — light, quiet, one brand accent. */
:root {
  --brand: #1E6FA8; --brand-soft: #1E6FA814;
  --bg: #F5F7FA; --panel: #FFFFFF; --line: #DCE3EC; --ink: #1F2937; --muted: #6B7280;
  --bs-body-bg: var(--bg); --bs-body-color: var(--ink); --bs-border-color: var(--line);
  --bs-primary: var(--brand); --bs-primary-rgb: 30, 111, 168; --bs-link-color: var(--brand); --bs-link-hover-color: var(--brand);
  --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { min-height: 100vh; display: flex; flex-direction: column; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 88%, black); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--brand-soft); }
.card { border: 1px solid var(--line); border-radius: .5rem; box-shadow: none; }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; }
.table { --bs-table-border-color: var(--line); }
.table thead th { font-weight: 600; color: var(--muted); font-size: .8125rem; border-bottom-width: 1px; }

/* top bar */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); height: 56px; display: flex; align-items: center; padding: 0 1rem; gap: 1rem; }
.topbar .brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.topbar .brand img { height: 28px; }
.topbar .brand .portal { color: var(--muted); font-weight: 400; }
.topbar .spacer { flex: 1; }

/* sidebar layout (admin/customer desktop) */
.shell { display: flex; flex: 1; }
.sidebar { width: 220px; background: var(--panel); border-right: 1px solid var(--line); padding: 1rem .75rem; flex-shrink: 0; }
.sidebar .nav-link { color: var(--ink); border-radius: .375rem; padding: .5rem .75rem; display: flex; gap: .6rem; align-items: center; font-size: .9375rem; }
.sidebar .nav-link .bi { color: var(--muted); width: 1.1rem; text-align: center; }
.sidebar .nav-link:hover { background: var(--bg); }
.sidebar .nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidebar .nav-link.active .bi { color: var(--brand); }
.main { flex: 1; padding: 1.5rem; min-width: 0; }
.page-title { font-size: 1.375rem; font-weight: 600; margin: 0 0 1.25rem; }
@media (max-width: 767.98px) { .sidebar { display: none; } .main { padding: 1rem; } }

/* mobile bottom tab bar (driver) */
.tabbar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); }
.tabbar a { color: var(--muted); text-decoration: none; font-size: .7rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 64px; }
.tabbar a .bi { font-size: 1.35rem; }
.tabbar a.active { color: var(--brand); }
.portal-driver .main { padding: 1rem; }

/* auth card */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; padding: 2rem; }
.auth-card .logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; font-weight: 600; font-size: 1.125rem; }
.auth-card .logo img { height: 32px; }
.code-input { font-size: 1.5rem; letter-spacing: .4rem; text-align: center; font-variant-numeric: tabular-nums; }
.backup-codes { columns: 2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; }

.app-footer { border-top: 1px solid var(--line); background: var(--panel); font-size: .8125rem; color: var(--ink); padding: .6rem 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; padding: 1rem 1.25rem; }
.stat .label { color: var(--muted); font-size: .8125rem; }
.stat .value { font-size: 1.5rem; font-weight: 600; }
.status-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; }
.badge-status { font-weight: 500; }
.usage-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.usage-bar > div { height: 100%; background: var(--brand); }
.usage-bar.warn > div { background: #D97706; }
.usage-bar.full > div { background: #DC2626; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty .bi { font-size: 2rem; display: block; margin-bottom: .5rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .topbar, .sidebar, .tabbar, .app-footer, .no-print { display: none !important; } .main { padding: 0; } }

/* dispatch board */
.sig-pad { width: 100%; height: 160px; background: #fff; border: 1px dashed var(--line); border-radius: .375rem; touch-action: none; }
.min-w-0 { min-width: 0; }
.trip-actions .btn-lg { padding: .9rem; font-size: 1.1rem; }
.map-pin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.map-box { height: 480px; border: 1px solid var(--line); border-radius: .5rem; }
.map-box.tall { height: calc(100vh - 200px); min-height: 420px; }
.leaflet-container { font: inherit; }
#mapTable .drag-handle { cursor: grab; font-size: 1.1rem; }
#mapTable tr.opacity-50 { background: var(--brand-soft); }
.nemt-loc-panel { width: 50vw !important; max-width: 100vw; }
@media (max-width: 992px) { .nemt-loc-panel { width: 100vw !important; } }
.nemt-loc-list .list-group-item, .nemt-pat-list .list-group-item { text-align: left; font-size: .9rem; }
.nemt-pax-single thead, .nemt-pax-single .pax-del { display: none; }
.nemt-side-panel { width: 50vw !important; }
@media (max-width: 992px) { .nemt-side-panel { width: 100vw !important; } }

/* ---- Dispatch board v3 (driver rows) ---- */
.board-v3 { display: flex; flex-direction: column; gap: .5rem; }
.board-v3 .brow { display: grid; grid-template-columns: 170px repeat(5, minmax(0, 1fr)); gap: .5rem; background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; padding: .4rem; }
.board-v3 .brow-un { grid-template-columns: 170px 1fr; }
.board-v3 .brow-cols { background: transparent; border: 0; padding: 0 .4rem; position: sticky; top: 0; z-index: 2; }
.board-v3 .bsec { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; background: var(--bg); padding: .2rem .4rem; }
.board-v3 .bhead { font-weight: 600; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; align-self: start; padding: .25rem; }
.board-v3 .bcell.drop { min-height: 52px; max-height: 260px; overflow-y: auto; border-radius: .35rem; padding: .2rem; background: var(--bg); border: 1px dashed transparent; transition: background .15s; }
.board-v3 .drop-un { display: flex; flex-wrap: wrap; gap: .4rem; align-content: flex-start; max-height: 320px; }
.board-v3 .drop-un .board-card { width: 230px; margin: 0; }
.board-v3.dragging .drop { border-color: #cbd5e1; } .board-v3 .drop.over { background: var(--brand-soft); border-color: var(--brand); }
.board-v3 .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #9ca3af; } .board-v3 .dot.on { background: #2E7D5B; }
.board-v3 .board-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: .4rem; padding: .35rem .45rem; margin-bottom: .3rem; font-size: .82rem; color: var(--ink); text-decoration: none; position: relative; }
.board-v3 .board-card:hover { border-color: var(--brand); } .board-v3 .board-card[draggable="true"] { cursor: grab; } .board-v3 .card-menu { margin-left: .25rem; }
.board-v3 .board-run { border-left: 3px solid var(--brand); }
.board-v3 .dropdown-menu { z-index: 1080; }
.board-v3 .st-completed { opacity: .75; } .board-v3 .st-cancelled, .board-v3 .st-no_show { opacity: .65; }
.board-v3 .trip-link { text-decoration: none; } .board-v3 .trip-link:hover { text-decoration: underline; }
@media (max-width: 1200px) { .board-v3 .brow { grid-template-columns: 140px repeat(5, minmax(0, 1fr)); } }
.board-v3 .board-route { border-left: 3px solid #7C3AED; background: #faf5ff; }

@media (min-width: 992px) { .route-form .route-col-main { flex: 0 0 60%; max-width: 60%; } .route-form .route-col-side { flex: 0 0 40%; max-width: 40%; } }
