/* Neon Plant & Tool Hire: design system.
   Manila and near black, serif headlines, quiet lines, pill controls. Wisbech runs black menu bars,
   Manchester runs the same scheme inverted. Every colour pair used for text meets WCAG AA. */

@font-face { font-family: 'Newsreader'; src: url('../assets/fonts/newsreader-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('../assets/fonts/newsreader-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('../assets/fonts/newsreader-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('../assets/fonts/newsreader-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --paper: #EFE8D8;
  --paper-2: #E5DCC7;
  --paper-3: #D9CEB4;
  --card: #F8F4EA;
  --ink: #15140F;
  --ink-2: #3F3B33;
  --mute: #625C50;
  --line: rgba(21, 20, 15, 0.12);
  --line-2: rgba(21, 20, 15, 0.24);
  --night: #15140F;
  --night-2: #23211C;
  --night-3: #322F28;
  --on-night: #EFE8D8;
  --on-night-mute: #ABA492;
  --ok: #2B6440; --ok-bg: #DCE5D0;
  --warn: #7E520C; --warn-bg: #F0E0B9;
  --bad: #962F20; --bad-bg: #EFD3C8;
  --info: #2B4A69; --info-bg: #D6DEE3;
  --focus: #15140F;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 14px; --r-sm: 9px; --pill: 999px;
  --shadow: 0 1px 0 rgba(21, 20, 15, 0.04), 0 10px 30px -18px rgba(21, 20, 15, 0.35);
  --side: 252px;
  --bar-bg: var(--night); --bar-fg: var(--on-night); --bar-mute: var(--on-night-mute); --bar-line: rgba(239, 232, 216, 0.12); --bar-hover: var(--night-2); --bar-active-bg: var(--on-night); --bar-active-fg: var(--night);
}
/* Manchester: the same scheme, inverted on the menu bars */
body[data-depot="MAN"] {
  --bar-bg: var(--paper-2); --bar-fg: var(--ink); --bar-mute: var(--mute); --bar-line: rgba(21, 20, 15, 0.16); --bar-hover: var(--paper-3); --bar-active-bg: var(--night); --bar-active-fg: var(--on-night);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 38px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 0.75em; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); }
.muted { color: var(--mute); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.eyebrow { font: 500 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
/* The menu keeps the dark scheme at both depots: only the top bar inverts for Manchester */
.sidebar { --bar-bg: var(--night); --bar-fg: var(--on-night); --bar-mute: var(--on-night-mute); --bar-line: rgba(239, 232, 216, 0.12); --bar-hover: var(--night-2); --bar-active-bg: var(--on-night); --bar-active-fg: var(--night); }
.sidebar { background: var(--bar-bg); color: var(--bar-fg); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; border-right: 1px solid var(--bar-line); }
.exit { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 20px; border-bottom: 1px solid var(--bar-line); font: 500 11.5px var(--sans); }
.exit a, .shop-exit { color: var(--bar-fg); text-decoration: none; white-space: nowrap; }
.exit a:hover, .shop-exit:hover { text-decoration: underline; }
.exit a + a { color: var(--bar-mute); }
.side-top { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 8px 18px 20px; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.pin-btn, .nav-close { display: inline-grid; place-items: center; width: 30px; height: 30px; background: none; border: 1px solid var(--bar-line); color: var(--bar-mute); border-radius: 50%; cursor: pointer; flex: none; padding: 0; }
.pin-btn:hover, .nav-close:hover { color: var(--bar-fg); background: var(--bar-hover); }
.pin-btn[aria-pressed="true"] { color: var(--bar-active-fg); background: var(--bar-active-bg); border-color: var(--bar-active-bg); }
.pin-btn svg, .nav-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-close { display: none; }
/* Floating menu: unpinned, narrow screens and the customer screens */
body.nav-float .app { grid-template-columns: minmax(0, 1fr); }
body.nav-float .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(300px, 86vw); z-index: 100; transform: translateX(-102%); transition: transform .22s ease, visibility 0s linear .22s; visibility: hidden; }
body.nav-float.nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .5); }
body.nav-float .nav-close { display: inline-flex; }
body.nav-float .pin-btn { order: 0; }
.nav-scrim { display: none; }
body.nav-float.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 99; background: rgba(21, 20, 15, .38); }
@media (max-width: 920px) { .pin-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { body.nav-float .sidebar { transition: none; } }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--bar-fg); color: var(--bar-bg); display: grid; place-items: center; font: 600 15px var(--serif); flex: none; }
.brand-name { font: 500 17px/1.1 var(--serif); }
.brand-sub { font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bar-mute); margin-top: 3px; }
.nav { padding: 6px 12px 16px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-label { font: 500 10.5px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--bar-mute); padding: 0 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--bar-fg); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--bar-hover); }
.nav a[aria-current="page"] { background: var(--bar-active-bg); color: var(--bar-active-fg); }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav .count { margin-left: auto; font: 500 11px var(--mono); padding: 1px 7px; border-radius: var(--pill); background: var(--bar-hover); }
.nav a[aria-current="page"] .count { background: transparent; }
.side-foot { padding: 14px 20px 20px; border-top: 1px solid var(--bar-line); font-size: 12px; color: var(--bar-mute); }
.side-foot a { color: var(--bar-fg); }
.side-foot button { background: none; border: 1px solid var(--bar-line); color: var(--bar-fg); border-radius: var(--pill); padding: 6px 12px; cursor: pointer; font-size: 12px; margin-top: 10px; }
.side-foot button:hover { background: var(--bar-hover); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--bar-bg); color: var(--bar-fg); display: flex; align-items: center; gap: 14px; padding: 10px 28px; border-bottom: 1px solid var(--bar-line); min-height: 60px; }
.topbar .crumbs { font: 500 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--bar-mute); white-space: nowrap; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: inline-grid; place-items: center; flex: none; background: none; border: 1px solid var(--bar-line); color: var(--bar-fg); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; }
.search { position: relative; width: min(380px, 40vw); }
.search input { width: 100%; background: var(--bar-hover); border: 1px solid var(--bar-line); color: var(--bar-fg); border-radius: var(--pill); padding: 8px 14px 8px 36px; }
.search input::placeholder { color: var(--bar-mute); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--bar-mute); fill: none; stroke-width: 2; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 10.5px var(--mono); color: var(--bar-mute); border: 1px solid var(--bar-line); border-radius: 5px; padding: 1px 5px; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); max-height: 420px; overflow-y: auto; padding: 6px; }
.search-results a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 9px; text-decoration: none; }
.search-results a:hover, .search-results a.active { background: var(--paper-2); }
.search-results .k { font: 500 10.5px var(--mono); text-transform: uppercase; color: var(--mute); width: 70px; flex: none; }
.depot-switch { display: inline-flex; background: var(--bar-hover); border: 1px solid var(--bar-line); border-radius: var(--pill); padding: 3px; }
.depot-switch button { border: 0; background: none; color: var(--bar-fg); padding: 6px 13px; border-radius: var(--pill); cursor: pointer; font-weight: 500; font-size: 13px; }
.depot-switch button[aria-pressed="true"] { background: var(--bar-active-bg); color: var(--bar-active-fg); }
.today-chip { font: 500 11.5px var(--mono); color: var(--bar-mute); white-space: nowrap; }

.content { padding: 28px 32px 64px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .titles { flex: 1; min-width: 260px; }
.page-head .lede { color: var(--ink-2); max-width: 760px; margin-top: 8px; font-size: 15px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { flex: 1; }
.card.flush .card-head { padding: 16px 20px 0; }
.card.dark { background: var(--night); color: var(--on-night); border-color: var(--night); }
.card.dark .muted { color: var(--on-night-mute); }
.section { margin-top: 28px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* KPI tiles */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { font: 500 11px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--mute); }
.kpi .value { font: 500 30px/1.05 var(--serif); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12.5px; color: var(--ink-2); }
.kpi.dark { background: var(--night); color: var(--on-night); border-color: var(--night); }
.kpi.dark .label, .kpi.dark .sub { color: var(--on-night-mute); }
button.kpi { text-align: left; cursor: pointer; font: inherit; }
button.kpi:hover { border-color: var(--line-2); }
button.kpi[aria-pressed="true"] { background: var(--night); color: var(--on-night); }
button.kpi[aria-pressed="true"] .label, button.kpi[aria-pressed="true"] .sub { color: var(--on-night-mute); }
.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; padding: 8px 16px; font-weight: 500; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; color: var(--ink); }
.btn:hover { background: var(--paper-2); }
.btn-primary { background: var(--ink); color: var(--on-night); border-color: var(--ink); }
.btn-primary:hover { background: var(--night-3); }
.btn-danger { color: var(--bad); border-color: rgba(150, 47, 32, .4); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 10px; }
.card.dark .btn { color: var(--on-night); border-color: rgba(239, 232, 216, .3); }
.card.dark .btn:hover { background: var(--night-2); }
.card.dark .btn-primary { background: var(--on-night); color: var(--night); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .label-text { font: 500 12px var(--sans); color: var(--ink-2); }
.input, .select, .textarea { width: 100%; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-height: 38px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 20, 15, .1); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--mute); }

.seg { display: inline-flex; background: var(--paper-2); border-radius: var(--pill); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: var(--pill); cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-night); }
/* The baseline is drawn inside the strip (inset shadow) so nothing pokes out below it: an overflowing pixel
   used to give the strip a vertical scroll bar that showed as a small pill at its right end. */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 500; color: var(--mute); border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--pill); font: 500 11.5px/1.6 var(--sans); white-space: nowrap; border: 1px solid transparent; background: var(--paper-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.ink { background: var(--ink); color: var(--on-night); }
.badge.outline { background: transparent; border-color: var(--line-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--pill); border: 1px solid var(--line-2); font-size: 12.5px; background: var(--card); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-night); border-color: var(--ink); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 10px 14px; border-bottom: 1px solid var(--line-2); background: var(--paper-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th .arrow { opacity: .7; margin-left: 4px; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: rgba(21, 20, 15, .035); }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); padding: 10px 14px; }
.tbl.compact td { padding: 6px 12px; }
.tbl .sub { color: var(--mute); font-size: 12px; }
.card .tbl th:first-child { padding-left: 20px; } .card .tbl td:first-child { padding-left: 20px; }
.card .tbl th:last-child { padding-right: 20px; } .card .tbl td:last-child { padding-right: 20px; }
.tbl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.tbl-tools .input { max-width: 280px; min-height: 34px; padding: 6px 12px; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.empty { text-align: center; padding: 40px 20px; color: var(--mute); }
.empty h4 { color: var(--ink); margin-bottom: 4px; }

/* ---------- Money (ex and inc VAT, always together) ---------- */
.money { display: inline-flex; align-items: baseline; gap: 5px; flex-wrap: wrap; white-space: nowrap; }
.money-ex { font-weight: 600; font-variant-numeric: tabular-nums; }
.money-inc { color: var(--mute); font-variant-numeric: tabular-nums; }
.money-tag { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; background: rgba(21, 20, 15, .38); z-index: 80; animation: fade .15s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--paper); z-index: 90; display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(21, 20, 15, .4); animation: slide .2s ease; }
.drawer-head { padding: 22px 26px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head .t { flex: 1; min-width: 0; }
.drawer-body { padding: 20px 26px 32px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--paper-2); }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--paper); border-radius: 18px; z-index: 95; box-shadow: var(--shadow); animation: pop .16s ease; }
.modal-body { padding: 24px; }
.modal-foot { padding: 14px 24px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: var(--paper-2); border-radius: 0 0 18px 18px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--on-night); padding: 11px 18px; border-radius: var(--pill); font-weight: 500; box-shadow: var(--shadow); animation: pop .18s ease; max-width: min(560px, calc(100vw - 32px)); }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } }
.toast { animation-name: toastin; } @keyframes toastin { from { transform: translateY(8px); opacity: 0; } }

/* Loading screen while the books open */
.boot { position: fixed; inset: 0; background: var(--night); color: var(--on-night); display: grid; place-items: center; z-index: 200; }
.boot-inner { width: min(420px, 86vw); }
.boot h2 { font-size: 30px; margin-bottom: 6px; }
.boot p { color: var(--on-night-mute); }
.boot-bar { height: 3px; background: rgba(239, 232, 216, .15); border-radius: 3px; overflow: hidden; margin-top: 22px; }
.boot-bar span { display: block; height: 100%; width: 5%; background: var(--on-night); transition: width .3s ease; }
.boot-msg { font: 500 12px var(--mono); color: var(--on-night-mute); margin-top: 12px; letter-spacing: .03em; }

/* ---------- Data presentation ---------- */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--mute); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .when { font: 500 11px var(--mono); color: var(--mute); }
.bar-track { height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.bar-fill { height: 100%; background: var(--ink); border-radius: 6px; }
.progress-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 60px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.chart { width: 100%; height: 240px; display: block; }
.chart text { font: 500 10.5px var(--mono); fill: var(--mute); }
.chart .grid line { stroke: var(--line); }
.chart-tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--on-night); padding: 7px 10px; border-radius: 9px; font-size: 12px; z-index: 150; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.callout { border: 1px solid var(--line-2); border-left: 3px solid var(--ink); background: var(--card); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.callout.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; padding: 3px 9px; border-radius: var(--pill); background: var(--ink); color: var(--on-night); }
.kbd { font: 500 11px var(--mono); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }

/* ---------- Scroll bars: thin, rounded and in the house colours instead of the browser default ---------- */
html, .drawer, .drawer *, .modal, .content, .tbl-wrap, .search-results { scrollbar-width: thin; scrollbar-color: rgba(21, 20, 15, .28) transparent; }
.sidebar, .sidebar * { scrollbar-width: thin; scrollbar-color: rgba(239, 232, 216, .22) transparent; }
.sidebar:hover { scrollbar-color: rgba(239, 232, 216, .38) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(21, 20, 15, .26); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(21, 20, 15, .42); }
.sidebar::-webkit-scrollbar-thumb { background-color: rgba(239, 232, 216, .2); }
.sidebar::-webkit-scrollbar-thumb:hover { background-color: rgba(239, 232, 216, .38); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- AI assistants: top bar button and the rows used in the panel and on Start here ---------- */
.ai-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--bar-hover); border: 1px solid var(--bar-line); color: var(--bar-fg); border-radius: var(--pill); padding: 7px 13px; cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap; }
.ai-btn:hover { background: var(--bar-active-bg); color: var(--bar-active-fg); }
.ai-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.ai-rows { display: grid; gap: 10px; }
.ai-row { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--card); display: grid; gap: 6px; }
.ai-row.is-here { border-color: var(--ink); }
.ai-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-row-go { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.ai-row-go .select { flex: 1 1 260px; min-width: 0; }
.ai-row-go .input { flex: 1 1 220px; min-width: 0; }
.ai-ask .card-head { display: none; }
.ix-ai-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 920px) {
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .search { order: 5; width: 100%; }
  .today-chip, .topbar .crumbs { display: none; }
  .ai-btn span { display: none; }
  .ix-ai-rows { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 48px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  h1 { font-size: 30px; }
  .dl { grid-template-columns: 120px minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .g4, .g5 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 24px; } }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .app { display: block; } body { background: #fff; } .card { border-color: #ccc; } }

/* Fixes after module build: header alignment for number columns, menu icon */
.tbl th.num { text-align: right; }
.menu-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
