/* Ridex — design 03 Solent (decision 0003): harbour blue on daylight, sea teal, a coral signal. One stylesheet for
   the public site and the staff portal. System fonts (no third-party font requests). WCAG 2.2 AA in both modes. */
:root {
  --bg: #F4F8FA; --surface: #FFFFFF; --surface-2: #EAF2F6; --line: #DCE6EC;
  --ink: #0B2233; --muted: #4F6577; --accent: #0A7EA4; --accent-ink: #FFFFFF; --accent-soft: #D7EEF6; --accent-text: #065A76;
  --coral: #B83A28; --coral-soft: #FDE7E3; --danger-ink: #FFFFFF; --amber: #8A5A00; --amber-soft: #FFF1CC; --green: #1B6E3A; --green-soft: #DDF3E4;
  --focus: #0A7EA4;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(11 34 51 / 6%), 0 8px 24px rgb(11 34 51 / 6%);
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-sm: 0.875rem; --text: 1rem; --text-lg: 1.25rem; --text-xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --text-hero: clamp(2.2rem, 1.2rem + 4vw, 3.75rem);
  --gap: 16px; --gap-lg: clamp(24px, 3vw, 40px);
  --fast: 150ms; --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--text)/1.55 var(--font); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: var(--text-xl); font-weight: 800; }
h2 { font-size: var(--text-lg); font-weight: 750; }
h3 { font-size: var(--text); font-weight: 700; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.mono { font-family: var(--mono); font-size: 0.95em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px clamp(16px, 3vw, 32px); background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.topbar .spacer { flex: 1; }
.topbar nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 600; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { background: var(--surface-2); }
.who { font-size: var(--text-sm); color: var(--muted); }

/* ---- portal layout: side nav on wide screens, a scrolling strip on narrow */
.portal { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-width: 0; min-height: calc(100vh - 57px); }
.sidenav { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; }
.sidenav a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-weight: 600; }
.sidenav a:hover { background: var(--surface-2); }
.sidenav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.content { padding: clamp(16px, 3vw, 32px); min-width: 0; }
@media (max-width: 860px) {
  .portal { grid-template-columns: minmax(0, 1fr); }
  .sidenav { min-width: 0; display: flex; overflow-x: auto; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .sidenav a { white-space: nowrap; }
}

/* ---- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2vw, 24px); box-shadow: var(--shadow); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
/* Faiz 03-11: less empty space on staff pages: a short form on one line, and closer fields inside small cards */
.doc-form { display: grid; gap: 10px 12px; align-items: end; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.doc-form > h2 { grid-column: 1 / -1; margin: 0; }
.doc-form input[type="file"] { max-width: 100%; }
.stack.tight > * + * { margin-top: 8px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.stat.alarm { border-color: var(--coral); background: var(--coral-soft); }

/* ---- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.no-driver td, tr.urgent td { background: var(--coral-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--surface-2); color: var(--ink); }
.badge.placeholder, .badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--coral-soft); color: var(--coral); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--accent-soft); color: var(--accent-text); }
/* 4.321: the days of a busy-time window, one row: ticked green, the others faint */
td.days { white-space: nowrap; }
td.days .badge { padding: 2px 6px; margin-right: 2px; }
td.days .badge.off { background: transparent; color: var(--muted); opacity: 0.5; }

/* ---- forms */
form.stack { max-width: 640px; }
label { display: block; font-weight: 650; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: var(--text-sm); }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=time],
input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
/* 4.251 (Faiz 17-11): the grey example text in a box goes as soon as you click in */
input:focus::placeholder, textarea:focus::placeholder { color: transparent; }
textarea { min-height: 96px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 22px; height: 22px; }
.errors, .errorlist { color: var(--coral); font-weight: 600; padding-left: 18px; }
/* 4.330: RideX Eat / Courier registration (look A) */
.partner .strap { font-weight: 700; color: var(--accent-text); font-size: var(--text-lg); }
.partner-photo { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.partner-logo { height: 48px; width: auto; }  /* Faiz 25-11: the brand on the RideX Taxi page */
fieldset.chips { border: 0; padding: 0; margin: 0; }
fieldset.chips legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
fieldset.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin: 0 6px 6px 0; background: var(--surface); font-weight: 400; cursor: pointer; }
fieldset.chips label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.partner-go { width: 100%; background: #b83a28; border-color: #b83a28; font-weight: 800; letter-spacing: .02em; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font: 700 var(--text)/1 var(--font);
  text-decoration: none; cursor: pointer; transition: transform var(--fast) var(--ease), filter var(--fast) var(--ease); }
button:hover, .button:hover { filter: brightness(1.08); }
button:active, .button:active { transform: translateY(1px) scale(0.99); }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
button.danger, .button.danger { background: var(--coral); color: var(--danger-ink); }
button:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--line); box-shadow: none; filter: none; transform: none; cursor: not-allowed; }  /* 4.341: never drawn as live */
button.link { background: none; color: var(--accent-text); padding: 0; min-height: 0; border: 0; text-decoration: underline; }
.inline-form { display: inline; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-weight: 600; }
.messages li.error { background: var(--coral-soft); color: var(--coral); }

/* ---- maps */
.map { width: 100%; min-height: 360px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }

/* ---- public site */
.site-main { max-width: 1120px; margin: 0 auto; padding: var(--gap-lg) clamp(16px, 3vw, 32px); }
.hero { display: grid; gap: var(--gap-lg); grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; padding: var(--gap-lg) 0; }
.hero h1 { font-size: var(--text-hero); letter-spacing: -0.03em; }
.hero .lead { font-size: var(--text-lg); color: var(--muted); max-width: 34ch; }
.hero .book-box { position: relative; }
.hero .book-box::before { content: ""; position: absolute; inset: -18px -18px auto auto; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); z-index: -1; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.steps { counter-reset: step; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.steps .card::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 10px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px clamp(16px, 3vw, 32px); font-size: var(--text-sm); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.safety { border: 2px solid var(--coral); background: var(--coral-soft); }
.trip-status { font-size: var(--text-lg); font-weight: 800; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print {
  .topbar, .sidenav, .staffbar, .back-link, .site-footer, .no-print { display: none !important; }
  body, body.staff { background: #FFFFFF; color: #000000; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .portal { display: block; }
  @page { size: A4; margin: 18mm; }
}
.split { display: grid; gap: var(--gap-lg); grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.spacer { flex: 1; }
/* address search list (places.js) */
.places-list { list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.places-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.places-list li:hover, .places-list li[aria-selected="true"] { background: var(--accent-soft); }
.places-list li.recent { display: flex; align-items: center; gap: 10px; }  /* 4.183: the person's own recent searches */
.places-list li.recent::before { content: ""; flex: none; width: 18px; height: 18px; opacity: .6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat; }
.driver-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-soft); }
.row > * { min-width: 0; }
input, select, textarea { max-width: 100%; }
.table-wrap { position: relative; }  /* hidden labels inside a scrolling table stay inside it (no sideways page scroll) */
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- staff sign-in pages (allauth, status 4.15) */
.auth { width: calc(100% - 32px); max-width: 440px; margin: clamp(24px, 6vh, 64px) auto; }
.auth form p { margin: 0 0 14px; }
.auth form button[type=submit] { width: 100%; }
.auth input[type=checkbox] { width: 22px; height: 22px; vertical-align: middle; margin-right: 8px; }
.auth form p label[for$="remember"] { display: inline; }

/* Staff settings (Faiz 27-10): every group lines up the same columns */
.settings-table { table-layout: fixed; }
.settings-table th:nth-child(1) { width: 50%; }
.settings-table th:nth-child(2) { width: 25%; }

/* ---- a friendlier staff portal (Faiz 28-10, status 4.42): icons in the menu, Back on every inner page, tabs,
   figures you can click, rows that light up under the pointer; motion only for those who have not asked for less */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.back-link:hover { background: var(--accent-soft); }
/* 4.214 (Faiz 14-11): where you are, not only Back */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; }
.crumbs a { color: var(--accent-text); text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.crumbs a:hover { background: var(--accent-soft); }
.crumbs span[aria-hidden] { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); }
td.center, th.center { text-align: center; }
.detail-narrow { max-width: 1040px; margin: 0 auto; }
main:has(.detail-narrow) .crumbs { max-width: 1040px; margin-inline: auto; }
.detail-narrow .doc-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 260px)); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.page-head h1 { margin: 0; flex: 1 1 auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; padding: 4px; background: var(--surface-2); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabs a { padding: 8px 16px; border-radius: 999px; color: var(--ink); font-weight: 650; text-decoration: none; }
.tabs a:hover { background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card, .card.lift { transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card:hover, .card.lift:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 2px 4px rgb(11 34 51 / 8%), 0 14px 32px rgb(11 34 51 / 12%); }
.stat { border-top: 4px solid var(--accent); }
.stat.alarm { border-top-color: var(--coral); }
.stat .go { font-size: var(--text-sm); color: var(--accent-text); font-weight: 700; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--surface-2); }
tr.off td { color: var(--muted); }
.totals td { font-weight: 800; background: var(--surface-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
button.small, .button.small { min-height: 36px; padding: 6px 14px; font-size: var(--text-sm); }
details.inline > summary { cursor: pointer; color: var(--accent-text); font-weight: 700; list-style: none; display: inline-flex; min-height: 36px; align-items: center; }
details.inline[open] > summary { margin-bottom: 10px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin: 12px 0 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi span { display: block; color: var(--muted); font-size: var(--text-sm); }
.kpi b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: rise .25s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { a.card, .card.lift, tbody tr, .sidenav a { transition: none; } a.card:hover, .card.lift:hover { transform: none; } }
input.auto { width: auto; }
details.card > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▾"; margin-left: auto; color: var(--accent-text); transition: transform .15s; }
details.card[open] > summary::after { transform: rotate(180deg); }
details.card[open] > summary { margin-bottom: 14px; }
.table-wrap details.inline[open] { min-width: min(440px, 80vw); }
.table-wrap details.inline .grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
details.card + h2, .kpis + details.card { margin-top: 20px; }

/* ---- staff website layout v2 (Faiz 29-10: "so much empty space"): a title bar with the actions on the right, sections
   as panels side by side, quiet empty states, forms in two columns, a side panel beside a form */
.content { max-width: 1680px; }
.page-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 18px; }
.page-bar h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem); }
.page-bar .sub { color: var(--muted); font-size: var(--text-sm); width: 100%; margin-top: -6px; }
.page-bar .spacer { flex: 1; }
.panels { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; margin-bottom: 18px; }
.panels.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel > header h2 { margin: 0; font-size: 1.02rem; flex: 1; }
.panel > header .ico { color: var(--accent-text); }
.panel .table-wrap { border: 0; border-radius: 0; }
.panel .body { padding: 16px 18px; }
.empty { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: var(--muted); font-size: var(--text-sm); }
.empty .ico { color: var(--green); }
.with-side { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
@media (max-width: 1100px) { .with-side { grid-template-columns: minmax(0, 1fr); } }
.form-grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { margin-bottom: 4px; }
.checklist { margin: 0; padding-left: 20px; } .checklist li + li { margin-top: 8px; }
.actions-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.actions-grid a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-weight: 700; text-decoration: none; transition: border-color .15s, background .15s; }
.actions-grid a:hover { border-color: var(--accent); background: var(--accent-soft); }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
a.card.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
a.card.stat span:first-child { font-size: var(--text-sm); }
a.card.stat b { font-size: 2.2rem; line-height: 1.1; }
.panel td a, .panel td:first-child { white-space: nowrap; }

/* ==== staff website, design C (Faiz's pick 29-10-2026): light and clean like bookridex.com, the menu across the top,
   white cards with a coloured edge, coloured status pills. Scoped to body.staff; the public site is unchanged. ==== */
body.staff { background: #F1F5F8; }
.staffbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px 18px; padding: 0 24px; min-height: 58px;
  background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgb(11 34 51 / 3%); }
.staffbar .brand { font-size: 1.05rem; white-space: nowrap; }
.topnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; padding: 17px 11px 15px; border-bottom: 3px solid transparent; color: var(--muted);
  font-weight: 650; text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s; }
.topnav a .ico { width: 18px; height: 18px; }
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.staffbar .me { display: flex; align-items: center; gap: 10px; margin-left: auto; white-space: nowrap; }
/* 4.261 B (17-11, measured: one line needs about 1,315 px with every tab): below 1400 px the tabs get their own full row, so nothing wraps alone under Today */
@media (max-width: 1400px) {
  .staffbar { flex-wrap: wrap; padding: 8px 16px 0; }
  .topnav { order: 3; flex-basis: 100%; }
}
body.staff .content { max-width: 1680px; margin: 0 auto; padding: 22px clamp(16px, 2.5vw, 32px) 40px; }
body.staff .card, body.staff .panel, body.staff .table-wrap, body.staff .kpi { border: 0; border-radius: 14px;
  box-shadow: 0 1px 2px rgb(11 34 51 / 6%), 0 8px 22px rgb(11 34 51 / 6%); }
body.staff .panel .table-wrap { box-shadow: none; border-radius: 0; }
body.staff .panel > header { background: var(--surface); border-bottom: 1px solid #EAF2F6; border-left: 4px solid var(--accent); }
body.staff .panel.alert > header { border-left-color: var(--coral); }
body.staff th { background: #F7FAFC; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .03em; }
body.staff td { border-bottom-color: #EAF2F6; }
body.staff tbody tr:hover td { background: #F7FBFD; }
body.staff h1 { letter-spacing: -0.02em; }
body.staff .content > h2, body.staff .stack > h2 { font-size: 1.1rem; margin: 26px 0 10px; }
body.staff .badge { padding: 3px 10px; }
.hello { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 18px; }
.hello h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.hello .when { color: var(--muted); }
.hello .spacer { flex: 1; }
.tiles.icons { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
a.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border-radius: 14px; color: var(--ink);
  text-decoration: none; box-shadow: 0 1px 2px rgb(11 34 51 / 6%), 0 8px 22px rgb(11 34 51 / 6%); transition: transform .15s, box-shadow .15s; }
a.tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(11 34 51 / 8%), 0 14px 30px rgb(11 34 51 / 12%); }
a.tile .ib { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
a.tile .ib .ico { width: 22px; height: 22px; }
a.tile small { display: block; color: var(--muted); font-size: var(--text-sm); }
a.tile b { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
a.tile.alarm .ib { background: var(--coral-soft); color: var(--coral); }
a.tile.alarm b { color: var(--coral); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink); }
.pill.green { background: var(--green-soft); color: var(--green); } .pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--coral-soft); color: var(--coral); } .pill.blue { background: var(--accent-soft); color: var(--accent-text); }
body.staff .actions-grid a { background: #F4F8FA; border: 0; }
body.staff .actions-grid a:hover { background: var(--accent-soft); }
/* short forms on one line (dates, a search): labels beside their fields, fields only as wide as they need */
body.staff form.row > label, body.staff .row > div > label { margin: 0; }
body.staff form.row input:not([type=checkbox]):not([type=hidden]):not([type=search]), body.staff form.row select { width: auto; flex: 0 1 220px; }
body.staff form.row input[type=search], body.staff form.row input[type=text] { flex: 1 1 260px; }
body.staff .golive ul { columns: 2 320px; column-gap: 32px; } body.staff .golive li { break-inside: avoid; margin-bottom: 4px; }
.alarm-text { color: var(--coral); }
@media print { body.staff { background: #FFFFFF; } .staffbar { display: none !important; } body.staff .card, body.staff .panel, body.staff .table-wrap { box-shadow: none; } }

/* ==== Settings as cards (4.52, Faiz 30-10-2026): the staff width (1,680 px) in columns that end level, a switch per
   yes/no and per option, a one-line "why?" under a switch that changed. Light only, like the rest of the portal. ==== */
.settings-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin: 0 0 16px; }
.golive-strip { flex: 1 1 520px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--amber-soft);
  border: 1px solid #F0D68A; border-radius: var(--radius); padding: 12px 16px; }
.golive-strip b { color: var(--amber); } .golive-strip a { color: var(--amber); font-weight: 600; }
.golive-strip.ready { background: var(--green-soft); border-color: #B9E3C6; } .golive-strip.ready b { color: var(--green); }
body.staff .settings-find { flex: 0 1 340px; border-radius: 999px; padding: 10px 16px; }
.setting-cards { columns: 3 400px; column-gap: 16px; }
.setting-cards.two { columns: 2 420px; }
.setting-card { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.setting-card[hidden] { display: none; }
.setting-card > header { display: flex; gap: 10px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--accent); }
.setting-card > header h2 { font-size: 1.15rem; margin: 0; } .setting-card > header p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.card-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); font-size: 16px; }
.setting-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.setting-line:last-child { border-bottom: 0; } .setting-line[hidden] { display: none; }
body.staff h2[id]:target { background: var(--amber-soft); border-radius: 6px; scroll-margin-top: 80px; } /* 4.309: the place a search result opens */
.place-thumb { width: 96px; height: 60px; object-fit: cover; border-radius: 8px; display: block; } /* 4.317 */
.setting-line .what { flex: 1 1 200px; min-width: 0; } .setting-line .what label { font-size: inherit; } .setting-line .what b { font-size: 1rem; font-weight: 700; line-height: 1.35; } /* Faiz 25-11: one size for every line */
.setting-line .what small { display: block; color: var(--muted); font-size: 0.86rem; line-height: 1.5; margin-top: 3px; max-width: 68ch; overflow-wrap: anywhere; }
.setting-line .what code { font-size: 0.72rem; }
.setting-line .now { text-align: right; flex: 0 1 auto; } .setting-line .now > b { font-size: 0.92rem; }
.setting-line.cars .now { flex: 1 1 100%; } .setting-line.cars input { width: 100%; }  /* Faiz 23-11: the car type names, full width */
.setting-line .inline-edit { display: flex; gap: 8px; align-items: center; } .setting-line .inline-edit input { width: 12rem; max-width: 55vw; }
.setting-line details.change > summary { cursor: pointer; color: var(--accent-text); font-weight: 700; font-size: 0.82rem; list-style: none; display: inline-block;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; margin-left: 8px; }
.setting-line details.change[open] { text-align: left; } .setting-line details.change form { margin-top: 10px; min-width: min(320px, 70vw); }
.switch { position: relative; flex: none; width: 51px; min-width: 51px; height: 31px; min-height: 31px; padding: 0; border: 0; border-radius: 999px;
  background: #C9D3DA; cursor: pointer; transition: background var(--fast); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 2px 4px rgb(0 0 0 / 25%); transition: transform var(--fast) var(--ease); }
.switch[aria-checked="true"] { background: #2FA84F; } .switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.setting-line .why { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px; }
.setting-line .why[hidden] { display: none; }
body.staff .setting-line .why input { flex: 1 1 220px; width: auto; }
.notice-strip { background: var(--coral-soft); color: var(--coral); border-radius: var(--radius); padding: 12px 16px; font-weight: 600; }
.notice-strip a { color: var(--coral); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px 16px 0; }
.stat-row div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat-row b { display: block; font-size: 1.4rem; } .stat-row span { font-size: 0.8rem; color: var(--muted); }
.pad { padding: 8px 16px 14px; margin: 0; }
.code-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding: 16px; }
.code-form label, .code-form legend { display: grid; gap: 4px; font-size: 0.82rem; font-weight: 600; }
.code-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
body.staff .code-form fieldset input[name=amount] { width: 90px; flex: none; }
.code-form .choice { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.code-form .wide-field { grid-column: 1 / -1; }
.code-chip { font-family: var(--mono); font-weight: 700; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }
.codes-table details.change form { margin-top: 8px; }
.model-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; padding: 16px; }
.model-card { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.model-card img { width: 92px; height: 56px; object-fit: contain; }
.fleet-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 16px; }
.fleet-counts a { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); }
.fleet-counts b { display: block; font-size: 1.6rem; } .fleet-counts span { color: var(--muted); font-size: 0.82rem; }
@media (max-width: 560px) { .setting-line .now { flex-basis: 100%; } }

/* 4.55 (Faiz 30-10): Business settings as a left-hand menu with the chosen part on the right; the change log; the
   temporary preview button in the top bar; the up arrow on every staff page (as on the bookridex.com home page) */
.settings-layout { display: grid; grid-template-columns: minmax(250px, max-content) minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-side { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow); }
.settings-side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 600; text-decoration: none; }
.settings-side a:hover { background: var(--surface-2); }
.settings-side a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
/* 4.215 (Faiz's pick A): the page title over the menu, the part's heading on the same line over the list */
.settings-layout > .layout-title, .settings-layout > .layout-bar { margin: 0; align-self: center; }
.settings-layout > .layout-bar h2 { margin: 0; }
.settings-side .side-ico { width: 24px; text-align: center; } .settings-side .side-t { flex: 1; white-space: nowrap; }  /* 4.215: one line each */
.settings-side small { min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-size: 0.75rem; text-align: center; }
.settings-side a[aria-current="page"] small { background: rgb(255 255 255 / 22%); color: var(--accent-ink); }
/* Faiz 25-11: Referrals and the restaurant settings as boxes side by side, on one screen without scrolling */
.line-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 16px; }
.line-boxes .setting-line { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); align-content: center; }
.line-boxes .setting-line .what { flex-basis: 150px; } .line-boxes .figure .what b { font-size: 1.5rem; }
.line-boxes .setting-line .inline-edit input { width: 5.5rem; }
.setting-cards.one { columns: 1; max-width: 860px; }
.log-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 14px; }
body.staff .log-filter select { width: auto; min-width: 180px; }
table.log td.change { overflow-wrap: anywhere; min-width: 180px; } table.log .nowrap { white-space: nowrap; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 14px 0; }
.staffbar .preview-top { display: flex; flex: none; }
.staffbar .preview-top button { display: grid; place-items: center; width: 38px; height: 38px; min-height: 0; padding: 0; margin: 0;
  border: 1px dashed var(--accent); border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); cursor: pointer; }
.staffbar .preview-top .ico { width: 19px; height: 19px; }
/* 4.261 B: the profile circle (initials) and its menu, built like the bell */
.profile { position: relative; }
.profile > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  background: var(--accent); color: #FFFFFF; font-weight: 750; font-size: 0.9rem; letter-spacing: .02em; }
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.profile[open] > summary { box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(280px, calc(100vw - 32px)); white-space: normal;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / 14%); padding: 6px; }
.profile-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow-wrap: anywhere; }
.profile-head strong { display: block; } .profile-head small { color: var(--muted); }
.profile-panel a, .profile-out { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: left; justify-content: flex-start; min-height: 0; }
.profile-panel a:hover, .profile-panel a:focus-visible, .profile-out:hover, .profile-out:focus-visible { background: var(--surface-2); }
.profile-panel a[aria-current="page"] { color: var(--accent-text); }
.profile-panel .ico { width: 18px; height: 18px; flex: none; }
.profile-panel form { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.profile-out { color: #B3261E; }
.settings-main { min-width: 0; } /* a wide table scrolls in its box on a phone, never the page (4.70) */
.settings-main .settings-bar { flex-direction: column; } .settings-main .golive-strip { flex: none; }
@media (min-width: 1401px) { .topnav { flex-wrap: wrap; overflow: visible; } }  /* many roles: a second line, nothing hidden */
body.staff .settings-main .settings-find { flex: none; width: 100%; max-width: 860px; }
.a-top { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 46px; height: 46px; border-radius: 50%; display: grid;
  place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.4rem; font-weight: 800; text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.a-top[hidden] { display: none; }
.a-top:hover { filter: brightness(1.08); } .a-top:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .settings-side a { flex: none; white-space: nowrap; }
}

/* Drivers & cars (4.80-4.89, Faiz 02-11): count boxes that filter, and column headings that sort */
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--accent); }
a.kpi[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover { text-decoration: underline; }

/* the driver's approval checklist (Faiz 02-11: "simple and easy") */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.checklist .mark { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 999px; font-weight: 700; flex: none; }
.checklist .ok .mark { background: #DFF5E6; color: #136B33; }
.checklist .todo .mark { background: #FDE7E7; color: #A11A1A; }

/* ---- Today's one Dispatch board: a line between its parts (Faiz 04-11) */
.board-sections > section + section { border-top: 1px solid var(--line); margin-top: var(--gap-lg); padding-top: var(--gap-lg); }
.board-sections > section > h2 { margin-bottom: 10px; }
.map-tall { min-height: min(62vh, 620px); margin-bottom: var(--gap-lg); }

/* ---- Fleet pages: space and a clear edge between parts (Faiz 04-11) */
.fleet-part, .files-panel { margin-top: var(--gap-lg); }
.fleet-part > .body > form > .row { margin-bottom: 12px; }

/* ---- Staff register: Manage dialog (Faiz 04-11) */
dialog.manage .card { border: 0; box-shadow: none; padding: 0; background: none; }
dialog.manage .card > h2 { display: none; }
dialog.manage .doc-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
dialog.manage .doc-form > button { grid-column: 1 / -1; justify-self: start; }
dialog.manage input:not([type="checkbox"]):not([type="file"]), dialog.manage select { width: 100%; }
dialog.manage { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
dialog.bulk-dialog, dialog.manage.narrow { width: min(560px, calc(100vw - 32px)); }
/* ---- Fares page (Faiz 11-11): panels for the prices now, the change in a Manage dialog */
.fares-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fares-head h2 { margin: 0; }
.fare-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.fare-list dt { font-weight: 600; }
.fare-list dd { margin: 0; overflow-wrap: anywhere; }
.fare-list dd.wide { grid-column: 1 / -1; }
.fares-part { margin-top: var(--gap-lg); }
/* four panels two by two on every staff screen (3 + 1 left a gap on wide screens, 4 across cramped the car table); one on a phone */
.panels.fare-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .panels.fare-panels { grid-template-columns: minmax(0, 1fr); } }
.fares-part > header .small { flex: none; }
dialog.manage table input { width: 100%; min-width: 0; }
dialog.job-dialog { width: min(1180px, calc(100vw - 32px)); }
.job-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 20px; padding: 18px; }
.job-cols .map { min-height: min(66vh, 560px); }
.job-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 12px 0; }
.job-facts dt { font-weight: 600; }
.job-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 820px) { .job-cols { grid-template-columns: minmax(0, 1fr); } .job-cols .map { min-height: 280px; order: -1; } }
.bulk-bar { padding: 10px 0; }
.bulk-all { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; white-space: nowrap; font-weight: inherit; margin: 0; }
th.bulk-col, td.bulk-col { text-align: center; vertical-align: middle; }
dialog.manage::backdrop { background: rgba(10, 30, 45, .45); }
dialog.manage > header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.manage-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.manage-col + .manage-col { border-left: 1px solid var(--line); }
.manage-col > section { padding: 16px 20px; }
.manage-col > section + section { border-top: 1px solid var(--line); }
/* 4.248 (Faiz 17-11, layout A): one line per document at the top of Manage */
.doc-lines { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.doc-lines > h3 { margin: 0 0 4px; }
.doc-line { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) 7.5rem; gap: 8px 12px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.doc-lines > .doc-line:first-of-type { border-top: 0; }
.doc-line .nm { align-self: center; display: grid; gap: 4px; justify-items: start; }
.doc-line label { font-size: 13px; }
.doc-line input[type="file"] { max-width: 100%; }
.doc-line > button { width: 100%; }
.doc-line > p { margin: 0 0 10px; }
@media (max-width: 860px) { .doc-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .doc-line .nm { grid-column: 1 / -1; } }
@media (max-width: 860px) { .manage-cols { grid-template-columns: minmax(0, 1fr); } .manage-col + .manage-col { border-left: 0; border-top: 1px solid var(--line); } }
dialog.manage h3 { margin-bottom: 10px; }
.manage-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.manage-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px; align-items: end; padding: 12px 0; }
.manage-row + .manage-row { border-top: 1px solid var(--line); }
.manage-row button { width: 100%; }
.manage-row label { margin-top: 8px; }
.manage-row label.check { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.manage-row label.check input { width: auto; }
@media (max-width: 560px) { .manage-grid, .manage-row { grid-template-columns: minmax(0, 1fr); } }
/* 4.173: driver and car panels (label | value) and the folded document history */
dl.kv { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.kv { grid-template-columns: minmax(0, 1fr); } dl.kv dd { margin-bottom: 6px; } }
details.doc-history { margin-top: 10px; } details.doc-history summary { cursor: pointer; color: var(--muted); font-size: 14px; }
/* 4.174: the signed agreement printed from the staff driver page */
.agreement h3 { font-size: 1rem; margin: 18px 0 6px; } .agreement p { margin: 0 0 8px; }
dl.agreement-blanks { display: grid; grid-template-columns: minmax(140px, 260px) minmax(0, 1fr); gap: 4px 12px; margin: 10px 0; }
dl.agreement-blanks dt { color: var(--muted); } dl.agreement-blanks dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Faiz 11-11-2026 (4.191, layout A): the driver page says in one line whether the driver can work */
.state { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--radius);
  padding: 14px 18px; margin: 8px 0 16px; font-weight: 650; border: 1px solid var(--line); }
.state.ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.state.todo { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.state.stop { background: var(--coral-soft); color: var(--coral); border-color: color-mix(in srgb, var(--coral) 25%, transparent); }
.state small { display: block; font-weight: 400; color: var(--ink); }
a.kpi { color: inherit; text-decoration: none; transition: border-color var(--fast), transform var(--fast); }
a.kpi:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi b.ok { color: var(--green); } .kpi b.todo { color: var(--amber); }
.who-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); margin: 2px 0 4px; }
/* ---- Faiz 11-11-2026: the Money page's filter bar, one row on a wide screen */
.filter-bar { display: grid; gap: 12px; align-items: end; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin: 0 0 12px; }
.filter-bar label { display: block; font-size: var(--text-sm); color: var(--muted); margin-bottom: 4px; }
.filter-bar input, .filter-bar select { width: 100%; }
.panel.wide + .panel.wide { margin-top: var(--gap); }
.panel > header form.row { flex-wrap: nowrap; gap: 8px; }
/* Faiz 12-11: Money and Reports in clear panels */
.panel .kpis { margin: 4px 0 0; }
.kpi small { display: block; margin-top: 2px; font-size: var(--text-sm); }
.panel .tabs { margin-top: 0; }
/* 4.203 (Faiz 13-11): enable / disable is the iPhone switch everywhere (portal/_switch.html) */
.switch-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.switch-say { font-size: 0.82rem; font-weight: 600; color: #136B33; } .switch-say.off { color: var(--muted); }
dialog.manage.switch-ask { width: min(460px, calc(100vw - 32px)); white-space: normal; }
dialog.switch-ask form { padding: 18px 20px; }
dialog.switch-ask header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
dialog.switch-ask h2 { font-size: 1.05rem; margin: 0; }
/* 4.208 (Faiz 13-11): the driver's Overview in two columns on a wide screen, one on a phone */
.driver-overview { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 1000px) { .driver-overview { grid-template-columns: minmax(0, 1fr); } }
/* 4.205: the driver's photo, and the new one waiting for staff */
.photo-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.photo-row figure { margin: 0; display: grid; gap: 6px; justify-items: center; text-align: center; }
/* 4.266: the driver's photo before the name on the driver page */
.driver-photo-head { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.driver-photo-head.none { display: grid; place-items: center; color: var(--muted); font-weight: 750; font-size: 1.05rem; }
.photo-check { margin: 0 0 16px; border-left: 4px solid #E0A100; }
.photo-open { padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; flex: none; }
.photo-open:focus-visible { outline: 3px solid var(--focus, #1a73e8); outline-offset: 2px; }
.photo-full { display: block; max-width: 100%; max-height: calc(100vh - 220px); margin: 0 auto; border-radius: 8px; object-fit: contain; }
.driver-photo-big { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.photo-none { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 0.82rem; }
/* 4.202 (Faiz 13-11): the notification bell beside the name */
.bell { position: relative; }
.bell > summary { list-style: none; cursor: pointer; position: relative; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.bell > summary::-webkit-details-marker { display: none; }
.bell > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bell > summary .ico { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #C62828; color: #FFFFFF; font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(360px, calc(100vw - 32px)); white-space: normal;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / 14%); padding: 12px; }
@media (max-width: 480px) { .bell-panel { right: -48px; } }  /* 4.340: past the profile circle, or a phone cuts its left edge */
.bell-panel h2 { font-size: 0.95rem; margin: 0 0 8px; }
.bell-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bell-panel a, .bell-open button { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.bell-open button { width: 100%; align-items: baseline; border: 0; background: none; box-shadow: none; min-height: 0; font: inherit; text-align: left; cursor: pointer; }
.bell-panel a:hover, .bell-panel a:focus-visible, .bell-open button:hover, .bell-open button:focus-visible { background: var(--surface-2); }
.bell-panel b { color: #C62828; } .bell-panel .info b { color: var(--muted); }
.bell-panel .none { color: var(--muted); padding: 9px 10px; }
/* 4.206: Add a driver */
.driver-new { display: grid; gap: var(--gap); }
.doc-upload input[type="file"] { max-width: 280px; }
/* 4.209: bell lines read / unread */
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.bell-head h2 { margin: 0; }
.bell-panel li { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); }
.bell-panel li > a, .bell-open { flex: 1; min-width: 0; }
.bell-panel li.unread .bell-open span { font-weight: 700; }
.bell-panel li.read b { color: var(--muted); }
.bell-panel li.read .bell-open span { color: var(--muted); }
.link-button { background: none; border: 0; padding: 4px 6px; min-height: 0; color: var(--accent-text); font-size: 0.75rem; font-weight: 650; cursor: pointer; white-space: nowrap; box-shadow: none; }
.link-button:hover { text-decoration: underline; background: none; }
dialog.manage .manage-body { padding: 16px 20px 20px; }
/* 4.209 (Faiz 13-11 night): two panels side by side on a wide screen; a grid's button stays button-sized */
.pair { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; margin-bottom: var(--gap); }
.pair > .panel { margin: 0; }
@media (max-width: 1000px) { .pair { grid-template-columns: minmax(0, 1fr); } }
.doc-form > button { justify-self: start; }
.photo-upload { margin-top: 4px; }
form.stack.wide { max-width: none; }  /* 4.209: a form inside a full-width panel uses the width */

/* 4.215 (Faiz's pick 1): Message drivers in three steps with the phone preview */
.msg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--gap); align-items: start; }
.msg-steps { display: grid; gap: 12px; }
.msg-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.msg-step h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1rem; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85rem; }
.msg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.msg-chips .chip { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 700; cursor: pointer; }
.msg-chips .chip:hover, .msg-chips .chip:focus-visible { background: var(--accent-soft); }
.msg-step textarea { width: 100%; }
.msg-count { text-align: right; margin: 4px 0 0; }
.msg-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.msg-choice { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.msg-choice input { grid-row: span 2; }
.msg-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.msg-choice.off { opacity: .6; cursor: not-allowed; }
.msg-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.msg-phone { margin: 0; position: sticky; top: 90px; text-align: center; }
.phone-screen { border: 8px solid var(--ink); border-radius: 30px; min-height: 330px; padding: 34px 10px; background: linear-gradient(160deg, #1b3a52, #0b2233); }
.phone-notice { display: grid; gap: 2px; text-align: left; background: rgb(255 255 255 / 94%); color: #0B2233; border-radius: 14px; padding: 10px 12px; font-size: .9rem; overflow-wrap: anywhere; }
.phone-notice small { color: #4F6577; }
@media (max-width: 1000px) { .msg-layout { grid-template-columns: minmax(0, 1fr); } .msg-phone { position: static; max-width: 260px; margin: 0 auto; } }

/* 4.252 (Faiz 17-11, layout A): phone booking, the trip left and the price and booking right */
.phone-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap-lg); align-items: start; }
.price-big { font-size: 2rem; font-weight: 800; margin: 0; }
@media (max-width: 900px) { .phone-grid { grid-template-columns: minmax(0, 1fr); } }
/* 4.265 (Faiz 17-11, pick A): the driver Manage dialog in tabs: photo, name and status on top; one part at a time */
dialog.manage.tabbed { width: min(900px, calc(100vw - 32px)); }
dialog.manage.tabbed > header { align-items: center; justify-content: flex-start; }
dialog.manage.tabbed > header > div { flex: 1; min-width: 0; }
dialog.manage.tabbed > header h2 { margin: 0; }
dialog.manage.tabbed > header p { margin: 2px 0 0; }
.driver-photo-head.small { width: 44px; height: 44px; font-size: .9rem; }
.mtabs { position: sticky; top: 76px; z-index: 1; display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.mtabs::-webkit-scrollbar { display: none; }
.mtabs [role="tab"] { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font: inherit;
  font-weight: 650; padding: 12px 12px 10px; min-height: 0; white-space: nowrap; cursor: pointer; }
.mtabs [role="tab"][aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.mtabs [role="tab"]:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
  background: #FFF2DC; color: #8A4B00; font-size: .72rem; }
.mpane { padding: 4px 0 8px; }
.mpane > .doc-lines { padding: 12px 20px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mgrid > section { padding: 16px 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .mgrid > section:nth-child(odd):not(:last-child) { border-right: 1px solid var(--line); } }

/* Faiz 18-11: the Reset card shows the three resets side by side (one column on a phone) */
.reset-choices { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* 4.286 Administration → Roles: the roles grid (● all, ◐ some, — none) and the tick tree */
.roles-grid th.center, .roles-grid td.center { text-align: center; }
.roles-grid tr.current td { background: var(--accent-soft); }
.mark.all { color: var(--accent-text); } .mark.some { color: var(--accent); } .mark.none { color: var(--muted); }
.money-mark { color: var(--coral); font-weight: 800; }
.role-tree details { border-top: 1px solid var(--line); padding: 8px 0; }
.role-tree summary { cursor: pointer; padding: 4px 0; }
.role-tree label { display: flex; gap: 8px; align-items: baseline; padding: 4px 0 4px 26px; font-weight: 400; }
.role-tree label.all { font-weight: 700; }
.role-tree .kind { font-size: 11px; font-weight: 800; border-radius: 4px; padding: 0 5px; }
.role-tree .kind.v { background: var(--accent-soft); color: var(--accent-text); }
.role-tree .kind.ch { background: var(--coral-soft); color: var(--coral); }

/* Faiz 19-11: the booking page's actions side by side in one card, each a light tile */
.action-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.action-grid .action { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--surface); }
.action-grid .action h3 { margin: 0; }

/* Faiz 22-11: a magnifying glass in the phone booking's address boxes */
input.find-place { padding-left: 38px; background: var(--surface, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") no-repeat 12px center / 18px 18px; }
/* Faiz 22-11: the staff header shows the BookRideX logo (as the public site) */
.staffbar .brand img.logo { width: auto; height: 34px; }
