.workspace { margin-left: 236px; min-height: 100vh; }
.workspace.signed-out { margin-left: 0; }
.preview-banner { padding: 12px 16px; border: 1px solid var(--input-border); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: .85rem; }
.document-list { display: grid; gap: 12px; }
.email-copy { white-space: pre-wrap; font: inherit; color: var(--ink); }
.report-total { font-size: 1.3rem; font-weight: 700; }
.inline-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.record-details { display: grid; grid-template-columns: minmax(90px, 140px) 1fr; gap: 8px 20px; margin: 24px 0; }
.record-details dd { margin: 0; overflow-wrap: anywhere; }
.mobile-menu { display: none; }
.aging-list progress { display: block; width: 100%; height: 4px; grid-column: 1 / -1; border: 0; accent-color: var(--orange); }
.aging-list progress::-webkit-progress-bar { background: var(--line); }
.aging-list progress::-webkit-progress-value { background: var(--orange); }
@media(max-width: 760px) { .workspace { margin-left: 0; } .mobile-menu { display: block; } .sidebar { visibility: hidden; } body.nav-open .sidebar { visibility: visible; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); } }
.mail-preview { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
[data-page="claim-workflow"] input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; accent-color: var(--orange); margin-right: .5rem; }
[data-page="claim-workflow"] label:has(input[type="checkbox"]), [data-page="claim-workflow"] p:has(> input[type="checkbox"]) { display: flex; align-items: start; gap: .5rem; }
[data-page="invoice-draft"] input[type="checkbox"] {width:auto;min-height:0;margin-inline:.4rem;vertical-align:middle;}
[data-page="invoice-draft"] .invoice-description {white-space:normal;min-width:18rem;}
[data-page="invoice-draft"] form.stack {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;}
[data-page="invoice-draft"] form.stack > p {margin:0;}
[data-page="invoice-draft"] form.stack > p:has(textarea), [data-page="invoice-draft"] form.stack > p:has(input[type="checkbox"]), [data-page="invoice-draft"] form.stack > button, [data-page="invoice-draft"] form.stack > .errorlist {grid-column:1 / -1;}
@media(max-width:760px) {[data-page="invoice-draft"] form.stack {grid-template-columns:1fr;}}
body[data-page="invoice-finalize"] input[type="checkbox"] { width: auto; display: inline-block; margin-right: .5rem; }
body[data-page="invoice-finalize"] .approval-confirm { display: flex; align-items: flex-start; gap: .5rem; margin: 1rem 0; }
.director-form { margin: 1rem 0; padding-top: .75rem; border-top: 1px solid var(--line, rgba(127,127,127,.25)); display: grid; gap: .5rem; justify-items: start; }
.director-form .approval-confirm { display: flex; flex-direction: row; align-items: flex-start; gap: .5rem; text-align: left; font-weight: 500; }
.director-form .approval-confirm input[type="checkbox"] { width: auto; min-width: 0; flex: none; margin: .2rem 0 0; }
.director-form label:not(.approval-confirm) { width: 100%; max-width: 14rem; }
body[data-page="invoice-finalize"] .evidence-digest { overflow-wrap: anywhere; }
/* C6 invoice support controls */
.support-actions { white-space: nowrap; text-align: right; }
.support-actions form { display: inline-block; margin: 0 0 0 6px; }
.support-upload { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 16px; }
.support-upload label { flex: 1 1 260px; }
@media (max-width: 640px) {
  .support-actions { white-space: normal; }
  .support-actions form { margin: 4px 0 0 4px; }
}
/* C8 email approval */
#email label.check { display: flex; align-items: center; gap: 8px; }
#email label.check input { width: auto; flex: 0 0 auto; margin: 0; }

/* ZB-23 — dashboard concept v2 and style fixes (Zest palette, Light and Dark). */
/* S1 grouped sidebar: lighter items, small labels, one accent dot for the current page. */
.sidebar nav { gap: 0; }
.nav-group { display: grid; gap: 1px; }
.nav-group + .nav-group { margin-top: 6px; }
.sidebar .nav-label { padding: 14px 12px 4px; font-size: .62rem; }
.sidebar nav a { padding: 7px 12px 7px 24px; font-size: .86rem; position: relative; color: var(--sidebar-muted); }
.sidebar nav a:hover { color: var(--sidebar-text); }
.sidebar nav a.active { box-shadow: none; color: var(--on-charcoal); font-weight: 600; }
.sidebar nav a.active::before { content: ""; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--orange); }

/* Header */
.overview-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.overview-head h1 { font-size: 1.35rem; margin: 0; letter-spacing: -.02em; }
.meta { color: var(--muted); font-size: .74rem; margin: 3px 0 0; }
.overview-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--surface); }
.segmented a { padding: 5px 12px; border-radius: 7px; font-size: .8rem; color: var(--muted); text-decoration: none; }
.segmented a.active { background: var(--charcoal); color: var(--on-charcoal); }

/* Headline cards: no decorative circles. */
.kpi.v2::after { display: none; }
.kpi.v2 { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 12px; }
.kpi.v2 .label { font-size: .74rem; font-weight: 650; color: var(--muted); }
.kpi.v2 .label small { display: inline; font-weight: 400; margin-left: 4px; }
.kpi.v2 strong { margin: 2px 0 0; font-size: 1.3rem; }
.kpi.v2 strong.secondary { font-size: .95rem; margin: 0; color: var(--muted); }
.kpi.v2 strong.negative, .negative { color: var(--red); }
.delta { font-size: .74rem; font-weight: 650; color: var(--muted); }
.delta small { display: inline; font-weight: 400; color: var(--muted); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.sparkline { width: 100%; height: 30px; margin-top: 6px; display: block; }
.sparkline polyline { stroke: var(--orange); }

/* Panels */
.dashboard-grid.v2 h2, .infographic-grid.v2 h2, .panel .panel-head h2 { font-size: 1rem; margin: 0 0 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend i.revenue { background: var(--orange); }
.legend i.expenses { background: var(--chart-expenses); }
.legend i.forecast { background: var(--chart-revenue-forecast); }

/* Ageing: stacked bar plus legend list (SVG, tones 1-5 from current to over 90). */
.stacked-bar { display: block; width: 100%; height: 10px; margin: 14px 0 12px; border-radius: 5px; overflow: hidden; }
.stacked-bar rect, .stacked-bar.empty rect { fill: var(--line); }
.tone-1 { fill: var(--orange); background: var(--orange); }
.tone-2 { fill: var(--chart-revenue-forecast); background: var(--chart-revenue-forecast); }
.tone-3 { fill: var(--amber); background: var(--amber); }
.tone-4 { fill: #c87533; background: #c87533; }
.tone-5 { fill: var(--red); background: var(--red); }
.stacked-bar rect.tone-1 { fill: var(--orange); } .stacked-bar rect.tone-2 { fill: var(--chart-revenue-forecast); }
.stacked-bar rect.tone-3 { fill: var(--amber); } .stacked-bar rect.tone-4 { fill: #c87533; } .stacked-bar rect.tone-5 { fill: var(--red); }
.aging-legend, .checks, .ranked { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.aging-legend li, .checks li { display: grid; grid-template-columns: 14px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--row-line); font-size: .84rem; }
.aging-legend li:last-child, .checks li:last-child { border-bottom: 0; }
.aging-legend i { width: 9px; height: 9px; border-radius: 3px; display: block; }

/* Checks: coloured status dots. */
.dot { width: 9px; height: 9px; border-radius: 50%; display: block; background: var(--line); }
.dot.good { background: var(--green); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--red); }
.checks strong { font-variant-numeric: tabular-nums; }

/* Splits as ranked bars. */
.ranked li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 8px; padding: 6px 0; font-size: .84rem; }
.ranked li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-bar { grid-column: 1 / -1; width: 100%; height: 6px; display: block; }
.share-bar .track { fill: var(--line); } .share-bar .fill { fill: var(--orange); }
table.compact th, table.compact td { padding: 6px 8px; font-size: .84rem; }

/* S8 status pills. */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; line-height: 1.5; white-space: nowrap; background: var(--grey-soft); color: var(--muted); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-orange { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-muted { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* S9: grid columns never overflow the content area; S7: 2x2 cards on phones. */
.dashboard-grid.v2 { grid-template-columns: minmax(0, 1.65fr) minmax(0, .85fr); }
.dashboard-grid.v2 > *, .infographic-grid.v2 > *, .kpi-grid.v2 > * { min-width: 0; }
@media (max-width: 1050px) { .dashboard-grid.v2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .kpi-grid.v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi.v2 { padding: 12px; }
  .kpi.v2 strong { font-size: 1rem; }
  .kpi.v2 .delta small { display: none; }
  .overview-head { align-items: flex-start; }
}
@media (max-width: 430px) { .kpi-grid.v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dashboard-grid.v2 .panel-head, .infographic-grid.v2 .panel-head { align-items: baseline; margin-bottom: 4px; }
.legend > span { white-space: nowrap; }

/* ZB-23 part 2 */
/* S4 statements: headline row and right-aligned summary tables. */
.kpi-grid.v2.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.statement-compare { margin: -10px 0 18px; }
table.summary-table { width: auto; min-width: min(100%, 420px); margin-top: 14px; }
table.summary-table th { text-align: left; font-weight: 500; color: var(--muted); padding-right: 24px; }
table.summary-table tr.total th, table.summary-table tr.total td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); }
table.summary-table tr.control th, table.summary-table tr.control td { font-size: .78rem; }
@media (max-width: 760px) { .kpi-grid.v2.three { grid-template-columns: minmax(0, 1fr); } }

/* S5 invoice header: number, status pill, customer, figures and one action bar. */
.invoice-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: start; }
.invoice-id h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.45rem; }
.invoice-id p { margin: 4px 0 0; color: var(--muted); }
.invoice-figures { display: flex; gap: 28px; margin: 0; flex-wrap: wrap; }
.invoice-figures dt { color: var(--muted); font-size: .72rem; }
.invoice-figures dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.action-bar { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--row-line); }
@media (max-width: 760px) { .invoice-head { grid-template-columns: minmax(0, 1fr); } .invoice-figures { gap: 18px; } }

/* S6 phone filters: disclosure with active-filter chips (built by filters.js). */
details.filters { margin-bottom: 16px; }
details.filters > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--surface); font-weight: 650; font-size: .88rem; }
details.filters > summary::-webkit-details-marker { display: none; }
details.filters > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
details.filters[open] > summary::after { content: "▴"; }
details.filters > form { margin-top: 10px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--orange-soft); color: var(--accent-text); font-size: .74rem; font-weight: 600; }

.invoice-figures > div { display: block; }
.invoice-figures dt, .invoice-figures dd { display: block; }
.action-bar:empty { display: none; }
.infographic-grid.v2.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1050px) { .infographic-grid.v2.two { grid-template-columns: minmax(0, 1fr); } }

/* ZC-01 Zest lockup: official wordmark + app name, same in every Zest app (brand/README.md). */
.sidebar .brand{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:4px 8px 24px;text-decoration:none;line-height:1}
.sidebar .brand img{display:block;width:auto;height:32px;padding:0;border-radius:0;background:none}
.sidebar .brand small{font:600 10px/1 Inter,system-ui,sans-serif;letter-spacing:.24em;text-transform:uppercase;color:var(--sidebar-muted)}

/* ZB-28 (atcounting 2.1/2.4): Controls panel, cash card note, Wio cash with ageing, collected line */
.legend i.collected { background: var(--green); height: 3px; border-radius: 2px; vertical-align: 2px; }
.dashboard-grid.v2 > .controls-panel { grid-column: 1 / -1; }
.kpi.v2 .kpi-note { font-size: .74rem; color: var(--muted); }
.cash-balances { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 2px; }
.cash-balances li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: .84rem; color: var(--muted); }
.cash-balances li:first-child strong { font-size: 1.15rem; color: var(--ink); }
.cash-balances li:first-child { color: var(--ink); }
.cash-ageing .panel-head.sub { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--row-line); }
.cash-ageing .panel-head.sub h2 { font-size: .95rem; }
.cash-ageing .aging-legend li { padding: 5px 0; }
#outlook table.summary-table { width: 100%; }
table.summary-table th { text-transform: none; letter-spacing: normal; font-size: .84rem; }
table.summary-table th .meta { display: block; font-size: .78rem; margin-top: 2px; }
