/* JM Shuttle Field Trips. Colours match OneRide (navy and school-bus yellow).
   Every colour is a token here; dark mode redefines the tokens only. */
:root {
  --navy: #0B2545;
  --yellow: #FFC93C;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #16202B;
  --muted: #5B6573;
  --border: #DFE3E8;
  --field: #FBFBFC;
  --heading: #0B2545;
  --link: #1D4E89;
  --on-navy: #FFFFFF;
  --accent-bg: #FFF8E6;
  --accent-border: #F3D58A;
  --good: #12704A;
  --good-bg: #E4F5EC;
  --warn: #8A5A00;
  --warn-bg: #FFF1D6;
  --danger: #B3332A;
  --danger-bg: #FBE3E1;
  --info: #1D4E89;
  --info-bg: #E6EEF8;
  --focus: #1D4E89;
  --shadow: 0 2px 12px rgba(11, 37, 69, 0.07);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #8CB8EE;
    --bg: #0A121C;
    --card: #111C29;
    --text: #E7EDF5;
    --muted: #9AA6B6;
    --border: #243242;
    --field: #0D1722;
    --heading: #E7EDF5;
    --link: #9CC3F2;
    --on-navy: #0A121C;
    --accent-bg: #2A2210;
    --accent-border: #5C4A1C;
    --good: #6EE7A8;
    --good-bg: #10301F;
    --warn: #F7C66B;
    --warn-bg: #33270E;
    --danger: #F59A93;
    --danger-bg: #3A1614;
    --info: #9CC3F2;
    --info-bg: #142538;
    --focus: #9CC3F2;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--link); }
h1, h2 { color: var(--heading); line-height: 1.2; text-wrap: balance; margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.75rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.wrap-wide { max-width: 1100px; }
main.wrap { padding-block: 24px 48px; display: flex; flex-direction: column; gap: 16px; }

.site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; max-width: 1100px; }
.brand { display: block; }
.logo { height: 40px; width: auto; display: block; }
.logo-dark { display: none; }
.header-phone { font-weight: 600; text-decoration: none; }
.admin-nav { display: flex; gap: 16px; align-items: center; }
.admin-nav form { margin: 0; }
.site-footer { color: var(--muted); font-size: 0.85rem; padding-block: 24px 40px; border-top: 1px solid var(--border); }

.lede { font-size: 1.05rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; color: var(--muted); }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.break { overflow-wrap: anywhere; }
.crumb { margin: 0; font-size: 0.9rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-bottom: 0.25rem; }
.kicker-good { color: var(--good); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.narrow { max-width: 420px; width: 100%; margin: 24px auto; }
.card-accent { background: var(--accent-bg); border-color: var(--accent-border); }

/* Home */
.hero { padding-top: 8px; }
.paths { display: grid; gap: 14px; }
.path-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; }
.path-card:hover { border-color: var(--yellow); transform: translateY(-1px); }
.path-kicker { align-self: flex-start; background: var(--yellow); color: #1B1404; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.path-card + .path-card .path-kicker { background: var(--info-bg); color: var(--info); }
.path-title { font-size: 1.3rem; font-weight: 700; color: var(--heading); }
.path-text { color: var(--muted); }
.path-go { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 10px; padding: 12px 18px; border-radius: 10px; background: var(--yellow); color: #1B1404; font-size: 1.15rem; font-weight: 800; }
.path-card:hover .path-go { filter: brightness(1.05); }

/* Forms */
.trip-form { display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.card { padding: 20px; }
legend { font-weight: 700; font-size: 1.1rem; color: var(--heading); padding: 0; margin-bottom: 12px; float: left; width: 100%; }
legend + * { clear: both; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { font-weight: 600; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px; }
textarea { resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.field-error { color: var(--danger); font-size: 0.9rem; font-weight: 600; margin: 0; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); cursor: pointer; font-weight: 500; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--info-bg); }
.choice input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--navy); flex: none; }
.stack { display: flex; flex-direction: column; gap: 4px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border-radius: 10px; padding: 12px 18px; min-height: 46px; border: 2px solid var(--navy); background: var(--navy); color: var(--on-navy); cursor: pointer; text-decoration: none; text-align: center; }
.button:hover { filter: brightness(1.1); }
.button-big { width: 100%; font-size: 1.1rem; padding: 15px 18px; background: var(--yellow); border-color: var(--yellow); color: #1B1404; }
.button-secondary { background: transparent; color: var(--navy); }
.button-quiet { background: transparent; border-color: var(--border); color: var(--text); font-weight: 600; }
.button-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button-row form { margin: 0; }
.link-button { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.alert { border-radius: 10px; padding: 12px 14px; background: var(--info-bg); color: var(--text); border: 1px solid var(--border); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--danger-bg); border-color: var(--danger); }
.alert-good { background: var(--good-bg); border-color: var(--good); }
.alert-warn { background: var(--warn-bg); border-color: var(--accent-border); }

/* Quote */
.quote-card, .status-card { border-top: 6px solid var(--yellow); }
.status-good { border-top-color: var(--good); }
.price-big { font-size: clamp(2.4rem, 10vw, 3.2rem); font-weight: 800; color: var(--heading); line-height: 1.1; margin: 4px 0 4px; font-variant-numeric: tabular-nums; }
.price-sub { color: var(--muted); }
.lines { list-style: none; padding: 0; margin: 12px 0; border-top: 1px solid var(--border); }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.office-note { background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 10px; padding: 10px 12px; }
.decline { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.decline summary { cursor: pointer; color: var(--link); font-weight: 600; }
.decline form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.decline fieldset { display: flex; flex-direction: column; gap: 8px; }
.decline legend { font-size: 1rem; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 220px; font-size: 0.9rem; }
.details { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 6px 14px; margin: 0 0 12px; }
.details dt { color: var(--muted); font-size: 0.9rem; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.terms ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Office */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.table-card { padding: 0; overflow: hidden; }
.table-head { padding: 16px 20px 4px; }
.table-card > .muted { padding: 0 20px 16px; }
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--info-bg); color: var(--info); font-size: 0.85rem; text-align: center; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.pill-big { font-size: 0.9rem; padding: 6px 12px; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.request-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 16px; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.93rem; }

/* Phones: each dashboard row becomes a small card instead of a wide table. */
@media (max-width: 639px) {
  .table-scroll thead { display: none; }
  .table-scroll table, .table-scroll tbody, .table-scroll tr { display: block; }
  .table-scroll tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 20px; border-top: 1px solid var(--border); }
  .table-scroll td { border: 0; padding: 0; }
  .table-scroll td:nth-child(3), .table-scroll td:nth-child(4) { flex-basis: 100%; }
  .table-scroll td:nth-child(5)::after { content: " riders"; }
  .table-scroll td.num { text-align: left; }
  .table-scroll td:nth-child(6) { font-weight: 700; }
  .table-scroll td:nth-child(7) { margin-left: auto; }
}
@media (min-width: 720px) {
  .paths { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 3fr 2fr; }
}
@media (prefers-color-scheme: dark) {
  .logo-light { display: none; }
  .logo-dark { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
