/* Bidon Rider Card – shared look for all phone screens (matches the printed card). */
:root {
  --ink: #17302a;
  --black: #0b0b0b;
  --cream: #f5f3ec;
  --lime: #d5e3a3;
  --muted: #4a5752;
  --line: #b8bfb9;
  --ok: #1f6b45;
  --ok-bg: #e3f1e8;
  --info: #1d4f91;
  --info-bg: #e3ecf8;
  --warn: #8a4b00;
  --warn-bg: #fff4e0;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.bar {
  background: var(--black);
  color: #fff;
  padding: 16px 20px 12px;
  border-bottom: 4px solid var(--lime);
}
header.bar .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
header.bar .brand { font-weight: 800; font-size: 20px; letter-spacing: 0.04em; }
header.bar .role { font-size: 13px; font-weight: 700; color: var(--lime); text-transform: uppercase; }
header.bar .sub { font-size: 13px; color: #c9c9c9; margin-top: 2px; }

main { padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; width: 100%; max-width: 560px; margin: 0 auto; }
h1 { margin: 0; font-size: 22px; font-weight: 800; }
h2 { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
p { margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
label, .label { font-size: 13px; font-weight: 600; }
input, select {
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.inline { display: flex; gap: 8px; }
.inline > input { flex: 1; min-width: 0; }

button, .button {
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
button.primary, .button.primary { background: var(--ink); color: #fff; border-color: var(--ink); min-height: 56px; font-size: 17px; }
button.accent { background: var(--lime); color: var(--black); border-color: var(--lime); min-height: 56px; font-size: 17px; font-weight: 800; }
button.icon { width: 48px; padding: 0; flex: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.full { width: 100%; }

.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.segmented button { flex-direction: column; gap: 0; min-height: 56px; border-color: var(--line); font-weight: 600; }
.segmented button small { font-size: 11px; font-weight: 500; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }
.segmented button[aria-pressed="true"] small { color: var(--lime); }

.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; min-height: 44px; border-color: var(--line); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.panel { background: #fff; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.result { border: 2px solid var(--ink); }
.result .title { font-size: 17px; font-weight: 800; }
.result.ok { border-color: var(--ok); } .result.ok .title { color: var(--ok); }
.result.info { border-color: var(--info); } .result.info .title { color: var(--info); }
.result.warn { border-color: var(--warn); } .result.warn .title { color: var(--warn); }
.result.bad { border-color: var(--bad); } .result.bad .title { color: var(--bad); }
.charge { font-size: 40px; font-weight: 800; line-height: 1.1; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

.notice { border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: #5c3300; }
.notice.bad { background: var(--bad-bg); color: #8c1d16; }
.notice.ok { background: var(--ok-bg); color: #14452d; }
.notice.info { background: var(--info-bg); color: #143a6b; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.stat { background: #fff; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 24px; font-weight: 800; }
.stat.alert { background: var(--bad-bg); } .stat.alert span, .stat.alert strong { color: #8c1d16; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #ecebe4; font-size: 15px; }
.list li:last-child { border-bottom: none; }
.empty { color: var(--muted); font-size: 14px; padding: 4px 0; }

.income { background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-end; }
.income span { font-size: 12px; color: var(--lime); }
.income strong { font-size: 30px; font-weight: 800; display: block; }
.income small { color: #d9e0dc; font-size: 13px; text-align: right; }

.status-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.status-pill.online { background: var(--ok-bg); color: var(--ok); }

/* QR scanner */
dialog.scanner { border: none; padding: 0; width: min(100vw, 520px); max-width: 100vw; background: #000; color: #fff; border-radius: 16px; }
dialog.scanner::backdrop { background: rgba(0, 0, 0, 0.85); }
dialog.scanner video { width: 100%; display: block; aspect-ratio: 3 / 4; object-fit: cover; }
dialog.scanner .controls { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
dialog.scanner .controls p { font-size: 14px; color: #ddd; text-align: center; }
dialog.scanner button { background: #fff; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--black); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 10; }

[hidden] { display: none !important; }

button.linkish { min-height: 0; padding: 0; border: none; background: none; color: var(--lime); font-size: 13px; font-weight: 600; text-decoration: underline; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.check input { width: 22px; height: 22px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid #ecebe4; }
table.grid td { padding: 8px 4px; border-bottom: 1px solid #ecebe4; vertical-align: top; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { min-height: 36px; font-size: 13px; padding: 0 10px; }
.pill-off { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #ecebe4; color: var(--muted); }
.tabs.wrap { flex-wrap: wrap; }
.tabs.wrap button { flex: 1 1 80px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* day picker: our own label, the phone's calendar behind it */
.daypick { display: flex; gap: 8px; align-items: stretch; }
.daypick button.icon { font-size: 22px; font-weight: 800; }
.daypick .day { position: relative; flex: 1; min-width: 0; }
.daypick .day button { width: 100%; height: 48px; justify-content: space-between; font-size: 18px; border-color: var(--line); }
.daypick input[type=date] { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

textarea { font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; resize: vertical; }
textarea:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.panel p a { color: var(--info); font-weight: 600; }

footer.version { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 18px; }
table.grid td.num { text-align: right; white-space: nowrap; }
details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.hash { font-size: 24px; font-weight: 800; color: var(--ink); }
.cal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.cal { background: #fff; border-radius: 18px; padding: 16px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.cal-title { margin: 0; font-size: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 19px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-day { min-height: 44px; padding: 0; border-radius: 10px; font-size: 17px; font-weight: 700; }
.cal-day.today { border-color: var(--ink); border-width: 2px; }
.cal-day.sel { background: var(--ink); color: #fff; }
.cal-day[disabled] { opacity: .3; }
button.big, .button.big { min-height: 76px; font-size: 22px; font-weight: 800; border-radius: 18px; width: 100%; }
.stepnav { display: flex; justify-content: space-between; gap: 10px; }
.stepnav button { min-height: 48px; padding: 0 18px; font-weight: 700; }

/* the cars of one day under status headings (owner, manager, vendors) */
.cargrid { width: 100%; border-collapse: collapse; font-size: 16px; }
.cargrid th, .cargrid td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cargrid thead th { font-size: 13px; color: var(--muted, #5f6b66); font-weight: 600; }
.cargrid td strong { font-size: 18px; }
.cargrid .k { display: block; font-size: 12px; color: var(--muted, #5f6b66); }
.cargrid tr.head th { background: var(--ink); color: #fff; font-size: 15px; padding: 8px 10px; border-radius: 0; }
.cargrid tr.head.s-not-paid th { background: var(--bad, #b3261e); }
.cargrid tr.head.s-left th { background: #9aa5a0; }

/* sortable, searchable grids */
.gridtools { display: flex; gap: 8px; margin: 0 0 8px; flex-wrap: wrap; }
.gridtools input { flex: 1 1 160px; min-height: 44px; }
.gridtools select { flex: 0 1 220px; min-height: 44px; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: " ↕"; opacity: .35; font-size: .9em; }
th.sortable[aria-sort="ascending"]::after { content: " ▲"; opacity: 1; }
th.sortable[aria-sort="descending"]::after { content: " ▼"; opacity: 1; }

/* "Put Rider Card on this phone" (staff screens, until installed) */
.install-hint { max-width: 560px; margin: 16px auto 0; text-align: center; }
.install-hint .linkish { font-size: 15px; color: var(--ink); }
@media (display-mode: standalone) { .install-hint { display: none; } }
