/* POSH operator console. The passenger palette (app/lib/ui/palette.dart) on a navy bar the colour of the logo's own
   ground. Archivo only, nothing below 15 px or lighter than 500, tabular figures for every number. No shadows,
   gradients or blur: one elevation, a raised surface or a 1 px line. Banned: green, taxi yellow and gold. Critical
   red is only ever a fill with white text. */

@font-face { font-family: "Archivo"; src: url("fonts/Archivo-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/Archivo-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/Archivo-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "ArchivoWordmark"; src: url("fonts/ArchivoWordmark-BoldItalic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #FAF8F5;
  --surface: #FFFFFF;
  --ink: #16130F;
  --ink-2: #4A443C;
  --accent: #12244A;
  --accent-on: #FFFFFF;
  --accent-tint: #E9EDF5;
  --line: #E3DED6;
  --critical: #A32A1E;
  --navy: #010C28;
  --navy-line: #1D2B4D;
  --navy-ink-2: #B9C3D6;
  --radius: 12px;
  --radius-card: 20px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 500 16px/1.45 "Archivo", system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.secondary { color: var(--ink-2); font-size: 15px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Controls */
button { font: inherit; cursor: pointer; }
button.primary, button.secondary-button, button.small, button.danger {
  min-height: 48px; padding: 0 20px; border-radius: var(--radius); font-size: 16px; font-weight: 600;
  border: 1px solid var(--accent);
}
button.primary { background: var(--accent); color: var(--accent-on); }
button.secondary-button { background: var(--surface); color: var(--accent); }
button.small { min-height: 44px; padding: 0 16px; font-size: 15px; background: var(--surface); color: var(--accent); }
button.small.strong { background: var(--accent); color: var(--accent-on); }
button.danger { background: var(--critical); border-color: var(--critical); color: #FFFFFF; }
button.plain { min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.55; cursor: default; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 48px; padding: 10px 14px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #6E675E; }
label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.phone-field { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.phone-field:focus-within { border-color: var(--accent); }
.phone-field .prefix { display: flex; align-items: center; padding: 0 12px 0 14px; color: var(--ink-2); border-right: 1px solid var(--line); }
.phone-field input { border: 0; border-radius: 0; }
.phone-field input:focus-visible { outline: none; }
.form-error { color: var(--ink); font-weight: 600; min-height: 0; }
.form-error:not(:empty) { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--critical); border-left-width: 6px; border-radius: var(--radius); background: var(--surface); }
.form-note:not(:empty) { margin-top: 10px; }

/* The lockup: the real POSH mark and the wordmark */
.mark { width: 40px; height: 40px; display: block; flex: none; }
.wordmark { font-family: "ArchivoWordmark", "Archivo", sans-serif; font-style: italic; font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: 0; }
.lockup, .brand { display: flex; align-items: center; gap: 10px; }

/* Sign-in: one centred column, no side panel (18 Nov 2026). The lockup, the POSH car at Arch 22 (the apps' own
   signature picture), the heading, then the form with its labels above the fields. */
.signin { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; background: var(--ground); }
.signin-panel { width: 100%; max-width: 440px; padding: 24px var(--gutter) 48px; }
.signin-panel .lockup { justify-content: center; margin-bottom: 24px; }
.signin-panel .lockup .mark { width: 40px; height: 40px; }
.lockup-label { font-size: 17px; font-weight: 600; color: var(--ink-2); padding-left: 10px; border-left: 1px solid var(--line); }
.signin-picture { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 8px; }
.signin-form { display: grid; gap: 10px; }
.signin-form h1 { font-size: 28px; text-align: center; }
.signin-form > .secondary { text-align: center; margin-bottom: 14px; }
.signin-form label { margin-top: 4px; }
.signin-form button.primary { margin-top: 14px; width: 100%; min-height: 52px; font-size: 17px; }
.signin-form button.plain { justify-self: center; }
.signin-form #passwordRule { margin-top: -4px; font-size: 14px; text-align: left; }
.password-field { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.password-field:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.password-field input { border: 0; border-radius: 0; }
.password-field input:focus-visible { outline: none; }
.password-field .show-password { flex: none; min-width: 72px; padding: 0 14px; background: none; border: 0; border-left: 1px solid var(--line); color: var(--accent); font-weight: 600; font-size: 15px; }
.code-input { font-size: 28px; font-weight: 700; letter-spacing: 0.3em; }
@media (min-width: 600px) {
  .signin { align-items: center; }
  .signin-panel { padding: 40px; margin: 32px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
  .signin-picture { max-width: 300px; }
}
@media (max-height: 820px) {
  /* A laptop's short screen: the whole sign-in fits without scrolling. */
  .signin-picture { max-width: 190px; }
  .signin-panel { margin-block: 12px; padding-block: 28px; }
  .signin-panel .lockup { margin-bottom: 16px; }
}

/* The bar */
.top { position: sticky; top: 0; z-index: 5; }
.bar {
  background: var(--navy); color: #FFFFFF;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px var(--gutter);
  border-bottom: 1px solid var(--navy-line);
}
.bar .wordmark { color: #FFFFFF; font-size: 24px; }
.bar-title { font-size: 17px; font-weight: 600; color: var(--navy-ink-2); padding-left: 10px; border-left: 1px solid var(--navy-line); }
.bar-status { flex: 1 1 220px; font-size: 15px; color: var(--navy-ink-2); }
.bar-status.trouble { color: #FFFFFF; font-weight: 600; }
.bar-actions { display: flex; gap: 8px; }
.bar-button {
  min-height: 44px; padding: 0 14px; border-radius: var(--radius); font-size: 15px; font-weight: 600;
  background: transparent; color: #FFFFFF; border: 1px solid #3A4A70;
}
.bar-button.attention { background: #FFFFFF; color: var(--navy); }

/* The banner when an alert arrives */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px var(--gutter); background: var(--accent); color: #FFFFFF; font-weight: 600;
}
.banner.critical { background: var(--critical); }
.banner p { flex: 1 1 260px; font-size: 17px; }
.banner-actions { display: flex; gap: 8px; }
.banner button { min-height: 44px; padding: 0 16px; border-radius: var(--radius); font-weight: 600; background: #FFFFFF; color: var(--ink); border: 1px solid #FFFFFF; }
.banner button + button { background: transparent; color: #FFFFFF; }

/* Phones: one compact row for the bar, so the bar and a banner leave most of the screen to the alerts. */
@media (max-width: 699px) {
  .bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 12px; }
  .bar .mark { width: 32px; height: 32px; }
  .bar .wordmark { font-size: 21px; }
  .bar-status { grid-column: 1 / -1; grid-row: 2; }
  .bar-button { padding: 0 12px; }
  .banner { padding: 10px 12px; gap: 8px 12px; }
  .banner p { font-size: 16px; flex-basis: 100%; }
}
@media (max-width: 479px) { .bar-title { display: none; } }

/* Section tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--radius); color: var(--ink); font-weight: 600; text-decoration: none; }
.tabs a:hover { background: var(--accent-tint); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-size: 15px; font-weight: 700; }
.count.critical { background: var(--critical); color: #FFFFFF; }

/* The board */
.board { display: grid; gap: 16px; padding: 16px var(--gutter) 64px; max-width: 1600px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; min-width: 0; scroll-margin-top: calc(var(--top-height, 72px) + 12px); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.panel-head-gap { margin-top: 28px; }
.stack { display: grid; gap: 12px; }
.empty { color: var(--ink-2); padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
/* Laptop: alerts keep the left column, always in view; every other section stacks on the right. */
@media (min-width: 1100px) {
  .board { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; }
  .board > .panel { grid-column: 2; }
  .board > .panel-alerts {
    grid-column: 1; grid-row: 1 / span 4; position: sticky; top: calc(var(--top-height, 72px) + 16px);
    max-height: calc(100vh - var(--top-height, 72px) - 32px); overflow-y: auto;
  }
}

/* Alerts */
.alert { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; background: var(--surface); display: grid; gap: 8px; }
.alert.new { border-color: var(--accent); border-width: 2px; padding: 15px; }
.alert-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.alert-title h3 { font-size: 17px; }
.alert-time { font-size: 15px; color: var(--ink-2); }
.alert-do { font-size: 15px; color: var(--ink-2); }
.alert.critical { background: var(--critical); border-color: var(--critical); color: #FFFFFF; }
.alert.critical .alert-time, .alert.critical .alert-do, .alert.critical .people dt { color: #FFFFFF; }
.alert.critical a { color: #FFFFFF; }
.alert.critical button.small { background: #FFFFFF; color: var(--ink); border-color: #FFFFFF; }
.alert.critical button.small.strong { background: transparent; color: #FFFFFF; border-color: #FFFFFF; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Rides */
.ride-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.ride { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; display: grid; gap: 12px; background: var(--surface); align-content: start; }
.ride.needs-you { border: 2px solid var(--critical); padding: 15px; }
.ride-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; min-height: 30px; padding: 2px 12px; border-radius: 999px; font-size: 15px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.pill.blue { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent); }
.pill.navy { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.pill.ink { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.pill.critical { background: var(--critical); border-color: var(--critical); color: #FFFFFF; }
.fare { font-size: 26px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.route { display: grid; gap: 2px; }
.route p { font-size: 17px; }
.route .label { display: inline-block; min-width: 44px; color: var(--ink-2); font-size: 15px; }
.people { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.people dt { color: var(--ink-2); font-size: 15px; padding-top: 1px; }
.people dd { margin: 0; overflow-wrap: anywhere; }
.people dd .sub { color: var(--ink-2); font-size: 15px; }
.alert.critical .people dd .sub { color: #FFFFFF; }
.ride-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ride-id { font-size: 15px; color: var(--ink-2); }
.code { font-weight: 700; letter-spacing: 0.08em; }

/* Ended rides and short lists: one row each */
.rows { display: grid; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.row { display: grid; grid-template-columns: 1fr; gap: 4px 16px; align-items: center; width: 100%; text-align: left; padding: 12px 16px; background: var(--surface); border: 0; border-top: 1px solid var(--line); color: var(--ink); }
.row:first-child { border-top: 0; }
button.row:hover { background: var(--accent-tint); }
.row .where { font-size: 16px; overflow-wrap: anywhere; }
.row .meta { color: var(--ink-2); font-size: 15px; }
.row .money { font-weight: 700; }
@media (min-width: 760px) {
  .row { grid-template-columns: 76px 190px minmax(0, 1fr) 96px 190px; }
  .row .money { text-align: right; }
}

/* Drivers */
.toolbar { margin-bottom: 12px; max-width: 520px; }
.drivers { display: grid; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.driver { display: grid; grid-template-columns: 1fr; gap: 6px 16px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: center; }
.driver:first-child { border-top: 0; }
.driver .name { font-weight: 600; font-size: 17px; }
.driver .meta { color: var(--ink-2); font-size: 15px; }
.driver-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.driver-actions button, .ride-actions button, .alert-actions button { white-space: nowrap; }
@media (max-width: 899px) {
  .driver { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .driver-actions { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .driver { grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(180px, 1.3fr) minmax(190px, 1.2fr) auto; }
  .driver-actions { justify-content: flex-end; }
}
.register { margin-top: 16px; }
.register summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; }
.register > .secondary { margin: 4px 0 12px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.form-grid label { display: grid; gap: 6px; }
.form-actions { display: flex; align-items: end; }
@media (min-width: 760px) { .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Passenger lookup and tools */
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; max-width: 520px; margin-bottom: 16px; }
.passenger-card { display: grid; gap: 12px; }
.tool { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.tool:first-of-type { border-top: 0; padding-top: 0; }
.tool > div { flex: 1 1 280px; display: grid; gap: 4px; }
.signed-in-as { margin-top: 16px; }

/* Dialogs */
.dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; color: var(--ink); background: var(--surface); }
.dialog-wide { width: min(720px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(1, 12, 40, 0.55); }
.dialog form { display: grid; gap: 12px; }
.dialog-text { color: var(--ink-2); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
#rideDialogBody .ride { border: 0; padding: 0; }
