/* MOT Plus 1 — workshop look, refined.
   The dashboard opens on a night-navy band (continuous with the header) that ends on the number-plate yellow rule.
   Everything below is quiet: one white board, one grouped list. Plate yellow is kept for plates, the main
   "Add customer" action and focus. Red = overdue/fail, green = booked/pass, amber = due soon. */
:root {
  --night: #0f1a27;        /* header + dashboard band */
  --night-2: #1b2838;      /* raised areas on the band */
  --ink: #17212c;          /* body text */
  --muted: #5b6672;
  --faint: #8a949e;
  --paper: #f1f3f5;        /* page: cool porcelain grey */
  --surface: #ffffff;
  --sunk: #f6f7f9;         /* panels inside white surfaces, row hover */
  --line: #e1e5e9;
  --line-strong: #c4ccd3;
  --shop: #1c2a3a;         /* primary buttons */
  --shop-2: #2a3b4f;
  --plate: #f6c500;        /* UK rear plate */
  --plate-ink: #141414;
  --pass: #1d6b4a;
  --pass-bg: #e4f1ea;
  --fail: #9c4a3c;         /* overdue: muted brick, not alarm red */
  --fail-bg: #f5ebe7;
  --due: #8a6116;
  --due-bg: #f8f0de;
  --on-night: #ffffff;
  --on-night-muted: #a7b3c0;
  --radius-sm: 6px;        /* buttons, inputs, badges */
  --radius: 12px;          /* main surfaces */
  --lift: 0 1px 2px rgba(15, 26, 39, .06), 0 10px 28px -14px rgba(15, 26, 39, .22);
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  /* aliases kept for older rules */
  --bg: var(--paper); --navy: var(--shop); --primary: var(--shop);
  --danger: var(--fail); --danger-bg: var(--fail-bg); --warn: var(--due); --warn-bg: var(--due-bg);
  --ok: var(--pass); --ok-bg: var(--pass-bg);
  font-family: var(--body);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums; overflow-x: clip; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .005em; line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 .75rem; }
h3 { font-size: 1.2rem; margin-bottom: .4rem; }
h4 { font-family: var(--display); font-size: 1.05rem; }
.muted { color: var(--muted); }
a { color: var(--shop); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--plate); outline-offset: 2px; }

/* ---------- Header ---------- */
.topbar { background: var(--night); color: #fff; display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  padding: .7rem max(20px, env(safe-area-inset-left, 0px)) .7rem max(20px, env(safe-area-inset-right, 0px));
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; border-bottom: 3px solid var(--plate); }
/* On the dashboard the band below carries the yellow rule instead */
body[data-tab="dashboard"] .topbar { border-bottom-color: rgba(255, 255, 255, .07); border-bottom-width: 1px; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700; }
.brand-mark { background: var(--plate); color: var(--plate-ink); padding: .08rem .5rem; border-radius: 4px; border: 1.5px solid var(--plate-ink);
  box-shadow: 0 0 0 2px var(--plate); font-size: 1.15rem; letter-spacing: .07em; }
.brand-name { font-size: 1.4rem; color: inherit; letter-spacing: .01em; }
.tabs { display: flex; gap: .2rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: var(--on-night-muted); text-decoration: none; padding: .5rem .85rem; white-space: nowrap; font-weight: 600; position: relative; }
.tabs a:hover { color: #fff; }
.tabs a.active { color: #fff; }
.tabs a.active::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: -.12rem; height: 3px; border-radius: 3px; background: var(--plate); }
.topbar form { margin: 0; }
.topbar .btn.ghost { color: #dfe6ee; border-color: rgba(255, 255, 255, .22); }
.topbar .btn.ghost:hover { border-color: #fff; color: #fff; }
@media (max-width: 640px) {
  .topbar { gap: .4rem .8rem; padding-bottom: .2rem; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -.5rem; }
  .tabs a { padding: .55rem .6rem .6rem; font-size: .95rem; }
  .tabs a.active::after { left: .6rem; right: .6rem; bottom: .05rem; }
  .topbar form { margin-left: auto; }
}

main { max-width: 1120px; margin: 0 auto; padding: 1.8rem max(20px, env(safe-area-inset-right, 0px)) 4rem max(20px, env(safe-area-inset-left, 0px)); }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: .58rem 1.05rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; line-height: 1.2; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--shop); border-color: var(--shop); color: #fff; }
.btn.primary:hover { background: var(--shop-2); border-color: var(--shop-2); }
.btn.accent { background: var(--plate); border-color: var(--plate); color: var(--plate-ink); font-weight: 700; }
.btn.accent:hover { background: #ffd31f; border-color: #ffd31f; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--fail); }
.btn.small { padding: .34rem .7rem; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Dashboard band ---------- */
.hero-band { position: relative; isolation: isolate; color: var(--on-night); margin-top: -1.8rem; padding: 2.4rem 0 2rem; margin-bottom: 1.6rem; }
.hero-band::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); background: var(--night); border-bottom: 3px solid var(--plate); z-index: -1; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 3.9rem); letter-spacing: -.005em; }
.hero-summary { margin: .45rem 0 0; font-size: 1.15rem; color: var(--on-night-muted); max-width: 60ch; }
.hero .btn.accent { padding: .7rem 1.2rem; }

/* Summary strip: one instrument row split into four */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: .85rem 1.1rem; border-left: 1px solid var(--line); display: flex; align-items: baseline; gap: .6rem; }
.stat:first-child { border-left: none; }
.stat span { font-family: var(--display); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat small { color: var(--muted); font-size: .95rem; }
.stat.danger span { color: var(--fail); }
.stat.warn span { color: var(--due); }
.stat.booked span { color: var(--pass); }
.hero-band .stats { background: var(--night-2); border-color: rgba(255, 255, 255, .08); }
.hero-band .stat { border-left-color: rgba(255, 255, 255, .08); padding: 1rem 1.2rem; }
.hero-band .stat span { color: #fff; font-size: 2.6rem; }
.hero-band .stat small { color: var(--on-night-muted); }
.hero-band .stat.danger span { color: #e8a596; }
.hero-band .stat.warn span { color: #e9c97f; }
.hero-band .stat.booked span { color: #8fcfac; }
@media (max-width: 640px) {
  .hero-band { padding: 1.8rem 0 1.5rem; }
  .hero { margin-bottom: 1.2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-band .stat:nth-child(n+3) { border-top-color: rgba(255, 255, 255, .08); }
  .hero-band .stat { padding: .85rem 1rem; }
  .hero-band .stat span { font-size: 2.2rem; }
}

/* ---------- Two-week calendar ---------- */
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.board-head h2 { margin-bottom: .75rem; }
.board-key { margin: 0; font-size: .88rem; display: flex; gap: .35rem 1rem; align-items: center; flex-wrap: wrap; }
.key { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: -.6rem; vertical-align: -1px; }
.key.due { background: var(--due); } .key.booked { background: var(--pass); } .key.over { background: var(--fail); }
.cal { display: flex; flex-direction: column; gap: .9rem; }

/* Overdue cars: a quiet white strip with a thin brick edge, not an alarm */
.cal-overdue { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--fail);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--lift); }
.cal-overdue-head { padding: .85rem 1.1rem; display: flex; flex-direction: column; justify-content: center; gap: .2rem; min-width: 9.5rem; border-right: 1px solid var(--line); }
.cal-overdue-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink); display: flex; align-items: center; gap: .45rem; }
.cal-overdue-note { font-size: .82rem; color: var(--muted); }
.cal-overdue-head .cal-count { background: var(--fail-bg); color: var(--fail); }
.cal-overdue-jobs { display: flex; flex-wrap: wrap; gap: .5rem; padding: .7rem; align-items: flex-start; flex: 1; }
.cal-overdue-jobs .job { width: 11.5rem; }

/* ---------- Today + To chase ---------- */
.ops { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.1rem; margin-top: 1.6rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: 1rem 1.15rem .85rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 1.35rem; }
.panel-sub { font-size: .85rem; color: var(--muted); font-weight: 600; }
.panel-empty { padding: 1.4rem 1.15rem; color: var(--muted); font-size: .95rem; }
.today-panel .panel-head { background: var(--night); border-bottom: 3px solid var(--plate); }
.today-panel .panel-head h2 { color: #fff; }
.today-panel .panel-sub { color: var(--plate); }

.slot { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto; align-items: center; gap: .9rem; padding: .85rem 1.15rem; border-top: 1px solid var(--line); cursor: pointer; }
.slot:first-child { border-top: none; }
.slot:hover { background: var(--sunk); }
.slot:focus-visible { outline: 3px solid var(--plate); outline-offset: -3px; }
.slot-time { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--ink); border-right: 1px solid var(--line); padding-right: .6rem; }
.slot-time.any { font-size: .9rem; line-height: 1.15; color: var(--muted); font-family: var(--body); font-weight: 600; }
.slot-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.slot-who { margin-top: .3rem; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-actions, .chase-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.tag { font-size: .74rem; font-weight: 700; letter-spacing: .02em; padding: .12rem .45rem; border-radius: 4px; }
.tag.mot { background: #e6edf6; color: #22476e; }
.tag.svc { background: #ece8f5; color: #4d3f7a; }

.chase-row { display: flex; align-items: center; gap: .6rem .9rem; flex-wrap: wrap; padding: .8rem 1.15rem .8rem 1rem; border-top: 1px solid var(--line); border-left: 3px solid var(--due); }
.chase-row:first-child { border-top: none; }
.chase-row.over { border-left-color: var(--fail); }
.chase-main { flex: 1; min-width: 12rem; cursor: pointer; }
.chase-main:focus-visible { outline: 3px solid var(--plate); outline-offset: 2px; }
.chase-when { font-size: .82rem; font-weight: 700; color: var(--due); }
.chase-row.over .chase-when { color: var(--fail); }
@media (max-width: 900px) {
  .ops { grid-template-columns: 1fr; }
  .slot { grid-template-columns: 3.9rem minmax(0, 1fr); }
  .slot-actions { grid-column: 2; justify-content: flex-start; }
  .slot-time { font-size: 1.35rem; }
}

/* Two rolling weeks, seven days a row */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--lift); }
.cal-day { background: var(--surface); min-height: 7.25rem; display: flex; flex-direction: column; min-width: 0; }
.cal-day.weekend { background: var(--sunk); }
.cal-mon-auto { display: none; }
.cal-date { display: flex; align-items: baseline; gap: .35rem; padding: .55rem .65rem .35rem; }
.cal-dow { font-size: .8rem; font-weight: 600; color: var(--muted); }
.cal-num { font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1; order: -2; }
.cal-mon { font-size: .8rem; font-weight: 600; color: var(--muted); order: -1; }
.cal-count { margin-left: auto; align-self: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--paper);
  color: var(--ink); font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cal-day.today { background: #fffbea; box-shadow: inset 0 0 0 2px var(--night); position: relative; z-index: 1; }
.cal-day.today .cal-date { background: var(--night); color: #fff; padding-bottom: .5rem; margin-bottom: .2rem; }
.cal-day.today .cal-dow, .cal-day.today .cal-mon { color: var(--plate); }
.cal-day.today .cal-count { background: var(--plate); color: var(--plate-ink); }
.cal-jobs { padding: .15rem .5rem .55rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.cal-free { color: var(--faint); font-size: .82rem; padding: .1rem .2rem; }

/* A job: plate, what and when, who */
.job { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .3rem .4rem; width: 100%;
  padding: .45rem .5rem .42rem .55rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--due);
  box-shadow: 0 1px 2px rgba(15, 26, 39, .06); }
.job.booked { border-left-color: var(--pass); }
.job.over { border-left-color: var(--fail); }
.job:hover { border-color: var(--line-strong); box-shadow: 0 6px 16px -8px rgba(15, 26, 39, .35); }
.job:focus-visible { outline: 3px solid var(--plate); outline-offset: 1px; }
.job .plate { justify-self: start; }
.job-time, .job-state { justify-self: end; font-size: .76rem; font-weight: 700; border-radius: 4px; padding: .05rem .32rem; white-space: nowrap; }
.job-time { color: var(--pass); background: var(--pass-bg); }
.job-state { color: var(--due); background: var(--due-bg); }
.job.over .job-state { color: var(--fail); background: var(--fail-bg); }
.job-what { grid-column: 1 / -1; font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.job-who { font-weight: 500; color: var(--muted); }

/* Phones and narrow tablets: an agenda, one day per row, quiet days hidden */
@media (max-width: 900px) {
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; flex-direction: row; align-items: stretch; }
  .cal-day.free:not(.today) { display: none; }
  .cal-date { flex-direction: column; align-items: flex-start; gap: .1rem; width: 5.2rem; flex: none; padding: .7rem .75rem; border-right: 1px solid var(--line); }
  .cal-day.today .cal-date { margin-bottom: 0; border-right-color: var(--night); }
  .cal-num { order: -2; font-size: 1.7rem; }
  .cal-date .cal-count { display: none; }
  .cal-mon-auto { display: inline; }
  .cal-jobs { padding: .55rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); align-content: start; }
  .cal-free { align-self: center; }
  .cal-overdue { flex-direction: column; }
  .cal-overdue-head { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; padding: .7rem .9rem; border-right: none; border-bottom: 1px solid var(--line); }
  .cal-overdue-jobs .job { width: calc(50% - .25rem); }
}

/* ---------- Lists: one grouped ledger rather than separate cards ---------- */
.list { display: flex; flex-direction: column; }
.list:not(#preview) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--lift); }
.list:not(#preview):empty { display: none; }
.row { background: var(--surface); padding: .9rem 1.15rem; display: flex; align-items: center; gap: .6rem 1.1rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.list > .row:first-child, .list > h2 + .row { border-top: none; }
#preview { gap: .5rem; }
#preview .row { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--sunk); }
.row .main { flex: 1; min-width: 190px; }
.row .title { font-weight: 700; }
.row .sub { color: var(--muted); font-size: .92rem; margin-top: .1rem; }
.row.handled { opacity: .55; }
.empty { color: var(--muted); padding: 1.6rem; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.list:not(#preview) > .empty { border: none; border-radius: 0; }

.list-group { display: flex; align-items: center; gap: .5rem; padding: .55rem 1.15rem; background: var(--sunk); border-top: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); }
.list > .list-group:first-child { border-top: none; }
.list-group::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--faint); }
.list-group.over::before { background: var(--fail); }
.list-group.week::before { background: var(--due); }
.list-group.later::before { background: var(--pass); }
.list-group-count { font-family: var(--body); font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 .45rem; }
.list-group + .row { border-top-color: var(--line); }

/* UK number plate: yellow face, black border set just inside the edge */
.plate { background: var(--plate); color: var(--plate-ink); font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: .09em;
  padding: .1rem .55rem; border-radius: 4px; border: 1.5px solid var(--plate-ink); box-shadow: 0 0 0 2px var(--plate), 0 1px 3px 2px rgba(15, 26, 39, .12);
  white-space: nowrap; line-height: 1.25; margin: 2px; }
.plate-sm { font-size: .92rem; letter-spacing: .06em; padding: .02rem .38rem; box-shadow: 0 0 0 1.5px var(--plate); margin: 1.5px; }

.badges { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.badge { font-size: .82rem; font-weight: 600; padding: .22rem .6rem; border-radius: 999px; background: transparent; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.overdue, .badge.failed { background: var(--fail-bg); color: var(--fail); border-color: transparent; }
.badge.soon { background: var(--due-bg); color: var(--due); border-color: transparent; }
.badge.ok { background: var(--pass-bg); color: var(--pass); border-color: transparent; }

.search { width: 100%; padding: .75rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; margin-bottom: 1rem; background: var(--surface); }
.search:focus { border-color: var(--ink); }

/* ---------- Cards / settings ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.35rem; margin-top: 1rem; }
.card p { max-width: 75ch; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.inline-form input, .inline-form select { padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--ink); }
.stack-form { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; max-width: 34rem; }
.stack-form label { font-weight: 500; }
.stack-form textarea { padding: .55rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; }
.copy-code { display: inline-block; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .35rem .55rem; cursor: pointer; word-break: break-all; user-select: all; }
.alert { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--due); border-radius: var(--radius-sm); padding: .8rem 1rem;
  margin-top: 1rem; display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; box-shadow: var(--lift); }
.alert strong { color: var(--due); }
.alert a { color: var(--ink); font-weight: 700; }
#tab-dashboard .alert + .alert { margin-top: .6rem; }
.nav-count { background: var(--plate); color: var(--plate-ink); border-radius: 999px; font-size: .72rem; font-weight: 800; padding: .05rem .42rem; margin-left: .2rem; }

/* ---------- Editor dialog ---------- */
dialog { border: none; border-radius: 16px; padding: 0; width: min(780px, 96vw); max-height: 92vh; background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(8, 14, 22, .55); }
dialog::backdrop { background: rgba(10, 17, 26, .6); backdrop-filter: blur(2px); }
dialog form { padding: 1.4rem 1.5rem; }
.dialog-head, .dialog-foot { display: flex; align-items: center; gap: .5rem; }
.dialog-head { justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 1.75rem; }
.dialog-foot { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
fieldset { border: none; background: var(--sunk); border-radius: var(--radius); margin: 1rem 0 0; padding: .9rem 1.05rem 1.05rem; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 .7rem; font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
legend + * { clear: both; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem .9rem; }
label { display: flex; flex-direction: column; gap: .28rem; font-size: .88rem; font-weight: 600; color: #34404b; }
label input, label select, label textarea { padding: .58rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); }
label input:focus, label select:focus, label textarea:focus, .inline-form input:focus, .inline-form select:focus { border-color: var(--ink); }
label.check { flex-direction: row; align-items: center; gap: .5rem; grid-column: 1 / -1; font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--pass); }
.plate-input { text-transform: uppercase; background: var(--plate) !important; border: 1.5px solid var(--plate-ink) !important; font-family: var(--display); font-weight: 700; font-size: 1.2rem !important; letter-spacing: .09em; }
.error { color: var(--fail); font-weight: 600; }
.lookup-cell { display: flex; align-items: flex-end; }
.lookup-msg { grid-column: 1 / -1; margin: 0; font-size: .88rem; }
.lookup-msg:empty { display: none; }
.status-row { border-top: 1px solid var(--line); padding: .85rem 0; display: flex; flex-direction: column; gap: .55rem; }
.status-row:first-of-type { border-top: none; padding-top: .1rem; }
.status-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.status-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; min-width: 4.5rem; }
.status-actions { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.status-actions .divider { width: 1px; align-self: stretch; background: var(--line-strong); margin: 0 .25rem; }
label.mini { font-size: .78rem; gap: .15rem; }
label.mini input, label.mini select { padding: .36rem .48rem; font-size: .88rem; }
.contingency-row { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; background: var(--due-bg); border-radius: var(--radius-sm); padding: .55rem .65rem; }
.contingency-row .note { font-size: .8rem; color: var(--due); flex-basis: 100%; margin: 0; }
.contingency-row .mini input { text-transform: uppercase; }
.small-note { font-size: .82rem; margin: .5rem 0 0; }
#work-history h4 { margin: .9rem 0 .3rem; }
.hist { font-size: .88rem; color: var(--muted); padding: .18rem 0; }

#toast { position: fixed; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--night); color: #fff;
  padding: .8rem 1.15rem; border-radius: 10px; border-left: 4px solid var(--plate); max-width: 92vw; z-index: 20; box-shadow: 0 16px 40px -12px rgba(8, 14, 22, .5); }

/* ---------- Sign-in ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--night); padding: 20px;
  background-image: radial-gradient(120% 70% at 50% 0%, #1d2d41 0%, var(--night) 60%); }
.login-card { background: var(--surface); padding: 2.2rem 2rem 2rem; border-radius: 16px; width: min(390px, 100%); display: flex; flex-direction: column; gap: 1rem;
  border-top: 5px solid var(--plate); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .6); }
.login-card .brand { color: var(--ink); font-size: 1.5rem; }
.login-card p { margin: 0; }
.login-card .btn.primary { justify-content: center; padding: .7rem 1rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Garage owner login: hide set-up details */
.role-owner .admin-only { display: none !important; }
.check-mini { flex-direction: row !important; align-items: center; gap: .35rem; }
.owner-only { display: none; }
.role-owner .owner-only { display: block; }
.hero-band + .alert { margin-top: 0; }
/* Plates in lists share one width so names line up like a ledger */
@media (min-width: 641px) { .row > .plate { min-width: 7.4em; text-align: center; } }
@media (max-width: 640px) { .row .main { min-width: 150px; } }
.nowrap { white-space: nowrap; }
