/* JGasFlow — app layout + components on top of design-system.css (hand-written; the design's
   inline styles turned into classes). Only design tokens are used. */

[hidden] { display: none !important; }

/* Status colours the design system has no tokens for — light values here, dark ones for the Control theme. */
:root { --danger-bg: #fdecec; --danger-border: #e6a3a3; --danger-text: #8a1f1f; --danger-strong: #c53030; --warn-text: #b45309; }
[data-theme="control"] { --danger-bg: #3a1618; --danger-border: #7a2c30; --danger-text: #f6b3b3; --danger-strong: #f07470; --warn-text: #f0a33a; }
html, body { height: 100%; }
.app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); }

/* ── sidebar ─────────────────────────────────────────────────────────── */
.sidebar { border-right: 1px solid var(--color-divider); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--color-bg); }
.sidebar-brand { padding: 16px 14px 10px; display: flex; align-items: center; gap: 10px; }
.sidebar-code { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--font-heading); font-weight: 600; font-size: 15px; color: var(--color-accent-700); }
.sidebar-name { font-family: var(--font-heading); font-weight: 600; font-size: 17px; line-height: 1.1; }
.sidebar-sub, .nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-600); }
.nav-label { font-size: 10px; letter-spacing: .1em; padding: 8px 14px 2px; }
.nav-label + .nav-label { padding-top: 14px; }
/* a folding menu group (24-Sep-2026) */
.nav-fold { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; padding-top: 14px; }
.nav-fold:hover { color: var(--color-accent-700); }
.nav-fold .nav-caret { margin-left: auto; font-size: 11px; transition: transform .15s; }
.nav-fold[aria-expanded="true"] .nav-caret { transform: rotate(90deg); }
.sidebar-toggle { padding: 4px 14px 12px; }
.sidebar .seg { width: 100%; }
.sidebar .seg-opt { flex: 1; justify-content: center; }
.sidebar .seg-themes .seg-opt { padding: 7px 4px; font-size: 12px; min-width: 0; }
.sidebar nav { display: flex; flex-direction: column; }
.nl, .kpi, .list-row, .search-hit, .notif-row { text-decoration: none; }
.nl .nl-i { width: 18px; font-size: 11px; color: var(--color-neutral-500); font-variant-numeric: tabular-nums; }
.nl .nl-badge { margin-left: auto; font-size: 11px; color: var(--color-accent-700); }
.sidebar-theme { margin-top: auto; padding: 10px 14px 0; }
.sidebar-theme .nav-label { padding: 0; margin-bottom: 4px; }
.sidebar-user { padding: 14px; border-top: 1px solid var(--color-divider); font-size: 12px; margin-top: 10px; }
.sidebar-user b { font-weight: 500; }
.sidebar-user .muted { color: var(--color-neutral-600); }
.sidebar-user form { display: inline; }
.sidebar-user .btn-ghost { padding: 0; font-size: 12px; margin-top: 4px; }

/* ── main / header ───────────────────────────────────────────────────── */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--color-divider); position: sticky; top: 0; background: var(--color-bg); z-index: 5; }
.search-wrap { position: relative; flex: 1; max-width: 560px; }
.search-wrap .input { padding-left: 34px; }
.search-wrap svg { position: absolute; left: 11px; top: 11px; color: var(--color-neutral-500); }
.search-pop { position: absolute; top: 40px; left: 0; right: 0; background: var(--color-bg); z-index: 20; padding: 6px 0; }
.search-pop .pop-title { padding: 4px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-600); }
.search-hit { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 7px 12px; cursor: pointer; border-top: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent); text-decoration: none; color: inherit; }
.search-hit:hover { background: color-mix(in srgb, var(--color-accent) 8%, transparent); }
.search-hit .tag { justify-content: center; }
.search-hit .t { font-size: 13px; }
.search-hit .s { font-size: 12px; color: var(--color-neutral-600); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell-count { background: var(--color-accent); color: var(--color-bg); font-size: 10px; padding: 0 5px; line-height: 16px; }
.notif-pop { position: absolute; right: 20px; top: 52px; width: 380px; background: var(--color-bg); z-index: 20; }
.notif-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--color-divider); }
.notif-head span { font-family: var(--font-heading); font-weight: 600; font-size: 16px; }
.notif-head .btn-ghost { margin-left: auto; font-size: 12px; }
.notif-row { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 9px 14px; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent); text-decoration: none; color: inherit; }
.notif-row .dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--color-neutral-300); }
.notif-row .t { font-size: 13px; }
.notif-row .s { font-size: 11px; color: var(--color-neutral-600); }
.notif-empty { padding: 16px 14px; font-size: 13px; color: var(--color-neutral-600); }

/* ── page ─────────────────────────────────────────────────────────────── */
.page { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.page-head .sub { color: var(--color-neutral-600); font-size: 13px; }
.page-head .crumbs { font-size: 12px; color: var(--color-neutral-600); margin-bottom: 4px; }
.page-head .crumbs a { color: var(--color-accent); text-decoration: none; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* dashboard toggles (Overview|Pipeline · ALL|names · period) stay on ONE line, right of the heading (Saqib, 25-Sep-2026) */
/* 25-Sep-2026 (Saqib): its own full-width row under the heading — Overview | Pipeline on the left, the company filter in the middle, the period on the right */
.page-head .head-tools { flex: 1 1 100%; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; white-space: nowrap; margin-top: 6px; }
.page-head .head-tools > .seg:first-child { justify-self: start; grid-column: 1; }
.page-head .head-tools > #company-filter { justify-self: center; grid-column: 2; }
.page-head .head-tools > .seg:last-child:not(:first-child):not(#company-filter) { justify-self: end; grid-column: 3; }
@media (max-width: 760px) { .page-head .head-tools { grid-template-columns: 1fr; } .page-head .head-tools > * { justify-self: start !important; grid-column: 1 !important; } }
.flash { padding: 10px 14px; font-size: 13px; border: 1px solid var(--color-accent-300); background: var(--color-accent-100); color: var(--color-accent-800); }
.flash.err { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.errors { padding: 10px 14px; font-size: 13px; border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.errors ul { margin: 4px 0 0; padding-left: 18px; }

/* grids */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-32 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.grid-23 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 16px; }
.small { font-size: 12px; } .tiny { font-size: 11px; } .muted { color: var(--color-neutral-600); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* KPI card */
.kpi { cursor: pointer; padding: 14px 16px; text-decoration: none; color: inherit; }
.kpi .v { font-family: var(--font-heading); font-weight: 600; font-size: 30px; line-height: 1; }
.kpi .s { font-size: 12px; color: var(--color-neutral-700); }
.kpi.warn .card-kicker { color: var(--warn-text); }

/* panels & tables */
.panel { padding: 16px; }
/* Every table scrolls inside its own box — never the page (ui-conventions). Cards are flex columns, so their
   children also need min-width:0 or wide content widens the card itself. */
.table-wrap { overflow-x: auto; max-width: 100%; }
.blueprint.table-wrap { padding: 0; }
.card > * { min-width: 0; }
.card > .btn { align-self: flex-start; }
/* Cells marked .wrap may break lines (names, makes, notes) so a table fits before it has to scroll. */
.table td.wrap, .table th.wrap { white-space: normal; }
.table td.wrap { min-width: 120px; }
.actions-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
/* Numeric column headings sit over their right-aligned figures (the design system left-aligns every th). */
.table th.num { text-align: right; }
/* Entry tables: headings may wrap, inputs fill their cell instead of forcing it wider. */
.table.lines th { white-space: normal; vertical-align: bottom; }
.table.lines td { white-space: normal; vertical-align: top; }
.table.lines .input { width: 100%; min-width: 0; }
.table.lines .input.w-70 { width: 76px; }
.table.lines .input.w-100 { width: 104px; }
.cell-stack { display: flex; flex-direction: column; gap: 4px; }
.cell-pair { display: flex; gap: 4px; }
.cell-pair > * { flex: 1; min-width: 0; }
.card .card-title { display: flex; align-items: baseline; gap: 14px; }
.card .card-title .ml-auto { font-size: 12px; font-weight: 400; color: var(--color-neutral-600); font-family: var(--font-body); }
/* every titled card minimises (Saqib, 23-Sep-2026): the chevron in the title hides everything but the title; cards with a
   data-fold-key remember it per browser */
.card-title > .card-fold { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--color-neutral-600); font: inherit; font-size: 13px; line-height: 1; padding: 2px 5px; align-self: center; transition: transform .15s; }
.card-title > .ml-auto + .card-fold { margin-left: 0; }
.card-title > .card-fold:hover { color: var(--color-accent); }
.card.is-folded > :not(.card-title):not(.corner) { display: none !important; }
.card.is-folded > .card-title > .card-fold { transform: rotate(-90deg); }
.list-row { display: grid; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent); font-size: 13px; }
.list-row b { font-family: var(--font-heading); font-weight: 600; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--color-neutral-600); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step .step-i { font-size: 10px; color: var(--color-neutral-500); }
.bar { height: 6px; background: var(--color-neutral-200); position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--color-accent); }
.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; align-items: end; height: 180px; margin-top: 14px; border-bottom: 1px solid var(--color-divider); }
.chart svg { width: 48px; height: 100%; display: block; margin: 0 auto; }
.chart-labels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; font-size: 12px; text-align: center; color: var(--color-neutral-600); margin-top: 6px; }
.legend { margin-left: auto; font-size: 12px; display: flex; gap: 12px; align-items: center; }
.legend .sw { display: inline-block; width: 10px; height: 10px; background: var(--color-accent); }
.legend .sw.o { background: none; border: 1px solid var(--color-accent-700); }
.totals { display: grid; grid-template-columns: auto auto; gap: 6px 24px; justify-content: end; font-size: 13px; padding: 10px 12px; }
.totals .k { color: var(--color-neutral-600); }
.totals .big { font-family: var(--font-heading); font-weight: 600; font-size: 16px; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* dense rows: a label that wrapped pushed its box down and the inputs of the row sat at different heights (Saqib, 23-Sep-2026) —
   labels stay on one line (ellipsis if too long; keep them short) so the inputs of a row are always inline */
.form-grid.cols-3 .field > label, .form-grid.cols-4 .field > label, .row-end .field > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-grid.cols-3, .form-grid.cols-4 { align-items: start; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.field .hint { font-size: 11px; color: var(--color-neutral-600); margin-top: 3px; }
.field.error .input { border-color: var(--danger-strong); }
.field .err { font-size: 11px; color: var(--danger-strong); margin-top: 3px; }
.input-sm { min-height: 30px; padding: 3px 8px; }
.input.w-70 { width: 70px; text-align: right; }
.input.w-100 { width: 100px; }
select.input { appearance: auto; }
.lines .input { min-height: 30px; padding: 3px 8px; }
.lines td { vertical-align: middle; }
.lines textarea.input { min-height: 30px; }
.item-sub { font-size: 12px; color: var(--color-neutral-600); }
.actions-cell { white-space: nowrap; }

/* dialogs */
/* Popups must be opaque in every theme. The Industry theme makes .card/.dialog transparent (right for cards on
   the page, wrong for a popup — the page showed through), and .dialog-body is faded to 85 %, too faint for forms. */
.dialog-backdrop { z-index: 50; background: rgba(15, 17, 20, .55); }
.dialog-backdrop .dialog { background: var(--color-surface); border: 1px solid var(--color-divider); box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog-backdrop .dialog-body { opacity: 1; }
[data-theme="industry"] .dialog-backdrop .dialog { background: var(--color-bg); }
.dialog.wide { width: min(980px, 100%); }
.dialog.medium { width: min(640px, 100%); }
.dialog-body .table { font-size: 13px; }
.dialog-body .blueprint { padding: 10px 12px; font-size: 12px; }
.progress { height: 8px; background: var(--color-neutral-200); }
.progress > i { display: block; height: 100%; background: var(--color-accent); transition: width .2s; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--color-bg); }
.auth .card { width: min(400px, 100%); padding: 24px; gap: 14px; }
.auth h1 { font-size: 26px; margin: 0; }

/* print/pdf helpers live in the pdf layout, not here */

/* ── responsive ─────────────────────────────────────────────────────────
   (.menu-btn must be hidden BEFORE the media query that shows it — equal specificity, later wins) */
.menu-btn { display: none; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-32, .grid-23, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; height: auto; transform: translateX(-100%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 8px 12px; }
  .search-wrap { max-width: none; }
  .search-wrap .input { font-size: 13px; }
  .topbar-actions .btn-primary { display: none; }
  .page { padding: 14px 12px 40px; }
  .grid-2, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .notif-pop { right: 8px; left: 8px; width: auto; }
  .totals { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 39; }

.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 16px; }
.check { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 3px; }

/* ── Searchable dropdowns (public/js/select-search.js): every <select> becomes a button + a filter panel ── */
.ss { position: relative; display: block; min-width: 0; }
.ss .ss-native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }
.ss-control { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.ss-control .ss-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-control .ss-text.is-placeholder { color: var(--color-neutral-600); }
.ss-control .ss-caret { flex: none; font-size: 11px; color: var(--color-neutral-600); }
.ss-control:disabled { cursor: not-allowed; opacity: .6; }
.ss-control.is-invalid { border-color: var(--danger-strong); }
.table.lines .ss, .lines .ss { width: 100%; }
.ss-panel { position: fixed; z-index: 1000; background: var(--color-surface); border: 1px solid var(--color-divider); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 6px; max-width: calc(100vw - 16px); box-sizing: border-box; }
[data-theme="industry"] .ss-panel { background: var(--color-bg); }
.ss-panel .ss-search { width: 100%; box-sizing: border-box; }
.ss-list { max-height: 260px; overflow: auto; }
.ss-opt { padding: 6px 8px; cursor: pointer; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-opt.is-active { background: color-mix(in srgb, var(--color-accent) 14%, transparent); }
.ss-opt.is-selected { font-weight: 600; }
.ss-opt.is-disabled { opacity: .5; cursor: default; }
.ss-empty { padding: 8px; font-size: 13px; color: var(--color-neutral-600); }

.seg .seg-opt.is-on { font-weight: 600; }
a.seg-opt { color: inherit; text-decoration: none; }

/* ── text size (Saqib, 23-Sep-2026: "hardly readable") — the whole UI scales; per user in users.density, switch in the sidebar ── */
html[data-density="normal"] { zoom: 1.12; }
html[data-density="large"] { zoom: 1.28; }
.seg a.seg-opt.is-on { background: var(--color-accent); color: var(--color-bg); }

/* a form that sits inline beside buttons (Users list: Unlock next to Edit) */
form.inline { display: inline-block; margin: 0; vertical-align: middle; }

/* ══ Dashboard laid out like the client's mock (Dashboard.jpeg page 1 of 12) — 25-Sep-2026 ══ */
:root { --ch-1: #2f6fed; --ch-2: #22a06b; --ch-3: #f59e0b; --ch-4: #7c3aed; --ch-5: #94a3b8; }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; }   /* rows of four, every tile the same size (Saqib, 25-Sep-2026) */
@media (max-width: 1100px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 10px; color: inherit; text-decoration: none; }
.tile-ico { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; }
.tile-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.c-blue { color: var(--ch-1); background: color-mix(in srgb, var(--ch-1) 12%, transparent); }
.c-green { color: var(--ch-2); background: color-mix(in srgb, var(--ch-2) 12%, transparent); }
.c-orange { color: var(--ch-3); background: color-mix(in srgb, var(--ch-3) 14%, transparent); }
.c-red { color: #e5484d; background: color-mix(in srgb, #e5484d 12%, transparent); }
.c-purple { color: var(--ch-4); background: color-mix(in srgb, var(--ch-4) 12%, transparent); }
.tile-body { display: flex; flex-direction: column; min-width: 0; }
.tile-k { font-size: 12px; font-weight: 600; color: var(--color-neutral-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-v { font-family: var(--font-heading); font-weight: 600; font-size: 26px; line-height: 1.15; margin: 2px 0; }
.tile.is-money .tile-v { font-size: 20px; }
.tile-l { font-size: 11px; color: var(--color-neutral-600); }
.tile:hover .tile-l { color: var(--color-accent-700); text-decoration: underline; }
.tone-green { color: var(--ch-2); } .tone-blue { color: var(--ch-1); } .tone-red { color: #e5484d; }
.dash-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: stretch; }
@media (max-width: 1100px) { .dash-charts { grid-template-columns: 1fr; } }
.card-title-sub { font-family: var(--font-body); font-weight: 400; }
.dchart { width: 100%; height: auto; display: block; margin-top: 8px; }
.dchart .grid { stroke: var(--color-divider); stroke-width: 1; }
.dchart .ax { font-size: 10px; fill: var(--color-neutral-600); font-family: var(--font-body); }
.dchart rect.ch-1, .dchart circle.ch-1 { fill: var(--ch-1); } .dchart rect.ch-2, .dchart circle.ch-2 { fill: var(--ch-2); } .dchart rect.ch-3 { fill: var(--ch-3); }
.dchart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; } .dchart .ln.ch-1 { stroke: var(--ch-1); } .dchart .ln.ch-2 { stroke: var(--ch-2); }
.legend .sw.ch-1 { background: var(--ch-1); border: 0; } .legend .sw.ch-2 { background: var(--ch-2); border: 0; } .legend .sw.ch-3 { background: var(--ch-3); border: 0; }
.donut-wrap { display: flex; gap: 14px; align-items: center; }
.donut { width: 120px; height: 120px; flex: 0 0 120px; }
.donut circle.ch-1 { stroke: var(--ch-1); } .donut circle.ch-2 { stroke: var(--ch-2); } .donut circle.ch-3 { stroke: var(--ch-3); } .donut circle.ch-4 { stroke: var(--ch-4); } .donut circle.ch-5 { stroke: var(--ch-5); }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; flex: 1; min-width: 0; }
.donut-legend .row { gap: 8px; }
.donut-legend a { color: inherit; text-decoration: none; }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 10px; }
.donut-legend .sw.ch-1 { background: var(--ch-1); } .donut-legend .sw.ch-2 { background: var(--ch-2); } .donut-legend .sw.ch-3 { background: var(--ch-3); } .donut-legend .sw.ch-4 { background: var(--ch-4); } .donut-legend .sw.ch-5 { background: var(--ch-5); }
.donut-legend b { color: var(--ch-2); }
.act-row { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent); font-size: 13px; color: inherit; text-decoration: none; }
.act-row:first-of-type { border-top: 0; }
.act-ico { width: 20px; height: 20px; border-radius: 50%; padding: 3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.act-row b { font-family: var(--font-heading); font-weight: 600; font-size: 12px; }

/* ── the left menu in the mock's dark navy (25-Sep-2026) ── */
.sidebar { --sb-bg: #0b1f44; --sb-fg: #e6ecf7; --sb-muted: #93a4c6; --sb-line: rgba(255,255,255,.14); background: var(--sb-bg); color: var(--sb-fg); border-right: 0; }
.sidebar .sidebar-name { color: #fff; }
.sidebar .sidebar-sub, .sidebar .nav-label, .sidebar .nl .nl-i, .sidebar-user .muted { color: var(--sb-muted); }
.sidebar .sidebar-code { color: #fff; }
.sidebar .blueprint > .corner::before, .sidebar .blueprint > .corner::after { background: rgba(255,255,255,.45); }
.sidebar .nl { color: var(--sb-fg); }
.sidebar .nl:hover { background: rgba(255,255,255,.08); }
.sidebar .nl[aria-current="page"] { background: var(--color-accent); color: #fff; border-left-color: #fff; }
.sidebar .nl[aria-current="page"] .nl-i, .sidebar .nl[aria-current="page"] .nl-badge { color: #fff; }
.sidebar .nl .nl-badge { color: #fff; background: rgba(255,255,255,.16); padding: 0 6px; border-radius: 9px; min-width: 18px; text-align: center; }
.sidebar .nl .nl-badge:empty { display: none; }
.sidebar .nav-fold:hover { color: #fff; }
.sidebar .seg { border-color: var(--sb-line); background: transparent; }
.sidebar .seg-opt { color: var(--sb-fg); }
.sidebar .seg-opt + .seg-opt { border-left-color: var(--sb-line); }
.sidebar .seg-opt:has(input:checked) { background: var(--color-accent); color: #fff; }
.sidebar .seg-opt:not(:has(input:checked)):hover { background: rgba(255,255,255,.08); }
.sidebar-user { border-top-color: var(--sb-line); }
.sidebar-user b { color: #fff; }
.sidebar .btn-ghost { color: var(--sb-fg); }
.sidebar .btn-ghost:hover { color: #fff; }
.card.tile { flex-direction: row; }
.sidebar .nl { white-space: nowrap; font-size: 13.5px; }
.dash-charts .card-title { flex-wrap: wrap; row-gap: 4px; }

.donut-legend .dl-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; }
.donut-legend .dl-row a, .donut-legend .dl-row .muted { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.donut-legend .dl-row b { margin-left: auto; }

.sidebar-logo { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; flex: 0 0 34px; }

/* every input field on a very light tint of the theme's own blue — the accent of the active menu entry (Saqib, 28-Sep-2026;
   first asked as #E6E5FF, then "a very light variant of this blue"). Worked-out (read-only) boxes keep their grey; the text
   inside an input is always dark, so the dark theme stays readable. */
:root { --input-bg: color-mix(in srgb, var(--color-accent) 9%, #ffffff); --input-fg: #16181d; }
.input:not([readonly]):not(:disabled), select.input:not(:disabled), textarea.input:not([readonly]), .ss-control:not(:disabled),
.ss-panel .ss-search { background: var(--input-bg); color: var(--input-fg); }
.input::placeholder { color: color-mix(in srgb, var(--input-fg) 50%, transparent); }
.ss-control:not(:disabled) .ss-text.is-placeholder, .ss-control:not(:disabled) .ss-caret { color: color-mix(in srgb, var(--input-fg) 55%, transparent); }
select.input option { background: #fff; color: var(--input-fg); }
/* a list row with its Remove button beside it */
.row-with-remove { display: flex; align-items: center; gap: 6px; border-top: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent); }
.row-with-remove > .list-row { flex: 1 1 auto; min-width: 0; border-top: 0; }
.row-with-remove:first-of-type { border-top: 0; }
.btn-remove { color: #c0392b; font-size: 12px; padding: 2px 6px; }
.btn-remove:hover { text-decoration: underline; }

/* ── Shared screen components of the foundation (Build conventions G.3, 29-Sep-2026). Layout only — every colour is a
   token of brand.css. ── */
/* "+ New" in the top bar and its list */
.quick-pop { position: absolute; right: 20px; top: 52px; min-width: 220px; background: var(--color-bg); z-index: 20; padding: 6px 0; }
.quick-pop .quick-row { display: block; padding: 8px 14px; text-decoration: none; color: inherit; font-size: 13.5px; }
.quick-pop .quick-row:hover { background: var(--color-neutral-100); }
@media (max-width: 900px) { .topbar-actions .btn-primary.quick-btn { display: inline-flex; } .quick-pop { right: 8px; left: 8px; min-width: 0; } }
/* <x-field>: the message under the box */
.field .err { font-size: 12px; margin-top: 3px; }
/* <x-money-input>: the currency symbol in front of the box */
.money-input { position: relative; display: flex; align-items: stretch; min-width: 0; }
.money-input .money-sym { display: flex; align-items: center; padding: 0 9px; font-size: 13px; color: var(--color-neutral-700); background: var(--color-neutral-100); border: 1px solid var(--color-neutral-300); border-right: 0; border-radius: 9px 0 0 9px; white-space: nowrap; }
.money-input .input { flex: 1 1 auto; min-width: 0; text-align: right; border-top-left-radius: 0; border-bottom-left-radius: 0; }
/* <x-stepper>: big − and + for touch screens */
.stepper { display: inline-flex; align-items: stretch; max-width: 100%; }
.stepper .stepper-input { width: 64px; min-width: 0; text-align: center; border-radius: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper .stepper-input::-webkit-outer-spin-button, .stepper .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .stepper-btn { min-width: 38px; min-height: 36px; font-size: 18px; line-height: 1; cursor: pointer; border: 1px solid var(--color-neutral-300); background: var(--color-neutral-100); color: var(--color-text); padding: 0 8px; }
.stepper .stepper-btn:first-child { border-right: 0; border-radius: 9px 0 0 9px; }
.stepper .stepper-btn:last-child { border-left: 0; border-radius: 0 9px 9px 0; }
.stepper .stepper-btn:hover { background: var(--color-neutral-200); }
.stepper .stepper-btn:active { background: var(--color-accent-100); }
/* <x-more-details>: the folded group under the first six boxes */
.more-details { margin-top: 12px; border-top: 1px solid var(--color-divider); padding-top: 8px; }
.more-details > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--color-accent-700); list-style: none; padding: 4px 0; }
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary::before { content: '▸ '; }
.more-details[open] > summary::before { content: '▾ '; }
.more-details-body { padding-top: 8px; }
/* <x-table-totals> and the totals row of <x-size-grid> */
.table tfoot td { font-weight: 600; border-top: 2px solid var(--color-divider); border-bottom: 0; }
/* <x-size-grid>: one row per cylinder size */
.size-grid th.size-name { text-align: left; font-weight: 600; white-space: normal; }
.size-grid td { vertical-align: middle; }
.size-grid td.num .stepper { justify-content: flex-end; }
@media (max-width: 600px) {
  /* on a phone each size is a block with its columns under each other */
  .size-grid thead { display: none; }
  .size-grid, .size-grid tbody, .size-grid tfoot, .size-grid tr, .size-grid th.size-name, .size-grid td { display: block; width: 100%; }
  .size-grid tr { border-bottom: 1px solid var(--color-divider); padding: 6px 0; }
  .size-grid th.size-name { border: 0; padding: 4px 8px; }
  .size-grid td { display: flex; justify-content: space-between; align-items: center; border: 0; padding: 3px 8px; }
  .size-grid td::before { content: attr(data-label); font-size: 12px; color: var(--color-neutral-700); font-weight: 400; }
  .size-grid tfoot td:first-child::before { content: ''; }
}
/* <x-cancel-form> */
.cancel-form .row { margin-top: 8px; }
/* a heading row inside a table (Settings → Modules, the role matrix): the side-menu group or the permission group */
.table tr.group-row > td { background: var(--color-accent-100); color: var(--color-accent-800); font-weight: 600; }
