:root {
  --bg: #f5f6f8; --surface: #ffffff; --text: #1d2330; --muted: #5d6676; --line: #dde1e7;
  --brand: #17365d; --brand-text: #ffffff; --accent: #1f5fa8; --accent-hover: #184c86;
  --ok: #1d7a46; --ok-bg: #e6f4ec; --bad: #b42318; --bad-bg: #fdecea; --warn: #8a5300; --warn-bg: #fff1d0; --info-bg: #eaf1fb;
  --iris: #13703a;                     /* tabs that copy FBR's IRIS screens (Director, 21 Nov 2026) */
  --radius: 8px; --gap: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --surface: #1b212b; --text: #e6e9ee; --muted: #9aa3b2; --line: #2d3542;
    --brand: #0f2440; --accent: #4d8fd9; --accent-hover: #6ba3e3;
    --ok: #4cc283; --ok-bg: #133325; --bad: #ff7b6e; --bad-bg: #3a1916; --warn: #f0b34a; --warn-bg: #3a2c10; --info-bg: #182a40;
    --iris: #5fd394;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
a { color: var(--accent); }
code { font-family: Consolas, "Cascadia Mono", monospace; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 20px;
  background: var(--brand); color: var(--brand-text); }
.brand { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; line-height: 1.2; }
.brand-text { display: flex; flex-direction: column; }
.brand-logo { width: 40px; height: auto; background: #fff; border-radius: 8px; padding: 3px; flex: none; }
.login-logo { display: block; width: 96px; height: auto; margin: 0 auto 8px; }
.brand-sub { font-weight: 400; font-size: .75rem; opacity: .8; }
/* top bar: grouped menus (Director, 18 Nov 2026) */
.icon-sprite { display: none; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 0; flex-wrap: wrap; align-items: center; }
.nav-top, .nav-group > summary { display: flex; align-items: center; gap: 6px; color: var(--brand-text); text-decoration: none;
  padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: .9rem; white-space: nowrap; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .ic:last-child { width: 14px; height: 14px; opacity: .75; transition: transform .15s; }
.nav-group[open] > summary .ic:last-child { transform: rotate(180deg); }
.nav-top:hover, .nav-group > summary:hover, .nav-group[open] > summary { background: rgba(255,255,255,.14); }
.nav-top[aria-current="page"], .nav-group.current > summary { box-shadow: inset 0 -2px 0 #9fc4ee; background: rgba(255,255,255,.08); }
.nav-group { position: relative; }
.nav-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 300px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16,24,40,.18), 0 2px 6px rgba(16,24,40,.08); }
.nav-menu-right { left: auto; right: 0; min-width: 250px; }
.nav-menu a, .nav-signout { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 7px; text-decoration: none;
  color: var(--text); width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.nav-menu a .ic, .nav-signout .ic { color: var(--accent); margin-top: 2px; }
.nav-menu a:hover, .nav-signout:hover { background: var(--info-bg); }
.nav-menu a[aria-current="page"] { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--accent); }
/* Desktop drop-downs (Business, Admin and the like) scroll inside themselves rather than running off the bottom of the screen.
   Capped at the viewport height less the top bar (--topbar-h is the live bar height, set by nav.js) less a small gap. The phone
   drawer (<=720px) is left untouched: it stays static and the whole drawer scrolls. */
@media (min-width: 721px) {
  .nav-menu { max-height: calc(100vh - var(--topbar-h, 72px) - 24px); overflow-y: auto; overscroll-behavior: contain; }
}
.nav-t { display: block; font-weight: 600; font-size: .93rem; }
.nav-h { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.nav-role { margin: 4px 10px 6px; color: var(--muted); font-size: .8rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--brand); display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .8rem; letter-spacing: .02em; }
.nav-role strong { color: var(--text); font-size: .93rem; }
.search-box { display: flex; flex-direction: row; align-items: center; gap: 6px; background: #fff; color: #5d6676; border-radius: 7px; padding: 0 10px; margin: 0; }
.search-box input { border: 0; background: transparent; padding: 7px 0; width: 8.5rem; color: #1d2330; transition: width .15s; }
.search-box input:focus { width: 13rem; }
.search-box input:focus { outline: none; }
.search-box:focus-within { outline: 2px solid #9fc4ee; }

.page { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.page-wide { max-width: none; padding-left: 24px; padding-right: 24px; }      /* month-by-month tables use the whole screen */
.page-wide .table th, .page-wide .table td { padding-left: 6px; padding-right: 6px; }
.bidcalc-frame, .lcdraft-frame { display: block; width: 100%; height: 900px; border: 1px solid var(--border, #d1d9e0); border-radius: 12px; background: #eef1f6; }  /* height is auto-fitted to content by bidcalc/frame-resize.js so the page scrolls once (no inner scrollbar); 900px is the pre-JS fallback */
.narrow { max-width: 460px; margin: 0 auto; padding: 40px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); }
.heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.heading-row h1 { margin: 0; }
.hint { color: var(--muted); font-size: .88rem; }

.stack { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text); min-width: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-family: Consolas, monospace; }
button, .button { font: inherit; display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .button:hover { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: var(--accent-hover); }
.small { padding: 3px 8px; font-size: .82rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions form, form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; background: var(--info-bg); }
.flash-error { background: var(--bad-bg); color: var(--bad); font-weight: 600; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.numeric th:nth-child(n+3) { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .num, .table th.num { text-align: right; }      /* beats the table's default left alignment */
tr.muted td { opacity: .55; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; background: var(--bg); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tax-badge { display: block; border-radius: var(--radius); padding: 10px 14px; font-weight: 600; background: var(--ok-bg); color: var(--ok); }
.tax-badge.warn { background: var(--warn-bg); color: var(--warn); }
.tax-badge small { display: block; font-weight: 400; margin-top: 2px; }

.status { border-radius: var(--radius); padding: 14px 18px; margin: 12px 0 var(--gap); border: 1px solid var(--line); }
.status-ok { background: var(--ok-bg); }
.status-bad { background: var(--bad-bg); }
.status h2 { margin-bottom: 6px; }
.status ul { list-style: none; margin: 0; padding: 0; columns: 2 320px; font-size: .9rem; }
.status li { break-inside: avoid; padding: 2px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.status li.ok .dot { background: var(--ok); }
.status li.bad .dot { background: var(--bad); }
.status li.bad { color: var(--bad); }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.figure { min-width: 0; overflow-wrap: anywhere; }                /* text stays inside its box */
.figure-value .hint { display: block; font-size: .8rem; font-weight: 400; margin-top: 2px; white-space: normal; line-height: 1.35; }
.figure-label { color: var(--muted); font-size: .85rem; }
.figure-value { font-size: 1.35rem; font-weight: 700; text-align: left; }
.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.period label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }

.steps { padding-left: 20px; }
.steps li { margin-bottom: 18px; }
.qr { background: #fff; display: inline-block; padding: 6px; border-radius: 6px; margin: 8px 0; }
.key { font-size: 1rem; word-break: break-all; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font-size: 1.05rem; }
.temp-password code { font-size: 1.4rem; padding: 8px 12px; background: var(--bg); border-radius: 6px; display: inline-block; }
.recovery { margin-top: 16px; }
.recovery summary { cursor: pointer; color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.nowrap { white-space: nowrap; }
.plain { margin: 0; padding-left: 18px; }
.ok-text { color: var(--ok); font-weight: 700; }
.bad-text { color: var(--bad); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; }
.filters label { font-weight: 400; font-size: .85rem; }
/* A period or filter changed but not yet shown (nav.js) */
form.is-stale button.primary { animation: stale-pulse 1.6s ease-in-out infinite; }
@keyframes stale-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 95, 168, .45); } 50% { box-shadow: 0 0 0 6px rgba(31, 95, 168, 0); } }
.stale-note { color: var(--warn); font-size: .85rem; align-self: center; }
.stale-note:empty { display: none; }
.stale { opacity: .45; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { form.is-stale button.primary { animation: none; } }
@media print { .stale-note { display: none; } .stale { opacity: 1; } }
.grow { flex: 1 1 260px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; }
.narrow-form { max-width: 560px; }
.entry-head { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.entry-head label { flex: 0 1 200px; }
.entry-head label.grow { flex: 1 1 320px; }
.lines td { padding: 4px; }
.lines input { width: 100%; }
.lines .col-acct { width: 26%; min-width: 200px; }
.lines .col-amt { width: 14%; min-width: 110px; }
.lines .col-x { width: 32px; }
.lines tfoot th { text-transform: none; font-size: .9rem; color: var(--text); }
input.invalid { border-color: var(--bad); background: var(--bad-bg); }
button:disabled { opacity: .45; cursor: not-allowed; }
.form-submit { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.remove-line { font-size: 1.2rem; text-decoration: none; color: var(--muted); }

.crumb { margin: 0 0 4px; font-size: .88rem; }
.group-title { margin: 22px 0 10px; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--accent); }
.tile strong { color: var(--accent); }
.tile span { color: var(--muted); font-size: .85rem; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 0; }
legend { font-weight: 600; font-size: .92rem; padding: 0 4px; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; padding: 3px 0; }
label.check input { margin-top: 4px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.inline-label { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.center { text-align: center; }
input.amount { min-width: 100px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.report-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.report-card.muted { opacity: .6; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.two input { width: 100%; }
.report td { padding: 4px 8px; }
.report .r-heading td { background: var(--bg); font-weight: 700; padding-top: 10px; }
.report .r-subtotal td { font-weight: 700; border-top: 1px solid var(--muted); }
.report .r-total td { font-weight: 700; border-top: 1px solid var(--text); border-bottom: 3px double var(--text); }
.report .r-muted td { color: var(--muted); font-style: italic; }
.report .r-first td { border-top: 1px solid var(--line); }
.report .r-line td, .report .r-muted td { border-bottom: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 16px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.subnav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.rec { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px; border-radius: 6px; margin: 8px 0 14px; font-size: .9rem; }
.rec-ok { background: var(--ok-bg); }
.rec-bad { background: var(--bad-bg); color: var(--bad); }
.tile .rec { margin: 6px 0 0; }
.diff { border-collapse: collapse; font-size: .82rem; }
.diff th { text-align: left; color: var(--muted); font-weight: 600; padding: 1px 8px 1px 0; white-space: nowrap; vertical-align: top; }
.diff td { padding: 1px 6px 1px 0; vertical-align: top; word-break: break-word; }
.diff .old { color: var(--bad); text-decoration: line-through; }
.diff .new { color: var(--ok); }
textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9rem; }
.tax-working { background: var(--bg); border-radius: 6px; padding: 8px 12px; }
.tax-working summary { cursor: pointer; font-weight: 600; }
.tax-working .table td, .tax-working .table th { padding: 4px 6px; }
.upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.upload label { flex: 1 1 240px; min-width: 0; }
input[type=file] { padding: 6px; max-width: 100%; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .who { margin-left: 0; }
  .codes { grid-template-columns: 1fr; }
}

/* rights form */
.rights-table td.tick { width: 2.2rem; vertical-align: top; }
.rights-table input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
.rights-form .two { gap: 12px; }
@media print { body.no-print > * { display: none !important; } body.no-print::before { content: "Printing is not allowed for this user."; display: block; padding: 2rem; } }
.rights-table label { display: inline; margin: 0; }
.rights-table td { padding-top: 6px; padding-bottom: 6px; }

.slab-table td, .slab-table th { padding: 5px 8px; }
textarea.mono { white-space: pre; overflow-x: auto; }

/* dashboard charts: colours are the validated categorical slots 1 and 2 and the blue-red diverging pair (light, then dark) */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-pos: #2a78d6; --viz-neg: #e34948; --viz-grid: #e4e6ea; --viz-zero: #8b93a1; }
@media (prefers-color-scheme: dark) { :root { --viz-1: #3987e5; --viz-2: #d95926; --viz-pos: #3987e5; --viz-neg: #e66767; --viz-grid: #2d3542; --viz-zero: #6b7585; } }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.chart-card h2 { margin-bottom: 2px; }
.chart-card { margin-bottom: 0; }
.chart-takeaway { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }
.chart { width: 100%; height: auto; display: block; }
.chart-hair { stroke: var(--viz-grid); stroke-width: 1; }
.chart-zero { stroke: var(--viz-zero); stroke-width: 1; }
.chart-tick { fill: var(--muted); font-size: 11px; }
.chart-label { fill: var(--text); font-size: 12px; }
.chart-value { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.s1 { stroke: var(--viz-1); } .chart-line.s2 { stroke: var(--viz-2); }
.chart-area { stroke: none; opacity: .10; } .chart-area.s1 { fill: var(--viz-1); } .chart-area.s2 { fill: var(--viz-2); }
.chart-dot { stroke: var(--surface); stroke-width: 2; } .chart-dot.s1 { fill: var(--viz-1); } .chart-dot.s2 { fill: var(--viz-2); }
.chart-bar.pos { fill: var(--viz-pos); } .chart-bar.neg { fill: var(--viz-neg); }
.chart-hit { fill: transparent; stroke: none; }
.chart-hit:hover { fill: var(--viz-1); fill-opacity: .08; }
.chart-legend { display: flex; gap: 16px; list-style: none; margin: 0 0 6px; padding: 0; font-size: .88rem; }
.chart-legend .swatch { display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.swatch.s1 { background: var(--viz-1); } .swatch.s2 { background: var(--viz-2); }
.chart-table { margin-top: 8px; } .chart-table table { margin-top: 6px; }
@media print { .chart-grid { grid-template-columns: 1fr 1fr; } .chart-table { display: none; } }

/* phones and the installed app */
@media (max-width: 720px) {
  .topbar { padding: 8px 12px; gap: 6px 12px; }
  .nav { width: 100%; }
  .nav-menu { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
  .who-menu { margin-left: auto; }
  .page, .page-wide { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .heading-row { flex-wrap: wrap; gap: 8px; }
  .actions { flex-wrap: wrap; }
  input, select, textarea, button, .button { font-size: 16px; }
  button, .button, select, input:not([type=checkbox]):not([type=radio]) { min-height: 42px; }
}
.topbar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (display-mode: standalone) { .nav a:focus-visible { outline-offset: -2px; } }

.guessed input, .guessed select { border-color: #d9a400; }
.assistant-answer { font-size: 1.1rem; margin: 0; }
.examples { padding-left: 1.1rem; margin: 0 0 8px; } .examples li { margin: 4px 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; border-bottom: 1px solid var(--line, #d0d4da); }
.tabs a { padding: 8px 14px; text-decoration: none; border-radius: 6px 6px 0 0; }
.tabs a[aria-current='page'] { font-weight: 600; border: 1px solid var(--line, #d0d4da); border-bottom-color: var(--bg, #fff); margin-bottom: -1px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
 dl.facts dt { font-weight: 600; } dl.facts dd { margin: 0; }

/* the top bar stays in view while the page scrolls */
.topbar { position: sticky; top: 0; z-index: 100; }
@media print { .topbar { position: static; } }

/* How to Use this App */
.guide-toc ol { columns: 2; column-gap: 32px; margin: 8px 0 0; padding-left: 20px; }
.guide-toc li { margin: 3px 0; break-inside: avoid; }
section[id] { scroll-margin-top: 72px; }
@media (max-width: 640px) { .guide-toc ol { columns: 1; } }

/* Annual tax return laid out like IRIS */
.tabs-app { align-items: center; font-size: .92rem; }
.tab-rows > .tabs + .tabs { margin-top: -12px; }        /* two rows of tabs: the second (the open one) sits on the first */
.tabs-app .hint { padding: 0 6px 0 2px; }
/* Tax returns: the row that copies IRIS is green, the app's own row keeps the link blue; each row is labelled */
.tabs-iris { align-items: center; }
.tabs-iris a { color: var(--iris); }
.tabs-iris .tabs-label, .tabs-app .tabs-label { padding: 0 6px 0 2px; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tabs-iris .tabs-label { color: var(--iris); }
.tabs-app .tabs-label { color: var(--accent); }
.iris-layout { display: grid; grid-template-columns: minmax(200px, 250px) 1fr; gap: 16px; align-items: start; }
.iris-menu { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.iris-menu .group { font-weight: 600; margin-top: 8px; color: var(--muted); }
.iris-menu a { padding: 4px 8px; border-radius: 4px; text-decoration: none; }
.iris-menu a:hover { background: var(--bg); }
.iris-code { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.iris-src { font-size: .8rem; color: var(--muted); }
.table tr.heading td { font-weight: 600; }
@media (max-width: 760px) { .iris-layout { grid-template-columns: 1fr; } .iris-menu { position: static; } }

.pay-table input.num { width: 9rem; }
.pay-table td:first-child { white-space: nowrap; }

/* search across the app */
.site-search { margin-left: auto; display: flex; align-items: center; }
@media (max-width: 720px) { .site-search { width: 100%; margin-left: 0; } .search-box { flex: 1; } .search-box input { width: 100%; } }
.search-hits { list-style: none; padding: 0; margin: 0; }
.search-hits li { padding: 8px 0; border-bottom: 1px solid var(--line, #d0d4da); }
.search-hits li:last-child { border-bottom: 0; }
.search-snip { color: var(--muted); font-size: .92rem; }
mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
::target-text { background: #ffe58a; }

/* How to Use on paper: everyone may print it; no top bar or buttons, each section on a new page, a wide right margin for notes */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 15mm 35mm 15mm 15mm; }
  body.guide-page { background: #fff; color: #000; font-size: 10.5pt; }
  body.guide-page .topbar, body.guide-page .flash, body.guide-page .no-print-btn, body.guide-page .site-search { display: none !important; }
  body.guide-page .print-only { display: block; }
  body.guide-page .print-head { font-size: 9pt; border-bottom: 1px solid #000; padding-bottom: 4px; margin-bottom: 8px; }
  body.guide-page .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 6mm; background: #fff; }
  body.guide-page section.card[id] { break-before: page; }
  body.guide-page section#start { break-before: auto; }
  body.guide-page h2, body.guide-page h3 { break-after: avoid; color: #000; }
  body.guide-page tr, body.guide-page li { break-inside: avoid; }
  body.guide-page table { border-collapse: collapse; width: 100%; }
  body.guide-page th, body.guide-page td { border: 1px solid #999; padding: 3px 5px; vertical-align: top; }
  body.guide-page a { color: #000; text-decoration: none; }
  body.guide-page .guide-toc ol { columns: 2; }
}

/* IRIS-like tables with many columns (Annual Tax Return > Depreciation, Sales Tax annexes): the whole screen, headings wrap, no sideways scroll */
.wide-table .table th { white-space: normal; font-size: .74rem; line-height: 1.25; vertical-align: bottom; }
.wide-table .table td { font-size: .92rem; }
.wide-table .table td.num { white-space: nowrap; }
.wide-table .table-wrap { overflow-x: visible; }
@media (max-width: 1100px) { .wide-table .table-wrap { overflow-x: auto; } }

.inline-code { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 0 0; }
.inline-code input { width: 7.5rem; letter-spacing: .15em; }

@media print { .topbar .nav, .topbar .site-search, .topbar .who-menu { display: none; } }
@media (max-width: 1500px) { .topbar .brand-sub { display: none; } }

/* Upload Bank Statements > To decide: one line, one question at a time */
.decide-line { display: flex; flex-direction: column; gap: 12px; }
.decide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.decide-amt { padding: 4px 10px; border-radius: 999px; font-size: .95rem; }
.decide-amt.out { background: #fdecea; color: #8a1c12; }
.decide-amt.in { background: #e6f4ea; color: #14532d; }
.decide-text { margin: 0; color: var(--muted, #555); font-size: .92rem; overflow-wrap: anywhere; }
.decide-what { display: flex; flex-direction: column; gap: 6px; max-width: 32rem; }
.decide-what select { font-weight: 600; }
.dlabel { font-weight: 600; }
.dstep { margin: 0 0 6px; font-weight: 600; }
.decide-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px 16px; }
.dfield { display: flex; flex-direction: column; gap: 4px; }
.dtag { font-size: .75rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.dtag.need { background: #fff1d6; color: #7a4b00; }
.dtag.opt { background: #eef0f3; color: #555; }
.decide-line.js .dtag:empty { display: none; }
.decide-line.js:not(.chosen) .decide-more, .decide-line.js:not(.chosen) .actions { display: none; }
@media (prefers-color-scheme: dark) {
  .decide-amt.out { background: #4a1d18; color: #ffd7d1; }
  .decide-amt.in { background: #163824; color: #c9f2d6; }
  .dtag.need { background: #4a3510; color: #ffe2a8; }
  .dtag.opt { background: #2b2f36; color: #c8ccd2; }
}
.decide-line [hidden] { display: none !important; }

/* Dashboard: the integrity checks fold into one line while they all pass */
.checks-ok { margin: 0 0 16px; padding: 8px 14px; border-radius: 8px; background: var(--ok-bg); }
.checks-ok summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
.checks-ok ul { list-style: none; padding: 0; columns: 2 22rem; margin: 8px 0 4px; }
.checks-ok li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.checks-ok .dot { background: var(--ok); }

/* Admin > Settings: grouped cards flowing in columns, no gaps (Director, 19 Nov 2026) */
.settings-grid { columns: 3 320px; column-gap: var(--gap); margin-bottom: var(--gap); }
.settings-card { break-inside: avoid; display: flex; flex-direction: column; gap: 12px; margin: 0 0 var(--gap); min-width: 0; }
.settings-card h2 { margin: 0; font-size: 1.1rem; }
.settings-card .settings-note { margin: -8px 0 0; }
.setting { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 600; }
.setting input { font-weight: 400; }
.setting .hint { font-weight: 400; font-size: .82rem; line-height: 1.35; }

/* The second row of tabs (Admin, tax returns) stays in view under the top bar (Director, 19 Nov 2026) */
.subnav, .tabs { position: sticky; top: var(--topbar-h, 72px); z-index: 90; background: var(--bg); padding-top: 6px; }
.tab-rows { position: sticky; top: var(--topbar-h, 72px); z-index: 90; background: var(--bg); }
.tab-rows > .tabs { position: static; }
@media print { .subnav, .tabs, .tab-rows { position: static; } }

/* Reports: the title, PDF / Excel / CSV and the dates stay put; only the figures scroll, under their column headings (Director, 20 Nov 2026) */
.report-top { position: sticky; top: var(--topbar-h, 72px); z-index: 80; background: var(--bg); padding-top: 6px; }
.report-top .filters { margin-bottom: 10px; }
.report-top .check { display: flex; align-items: center; gap: 6px; align-self: center; }
.report-top .check-stack { display: flex; flex-direction: column; gap: 6px; align-self: center; }
.report-top .check-stack .check { align-self: flex-start; }
@media (min-width: 901px) {
  .report-body.table-wrap { overflow-x: visible; }
  .report-body thead th { position: sticky; top: calc(var(--topbar-h, 72px) + var(--report-top-h, 0px)); z-index: 5;
                           background: var(--surface, #fff); box-shadow: inset 0 -1px 0 var(--line, #d0d7e2); }
}
@media (max-width: 900px) { .report-top { position: static; } }
@media (min-width: 901px) { table.fixed-cols { table-layout: fixed; width: 100%; } table.fixed-cols td { overflow-wrap: break-word; } }
@media print { .report-top { position: static; } .report-body thead th { position: static; box-shadow: none; } }

/* Project budget lines: payment status (Director, 19 Nov 2026) */
.pay-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pay-planned { background: #e8eefc; color: #1d3f8f; }
.pay-paid { background: #e6f4ea; color: #14532d; }
.pay-part { background: #fff1d6; color: #7a4b00; }
.pay-overdue, .pay-part-overdue { background: #fdecea; color: #8a1c12; }
@media (prefers-color-scheme: dark) {
  .pay-planned { background: #1d2c4f; color: #cddbff; } .pay-paid { background: #163824; color: #c9f2d6; }
  .pay-part { background: #4a3510; color: #ffe2a8; } .pay-overdue, .pay-part-overdue { background: #4a1d18; color: #ffd7d1; }
}

/* Arriving from Funds to arrange: the row is highlighted and its change form opened (Director, 19 Nov 2026) */
tr[id]:target { background: #fff6d6; outline: 2px solid #e0b100; }
tr[id] { scroll-margin-top: calc(var(--topbar-h, 72px) + 60px); }
.month-pays { margin-top: 6px; }
.month-pays .table td { padding: 4px 8px; }
.month-pays tr.pay-first td { font-weight: 600; }

/* Project budget lines: the description gets the room; the status and its payments wrap in a narrower column (Director, 19 Nov 2026) */
.budget-lines th.bl-desc { width: 38%; min-width: 280px; }
.budget-lines .bl-status { width: 22%; min-width: 200px; white-space: normal; }
.budget-lines .bl-status .hint { display: inline-block; }

/* What-if notice on the project budget (Director, 19 Nov 2026) */
.status-warn { background: #fff6d6; border-color: #e0b100; }
.status-warn p { margin: 0; }

/* Project cost lists: entry numbers, categories and amounts on one line; the description takes the room; buttons side by side (Director, 19 Nov 2026) */
.table th.wide { width: 60%; }
.row-actions { white-space: nowrap; width: 190px; min-width: 190px; text-align: center; }
.table th.row-actions-h { text-align: center; width: 190px; }
.row-actions .link-button, .row-actions summary { text-align: center; }
.row-actions form, .row-actions details { display: block; margin: 0 0 4px; }
.row-actions details[open] { white-space: normal; min-width: 260px; }
.row-actions form { text-align: center; }
.row-actions form button { display: inline-block; margin: 0 auto; }
.row-actions details[open] form { text-align: left; }

/* Print one table or the whole page (print.js, Director 19 Nov 2026) */
.pr-btn { margin-left: 10px; font-size: .78rem; padding: 2px 10px; vertical-align: middle; font-weight: 400; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .topbar, .subnav, .flash, .crumb { display: none !important; }
  main.printable { padding: 0; max-width: none; }
  main.printable .pr-btn, main.printable form, main.printable details, main.printable button, main.printable .heading-row .actions,
  main.printable .row-actions, main.printable th.row-actions-h { display: none !important; }
  main.printable form.print-keep { display: flex !important; }
  main.printable form.print-keep input, main.printable form.print-keep select, main.printable form.print-keep textarea {
    border: 0; background: none; padding: 0; appearance: none; -webkit-appearance: none; font-weight: 400; min-height: 0; resize: none; }
  main.printable form.print-keep input:placeholder-shown { visibility: hidden; }
  main.printable form.print-keep .hint { display: none; }
  main.printable .print-only { display: block; }
  main.printable .print-head { font-size: 9pt; border-bottom: 1px solid #000; padding-bottom: 4px; margin-bottom: 8px; }
  main.printable .card { box-shadow: none; border: 0; padding: 0; margin: 0 0 6mm; background: #fff; }
  main.printable h1 { font-size: 15pt; } main.printable h2 { font-size: 12pt; break-after: avoid; } main.printable h3 { font-size: 11pt; break-after: avoid; }
  main.printable table { border-collapse: collapse; width: 100%; font-size: 8.5pt; }
  main.printable th, main.printable td { border-bottom: 1px solid #bbb; padding: 3px 5px; }
  main.printable tr { break-inside: avoid; }
  /* paper has no scroll bar: the table fits the page, and notes, badges and links inside it print at the table's size */
  main.printable .table-wrap { overflow: visible !important; max-height: none !important; }
  main.printable td .hint, main.printable td .badge, main.printable td a, main.printable td small { font-size: inherit; }
  main.printable td .badge { border: 0; padding: 0; background: none; color: inherit; }
  main.printable th { letter-spacing: 0; white-space: normal; }
  main.printable a { color: #000; text-decoration: none; }
  main.printable .figures { gap: 6px; }
  body.printing-one .pr-path > *:not(.pr-path):not(.pr-on) { display: none !important; }
}

/* Edit a supplier in the Parties card: "edit" sits beside "remove"; the form opens below the line */
details.inline-edit { display: inline; margin-left: 6px; }
details.inline-edit[open] { display: block; margin: 6px 0 10px; }

.table td.indent { padding-left: 28px; }

/* An edit form from a table cell, opened in its own full-width row under the line (nav.js) */
tr.edit-row > td { background: var(--bg); border-top: 0; padding: 12px 16px 16px; }
.edit-box { max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.edit-box form { margin: 0; }
.edit-box .edit-close { align-self: flex-start; }
@media print { tr.edit-row { display: none; } }

/* Information vs changes (Director, 19 Nov 2026): the forms that post to the books or change the project sit in an amber frame; every
   add / edit control inside an information pane carries the same amber cue. */
:root { --edit-bg: #fff8e6; --edit-line: #d99a00; }
@media (prefers-color-scheme: dark) { :root { --edit-bg: #2a2312; --edit-line: #c08a12; } }
.zone-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 10px; padding: 8px 12px;
  border-radius: var(--radius); font-size: 1.02rem; }
.zone-info { background: var(--info-bg); border-left: 4px solid var(--accent); }
.zone-change { margin-top: 28px; padding: 4px 14px 2px; border: 2px solid var(--edit-line); border-radius: calc(var(--radius) + 4px);
  background: var(--edit-bg); }
.zone-change .zone-head { padding-left: 0; }
.zone-change .card { border-color: var(--edit-line); }
.card details.recovery { border-left: 3px solid var(--edit-line); background: var(--edit-bg); border-radius: var(--radius); padding: 6px 12px; }
.card details.recovery > summary, .card td details > summary.link-button, details.inline-edit > summary { color: var(--warn); }
.card details.recovery > summary::before, .card td details > summary.link-button::before, details.inline-edit > summary::before { content: "✎ "; }
tr.edit-row > td { background: var(--edit-bg); border-left: 3px solid var(--edit-line); }
details.inline-edit, details.inline-edit > summary { display: inline; }
#suppliers form.inline { display: inline; margin-left: 4px; }
@media print { .zone-head { display: none; } .zone-change { border: 0; background: none; padding: 0; } }

/* Hide or show a pane (collapse.js) */
.pane-toggle { margin-left: 10px; font-size: .78rem; padding: 2px 10px; vertical-align: middle; font-weight: 400; }
@media screen { .card.collapsed > *:not(h2) { display: none !important; } .card.collapsed { padding-bottom: 8px; } .card.collapsed > h2 { margin-bottom: 0; } }
@media print { .pane-toggle { display: none; } }
.zone-change .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.zone-change .grid-2 > :nth-child(3) { grid-column: 1 / -1; }
@media (max-width: 900px) { .zone-change .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Dashboard To do: red now or within a week, amber within a month, blue later (Director, 19 Nov 2026) */
.status.todo { background: var(--surface); }
.status li.todo-urgent .dot, .lvl-urgent { background: var(--bad); }
.status li.todo-soon .dot, .lvl-soon { background: var(--edit-line); }
.status li.todo-later .dot, .lvl-later { background: var(--accent); }
.status li.todo-urgent a { color: var(--bad); }
.status li.todo-soon a { color: var(--warn); }
.status li.todo-later a { color: var(--accent); }
.lvl { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
details:not([open]) .when-open, details[open] .when-closed { display: none; }

/* A form laid out across its pane (Record a commission agreement, ...) - Director, 20 Nov 2026 */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-items: end; margin-top: 10px; }
.form-grid label { margin: 0; }
.form-grid .wide { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-grid output.calc { display: block; padding: 9px 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 900px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .wide { grid-column: auto; } }
.form-grid [hidden] { display: none !important; }

.form-grid .calc-line { padding: 9px 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.form-grid label.check { align-self: center; }

/* SECP: what would change if... */
.notes-list dt { font-weight: 600; margin-top: .7rem; }
.notes-list dd { margin: .2rem 0 0 0; }

/* Dashboard: hide or show each figure (eye button; remembered on this device) */
.figure-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.figure .eye { background: none; border: 0; padding: 2px; margin: -2px -2px 0 0; color: var(--muted, #6b7280); cursor: pointer; border-radius: 6px; line-height: 0; }
.figure .eye:hover, .figure .eye:focus-visible { color: var(--accent); background: rgba(0,0,0,.05); }
.figure .eye .eye-shut, .figure.is-hidden .eye .eye-open { display: none; }
.figure.is-hidden .eye .eye-shut { display: inline; }
.figure .amt-mask { display: none; letter-spacing: 2px; }
.figure.is-hidden .amt { display: none; }
.figure.is-hidden .amt-mask { display: inline; }
@media print { .figure .eye { display: none; } }

/* Data tab of the tax return: every table on the page uses the same columns, so codes, amounts and sources line up (Director, 21 Nov 2026) */
.iris-lines { table-layout: fixed; width: 100%; }
.iris-lines col.c-code { width: 6.5rem; }
.iris-lines col.c-desc { width: 38%; }
.iris-lines col.c-amt { width: 10rem; }
.iris-lines col.c-desc-gross { width: 24%; }
.iris-lines col.c-gross { width: 14%; }      /* description + receipts = 38%: the amount column still lines up */
.iris-lines td, .iris-lines th { overflow-wrap: anywhere; }
@media (max-width: 700px) { .iris-lines { table-layout: auto; } }
/* Murabaha participations: money columns evenly wide and never wrapped; the participant keeps room for the name and notes.
   Flexible widths, so it fits any screen and an A4 page (the Action column is left off the paper). */
.murabaha-table { width: 100%; }
.murabaha-table th:first-child, .murabaha-table td:first-child { min-width: 14rem; }
.murabaha-table td.num, .murabaha-table th.num { white-space: nowrap; width: 8.5rem; padding-left: 1rem; }
.murabaha-table td:nth-child(2), .murabaha-table td:nth-child(6), .murabaha-table td:nth-child(7) { white-space: nowrap; }
.murabaha-table td:nth-child(6), .murabaha-table th:nth-child(6) { padding-left: 1.5rem; }   /* a gap between Price and Due */
@media print {
  .murabaha-table th:first-child, .murabaha-table td:first-child { min-width: 0; width: 26%; }
  .murabaha-table td.num, .murabaha-table th.num { width: auto; padding-left: 6px; }
  .murabaha-table td:nth-child(6), .murabaha-table th:nth-child(6) { padding-left: 8px; }
}

/* Tax returns: the title, year / period and both rows of tabs stay under the top bar while scrolling (Director, 21 Nov 2026) */
.return-head .tabs, .return-head .tab-rows { position: static; }
.return-head .tabs:last-child, .return-head .tab-rows:last-child { margin-bottom: 8px; }
.return-head + * { margin-top: 8px; }
.report-top ~ * .iris-menu, .report-top ~ .iris-layout .iris-menu { top: calc(var(--topbar-h, 72px) + var(--report-top-h, 0px) + 8px);
  max-height: calc(100vh - var(--topbar-h, 72px) - var(--report-top-h, 0px) - 16px); overflow-y: auto; }   /* the section list scrolls in what room is left */
.report-top ~ * section[id], .report-top ~ section[id] { scroll-margin-top: calc(var(--topbar-h, 72px) + var(--report-top-h, 0px) + 8px); }
@media (max-height: 560px) { .return-head { position: static; } }   /* a short screen keeps its room for the figures */

/* Phones (21 Nov 2026): small text links and toggles get a finger-sized tap area. */
@media (max-width: 720px) {
  main details > summary, main details > summary.link-button { padding-top: 9px; padding-bottom: 9px; }
  main button.link-button { padding-top: 9px; padding-bottom: 9px; }
}

/* Phones: one Menu button instead of five rows of menus (Director, 21 Nov 2026). The bar is one row (logo, Menu, your initials) and stays
   at the top; Menu opens a panel with the search box and the menus, each opening in place, and scrolls if it is taller than the screen.
   Computers keep the menu bar as it is: the drawer wrapper takes no space there and the button is hidden. */
.menu-toggle { display: none; }
.nav-drawer { display: contents; }
@media print { .menu-toggle { display: none !important; } }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; column-gap: 8px; }
  .topbar .brand { order: 0; flex: 1 1 0; min-width: 0; }
  .topbar .brand-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .menu-toggle { order: 1; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 6px 10px;
    background: rgba(255,255,255,.12); color: var(--brand-text); border: 1px solid rgba(255,255,255,.35); border-radius: 8px; font-size: 15px; font-weight: 600; }
  .menu-toggle .ic { width: 20px; height: 20px; }
  .menu-toggle .ic:nth-of-type(2), .topbar.nav-open .menu-toggle .ic:nth-of-type(1) { display: none; }
  .topbar.nav-open .menu-toggle .ic:nth-of-type(2) { display: block; }
  .topbar .who-menu { order: 2; margin-left: 0; }
  .nav-drawer { display: none; order: 3; width: 100%; max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); overflow-y: auto;
    overscroll-behavior: contain; padding: 4px 0 10px; }
  .topbar.nav-open .nav-drawer { display: flex; flex-direction: column; gap: 8px; }
  .nav-drawer .site-search { order: -1; width: 100%; }
  .nav-drawer .nav { flex-direction: column; align-items: stretch; width: 100%; }
  .nav-drawer .nav-top, .nav-drawer .nav-group > summary { padding: 11px 10px; font-size: 1rem; }
  .nav-drawer .nav-group > summary .ic:last-child { margin-left: auto; }
  .nav-drawer .nav-menu { position: static; margin: 2px 0 8px; box-shadow: none; min-width: 0; }
}

/* Actions on a card (Employees and pay, Loans and facilities, Term deposits, Provincial taxes - Director, 23 Nov 2026): the links sit in a row;
   an open one takes the card's full width and its fields sit side by side, several to a row, instead of one narrow column. */
.card-actions { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: flex-start; margin: 10px 0 4px; }
.card-actions > details[open] { flex: 1 0 100%; order: 10; border-top: 1px solid var(--line); padding-top: 8px; }
.card-actions form.stack, .card-actions form.narrow-form { max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px 18px; align-items: end; margin-top: 8px; }
.card-actions form .two { display: contents; }
.card-actions form > p, .card-actions form > h4, .card-actions form > .full, .card-actions form > .children-rows, .card-actions form > label.wide { grid-column: 1 / -1; }
.card-actions form > button { justify-self: start; grid-column: 1 / -1; }
.card-actions form label { margin: 0; }
.children-rows { display: grid; gap: 8px; }
.child-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; align-items: end; }
.child-row label { margin: 0; }
.card-actions form label.span2 { grid-column: span 2; }

/* Employees > Address, phone and family (Director, 23 Nov 2026): five columns - address, mobile, landline, the relative's name; then marital
   status and number of children on the left, the relative's relation and number under the relative's name; on a narrow screen two columns. */
.card-actions form.family-form { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card-actions form.family-form .f-c1 { grid-column: 1; }
.card-actions form.family-form .f-c2 { grid-column: 2; }
.card-actions form.family-form .f-c4 { grid-column: 4; }
.card-actions form.family-form .f-c5 { grid-column: 5; }
@media (max-width: 1100px) {
  .card-actions form.family-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-actions form.family-form .f-c1, .card-actions form.family-form .f-c2, .card-actions form.family-form .f-c4,
  .card-actions form.family-form .f-c5 { grid-column: auto; }
}

/* Dashboard figures coloured by what the money is (Director, 23 Nov 2026): uses the app's ok / warn / bad colours, which have their own
   dark-mode shades; the hint under a figure keeps its own muted colour. */
.figure-value.tone-good .amt { color: var(--ok); }
.figure-value.tone-held .amt { color: var(--warn); }
.figure-value.tone-owed .amt { color: var(--bad); }

/* orange: money committed to delivering a contract - project costs held, bank guarantees, LC margins (Director, 23 Nov 2026) */
:root { --committed: #d97706; }
@media (prefers-color-scheme: dark) { :root { --committed: #fbbf24; } }
.figure-value.tone-committed .amt { color: var(--committed); }

/* Dashboard panes hidden or shown by the arrow before their heading (collapse.js) */
.pane-arrow { background: none; border: 0; padding: 0 8px 0 0; margin: 0; min-height: 0; font-size: .85em; color: var(--accent); cursor: pointer; }
.pane-arrow:hover { color: var(--accent-hover); }
@media screen { [data-pane].pane-hidden > *:not(h2) { display: none !important; } [data-pane].pane-hidden > h2 { margin-bottom: 0; } }
.chart-grid > [data-pane].pane-hidden { align-self: start; }

/* the top of each page stays in view under the top bar (nav.js; Director, 23 Nov 2026) */
@media (min-width: 901px) {
  .page-top { position: sticky; top: var(--topbar-h, 72px); z-index: 85; background: var(--bg); padding-top: 8px; margin-top: -8px; }
  .page-top.stuck { box-shadow: 0 6px 6px -6px rgba(0, 0, 0, .25); }
  .page-top > .heading-row, .page-top > h1 { padding-bottom: 6px; }
  .page-top > :last-child { margin-bottom: 10px; }
  .page-top .tabs, .page-top .subnav, .page-top .tab-rows { position: static; }
  .subnav, .tabs, .tab-rows { top: calc(var(--topbar-h, 72px) + var(--page-top-h, 0px)); }
  section[id], tr[id], [id].card { scroll-margin-top: calc(var(--topbar-h, 72px) + var(--page-top-h, 0px) + 8px); }
}
@media print { .page-top { position: static; box-shadow: none; } }

/* My notes (Director, 23 Nov 2026) */
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 4px; }
.note h2 { margin-bottom: 2px; }
code.revealed { font-size: 1rem; background: var(--warn-bg); padding: 2px 6px; border-radius: 4px; user-select: all; }
form.inline-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
form.inline-code input { width: 7.5em; }

/* Where SPURTEK is heading: the forecast pane at the top of the Dashboard (Director, 24 Nov 2026) */
.ahead { border-left: 4px solid var(--ok); }
.ahead .figures { margin-bottom: 8px; }
.ahead .figure { background: var(--ok-bg); }

/* paisa (the two digits after the decimal point) smaller on screen (amounts.js; Director, 24 Nov 2026) */
.paisa { font-size: .72em; opacity: .85; }
.figure-value .paisa { font-size: .62em; }

/* signature preview on the Account page (CSP blocks inline styles; Director, 24 Nov 2026) */
.sig-preview { max-height: 72px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }

/* Quotation generator: the line-items grid and read-only fields (Director, 25 Nov 2026) */
input.readonly, input[readonly] { background: var(--surface); color: var(--muted); border-style: dashed; }
.qitems { table-layout: fixed; width: 100%; }
.qitems th { font-size: .82em; }
.qitems td { padding: 3px 4px; }
.qitems td input { width: 100%; box-sizing: border-box; padding: 6px 7px; min-height: 36px; }
.qitems .c-sno { width: 4%; } .qitems .c-it { width: 6%; } .qitems .c-part { width: 15%; }
.qitems .c-desc { width: 28%; } .qitems .c-oem { width: 15%; } .qitems .c-qty { width: 6%; }
.qitems .c-unit { width: 6%; } .qitems .c-rate { width: 10%; } .qitems .c-gst { width: 6%; }
@media (max-width: 760px) { .qitems, .qitems thead, .qitems tbody, .qitems tr, .qitems td { display: block; width: auto; }
  .qitems thead { display: none; } .qitems tr { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; padding: 6px; }
  .qitems td { padding: 3px 0; } }
