/* Cool Bros AC — "Painted Shop Board".
   Trinidad hand-painted shop signage brought to a working app: a deep sign-board blue shell, flat enamel panels in
   the four job colours, condensed sign capitals for titles and numbers, a plain sturdy sans for reading.
   Flat paint only: no gradients, glass or glow. One neutral ramp for every grey. */

@import url("/static/fonts.css");

:root {
  /* Neutral ramp (cool, from the sign-board blue) */
  --n0: #ffffff; --n50: #f4f6f9; --n100: #e8ecf1; --n200: #d4dae2; --n300: #b6bfca; --n400: #8a96a4;
  --n500: #5f6b7a; --n600: #465060; --n700: #313a47; --n800: #1e2630; --n900: #121820; --n950: #0a0e14;

  /* Paint */
  --board: #0b3d6e;          /* sign-board blue: shell, primary actions */
  --board-deep: #082c50;
  --board-ink: #ffffff;
  --yellow: #f5b800;         /* sign yellow: clock in, highlights, selection */
  --yellow-ink: #1a1400;
  --red: #c8231b;            /* pepper red: install, clock out, owed */
  --red-ink: #ffffff;
  --blue: #1d64c8;           /* enamel blue: service */
  --green: #11804f;          /* bush green: site visit, paid */
  --green-ink: #ffffff;

  /* Job colours */
  --t-service: var(--blue);
  --t-install: var(--red);
  --t-repair: var(--yellow);
  --t-site_visit: var(--green);

  /* Surfaces */
  --ground: var(--n50);
  --panel: var(--n0);
  --ink: var(--n900);
  --ink-2: var(--n600);
  --line: var(--n200);
  --line-strong: var(--n300);

  /* State tags */
  --ok-bg: #dcf2e6; --ok: #0b6a40;
  --wait-bg: #fff1c7; --wait: #7a5600;
  --bad-bg: #fde3e1; --bad: #a31c15;
  --info-bg: #dde9fb; --info: #154f9e;
  --mute-bg: var(--n100); --mute: var(--n600);

  --r: 6px; --r-sm: 4px; --tap: 48px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 14px -10px rgba(0, 0, 0, .25);
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --board: #0d4a85; --board-deep: #08345f;
    --blue: #3b82e6; --red: #e0463c; --yellow: #f7c533; --green: #1f9e66;
    --ground: var(--n950); --panel: #111821; --ink: #e9eef4; --ink-2: #a3afbd; --line: #243040; --line-strong: #33415a;
    --ok-bg: rgba(31, 158, 102, .18); --ok: #6fe0ac;
    --wait-bg: rgba(247, 197, 51, .16); --wait: #ffd666;
    --bad-bg: rgba(224, 70, 60, .18); --bad: #ff9c94;
    --info-bg: rgba(59, 130, 230, .18); --info: #9cc3ff;
    --mute-bg: rgba(138, 150, 164, .14); --mute: #b7c1cd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 26px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 500 16px/1.45 var(--text); font-feature-settings: "tnum" 0;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 960px) { body { padding-bottom: 0; } }
::selection { background: var(--yellow); color: var(--yellow-ink); }
input, textarea { caret-color: var(--board); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--ground); }
a { color: var(--board); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
@media (prefers-color-scheme: dark) { a { color: #9cc3ff; } }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: .01em; line-height: 1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 6vw, 3rem); font-weight: 900; }
h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: .75rem; }
h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.red { color: var(--bad); }
.green { color: var(--ok); }
.inline { display: inline; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1rem; padding-top: calc(.55rem + env(safe-area-inset-top));
  background: var(--board-deep); color: var(--board-ink);
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 7px; box-shadow: 0 0 0 2px var(--yellow); }
.brand-name { font-family: var(--display); font-weight: 900; font-size: 1.35rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.brand-name small { display: block; font-family: var(--text); font-weight: 600; font-size: .62rem; letter-spacing: .14em; color: var(--yellow); margin-top: 2px; }
.spacer { flex: 1; }
.switcher { display: flex; background: rgba(255, 255, 255, .1); border-radius: var(--r); padding: 3px; }
.switcher a { padding: .45rem .8rem; border-radius: var(--r-sm); text-decoration: none; color: rgba(255, 255, 255, .78); font-weight: 600; font-size: .875rem; }
.switcher a.on { background: var(--yellow); color: var(--yellow-ink); }
.topbar .icon-btn { color: #fff; background: transparent; border: 0; min-height: 40px; min-width: 40px; padding: 0 .5rem; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.topbar .install { background: var(--yellow); color: var(--yellow-ink); border-color: var(--yellow); }
@media (max-width: 600px) {
  .brand-name { display: none; }
  .topbar { gap: .5rem; padding-left: .75rem; padding-right: .5rem; }
  .switcher a { padding: .45rem .6rem; }
}

.layout { display: block; }
@media (min-width: 960px) { .layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 56px); } }
.sidenav { display: none; }
@media (min-width: 960px) {
  .sidenav { display: block; position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; padding: 1.25rem .85rem 2rem; background: var(--board); color: #fff; }
  .sidenav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: var(--r); color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 600; }
  .sidenav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .sidenav a.on { background: var(--yellow); color: var(--yellow-ink); }
  .sidenav .group { margin: 1.25rem .75rem .35rem; font-family: var(--display); font-weight: 800; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
}
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem 2rem; }
@media (min-width: 960px) { main { padding: 0 2rem 3rem; } }
main.narrow { max-width: 480px; padding-top: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 62px; font-size: .72rem; font-weight: 700; color: var(--ink-2); text-decoration: none; letter-spacing: .01em; }
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a.on { color: var(--board); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 4px; background: var(--yellow); border-radius: 0 0 4px 4px; }
@media (prefers-color-scheme: dark) { .tabbar a.on { color: #fff; } }
@media (min-width: 960px) { .tabbar { display: none; } }

/* ---------- Page board (the painted header every page opens with) ---------- */
.board {
  margin: 0 -1rem 1.25rem; padding: 1.4rem 1rem 1.5rem; background: var(--board); color: #fff;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem;
  animation: paint .7s var(--ease-out) both;
}
.board h1 { color: #fff; }
.board .sub { margin: .45rem 0 0; color: rgba(255, 255, 255, .82); font-weight: 600; }
.board .sub strong { color: var(--yellow); font-weight: 700; }
.board .meta { margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.board .actions .btn.secondary, .board .actions button.secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.board .actions .btn.secondary:hover, .board .actions button.secondary:hover { background: rgba(255, 255, 255, .1); }
@media (min-width: 960px) {
  .board { margin: 0 -2rem 1.75rem; padding: 2rem 2rem 1.75rem; }
}
@keyframes paint { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .board, .job-panel, .clock-board { animation: none !important; } }

/* ---------- Panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 .75rem; }
.section-title h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.apart { margin-left: auto; }

/* ---------- Buttons ---------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: 0 1.05rem;
  border-radius: var(--r); border: 2px solid var(--board); background: var(--board); color: #fff;
  font: 700 .95rem/1 var(--text); letter-spacing: .01em; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease-out), background-color .15s, border-color .15s;
}
.btn:active, button:active { transform: translateY(1px) scale(.99); }
.btn:hover, button:hover { background: var(--board-deep); border-color: var(--board-deep); }
.btn.secondary, button.secondary { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover, button.secondary:hover { border-color: var(--ink-2); background: var(--panel); }
.btn.ghost, button.ghost { background: transparent; color: var(--board); border-color: transparent; }
@media (prefers-color-scheme: dark) { .btn.ghost, button.ghost { color: #9cc3ff; } }
.btn.ghost:hover, button.ghost:hover { background: var(--mute-bg); border-color: transparent; }
.btn.danger, button.danger { background: transparent; color: var(--bad); border-color: var(--bad-bg); }
.btn.danger:hover, button.danger:hover { background: var(--bad-bg); border-color: var(--bad-bg); }
.btn.small, button.small { min-height: 38px; padding: 0 .8rem; font-size: .85rem; }
.btn.big, button.big { min-height: 64px; width: 100%; font-family: var(--display); font-weight: 900; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .03em; }
.btn.go, button.go { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.btn.go:hover, button.go:hover { background: #e2a900; border-color: #e2a900; }
.btn.stop, button.stop { background: var(--red); border-color: var(--red); color: #fff; }
.btn.stop:hover, button.stop:hover { background: #a91d16; border-color: #a91d16; }
button:disabled { opacity: .5; cursor: not-allowed; }
/* Destructive actions stand apart from the main action (kept from Dark Console). */
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong); display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Forms ---------- */
form.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
label, .label { font-size: .85rem; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .65rem .8rem; border: 2px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--ink); font: 500 1rem var(--text);
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--board); box-shadow: 0 0 0 3px rgba(245, 184, 0, .45); }
input::placeholder, textarea::placeholder { color: var(--n400); }
textarea { min-height: 104px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--board); }
input[type=file] { padding: .5rem; border-style: dashed; background: var(--ground); }
input[type=file]::file-selector-button { font: 700 .9rem var(--text); border: 0; border-radius: var(--r-sm); background: var(--board); color: #fff; padding: .55rem .9rem; margin-right: .75rem; cursor: pointer; }
.check { display: flex; align-items: center; gap: .65rem; min-height: var(--tap); font-weight: 600; }
.row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: repeat(3, 1fr); } }
.hint { font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choices label { flex: 1 1 0; min-width: 92px; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices span {
  display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 .8rem; text-align: center;
  border: 2px solid var(--line); border-radius: var(--r); background: var(--panel); font-weight: 700; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.choices span:hover { border-color: var(--line-strong); }
.choices input:checked + span { background: var(--board); border-color: var(--board); color: #fff; }
.choices input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.disclose { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--board); padding: .35rem 0; }
@media (prefers-color-scheme: dark) { .disclose { color: #9cc3ff; } }
.disclose .icon { transition: transform .2s var(--ease-out); }
details[open] > summary .disclose .icon, details[open] > summary.disclose .icon { transform: rotate(90deg); }

/* ---------- Tags (square, sentence case) ---------- */
.tag { display: inline-flex; align-items: center; gap: .3rem; min-height: 24px; padding: 2px 8px; border-radius: var(--r-sm); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.tag.green { background: var(--ok-bg); color: var(--ok); }
.tag.amber { background: var(--wait-bg); color: var(--wait); }
.tag.red { background: var(--bad-bg); color: var(--bad); }
.tag.blue { background: var(--info-bg); color: var(--info); }
.tag.slate { background: var(--mute-bg); color: var(--mute); }
.tag.on-paint { background: rgba(255, 255, 255, .94); color: var(--n900); }

/* ---------- Notices ---------- */
.notice { display: flex; align-items: center; gap: .6rem; border-radius: var(--r); padding: .8rem 1rem; margin: 0 0 1rem; font-weight: 700; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.err { background: var(--bad-bg); color: var(--bad); }
.notice.float { position: fixed; left: 50%; transform: translateX(-50%); top: calc(66px + env(safe-area-inset-top)); z-index: 40; width: min(560px, calc(100vw - 24px)); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .35); }
.flash-area { padding-top: 1rem; }
.flash-area:empty { display: none; }

/* ---------- The signature: job panels and planks ---------- */
.job-panel {
  --paint: var(--t-service); --on: #fff;
  position: relative; display: block; border-radius: var(--r); padding: 1.15rem 1.15rem 1rem; color: var(--on); background: var(--paint);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12), var(--shadow); text-decoration: none; animation: lift .6s .1s var(--ease-out) both;
}
.job-panel.t-service { --paint: var(--t-service); }
.job-panel.t-install { --paint: var(--t-install); }
.job-panel.t-repair { --paint: var(--t-repair); --on: var(--yellow-ink); }
.job-panel.t-site_visit { --paint: var(--t-site_visit); }
.job-panel .kind { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; opacity: .92; }
.job-panel .who { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 9vw, 2.7rem); line-height: .95; text-transform: uppercase; margin: .35rem 0 .45rem; text-wrap: balance; }
.job-panel .where { font-weight: 600; opacity: .95; }
.job-panel .units { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 .2rem; }
.job-panel .units span { background: rgba(0, 0, 0, .18); padding: 3px 8px; border-radius: var(--r-sm); font-weight: 700; font-size: .82rem; }
.job-panel.t-repair .units span { background: rgba(0, 0, 0, .1); }
.job-panel .panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.job-panel .panel-actions .btn { background: rgba(255, 255, 255, .95); color: var(--n900); border-color: transparent; }
.job-panel .panel-actions .btn:hover { background: #fff; }
.job-panel .panel-actions .btn.ghosted { background: rgba(0, 0, 0, .16); color: var(--on); }
@keyframes lift { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.planks { display: grid; gap: .55rem; }
.plank {
  display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: stretch; min-height: 72px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s var(--ease-out);
}
.plank:hover { border-color: var(--line-strong); }
.plank:active { transform: scale(.995); }
.plank .swatch {
  --paint: var(--t-service); --on: #fff;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: .5rem .55rem; background: var(--paint); color: var(--on);
  font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 1;
}
.plank .swatch b { font-size: 1.05rem; letter-spacing: .03em; }
.plank .swatch small { font-family: var(--text); font-weight: 700; font-size: .68rem; letter-spacing: .04em; opacity: .9; }
.plank.t-install .swatch { --paint: var(--t-install); }
.plank.t-repair .swatch { --paint: var(--t-repair); --on: var(--yellow-ink); }
.plank.t-site_visit .swatch { --paint: var(--t-site_visit); }
.plank .body { padding: .65rem .85rem; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.plank .title { font-weight: 700; font-size: 1.02rem; }
.plank .sub { font-size: .85rem; color: var(--ink-2); }
.plank .end { padding: .65rem .85rem .65rem 0; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .3rem; }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* ---------- Clock ---------- */
.clock-board { border-radius: var(--r); padding: 1.1rem; margin: 1rem 0; text-align: center; animation: lift .6s .18s var(--ease-out) both; }
.clock-board.on { background: var(--red); color: #fff; }
.clock-board.off { background: var(--panel); border: 1px solid var(--line); }
.clock-board .label { font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; color: inherit; opacity: .9; }
.clock-board .time { font-family: var(--display); font-weight: 900; font-size: clamp(3.4rem, 17vw, 4.6rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; margin: .2rem 0 .3rem; }
.clock-board .where { font-weight: 600; margin-bottom: .9rem; }
.clock-board.on .where a { color: #fff; }
.clock-board.on .btn.stop, .clock-board.on button.stop { background: #fff; color: var(--red); border-color: #fff; }

/* ---------- Lists ---------- */
.list { display: grid; gap: .5rem; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: center; padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
a.item:hover { border-color: var(--line-strong); }
.item .title { font-weight: 700; }
.item .sub { font-size: .85rem; color: var(--ink-2); }
.item .end { text-align: right; }
.item.total { background: transparent; border-style: dashed; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .65rem 1rem; margin-top: 1.1rem; font-family: var(--display); font-weight: 800; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .03em; }
.day-head:first-child { margin-top: 0; }
.day-head .num { font-family: var(--text); font-weight: 700; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.day-block { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.day-block .entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.day-block .entry:first-child { border-top: 0; }

/* ---------- Stats and the painted KPI tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; text-decoration: none; color: var(--ink); display: block; }
.stat .k { font-size: .8rem; color: var(--ink-2); font-weight: 700; }
.stat .v { font-family: var(--display); font-size: 2.1rem; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat.red .v { color: var(--bad); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.25rem; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi {
  --paint: var(--board); --on: #fff;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: .8rem .95rem; border-radius: var(--r);
  background: var(--paint); color: var(--on); text-decoration: none; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1);
}
.kpi .k { font-weight: 700; font-size: .85rem; opacity: .95; }
.kpi .v { font-family: var(--display); font-weight: 900; font-size: clamp(2.6rem, 8vw, 3.4rem); line-height: .9; font-variant-numeric: tabular-nums; }
.kpi.t-service { --paint: var(--t-service); }
.kpi.t-install { --paint: var(--t-install); }
.kpi.t-repair { --paint: var(--t-repair); --on: var(--yellow-ink); }
.kpi.t-site_visit { --paint: var(--t-site_visit); }
.kpi.t-all { --paint: var(--n800); }
@media (prefers-color-scheme: dark) { .kpi.t-all { --paint: var(--n700); } }

/* The money board: income − costs = profit, lettered like a price board */
.money-board { display: grid; grid-template-columns: 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
@media (min-width: 720px) { .money-board { grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; } }
.money-board .cell { padding: 1rem 1.15rem; }
.money-board .k { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.money-board .v { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 5vw, 2.7rem); line-height: 1; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.money-board .op { display: none; align-items: center; justify-content: center; font-family: var(--display); font-weight: 900; font-size: 2.2rem; color: var(--n300); }
@media (min-width: 720px) { .money-board .op { display: flex; } }
.money-board .cell.result { background: var(--board); color: #fff; }
.money-board .cell.result .k { color: rgba(255, 255, 255, .8); }
.money-board .cell.result.loss { background: var(--red); }
@media (max-width: 719px) { .money-board .cell + .cell { border-top: 1px solid var(--line); } }

/* ---------- Tables (stack into labelled rows on phones) ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th { text-align: left; font-family: var(--display); font-weight: 800; font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: .65rem .85rem; background: var(--ground); border-bottom: 1px solid var(--line); }
td { padding: .7rem .85rem; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--ground) 55%, transparent); }
tfoot td { font-weight: 800; border-top: 2px solid var(--line-strong); }
td.num, th.num { font-variant-numeric: tabular-nums; }
@media (max-width: 699px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack tfoot { display: block; width: 100%; }
  table.stack tr { padding: .7rem .95rem; border-top: 1px solid var(--line); }
  table.stack tbody tr:first-child { border-top: 0; }
  table.stack td { border: 0; padding: .12rem 0; text-align: left !important; white-space: normal; }
  table.stack td[data-label] { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .75rem; }
  table.stack td[data-label]::before { content: attr(data-label); font-size: .78rem; font-weight: 700; color: var(--ink-2); padding-top: 2px; }
  table.stack tfoot tr { border-top: 2px solid var(--line-strong); }
}

/* ---------- Segmented filters ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: .2rem; padding: .25rem; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.seg a { padding: .5rem .85rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--board); color: #fff; }
.board .seg { background: rgba(255, 255, 255, .1); border-color: transparent; }
.board .seg a { color: rgba(255, 255, 255, .8); }
.board .seg a.on { background: var(--yellow); color: var(--yellow-ink); }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.filters form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters input, .filters select { width: auto; min-height: 42px; }
.board .filters { margin: 0; }
.board input[type=date] { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; color-scheme: dark; }

/* ---------- Photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.photos a { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--mute-bg); }
.photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease-out); }
.photos a:hover img { transform: scale(1.04); }
.photos .tag { position: absolute; left: 6px; bottom: 6px; }
.shutter { display: grid; place-items: center; gap: .35rem; min-height: 120px; padding: 1rem; border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--ground); text-align: center; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.shutter .icon { width: 34px; height: 34px; color: var(--board); }
.shutter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shutter:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- Chart: painted planks on one baseline ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--board); }
.chart .bar.neg { fill: var(--red); }
.chart .bar.now { fill: var(--yellow); }
.chart text { fill: var(--ink-2); font: 700 12px var(--text); }
.chart text.val { font: 900 14px var(--display); fill: var(--ink); }
.chart .axis { stroke: var(--line-strong); stroke-width: 2; }
@media (prefers-color-scheme: dark) { .chart .bar { fill: #3b82e6; } }

/* ---------- Sync badge, install, iOS hint ---------- */
.sync { position: fixed; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: .45rem; padding: .55rem .85rem; border-radius: var(--r); background: var(--yellow); color: var(--yellow-ink); font-weight: 800; font-size: .85rem; box-shadow: var(--shadow); }
@media (min-width: 960px) { .sync { bottom: 16px; } }
.install { display: none !important; }
.install.show { display: inline-flex !important; }
.card.install.show { display: flex !important; align-items: center; gap: 1rem; }
.ios-hint { display: none; }
.ios-hint.show { display: block; }

/* ---------- Sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--ground); padding-bottom: 0; }
.signin-board { background: var(--board); color: #fff; padding: calc(2.5rem + env(safe-area-inset-top)) 1.25rem 2.25rem; }
.signin-board .inner { max-width: 440px; margin: 0 auto; }
.signin-board img { width: 64px; height: 64px; border-radius: 12px; box-shadow: 0 0 0 3px var(--yellow); }
.signin-board h1 { color: #fff; font-size: clamp(3rem, 14vw, 4.2rem); line-height: .88; margin-top: 1.1rem; }
.signin-board p { margin: .6rem 0 0; color: rgba(255, 255, 255, .82); font-weight: 600; }
.signin-board p strong { color: var(--yellow); }
.signin main { padding-top: 1.25rem; }
/* The four job colours side by side: the legend every screen shares. */
.stripe { display: flex; height: 10px; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: var(--t-service); }
.stripe i:nth-child(2) { background: var(--t-install); }
.stripe i:nth-child(3) { background: var(--t-repair); }
.stripe i:nth-child(4) { background: var(--t-site_visit); }

/* ---------- Documents (invoices, payslips): print to PDF ---------- */
.doc { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-family: var(--text); }
.doc .doc-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; padding: 22px 28px; background: #0b3d6e; color: #fff; }
.doc .doc-head h1 { color: #fff; font-size: 2.2rem; }
.doc .doc-head .addr { white-space: pre-line; font-size: .88rem; opacity: .88; margin-top: 6px; }
.doc .doc-head .kind { font-family: var(--display); font-weight: 900; font-size: 1.9rem; text-transform: uppercase; color: #f5b800; text-align: right; line-height: 1; }
.doc .doc-head .kind small { display: block; font-family: var(--text); font-size: .95rem; font-weight: 700; color: #fff; margin-top: 4px; }
.doc .doc-body { padding: 22px 28px 28px; }
.doc .stripe { height: 6px; }
.doc table td, .doc table th { color: #111; }
.doc th { background: #f1f3f6; color: #444; }
.doc .meta { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 5px 18px; font-size: .92rem; margin-bottom: 18px; }
.doc .meta span:nth-child(odd) { color: #666; font-weight: 600; }
.doc .total { display: flex; justify-content: space-between; align-items: baseline; background: #0b3d6e; color: #fff; padding: 12px 16px; font-weight: 700; margin-top: 14px; border-radius: 4px; }
.doc .total span:last-child { font-family: var(--display); font-weight: 900; font-size: 1.7rem; }
.doc .sub-total { display: flex; justify-content: space-between; padding: 6px 16px; }
.doc .sign { margin-top: 48px; display: flex; justify-content: space-between; align-items: flex-end; font-size: .8rem; color: #555; }
.doc .sign .line { border-top: 1.5px solid #888; width: 220px; padding-top: 5px; text-align: center; }
.doc-tools { max-width: 820px; margin: 0 auto 14px; }
@media print {
  body { background: #fff; padding: 0; }
  .topbar, .sidenav, .tabbar, .no-print, .sync, .notice, .board .actions { display: none !important; }
  .layout { display: block; }
  main { padding: 0; max-width: none; }
  .doc { border: 0; border-radius: 0; max-width: none; }
  .board { margin: 0 0 1rem; animation: none; }
  .doc .doc-head, .doc .total, .board, .stripe { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* The job page's header board is the job panel itself, painted full width in the job colour. */
.job-panel.as-board { margin: 0 -1rem 1.25rem; border-radius: 0; box-shadow: none; padding: 1.4rem 1rem 1.3rem; animation: paint .7s var(--ease-out) both; }
@media (min-width: 960px) { .job-panel.as-board { margin: 0 -2rem 1.75rem; padding: 2rem 2rem 1.6rem; } }
.job-panel .desc { margin: .8rem 0 0; font-weight: 500; max-width: 60ch; white-space: pre-line; opacity: .95; }
.status-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.status-row.owner { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 520px) { .status-row.owner { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.status-row label { min-width: 0; }
.status-row span { font-size: .85rem; padding: 0 .4rem; }
.job-grid { display: grid; gap: 1rem; }
@media (min-width: 1040px) { .job-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.card > .card-head h2 { margin: 0; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--r-sm); background: var(--mute-bg); color: var(--mute); font: 800 .85rem var(--text); }
.unit-chip { display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Round-one fixes ---------- */
.tag { text-transform: none; letter-spacing: 0; font-family: var(--text); }
/* The blue rail runs the full height on desktop. */
@media (min-width: 960px) {
  body::before { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: 236px; background: var(--board); z-index: -1; }
  main { max-width: none; }
}
/* Phone: the period tabs scroll sideways instead of wrapping; custom dates fold away. */
@media (max-width: 719px) {
  .board .seg { flex-wrap: nowrap; overflow-x: auto; max-width: calc(100vw - 2rem); scrollbar-width: none; }
  .board .seg a { white-space: nowrap; }
  .kpis > :first-child { grid-column: span 2; min-height: 92px; }
}
.custom-range form { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.disclose.on-board { color: rgba(255, 255, 255, .85); }
/* Profit by month: painted bars on one baseline, real text at every size. */
.bars { --h: 210px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .45rem; align-items: end; padding: .25rem 0 .5rem; }
.bars .col { display: grid; grid-template-rows: var(--h) auto; justify-items: center; min-width: 0; }
.bars.split .col { grid-template-rows: calc(var(--h) / 2) calc(var(--h) / 2) auto; }
.bars .up, .bars .down { width: 100%; display: flex; flex-direction: column; align-items: center; }
.bars .up { justify-content: flex-end; border-bottom: 2px solid var(--line-strong); }
.bars .down { justify-content: flex-start; }
.bars i { display: block; width: min(100%, 46px); min-height: 0; background: var(--board); border-radius: 3px 3px 0 0; transform-origin: bottom; animation: rise .8s var(--ease-out) both; }
.bars .down i { background: var(--red); border-radius: 0 0 3px 3px; transform-origin: top; }
.bars .col:nth-child(2) i { animation-delay: .04s; } .bars .col:nth-child(3) i { animation-delay: .08s; } .bars .col:nth-child(4) i { animation-delay: .12s; }
.bars .col:nth-child(5) i { animation-delay: .16s; } .bars .col:nth-child(6) i { animation-delay: .2s; } .bars .col:nth-child(n+7) i { animation-delay: .24s; }
.bars .val { font: 900 clamp(.8rem, 2.6vw, 1rem)/1 var(--display); margin-bottom: 4px; white-space: nowrap; }
.bars .down .val { margin: 4px 0 0; color: var(--bad); }
.bars .m { font-weight: 700; font-size: .78rem; color: var(--ink-2); margin-top: 6px; }
@media (prefers-color-scheme: dark) { .bars i { background: #3b82e6; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .bars i { animation: none; } }

/* ---------- Detector fixes ---------- */
:root { --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 14px -10px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: dark) { :root { --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px -12px rgba(0, 0, 0, .7); } }
.card, .money-board { box-shadow: none; }
.brand-name small { font-size: .7rem; }
/* Documents are paper: always light, whatever the phone's theme. */
.doc {
  color-scheme: light; color: #111;
  --ink: #111111; --ink-2: #555b66; --line: #dde2e8; --line-strong: #c5ccd5; --panel: #ffffff; --ground: #f1f3f6;
  --ok-bg: #dcf2e6; --ok: #0b6a40; --bad-bg: #fde3e1; --bad: #a31c15; --mute-bg: #e8ecf1; --mute: #465060;
}
.doc tbody tr:hover td { background: #f6f7f9; }

/* ---------- Finish-review fixes ---------- */
/* Job facts sit under the lettered name; the type is a small painted plate. */
.job-panel .facts { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; font-weight: 700; margin-bottom: .55rem; }
.job-panel .plate { background: rgba(0, 0, 0, .22); padding: 3px 9px; border-radius: var(--r-sm); font-family: var(--display); font-weight: 800; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; }
.job-panel.t-repair .plate { background: var(--yellow-ink); color: var(--yellow); }
.job-panel .who { margin-top: 0; }
.clock-board h2 { margin-bottom: .4rem; }
/* Dark mode keeps full-strength paint so white lettering stays readable; lighter tints are for links only. */
@media (prefers-color-scheme: dark) { :root { --blue: #1d64c8; --red: #c8231b; --green: #11804f; --yellow: #f5b800; } }
/* Rows inside a card are ruled lines, not cards within cards. */
.card .list { gap: 0; }
.card .item { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: .8rem 0; }
.card .list > .item:first-child, .card > .item:first-of-type { border-top: 0; }
.card .item.total { border-top: 2px solid var(--line-strong); }
/* The live timer: one fixed cell per digit. */
.clock-board .time .d { display: inline-block; width: .56em; text-align: center; }
.clock-board .time .c { display: inline-block; width: .26em; text-align: center; }
/* Blue rail only on app pages; documents print clean. */
body::before { content: none; }
@media (min-width: 960px) { body.app::before { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: 236px; background: var(--board); z-index: -1; } }
.doc .total { align-items: center; }
/* Future months show the month and nothing else. */
.bars .col.future .m { opacity: .5; }
.bars .col.future .up { border-bottom-style: dashed; }
/* Period tabs wrap on phones rather than clipping. */
@media (max-width: 719px) { .board .seg { flex-wrap: wrap; overflow: visible; max-width: 100%; } .board .seg a { padding: .45rem .7rem; } }
/* Waiting tiles in shell blue and ink: job colours only ever mean job types. */
.kpis .kpi:not([class*="t-"]) { --paint: var(--board); }
/* Ceiling: planks carry a wash of their job colour; the shell carries the four-colour stripe; board lettering gets a signwriter's shade line. */
.plank { --paint: var(--t-service); background: color-mix(in srgb, var(--paint) 7%, var(--panel)); border-color: color-mix(in srgb, var(--paint) 28%, var(--line)); }
.plank.t-install { --paint: var(--t-install); }
.plank.t-repair { --paint: var(--t-repair); }
.plank.t-site_visit { --paint: var(--t-site_visit); }
.topbar { box-shadow: 0 4px 0 0 var(--yellow); }
.board h1, .signin-board h1 { text-shadow: 2px 2px 0 var(--board-deep); }

/* =====================================================================
   PaySuiteTT colour scheme (owner, 14 Oct 2026): the app uses PaySuiteTT's blues, ground, ink and status tones;
   layout, lettering and the job panels are what set it apart from PaySuiteTT.
   ===================================================================== */
:root {
  --board: #075985;            /* PaySuiteTT admin-blue-deep */
  --board-deep: #0f3d5e;       /* PaySuiteTT pay-blue-deep */
  --board-bright: #0284c7;     /* PaySuiteTT admin-blue-bright */
  --sky-soft: #e0f2fe;         /* PaySuiteTT admin-blue-soft */
  --yellow: var(--sky-soft);   /* the old sign-yellow slots become PaySuiteTT's light-sky highlight */
  --yellow-ink: #075985;
  --t-service: #0369a1;        /* PaySuiteTT admin-blue */
  --t-install: #a3231f;        /* PaySuiteTT red tone */
  --t-repair: #a15c07;         /* PaySuiteTT amber tone, deepened for white lettering */
  --t-site_visit: #0b6b45;     /* PaySuiteTT green tone */
  --red: #a3231f; --blue: #0369a1; --green: #0b6b45;
  --n50: #f5f8fb; --n100: #edf0f3; --n200: #e5e7eb; --n300: #cbd2da; --n600: #475262; --n900: #111418;
  --ground: #f5f8fb; --panel: #ffffff; --ink: #111418; --ink-2: #475262; --line: #e5e7eb; --line-strong: #cbd2da;
  --ok-bg: #e3f5ec; --ok: #0b6b45; --wait-bg: #fcf0d9; --wait: #8a4b06; --bad-bg: #fde6e6; --bad: #a3231f;
  --info-bg: #e1f0f9; --info: #075985; --mute-bg: #edf0f3; --mute: #475262;
}
@media (prefers-color-scheme: dark) {
  :root {
    --board: #0c4a6e; --board-deep: #082f49; --board-bright: #087fa9; --sky-soft: rgba(8, 127, 169, .28);
    --yellow: #e0f2fe; --yellow-ink: #075985;
    --t-service: #0369a1; --t-install: #a3231f; --t-repair: #a15c07; --t-site_visit: #0b6b45;
    --red: #a3231f; --blue: #0369a1; --green: #0b6b45;
    --ground: #0c1118; --panel: #121a23; --ink: #eef7ff; --ink-2: #a9bbcb; --line: rgba(148, 163, 184, .22); --line-strong: rgba(148, 163, 184, .36);
    --ok-bg: rgba(16, 185, 129, .16); --ok: #6ee7b7; --wait-bg: rgba(245, 158, 11, .16); --wait: #fcd34d; --bad-bg: rgba(248, 113, 113, .16); --bad: #fca5a5;
    --info-bg: rgba(8, 127, 169, .22); --info: #7dd3fc; --mute-bg: rgba(148, 163, 184, .14); --mute: #cbd5e1;
  }
}
::selection { background: #bae6fd; color: #082f49; }
:focus-visible { outline-color: var(--board-bright); }
.choices input:focus-visible + span, .shutter:focus-within { outline-color: var(--board-bright); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(2, 132, 199, .28); }
/* Primary moves: Clock in in PaySuiteTT bright blue, Clock out stays red. */
.btn.go, button.go { background: var(--board-bright); border-color: var(--board-bright); color: #fff; }
.btn.go:hover, button.go:hover { background: #0369a1; border-color: #0369a1; }
.btn.stop:hover, button.stop:hover { background: #861a17; border-color: #861a17; }
.topbar { box-shadow: 0 3px 0 0 var(--board-bright); }
.brand img, .signin-board img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.board .sub strong, .signin-board p strong { color: #bae6fd; }
.board h1, .signin-board h1 { text-shadow: 2px 2px 0 rgba(8, 47, 73, .55); }
.tabbar a.on::before { background: var(--board-bright); }
.sync { background: var(--sky-soft); color: #075985; }
/* Repair was sign-yellow with dark lettering; in PaySuiteTT amber it takes white lettering like the rest. */
.job-panel.t-repair, .kpi.t-repair { --on: #fff; }
.plank.t-repair .swatch { --on: #fff; }
.job-panel.t-repair .units span { background: rgba(0, 0, 0, .18); }
.job-panel.t-repair .plate { background: rgba(0, 0, 0, .22); color: #fff; }
.bars i { background: #087fa9; }
.bars .down i { background: var(--t-install); }
@media (prefers-color-scheme: dark) { .bars i { background: #0ea5e9; } a { color: #7dd3fc; } .disclose, .btn.ghost, button.ghost { color: #7dd3fc; } .tabbar a.on { color: #7dd3fc; } }
.doc .doc-head { background: #075985; }
.doc .doc-head .kind { color: #bae6fd; }
.doc .total { background: #075985; }
.doc .stripe i:nth-child(1) { background: #0369a1; } .doc .stripe i:nth-child(2) { background: #a3231f; }
.doc .stripe i:nth-child(3) { background: #a15c07; } .doc .stripe i:nth-child(4) { background: #0b6b45; }

/* ---------- CoolBros logo (their mark and wordmark, redrawn flat) and red accents ---------- */
:root { --accent-red: #d92d20; }
.brand .mark { width: 36px; height: 36px; flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark b { font: italic 800 1.3rem/1 "Noto Sans", var(--text); letter-spacing: -.01em; color: #5b9cf5; }
.wordmark small { font: 600 .72rem/1.1 "Noto Sans", var(--text); color: #7dd3fc; letter-spacing: .02em; margin-top: 2px; }
@media (max-width: 600px) { .topbar .wordmark small { display: none; } .topbar .wordmark b { font-size: 1.15rem; } }
.signin-board .lockup { display: flex; align-items: center; gap: .75rem; }
.signin-board .lockup .mark { width: 64px; height: 64px; }
.signin-board .lockup .wordmark b { font-size: 2.1rem; }
.signin-board .lockup .wordmark small { font-size: 1rem; }
.signin-board h1 { font-size: clamp(2.4rem, 11vw, 3.2rem); margin-top: 1.4rem; }
/* Red accents: the shell stripe, the active tab and menu markers, and waiting counts. */
.topbar { box-shadow: 0 3px 0 0 var(--accent-red); }
.tabbar a.on::before { background: var(--accent-red); }
@media (min-width: 960px) { .sidenav a.on { box-shadow: inset 4px 0 0 var(--accent-red); } }
.count.alert, .kpis .kpi .v.alert { color: #fff; }
.count.alert { background: var(--accent-red); }

/* ---------- Red means urgent (owner, 14 Oct 2026) ----------
   Red is reserved for things that need attention now: waiting approvals, overdue invoices, money owed, losses,
   Clock out, "not received"/reject and errors. Job colours never use it. */
:root { --t-service: #0284c7; --t-install: #0f3d5e; }
@media (prefers-color-scheme: dark) { :root { --t-service: #0284c7; --t-install: #1e4f7a; } }
.topbar { box-shadow: 0 3px 0 0 var(--board-bright); }
.tabbar a.on::before { background: var(--board-bright); }
@media (min-width: 960px) { .sidenav a.on { box-shadow: none; } }
.bars .down i { background: var(--accent-red); }
.money-board .cell.result.loss { background: var(--accent-red); }
.kpi.urgent { --paint: var(--accent-red); --on: #fff; }
.doc .stripe i:nth-child(1) { background: #0284c7; } .doc .stripe i:nth-child(2) { background: #0f3d5e; }
.kpis .kpi.urgent { --paint: var(--accent-red); --on: #fff; }
.kpi.t-all { --paint: var(--panel); --on: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- Final-review fixes ---------- */
/* Service in a deeper sky so white lettering passes AA; install stays navy. */
:root { --t-service: #0369a1; --red: #b42318; --accent-red: #b42318; }
@media (prefers-color-scheme: dark) { :root { --t-service: #0369a1; --t-install: #1d3f63; --red: #b42318; --accent-red: #b42318; } }
.topbar .wordmark small { display: block; }
@media (max-width: 380px) { .topbar .wordmark small { display: none; } }
/* Tables inside a card are ruled rows, not a box in a box. */
.card .table-wrap { border: 0; border-radius: 0; background: transparent; margin: 0; }
.card .table-wrap th { background: transparent; }
/* Signwriter's shade: opaque paint, not a translucent ghost. */
.board h1, .signin-board h1 { text-shadow: 2px 2px 0 var(--board-deep); }
/* Dark mode: Clock in is light sky on the dark ground, a clear step from the service panel. */
@media (prefers-color-scheme: dark) { .btn.go, button.go { background: #e0f2fe; border-color: #e0f2fe; color: #075985; } .btn.go:hover, button.go:hover { background: #bae6fd; border-color: #bae6fd; } }
/* Documents carry the CoolBros mark. */
.doc-brand { display: flex; align-items: center; gap: 14px; }
.doc-brand .mark { width: 54px; height: 54px; flex: none; }
/* Documents: the brand band is deep navy so the royal-blue mark reads clearly. */
.doc .doc-head { background: #0f3d5e; }

/* Design-record fixes (14 Oct 2026). */
/* One red: every urgent thing uses #b42318. */
:root { --red: #b42318; --bad: #b42318; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --red: #b42318; --bad: #f97066; } }
/* Sign-in band is navy, like the top bar, so the mark and wordmark read. */
.signin-board { background: #0f3d5e; }
/* Small primary buttons are a shade deeper so their white text clears 4.5:1. */
.btn.go.small, button.go.small { background: #0369a1; border-color: #0369a1; }
/* The offline badge is solid in both themes. */
.sync { background: #e0f2fe; color: #075985; }
/* Chart key matches the bars. */
.legend i.k-profit { background: #087fa9 !important; }
@media (prefers-color-scheme: dark) { .legend i.k-profit { background: #0ea5e9 !important; } }
/* Documents: the service segment is the app's service colour; the total bars match the navy band. */
.doc .stripe i:nth-child(1) { background: #0369a1; }
.doc .total { background: #0f3d5e; }
/* Sign-in: a light rule keeps the navy install segment from merging into the navy band. */
.signin > header .stripe { border-top: 3px solid #e0f2fe; }

/* Money board: three separate tiles, no maths signs; the result tile carries the colour. */
.money-board { background: none; border: 0; border-radius: 0; overflow: visible; gap: .75rem; }
@media (min-width: 720px) { .money-board { grid-template-columns: repeat(3, 1fr); } }
.money-board .cell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
@media (max-width: 719px) { .money-board .cell + .cell { border-top: 1px solid var(--line); } }
.money-board .cell.result { border-color: transparent; }

/* NI forms page: download buttons in a row; the missing-details list reads as a list. */
.actions-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.nis-month .notice ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.nis-month .notice a { color: inherit; text-decoration: underline; }
/* Accountant logins on Staff & logins: name, password reset and on/off on one line where there's room. */
.plank-row { display: grid; gap: .6rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .plank-row { grid-template-columns: 1fr 1.4fr auto; align-items: end; } }

/* Job time, "new job" banner and job alerts. */
.plank .at { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 700; margin-right: .15rem; }
.plank .end { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.notice.news { background: var(--info-bg); color: var(--info); text-decoration: none; }
.notice.news span { flex: 1; }
.card.alerts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.card.alerts h3 { margin: 0 0 .15rem; }
.card.alerts p { margin: 0; }
.card.alerts[hidden], .card.alerts [hidden] { display: none; }
.job-panel .where.crew { opacity: .92; }

/* Employee profile. */
.profile-board .who-row { display: flex; gap: 1rem; align-items: center; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.profile-board .meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .35rem; }
.profile-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-kpis .kpi .d { display: block; font-size: .78rem; opacity: .8; margin-top: .2rem; }
.profile-grid { display: grid; gap: 1rem; }
@media (min-width: 960px) { .profile-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.profile-grid .item .end { display: flex; gap: .4rem; align-items: center; }
.reset-row { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }

/* Help menu (?) in the top bar. */
.help-menu { position: relative; }
.help-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.help-menu > summary::-webkit-details-marker { display: none; }
.help-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .35); padding: .35rem; display: grid; }
.help-menu .menu button { all: unset; cursor: pointer; padding: .7rem .8rem; border-radius: var(--r-sm); font-weight: 600; font-size: .92rem; color: var(--ink); }
.help-menu .menu button:hover, .help-menu .menu button:focus-visible { background: var(--line); }
.help-menu .menu button[hidden] { display: none; }

/* Walkthrough tips (driver.js popovers). */
.driver-popover.cb-tour { font-family: var(--text); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; max-width: min(22rem, calc(100vw - 2rem)); box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .45); padding: 1rem 1.1rem; }
.driver-popover.cb-tour .driver-popover-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; font-size: 1.25rem; line-height: 1.05; color: var(--ink); }
.driver-popover.cb-tour .driver-popover-description { font-size: .95rem; line-height: 1.45; color: var(--ink-2); margin-top: .35rem; }
.driver-popover.cb-tour .driver-popover-progress-text { font-size: .78rem; color: var(--ink-2); }
.driver-popover.cb-tour .driver-popover-footer { gap: .4rem; flex-wrap: wrap; margin-top: .9rem; }
.driver-popover.cb-tour .driver-popover-footer button { font-family: var(--text); text-shadow: none; font-weight: 700; font-size: .85rem; border-radius: var(--r-sm); padding: .5rem .8rem; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); }
.driver-popover.cb-tour .driver-popover-next-btn { background: #075985 !important; border-color: #075985 !important; color: #fff !important; }
.driver-popover.cb-tour .driver-popover-close-btn { color: var(--ink-2); }
.driver-popover.cb-tour .cb-tour-off { border: 0 !important; padding-left: 0 !important; color: var(--ink-2) !important; font-weight: 600 !important; text-decoration: underline; margin-right: auto; }
.driver-popover.cb-tour .driver-popover-arrow-side-left.driver-popover-arrow { border-left-color: var(--panel); }
.driver-popover.cb-tour .driver-popover-arrow-side-right.driver-popover-arrow { border-right-color: var(--panel); }
.driver-popover.cb-tour .driver-popover-arrow-side-top.driver-popover-arrow { border-top-color: var(--panel); }
.driver-popover.cb-tour .driver-popover-arrow-side-bottom.driver-popover-arrow { border-bottom-color: var(--panel); }

/* First-sign-in welcome. */
.cb-welcome { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; padding: 1rem; background: rgba(10, 14, 20, .55); animation: cb-fade .16s ease-out; }
.cb-welcome-card { width: min(26rem, 100%); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 1.5rem 1.4rem 1.1rem; text-align: center; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5); animation: cb-rise .22s ease-out; }
.cb-welcome-mark svg { width: 54px; height: 54px; }
.cb-welcome h2 { font-size: 1.8rem; margin: .5rem 0 .4rem; }
.cb-welcome p { color: var(--ink-2); margin: 0 0 1.1rem; line-height: 1.45; }
.cb-welcome-actions { display: grid; gap: .5rem; }
.cb-welcome-off { all: unset; cursor: pointer; margin-top: .8rem; font-size: .85rem; color: var(--ink-2); text-decoration: underline; }
@keyframes cb-fade { from { opacity: 0; } }
@keyframes cb-rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .cb-welcome, .cb-welcome-card { animation: none; } }

/* Owner's "Finish setting up" checklist. */
.card.setup .setup-progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: .25rem 0 .4rem; }
.card.setup .setup-progress span { display: block; height: 100%; background: #0d9488; }
.card.setup .item { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; }
.card.setup .item > div { flex: 1; }
.card.setup .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.card.setup .item.done .tick { background: #0d9488; border-color: #0d9488; color: #fff; }
.card.setup .item.done .title { color: var(--ink-2); text-decoration: line-through; }
.profile-kpis .kpi .v { font-size: clamp(1.5rem, 3.4vw, 2.4rem); overflow-wrap: anywhere; }
ol.steps { margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.6; }
.maps-list .item { gap: .75rem; }
.maps-list .end { display: flex; gap: .4rem; align-items: center; }
.maps-list select { max-width: 14rem; }
.logo-preview { margin: .5rem 0 1rem; padding: .75rem; border: 1px dashed var(--line-strong); border-radius: var(--r); display: inline-block; background: #fff; }
.logo-preview img { max-height: 80px; max-width: 280px; display: block; }
.doc-logo { max-height: 64px; max-width: 220px; object-fit: contain; }
