/* Isotrace shared design system (Dispatch plan, Phase 1b → 2V).
 *
 * The concept-art look: navy ink, teal accent, orange highlight, one set of
 * status colours used everywhere (list chip = map pin = timeline dot).
 *
 * Today every page carries its own copy of its styling. New pages load this
 * file instead, and Phase 2V moves the old pages onto it one group at a time.
 * Every class is prefixed `ui-` so nothing here can collide with a page's own
 * rules or with nav.css / staffbar.css while both styles live side by side.
 *
 * Light only: dark mode was removed app-wide (PR #122).
 *
 * Colours were picked to pass WCAG AA contrast for text (4.5:1) on white:
 * --ui-muted #5a6b73 is 5.4:1, --ui-red-ink #8e1f17 is 8.6:1. The status
 * colours also differ in lightness, not hue alone.
 */

:root {
  /* Ink and surfaces */
  --ui-ink: #10232b;        /* text, dark buttons, the pharmacy marker */
  --ui-ink-2: #3d5059;      /* secondary text */
  --ui-muted: #5a6b73;      /* labels, timestamps */
  --ui-line: #dbe3e6;       /* card borders */
  --ui-line-soft: #eef2f3;  /* row dividers */
  --ui-bg: #f2f5f6;         /* page background */
  --ui-surface: #ffffff;

  /* Brand */
  --ui-accent: #15607a;     /* teal: primary buttons, "on time" */
  --ui-accent-ink: #0e4659;
  --ui-accent-tint: #e3f0f4;
  --ui-orange: #e0871c;     /* highlight, driver exceptions */

  /* Status */
  --ui-red: #b3261e;        /* at risk / late */
  --ui-red-ink: #8e1f17;
  --ui-red-tint: #fbeceb;
  --ui-red-line: #e8b4ae;
  --ui-amber-tint: #f6deb0; /* exception chip */
  --ui-amber-soft: #fffaf2;
  --ui-grey: #6f8189;       /* returning */

  /* Type */
  --ui-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --ui-radius: 12px;
  --ui-radius-sm: 8px;
}

/* ---- Page ---------------------------------------------------------------- */
.ui-page {
  margin: 0;
  min-height: 100%;
  font-family: var(--ui-font);
  color: var(--ui-ink);
  background: var(--ui-bg);
}
.ui-page *, .ui-page *::before, .ui-page *::after { box-sizing: border-box; }
/* The `hidden` attribute must always win. Without this, any rule that sets
 * `display` (flex, inline-flex…) quietly shows a "hidden" element: on the
 * Dispatch page that left an invisible message layer over the whole map,
 * swallowing every drag, zoom and marker click. */
.ui-page [hidden] { display: none !important; }
.ui-page :focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 2px; }

.ui-h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.ui-h2 { margin: 0; font-size: 16px; font-weight: 700; }
.ui-sub { margin: 0; font-size: 14px; color: var(--ui-muted); }
.ui-small { font-size: 12px; color: var(--ui-muted); }
.ui-num { font-variant-numeric: tabular-nums; }
/* Read by screen readers, not shown: the text version of a picture. */
.ui-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;
}

/* ---- Cards ---------------------------------------------------------------- */
.ui-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  min-width: 0;
}
.ui-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #e6ecee;
}
.ui-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ui-row:last-child { border-bottom: 0; }
.ui-empty { padding: 28px 16px; text-align: center; color: var(--ui-muted); font-size: 14px; }

/* ---- KPI tiles ------------------------------------------------------------ */
.ui-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.ui-kpi {
  flex: 1 1 150px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 12px 16px;
  min-width: 0;
}
.ui-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ui-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ui-kpi-value { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.ui-kpi-value b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-kpi-value span { font-size: 13px; color: var(--ui-muted); }
@media (max-width: 560px) {
  /* Phone: three compact tiles to a row, as in the concept. */
  .ui-kpis { gap: 8px; }
  .ui-kpi { flex-basis: 100px; padding: 10px 12px; }
  .ui-kpi-label { font-size: 11px; }
  .ui-kpi-value { gap: 2px 6px; }
  .ui-kpi-value b { font-size: 22px; }
  .ui-kpi-value span { font-size: 12px; }
}
.ui-kpi.is-alert { border-color: var(--ui-red-line); }
.ui-kpi.is-alert .ui-kpi-label, .ui-kpi.is-alert b { color: var(--ui-red-ink); }
.ui-kpi.is-good b { color: var(--ui-accent); }

/* ---- Status chips (one vocabulary everywhere) ----------------------------- */
.ui-chip {
  flex: 0 0 auto;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  color: var(--ui-ink);
  background: var(--ui-line-soft);
}
.ui-chip.is-on-time { color: #fff; background: var(--ui-accent); }
.ui-chip.is-at-risk, .ui-chip.is-late { color: #fff; background: var(--ui-red); }
.ui-chip.is-exception { color: var(--ui-ink); background: var(--ui-amber-tint); }
.ui-chip.is-returning { color: #fff; background: var(--ui-grey); }
.ui-chip.is-not-departed { color: var(--ui-accent-ink); background: var(--ui-accent-tint); }
.ui-chip.is-done, .ui-chip.is-tracking, .ui-chip.is-errand { color: var(--ui-ink-2); background: var(--ui-line-soft); }

/* Item tags: the small uppercase label on an attention item. */
.ui-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 5px;
  padding: 2px 8px;
  color: var(--ui-ink-2);
  background: var(--ui-line-soft);
}
.ui-tag.is-dark { color: #fff; background: var(--ui-ink); }
.ui-tag.is-red { color: #fff; background: var(--ui-red); }
.ui-tag.is-soft-red { color: var(--ui-red-ink); background: var(--ui-red-tint); }
.ui-tag.is-amber { color: var(--ui-ink); background: var(--ui-amber-tint); }
.ui-tag.is-accent { color: var(--ui-accent-ink); background: var(--ui-accent-tint); }

/* ---- Buttons and links ---------------------------------------------------- */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.ui-btn:hover { border-color: var(--ui-accent); }
.ui-btn.is-primary { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.ui-btn.is-dark { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.ui-btn.is-outline { border-color: var(--ui-accent); color: var(--ui-accent); }
.ui-btn.is-wide { width: 100%; min-height: 44px; font-size: 14px; }
/* Ends or cancels something (End route): red outline, never filled. */
.ui-btn.is-danger { border-color: var(--ui-red-line); color: var(--ui-red-ink); }
.ui-btn.is-danger:hover { border-color: var(--ui-red); }
/* A toggle button (aria-pressed) shows when it's on. */
.ui-btn[aria-pressed="true"] { background: var(--ui-accent-tint); border-color: var(--ui-accent); color: var(--ui-accent-ink); }
.ui-btn:disabled { opacity: 0.55; cursor: default; }
.ui-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Progress bar --------------------------------------------------------- */
.ui-progress { flex: 1 1 auto; height: 6px; border-radius: 999px; background: #e6ecee; overflow: hidden; }
.ui-progress > span { display: block; height: 100%; background: var(--ui-accent); }
.ui-progress.is-returning > span { background: var(--ui-grey); }

/* ---- Notices -------------------------------------------------------------- */
.ui-note {
  border: 1px solid var(--ui-red-line);
  background: var(--ui-red-tint);
  color: var(--ui-red-ink);
  border-radius: var(--ui-radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}
.ui-note.is-info { border-color: var(--ui-line); background: var(--ui-surface); color: var(--ui-ink-2); }

/* ---- Dialog --------------------------------------------------------------- */
.ui-dialog {
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  padding: 18px;
  width: min(380px, calc(100% - 32px));
  color: var(--ui-ink);
  font-family: var(--ui-font);
  box-shadow: 0 24px 60px rgba(16, 35, 43, 0.3);
}
.ui-dialog::backdrop { background: rgba(16, 35, 43, 0.45); }
.ui-field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 14px; font-weight: 600; }
.ui-field input,
.ui-field select {
  font: inherit;
  font-weight: 400;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
}
.ui-field select { background: var(--ui-surface); color: var(--ui-ink); max-width: 100%; }

/* ===== Route History: drawer + timeline (ui-drawer, ui-timeline, ui-seg) ===== */
/* Added for the Route History redesign. New classes only: nothing above this
 * line changed, and Dispatch keeps its own copies until its group moves over. */

/* Side panel: a <dialog class="ui-drawer">. Opened with showModal() it dims the
 * page behind it (like Dispatch's run panel). With show() and .is-docked it
 * sits at the right edge and the page behind stays usable (a map you still
 * want to pan). Full screen on a phone either way. */
.ui-drawer {
  margin: 0 0 0 auto; padding: 0; border: 0; height: 100%; max-height: 100%;
  width: min(480px, 100%); max-width: 100%; overflow: auto;
  background: var(--ui-bg); color: var(--ui-ink); font-family: var(--ui-font);
  box-shadow: -20px 0 60px rgba(16, 35, 43, 0.25);
}
.ui-drawer *, .ui-drawer *::before, .ui-drawer *::after { box-sizing: border-box; }
.ui-drawer::backdrop { background: rgba(16, 35, 43, 0.35); }
.ui-drawer.is-docked[open] { position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 60; }
.ui-drawer-head {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 16px 18px; background: var(--ui-surface); border-bottom: 1px solid var(--ui-line);
}
.ui-drawer-body { padding: 14px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 600px) { .ui-drawer { width: 100%; } }

/* Segmented buttons: one choice out of a few ("Van | Trip | Speed"). */
.ui-seg { display: inline-flex; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); overflow: hidden; background: var(--ui-surface); }
.ui-seg > button {
  min-height: 34px; padding: 0 10px; border: 0; border-right: 1px solid var(--ui-line); background: none;
  font: 600 13px var(--ui-font); color: var(--ui-ink-2); cursor: pointer;
}
.ui-seg > button:last-child { border-right: 0; }
.ui-seg > button[aria-pressed="true"] { background: var(--ui-accent-tint); color: var(--ui-accent-ink); }
.ui-seg > button:disabled { opacity: 0.55; cursor: default; }

/* Day timeline: one lane per row (a van, a run) with bars and dots on a time
 * axis, and an optional clock line across every lane. Scrolls sideways inside
 * its own box on a phone, never the page. */
.ui-timeline-scroll { overflow-x: auto; }
.ui-timeline { position: relative; min-width: 760px; padding: 6px 16px 14px; }
.ui-tl-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; }
.ui-tl-hours { height: 26px; }
.ui-tl-track { position: relative; height: 100%; }
.ui-tl-hour { position: absolute; bottom: 4px; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--ui-muted); white-space: nowrap; }
.ui-tl-lane { height: 44px; border-top: 1px solid var(--ui-line-soft); }
.ui-tl-lane .ui-tl-track { height: 44px; cursor: crosshair; }
.ui-tl-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-right: 12px; }
.ui-tl-label b, .ui-tl-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-tl-label b { font-size: 13.5px; }
.ui-tl-label span { font-size: 12px; color: var(--ui-muted); }
.ui-tl-bar {
  position: absolute; top: 50%; transform: translateY(-50%); height: 14px; min-width: 5px;
  border: 0; border-radius: 999px; padding: 0; cursor: pointer;
}
.ui-tl-bar:hover { filter: brightness(0.9); }
.ui-tl-bar.is-selected { outline: 3px solid var(--ui-ink); outline-offset: 1px; }
.ui-tl-bar.is-hidden { opacity: 0.3; }
.ui-tl-dot { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ui-ink); pointer-events: none; }
.ui-tl-mark { position: absolute; top: 8px; bottom: 8px; width: 3px; transform: translateX(-1px); border-radius: 2px; background: var(--ui-red); pointer-events: none; }
.ui-tl-overlay { position: absolute; top: 6px; bottom: 14px; left: calc(16px + 170px); right: 16px; pointer-events: none; }
.ui-tl-cursor { position: absolute; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); background: var(--ui-ink); }
.ui-tl-cursor span {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700;
  color: #fff; background: var(--ui-ink); border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.ui-tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ui-ink-2); align-items: center; }
.ui-tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ui-tl-legend .ui-tl-dot, .ui-tl-legend .ui-tl-mark { position: static; transform: none; display: inline-block; }
.ui-tl-legend .ui-tl-mark { height: 12px; }

/* ===== Phase 2V: shared parts for the older pages (Records group first) ===== */
/* Added when Route Logs, Exception Log, Analytics and Route Doctor moved onto
 * this file. New classes only: nothing above this line changed. Several were
 * lifted out of Route History's page (date stepper, map key, link button,
 * fact grid) so every page uses one copy. */

:root {
  --ui-amber-ink: #9a5e0f;  /* amber text: caveats, "can't fix because…" (5.3:1 on white) */
}

/* Toolbar: a row of controls above a page's content (date, filters, export).
 * .is-card puts it in a white card, as Route Logs has it. */
.ui-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.ui-toolbar.is-card {
  background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius); padding: 12px 14px;
}
.ui-spacer { flex: 1 1 auto; }
.ui-label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ui-muted); }

/* Text, date and password boxes outside a dialog (.ui-field covers those). */
.ui-input {
  font: inherit; font-size: 14px; min-height: 36px; padding: 0 10px; max-width: 100%;
  border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm);
  background: var(--ui-surface); color: var(--ui-ink);
}
.ui-input:focus { border-color: var(--ui-accent); }

/* ← date → : step a day back or forward. */
.ui-datestep { display: inline-flex; align-items: center; gap: 6px; }
/* A square button holding one symbol (an arrow, a chevron). */
.ui-btn.is-icon { min-width: 36px; padding: 0 10px; font-size: 16px; }
.ui-btn.is-sm { min-height: 28px; padding: 0 10px; font-size: 12px; }

/* A button that reads as a link ("Show as table", "Only this"). */
.ui-link {
  background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12px;
  color: var(--ui-accent); text-decoration: underline; cursor: pointer;
}
.ui-link:hover { color: var(--ui-accent-ink); }

.ui-card.is-padded { padding: 14px 16px; }

/* Warning note: a caveat, not an error ("In testing"). */
.ui-note.is-warn {
  border-color: var(--ui-orange); border-left-width: 4px;
  background: var(--ui-amber-soft); color: var(--ui-ink);
}

/* Segmented buttons, older pages: their scripts mark the chosen button with
 * the class "on" rather than aria-pressed, so that counts as chosen too. */
.ui-seg > button.on { background: var(--ui-accent-tint); color: var(--ui-accent-ink); }

/* ---- Tables --------------------------------------------------------------- */
.ui-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ui-table th, .ui-table td {
  text-align: left; vertical-align: top; padding: 8px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.ui-table th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ui-muted); border-bottom-color: var(--ui-line);
}
.ui-table tbody tr:last-child td, .ui-table tbody tr:last-child th { border-bottom: 0; }
/* Numbers line up by place value, header over its digits. */
.ui-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Totals row. */
.ui-table tfoot th, .ui-table tfoot td {
  font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ui-ink);
  border-top: 2px solid var(--ui-line); border-bottom: 0;
}
.ui-table.is-compact th, .ui-table.is-compact td { padding: 6px 10px; }
/* A wide table scrolls sideways inside its card on a phone, never the page. */
.ui-table-wrap { overflow-x: auto; }
/* A tall table scrolls inside its box; the header and totals stay in view. */
.ui-table-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); }
.ui-table-scroll th, .ui-table-scroll td { white-space: nowrap; }
.ui-table-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--ui-surface); }
.ui-table-scroll tfoot th, .ui-table-scroll tfoot td { position: sticky; bottom: 0; background: var(--ui-surface); }

/* ---- Key (legend) for a map or chart --------------------------------------- */
.ui-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--ui-ink-2); }
.ui-legend > span { display: inline-flex; align-items: center; gap: 6px; }
/* Floating over a map: the page positions it, this gives it its box. */
.ui-legend.is-overlay {
  background: var(--ui-surface); color: var(--ui-ink); border: 1px solid var(--ui-line);
  border-radius: 10px; padding: 7px 10px;
}
/* One colour sample. The page sets its colour (style="background:…"). */
.ui-swatch { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 3px; background: var(--ui-grey); }
.ui-swatch.is-line { width: 16px; height: 5px; }
.ui-swatch.is-dot { border-radius: 50%; }
.ui-swatch.is-dashed { width: 16px; height: 0; border-top: 3px dashed var(--ui-grey); border-radius: 0; background: none; }

/* ---- Facts: label above value, as many to a row as fit -------------------- */
.ui-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; padding: 14px 16px; }
.ui-fact-k { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ui-muted); }
.ui-fact-v { font-size: 14px; margin-top: 2px; }

/* ---- Phone ---------------------------------------------------------------- */
@media (max-width: 560px) {
  /* Big enough to tap. */
  .ui-toolbar .ui-btn, .ui-toolbar .ui-input, .ui-toolbar .ui-seg > button { min-height: 44px; }
}

/* ===== Phase 2V PR 2: page header, tabs, list-and-detail (Customers first) ===== */
/* New classes only; nothing above this line changed. */

/* Page header: title and one line on the left, the page's main button on the right. */
.ui-pagehead { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.ui-pagehead > :first-child { min-width: 0; flex: 1 1 260px; }
.ui-pagehead .ui-sub { margin-top: 4px; }

/* A fold-out line ("How this page works"): the long explanation, one click away. */
.ui-details > summary {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ui-accent); list-style: none;
}
.ui-details > summary::-webkit-details-marker { display: none; }
.ui-details > summary::before { content: "\25B8"; font-size: 11px; transition: transform .15s; }
.ui-details[open] > summary::before { transform: rotate(90deg); }
.ui-details[open] > summary { margin-bottom: 8px; }

/* Tabs: one page, a few views ("Customers | SMS sign-ups"). role="tab" buttons
 * with aria-selected; the chosen one is underlined. */
.ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-line); overflow-x: auto; }
.ui-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none;
  font: 600 14px var(--ui-font); color: var(--ui-ink-2); cursor: pointer;
}
.ui-tab:hover { color: var(--ui-ink); }
.ui-tab[aria-selected="true"] { color: var(--ui-accent-ink); border-bottom-color: var(--ui-accent); }
.ui-tab .ui-count { font-weight: 500; color: var(--ui-muted); }

/* List and detail: a list on the left, the chosen item on the right. The list
 * column stays put while the page scrolls and scrolls on its own. On a phone
 * the page shows one or the other (the page decides which). */
.ui-split { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ui-split-side {
  position: sticky; top: 12px; max-height: calc(100vh - 24px - var(--shell-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.ui-split-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 899px) {
  .ui-split { grid-template-columns: minmax(0, 1fr); }
  .ui-split-side { position: static; max-height: none; }
}

/* The list: one button per item, name over a grey line, small markers right. */
.ui-picklist {
  background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
  overflow-y: auto; min-height: 0; flex: 1 1 auto;
}
.ui-pick {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 8px 12px;
  border: 0; border-bottom: 1px solid var(--ui-line-soft); border-left: 3px solid transparent;
  background: none; text-align: left; font: inherit; color: var(--ui-ink); cursor: pointer;
}
.ui-pick:last-child { border-bottom: 0; }
.ui-pick:hover { background: var(--ui-bg); }
.ui-pick[aria-current="true"] { background: var(--ui-accent-tint); border-left-color: var(--ui-accent); }
.ui-pick-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ui-pick-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ui-pick-sub { font-size: 12px; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-pick-marks { flex: 0 0 auto; display: inline-flex; gap: 4px; align-items: center; }
.ui-pick-mark { font-size: 12px; font-weight: 700; line-height: 1; }
.ui-pick-mark.is-warn { color: var(--ui-amber-ink); }
.ui-pick-mark.is-dirty { color: var(--ui-orange); }
.ui-pick-mark.is-zone { color: var(--ui-accent); }
.ui-pick-mark.is-off { color: var(--ui-muted); }
@media (max-width: 560px) { .ui-pick { min-height: 56px; } }

/* A heading between groups of fields inside a form ("Location", "Contacts"). */
.ui-group-h {
  grid-column: 1 / -1; margin: 6px 0 -2px; padding-top: 10px; border-top: 1px solid var(--ui-line-soft);
  font-size: 13px; font-weight: 700; color: var(--ui-ink);
}
.ui-group-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* A bar that stays at the bottom of the screen while its form is in view
 * (Save always visible). Sits above the phone's menu bar. */
.ui-stickybar {
  position: sticky; bottom: var(--shell-bottom, 0px); z-index: 3;
  background: var(--ui-surface); border-top: 1px solid var(--ui-line);
  box-shadow: 0 -6px 16px rgba(16, 35, 43, 0.06);
}

/* ===== Phase 2V PR 4: page tabs (ui-tabs.js) ===== */
/* A tab bar ui-tabs.js puts above a page's views (Pharmacists first). */
.ui-tabs.is-page { margin-bottom: 14px; }
