/* A&F Transport: same look as the workshop planner (colours, Barlow type, yellow plates). */
:root {
  --bg: #eef1f4; --surface: #ffffff; --surface-2: #f6f8fa; --surface-3: #edf1f5;
  --ink: #17212b; --muted: #5a6876; --line: #d6dde3; --line-2: #e6ebef;
  --accent: #1560ad; --accent-ink: #ffffff; --accent-soft: #e2eefa;
  --brand-a: #0a8fd8; --brand-b: #1e3070; --logo-plate: transparent;
  --today: #fff6d6; --plate: #f6c429; --plate-ink: #111111;
  --ok: #1f8a4c; --ok-bg: #e5f4ea; --warn: #b86e00; --warn-bg: #fff3dc; --bad: #c8322d; --bad-bg: #fde8e7;
  --info: #1d6fd1; --info-bg: #e4eefb; --violet: #7b4fc4; --violet-bg: #f1eafc; --grey: #7d8894; --grey-bg: #eef1f4;
  --shadow: 0 1px 2px rgba(20, 30, 45, .08), 0 4px 16px rgba(20, 30, 45, .06);
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1318; --surface: #161d24; --surface-2: #1b232b; --surface-3: #212a33; --ink: #e5eaef; --muted: #96a3b0; --line: #2b3641; --line-2: #232d37;
    --accent: #5cb0f0; --accent-ink: #0e1318; --accent-soft: #14283d; --brand-a: #2aa6ec; --brand-b: #5c7fd6; --logo-plate: #f3f7fb; --today: #2a2615;
    --plate: #e9b818; --ok: #4cc27e; --ok-bg: #13301f; --warn: #f0a530; --warn-bg: #33270f; --bad: #f07067; --bad-bg: #3a1a19;
    --info: #6cb2f5; --info-bg: #142a40; --violet: #b495f0; --violet-bg: #2a2140; --grey: #8592a0; --grey-bg: #1f2830;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1318; --surface: #161d24; --surface-2: #1b232b; --surface-3: #212a33; --ink: #e5eaef; --muted: #96a3b0; --line: #2b3641; --line-2: #232d37;
  --accent: #5cb0f0; --accent-ink: #0e1318; --accent-soft: #14283d; --brand-a: #2aa6ec; --brand-b: #5c7fd6; --logo-plate: #f3f7fb; --today: #2a2615;
  --plate: #e9b818; --ok: #4cc27e; --ok-bg: #13301f; --warn: #f0a530; --warn-bg: #33270f; --bad: #f07067; --bad-bg: #3a1a19;
  --info: #6cb2f5; --info-bg: #142a40; --violet: #b495f0; --violet-bg: #2a2140; --grey: #8592a0; --grey-bg: #1f2830;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14.5px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: .01em; text-wrap: balance; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.right { text-align: right; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 3px solid; border-image: linear-gradient(90deg, var(--brand-a), var(--brand-b)) 1; }
.top-in { display: flex; align-items: center; gap: 10px 16px; padding: 8px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; background: var(--logo-plate); border-radius: 8px; padding: 3px 8px 3px 4px; text-decoration: none; color: inherit; }
.brand img.mk { height: 32px; } .brand img.wm { height: 14px; display: block; }
.brand .sub { font-family: var(--display); font-weight: 600; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--brand-b) 70%, var(--muted)); line-height: 1; margin-top: 3px; }
.top .ctx { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acct { display: flex; gap: 8px; align-items: center; font-size: .85rem; margin-left: auto; }
.acct .who { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.nav { display: flex; align-items: stretch; gap: 2px; padding: 0 12px; border-top: 1px solid var(--line-2); position: relative; z-index: 45; }
.nav > a, .nav .mbtn { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: .02em; color: var(--muted); text-decoration: none; border: 0; border-bottom: 3px solid transparent; background: none; white-space: nowrap; }
.nav > a:hover, .nav .mbtn:hover, .nav .mbtn[aria-expanded="true"] { color: var(--ink); }
.nav > a[aria-current="page"], .nav .mbtn[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.nav .mbtn svg { opacity: .6; transition: transform .15s; }
.nav .mbtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav .mcur { font-family: var(--body); font-weight: 600; font-size: .78rem; letter-spacing: 0; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 8px; }
.nav .menu { position: relative; display: flex; }
.nav .mlist { position: absolute; top: calc(100% + 2px); left: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(10, 18, 28, .18); padding: 6px; display: grid; gap: 1px; z-index: 50; }
.nav .mlist a { padding: 8px 12px; border-radius: 7px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav .mlist a:hover { background: var(--surface-2); }
.nav .mlist a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .menu.fin .mbtn { color: color-mix(in srgb, var(--ok) 80%, var(--muted)); }
.nav .menu.fin .mbtn[aria-current="page"] { color: var(--ok); border-bottom-color: var(--ok); }
.nav .menu.fin .mcur { background: var(--ok-bg); color: var(--ok); }
.nav .menu.fin .mlist a[aria-current="page"] { background: var(--ok-bg); color: var(--ok); }
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; padding: 0 6px; }
  .nav > a, .nav .mbtn { padding: 8px 9px; font-size: .96rem; }
  .nav .mcur { display: none; }
  .nav .spacer { display: none; }
  .nav .mlist { position: fixed; left: 8px; right: 8px; top: auto; min-width: 0; }
}
.nav .sep { width: 1px; background: var(--line); margin: 8px 6px; flex: none; }

main { padding: 16px; max-width: 1800px; margin: 0 auto; }
.pagehead { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.pagehead h2 { font-size: 1.6rem; text-transform: uppercase; letter-spacing: .03em; }
.pagehead .sub { color: var(--muted); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 7px 13px; font-weight: 600; line-height: 1.15; white-space: nowrap; min-height: 36px; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 4px 9px; min-height: 30px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 0; background: none; padding: 6px 8px; border-radius: 6px; color: var(--muted); font-size: 1rem; line-height: 1; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=tel], input:not([type]), select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 6px 9px; min-height: 36px; width: 100%; min-width: 0; }
textarea { min-height: 70px; resize: vertical; }
select { padding-right: 26px; }
input:disabled, select:disabled { opacity: .6; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field > span b { color: var(--bad); }
.check { display: inline-flex; gap: 7px; align-items: center; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.toolbar .field { min-width: 120px; }
.toolbar .field.w-s { width: 120px; } .toolbar .field.w-m { width: 160px; } .toolbar .field.w-l { width: 220px; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 9px; min-height: 36px; }
.search input { border: 0; padding: 6px 0; min-height: 0; background: transparent; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-weight: 600; font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .num { opacity: .75; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; font-weight: 600; min-height: 34px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.datenav { display: flex; align-items: center; gap: 4px; }
.datenav input[type=date] { width: 150px; }
.datenav .lbl { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 0 6px; white-space: nowrap; }

/* ---------- cards, tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card > .hd h3 { text-transform: uppercase; letter-spacing: .04em; font-size: 1.05rem; }
.card > .bd { padding: 12px 14px; }
.card > .bd.flush { padding: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: grid; gap: 2px; border-top: 4px solid var(--tc, var(--accent)); }
.tile .v { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tile .s { font-size: .82rem; color: var(--muted); }
.tile.bad { --tc: var(--bad); } .tile.ok { --tc: var(--ok); } .tile.warn { --tc: var(--warn); } .tile.violet { --tc: var(--violet); }
.trio { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; margin-bottom: 14px; }
.trio.n4 { grid-template-columns: minmax(0, 1.9fr) repeat(3, minmax(0, 1fr)); }
.trio.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trio > .card { display: flex; flex-direction: column; min-width: 0; }      /* same height across the row: no gaps */
.trio > .card > .bd { flex: 1; }
.trio .feed { max-height: 300px; overflow: auto; }
@media (max-width: 1400px) { .trio.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .trio, .trio.n2, .trio.n4 { grid-template-columns: minmax(0, 1fr); } }
.trio .card .tblwrap { max-height: 300px; }
.tbl.compact th, .tbl.compact td { padding: 5px 6px; }
.tbl.compact .divtag { font-size: .86rem; }
.cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 14px; }

/* ---------- tables ---------- */
.tblwrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-height: calc(100vh - 230px); }
.tblwrap.free { max-height: none; }
table.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-3); text-align: left; font-family: var(--display); font-weight: 700; font-size: .92rem; letter-spacing: .03em; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--accent); }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl tr.click { cursor: pointer; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { position: sticky; bottom: 0; background: var(--surface-3); font-weight: 700; border-top: 1px solid var(--line); }
.tbl .cb { width: 30px; text-align: center; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.tbl .wrap { white-space: normal; min-width: 160px; }
.tbl td.ell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.emptystate { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 28px 20px; text-align: center; color: var(--muted); }
.emptystate h2 { color: var(--ink); margin-bottom: 6px; }

/* ---------- pills, plates, badges ---------- */
.plate { display: inline-block; background: var(--plate); color: var(--plate-ink); font-family: "Arial Narrow", var(--display); font-weight: 700; letter-spacing: .04em; border-radius: 4px; padding: 1px 6px; font-size: .9rem; white-space: nowrap; border: 1px solid rgba(0,0,0,.25); line-height: 1.35; }
.plate.lg { font-size: 1.25rem; padding: 2px 9px; }
.plate.trl { background: #e8e8e2; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: var(--grey-bg); color: var(--grey); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.st-open { background: var(--warn-bg); color: var(--warn); } .st-planned { background: var(--info-bg); color: var(--info); }
.st-progress { background: var(--violet-bg); color: var(--violet); } .st-done { background: var(--ok-bg); color: var(--ok); } .st-cancelled { background: var(--grey-bg); color: var(--grey); text-decoration: line-through; }
.fs-paid { background: var(--ok-bg); color: var(--ok); } .fs-part { background: #ffe1c2; color: #a0490a; } .fs-invoiced { background: var(--info-bg); color: var(--info); }
.fs-queried { background: var(--bad-bg); color: var(--bad); } .fs-none { background: var(--grey-bg); color: var(--grey); }
.vs-vor { background: var(--bad-bg); color: var(--bad); } .vs-mot { background: var(--info-bg); color: var(--info); } .vs-serviceable { background: var(--warn-bg); color: var(--warn); } .vs-roadworthy { background: var(--ok-bg); color: var(--ok); }
.divdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--dc, var(--grey)); flex: none; }
.divtag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.warnline { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: .9rem; }
.badline { display: flex; gap: 8px; align-items: flex-start; background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: .9rem; }
.okline { display: flex; gap: 8px; align-items: flex-start; background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: .9rem; }
.hint { color: var(--muted); font-size: .86rem; }

.tbl td.loads { min-width: 520px; width: 75%; }
.loadrow { display: flex; gap: 6px; flex-wrap: wrap; }
.loadrow .jcard { width: 178px; flex: none; cursor: pointer; }

/* customer / contract group headings on the planner and dashboard */
tr.grprow td { background: var(--accent-soft); border-top: 2px solid var(--accent); padding: 6px 10px; position: sticky; left: 0; }
tr.grprow td > * { margin-right: 10px; vertical-align: middle; }
tr.grprow .gname { font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
tr.divrow td { background: var(--surface-3); padding: 8px 10px; font-family: var(--display); font-size: 1.15rem; }
.board tr.grprow:hover td, .tbl tr.grprow:hover td { background: var(--accent-soft); }

/* fleet utilisation */
.ubar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin-bottom: 12px; }
.ubar span { min-width: 3px; }
.ugrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ucol { min-width: 0; }
.ucol .uh { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; font-size: .92rem; }
.ulist { display: grid; gap: 3px; max-height: 190px; overflow: auto; align-content: start; }
.uitem { display: flex; gap: 6px; align-items: center; border: 0; background: none; padding: 2px 0; text-align: left; min-width: 0; }
.uitem .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uitem:hover .plate { outline: 2px solid var(--accent); }

/* job type tags: DAY = day rate, RC = rate card */
.btag { display: inline-block; border-radius: 4px; padding: 0 5px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; line-height: 1.5; vertical-align: middle; flex: none; }
.btag.day { background: var(--info-bg); color: var(--info); }
.btag.rc { background: var(--violet-bg); color: var(--violet); }

/* ---------- planner board ---------- */
.board-wrap { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 12px; align-items: start; }
.pool { position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow: auto; }
.pool .grp { padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.pool .grp h4 { font-size: .98rem; display: flex; gap: 6px; align-items: center; }
.pool .grp .meta { font-size: .8rem; color: var(--muted); margin: 2px 0 6px; }
.jcard { display: grid; gap: 1px; border: 1px solid var(--line); border-left: 4px solid var(--jc, var(--info)); background: var(--surface); border-radius: 7px; padding: 4px 7px; font-size: .82rem; line-height: 1.25; cursor: grab; min-width: 0; text-align: left; width: 100%; }
.jcard:hover { border-color: var(--accent); }
.jcard .r1 { display: flex; gap: 6px; font-weight: 700; align-items: center; }
.jcard .r1 .t { margin-left: auto; color: var(--muted); font-weight: 600; }
.jcard .r2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.jcard.done { --jc: var(--ok); background: color-mix(in srgb, var(--ok-bg) 60%, var(--surface)); }
.jcard.progress { --jc: var(--violet); }
.jcard.cancelled { --jc: var(--grey); opacity: .6; text-decoration: line-through; }
.jcard.open { --jc: var(--warn); }
.jcard.dragging { opacity: .4; }
.board { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.board th { position: sticky; top: 0; z-index: 3; background: var(--surface-3); font-family: var(--display); font-size: .95rem; padding: 7px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board td { border-bottom: 1px solid var(--line-2); padding: 4px 5px; vertical-align: top; }
.board td.veh { min-width: 150px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.board tr.vor td { background: color-mix(in srgb, var(--bad-bg) 55%, var(--surface)); }
.board td.slot { min-width: 160px; width: 15%; }
.board td.slot.over { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.board .addslot { width: 100%; min-height: 40px; border: 1px dashed var(--line); background: transparent; border-radius: 7px; color: var(--muted); font-size: .8rem; }
.board .addslot:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.board td.drv { min-width: 180px; }
.board .drv select { min-height: 30px; padding: 3px 6px; font-size: .86rem; }
.board .drv .off { color: var(--bad); font-weight: 700; font-size: .78rem; }
.board .vline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.board .vsub { font-size: .76rem; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.board .note input { min-height: 30px; font-size: .84rem; }
.board .start input { min-height: 30px; width: 88px; padding: 3px 6px; }

/* ---------- rota / calendar ---------- */
.rota { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.rota th, .rota td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; text-align: center; }
.rota th { position: sticky; top: 0; z-index: 3; background: var(--surface-3); font-family: var(--display); font-weight: 700; padding: 4px 2px; min-width: 34px; }
.rota th.we, .rota td.we { background: color-mix(in srgb, var(--grey-bg) 70%, var(--surface)); }
.rota th.today { background: var(--today); }
.rota td.nm, .rota th.nm { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: 3px 8px; white-space: nowrap; min-width: 190px; font-size: .86rem; }
.rota th.nm { z-index: 4; background: var(--surface-3); }
.rota td.grp { text-align: left; background: var(--surface-3); font-family: var(--display); font-weight: 700; padding: 5px 8px; position: sticky; left: 0; }
.rota td.tot { font-variant-numeric: tabular-nums; padding: 2px 5px; background: var(--surface-2); font-weight: 600; }
.rota .c { display: block; width: 100%; min-width: 34px; height: 26px; border: 0; background: transparent; font-size: .74rem; font-weight: 700; padding: 0 2px; }
.rota .c:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.rota .c.dflt { color: var(--muted); font-weight: 500; opacity: .75; }
.r-in { background: var(--ok-bg) !important; color: var(--ok); } .r-hol { background: #fff27a !important; color: #4a4100; } .r-unp { background: #b7f5b7 !important; color: #145214; }
.r-bh { background: #ffb3ff !important; color: #5d005d; } .r-brk { background: #ffd699 !important; color: #6b3d00; } .r-sick { background: var(--bad-bg) !important; color: var(--bad); }
.r-ns { background: #f2b8b5 !important; color: #7d1410; } .r-trn { background: var(--info-bg) !important; color: var(--info); } .r-ngt { background: #c9cff0 !important; color: #1e2a6b; }
.r-req { background: #ffd3d3 !important; color: #9b1c1c; } .r-left { background: var(--grey-bg) !important; color: var(--grey); } .r-oth { background: var(--surface-3) !important; color: var(--ink); }
.rota .c.dflt.r-in { background: transparent !important; } .rota .c.dflt.r-brk { background: transparent !important; color: var(--muted); } .rota .c.dflt.r-ngt { background: transparent !important; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; }
.legend span { border-radius: 5px; padding: 2px 7px; font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dh { font-family: var(--display); font-weight: 700; text-align: center; color: var(--muted); }
.cal .day { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; min-height: 120px; padding: 5px 6px; display: grid; align-content: start; gap: 3px; font-size: .8rem; }
.cal .day.out { opacity: .4; }
.cal .day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal .day .dn { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; font-size: 1rem; }
.cal .day .who { border-radius: 4px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; cursor: pointer; border: 0; text-align: left; font-size: .78rem; }

/* ---------- lists / feed ---------- */
.feed { display: grid; }
.feed .it { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; cursor: pointer; }
.feed .it:hover { background: var(--surface-2); }
.feed .it .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .it .s { grid-column: 2 / -1; color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .it .w { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }
.items { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.items .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 7px 10px; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.items .row:last-child { border-bottom: 0; }
.items .row.fail { background: var(--bad-bg); }
.items .row .note { grid-column: 1 / -1; color: var(--bad); font-weight: 600; font-size: .85rem; }
.items .sec { background: var(--surface-3); font-family: var(--display); font-weight: 700; padding: 5px 10px; text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog.wide { width: min(1040px, calc(100vw - 24px)); }
dialog.xwide { width: min(1400px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 18, 28, .5); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.dlg-head h2 { flex: 1; font-size: 1.35rem; text-transform: uppercase; letter-spacing: .03em; }
.dlg-body { padding: 14px 16px; overflow: auto; display: grid; gap: 12px; }
.dlg-foot { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.colpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.pop { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; min-width: 190px; max-height: 340px; overflow: auto; }
.pop button { border: 0; background: none; text-align: left; padding: 6px 9px; border-radius: 6px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.pop button:hover { background: var(--surface-2); }

/* ---------- sign-in, toast ---------- */
#authGate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.ag-card { width: min(380px, 100%); display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
.ag-brand { display: grid; justify-items: center; gap: 6px; padding: 6px 8px 10px; background: var(--logo-plate); border-radius: 10px; }
.ag-mk { height: 56px; } .ag-wm { height: 20px; }
.ag-sub { font-family: var(--display); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-size: .85rem; }
.ag-msg { min-height: 1.2em; margin: 0; font-size: .9rem; color: var(--muted); }
.ag-link { border: 0; background: none; color: var(--accent); font-weight: 600; justify-self: center; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- invoice print ---------- */
.inv { background: #fff; color: #111; padding: 28px; font-size: 13px; }
.inv h1 { font-family: var(--display); font-size: 2rem; }
.inv table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.inv th, .inv td { border-bottom: 1px solid #ddd; padding: 5px 6px; text-align: left; }
.inv td.n, .inv th.n { text-align: right; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .board-wrap { grid-template-columns: 1fr; }
  .pool { position: static; max-height: 300px; }
}
@media (max-width: 720px) {
  main { padding: 12px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .acct .who { max-width: 140px; }
  .tblwrap { max-height: none; }
  .toolbar .field, .toolbar .field.w-s, .toolbar .field.w-m, .toolbar .field.w-l { width: calc(50% - 4px); min-width: 0; }
  .cal { grid-template-columns: 1fr; } .cal .dh { display: none; } .cal .day.out { display: none; }
}
@media print {
  .top, .nav, .noprint { display: none !important; }
  body { background: #fff; }
}
