:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef1f5; --text: #0f172a; --muted: #5b6577;
  --border: #dde2ea; --accent: #1e3a8a; --accent-ink: #ffffff; --accent-soft: #e8eefc; --icon: #64748b; --link: #1e3a8a;
  --danger: #b42318; --danger-soft: #fdecea; --warn: #9a6700; --warn-soft: #fff4d6; --ok: #1a7f37;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06); color-scheme: light;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Theme: chosen at the top of every page (Light / Dark / System), kept per device in theme.js. */
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2e; --surface-2: #17223a; --text: #e2e8f0; --muted: #94a3b8;
  --border: #23304d; --accent: #4c6ef5; --accent-ink: #ffffff; --accent-soft: #1c2b52; --icon: #94a3b8; --link: #93b4ff;
  --danger: #ff7b72; --danger-soft: #3a1d1c; --warn: #e3b341; --warn-soft: #33290f; --ok: #56d364;
  --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
  --bg: #0b1220; --surface: #111a2e; --surface-2: #17223a; --text: #e2e8f0; --muted: #94a3b8;
  --border: #23304d; --accent: #4c6ef5; --accent-ink: #ffffff; --accent-soft: #1c2b52; --icon: #94a3b8; --link: #93b4ff;
  --danger: #ff7b72; --danger-soft: #3a1d1c; --warn: #e3b341; --warn-soft: #33290f; --ok: #56d364;
  --shadow: none; color-scheme: dark;
  }
}
/* Paper is always light, whatever the screen shows. */
@media print { :root:not(#print-light) { --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef1f5; --text: #0f172a; --muted: #5b6577;
  --border: #dde2ea; --accent: #1e3a8a; --accent-ink: #ffffff; --accent-soft: #e8eefc; --icon: #64748b; --link: #1e3a8a;
  --danger: #b42318; --danger-soft: #fdecea; --warn: #9a6700; --warn-soft: #fff4d6; --ok: #1a7f37;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06); color-scheme: light; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.muted { color: var(--muted); }
.boot { padding: 40px; color: var(--muted); }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 14px; color: var(--accent); }
.side a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.side a:hover { background: var(--surface-2); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .group { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 14px 10px 4px; }
.main { min-width: 0; }
.top { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.top .company { margin-right: auto; font-weight: 600; }
.page { padding: 20px 24px 60px; max-width: 1200px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.menu-btn { display: none; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; z-index: 20; width: 240px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .side.open { display: block; }
  .menu-btn { display: inline-flex; margin-right: auto; }
  .top .company { display: none; }
  .page { padding: 16px 16px 60px; }
}

/* Cards and tables */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; }
tr:last-child td { border-bottom: 0; }
tr.total td { font-weight: 650; border-top: 2px solid var(--border); }
tr.section td { background: var(--surface-2); font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Forms */
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; min-width: 0; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input.num { text-align: right; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
button, .btn { font: inherit; font-weight: 600; border-radius: 6px; padding: 7px 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.07); }
button.danger { color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
details.add { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
details.add summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.add[open] summary { margin-bottom: 12px; }
.lines td { padding: 5px 6px; }
.lines input, .lines select { padding: 5px 7px; }
.lines .x { padding: 4px 9px; }
.totals { margin-left: auto; width: min(340px, 100%); margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; font-size: 17px; border-top: 2px solid var(--border); padding-top: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters label { min-width: 150px; }

/* Status badges and messages */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.open { background: var(--accent-soft); color: var(--accent); }
.badge.overdue, .badge.void { background: var(--danger-soft); color: var(--danger); }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.closed, .badge.posted { color: var(--ok); }
.note { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); margin-bottom: 14px; }
.ok-note { background: var(--accent-soft); }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; max-width: min(560px, calc(100vw - 32px)); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); color: #fff; }

/* Sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .box { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.auth form { display: grid; gap: 12px; }
.auth h1 { margin-bottom: 2px; }
.auth .brand { padding: 0 0 12px; }

/* Printing a document */
.doc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin-bottom: 16px; }
.doc-head div > span:first-child { display: block; color: var(--muted); font-size: 12.5px; }
@media print {
  .side, .top, .actions, .no-print, #toast { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .panel, .card { box-shadow: none; }
  body { background: #fff; color: #000; }
}
a.card { color: var(--text); display: block; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
tr.matches td { background: var(--surface-2); white-space: normal; }
/* Inventory */
.two { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
form.inline { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: middle; font-size: 14px; font-weight: 400; }
form.inline input { width: auto; }
p.alert { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--radius); }
[hidden] { display: none !important; }
/* Budgets and wide reports */
table.budget input.cell { width: 84px; padding: 4px 6px; }
table.budget td { padding: 4px 6px; }
.neg { color: var(--danger); }
/* Payroll */
details.stub { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 8px 0; padding: 10px 14px; }
details.stub summary { cursor: pointer; font-weight: 600; }
.paystub table { width: 100%; margin-top: 8px; }
.paystub .doc-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
td input.cell { width: 90px; }
@media print { details.stub { break-inside: avoid; } details.stub:not([open]) { display: none; } }
.weekbar a { text-decoration: none; padding: 0 6px; }
/* Sign-in security */
.banner { background: var(--warn-soft); color: var(--text); padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
pre.codes { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-size: 16px; line-height: 1.7; width: max-content; max-width: 100%; }
code.key { font-size: 15px; letter-spacing: 1px; word-break: break-all; }
ol.steps li { margin-bottom: 8px; }

/* Sidebar sections: one open at a time */
.nav-parent { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; box-shadow: none; text-align: left;
  padding: 8px 10px; margin-top: 2px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.nav-parent:hover { background: var(--surface-2); }
.nav-parent:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-parent .chev { display: inline-block; width: 12px; color: var(--muted); transition: transform .15s; }
.nav-group.open > .nav-parent .chev { transform: rotate(90deg); }
.nav-group.open > .nav-parent { color: var(--accent); }
.nav-children a { padding-left: 30px; }
@media (prefers-reduced-motion: reduce) { .nav-parent .chev { transition: none; } }

/* Units (Phase 4D) */
fieldset.units-box { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
fieldset.units-box legend { font-weight: 600; padding: 0 6px; }
fieldset.units-box p { grid-column: 1 / -1; margin: 0; }
.bxpc { display: flex; gap: 6px; align-items: center; }
.bxpc input { width: 70px; }

/* Sidebar with icons (owner's design, Nov 2026) */
.side { padding: 14px 10px; }
.brand { color: var(--accent); }
:root[data-theme="dark"] .brand { color: #93b4ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .brand { color: #93b4ff; } }
.side svg.ic { width: 19px; height: 19px; flex: none; stroke: var(--icon); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side > a, .nav-parent { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; margin-top: 2px; font-weight: 500; color: var(--text); }
.side > a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.side > a.on svg.ic { stroke: var(--accent-ink); }
.nav-parent .chev { margin-left: auto; width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 2; transition: transform .15s; }
.nav-group.open > .nav-parent .chev { transform: rotate(180deg); }
.nav-group.open > .nav-parent { color: var(--accent); font-weight: 600; }
.nav-group.open > .nav-parent svg.ic { stroke: var(--accent); }
:root[data-theme="dark"] .nav-group.open > .nav-parent, :root[data-theme="dark"] .nav-group.open > .nav-parent svg.ic { color: #93b4ff; stroke: #93b4ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .nav-group.open > .nav-parent, :root:not([data-theme]) .nav-group.open > .nav-parent svg.ic { color: #93b4ff; stroke: #93b4ff; } }
.nav-children a { padding: 7px 12px 7px 43px; border-radius: 9px; font-size: 14px; color: var(--muted); }
.nav-children a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
:root[data-theme="dark"] .nav-children a.on { color: #c7d5ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .nav-children a.on { color: #c7d5ff; } }

/* Theme switch at the top */
.theme { position: relative; }
.theme > button svg, .theme-menu svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme > button { font-weight: 500; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 6px; width: 160px; display: grid; gap: 2px; }
.theme-menu button { border: 0; background: none; justify-content: flex-start; font-weight: 500; width: 100%; padding: 7px 10px; border-radius: 7px; }
.theme-menu button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-menu button:hover { background: var(--surface-2); }
@media (max-width: 800px) { .theme .t-label { display: none; } }
.top select { width: auto; max-width: 260px; }

/* Settings (Phase 6E) */
.btn.gear { padding: 6px 8px; }
.btn.gear svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side .lock { font-size: 11px; margin-left: auto; }
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.set-tabs { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: grid; gap: 2px; position: sticky; top: 12px; }
.set-tabs a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 12px; border-radius: 9px; color: var(--text); }
.set-tabs a small { color: var(--muted); font-size: 11.5px; }
.set-tabs a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.set-tabs a.on small { color: inherit; opacity: .75; }
.set-tabs a:hover { text-decoration: none; }
.set-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
.set-sec h3 { margin: 0 0 6px; font-size: 16px; }
.set-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; }
.set-label { font-weight: 500; }
.small { font-size: 12.5px; }
.inline-in { display: inline-flex; gap: 8px; align-items: center; }
.set-save { display: flex; justify-content: flex-end; }
.switch-row { display: flex !important; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 38px; height: 22px; border-radius: 99px; background: var(--border); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row input:disabled + .switch { opacity: .5; }
.lock-note { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg label { display: block; padding: 7px 14px; color: var(--text); font-size: 14px; cursor: pointer; }
.seg label input { position: absolute; opacity: 0; width: 1px; }
.seg label.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg label.locked { color: var(--muted); cursor: default; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.usage { display: inline-block; width: 160px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.usage div { height: 100%; background: var(--accent); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; position: relative; }
.plan-card.current { border: 2px solid var(--accent); }
.plan-card .tag { position: absolute; top: -10px; left: 16px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 9px; }
.plan-card .price { font-size: 26px; font-weight: 800; margin-top: 6px; }
.plan-card .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13.5px; }
.plan-card li { padding: 3px 0 3px 20px; position: relative; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan-card li.x { color: var(--muted); }
.plan-card li.x::before { content: "–"; color: var(--muted); }
@media (max-width: 800px) {
  .settings { grid-template-columns: 1fr; }
  .set-tabs { position: static; display: flex; overflow-x: auto; }
  .set-tabs a small { display: none; }
  .set-tabs a { white-space: nowrap; }
  .set-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Point of sale (Phase 7B) */
.page:has(.pos) { max-width: none; }
.pos-top { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 12px; }
.pill { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 4px 10px; font-weight: 600; font-size: 12.5px; }
.pos { display: grid; grid-template-columns: 1fr minmax(340px, 440px); gap: 14px; align-items: start; }
.pos-left, .pos-right { padding: 12px; overflow: visible; }
.pos-search input { border: 2px solid var(--accent); border-radius: 10px; padding: 11px 12px; font-size: 15px; }
.pos-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; max-height: calc(100vh - 230px); overflow-y: auto; }
.tile { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); }
.tile .n { font-weight: 600; }
.tile .s { color: var(--muted); font-size: 12.5px; margin: 3px 0 8px; }
.tile.out .s { color: var(--danger); }
.tile .p { display: flex; gap: 6px; flex-wrap: wrap; }
.tile .p button { flex: 1; justify-content: center; background: var(--accent-soft); color: var(--accent); border-color: transparent; padding: 6px 8px; font-size: 13px; }
.tile .p button:disabled { background: var(--surface-2); color: var(--muted); }
.pos-right .cart { width: 100%; margin-top: 8px; }
.pos-right .cart td { padding: 6px 4px; white-space: normal; vertical-align: middle; }
.u { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.u button { border: 0; border-radius: 0; padding: 3px 9px; font-size: 12.5px; font-weight: 500; }
.u button.on { background: var(--accent); color: var(--accent-ink); }
.qbox { display: inline-flex; align-items: center; gap: 4px; }
.qbox button { padding: 2px 9px; }
.qbox input { width: 46px; padding: 4px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pay-methods button { justify-content: center; padding: 10px 4px; }
.pay-methods button.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.cash-row { display: flex; gap: 12px; align-items: end; justify-content: space-between; margin-top: 10px; }
.cash-row label { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); }
button.pay { width: 100%; justify-content: center; margin-top: 12px; padding: 14px; font-size: 17px; }
.pos-empty { padding: 30px 0; text-align: center; }
.pos-open { max-width: 520px; padding: 16px; }
#receipt-print { display: none; }
@media print {
  body.printing-receipt > *:not(#receipt-print) { display: none !important; }
  body.printing-receipt #receipt-print { display: block; color: #000; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; }
  #receipt-print.paper-80mm { width: 72mm; }
  #receipt-print.paper-58mm { width: 48mm; font-size: 11px; }
  #receipt-print.paper-a4 { width: 120mm; font-size: 13px; }
  #receipt-print hr { border: 0; border-top: 1px dashed #000; }
  #receipt-print .r-c { text-align: center; }
  #receipt-print .r-l { display: flex; justify-content: space-between; gap: 8px; }
  #receipt-print .r-t { font-weight: 700; font-size: 1.15em; }
}
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; }
  .pos-tiles { max-height: none; }
}
:root[data-theme="dark"] .pill { color: #c7d5ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .pill { color: #c7d5ff; } }

/* Documents (Phase 6B) */
.logo-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo-prev { max-height: 56px; max-width: 180px; border: 1px solid var(--border); border-radius: 6px; padding: 4px; background: #fff; }
.small-btn { padding: 2px 10px; font-size: 12.5px; margin-left: 10px; }

/* Report centre (Phase 6F) */
.report-centre { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 22px; }
.report-centre section h2 { margin: 14px 0 8px; font-size: 15px; }
.rc-item { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; color: var(--text); }
.rc-item:hover { border-color: var(--accent); text-decoration: none; }
.rc-item b { display: block; color: var(--link); }
.rc-item span { color: var(--muted); font-size: 13px; }
.rc-item.locked b { color: var(--muted); }
a.drill { color: inherit; border-bottom: 1px dotted var(--muted); }
a.drill:hover { color: var(--link); text-decoration: none; }

/* ---------- Apple-inspired sidebar and dashboard (18 Nov 2026) ---------- */
:root { --bg: #f5f5f7; --tile-ink: #ffffff; --d-hair: rgba(0,0,0,.08); --d-track: #e8e8ed;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c-bad: #d03b3b; --c-good: #1a9e3f; --c-warn: #c77700; }
:root[data-theme="dark"] { --d-hair: rgba(255,255,255,.10); --d-track: #263252;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c-bad: #e5534b; --c-good: #30d158; --c-warn: #e3a008; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --d-hair: rgba(255,255,255,.10); --d-track: #263252;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c-bad: #e5534b; --c-good: #30d158; --c-warn: #e3a008; } }
@media print { :root:not(#print-light) { --bg: #f4f5f7; } }

/* Sidebar: larger type, coloured icon tiles (like system settings), soft selection. */
.side { padding: 20px 12px; width: 256px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: -.01em; padding: 2px 10px 20px; }
.brand::before { content: ""; width: 32px; height: 32px; border-radius: 8px; background: url(/logo.svg) center / contain no-repeat; flex: none; }
.side > a, .nav-parent { gap: 12px; padding: 8px 10px; border-radius: 11px; font-size: 16px; font-weight: 500; margin-top: 3px; }
.side .ntile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: #8e8e93; }
.side .ntile svg.ic, .side > a.on .ntile svg.ic, .nav-group.open > .nav-parent .ntile svg.ic,
:root[data-theme="dark"] .nav-group.open > .nav-parent .ntile svg.ic { width: 18px; height: 18px; stroke: var(--tile-ink); stroke-width: 2; }
.ntile.t-dashboard { background: #0a84ff; } .ntile.t-sales { background: #34c759; } .ntile.t-purchases { background: #ff9500; }
.ntile.t-inventory { background: #a2845e; } .ntile.t-banking { background: #5856d6; } .ntile.t-hr { background: #30b0c7; }
.ntile.t-accounting { background: #8e8e93; } .ntile.t-reports { background: #af52de; } .ntile.t-company { background: #636366; }
.side > a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-group.open > .nav-parent { color: var(--text); font-weight: 600; }
:root[data-theme="dark"] .nav-group.open > .nav-parent { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .nav-group.open > .nav-parent { color: var(--text); } }
.nav-children a { position: relative; padding: 8px 12px 8px 52px; font-size: 15.5px; font-weight: 600; border-radius: 10px; margin-top: 1px; color: var(--text); }
.nav-children a::before { content: ""; position: absolute; left: 32px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); transform: translateY(-50%); }
.nav-children a.on { background: var(--accent-soft); color: var(--link); }
.nav-children a.on::before { background: var(--link); }
.nav-parent .chev { width: 16px; height: 16px; }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.dash-head .eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.dash-head h1 { font-size: 32px; letter-spacing: -.02em; margin: 2px 0 0; font-weight: 700; }
.dash-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--d-track); border-radius: 9px; padding: 2px; }
.seg button { border: 0; box-shadow: none; background: none; font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 7px; color: var(--text); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.round { border-radius: 980px !important; padding: 7px 15px !important; font-size: 13px; }
.dgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dgrid.wide { grid-template-columns: 2fr 1fr; margin-top: 20px; }
@media (max-width: 1100px) { .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .dgrid, .dgrid.wide { grid-template-columns: 1fr; } .dash-head h1 { font-size: 26px; } }
.dcard { background: var(--surface); border-radius: 22px; padding: 22px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); min-width: 0; position: relative; }
:root[data-theme="dark"] .dcard { box-shadow: none; border: 1px solid var(--d-hair); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .dcard { box-shadow: none; border: 1px solid var(--d-hair); } }
.dcard .ch { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; }
.dcard .ch .t { font-size: 16px; font-weight: 600; }
.dcard .ch .m { font-size: 13px; color: var(--muted); }
.dcard a.go { font-size: 13px; font-weight: 500; }
.big { font-size: 32px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big.s { font-size: 24px; }
.cap { font-size: 13px; color: var(--muted); margin-top: 3px; }
.hbar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 12px 0 16px; background: var(--d-track); }
.hbar i { display: block; border-radius: 5px; min-width: 0; }
.leg { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 9px 0; color: var(--text); }
.leg .d { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.leg .v { font-weight: 600; margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.leg:hover { text-decoration: none; opacity: .8; }
.hair { height: 1px; background: var(--d-hair); margin: 14px 0; }
.drow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--d-hair); color: var(--text); }
.drow:last-child { border-bottom: 0; }
a.drow:hover { text-decoration: none; opacity: .85; }
.drow .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; font-size: 15px; font-weight: 700; }
.drow .r { margin-left: auto; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.drow b { font-size: 14.5px; font-weight: 600; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 980px; padding: 2px 9px; background: var(--accent-soft); color: var(--link); }
.k4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; } }
.donut { display: flex; align-items: center; gap: 22px; }
.donut .ring { position: relative; width: 150px; height: 150px; flex: none; }
.donut .ring .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut path { cursor: pointer; transition: opacity .15s; }
.donut svg:hover path:not(:hover) { opacity: .45; }
@media (max-width: 420px) { .donut { flex-direction: column; align-items: stretch; } .donut .ring { margin: 0 auto; } }
.spark { width: 100%; height: 160px; display: block; touch-action: none; }
.dtip { position: absolute; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 9px; pointer-events: none; white-space: nowrap; transform: translate(-50%, -110%); }
.up { color: var(--c-good); font-weight: 600; } .down { color: var(--c-bad); font-weight: 600; }
.private .big, .private .v, .private .drow .r, .private .money-p { filter: blur(9px); }

/* Coloured circles and tiles (shared by the dashboard and the summary cards) */
.tone-blue { background: #0a84ff; } .tone-green { background: #34a853; } .tone-orange { background: #f08c00; } .tone-red { background: #e5383b; }
.tone-gray { background: #8e8e93; } .tone-indigo { background: #5856d6; } .tone-teal { background: #1aa3b8; } .tone-brown { background: #a2845e; } .tone-yellow { background: #d4a000; }
/* Summary cards over list pages */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 0 0 20px; }
.stats:empty { display: none; }
.stat { display: block; background: var(--surface); border-radius: 20px; padding: 16px 18px; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  border: 2px solid transparent; transition: transform .12s, border-color .12s; }
.stat:hover { text-decoration: none; transform: translateY(-1px); }
.stat.on { border-color: var(--link); }
:root[data-theme="dark"] .stat { box-shadow: none; border-color: var(--d-hair); } :root[data-theme="dark"] .stat.on { border-color: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .stat { box-shadow: none; border-color: var(--d-hair); } :root:not([data-theme]) .stat.on { border-color: var(--link); } }
.stat .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat .ci { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 700; flex: none; }
.stat .tag { font-size: 12px; font-weight: 600; background: var(--d-track); border-radius: 980px; padding: 4px 10px; color: var(--muted); white-space: nowrap; }
.stat .num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 12px; font-variant-numeric: tabular-nums; }
.stat .lb { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .stat { transition: none; } }
@media print { .stats, .dash-tools { display: none !important; } }
.shell { grid-template-columns: 256px minmax(0, 1fr); }
@media (max-width: 800px) { .shell { grid-template-columns: 1fr; } .side { width: 270px; } }
.side .ntile svg.ic { display: block; margin: 0; }
.side .ntile { line-height: 0; }

/* Phase 7D: messaging settings, collections, message log */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.prov { border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: block; background: var(--surface); }
.prov input { position: absolute; opacity: 0; pointer-events: none; }
.prov b { display: block; font-size: 15px; } .prov span { font-size: 13px; color: var(--muted); }
.prov.on { border-color: var(--link); background: var(--accent-soft); }
.prov:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.msg-usage { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; } .msg-usage.dim { opacity: .45; }
.msg-usage .usage { flex: 0 0 200px; }
details.adv { margin: 8px 0; } details.adv > summary { cursor: pointer; color: var(--link); font-weight: 500; padding: 6px 0; }
.bubble-wrap { background: var(--d-track); border-radius: 22px; padding: 14px; margin-top: 10px; max-width: 420px; }
.bubble { background: var(--surface); border-radius: 18px; padding: 11px 14px; margin-top: 8px; line-height: 1.45; font-size: 14px; }
.chip.bad { background: #fee4e2; color: #b42318; } .chip.warn { background: #fff4e5; color: #9a4d00; }
:root[data-theme="dark"] .chip.bad { background: #3a1d1c; color: #ff9b94; } :root[data-theme="dark"] .chip.warn { background: #33290f; color: #f2c46b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .chip.bad { background: #3a1d1c; color: #ff9b94; } :root:not([data-theme]) .chip.warn { background: #33290f; color: #f2c46b; } }
.coll-row { display: grid; grid-template-columns: auto minmax(160px, 1.6fr) minmax(100px, .8fr) auto minmax(140px, 1.2fr) auto; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--d-hair); }
.coll-row:last-child { border-bottom: 0; }
.coll-row .amt { text-align: right; font-variant-numeric: tabular-nums; }
.coll-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.coll-row .acts .round, .coll-row .acts .btn { padding: 6px 12px !important; }
.coll-row .hist { grid-column: 1 / -1; background: var(--bg); border-radius: 16px; padding: 14px 16px; }
.coll-row .pick { width: 18px; height: 18px; }
@media (max-width: 900px) { .coll-row { grid-template-columns: auto 1fr auto; } .coll-row .last, .coll-row > div:nth-child(4) { grid-column: 2 / -1; } .coll-row .acts { grid-column: 1 / -1; justify-content: flex-start; } }
.note-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; } .note-form input[name=note] { flex: 1; min-width: 180px; }
.tl-row { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--d-hair); align-items: flex-start; }
.msg-body { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
button.linkish { background: none; border: 0; box-shadow: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
#msg-root .set-row > div { min-width: 0; }
#msg-root input:not([type=checkbox]):not([type=radio]), #msg-root select, #msg-root textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
#msg-root .set-row input[name=smsUrl] { width: 100%; }
.msg-usage { flex-wrap: wrap; } .msg-usage .usage { flex: 1 1 120px; max-width: 220px; }
#msg-root .inline-in { flex-wrap: wrap; }
.prov { position: relative; overflow: hidden; } .prov input { left: 0; top: 0; width: 1px; height: 1px; }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; } .bulk-bar select { width: auto; }

/* Credit control */
.k3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 6px; }
.k3 > div { background: var(--bg); border-radius: 16px; padding: 14px 16px; }
@media (max-width: 600px) { .k3 { grid-template-columns: 1fr; } }
.note-box { border-radius: 16px; padding: 12px 14px; margin-top: 12px; font-size: 14px; line-height: 1.45; }
.note-box.bad { background: #fee4e2; color: #7a1a12; } .note-box.warn { background: #fff4e5; color: #6b3a00; }
:root[data-theme="dark"] .note-box.bad { background: #3a1d1c; color: #ffc9c4; } :root[data-theme="dark"] .note-box.warn { background: #33290f; color: #f5d9a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .note-box.bad { background: #3a1d1c; color: #ffc9c4; } :root:not([data-theme]) .note-box.warn { background: #33290f; color: #f5d9a0; } }
.bar-sm { height: 8px; border-radius: 5px; background: var(--d-track); overflow: hidden; margin: 4px 0; } .bar-sm i { display: block; height: 100%; border-radius: 5px; }
.bc-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.6fr) 140px auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--d-hair); }
.bc-row:first-of-type { border-top: 0; }
@media (max-width: 700px) { .bc-row { grid-template-columns: 1fr auto; } .bc-row > div:nth-child(2) { grid-column: 1 / -1; } }

/* The logo on the sign-in pages */
.auth .brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.auth .brand::before { content: ""; width: 40px; height: 40px; border-radius: 10px; background: url(/logo.svg) center / contain no-repeat; flex: none; box-shadow: 0 6px 16px rgba(10, 132, 255, .25); }
/* Fixed assets (Phase 6H) */
.seg a { display: block; font-size: 13px; padding: 6px 14px; border-radius: 7px; color: var(--text); text-decoration: none; }
.seg a.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.seg + .panel, .seg + table, .seg + div { margin-top: 14px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.empty-state { text-align: center; padding: 40px 20px; } .empty-state h2 { margin-top: 0; }
div.stat { cursor: default; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }
.panel.pad { padding: 14px 18px; } .panel.pad .filters { margin: 0; } .panel.pad > .muted:last-child { margin-bottom: 0; }
/* Pharmacy (Phase 6I) */
.rolecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; border: 0; padding: 0; margin: 0; }
.rolecards legend { font-size: 13px; color: var(--muted); margin-bottom: 8px; padding: 0; }
.rolecard { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; cursor: pointer; font-size: 13px; color: var(--muted); line-height: 1.4; }
.rolecard b { color: var(--text); font-size: 15px; margin-top: 6px; }
.rolecard input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rolecard:has(input:checked) { border: 2px solid var(--accent); padding: 13px; box-shadow: 0 4px 18px rgba(0,113,227,.12); }
.rolecard:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; color: #fff; }
.matrix td.c, .matrix th.c { text-align: center; } .matrix td.y { color: #34c759; } .matrix td.n { color: #c7c7cc; }
.medgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.med-box { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 980px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); vertical-align: middle; }
.pill.rx { background: #ffe5e5; color: #b42318; }
:root[data-theme="dark"] .pill.rx { background: #3a1d1c; color: #ffc9c4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .pill.rx { background: #3a1d1c; color: #ffc9c4; } }
.tile .g { font-size: 12px; color: var(--muted); margin: 2px 0; }
.small { font-size: 12.5px; }
@media (max-width: 700px) { .medgrid { grid-template-columns: 1fr; } }

/* Narrow sidebar and the path back (Phase 6I) */
.side-toggle { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 16px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border);
  background: none; box-shadow: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.side-toggle:hover { color: var(--accent); border-color: var(--accent); }
.shell.mini { grid-template-columns: 76px minmax(0, 1fr); }
.shell.mini .side { width: 76px; padding: 14px 10px; overflow-x: hidden; }
.shell.mini .side .brand { font-size: 0; padding: 4px 0 14px; display: flex; justify-content: center; }
.shell.mini .side .brand::before { content: ''; width: 34px; height: 34px; border-radius: 10px; background: url(/logo-64.png) center / cover; }
.shell.mini .side a > span:not(.ntile), .shell.mini .nav-parent > span:not(.ntile), .shell.mini .nav-parent .chev, .shell.mini .nav-children, .shell.mini .side .lock { display: none !important; }
.shell.mini .side a, .shell.mini .nav-parent { justify-content: center; padding: 8px 0 !important; display: flex; }
.shell.mini .side-toggle { justify-content: center; padding: 8px 0; font-size: 16px; }
@media (max-width: 800px) { .side-toggle { display: none; } .shell.mini { grid-template-columns: 1fr; } }
.trail { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: -4px 0 12px; }
.backpill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px 6px 10px; border-radius: 980px; background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px; color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: pointer; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.crumbs .crumb { background: none; border: 0; box-shadow: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.crumbs .crumb:hover { text-decoration: underline; } .crumbs .sep { color: #c7c7cc; }
form.grid .wide, .grid > .wide { grid-column: 1 / -1; }

/* Plan and billing (Phase 8A) */
.sub-banner { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; }
.sub-banner a { margin-left: auto; font-weight: 600; white-space: nowrap; }
.sub-banner.trial { background: #e8f1ff; color: #0b3d91; } .sub-banner.due { background: #fff4e5; color: #6b3a00; } .sub-banner.late { background: #fee4e2; color: #7a1a12; }
:root[data-theme="dark"] .sub-banner.trial { background: #10233f; color: #b9d4ff; } :root[data-theme="dark"] .sub-banner.due { background: #33290f; color: #f5d9a0; } :root[data-theme="dark"] .sub-banner.late { background: #3a1d1c; color: #ffc9c4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .sub-banner.trial { background: #10233f; color: #b9d4ff; } :root:not([data-theme]) .sub-banner.due { background: #33290f; color: #f5d9a0; } :root:not([data-theme]) .sub-banner.late { background: #3a1d1c; color: #ffc9c4; } }
.ov { position: fixed; inset: 0; background: rgba(0,0,0,.42); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 22px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 4px; font-size: 22px; } .modal .sub { color: var(--muted); margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.m3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.mp { border: 1px solid var(--border); border-radius: 16px; padding: 14px; } .mp.rec { border: 2px solid var(--accent); padding: 13px; }
.mp h3 { margin: 0 0 2px; font-size: 16px; } .mp .p { font-size: 22px; font-weight: 700; margin-top: 4px; } .mp .y { font-size: 12.5px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; } .card h3 { margin: 0 0 10px; font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; position: relative; }
.plan.cur { border: 2px solid var(--accent); padding: 17px; box-shadow: 0 6px 24px rgba(0,113,227,.12); }
.plan h3 { margin: 0; font-size: 19px; } .plan .who { color: var(--muted); font-size: 13px; } .plan .price { font-size: 28px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.02em; }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 500; } .plan ul { padding-left: 18px; margin: 10px 0 0; font-size: 13.5px; line-height: 1.65; }
.plan .cur-tag { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; padding: 3px 9px; border-radius: 980px; }
.howpay { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; } .howpay div { border: 1px solid var(--border); border-radius: 14px; padding: 12px; font-size: 14px; } .howpay b { display: block; margin-bottom: 4px; }
.ref { font-family: ui-monospace, Menlo, monospace; font-size: 16px; font-weight: 700; background: var(--surface-2); padding: 3px 9px; border-radius: 8px; }
@media (max-width: 760px) { .plans, .m3 { grid-template-columns: 1fr; } .sub-banner { padding: 10px 14px; flex-wrap: wrap; } .sub-banner a { margin-left: 0; } }

/* ---------- Admin console (Phase 8A-2) ---------- */
.adm-top { display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: #1d1d1f; color: #f5f5f7; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.adm-top a { color: #d1d1d6; text-decoration: none; }
.adm-brand { display: flex; align-items: center; gap: 8px; } .adm-brand b { color: #fff; font-size: 16px; }
.adm-tag { background: #ff9f0a; color: #1d1d1f; font-weight: 800; font-size: 10.5px; padding: 2px 8px; border-radius: 980px; letter-spacing: .04em; }
.adm-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-top nav a { padding: 6px 12px; border-radius: 980px; font-size: 14px; }
.adm-top nav a.on, .adm-top nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.adm-me { margin-left: auto; font-size: 13px; color: #aeaeb2; } .adm-me a { color: #fff; }
.adm { max-width: 1280px; margin: 0 auto; padding: 20px 24px 60px; }
.adm h1 { margin: 4px 0 14px; font-size: 28px; letter-spacing: -.02em; }
.adm h2 { font-size: 18px; margin: 24px 0 10px; }
.adm-back { font-size: 14px; color: var(--link); }
.kpis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; color: var(--text); text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--accent); text-decoration: none; }
.kpi .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .kpi .n.small-n { font-size: 17px; line-height: 31px; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi.warn .n { color: var(--warn); } .kpi.ok .n { color: var(--ok); } .kpi.blue .n { color: var(--link); } .kpi.bad .n { color: var(--danger); }
.afilters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.afilter { padding: 6px 12px; border-radius: 980px; border: 1px solid var(--border); font-size: 13px; background: var(--surface); color: var(--text); text-decoration: none; }
.afilter span { color: var(--muted); margin-left: 3px; } .afilter:hover { text-decoration: none; border-color: var(--accent); }
.afilter.on { background: #1d1d1f; color: #fff; border-color: #1d1d1f; } .afilter.on span { color: #d1d1d6; }
:root[data-theme="dark"] .afilter.on { background: #f5f5f7; color: #1d1d1f; } :root[data-theme="dark"] .afilter.on span { color: #48484a; }
.chip-search { margin-left: auto; } .chip-search input { width: 280px; max-width: 100%; }
.wide-search { margin: 0 0 12px; } .wide-search input { width: 360px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.d-g { background: #34c759; } .d-b { background: #0a84ff; } .d-o { background: #ff9f0a; } .d-r { background: #ff3b30; } .d-x { background: #8e8e93; }
.adm-line { margin: -6px 0 14px; } .adm-line .ref { font-size: 14px; padding: 2px 8px; }
.adm-two { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.adm-two .card { margin-bottom: 16px; border-radius: 16px; } .adm-two .card h3 { margin: 0 0 10px; font-size: 15px; }
.adm-two .card .panel { box-shadow: none; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 10px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.usage-row { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.adm-form { display: grid; gap: 10px; } .adm-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.adm-pair { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.adm-inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 8px; }
.adm-inline label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; min-width: 180px; }
.adm-inline input:not([type=checkbox]), .adm-inline select { width: 100%; }
.adm-inline label.check { display: flex; flex: 0 0 auto; min-width: 0; align-items: center; gap: 6px; padding-bottom: 8px; }
.adm-note { border-top: 1px solid var(--border); padding: 8px 0; font-size: 14px; white-space: pre-wrap; }
.adm-link { background: none; border: 0; padding: 0; font-weight: 600; } .adm-link:hover { background: none; text-decoration: underline; }
.adm-num { width: 128px; text-align: right; font-variant-numeric: tabular-nums; }
#pf .panel { overflow-x: auto; } .adm-cur { width: 64px; text-transform: uppercase; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin-bottom: 14px; }
.adm-grid .card h3 { margin: 0 0 8px; font-size: 15px; }
.adm-pi { display: grid; grid-template-columns: 150px 1fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(4, 1fr); } .adm-two { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .adm { padding: 14px 16px 40px; } .adm-top { padding: 10px 16px; gap: 8px; } .adm-me { margin-left: 0; width: 100%; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .chip-search { margin-left: 0; width: 100%; } .chip-search input, .wide-search input { width: 100%; }
  .adm .panel { overflow-x: auto; } .kv { grid-template-columns: 110px 1fr; } .adm-pi { grid-template-columns: 1fr; }
  .adm-grid { grid-template-columns: 1fr; }
}

/* ---------- Apple-style grouped lists and sheets (Phase 8A-3; used by Data & Privacy, closed companies) ---------- */
.ap { max-width: 680px; }
.ap-hdr { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 24px 16px 7px; }
.ap-hdr:first-child { margin-top: 4px; }
.ap-ftr { font-size: 13px; color: var(--muted); margin: 7px 16px 0; line-height: 1.45; }
.ap-grp { background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 .5px var(--border); }
.ap-row { display: flex; align-items: center; gap: 13px; padding: 12px 16px; min-height: 26px; font-size: 15.5px; position: relative; width: 100%;
  background: none; border: 0; border-radius: 0; color: var(--text); font-weight: 400; text-align: left; box-sizing: border-box; }
button.ap-row { cursor: pointer; } button.ap-row:hover { background: var(--surface-2); }
.ap-row + .ap-row::before { content: ""; position: absolute; top: 0; left: 59px; right: 0; border-top: .5px solid var(--border); }
.ap-row.plain + .ap-row::before, .ap-row.plain::before { left: 16px; }
.ap-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 15px; flex: 0 0 30px; }
.ap-t { flex: 1; min-width: 0; } .ap-t small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.ap-v { color: var(--muted); font-size: 14.5px; } .ap-chev { color: #c7c7cc; font-size: 20px; line-height: 1; }
.ap-row.red { color: #ff3b30; justify-content: center; font-weight: 500; } .ap-row.blue { color: #007aff; justify-content: center; font-weight: 500; }
:root[data-theme="dark"] .ap-row.blue { color: #0a84ff; } :root[data-theme="dark"] .ap-row.red { color: #ff453a; }
.ap-row.dim { color: var(--muted); }
.ap-ov { position: fixed; inset: 0; background: rgba(0,0,0,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 200;
  animation: apfade .18s ease-out; padding: 16px; }
.ap-sheet { background: var(--surface); border-radius: 20px; width: min(420px, 100%); padding: 26px 24px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); text-align: center;
  animation: aprise .22s cubic-bezier(.2,.8,.2,1); box-sizing: border-box; }
.ap-sheet .big { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 30px; }
.ap-sheet h2 { font-size: 20px; margin: 0 0 8px; letter-spacing: -.015em; }
.ap-sheet p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.ap-sheet input, .ap-sheet select { width: 100%; box-sizing: border-box; border: 0; background: var(--surface-2); border-radius: 10px; padding: 11px 12px; font-size: 15px; margin-bottom: 8px; color: var(--text); }
.ap-btns { display: grid; gap: 8px; margin-top: 10px; }
.ap-b { display: flex; justify-content: center; width: 100%; border: 0; border-radius: 12px; padding: 12px; font-size: 16px; font-weight: 600; cursor: pointer; }
.ap-b.destr { background: #ff3b30; color: #fff; } .ap-b.prim { background: #007aff; color: #fff; } .ap-b.plain { background: var(--surface-2); color: #007aff; }
.ap-b:disabled { opacity: .4; cursor: default; } .ap-b:hover:not(:disabled) { filter: brightness(1.05); }
.ap-prog { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 4px 0 10px; }
.ap-prog i { display: block; height: 100%; width: 40%; background: #007aff; border-radius: 3px; animation: apslide 1.2s ease-in-out infinite; }
.ap-tick { color: #34c759; font-weight: 600; } .ap-warn { color: #ff9500; font-weight: 600; }
.ap-link { background: none; border: 0; padding: 0; color: #007aff; font: inherit; font-weight: 600; cursor: pointer; }
@keyframes apfade { from { opacity: 0; } } @keyframes aprise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
@keyframes apslide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .ap-ov, .ap-sheet, .ap-prog i { animation: none; } }

/* ---------- Terms and Privacy pages (Phase 8A-4) ---------- */
body.legal { background: var(--surface); }
.lg-top { position: sticky; top: 0; display: flex; align-items: center; gap: 22px; padding: 14px 40px; z-index: 5; font-size: 14px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: .5px solid var(--border); }
.lg-top b { font-size: 17px; margin-right: auto; } .lg-top b a { color: var(--text); } .lg-top a { color: var(--muted); text-decoration: none; } .lg-top a.on { color: var(--text); font-weight: 600; }
.lg { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 56px; max-width: 1000px; margin: 0 auto; padding: 44px 40px 80px; }
.lg main { min-width: 0; }
.lg nav { position: sticky; top: 84px; align-self: start; font-size: 13.5px; line-height: 2; }
.lg nav a { display: block; color: var(--muted); text-decoration: none; } .lg nav a:hover { color: var(--text); }
.lg h1 { font-size: 44px; letter-spacing: -.03em; margin: 0 0 6px; line-height: 1.05; }
.lg .upd { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.lg h2 { font-size: 21px; letter-spacing: -.015em; margin: 36px 0 8px; scroll-margin-top: 80px; }
.lg p, .lg li { font-size: 16px; line-height: 1.6; } .lg li { margin: 4px 0; }
.lg .short { background: var(--surface-2); border-radius: 18px; padding: 20px 22px; margin: 0 0 10px; scroll-margin-top: 80px; }
.lg .short h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lg .short ul { margin: 0; padding-left: 20px; } .lg .short li { font-size: 15.5px; }
.lg table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 10px 0; }
.lg td, .lg th { white-space: normal; background: none; text-align: left; padding: 9px 10px; border-bottom: .5px solid var(--border); vertical-align: top; } .lg th { color: var(--muted); font-weight: 600; font-size: 13px; }
.lg-foot { color: var(--muted); font-size: 13px; margin-top: 40px; padding-top: 16px; border-top: .5px solid var(--border); }
@media (max-width: 820px) {
  .lg { grid-template-columns: 1fr; padding: 24px 16px 60px; gap: 0; } .lg nav { display: none; } .lg h1 { font-size: 34px; }
  .lg-top { padding: 12px 16px; gap: 14px; white-space: nowrap; } .lg-long { display: none; } .lg table { font-size: 13.5px; } .lg td, .lg th { padding: 8px 6px; overflow-wrap: anywhere; }
}
.legal-links { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 14px; } .legal-links a { color: var(--muted); }

/* ---------- Phase D1: Apple look — system blue, translucent top bar, avatar menu, pill buttons, large titles ---------- */
:root { --accent: #0071e3; --link: #0066cc; --accent-soft: #e8f1fd; --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif; }
:root[data-theme="dark"] { --accent: #0a84ff; --link: #4ea1ff; --accent-soft: #0b2a4d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --accent: #0a84ff; --link: #4ea1ff; --accent-soft: #0b2a4d; } }
body { -webkit-font-smoothing: antialiased; }
.top { position: sticky; top: 0; z-index: 15; min-height: 52px; padding: 8px 28px; gap: 8px; border-bottom: .5px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.top .company { font-size: 15px; letter-spacing: -.01em; }
.pill-select { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: 980px; background: var(--surface-2); color: var(--muted); }
.pill-select svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top .pill-select select { border: 0; background: transparent; padding: 0 24px 0 0; height: 32px; font-size: 13.5px; color: var(--text); outline: none; max-width: 220px; }
.top .btn.gear, .top #theme-btn { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); }
.top #theme-btn .t-label { display: none; }
.top #theme-btn svg { width: 17px; height: 17px; }
.me { position: relative; }
.avatar { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 0; justify-content: center; font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #5e5ce6, #0a84ff); letter-spacing: .02em; }
.avatar:hover { background: linear-gradient(135deg, #5e5ce6, #0a84ff); filter: brightness(1.08); }
.avatar.big { width: 40px; height: 40px; font-size: 15px; display: inline-flex; align-items: center; flex: 0 0 40px; }
.me-menu { position: absolute; right: 0; top: 40px; width: 260px; background: var(--surface); border-radius: 14px; padding: 6px; z-index: 30;
  box-shadow: 0 0 0 .5px var(--border), 0 18px 48px rgba(0,0,0,.18); }
.me-menu[hidden] { display: none; }
.me-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: .5px solid var(--border); margin-bottom: 4px; }
.me-head b { display: block; font-size: 14.5px; } .me-head small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.me-menu a, .me-menu button { display: flex; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font-weight: 400; font-size: 14.5px; text-decoration: none; }
.me-menu a:hover, .me-menu button:hover { background: var(--accent); color: #fff; text-decoration: none; }
.me-menu #logout { color: var(--danger); } .me-menu #logout:hover { background: #ff3b30; color: #fff; }
.page { padding: 22px 36px 72px; }
.page-head { align-items: flex-end; margin-bottom: 20px; }
.page-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12; margin: 0; }
.trail { margin: 0 0 2px; }
.backlink { background: none; border: 0; padding: 0; color: var(--link); font-weight: 400; font-size: 15px; cursor: pointer; }
.backlink:hover { background: none; text-decoration: underline; }
button, .btn { border-radius: 980px; padding: 7px 16px; border: 1px solid transparent; background: var(--surface-2); color: var(--link); font-weight: 600; }
button:hover, .btn:hover { background: color-mix(in srgb, var(--surface-2) 85%, var(--text)); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
button.danger { color: var(--danger); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent); }
@media (max-width: 800px) {
  .top { padding: 8px 16px; } .page { padding: 16px 16px 60px; } .page-head h1 { font-size: 28px; }
  .top { flex-wrap: nowrap; } .top .pill-select select { max-width: 120px; } .top .pill-select { min-width: 0; flex: 0 1 auto; }
  .menu-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; font-size: 18px; flex: 0 0 36px; }
}

/* ---------- Phase D2: Settings as Apple grouped lists, iOS switches, Plan and billing, welcome sheet ---------- */
.settings { grid-template-columns: 250px minmax(0, 1fr); gap: 28px; }
.set-tabs { background: none; border: 0; padding: 0; gap: 14px; top: 68px; }
.st-grp { background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 .5px var(--border); }
.set-tabs a { display: flex; align-items: center; gap: 11px; padding: 0 12px; min-height: 42px; border-radius: 0; position: relative; color: var(--text); font-size: 14.5px; justify-content: flex-start; }
.set-tabs a + a::before { content: ""; position: absolute; top: 0; left: 51px; right: 0; border-top: .5px solid var(--border); }
.set-tabs a.on { background: var(--accent); color: #fff; font-weight: 500; } .set-tabs a.on::before, .set-tabs a.on + a::before { border-color: transparent; }
.set-tabs a:hover:not(.on) { background: var(--surface-2); }
.st-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; flex: 0 0 28px; color: #fff; }
.st-t { flex: 1; } .st-chev { color: #c7c7cc; font-size: 18px; } .set-tabs a.on .st-chev { color: #fff; }
.set-sec { background: none; border: 0; padding: 0; margin-bottom: 26px; }
.set-sec > h3 { font-size: 12.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 16px 7px; }
.set-sec > p, .set-sec > .muted, .set-foot { font-size: 13px; color: var(--muted); margin: 7px 16px 0; }
.set-card { background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 .5px var(--border); }
.set-card + .set-card { margin-top: 14px; }
.set-card .set-row { grid-template-columns: minmax(170px, 42%) 1fr; padding: 10px 16px; min-height: 26px; border-top: 0; position: relative; }
.set-card .set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--border); }
.set-card .set-row > :last-child { justify-self: end; text-align: right; min-width: 0; }
.set-card .set-label { font-weight: 400; font-size: 15px; }
.set-card .set-row .muted.small { font-size: 12.5px; }
.set-card input:not([type=checkbox]):not([type=radio]):not([type=file]), .set-card select { border: 0; background: transparent; text-align: right; font-size: 15px; padding: 6px 0; width: 100%; max-width: 360px; }
.set-card select { text-align-last: right; cursor: pointer; padding-right: 2px; }
.set-card input:focus, .set-card select:focus { outline: none; box-shadow: none; }
.set-card textarea { background: var(--surface-2); border: 0; border-radius: 9px; text-align: left; width: 100%; min-width: 260px; }
.set-card .inline-in { justify-content: flex-end; } .set-card .inline-in input { width: 90px !important; }
.set-card .set-row > div:last-child > a { color: var(--link); }
.switch { width: 51px; height: 31px; background: #e9e9ea; } :root[data-theme="dark"] .switch { background: #39393d; }
.switch::after { left: 2px; top: 2px; width: 27px; height: 27px; box-shadow: 0 2px 5px rgba(0,0,0,.22); }
.switch-row input:checked + .switch { background: #34c759; }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.set-card .switch-row { justify-content: flex-end; text-align: left; flex-direction: row-reverse; gap: 14px; }
.set-card .switch-row > span:last-child { color: var(--muted); font-size: 13.5px; }
.seg { border: 0; background: var(--surface-2); border-radius: 9px; padding: 2px; overflow: visible; }
.seg label { padding: 6px 14px; border-radius: 7px; font-size: 14px; }
.seg label.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.set-status { font-size: 13px; color: var(--muted); margin: 10px 16px 0; } .set-status.ok { color: #34c759; } .set-status.err { color: var(--danger); }
.set-save { margin: 12px 0 0; }
.link-btn { background: none; border: 0; padding: 4px 0 4px 10px; color: var(--link); font-weight: 500; }
.link-btn:hover { background: none; text-decoration: underline; }
/* Plan and billing */
.pl-state { display: flex; gap: 18px; align-items: center; background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 .5px var(--border); padding: 18px 20px; }
.pl-state b { font-size: 19px; letter-spacing: -.01em; } .pl-state p { margin: 3px 0 0; color: var(--muted); font-size: 14px; } .pl-state .pl-ctry { font-size: 13px; }
.pl-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 64px; }
.pl-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 19px; }
.pl-seg { margin: 0 0 14px; }
.plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; }
.pl { background: var(--surface); border-radius: 18px; box-shadow: 0 0 0 .5px var(--border); padding: 20px; display: flex; flex-direction: column; position: relative; }
.pl.rec { box-shadow: 0 0 0 2px var(--accent); }
.pl-tag { font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.pl h3 { margin: 0; font-size: 22px; letter-spacing: -.015em; text-transform: none; color: var(--text); font-weight: 700; }
.pl-who { color: var(--muted); font-size: 13.5px; margin: 2px 0 12px; }
.pl-pr { font-size: 32px; font-weight: 700; letter-spacing: -.025em; } .pl-pr small { font-size: 15px; color: var(--muted); font-weight: 500; }
.pl-yr { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.pl ul { list-style: none; padding: 0; margin: 0 0 16px; font-size: 14px; line-height: 1.85; flex: 1; } .pl li::before { content: "✓"; color: #34c759; font-weight: 700; margin-right: 8px; }
.pl .pl-choose { justify-content: center; text-decoration: none; }
.pay-row .pay-m { display: flex; gap: 11px; align-items: center; text-align: left; } .pay-m small { display: block; color: var(--muted); font-size: 13px; }
.set-card .pay-row { grid-template-columns: 1fr auto; }
/* Welcome as a sheet */
.ov:has(.wsheet) { background: rgba(0,0,0,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal.wsheet { width: min(540px, 94vw); border-radius: 22px; padding: 26px 24px 18px; }
.wsheet .big { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto 12px; display: grid; place-items: center; font-size: 30px; background: #e5f1ff; }
.wsheet h2 { text-align: center; font-size: 22px; letter-spacing: -.015em; margin: 0 0 6px; } .wsheet .sub { text-align: center; }
.wsheet .wc-row { grid-template-columns: auto 1fr; } .wsheet .wc-row select { max-width: 300px; }
.wc-note { font-size: 12.5px; color: var(--muted); margin: 6px 4px 0; }
.wsheet .m3 { margin: 14px 0 6px; gap: 8px; } .wsheet .mp { background: var(--surface-2); border: 0; border-radius: 12px; padding: 10px 12px; }
.wsheet .mp.rec { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); border: 0; }
.wsheet .mp h3 { font-size: 13px; } .wsheet .mp .p { font-size: 20px; margin: 2px 0 0; } .wsheet .mp .p small { font-size: 12px; color: var(--muted); font-weight: 500; } .wsheet .mp .y { font-size: 11.5px; }
@media (max-width: 1000px) { .plans { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .set-tabs { display: flex; gap: 10px; overflow-x: auto; position: static; } .st-grp { display: flex; flex: 0 0 auto; }
  .set-tabs a { min-height: 38px; white-space: nowrap; } .set-tabs a + a::before { display: none; } .set-tabs .st-chev { display: none; }
  .set-card .set-row { grid-template-columns: 1fr; gap: 4px; } .set-card .set-row > :last-child { justify-self: stretch; text-align: left; }
  .set-card input:not([type=checkbox]):not([type=radio]):not([type=file]), .set-card select { text-align: left; max-width: none; } .set-card select { text-align-last: left; }
  .set-card .switch-row { justify-content: space-between; flex-direction: row; }
  .wsheet .m3 { grid-template-columns: 1fr; }
}
.pl-pr { white-space: nowrap; font-size: clamp(22px, 2.3vw, 32px); }
.set-card .set-row:has(> :only-child) > :only-child { grid-column: 1 / -1; justify-self: start; text-align: left; }

/* ---------- Phase D3: Apple-style lists ---------- */
.al-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.al-seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; margin-right: auto; max-width: 100%; overflow-x: auto; }
.al-seg a { padding: 6px 14px; border-radius: 7px; font-size: 14px; color: var(--text); text-decoration: none; white-space: nowrap; font-weight: 500; }
.al-seg a.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.al-seg a:hover:not(.on) { color: var(--link); }
.al-search { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 0 10px; height: 36px; width: 280px; max-width: 100%; color: var(--muted); }
.al-tools .al-seg + .al-search, .al-tools > .al-search:only-child { margin-left: auto; }
.al-search input { border: 0; background: transparent; padding: 0; height: 34px; font-size: 14.5px; outline: none; box-shadow: none; }
.al-search input:focus { outline: none; box-shadow: none; }
.al-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.al-pillsel { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 980px; background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.al-pillsel select { border: 0; background: transparent; padding: 0; font-size: 13.5px; color: var(--text); width: auto; }
.al-pillsel input { width: auto; }
.al-hdr { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 16px 7px; }
.al-hdr:first-child { margin-top: 0; }
.al-grp { background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 .5px var(--border); }
.al-row { display: flex; align-items: center; gap: 13px; padding: 10px 14px 10px 16px; min-height: 40px; position: relative; }
.al-row + .al-row::before { content: ""; position: absolute; top: 0; left: 65px; right: 0; border-top: .5px solid var(--border); }
.al-row.click { cursor: pointer; } .al-row.click:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.al-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.al-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: 0 0 36px; color: #fff; font-weight: 600; }
.al-ic.round { border-radius: 50%; font-size: 15px; }
.al-main { flex: 1; min-width: 0; }
.al-main b { display: block; font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-main small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.al-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 980px; margin-left: 6px; vertical-align: 1px; }
.al-pill.blue { background: #e8f1fd; color: #0066cc; } .al-pill.green { background: #e3f9e5; color: #1e7b34; } .al-pill.red { background: #ffe5e3; color: #c4320a; }
.al-pill.orange { background: #fff4e5; color: #9a4d00; } .al-pill.gray { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .al-pill.blue { background: #0b2a4d; color: #6cb4ff; } :root[data-theme="dark"] .al-pill.green { background: #12321b; color: #5ad57a; }
:root[data-theme="dark"] .al-pill.red { background: #3a1d1c; color: #ff8a80; } :root[data-theme="dark"] .al-pill.orange { background: #33290f; color: #f2c46b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .al-pill.blue { background: #0b2a4d; color: #6cb4ff; } :root:not([data-theme]) .al-pill.green { background: #12321b; color: #5ad57a; }
  :root:not([data-theme]) .al-pill.red { background: #3a1d1c; color: #ff8a80; } :root:not([data-theme]) .al-pill.orange { background: #33290f; color: #f2c46b; } }
.al-extra { flex: 0 0 auto; } .al-mini { width: auto; border: 0; background: var(--surface-2); border-radius: 8px; font-size: 12.5px; padding: 4px 8px; }
.al-amt { text-align: right; font-variant-numeric: tabular-nums; flex: 0 0 auto; max-width: 45%; }
.al-amt b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; } .al-amt small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.al-amt small.down { color: var(--danger); }
.al-chev { color: #c7c7cc; font-size: 20px; line-height: 1; }
.al-later { display: none !important; }
.al-more { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--link); font-weight: 500; }
.al-more:hover { background: none; text-decoration: underline; }
.al-empty, .al-none { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 .5px var(--border); padding: 28px; text-align: center; color: var(--muted); }
.al-none { margin-top: 10px; }
.danger-text { color: var(--danger) !important; }
details.add[hidden] { display: none; }
@media (max-width: 800px) {
  .al-search { width: 100%; order: 3; } .al-seg { margin-right: 0; }
  .al-row { padding: 10px 12px; gap: 11px; } .al-row + .al-row::before { left: 59px; }
  .al-main small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .al-extra { display: none; }
}
.al-row[hidden], .al-grp[hidden], .al-hdr[hidden] { display: none !important; }
@media (max-width: 800px) { .al-extra { display: block; } .al-extra .al-mini { display: none; } }
@media (max-width: 800px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 14px; border-radius: 16px; } .stat .ci { width: 30px; height: 30px; font-size: 14px; } .stat .tag { font-size: 11px; padding: 3px 8px; }
  .stat .num { font-size: 22px; margin-top: 8px; } .stat .lb { font-size: 12px; }
}

/* ---------- Phase D4: Apple-style forms — document forms, lines, bottom bar, picker, new customer sheet, add forms ---------- */
.docf { padding-bottom: 84px; }
.doc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.docf .set-sec { margin-bottom: 22px; }
.docf .set-card .set-row { grid-template-columns: minmax(120px, 34%) 1fr; }
.docf .set-card input[type=date] { max-width: 200px; }
.docf .note-row { grid-template-columns: 1fr !important; }
.docf .note-row input { text-align: left !important; max-width: none !important; }
.doc-lines .panel { border: 0; border-radius: 12px; box-shadow: 0 0 0 .5px var(--border); background: var(--surface); }
.lines th { background: none; font-size: 12px; padding: 10px 8px; border-bottom: .5px solid var(--border); }
.lines td { padding: 7px 6px; border-bottom: .5px solid var(--border); vertical-align: middle; }
.lines tbody tr:last-child td { border-bottom: 0; }
.lines input, .lines select { border: 0; background: var(--surface-2); border-radius: 8px; padding: 8px 9px; font-size: 14.5px; }
.lines input:focus, .lines select:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.lines input:disabled, .lines select:disabled { opacity: .55; }
.lines .x { background: none; border: 0; color: #c7c7cc; font-size: 15px; padding: 4px 8px; } .lines .x:hover { color: var(--danger); background: none; }
.lines .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.le-add { margin: 8px 6px 0; } .le-add .link-btn { padding-left: 4px; font-weight: 600; }
.doc-bar { position: fixed; left: var(--side-w, 256px); right: 0; bottom: 0; z-index: 12; display: flex; align-items: center; gap: 14px; padding: 12px 36px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--border); }
.shell.mini .doc-bar { left: 76px; }
.db-t { margin-right: auto; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.db-tot { margin-left: 14px; color: var(--muted); } .db-tot b { font-size: 22px; color: var(--text); margin-left: 6px; letter-spacing: -.01em; }
/* Picker */
.pk { position: relative; display: block; width: 100%; min-width: 0; }
.pk-native { position: absolute !important; opacity: 0; width: 1px !important; height: 1px; pointer-events: none; left: 50%; bottom: 0; }
.pk-btn { width: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 6px; background: none; border: 0; padding: 6px 0; color: var(--text); font-weight: 400; font-size: 15px; border-radius: 8px; min-height: 30px; }
.pk-btn:hover { background: none; } .pk-btn:disabled { opacity: .5; }
.pk-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } .pk-v.ph { color: var(--muted); }
.pk-chev { color: #c7c7cc; font-size: 18px; flex: 0 0 auto; }
.lines .pk-btn { justify-content: space-between; background: var(--surface-2); padding: 7px 9px; font-size: 14.5px; }
.pk-pop { position: fixed; z-index: 300; background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 .5px var(--border), 0 18px 48px rgba(0,0,0,.2);
  display: flex; flex-direction: column; overflow: hidden; animation: apfade .12s ease-out; }
.pk-q { margin: 10px; width: calc(100% - 20px); border: 0; background: var(--surface-2); border-radius: 9px; padding: 9px 11px; font-size: 15px; }
.pk-q:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.pk-list { overflow-y: auto; flex: 1; min-height: 0; }
.pk-opt { display: flex; gap: 10px; align-items: center; padding: 8px 14px; cursor: pointer; }
.pk-opt.on { background: var(--accent); color: #fff; } .pk-opt.on small { color: rgba(255,255,255,.85); }
.pk-opt.cur:not(.on) b::after { content: " ✓"; color: var(--accent); }
.pk-t { min-width: 0; } .pk-t b { display: block; font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-t small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: 0 0 30px; }
.pk-empty { padding: 14px; color: var(--muted); text-align: center; }
.pk-new { border: 0; border-top: .5px solid var(--border); border-radius: 0; background: none; color: var(--link); text-align: left; padding: 11px 14px; font-weight: 600; justify-content: flex-start; }
.pk-new:hover { background: var(--surface-2); }
/* New customer / vendor sheet */
.ap-sheet.ps-sheet { width: min(500px, 100%); padding: 0; text-align: left; overflow: hidden; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.ps-sheet form { display: flex; flex-direction: column; min-height: 0; }
.ps-top { display: flex; align-items: center; padding: 12px 16px; border-bottom: .5px solid var(--border); background: var(--surface); }
.ps-top b { flex: 1; text-align: center; font-size: 17px; } .ps-top .link-btn { min-width: 70px; padding: 4px 0; font-size: 16px; } .ps-top .ps-add { text-align: right; justify-content: flex-end; font-weight: 600; }
.ps-body { background: var(--bg); padding: 16px 16px 18px; overflow-y: auto; }
.ps-body .set-sec { margin-bottom: 18px; }
.set-card .set-row > .switch-row { justify-self: end; }
/* Add forms (new product, employee …): the fields as grouped rows */
details.add { border: 0; box-shadow: 0 0 0 .5px var(--border); border-radius: 14px; padding: 14px 18px; }
details.add > summary { font-size: 17px; color: var(--text); list-style: none; } details.add > summary::-webkit-details-marker { display: none; }
details.add > form.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
details.add > form.grid > label:not(.check), details.add fieldset > label:not(.check) { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: .5px solid var(--border); font-size: 14.5px; color: var(--text); }
details.add > form.grid > label > input:not([type=checkbox]), details.add > form.grid > label > select, details.add fieldset > label > input:not([type=checkbox]), details.add fieldset > label > select {
  border: 0; background: var(--surface-2); border-radius: 8px; padding: 7px 9px; }
details.add fieldset { grid-column: 1 / -1; border: 0; border-radius: 12px; background: var(--surface-2); padding: 6px 14px 10px; margin: 14px 0 4px; }
details.add fieldset > legend { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 0 0; float: left; width: 100%; margin-bottom: 6px; }
details.add fieldset > label > input:not([type=checkbox]), details.add fieldset > label > select { background: var(--surface); }
details.add .check { padding: 10px 2px; }
details.add > form.grid > button.primary, details.add > form.grid > .wide:last-child { grid-column: 1 / -1; justify-self: end; margin-top: 14px; }
details.add .medgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) {
  .doc-head { grid-template-columns: 1fr; gap: 0; }
  .doc-bar { left: 0; padding: 10px 16px; flex-wrap: wrap; } .db-t { width: 100%; } .doc-bar .actions { width: 100%; } .doc-bar .actions button { flex: 1; justify-content: center; }
  .docf { padding-bottom: 130px; }
  details.add > form.grid { grid-template-columns: 1fr; }
  details.add > form.grid > label:not(.check), details.add fieldset > label:not(.check) { grid-template-columns: 1fr; gap: 4px; }
}
.doc-bar { position: sticky; left: auto; right: auto; bottom: 0; margin: 10px -36px -72px; padding: 12px 36px 14px; }
.shell.mini .doc-bar { left: auto; }
.docf { padding-bottom: 0; }
@media (max-width: 800px) { .doc-bar { margin: 10px -16px -60px; padding: 10px 16px 14px; } .docf { padding-bottom: 0; } }
/* D4 fixes: line columns keep a readable width (the card scrolls sideways when they cannot fit); legends stay above their fields */
.doc-lines .panel { overflow-x: auto; }
.lines [name=description] { min-width: 130px; } .lines [name=unitId] { min-width: 86px; } .lines [name=lotId] { min-width: 130px; }
.lines [name=quantity] { min-width: 56px; } .lines [name=unitPrice], .lines [name=unitCost] { min-width: 78px; }
.lines [name=incomeAccountId], .lines [name=accountId] { min-width: 140px; } .lines [name=taxCodeId] { min-width: 104px; }
.lines .pk { min-width: 170px; } .lines [name=lotNo], .lines [name=expiry] { min-width: 96px; }
details.add fieldset > legend { float: none; display: block; padding: 8px 0 2px; }
details.add fieldset.med-box .medgrid { margin-top: 6px; }
details.add fieldset.med-box .medgrid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
details.add fieldset.med-box .medgrid input, details.add fieldset.med-box .medgrid select { border: 0; background: var(--surface); border-radius: 8px; padding: 7px 9px; color: var(--text); }
.doc-lines .lines td { padding: 7px 4px; } .doc-lines .lines th { padding: 10px 4px; }
.doc-lines .lines td:first-child, .doc-lines .lines th:first-child { padding-left: 10px; }
.lines [name=description] { min-width: 110px; } .lines [name=lotId] { min-width: 118px; } .lines [name=incomeAccountId], .lines [name=accountId] { min-width: 128px; }
.lines [name=taxCodeId] { min-width: 96px; } .lines .pk { min-width: 150px; }
details.add fieldset.med-box .medgrid label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
/* A form in half the width (inventory adjust and transfer side by side): one column of rows. */
.two > details.add > form.grid { grid-template-columns: 1fr; }
.two > details.add > form.grid > label:not(.check) { grid-template-columns: minmax(100px, 34%) 1fr; }
details.add .bxpc { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
details.add .bxpc input { width: 80px; border: 0; background: var(--surface-2); border-radius: 8px; padding: 7px 9px; }

/* ---------- Phase R: sales receipts, Return Items, refunds ---------- */
.pay-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pay-pills button { border: 0; border-radius: 980px; padding: 6px 13px; font-size: 13.5px; background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 500; }
.pay-pills button.on { background: var(--accent); color: #fff; font-weight: 600; }
.pay-pills button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-sheet.rt-sheet { width: min(580px, 100%); }
.rt-lines { padding: 0 !important; }
.rt-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 16px; position: relative; }
.rt-row + .rt-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--border); }
.rt-row b { font-weight: 500; } .rt-row small, .rt-ch small { display: block; color: var(--muted); font-size: 12.5px; }
.step { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.step button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--accent); font-weight: 700; font-size: 17px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.step > b { min-width: 52px; text-align: center; font-weight: 600; white-space: nowrap; }
.rt-ch { padding: 0 !important; }
.rt-ch .ch { display: grid; grid-template-columns: 1fr 24px; align-items: center; width: 100%; padding: 11px 16px; border: 0; background: none; text-align: left; color: var(--text); font: inherit; cursor: pointer; position: relative; }
.rt-ch .ch + .ch::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--border); }
.rt-ch .ch b { font-weight: 500; } .rt-ch .ck { color: var(--accent); font-weight: 700; font-size: 18px; text-align: right; visibility: hidden; }
.rt-ch .ch.on .ck { visibility: visible; } .rt-ch .ch.off { opacity: .45; cursor: default; }
.rr-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08)); padding: 28px 32px; max-width: 760px; }
.rr-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rr-top h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.rr-g { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 30px; margin: 18px 0 22px; font-size: 14px; }
.rr-g span { display: block; color: var(--muted); font-size: 13px; }
.rr-tot { display: flex; justify-content: flex-end; gap: 40px; margin: 14px 0 6px; font-size: 18px; font-weight: 700; }
@media (max-width: 640px) { .rr-card { padding: 20px 16px; } .rr-g { grid-template-columns: 1fr; } .rt-row { grid-template-columns: 1fr; } .step { justify-content: flex-start; } }
.docf .doc-head div.set-row > span.set-label { display: block; color: var(--text); font-size: 15px; }

/* Sales receipt: Customer, Details and Payment side by side, so the items start higher. */
.docf .doc-head.three { grid-template-columns: 1fr 1fr 1.3fr; gap: 18px; }
@media (max-width: 1250px) { .docf .doc-head.three { grid-template-columns: 1fr 1fr; } .docf .doc-head.three .pay-sec { grid-column: 1 / -1; } }
@media (max-width: 800px) { .docf .doc-head.three { grid-template-columns: 1fr; gap: 0; } }
.docf .doc-head.three .set-card .set-row { grid-template-columns: minmax(80px, 30%) 1fr; }
.docf .doc-head.three .pay-pills button { padding: 5px 11px; font-size: 13px; }

/* Columns chooser on document lines */
.le-add { display: flex; align-items: center; gap: 18px; position: relative; }
.le-cols { margin-left: auto; color: var(--muted) !important; }
.le-pop { position: absolute; right: 0; top: 100%; z-index: 60; background: var(--surface); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 12px 16px; width: 260px; display: grid; gap: 4px; }
.le-pop > b { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.le-pop .switch-row { justify-content: space-between; padding: 6px 0; }
.le-pop small { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.35; }

/* Phase D5: confirm / prompt / email sheets */
.ap-sheet .cs-body { white-space: normal; }
.ap-sheet textarea { width: 100%; box-sizing: border-box; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text); resize: vertical; padding: 4px 0; }
.ap-sheet .ap-b:focus-visible { outline: 3px solid rgba(0,122,255,.45); outline-offset: 2px; }

/* ---------- Phase D5: the admin console in the app's Apple style ---------- */
.adm-body { background: var(--bg); }
.adm-top { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  color: var(--text); border-bottom: .5px solid var(--border); padding: 10px 24px; }
.adm-top a { color: var(--text); }
.adm-brand b { color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.adm-tag { background: #ff9500; color: #fff; }
.adm-top nav { background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.adm-top nav a { padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text); }
.adm-top nav a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.adm-top nav a:hover:not(.on) { background: transparent; color: var(--accent); }
.adm-me { color: var(--muted); } .adm-me a { color: var(--accent); font-weight: 600; }
.adm h1 { font-size: 32px; letter-spacing: -.025em; }
.kpi { border: 0; border-radius: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.04); padding: 16px; }
a.kpi:hover { box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 10px 28px rgba(0,0,0,.07); }
.afilters { background: transparent; }
.afilter { border: 0; background: var(--surface-2); font-weight: 500; }
.afilter.on { background: var(--accent); color: #fff; } .afilter.on span { color: rgba(255,255,255,.8); }
:root[data-theme="dark"] .afilter.on { background: var(--accent); color: #fff; }
.chip-search input { border: 0; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; }
.adm-av { font-size: 13px; font-weight: 700; color: #fff !important; }
.av-green { background: #34c759 !important; } .av-blue { background: #0a84ff !important; } .av-orange { background: #ff9500 !important; }
.av-red { background: #ff3b30 !important; } .av-gray { background: #8e8e93 !important; }
.adm-two .card, .adm-grid .card { border: 0; border-radius: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.04); }
.adm-two .card h3, .adm-grid .card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.adm-form label, .adm-inline label { font-size: 13px; }
.adm-form input, .adm-form select, .adm-inline input, .adm-inline select { border: 0; background: var(--surface-2); border-radius: 10px; }
.kv { font-size: 15px; } .kv dt { font-size: 14px; }
@media (max-width: 800px) { .adm-top nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; } }
.al-ic.adm-av { font-size: 12.5px !important; letter-spacing: -.02em; width: 38px; height: 38px; min-width: 38px; }

/* Users page (Apple style): invite form on the left, people on the right */
.mem-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.role-list { padding: 0 !important; }
.role-row { display: grid !important; grid-template-columns: 34px 1fr 22px; gap: 12px; align-items: center; padding: 11px 16px; cursor: pointer; position: relative;
  border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; margin: 0 !important; }
.role-row + .role-row::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--border); }
.role-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.role-row .rc-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 16px; }
.role-row .rr-t b { display: block; font-size: 15px; font-weight: 500; color: var(--text); margin: 0; }
.role-row .rr-t small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.role-row .rr-ck { color: var(--accent); font-weight: 700; font-size: 17px; visibility: hidden; text-align: right; }
.role-row:has(input:checked) .rr-ck { visibility: visible; }
.role-row:has(input:checked) { background: color-mix(in srgb, var(--accent) 6%, transparent) !important; }
.role-row:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.role-more { margin: 8px 4px 0; } .role-more summary { color: var(--accent); cursor: pointer; font-size: 14px; }
.mem-go { width: 100%; justify-content: center; margin: 4px 0 18px; }
.mem-inv #link-text { width: 100%; border: 0; background: transparent; font-size: 14px; }
@media (max-width: 1000px) { .mem-grid { grid-template-columns: 1fr; } }
.role-list.rolecards { display: block !important; gap: 0; }
.role-list .role-row { grid-template-columns: 34px minmax(0, 1fr) 22px; }
.role-more { max-width: 100%; overflow-x: auto; } .mem-grid > * { min-width: 0; }

/* ---------- Phase D6a ---------- */
.pay-h { display: flex; justify-content: space-between; align-items: baseline; } .pay-h .ap-link { text-transform: none; letter-spacing: 0; font-size: 14px; }
.pmt-list { padding: 0 !important; }
.pmt-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 120px; gap: 12px; align-items: center; padding: 10px 16px; position: relative; }
.pmt-row + .pmt-row::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; border-top: .5px solid var(--border); }
.pay-t b { display: block; font-weight: 500; } .pay-t small { display: block; color: var(--muted); font-size: 12.5px; }
.pay-ck { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #c7c7cc; background: transparent; color: transparent; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; padding: 0; cursor: pointer; }
.pay-ck.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pay-in { width: 110px; justify-self: end; text-align: right; }
.pay-amt { font-size: 18px !important; font-weight: 600; }
.doc-bar .bad { color: var(--c-bad, #ff3b30); font-weight: 600; }
.dep-row { grid-template-columns: 26px minmax(0, 1fr) auto; cursor: pointer; } .dep-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dep-row:has(input:focus-visible) .pay-ck { outline: 2px solid var(--accent); outline-offset: 2px; } .dep-amt { font-weight: 600; }
.narrow-form { max-width: 620px; } .wide-btn { width: 100%; justify-content: center; margin: 4px 0 18px; } #f .wide-btn { max-width: 620px; }
.page .doc-head.doc-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); gap: 18px; align-items: center;
  background: var(--surface); border-radius: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.04); padding: 20px 24px; margin-bottom: 14px; }
.doc-hero .dh-who { display: flex; gap: 14px; align-items: center; min-width: 0; } .doc-hero .dh-who b { font-size: 17px; display: block; }
.doc-hero .dh-av { width: 48px; height: 48px; min-width: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.doc-hero .dh-l { display: block; color: var(--muted); font-size: 12.5px; } .doc-hero .dh-gap { margin-top: 6px; }
.doc-hero .al-pill { font-size: 13px; } .doc-hero .dh-big { display: block; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.doc-hero .dh-owe { color: #ff9500; } .doc-hero .dh-ok { color: #34c759; }
.doc-hero .dh-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; } .doc-hero .dh-bar i { display: block; height: 100%; background: #34c759; border-radius: 3px; }
.page .doc-head.dh-more:not(:has(> div)) { display: none; } .page .doc-head.dh-more { margin-bottom: 16px; }
.off-pg { max-width: 540px; margin: 50px auto; text-align: center; } .off-pg .big { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 36px; background: #e5f1ff; }
.off-pg h2 { font-size: 26px; margin: 0 0 8px; letter-spacing: -.02em; } .off-pg p { color: var(--muted); font-size: 15.5px; line-height: 1.5; }
@media (max-width: 900px) { .page .doc-head.doc-hero { grid-template-columns: 1fr 1fr; } .doc-hero .dh-who { grid-column: 1 / -1; } }
@media (max-width: 640px) { .pmt-row { grid-template-columns: 26px minmax(0, 1fr) 96px; } .pmt-row .al-pill { display: none; } .pay-in { width: 92px; }
  .page .doc-head.doc-hero { padding: 16px; } .doc-hero .dh-big { font-size: 22px; } }
.doc-hero .dh-who > .dh-av { display: grid; place-items: center; color: #fff; font-size: 18px; }
.pmt-row .pay-in { background: var(--surface-2) !important; border: 0 !important; border-radius: 8px; padding: 7px 10px; }
.pay-h .ap-link { background: none !important; padding: 0; }

/* ---------- Phase D6b ---------- */
.add-sheet { width: min(560px, 100%) !important; } .add-sheet .ps-sp { min-width: 70px; }
.add-body form, .add-body .grid, details.add-inline > form { display: block !important; }
.add-body form > label:not(.check), .add-body fieldset > label:not(.check), .add-body .grid > label:not(.check),
details.add-inline > form > label:not(.check) { display: grid !important; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); gap: 10px; align-items: center;
  background: var(--surface); padding: 10px 16px; margin: 0; font-size: 15px; color: var(--text); border-bottom: .5px solid var(--border); }
.add-body form > label:first-of-type, details.add-inline > form > label:first-of-type { border-radius: 12px 12px 0 0; }
.add-body form > label:not(.check):last-of-type, details.add-inline > form > label:not(.check):last-of-type { border-radius: 0 0 12px 12px; border-bottom: 0; }
.add-body input:not([type=checkbox]):not([type=radio]), .add-body select, .add-body textarea,
details.add-inline > form > label input:not([type=checkbox]), details.add-inline > form > label select { width: 100%; min-width: 0; text-align: left; }
.add-body label.check, details.add-inline label.check { display: flex; gap: 8px; align-items: center; padding: 12px 4px; }
.add-body button.primary, details.add-inline > form > button.primary { width: 100%; justify-content: center; margin-top: 14px; }
.add-body p, .add-body .muted { font-size: 13px; color: var(--muted); margin: 8px 4px; }
.add-body fieldset { border: 0; padding: 0; margin: 10px 0 0; }
details.add-inline { background: transparent; border: 0; box-shadow: none; padding: 0; }
details.add-inline > summary { list-style: none; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 0 16px 6px; cursor: default; pointer-events: none; }
details.add-inline > summary::-webkit-details-marker { display: none; }
.acc-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.acc-mfa { padding: 14px 16px !important; } .acc-mfa form.grid { display: grid; gap: 8px; margin-top: 10px; }
#branch-credit .dcard { margin-top: 26px; }
@media (max-width: 640px) { .add-body form > label:not(.check), details.add-inline > form > label:not(.check) { grid-template-columns: 1fr; gap: 4px; } }
details.add-inline > form > label:not(.check), .add-body form > label:not(.check) { padding: 10px 16px !important; }
details.add-inline > form { background: transparent !important; box-shadow: none !important; padding: 0 !important; }

/* ---------- Phase U: edit a member, stock by branch, purchases by product ---------- */
.em-sheet{width:min(540px,94vw)}
.em-sheet .role-list{display:block}
.em-sheet button.set-row{width:100%;background:none;border:0;text-align:left;font:inherit;cursor:pointer;color:inherit}
.em-sheet button.set-row:hover{background:var(--hover,rgba(0,0,0,.03))}
.sb-t td.sb-low{color:#ff3b30;font-weight:600}
.sb-ok{color:#248a3d;font-weight:500;margin:10px 4px}
td.pi-v{padding-left:28px!important;color:var(--muted,#6e6e73)}

/* ---------- Phase N: create a company, new product from a line, picker actions ---------- */
.co-new{margin:14px 0 18px}
.co-new .co-name{display:block;padding:12px 16px 10px;border-bottom:.5px solid var(--border)}
.co-new .co-name span{display:block;font-size:13px;color:var(--muted);margin-bottom:4px}
.co-new .co-name input{width:100%;border:0;background:none;font:inherit;font-size:17px;padding:2px 0;color:var(--text);outline:none}
.co-kind-h{padding:12px 16px 0;font-size:13px;color:var(--muted)}
.co-kinds{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:10px 16px 14px;border-bottom:.5px solid var(--border)}
.co-kind{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;border:1.5px solid var(--border);border-radius:12px;padding:10px 4px;font-size:13px;cursor:pointer;text-align:center}
.co-kind span{font-size:22px}
.co-kind input{position:absolute;opacity:0;pointer-events:none;inset:0;width:100%;height:100%;margin:0}
.co-kind:has(input:checked){border-color:var(--accent,#0a84ff);background:color-mix(in srgb,var(--accent,#0a84ff) 9%,transparent);color:var(--accent,#0a84ff);font-weight:600}
.co-kind:has(input:focus-visible){outline:2px solid var(--accent,#0a84ff);outline-offset:2px}
.co-new .set-row select{max-width:60%}
.co-go{width:100%;margin-top:4px}
@media (max-width:420px){.co-kinds{grid-template-columns:repeat(2,1fr)}}
.pk-new{display:flex;align-items:center;gap:8px;width:100%}
.pk-new small{margin-left:auto;color:var(--muted);font-weight:400;font-size:12px}
.pk-new.hl{background:color-mix(in srgb,var(--accent,#0a84ff) 9%,transparent)}
.np-sheet{width:min(520px,94vw)}
.seg2{display:flex;background:var(--surface-2,rgba(0,0,0,.06));border-radius:9px;padding:2px;margin:4px 0 14px}
.seg2 button{flex:1;border:0;background:none;padding:7px 4px;font:inherit;font-size:13px;border-radius:7px;color:var(--text);cursor:pointer}
.seg2 button.on{background:var(--surface,#fff);box-shadow:0 1px 3px rgba(0,0,0,.15);font-weight:600}
.np-sheet .set-row input.num{text-align:right}
@media (max-width:520px){.co-new .set-row{grid-template-columns:auto 1fr}.co-new .set-row select{justify-self:end;max-width:100%}}

/* ---------- Phase X: discounts, stock by branch switch, bank register ---------- */
.disc-row{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:10px 4px 0;flex-wrap:wrap}
.disc-row .dr-l{font-size:15px;color:var(--text)}
.dr-seg{display:inline-flex;background:var(--surface-2,rgba(0,0,0,.06));border-radius:8px;padding:2px}
.dr-seg button{border:0;background:none;padding:5px 12px;font:inherit;font-size:14px;border-radius:6px;cursor:pointer;color:var(--text);min-height:0}
.dr-seg button.on{background:var(--surface,#fff);box-shadow:0 1px 2px rgba(0,0,0,.15);font-weight:600}
.disc-row input[name=discValue]{width:96px;text-align:right}
.totals .disc span:last-child,.totals .disc span:first-child{color:#248a3d}
.sb-seg{margin:0 0 14px}
.reg-custom{display:flex;align-items:center;gap:6px}.reg-custom input{width:auto;min-width:0;padding:6px 8px;font-size:14px}
.reg-sum{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:4px 0 14px}
.reg-sum div{background:var(--surface,#fff);border-radius:14px;padding:12px 14px;box-shadow:0 1px 2px rgba(0,0,0,.05);display:flex;flex-direction:column;gap:4px}
.reg-sum span{font-size:12px;color:var(--muted)}.reg-sum b{font-size:18px}
.reg-t td.rin,.reg-sum b.rin{color:#248a3d}.reg-t td.rout,.reg-sum b.rout{color:#d70015}
.reg-sum{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:720px){.reg-sum{grid-template-columns:repeat(2,1fr)}.reg-custom{flex-wrap:wrap}}


/* ---------- Phase F: financial statements ---------- */
.fkpi{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:2px 0 14px}
.fkpi div{background:var(--surface,#fff);border-radius:16px;padding:14px 16px;box-shadow:0 1px 2px rgba(0,0,0,.05)}
.fkpi span{display:block;font-size:12px;color:var(--muted)}.fkpi b{display:block;font-size:21px;margin-top:4px}.fkpi small{font-size:12px;color:var(--muted)}
.fkpi b.fpos{color:#248a3d}
.fs-top{display:flex;justify-content:space-between;align-items:center;margin:0 4px 8px}
.fstmt table td,.fstmt table th{white-space:nowrap}.fstmt td.wrap{white-space:normal}
.fstmt tr.fsec td{cursor:pointer;font-weight:700}.fstmt .cv{display:inline-block;width:16px;color:var(--muted);font-size:11px}
.fstmt .cv::before{content:'▾'}.fstmt tr.fsec.closed .cv::before{content:'▸'}
.fstmt tr.facc td:first-child{padding-left:30px}.fstmt tr.fsub td{font-weight:600;color:var(--text);padding-top:10px}
.fstmt button.fx{border:0;background:none;width:18px;min-height:0;padding:0;margin:0 4px 0 -20px;color:var(--muted);cursor:pointer;font-size:11px}
.fstmt button.fx::before{content:'▸'}.fstmt button.fx.open::before{content:'▾'}
.fstmt tr.fpost td{font-size:12.5px;background:color-mix(in srgb,var(--accent,#0a84ff) 4%,transparent);color:var(--text)}.fstmt tr.fpost td:first-child{padding-left:50px;white-space:normal}
.fstmt tr.ftot td{font-weight:700}.fstmt tr.ftot td.num{border-top:1px solid rgba(127,127,127,.45)}
.fstmt tr.fkey td{font-weight:800;background:color-mix(in srgb,var(--accent,#0a84ff) 8%,transparent)}
.fstmt tr.fnet td{font-weight:800;font-size:15.5px;background:color-mix(in srgb,var(--accent,#0a84ff) 14%,transparent)}
.fstmt tr.fopen td{color:var(--muted)}
.fstmt td.fprev{color:var(--muted)}.fpct{color:var(--muted);font-size:12.5px}
.fneg{color:#d70015}.fup{color:#248a3d}.fdn{color:#d70015}.fz{color:var(--muted)}
.fs-ok{color:#248a3d;font-weight:500;margin:10px 4px}
@media (max-width:720px){.fkpi{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{.fkpi,.fs-top{display:none}.fstmt tr.fkey td,.fstmt tr.fnet td{background:none}.fstmt tr.fnet td.num{border-top:1px solid #000;border-bottom:3px double #000}
  .fstmt .cv::before,.fstmt button.fx{display:none}.fneg{color:#000}.fstmt tr.fpost{display:none}}

.fkpi b span{font-size:inherit;font-weight:inherit}

/* Phase F fix: the line above a statement stays in reach while scrolling (Unfold all / Fold all) */
.fs-top{position:sticky;top:52px;z-index:6;background:var(--bg,#f5f5f7);padding:8px 4px;margin:0 -4px 6px}
#unfold-all[disabled]{opacity:.6;cursor:progress}
.fstmt tr.fmore td{font-weight:500}

/* ---------- Phase Z: attachments, imports, price levels, early-payment discount ---------- */
.att-sec { margin-top: 22px; }
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; transition: background .15s; }
.thumbs.over { background: rgba(10,132,255,.06); }
.thumbs .t { position: relative; width: 150px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.thumbs .t:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.thumbs .t .img { height: 110px; background: linear-gradient(135deg,#eef3fb,#dfe7f3); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #7a8aa3; overflow: hidden; }
.thumbs .t .img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t .img.pdf { background: linear-gradient(135deg,#fdecec,#f6dede); color: #c0392b; letter-spacing: .04em; }
.thumbs .t .c { padding: 7px 9px; }
.thumbs .t .c b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.thumbs .t small { display: block; color: var(--muted); }
.thumbs .att-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 24px; opacity: 0; transition: opacity .15s; cursor: pointer; }
.thumbs .t:hover .att-x, .thumbs .t:focus-within .att-x { opacity: 1; }
@media (hover: none) { .thumbs .att-x { opacity: 1; } }
.thumbs .add { width: 150px; height: 160px; border: 2px dashed rgba(10,132,255,.45); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--accent, #0a84ff); font-weight: 600; gap: 4px; font-size: 14px; cursor: pointer; text-align: center; }
.thumbs .add .plus { font-size: 28px; line-height: 1; }
.thumbs .add small { font-weight: 400; color: var(--muted); }
.thumbs .add.busy { opacity: .55; cursor: progress; }
.imp-seg { display: inline-flex; background: rgba(120,120,128,.12); border-radius: 9px; padding: 2px; margin: 0 0 14px; flex-wrap: wrap; }
.imp-seg a { padding: 7px 16px; font-size: 14px; border-radius: 7px; color: var(--text); text-decoration: none; }
.imp-seg a.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.imp-steps { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.imp-steps span { font-size: 13px; padding: 6px 12px; border-radius: 980px; background: rgba(120,120,128,.12); color: var(--muted); }
.imp-steps span.on { background: var(--accent, #0a84ff); color: #fff; font-weight: 600; }
.imp-steps span.done { background: #e7f6ea; color: #248a3d; }
.drop { display: block; border: 2px dashed rgba(10,132,255,.4); border-radius: 16px; padding: 30px 20px; text-align: center; color: var(--text); background: rgba(10,132,255,.03); cursor: pointer; transition: background .15s, border-color .15s; }
.drop.over, .drop:hover { background: rgba(10,132,255,.07); border-color: rgba(10,132,255,.7); }
.drop b { display: block; font-size: 16px; margin-bottom: 4px; }
.drop .drop-ic { display: block; font-size: 26px; color: var(--accent, #0a84ff); margin-bottom: 6px; }
.imp-paste { margin-top: 12px; } .imp-paste summary { cursor: pointer; color: var(--accent, #0a84ff); font-size: 14px; }
.imp-paste textarea { width: 100%; margin-top: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.imp-sum { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.imp-sum .imp-counts { margin-left: auto; }
:is(.imp-sum, .imp-t) .ok { color: #248a3d; font-weight: 600; } :is(.imp-sum, .imp-t) .warn { color: #c93400; font-weight: 600; }
.imp-t tr.bad td { background: rgba(255,149,0,.08); }
.imp-t td.wrap { white-space: normal; max-width: 340px; }
.imp-bar { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.imp-done .set-card { padding: 28px 20px; text-align: center; }
.imp-done h2 { margin: 10px 0 4px; }
.big-ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; font-size: 28px; background: #e5f1ff; }
.big-ic.ok-ic { background: #e7f6ea; color: #248a3d; font-weight: 700; }
.mk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .mk-two { grid-template-columns: 1fr; } }
.pl-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 980px; background: #eef5ff; color: #0a58c9; margin-left: 6px; vertical-align: middle; }
.lv-note { font-size: 11px; color: #0a58c9; text-align: right; margin-top: 2px; white-space: nowrap; }
.cart .lv-note { text-align: left; }
.pl-wrap .al-row.on { background: rgba(10,132,255,.08); }
.pl-empty { padding: 26px 20px; text-align: center; }
.pl-empty b { display: block; margin: 12px 0 6px; }
.pl-fx { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.pay-disc { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pay-disc input { width: 92px; }
.pay-disc small { font-size: 11px; white-space: nowrap; }
:is(#left, .pay-disc) .good { color: #248a3d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .thumbs .t .img { background: linear-gradient(135deg,#1f2a3a,#18202c); color: #8ea3c2; }
  :root:not([data-theme="light"]) .thumbs .t .img.pdf { background: linear-gradient(135deg,#3a1f1f,#2c1818); color: #ff8a80; }
  :root:not([data-theme="light"]) .imp-steps span.done, :root:not([data-theme="light"]) .big-ic.ok-ic { background: rgba(48,209,88,.16); color: #30d158; }
  :root:not([data-theme="light"]) .pl-pill { background: rgba(10,132,255,.18); color: #64b5ff; }
  :root:not([data-theme="light"]) .lv-note { color: #64b5ff; }
  :root:not([data-theme="light"]) :is(.imp-sum, .imp-t) .ok, :root:not([data-theme="light"]) :is(#left, .pay-disc) .good { color: #30d158; }
  :root:not([data-theme="light"]) :is(.imp-sum, .imp-t) .warn { color: #ff9f0a; }
}
:root[data-theme="dark"] .thumbs .t .img { background: linear-gradient(135deg,#1f2a3a,#18202c); color: #8ea3c2; }
:root[data-theme="dark"] .thumbs .t .img.pdf { background: linear-gradient(135deg,#3a1f1f,#2c1818); color: #ff8a80; }
:root[data-theme="dark"] .imp-steps span.done, :root[data-theme="dark"] .big-ic.ok-ic { background: rgba(48,209,88,.16); color: #30d158; }
:root[data-theme="dark"] .pl-pill { background: rgba(10,132,255,.18); color: #64b5ff; }
:root[data-theme="dark"] .lv-note { color: #64b5ff; }
:root[data-theme="dark"] :is(.imp-sum, .imp-t) .ok, :root[data-theme="dark"] :is(#left, .pay-disc) .good { color: #30d158; }
:root[data-theme="dark"] :is(.imp-sum, .imp-t) .warn { color: #ff9f0a; }
/* Phase Z: Pay Bills rows with a Discount column */
.pmt-list.has-disc .pmt-row { grid-template-columns: 26px minmax(0, 1fr) auto 110px 120px; }
.pmt-list.has-disc .pay-disc input { background: var(--surface-2) !important; border: 0 !important; border-radius: 8px; padding: 7px 10px; text-align: right; }
@media (max-width: 640px) { .pmt-list.has-disc .pmt-row { grid-template-columns: 26px minmax(0, 1fr) 84px 92px; } .pay-disc input { width: 80px; } }

/* ---------- Your companies (Apple style) ---------- */
.cp { --cp-bg:#f2f2f7; --cp-card:#fff; --cp-tx:#1d1d1f; --cp-mu:#6e6e73; --cp-mu2:#86868b; --cp-sep:#d2d2d7; --cp-hov:#f5f5f7; --cp-blue:#0071e3; --cp-soft:#e8f1fd;
  min-height:100vh; background:var(--cp-bg); color:var(--cp-tx); display:flex; justify-content:center; padding:44px 16px 40px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Inter,Roboto,sans-serif; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cp { --cp-bg:#000; --cp-card:#1c1c1e; --cp-tx:#f5f5f7; --cp-mu:#a1a1a6; --cp-mu2:#8e8e93; --cp-sep:#38383a; --cp-hov:#2c2c2e; --cp-blue:#0a84ff; --cp-soft:rgba(10,132,255,.18); } }
:root[data-theme="dark"] .cp { --cp-bg:#000; --cp-card:#1c1c1e; --cp-tx:#f5f5f7; --cp-mu:#a1a1a6; --cp-mu2:#8e8e93; --cp-sep:#38383a; --cp-hov:#2c2c2e; --cp-blue:#0a84ff; --cp-soft:rgba(10,132,255,.18); }
.cp * { box-sizing:border-box; }
.cp-w { width:100%; max-width:580px; }
.cp-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 22px; }
.cp-brand { display:flex; align-items:center; gap:10px; font-size:20px; font-weight:700; color:var(--cp-blue); }
.cp-brand img { width:34px; height:34px; border-radius:8px; }
.cp-me { display:flex; align-items:center; gap:10px; min-width:0; background:var(--cp-card); border-radius:980px; padding:5px 14px 5px 5px; box-shadow:0 1px 2px rgba(0,0,0,.06); font-size:15px; }
.cp-me b { font-weight:600; white-space:nowrap; } .cp-me small { color:var(--cp-mu); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cp-av { width:32px; height:32px; border-radius:50%; color:#fff; display:grid; place-items:center; font-weight:600; font-size:13px; flex:none; }
.cp h1 { font-size:34px; font-weight:700; letter-spacing:-.02em; margin:6px 0 4px; color:var(--cp-tx); }
.cp-who { font-size:15px; color:var(--cp-mu); margin:0 0 18px; }
.cp-link { background:none; border:0; padding:0; color:var(--cp-blue); font:inherit; cursor:pointer; }
.cp-link:hover { text-decoration:underline; }
.cp-search { display:flex; align-items:center; gap:8px; background:rgba(118,118,128,.12); border-radius:10px; padding:0 12px; margin:0 0 4px; }
.cp-search input { flex:1; border:0 !important; background:transparent !important; box-shadow:none !important; font-size:17px; padding:10px 0 !important; color:var(--cp-tx); outline:none; }
.cp-h { font-size:13px; font-weight:500; color:var(--cp-mu); text-transform:uppercase; letter-spacing:.02em; margin:24px 16px 8px; }
.cp-g { background:var(--cp-card); border-radius:14px; overflow:hidden; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.cp-r { display:flex; align-items:center; gap:14px; width:100%; padding:12px 16px; position:relative; background:none; border:0; border-radius:0; text-align:left; font:inherit; color:var(--cp-tx); cursor:pointer; }
.cp-r.static { cursor:default; }
.cp-r + .cp-r::before { content:""; position:absolute; top:0; left:70px; right:0; border-top:.5px solid var(--cp-sep); }
.cp-r:not(.static):hover, .cp-r:focus-visible { background:var(--cp-hov); outline:none; }
.cp-r.busy { opacity:.55; cursor:progress; }
.cp-r[hidden], .cp-later { display:none; }
.cp-g.searching .cp-later { display:flex; } .cp-g.searching .cp-more { display:none; }
.cp-ic { width:42px; height:42px; border-radius:11px; display:grid; place-items:center; color:#fff; font-weight:600; font-size:18px; flex:none; position:relative; }
.cp-cur { position:absolute; right:-5px; bottom:-5px; width:19px; height:19px; border-radius:50%; background:#34c759; color:#fff; font-size:11px; display:grid; place-items:center; border:2px solid var(--cp-card); }
.cp-t { flex:1; min-width:0; }
.cp-t b { display:block; font-size:17px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cp-t b.dim { color:var(--cp-mu); }
.cp-t small { display:block; font-size:14.5px; color:var(--cp-mu); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cp-pill { font-size:12.5px; font-weight:600; padding:3px 9px; border-radius:980px; white-space:nowrap; flex:none; }
.cp-pill.ps { display:none; }
.cp-pill.ok { background:#e7f6ea; color:#248a3d; } .cp-pill.trial { background:#fff4e5; color:#c25e00; } .cp-pill.due { background:#ffe5e3; color:#d70015; }
.cp-pill.gray { background:rgba(118,118,128,.14); color:var(--cp-mu); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cp-pill.ok { background:rgba(48,209,88,.18); color:#30d158; } :root:not([data-theme="light"]) .cp-pill.trial { background:rgba(255,159,10,.18); color:#ff9f0a; } :root:not([data-theme="light"]) .cp-pill.due { background:rgba(255,69,58,.18); color:#ff453a; } }
:root[data-theme="dark"] .cp-pill.ok { background:rgba(48,209,88,.18); color:#30d158; } :root[data-theme="dark"] .cp-pill.trial { background:rgba(255,159,10,.18); color:#ff9f0a; } :root[data-theme="dark"] .cp-pill.due { background:rgba(255,69,58,.18); color:#ff453a; }
.cp-chev { color:#c7c7cc; font-size:22px; line-height:1; flex:none; }
.cp-r.add { color:var(--cp-blue); } .cp-r.add .cp-ic { background:var(--cp-soft); color:var(--cp-blue); font-size:24px; font-weight:400; } .cp-r.add b { font-weight:500; }
.cp-more { display:block; width:100%; background:none; border:0; border-top:.5px solid var(--cp-sep); border-radius:0; padding:12px; font:inherit; font-size:15px; color:var(--cp-blue); cursor:pointer; }
.cp-none { padding:16px; text-align:center; color:var(--cp-mu); }
.cp-acts { display:flex; gap:20px; padding:0 16px 12px 72px; font-size:15px; }
.cp-foot { display:flex; justify-content:center; gap:22px; margin-top:28px; font-size:15px; } .cp-foot a { color:var(--cp-blue); text-decoration:none; }
.cp-legal { text-align:center; color:var(--cp-mu2); font-size:13px; margin-top:12px; } .cp-legal a { color:inherit; text-decoration:none; }
.cp-hero { text-align:center; margin:10px 0 24px; } .cp-hero p { font-size:17px; color:var(--cp-mu); margin:6px auto 0; max-width:440px; line-height:1.45; }
.cp-hero .cp-who { font-size:14.5px; margin-top:10px; }
.cp-two { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.cp-big { background:var(--cp-card); border-radius:18px; padding:22px 20px; box-shadow:0 1px 2px rgba(0,0,0,.06); display:flex; flex-direction:column; gap:8px; border:2px solid transparent; }
.cp-big.main { border-color:var(--cp-blue); }
.cp-bic { width:52px; height:52px; border-radius:14px; display:grid; place-items:center; font-size:28px; }
.cp-big b { font-size:19px; font-weight:600; margin-top:6px; } .cp-big small { font-size:15px; color:var(--cp-mu); line-height:1.45; }
.cp-btn { margin-top:auto; align-self:flex-start; border-radius:980px; padding:10px 18px; font-size:15px; font-weight:600; border:0; cursor:pointer; }
.cp-btn.p { background:var(--cp-blue); color:#fff; } .cp-btn.s { background:var(--cp-soft); color:var(--cp-blue); }
.cp-steps { display:flex; justify-content:center; flex-wrap:wrap; gap:10px 26px; margin-top:26px; font-size:14.5px; color:var(--cp-mu); } .cp-steps b { color:var(--cp-tx); }
@media (max-width:560px) {
  .cp { padding:20px 14px; } .cp h1 { font-size:30px; } .cp-two { grid-template-columns:1fr; }
  .cp-me { padding:4px; } .cp-me b, .cp-me small { display:none; }
  .cp-pill.pr { display:none; } .cp-pill.ps { display:inline-block; margin-top:6px; }
  .cp-r { align-items:flex-start; } .cp-chev { align-self:center; }
}
/* New Company sheet */
.nc-sheet { position:relative; overflow:hidden; }
.nc-kinds { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.nc-kind { background:var(--surface); border:2px solid transparent; border-radius:14px; padding:14px 6px 12px; text-align:center; font-size:15px; color:var(--text); box-shadow:0 1px 2px rgba(0,0,0,.06); cursor:pointer; }
.nc-kind i { display:block; font-style:normal; font-size:28px; margin-bottom:6px; } .nc-kind small { display:block; font-size:11.5px; color:var(--muted); margin-top:2px; font-weight:400; }
.nc-kind.on { border-color:#0071e3; color:#0071e3; font-weight:600; }
.nc-pick { width:100%; background:none; border:0; font:inherit; color:inherit; cursor:pointer; text-align:left; }
.nc-pick .nc-val { margin-left:auto; } .nc-pick .nc-val::after { content:"  ›"; color:#c7c7cc; }
.nc-over { position:absolute; inset:0; background:var(--bg, #f2f2f7); display:flex; flex-direction:column; z-index:2; }
.nc-over[hidden] { display:none; }
.nc-s { margin:10px 16px; }
.nc-list { overflow:auto; padding:0 16px 16px; flex:1; }
.nc-list .set-row { width:100%; background:none; border:0; font:inherit; color:inherit; text-align:left; cursor:pointer; display:flex; justify-content:space-between; }
.nc-list small { color:var(--muted); } .nc-ck { color:#0071e3; }
.nc-making { align-items:center; justify-content:center; gap:14px; font-size:17px; text-align:center; padding:20px; }
.nc-making small { color:var(--muted); font-size:15px; }
.nc-spin { width:44px; height:44px; border-radius:50%; border:4px solid rgba(10,132,255,.18); border-top-color:#0071e3; animation:nc-spin .9s linear infinite; }
.nc-prog { width:240px; max-width:80%; height:6px; border-radius:3px; background:rgba(10,132,255,.18); overflow:hidden; }
.nc-prog i { display:block; height:100%; width:40%; background:#0071e3; border-radius:3px; animation:nc-prog 1.6s ease-in-out infinite; }
@keyframes nc-spin { to { transform:rotate(360deg); } }
@keyframes nc-prog { 0% { transform:translateX(-100%); } 100% { transform:translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .nc-spin, .nc-prog i { animation:none; } }
@media (max-width:520px) { .nc-kinds { grid-template-columns:repeat(2,1fr); } }
.nc-sheet .ps-body.nc-body { padding: 16px 16px 20px; }
.nc-sheet .nc-kind { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border-radius: 14px; padding: 14px 6px 12px;
  background: var(--surface); color: var(--text); border: 2px solid transparent; font-weight: 500; }
.nc-sheet .nc-kind.on { border-color: #0071e3; color: #0071e3; font-weight: 600; background: var(--surface); }
.nc-sheet .nc-pick { border-radius: 0; padding: 12px 16px; min-height: 48px; align-items: center; font-weight: 400; display: flex; width: 100%; }
.nc-sheet .nc-list .set-row { border-radius: 0; font-weight: 400; padding: 12px 16px; }

/* ---------- Phase D7: every remaining form in the Apple grouped style ----------
   A form on a page (form.grid) becomes one white card: a row per field, the label left and the value right, a thin line
   between rows, no grey boxes; its button sits under the card on the right. Sheets get the same plain right-aligned fields. */
.page form.grid { display: block; background: var(--surface); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); padding: 0; margin: 0 0 18px; overflow: visible; max-width: 760px; }
.page form.grid > label:not(.check), .page form.grid > .grid > label:not(.check), .page form.grid details > .grid > label:not(.check) {
  display: grid; grid-template-columns: minmax(150px, 40%) minmax(0, 1fr); gap: 4px 14px; align-items: center;
  padding: 11px 16px; margin: 0; font-size: 15px; font-weight: 400; color: var(--text); position: relative; min-height: 48px; }
.page form.grid > label:not(.check) + label:not(.check)::before, .page form.grid > .grid > label:not(.check) + label:not(.check)::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--border); }
.page form.grid > label > small, .page form.grid .grid > label > small { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin: -2px 0 0; }
.page form.grid label > input:not([type=checkbox]):not([type=radio]), .page form.grid label > select, .page form.grid label > textarea,
.add-body label > input:not([type=checkbox]):not([type=radio]), .add-body label > select, details.add-inline label > input:not([type=checkbox]), details.add-inline label > select {
  width: 100%; min-width: 0; background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 8px;
  text-align: right; padding: 6px 2px; font-size: 15px; color: var(--text); }
.page form.grid label > select, .add-body label > select, details.add-inline label > select { text-align-last: right; cursor: pointer; }
.page form.grid label > input:focus, .page form.grid label > select:focus, .add-body label > input:focus, .add-body label > select:focus {
  outline: none; background: var(--surface-2) !important; }
.page form.grid label > input::placeholder, .add-body label > input::placeholder { color: var(--muted); opacity: .75; }
.page form.grid label > textarea { text-align: left; background: var(--surface-2) !important; }
.page form.grid > label.check, .page form.grid .grid > label.check { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 15px; }
.page form.grid > button, .page form.grid > .wide:last-child, .page form.grid > p:last-child { display: flex; }
.page form.grid > button { margin: 12px 16px 14px auto; border-radius: 980px; padding: 9px 20px; }
.page form.grid > button.primary { background: #0071e3; color: #fff; }
.page form.grid > .wide { padding: 10px 16px; }
.page form.grid > .wide:last-child { justify-content: flex-end; gap: 10px; }
.page form.grid > p, .page form.grid > h3, .page form.grid > .note, .page form.grid > .note-box { margin: 10px 16px; }
.page form.grid > h3 { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.page form.grid details { padding: 6px 16px 10px; border-top: .5px solid var(--border); }
.page form.grid details > summary { padding: 8px 0; color: #0071e3; cursor: pointer; font-size: 15px; }
.page form.grid details > .grid { display: block; background: var(--surface-2); border-radius: 12px; margin-top: 6px; }
/* the button row: all buttons of a form share one line at the right */
.add-body label > input:not([type=checkbox]):not([type=radio]), .add-body label > select { text-align: right; }
@media (max-width: 640px) {
  .page form.grid > label:not(.check), .page form.grid .grid > label:not(.check) { grid-template-columns: minmax(110px, 42%) minmax(0, 1fr); }
  .page form.grid { max-width: none; }
}
/* the one form that must stay a small block (2-step sign-in setup) */
.acc-mfa form.grid { display: grid !important; gap: 8px; margin-top: 10px; background: transparent; box-shadow: none; }
/* D7: the fixed asset form with its depreciation preview */
.fa { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.fa-form .set-row > input, .fa-form .set-row > select { text-align: right; text-align-last: right; background: transparent !important; border: 0 !important; box-shadow: none !important; }
.fa-form .set-row > input:focus { background: var(--surface-2) !important; outline: none; }
.fa-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.fa-cat { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface); border: 2px solid transparent; border-radius: 14px;
  padding: 12px 6px; font-size: 14px; font-weight: 500; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: pointer; }
.fa-cat i { font-style: normal; font-size: 24px; line-height: 1.2; } .fa-cat small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.fa-cat.on { border-color: #0071e3; color: #0071e3; font-weight: 600; background: var(--surface); }
.fa-seg { display: inline-flex; background: rgba(118,118,128,.12); border-radius: 9px; padding: 2px; justify-self: end; }
.fa-seg button { border: 0; background: transparent; color: var(--text); padding: 6px 14px; font-size: 14px; font-weight: 500; border-radius: 7px; }
.fa-seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.fa-step { display: inline-flex; align-items: center; gap: 10px; justify-self: end; }
.fa-step b { min-width: 96px; text-align: center; font-weight: 600; }
.fa-step button { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; border: 0; background: rgba(118,118,128,.12); color: #0071e3; font-size: 18px; }
.fa-prev { position: sticky; top: 70px; }
.fa-pv { padding: 18px !important; display: block !important; }
.fa-big { font-size: 32px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fa-cap { font-size: 13px; color: var(--muted); }
.fa-k { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 4px; } .fa-k b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fa-note { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 10px 0 0; }
.fa-empty { color: var(--muted); font-size: 14px; padding: 26px 0; text-align: center; }
.fa-area { fill: rgba(0,113,227,.10); } .fa-line { fill: none; stroke: #0071e3; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; } .fa-dot { fill: #0071e3; }
.fa-ax { font-size: 11px; fill: var(--muted); }
.fa-sw { grid-template-columns: 1fr auto !important; }
@media (max-width: 900px) { .fa { grid-template-columns: 1fr; } .fa-prev { position: static; } }
.page details.add-inline > form.grid > button.primary { width: auto; }
/* D7: a form card is a column; its buttons line up at the bottom right */
.page form.grid { display: flex; flex-direction: column; }
.page form.grid > button { align-self: flex-end; }
.page form.grid > button + button { margin-top: -6px; }
/* facts (Method, Bought, ...) as a grouped card of rows */
.panel.pad:has(> dl.facts) { padding: 0 !important; border-radius: 14px; border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.06); max-width: 760px; }
dl.facts { display: grid; grid-template-columns: minmax(140px, 36%) 1fr; margin: 0; }
dl.facts > dt, dl.facts > dd { margin: 0; padding: 12px 16px; font-size: 15px; border-top: .5px solid var(--border); }
dl.facts > dt { color: var(--text); } dl.facts > dd { text-align: right; color: var(--muted); }
dl.facts > dt:first-of-type, dl.facts > dt:first-of-type + dd { border-top: 0; }
.page form.grid { align-items: stretch; }
dl.facts { gap: 0 !important; }
/* D7: a tick box in a grouped form is a switch on the right of its row, as on iPhone */
.add-body label:has(> input[type=checkbox]), .page form.grid > label:has(> input[type=checkbox]), details.add-inline label:has(> input[type=checkbox]) {
  display: flex !important; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); padding: 11px 16px !important; font-size: 15px; min-height: 48px; }
.add-body label > input[type=checkbox], .page form.grid > label > input[type=checkbox], details.add-inline label > input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: #e9e9eb; position: relative; cursor: pointer;
  transition: background .2s; margin: 0; border: 0; }
.add-body label > input[type=checkbox]::after, .page form.grid > label > input[type=checkbox]::after, details.add-inline label > input[type=checkbox]::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.add-body label > input[type=checkbox]:checked, .page form.grid > label > input[type=checkbox]:checked, details.add-inline label > input[type=checkbox]:checked { background: #34c759; }
.add-body label > input[type=checkbox]:checked::after, .page form.grid > label > input[type=checkbox]:checked::after, details.add-inline label > input[type=checkbox]:checked::after { transform: translateX(20px); }
.add-body label > input[type=checkbox]:focus-visible, .page form.grid > label > input[type=checkbox]:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .add-body label > input[type=checkbox]:not(:checked), :root:not([data-theme="light"]) .page form.grid > label > input[type=checkbox]:not(:checked) { background: #39393d; } }
:root[data-theme="dark"] .add-body label > input[type=checkbox]:not(:checked), :root[data-theme="dark"] .page form.grid > label > input[type=checkbox]:not(:checked) { background: #39393d; }

/* ---------- Sign in, create account and the other pages before a company (Apple style) ---------- */
.ax { --ax-bg:#fff; --ax-card:#fff; --ax-tx:#1d1d1f; --ax-mu:#6e6e73; --ax-mu2:#86868b; --ax-sep:#d2d2d7; --ax-blue:#0071e3; --ax-soft:#f5f5f7; --ax-err:#e30000;
  min-height:100vh; display:flex; flex-direction:column; background:var(--ax-bg); color:var(--ax-tx);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Inter,Roboto,sans-serif; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ax { --ax-bg:#000; --ax-card:#1c1c1e; --ax-tx:#f5f5f7; --ax-mu:#a1a1a6; --ax-mu2:#8e8e93; --ax-sep:#424245; --ax-blue:#2997ff; --ax-soft:#1c1c1e; --ax-err:#ff453a; } }
:root[data-theme="dark"] .ax { --ax-bg:#000; --ax-card:#1c1c1e; --ax-tx:#f5f5f7; --ax-mu:#a1a1a6; --ax-mu2:#8e8e93; --ax-sep:#424245; --ax-blue:#2997ff; --ax-soft:#1c1c1e; --ax-err:#ff453a; }
.ax * { box-sizing:border-box; }
.ax a { color:var(--ax-blue); text-decoration:none; } .ax a:hover { text-decoration:underline; }
.ax-top { display:flex; justify-content:space-between; align-items:center; padding:16px 28px; font-size:14px; color:var(--ax-mu); }
.ax-b { display:flex; align-items:center; gap:8px; color:var(--ax-tx) !important; font-weight:600; font-size:15px; text-decoration:none !important; }
.ax-b img { width:24px; height:24px; border-radius:6px; }
.ax-mid { flex:1; display:flex; justify-content:center; padding:48px 20px 40px; }
.ax-col { width:100%; max-width:400px; text-align:center; }
.ax-ic { width:76px; height:76px; border-radius:18px; display:block; margin:0 auto 22px; }
.ax h1 { font-size:32px; font-weight:600; letter-spacing:-.022em; line-height:1.12; margin:0 0 8px; color:var(--ax-tx); }
.ax-lead { font-size:17px; color:var(--ax-mu); line-height:1.4; margin:0 0 30px; }
.ax form { display:block; margin:0; }
.ax-fld { position:relative; display:block; text-align:left; margin:0; }
.ax-fld input { width:100%; height:56px; border:1px solid var(--ax-sep) !important; border-radius:12px; background:var(--ax-card) !important; color:var(--ax-tx);
  padding:22px 16px 6px; font-size:17px; outline:none; box-shadow:none; transition:border-color .15s, box-shadow .15s; }
.ax-fld.ax-go input { padding-right:56px; }
.ax-fld > span { position:absolute; left:17px; top:18px; font-size:17px; color:var(--ax-mu2); pointer-events:none; transition:all .15s ease; }
.ax-fld input:focus + span, .ax-fld input:not(:placeholder-shown) + span { top:8px; font-size:12px; color:var(--ax-mu); }
.ax-fld input:focus { border-color:var(--ax-blue) !important; box-shadow:0 0 0 3px rgba(0,113,227,.18); }
.ax-fld.bad input { border-color:var(--ax-err) !important; box-shadow:0 0 0 3px rgba(227,0,0,.12); }
.ax-arrow { position:absolute; right:10px; top:50%; transform:translateY(-50%); width:36px; height:36px; padding:0 !important; border-radius:50% !important;
  border:1.5px solid var(--ax-sep) !important; background:transparent !important; color:var(--ax-mu2) !important; display:grid !important; place-items:center; cursor:pointer; }
.ax-fld input:not(:placeholder-shown) ~ .ax-arrow { background:var(--ax-blue) !important; border-color:var(--ax-blue) !important; color:#fff !important; }
.ax-arrow:disabled { opacity:.5; cursor:progress; }
.ax form.busy .ax-arrow svg { animation:ax-pulse .9s ease-in-out infinite; }
@keyframes ax-pulse { 50% { opacity:.3; } }
.ax-stack .ax-fld input { border-radius:0; } .ax-stack .ax-fld:first-child input { border-radius:12px 12px 0 0; }
.ax-stack .ax-fld:last-child input { border-radius:0 0 12px 12px; margin-top:-1px; }
.ax-stack .ax-fld input:focus { position:relative; z-index:1; }
.ax-stack + .ax-fld { margin-top:12px; }
.ax-msg { color:var(--ax-err); font-size:14px; text-align:left; margin:10px 2px 0; line-height:1.4; }
.ax-links { margin-top:26px; display:grid; gap:12px; font-size:15px; color:var(--ax-mu); }
.ax-lnk { background:none !important; border:0 !important; padding:0 !important; color:var(--ax-blue) !important; font:inherit; font-size:15px; cursor:pointer; }
.ax-who { display:inline-flex; align-items:center; gap:8px; background:var(--ax-soft); border-radius:980px; padding:6px 12px 6px 6px; font-size:15px; margin:0 0 22px; max-width:100%; }
.ax-who i { width:26px; height:26px; border-radius:50%; background:#5856d6; color:#fff; font-style:normal; font-size:11px; font-weight:600; display:grid; place-items:center; flex:none; }
.ax-who span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ax-dots { display:flex; justify-content:center; gap:8px; margin:0 0 22px; } .ax-dots i { width:8px; height:8px; border-radius:4px; background:var(--ax-sep); transition:width .2s; }
.ax-dots i.on { background:var(--ax-blue); width:22px; } .ax-dots i.done { background:var(--ax-blue); opacity:.4; }
.ax-step { font-size:13px; color:var(--ax-mu); letter-spacing:.03em; text-transform:uppercase; margin:0 0 8px; }
.ax-btn { display:flex !important; justify-content:center; align-items:center; width:100%; border:0 !important; border-radius:12px !important; background:var(--ax-blue) !important; color:#fff !important;
  font-size:17px; font-weight:500; padding:15px !important; margin-top:22px; cursor:pointer; text-decoration:none !important; }
.ax-btn:disabled { opacity:.4; cursor:default; }
.ax-back { display:block; width:100%; margin-top:10px; background:none !important; border:0 !important; color:var(--ax-blue) !important; font-size:15px; font-weight:400; padding:10px !important; cursor:pointer; }
.ax-pw { display:flex; gap:6px; margin:10px 2px 0; } .ax-pw i { flex:1; height:3px; border-radius:2px; background:var(--ax-sep); } .ax-pw i.on { background:#34c759; }
.ax-pwt { font-size:13px; color:var(--ax-mu); text-align:left; margin:6px 2px 0; }
.ax-kinds { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.ax-kind { display:block !important; text-align:left; border:1px solid var(--ax-sep) !important; border-radius:14px !important; padding:14px 14px 12px !important; background:var(--ax-card) !important; color:var(--ax-tx) !important; cursor:pointer; font-weight:400; }
.ax-kind svg { width:28px; height:28px; stroke:var(--ax-tx); fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; display:block; margin-bottom:10px; }
.ax-kind b { display:block; font-size:16px; font-weight:600; } .ax-kind small { display:block; font-size:13px; color:var(--ax-mu); margin-top:2px; }
.ax-kind.on { border-color:var(--ax-blue) !important; box-shadow:0 0 0 1px var(--ax-blue); } .ax-kind.on svg { stroke:var(--ax-blue); }
.ax-kind:focus-visible { outline:2px solid var(--ax-blue); outline-offset:2px; }
.ax-hint { font-size:13.5px; color:var(--ax-mu); text-align:left; margin:10px 2px 0; line-height:1.45; }
.ax-two { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.ax-sel { display:block; text-align:left; border:1px solid var(--ax-sep); border-radius:12px; padding:8px 14px 6px; background:var(--ax-card); }
.ax-sel small { display:block; font-size:12px; color:var(--ax-mu); }
.ax-sel select { width:100%; border:0 !important; background:transparent !important; box-shadow:none !important; padding:2px 0 !important; font-size:17px; color:var(--ax-tx); outline:none; }
.ax-sel:focus-within { border-color:var(--ax-blue); box-shadow:0 0 0 3px rgba(0,113,227,.18); }
.ax-legal { font-size:12.5px; color:var(--ax-mu2); margin-top:16px; line-height:1.5; }
.ax-done { width:76px; height:76px; border-radius:50%; background:#34c759; color:#fff; display:grid; place-items:center; font-size:40px; margin:0 auto 22px; }
.ax-done.mail { background:var(--ax-blue); font-size:34px; } .ax-done.bad { background:#ff9500; }
.ax-sum { border:1px solid var(--ax-sep); border-radius:14px; text-align:left; margin-top:4px; background:var(--ax-card); }
.ax-sum div { display:flex; justify-content:space-between; gap:12px; padding:12px 16px; font-size:15px; } .ax-sum div + div { border-top:1px solid var(--ax-sep); }
.ax-sum span { color:var(--ax-mu); } .ax-sum b { font-weight:500; text-align:right; }
.ax-h2 { font-size:13px; font-weight:500; color:var(--ax-mu); text-transform:uppercase; letter-spacing:.03em; text-align:left; margin:24px 4px 8px; }
.ax-plans { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.ax-plan { position:relative; border:1px solid var(--ax-sep); border-radius:14px; padding:14px 8px 12px; background:var(--ax-card); }
.ax-plan.pop { border-color:var(--ax-blue); box-shadow:0 0 0 1px var(--ax-blue); }
.ax-plan b { display:block; font-size:15px; font-weight:600; } .ax-plan small { display:block; font-size:12px; color:var(--ax-mu); }
.ax-pr { font-size:22px; font-weight:600; letter-spacing:-.01em; margin:4px 0 2px; font-variant-numeric:tabular-nums; } .ax-pr small { display:inline; font-size:12px; font-weight:400; }
.ax-tag { position:absolute; top:-9px; left:50%; transform:translateX(-50%); background:var(--ax-blue); color:#fff; font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:980px; white-space:nowrap; }
.ax-more { margin-top:18px; text-align:left; } .ax-more summary { color:var(--ax-blue); cursor:pointer; font-size:15px; text-align:center; list-style:none; }
.ax-more summary::-webkit-details-marker { display:none; } .ax-more form { margin-top:12px; }
.ax-foot { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; border-top:1px solid var(--ax-sep); padding:16px 28px; font-size:12px; color:var(--ax-mu2); }
.ax-foot a { color:var(--ax-mu2) !important; }
@media (max-width:520px) { .ax-top { padding:14px 18px; } .ax-mid { padding:28px 18px; } .ax h1 { font-size:28px; } .ax-ic { width:64px; height:64px; } .ax-foot { padding:14px 18px; flex-direction:column; }
  .ax-plans { grid-template-columns:1fr; } .ax-plan { display:flex; align-items:center; justify-content:space-between; text-align:left; padding:12px 14px; } .ax-plan .ax-pr { margin:0; } .ax-tag { left:auto; right:12px; transform:none; } }
@media (prefers-reduced-motion: reduce) { .ax-fld > span, .ax-dots i, .ax-pw i { transition:none; } .ax form.busy .ax-arrow svg { animation:none; } }
.ax-fld > span { z-index: 2; } .ax-arrow { z-index: 2; }

/* Import: Excel template card */
.imp-tpl{display:grid;grid-template-columns:auto 1fr auto auto;gap:6px 12px;align-items:center;margin:12px 0 4px;padding:14px 16px;background:var(--card,#fff);border:1px solid var(--line,#e5e5ea);border-radius:14px}
.imp-tpl > span:first-child{font-size:26px;line-height:1}
.imp-tpl b{display:block;font-size:15px}
.imp-tpl small{display:block;color:var(--muted,#6e6e73);font-size:13px;margin-top:2px}
@media (max-width:700px){.imp-tpl{grid-template-columns:auto 1fr}.imp-tpl button{grid-column:1 / -1;width:100%}}

/* Product page (ip-), Edit Product (ei-), landed cost (lc-) */
.al-amt.np-warn b{display:inline-block;font-size:12.5px;font-weight:600;padding:3px 9px;border-radius:980px;background:#fff4e5;color:#c25e00}
:root[data-theme="dark"] .al-amt.np-warn b{background:#33290f;color:#f5c27a}
.ip-head{display:flex;gap:16px;align-items:center;margin:0 0 16px}.ip-ic{width:60px;height:60px;border-radius:16px;background:#fff4e5;display:grid;place-items:center;font-size:28px;flex:none}
:root[data-theme="dark"] .ip-ic{background:#33290f}
.ip-head h2{margin:0;font-size:22px;letter-spacing:-.01em}.ip-sub{color:var(--muted);font-size:14.5px;margin-top:3px}
.ip-pill{display:inline-block;font-size:12px;font-weight:600;padding:3px 9px;border-radius:980px;background:var(--surface-2);color:var(--muted);vertical-align:middle}.ip-pill.rx{background:#fee4e2;color:#b42318}
.ip-warn{margin:0 0 16px}.ip-warn a{font-weight:600}
.ip-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin:0 0 20px}
.ip-tl{background:var(--surface);border-radius:16px;padding:15px 17px;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.ip-tl small{display:block;font-size:13px;color:var(--muted)}.ip-tl b{display:block;font-size:25px;font-weight:700;letter-spacing:-.02em;margin-top:4px;font-variant-numeric:tabular-nums}
.ip-tl b.ip-sm{font-size:16px;font-weight:600;margin-top:8px}.ip-tl span{font-size:13px;color:var(--muted)}.ip-tl.warn b{color:#c25e00}
.ip-two{display:grid;grid-template-columns:1.2fr 1fr;gap:22px;align-items:start}
.ip-card{background:var(--surface);border-radius:14px;box-shadow:0 1px 2px rgba(0,0,0,.05);overflow:hidden}
.ip-br{display:grid;grid-template-columns:1fr auto 110px;gap:12px;align-items:center;padding:12px 16px;font-size:15px}.ip-br+.ip-br{border-top:.5px solid var(--border)}
.ip-br i{display:block;height:6px;border-radius:3px;background:#0071e3;margin-top:6px;max-width:100%}.ip-br.tot{font-weight:600;background:var(--surface-2)}
.ip-br .n,.ip-m .n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.ip-pr{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;font-size:15px}.ip-pr+.ip-pr{border-top:.5px solid var(--border)}
.ip-pr > span:last-child{text-align:right}.ip-pr.bad{color:var(--danger)}
.ip-mv{margin-top:22px}
.ip-m{display:grid;grid-template-columns:70px 1fr 120px 120px;gap:10px;padding:11px 16px;font-size:14.5px;align-items:center}.ip-m+.ip-m{border-top:.5px solid var(--border)}
.ip-m small{display:block;color:var(--muted);font-size:12.5px;margin-top:1px}.ip-m .up{color:#248a3d}.ip-m .down{color:#d70015}
.mute{color:var(--muted)}
@media (max-width:760px){.ip-two{grid-template-columns:1fr}.ip-tiles{grid-template-columns:1fr 1fr}.ip-m{grid-template-columns:54px 1fr auto}.ip-m > .n:last-child{display:none}.ip-br{grid-template-columns:1fr auto}.ip-br > .n:last-child{display:none}}
.ei-pr{display:grid;grid-template-columns:1fr auto 130px;gap:10px;align-items:center;padding:11px 0;border-top:1px solid var(--border)}.ei-pr:first-child{border-top:0}
.ei-pr small{display:block;color:var(--muted);font-size:12.5px}.ei-pr input{text-align:right}
.ei-auto{gap:6px;font-size:13px;color:var(--muted)}
.ei-addpack{background:none;border:0;color:#0071e3;font:inherit;padding:11px 0;cursor:pointer;text-align:left;width:100%;border-top:1px solid var(--border)}
.ei-arch{padding:0!important;margin-top:6px}.ei-arch button{width:100%;background:none;border:0;padding:13px;font:inherit;font-size:15px;color:#0071e3;cursor:pointer}.ei-arch button.destr{color:#d70015}
#ei-margin b.neg,.neg{color:#d70015}
@media (max-width:520px){.ei-pr{grid-template-columns:1fr 110px}.ei-auto{grid-column:1 / -1;order:3}}
.lc-intro{color:var(--muted);font-size:15px;margin:-4px 0 18px}
.lc-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px;align-items:start}
.lc-seg,.lc-seg2{margin:0;justify-self:end;min-width:230px}
.lc-ch{display:grid;grid-template-columns:1fr 130px;gap:10px;padding:8px 0;border-top:1px solid var(--border)}.lc-ch:first-child{border-top:0}.lc-ch .num{text-align:right}
.lc-add{background:none;border:0;border-top:1px solid var(--border);color:#0071e3;font:inherit;padding:11px 0;cursor:pointer;text-align:left;width:100%}
.lc-tot{display:flex;justify-content:space-between;padding:11px 0 3px;border-top:1px solid var(--border);font-weight:600}
.lc-more summary{display:flex;justify-content:space-between;gap:10px;cursor:pointer;padding:12px 16px;background:var(--surface);border-radius:14px;list-style:none;font-size:15px}
.lc-more summary::-webkit-details-marker{display:none}.lc-more summary::after{content:"›";color:#c7c7cc}.lc-more[open] summary{margin-bottom:10px}
.lc-box{background:var(--surface);border-radius:16px;box-shadow:0 1px 2px rgba(0,0,0,.06);overflow:hidden;margin-top:26px;position:sticky;top:16px}
.lc-h{padding:14px 18px;font-weight:600;font-size:16px;border-bottom:.5px solid var(--border)}
.lc-empty{color:var(--muted);padding:16px 18px;margin:0;font-size:14px}
.lc-r{display:grid;grid-template-columns:1fr auto;gap:4px 12px;padding:14px 18px}.lc-r+.lc-r{border-top:.5px solid var(--border)}
.lc-r small{display:block;color:var(--muted);font-size:13px}.lc-n{text-align:right;font-weight:600;font-variant-numeric:tabular-nums}
.lc-c{grid-column:1 / -1;font-size:15px;margin-top:4px}.lc-c s{color:var(--muted);margin:0 6px}.lc-c b{color:#0071e3}
.lc-why{grid-column:1 / -1;font-size:13px;color:var(--muted)}
.lc-note{grid-column:1 / -1;font-size:13px;color:#8a4b00;background:#fff4e5;border-radius:9px;padding:7px 10px;margin-top:6px}
:root[data-theme="dark"] .lc-note{background:#33290f;color:#f5d9a0}
.lc-f{padding:12px 18px;font-size:13px;color:var(--muted);background:var(--surface-2)}
.lc-bar{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
@media (max-width:760px){.lc-grid{grid-template-columns:1fr}.lc-box{margin-top:0;position:static}.lc-seg,.lc-seg2{min-width:0;width:100%}.lc-ch{grid-template-columns:1fr 110px}}
/* rows inside a set-card that are not set-rows: same 16px inset, light field for amounts */
.set-card .lc-ch,.set-card .lc-add,.set-card .lc-tot,.set-card .ei-pr,.set-card .ei-addpack{padding-left:16px;padding-right:16px;box-sizing:border-box}
.set-card .lc-ch input[name^=d]{text-align:left;max-width:none}
.set-card .lc-ch input.num,.set-card .ei-pr input.num{background:var(--surface-2);border-radius:9px;padding:7px 10px;text-align:right}
.set-card .ei-pr input.num:disabled{opacity:.55}
.set-card .lc-tot{padding-bottom:11px}
.set-card .lc-ch input[name^=d]{text-align:left!important;max-width:none!important}
.set-card .lc-ch input.num,.set-card .ei-pr input.num{background:var(--surface-2)!important;border-radius:9px!important;padding:7px 10px!important;text-align:right!important}
.lc-seg button,.lc-seg2 button{white-space:nowrap;padding:7px 12px}
.ip-head h2{font-size:17px;font-weight:600}
@media (max-width:760px){.ip-m{grid-template-columns:48px 1fr auto auto;font-size:13.5px;gap:8px}.ip-m > .n:last-child{display:block}}

/* Chart of accounts (cb-), account sheet (as-), account page (ac-) */
.cb-eq{display:flex;flex-wrap:wrap;gap:6px 18px;align-items:center;margin:-6px 0 16px;font-size:14.5px;color:var(--muted)}.cb-eq b{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}
.cb-ok{color:#248a3d;font-weight:600}.cb-bad{color:#d70015;font-weight:600}
.cb-alert{display:flex;gap:10px;align-items:center;background:#fee4e2;color:#7a1a12;border-radius:14px;padding:11px 14px;margin:0 0 16px;font-size:14px}.cb-alert a{color:#b42318;font-weight:600;margin-left:auto;white-space:nowrap}
:root[data-theme="dark"] .cb-alert{background:#3a1d1c;color:#ffc9c4}:root[data-theme="dark"] .cb-alert a{color:#ff8a80}
.cb-tools{display:flex;gap:10px;align-items:center;margin:0 0 18px}
.cb-seg{display:inline-flex;background:var(--surface-2);border-radius:10px;padding:2px;overflow-x:auto;scrollbar-width:none;flex:none;max-width:100%}.cb-seg::-webkit-scrollbar{display:none}
.cb-seg a{padding:6px 13px;border-radius:8px;font-size:14px;color:var(--text);white-space:nowrap;text-decoration:none}.cb-seg a.on{background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.12);font-weight:600}
.cb-search{flex:1;min-width:160px;display:flex;align-items:center;gap:6px;background:var(--surface-2);border-radius:10px;padding:0 12px}.cb-search input{border:0;background:transparent;padding:8px 0;font:inherit;font-size:14px;width:100%;outline:none;color:var(--text)}
.cb-opt{position:relative}.cb-optb{background:var(--surface-2);border:0;border-radius:10px;padding:8px 12px;font:inherit;font-size:14px;color:var(--text);white-space:nowrap;cursor:pointer}
.cb-pop{position:absolute;right:0;top:42px;z-index:20;width:280px;background:var(--surface);border-radius:13px;box-shadow:0 10px 40px rgba(0,0,0,.18),0 0 0 .5px var(--border);padding:4px 0}
.cb-pl{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;font-size:15px;cursor:pointer}.cb-pl+.cb-pl{border-top:.5px solid var(--border)}.cb-pl small{display:block;color:var(--muted);font-size:12px}
.cb-g{margin:0 0 20px}.cb-gh{display:flex;align-items:center;gap:10px;padding:0 4px 8px}
.cb-gi{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;font-size:15px;flex:none}
:root[data-theme="dark"] .cb-gi{filter:saturate(.9) brightness(.85)}
.cb-gt{flex:1;min-width:0}.cb-gt b{display:block;font-size:15px}.cb-gt small{display:block;color:var(--muted);font-size:12.5px}
.cb-gs{text-align:right;font-variant-numeric:tabular-nums}.cb-gs b{display:block;font-size:15px}.cb-gs small{display:block;color:var(--muted);font-size:12px}
.cb-card{background:var(--surface);border-radius:14px;box-shadow:0 1px 2px rgba(0,0,0,.05)}
.cb-r{display:grid;grid-template-columns:58px 1fr auto 34px;gap:10px;align-items:center;padding:11px 6px 11px 16px;font-size:15px;position:relative;cursor:pointer}
.cb-r:not(.nums){grid-template-columns:0 1fr auto 34px;gap:0 10px}
.cb-r+.cb-r::before{content:"";position:absolute;top:0;left:16px;right:0;border-top:.5px solid var(--border)}
.cb-r:hover{background:var(--surface-2)}.cb-r:first-child{border-radius:14px 14px 0 0}.cb-r:last-child{border-radius:0 0 14px 14px}.cb-r:only-child{border-radius:14px}
.cb-r.calc{cursor:default}.cb-r.calc:hover{background:none}
.cb-code{color:var(--muted);font-variant-numeric:tabular-nums;font-size:14px}.cb-n{min-width:0;position:relative}.cb-n small{display:block;color:var(--muted);font-size:12.5px;margin-top:1px}
.cb-sub{position:absolute;margin-left:-18px;color:#c7c7cc;font-style:normal}
.cb-b{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.cb-b.neg{color:#d70015;font-weight:600}.cb-b.zero{color:var(--muted)}
.cb-dots{width:30px;height:30px;border-radius:50%;border:0;background:none;color:var(--muted);font-weight:700;letter-spacing:1px;cursor:pointer;font-size:14px}.cb-dots:hover{background:var(--surface-2);color:var(--text)}
.cb-lock{font-size:12px;margin-left:6px;opacity:.6}.cb-calc{display:inline-block;font-size:11px;font-weight:600;padding:1px 7px;border-radius:980px;background:var(--surface-2);color:var(--muted);margin-left:6px;vertical-align:middle}
.cb-menu{position:absolute;right:8px;top:44px;z-index:20;width:220px;background:var(--surface);border-radius:13px;box-shadow:0 10px 40px rgba(0,0,0,.18),0 0 0 .5px var(--border);overflow:hidden;cursor:default}
.cb-menu button{display:flex;justify-content:space-between;width:100%;padding:11px 14px;font:inherit;font-size:15px;background:none;border:0;color:var(--text);cursor:pointer;text-align:left}
.cb-menu button+button{border-top:.5px solid var(--border)}.cb-menu button:hover{background:var(--surface-2)}.cb-menu .red{color:#d70015}.cb-menu span{color:var(--muted)}
.cb-foot{color:var(--muted);font-size:13px;padding:0 4px}
@media (max-width:700px){.cb-tools{flex-wrap:wrap}.cb-seg{order:3;width:100%}.cb-r,.cb-r.nums,.cb-r:not(.nums){grid-template-columns:1fr auto 30px;gap:0 8px;padding-left:14px}.cb-r .cb-code{display:none}.cb-n small.cb-c2{display:block}
  .cb-alert{flex-wrap:wrap}.cb-alert a{margin-left:0}.cb-eq{font-size:13.5px}.cb-pop{right:-4px}}
.as-ty{display:grid;grid-template-columns:30px 1fr 20px;gap:10px;align-items:center;width:100%;padding:10px 14px;background:none;border:0;font:inherit;color:var(--text);text-align:left;cursor:pointer;position:relative}
.as-ty+.as-ty::before{content:"";position:absolute;top:0;left:54px;right:0;border-top:.5px solid var(--border)}.as-ty b{font-weight:500;font-size:15px}.as-ty small{display:block;color:var(--muted);font-size:12.5px}
.as-ty.on b{color:#0071e3}.as-ck{color:#0071e3;font-weight:700}.as-ic{font-size:18px}
.as-more{background:none;border:0;border-top:.5px solid var(--border);width:100%;text-align:left;color:#0071e3;font:inherit;font-size:14.5px;padding:10px 14px;cursor:pointer}
.ac-t{display:grid;grid-template-columns:60px 1fr 110px 110px 120px;gap:10px;padding:11px 16px;font-size:14.5px;align-items:center}.ac-t+.ac-t{border-top:.5px solid var(--border)}
.ac-t small{display:block;color:var(--muted);font-size:12.5px}.ac-t .n{text-align:right;font-variant-numeric:tabular-nums}.ac-t .n small.mob{display:none}
.ac-h{font-size:11.5px;color:var(--muted);text-transform:uppercase;background:var(--surface-2)}.up{color:#248a3d}.dn{color:#d70015}.ip-tl b.up{color:#248a3d}.ip-tl b.dn,.ip-tl b.neg{color:#d70015}
.ac-link{text-decoration:none;color:#0071e3}
@media (max-width:760px){.ac-t{grid-template-columns:50px 1fr auto}.ac-t .hide{display:none}.ac-t .n small.mob{display:block}}

.cb-n small.cb-c2{display:none}
@media (max-width:700px){.cb-n small.cb-c2{display:block}}

/* Statements: side panel (where the money went, health check), brackets, red cash rows */
.fwrap{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:18px;align-items:start}
.fwrap > .panel,.fwrap > div > .panel{margin-top:0}
.fside{background:var(--surface);border-radius:14px;box-shadow:0 1px 2px rgba(0,0,0,.05);padding:12px 16px 14px;font-size:14px}
.fside h3{margin:4px 0 10px;font-size:15px}.fside h3:not(:first-child){margin-top:16px;padding-top:12px;border-top:.5px solid var(--border)}
.fside ul{margin:0;padding-left:18px}.fside li{margin-bottom:8px;line-height:1.4}
.fbar{display:grid;grid-template-columns:1fr auto;gap:2px 8px;margin-bottom:10px}.fbar b{font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}
.fbar i{grid-column:1 / -1;display:block;height:7px;border-radius:4px;background:var(--surface-2);overflow:hidden}.fbar em{display:block;height:100%;border-radius:4px;background:#2370cd}
.fside-note{color:var(--muted);font-size:12.5px;margin:2px 0 0}
.fhc{display:grid;grid-template-columns:1fr auto;gap:2px 8px;padding:9px 0}.fhc+.fhc{border-top:.5px solid var(--border)}.fhc b{font-variant-numeric:tabular-nums}
.fhc small{grid-column:1 / -1;color:var(--muted);font-size:12.5px;line-height:1.35}
.fbadge{font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:980px;margin-left:4px}.fbadge.ok{background:#e8f8ec;color:#1a7f37}.fbadge.mid{background:#fff4e5;color:#b25000}.fbadge.low{background:#fee4e2;color:#b42318}
:root[data-theme="dark"] .fbadge.ok{background:#14301c;color:#7ee2a0}:root[data-theme="dark"] .fbadge.mid{background:#33290f;color:#f5c27a}:root[data-theme="dark"] .fbadge.low{background:#3a1d1c;color:#ff9e97}
.fstmt tr.fred td{color:#d70015}.fstmt tr.fred td .fneg{font-weight:600}
.fstmt .fneg{color:inherit}.fstmt tr.fnet .fneg,.fstmt tr.fkey .fneg{color:#d70015}
@media (max-width:1100px){.fwrap{grid-template-columns:1fr}}
@media print{.fwrap{display:block}.fstmt tr.fred td{color:#000}}

/* Dashboard v2 (dk-): branch, dates, compare, cards */
.dk-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap;margin:6px 0 10px}.dk-ey{color:var(--muted);font-size:14px}.dk-head h1{margin:2px 0 0;font-size:32px;letter-spacing:-.02em}
.dk-tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center;position:relative}
.dk-seg{display:inline-flex;background:var(--surface-2);border-radius:10px;padding:2px;overflow-x:auto;scrollbar-width:none;max-width:100%}.dk-seg::-webkit-scrollbar{display:none}
.dk-seg button{border:0;background:none;padding:6px 12px;border-radius:8px;font:inherit;font-size:14px;color:var(--text);white-space:nowrap;cursor:pointer}.dk-seg button[aria-pressed="true"]{background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.12);font-weight:600}
.dk-pill{display:inline-flex;align-items:center;gap:6px;background:var(--surface-2);border:0;border-radius:10px;padding:6px 12px;font:inherit;font-size:14px;color:var(--text);cursor:pointer;white-space:nowrap}
.dk-brsel{padding:3px 6px 3px 8px;color:#0071e3}.dk-brsel select{border:0;background:transparent;font:inherit;font-size:14px;color:#0071e3;padding:4px 2px;max-width:220px;cursor:pointer}
.dk-ic-s{width:22px!important;height:22px!important;border-radius:6px!important}.dk-ic-s svg{width:14px!important;height:14px!important}
.dk-sub{display:flex;gap:6px 16px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:13px;margin:0 0 14px}.dk-sub b{color:var(--text);font-weight:600}.dk-sub .link-btn{font-size:13px;padding:0}
.dk-k{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 14px}
.dk-kt{display:block;background:var(--surface);border-radius:18px;padding:16px 18px;box-shadow:0 1px 2px rgba(0,0,0,.06);color:inherit;text-decoration:none}
.dk-kt small{display:block;font-size:13px;color:var(--muted)}.dk-kt b{display:block;font-size:28px;font-weight:700;letter-spacing:-.02em;margin:4px 0 2px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dk-kt span{font-size:13px;color:var(--muted)}
.dk-up{color:#248a3d;font-weight:600}.dk-dn{color:#d70015;font-weight:600}.dk-flat{color:var(--muted)}.dk-neg{color:#d70015!important}
.dk-al{display:flex;gap:10px;align-items:center;background:#fee4e2;color:#7a1a12;border-radius:14px;padding:11px 14px;margin:0 0 14px;font-size:14px}.dk-al a{margin-left:auto;color:#b42318;font-weight:600;white-space:nowrap}
:root[data-theme="dark"] .dk-al{background:#3a1d1c;color:#ffc9c4}:root[data-theme="dark"] .dk-al a{color:#ff8a80}
.dk-g{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px;align-items:start}.dk-span2{grid-column:span 2}
.dk-cd{background:var(--surface);border-radius:18px;padding:16px 18px;box-shadow:0 1px 2px rgba(0,0,0,.06);min-width:0;position:relative}
.dk-ch{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:10px}.dk-ch b{font-size:17px}.dk-ch span,.dk-ch a{font-size:13px;color:var(--muted);text-align:right}.dk-ch a{color:#0071e3;white-space:nowrap}
.dk-big{font-size:28px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}.dk-big.s{font-size:22px}.dk-cap{color:var(--muted);font-size:13px}
.dk-r{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 0;color:inherit;text-decoration:none}.dk-r+.dk-r{border-top:.5px solid var(--border)}
.dk-r > div{min-width:0;overflow:hidden;text-overflow:ellipsis}.dk-r .n{text-align:right;font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}.dk-r small{display:block;color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dk-go{color:#0071e3}
.dk-ic{width:32px;height:32px;border-radius:9px;display:grid;place-items:center}.dk-ic svg{width:18px;height:18px}
.t-blue{background:#e5f1ff;color:#0071e3}.t-green{background:#e8f8ec;color:#248a3d}.t-red{background:#fee4e2;color:#d70015}.t-orange{background:#fff4e5;color:#c25e00}.t-violet{background:#f0ebff;color:#6a4ce2}.t-gray{background:var(--surface-2);color:var(--muted)}
:root[data-theme="dark"] .t-blue{background:#16304f;color:#7fb8ff}:root[data-theme="dark"] .t-green{background:#14301c;color:#7ee2a0}:root[data-theme="dark"] .t-red{background:#3a1d1c;color:#ff9e97}:root[data-theme="dark"] .t-orange{background:#33290f;color:#f5c27a}:root[data-theme="dark"] .t-violet{background:#2a2350;color:#b7a8ff}
.dk-hb{display:flex;height:8px;border-radius:4px;overflow:hidden;background:var(--surface-2);margin:4px 0 8px}.dk-hb i{display:block;height:100%;border-radius:4px}.dk-split{margin:10px 0}.dk-split i{border-radius:0}
.dk-lg{display:flex;justify-content:space-between;gap:10px;font-size:14px;padding:4px 0;color:inherit;text-decoration:none}.dk-lg b{font-variant-numeric:tabular-nums;white-space:nowrap}.dk-lg > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dk-d{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:8px}.dk-sepl{border-top:.5px solid var(--border);margin-top:6px;padding-top:8px}
.dk-tot{display:flex;justify-content:space-between;font-weight:700;padding-top:9px;border-top:1px solid var(--border);margin-top:4px;font-variant-numeric:tabular-nums}
.dk-chart{position:relative}.dk-tip{position:absolute;transform:translate(-50%,-100%);background:var(--text);color:var(--bg);border-radius:8px;padding:5px 9px;font-size:12.5px;pointer-events:none;white-space:nowrap}.dk-tip .dk-cap{color:inherit;opacity:.75}
.dk-sp{display:flex;gap:16px;align-items:center;font-size:12.5px;color:var(--muted);margin-top:6px}.dk-sp i{display:inline-block;width:14px;height:3px;border-radius:2px;vertical-align:middle;margin-right:5px}.dk-sp i.dash{background:repeating-linear-gradient(90deg,#98a2b3 0 4px,transparent 4px 7px)}.dk-sp .link-btn{font-size:12.5px;padding:0;margin-left:auto}
.dk-table{width:100%;font-size:13.5px;margin-top:8px}.dk-table td,.dk-table th{padding:5px 4px}
.dk-fl{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:8px;margin:8px 0;font-size:13px;color:var(--muted)}.dk-fl i{display:inline-block;height:24px;border-radius:5px;min-width:3px;vertical-align:middle}.dk-fl b{color:var(--text);margin-left:8px;font-variant-numeric:tabular-nums}
.dk-fl > i{grid-column:2}.dk-fl{grid-template-columns:34px auto 1fr}.dk-fl b{justify-self:start}
.dk-bud{margin:6px 0}
.dk-k4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.dk-cmp{display:grid;grid-template-columns:1.4fr 1fr 1fr 1fr;gap:8px;font-size:14px;padding:8px 0;color:inherit;text-decoration:none}.dk-cmp+.dk-cmp{border-top:.5px solid var(--border)}.dk-cmp span:not(:first-child){text-align:right;font-variant-numeric:tabular-nums}
.dk-cmph{font-size:11.5px;color:var(--muted);text-transform:uppercase}.dk-cmpt{font-weight:700}
.dk-gs{background:var(--surface);border-radius:18px;padding:20px 22px;box-shadow:0 1px 2px rgba(0,0,0,.06);max-width:760px;margin-bottom:14px}.dk-gs.small{max-width:none}
.dk-pb{height:8px;border-radius:4px;background:var(--surface-2);margin:12px 0 6px;overflow:hidden}.dk-pb i{display:block;height:100%;background:#34c759}
.dk-st{display:grid;grid-template-columns:30px 1fr auto;gap:12px;align-items:center;padding:11px 0}.dk-st+.dk-st{border-top:.5px solid var(--border)}.dk-st small{display:block;color:var(--muted);font-size:13px}.dk-st a{color:#0071e3;font-weight:600;font-size:14px}
.dk-o{width:24px;height:24px;border-radius:50%;border:2px solid #c7c7cc;display:grid;place-items:center;font-size:13px}.dk-o.d{background:#34c759;border-color:#34c759;color:#fff}
.dk-sk{height:12px;border-radius:6px;background:var(--surface-2);margin:10px 0;animation:dkpulse 1.2s ease-in-out infinite}@keyframes dkpulse{50%{opacity:.5}}
.dk-err{text-align:center;padding:16px 8px;color:var(--muted);font-size:14px}.dk-err b{display:block;color:var(--text);margin-bottom:4px}.dk-err a{color:#0071e3;font-weight:600}
.dk-pop{position:absolute;right:120px;top:44px;z-index:40;background:var(--surface);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.2),0 0 0 .5px var(--border);padding:12px;width:310px;font-size:14px}
.dk-q{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:10px}.dk-q button{border:0;background:var(--surface-2);border-radius:8px;padding:7px 9px;font:inherit;font-size:13.5px;color:var(--text);cursor:pointer}.dk-q button.on{background:#0071e3;color:#fff}
.dk-dt{display:grid;grid-template-columns:1fr 1fr;gap:8px}.dk-dt label,.dk-cmpsel{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--muted)}.dk-dt input,.dk-cmpsel select{font-size:14px}.dk-cmpsel{margin-top:8px}
.dk-popb{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
.dk-ci{display:grid;grid-template-columns:56px 1fr auto;gap:10px;align-items:center;padding:9px 14px}.dk-ci+.dk-ci{border-top:.5px solid var(--border)}
.dk-mv button{border:0;background:var(--surface-2);border-radius:6px;width:24px;height:24px;margin-right:2px;cursor:pointer;color:var(--text)}.dk-mv button:disabled{opacity:.3;cursor:default}
.dk-g.private .n,.dk-g.private .dk-big,.dk-g.private .dk-lg b,.dk-g.private .dk-tot span:last-child,.dk-g.private .dk-fl b,.dk-g.private .dk-cmp span:not(:first-child),.dk-k.private b{filter:blur(7px)}
@media (max-width:1180px){.dk-g{grid-template-columns:repeat(2,minmax(0,1fr))}.dk-k{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:700px){.dk-g{grid-template-columns:1fr}.dk-span2{grid-column:auto}.dk-head h1{font-size:26px}.dk-kt b{font-size:22px}.dk-k4{grid-template-columns:1fr 1fr}.dk-pop{right:0;left:0;width:auto}.dk-al{flex-wrap:wrap}.dk-al a{margin-left:0}.dk-cmp{grid-template-columns:1.2fr 1fr 1fr;font-size:13px}.dk-cmp span:nth-child(3){display:none}}
.dk-kt b span{font-size:inherit;color:inherit;font-weight:inherit}
.dk-fl{display:flex!important;align-items:center;gap:8px}.dk-fl > span{width:34px;flex:none}.dk-fl > i{flex:none;height:24px;border-radius:5px}.dk-fl > b{margin-left:4px}

/* Import: plain fixes under a row's problem */
.imp-fx{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.imp-fx button{border:0;border-radius:980px;padding:4px 11px;font:inherit;font-size:12.5px;font-weight:600;background:#e5f1ff;color:#0071e3;cursor:pointer}
.imp-fx button.alt{background:var(--surface-2);color:var(--text)}

/* ---------- Desktop mode (DM1) ---------- */
:root { --dm-ven: #d97706; --dm-inv: #be4b7c; --dm-cus: #0e8fa3; --dm-emp: #5e5ce6; --dm-co: #8e8e93; --dm-bank: #1f8a4c;
  --dm-glass: rgba(255,255,255,.88); --dm-menu: rgba(255,255,255,.97); --dm-wbar: #f6f7f9; --dm-line2: #cfd3da;
  --dm-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 18px 48px rgba(0,0,0,.16), 0 3px 10px rgba(0,0,0,.06); --dm-red: #d70015; --dm-green: #1f8a4c; --dm-amber: #a65800; }
:root[data-theme="dark"] { --dm-ven: #f0a03c; --dm-inv: #e0709e; --dm-cus: #3cc3d6; --dm-emp: #8f8dff; --dm-co: #9a9aa0; --dm-bank: #32d468;
  --dm-glass: rgba(30,30,32,.88); --dm-menu: rgba(44,44,47,.98); --dm-wbar: #26262a; --dm-line2: #48484c; --dm-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 48px rgba(0,0,0,.55);
  --dm-red: #ff5a50; --dm-green: #32d468; --dm-amber: #ffb340; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --dm-ven: #f0a03c; --dm-inv: #e0709e; --dm-cus: #3cc3d6; --dm-emp: #8f8dff; --dm-co: #9a9aa0; --dm-bank: #32d468;
  --dm-glass: rgba(30,30,32,.88); --dm-menu: rgba(44,44,47,.98); --dm-wbar: #26262a; --dm-line2: #48484c; --dm-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 48px rgba(0,0,0,.55);
  --dm-red: #ff5a50; --dm-green: #32d468; --dm-amber: #ffb340; } }
svg.dmi { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
span.dmi { width: 16px; height: 16px; display: block; flex: none; }
.dm-app { height: 100vh; overflow: hidden; }
.dm { height: 100vh; display: flex; flex-direction: column; font-size: 13px; line-height: 1.38; }
.dm .num { font-variant-numeric: tabular-nums; } .dm .red { color: var(--dm-red); } .dm .green { color: var(--dm-green); }
.dm button { font: inherit; color: inherit; }
.dm-tb { height: 38px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--dm-glass); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.dm-logo { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #0a84ff, #5e5ce6); display: grid; place-items: center; color: #fff; }
.dm-logo svg { width: 13px; height: 13px; stroke-width: 2.2; }
.dm-co { font-weight: 600; white-space: nowrap; } .dm-sep { color: var(--muted); } .dm-m { color: var(--muted); }
.dm-br { display: flex; align-items: center; gap: 6px; color: var(--muted); } .dm-br select { border: 0; background: transparent; color: var(--text); font: inherit; padding: 2px 0; }
.dm-find { margin-left: auto; position: relative; width: 300px; height: 27px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; gap: 7px; padding: 0 9px; color: var(--muted); }
.dm-find input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; min-width: 0; }
.dm-find kbd { font: inherit; font-size: 10.5px; border: 1px solid var(--dm-line2); border-radius: 4px; padding: 0 4px; background: var(--surface); }
.dm-find:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.dm-fl { position: absolute; top: 31px; right: 0; width: 380px; background: var(--dm-menu); border-radius: 10px; box-shadow: var(--dm-shadow); padding: 5px; z-index: 300; }
.dm-fl button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 6px 9px; border-radius: 6px; text-align: left; cursor: pointer; }
.dm-fl button span { flex: 1; } .dm-fl button small { color: var(--muted); font-size: 11.5px; }
.dm-fl button.hl { background: var(--accent); color: #fff; } .dm-fl button.hl small { color: rgba(255,255,255,.8); }
.dm-fl p { margin: 8px 10px; color: var(--muted); }
.dm-me { position: relative; } .dm-av { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 11px; cursor: pointer; }
.dm-mm { position: absolute; right: 0; top: 34px; width: 260px; background: var(--dm-menu); border-radius: 12px; box-shadow: var(--dm-shadow); padding: 6px; z-index: 300; }
.dm-mm .dm-mmh { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; } .dm-mm .dm-mmh small { display: block; color: var(--muted); }
.dm-mm button, .dm-mm a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; color: var(--text); cursor: pointer; }
.dm-mm button:hover, .dm-mm a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.dm-mb { height: 31px; flex: none; display: flex; align-items: center; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dm-mb > button { border: 0; background: none; padding: 4px 9px; border-radius: 6px; cursor: default; }
.dm-mb > button:hover { background: var(--surface-2); } .dm-mb > button.on { background: var(--accent); color: #fff; }
.dm-mode { margin-left: auto; display: flex; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.dm-mode button { border: 0; background: none; padding: 2px 12px; border-radius: 6px; color: var(--muted); cursor: pointer; font-weight: 500; }
.dm-mode button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 .5px var(--border), 0 1px 2px rgba(0,0,0,.08); cursor: default; }
.dm > .banner { flex: none; margin: 0; border-radius: 0; }
.dm-body { flex: 1; min-height: 0; display: flex; }
.dm[data-bar="top"] .dm-body { flex-direction: column; } .dm[data-bar="hidden"] .dm-ib { display: none; }
.dm-ib { width: 86px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 8px 7px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.dm-ib button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 2px 6px; border: 0; background: none; border-radius: 10px; font-size: 11px; cursor: pointer; text-align: center; }
.dm-ib button span { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-ib button svg { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: var(--surface-2); stroke-width: 1.6; }
.dm-ib button:hover svg { background: var(--accent-soft); color: var(--accent); }
.dm-ib button.add { color: var(--muted); } .dm-ib button.add svg { background: none; border: 1px dashed var(--dm-line2); }
.dm-ib hr { border: 0; border-top: 1px solid var(--border); margin: 6px 6px; } .dm-ibl { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.dm[data-bar="top"] .dm-ib { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); padding: 4px 10px; overflow-x: auto; overflow-y: hidden; align-items: center; }
.dm[data-bar="top"] .dm-ib button { flex-direction: row; padding: 4px 8px; gap: 6px; } .dm[data-bar="top"] .dm-ib button svg { width: 24px; height: 24px; padding: 5px; }
.dm[data-bar="top"] .dm-ib hr { border-top: 0; border-left: 1px solid var(--border); height: 26px; margin: 0 6px; } .dm[data-bar="top"] .dm-ibl { display: none; }
.dm-ws { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; background: var(--bg); }
.dm-layer { position: absolute; inset: 10px; pointer-events: none; }
.dm-layer > * { pointer-events: auto; }
.dm-layer.busy iframe { pointer-events: none; } .dm-layer.busy { user-select: none; }
.dm-wb { height: 30px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: var(--surface); border-top: 1px solid var(--border); overflow: hidden; }
.dm-wb > button { display: flex; align-items: center; gap: 6px; border: 0; background: var(--surface-2); padding: 3px 10px; border-radius: 6px; cursor: pointer; max-width: 230px; position: relative; font-size: 12px; }
.dm-wb > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-wb > button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .dm-wb > button.min { opacity: .7; }
.dm-wb > button i { width: 7px; height: 7px; border-radius: 50%; background: var(--dm-amber); flex: none; }
.dm-wbr { margin-left: auto; display: flex; gap: 4px; flex: none; }
.dm-wbr button { display: flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--muted); padding: 3px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.dm-wbr button:hover { background: var(--surface-2); color: var(--text); }
/* windows */
.dm-win { position: absolute; display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; box-shadow: var(--dm-shadow); overflow: hidden; min-width: 360px; min-height: 240px; }
.dm-win[hidden] { display: none; } .dm-win.max { border-radius: 8px; }
.dm-win:not(.on) .dm-wt { opacity: .78; }
.dm-wt { height: 36px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 13px; background: var(--dm-wbar); border-bottom: 1px solid var(--border); cursor: default; user-select: none; touch-action: none; }
.dm-win.on .dm-wt { background: color-mix(in srgb, var(--accent) 5%, var(--dm-wbar)); }
.dm-wti { color: var(--muted); } .dm-win.on .dm-wti { color: var(--accent); }
.dm-wtt { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-wc { display: flex; gap: 2px; } .dm-wc button { width: 32px; height: 26px; border: 0; background: none; border-radius: 6px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.dm-wc button:hover { background: var(--surface-2); color: var(--text); } .dm-wc button.cl:hover { background: #e81123; color: #fff; }
.dm-wc svg { width: 14px; height: 14px; }
.dm-win iframe { flex: 1; width: 100%; border: 0; background: var(--bg); display: block; }
.dm-rz { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; }
.dm-win.max .dm-rz { display: none; }
/* menus */
.dm-dd { position: fixed; z-index: 400; min-width: 250px; max-height: calc(100vh - 80px); overflow-y: auto; background: var(--dm-menu); backdrop-filter: blur(24px); border-radius: 10px; box-shadow: var(--dm-shadow); padding: 5px; font-size: 13px; color: var(--text); }
.dm-dd button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 10px 5px 6px; border-radius: 6px; text-align: left; cursor: default; white-space: nowrap; font: inherit; color: inherit; }
.dm-dd button .tk { width: 14px; display: grid; place-items: center; color: var(--accent); } .dm-dd button .tk svg { width: 12px; height: 12px; stroke-width: 2.6; }
.dm-dd button > svg.dmi { color: var(--muted); } .dm-dd button .tx { flex: 1; }
.dm-dd button kbd { font: inherit; font-size: 11.5px; color: var(--muted); padding-left: 20px; }
.dm-dd button.hl:not(.off), .dm-dd button:not(.off):hover { background: var(--accent); color: #fff; }
.dm-dd button.hl:not(.off) svg, .dm-dd button:not(.off):hover svg, .dm-dd button.hl:not(.off) kbd, .dm-dd button:not(.off):hover kbd { color: #fff; }
.dm-dd button.off { color: var(--muted); opacity: .55; }
.dm-dd .chv { margin-left: 8px; width: 12px; height: 12px; } .dm-dd hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }
.dm .lk, .dm-dd .lk { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 5px; background: var(--warn-soft); color: var(--warn); }
/* Home */
.dm-home { position: absolute; inset: 0; padding: 12px; display: grid; grid-template-columns: 1fr 292px; gap: 12px; overflow: auto; }
.dm-flow { background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--d-hair, rgba(0,0,0,.06)); padding: 14px 16px 12px; display: flex; flex-direction: column; min-height: 520px; }
.dm-flow h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; } .dm-flow h2 small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.dm-canvas { position: relative; flex: 1; display: grid; grid-template-columns: 100px repeat(4, 1fr); column-gap: 30px; }
.dm-lane { grid-column: 1 / -1; border-radius: 12px; margin: 3px 0; }
.dm-l-ven { background: color-mix(in srgb, var(--dm-ven) 8%, transparent); } .dm-l-inv { background: color-mix(in srgb, var(--dm-inv) 7%, transparent); }
.dm-l-cus { background: color-mix(in srgb, var(--dm-cus) 8%, transparent); } .dm-l-emp { background: color-mix(in srgb, var(--dm-emp) 8%, transparent); }
.dm-l-co { background: color-mix(in srgb, var(--dm-co) 9%, transparent); }
.dm-ll { grid-column: 1; display: flex; flex-direction: column; justify-content: center; padding-left: 12px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; z-index: 1; }
.dm-ll small { font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--muted); }
.dm-c-ven { --c: var(--dm-ven); } .dm-c-inv { --c: var(--dm-inv); } .dm-c-cus { --c: var(--dm-cus); } .dm-c-emp { --c: var(--dm-emp); } .dm-c-co { --c: var(--dm-co); }
.dm-ll { color: var(--c); }
.dm-node { z-index: 2; align-self: center; position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 7px 9px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.dm-node:hover { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.dm-node.hub { border-color: color-mix(in srgb, var(--c) 45%, var(--border)); border-width: 1.5px; }
.dm-node .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.dm-c-co .ic { background: var(--surface-2); color: var(--muted); }
.dm-node .tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.22; }
.dm-node .tx b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-node .tx small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-node .bd { position: absolute; top: -7px; right: -6px; background: var(--dm-red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; box-shadow: 0 0 0 2px var(--surface); }
.dm-node .bd.b { background: var(--accent); }
svg.dm-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
svg.dm-links path { fill: none; stroke: var(--dm-line2); stroke-width: 1.6; } svg.dm-links path.main { stroke: var(--accent); stroke-width: 1.8; }
svg.dm-links .ah { fill: none; stroke: var(--dm-line2); stroke-width: 1.6; } svg.dm-links .ah2 { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.dm-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.dm-card { background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--d-hair, rgba(0,0,0,.06)); padding: 11px 14px; }
.dm-card h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.dm-card .ln { border: 0; background: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; }
.dm-bal { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 0; border: 0; border-top: 1px solid var(--border); background: none; text-align: left; }
.dm-bal:first-of-type { border-top: 0; } button.dm-bal { cursor: pointer; } button.dm-bal:hover span:first-child { color: var(--accent); }
.dm-bal span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dm-bal span:last-child { font-weight: 500; white-space: nowrap; }
.dm-qb { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.dm-qb button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 980px; background: var(--surface-2); padding: 5px 8px; font-weight: 600; font-size: 12px; cursor: pointer; }
.dm-qb button:hover { background: var(--accent-soft); color: var(--accent); }
.dm-att { flex: 1; }
.dm-todo { display: flex; gap: 9px; align-items: flex-start; width: 100%; padding: 7px 0; border: 0; border-top: 1px solid var(--border); background: none; text-align: left; cursor: pointer; }
.dm-todo:first-of-type { border-top: 0; } .dm-todo:hover b { color: var(--accent); }
.dm-todo .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.dm-todo .t-r { background: color-mix(in srgb, var(--dm-red) 13%, transparent); color: var(--dm-red); } .dm-todo .t-o { background: color-mix(in srgb, var(--dm-amber) 14%, transparent); color: var(--dm-amber); }
.dm-todo .t-b { background: var(--accent-soft); color: var(--accent); }
.dm-todo b { font-weight: 600; display: block; } .dm-todo small { color: var(--muted); font-size: 12px; }
.dm-ok { display: flex; gap: 8px; align-items: center; color: var(--dm-green); margin: 6px 0; }
@media (max-width: 1400px) { .dm-home { grid-template-columns: 1fr 250px; } .dm-canvas { grid-template-columns: 88px repeat(4, 1fr); column-gap: 24px; }
  .dm-node { padding: 6px 8px; gap: 7px; font-size: 12.5px; } .dm-node .ic { width: 24px; height: 24px; } .dm-tot { display: none; } }
@media (max-height: 820px) { .dm-ib button { padding: 4px 2px; gap: 2px; } .dm-ib button svg { width: 26px; height: 26px; padding: 5px; } }
/* sheets */
.dm-cl { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; text-align: left; }
.dm-cl label, .dm-cr { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.dm-cl label:hover { background: var(--surface-2); } .dm-cr span { flex: 1; }
.dm-cr button { border: 0; background: var(--surface-2); border-radius: 6px; width: 28px; height: 26px; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.dm-cr button:disabled { opacity: .35; cursor: default; }
.dm-h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; text-align: left; }
.dm-fv { max-height: 52vh; overflow-y: auto; columns: 2 240px; column-gap: 18px; text-align: left; }
.dm-fv section { break-inside: avoid; } .dm-fv label { display: flex; align-items: center; gap: 8px; padding: 4px 4px; font-size: 13.5px; }
.dm-fv label small { color: var(--muted); font-size: 11px; margin-left: auto; }
.ap-sheet.dm-wide { width: min(760px, 94vw); max-width: none; }
.dm-keys { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.dm-keys div { display: flex; gap: 12px; align-items: center; } .dm-keys kbd { min-width: 150px; font: inherit; font-size: 12.5px; font-weight: 600; }
/* a page inside a window */
.dm-embed .page { max-width: none; padding: 14px 18px 40px; }
.dm-embed .page-head h1 { font-size: 19px; }
/* Simple mode: the switch to Desktop mode */
.to-desk { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface-2); color: var(--text); border-radius: 980px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.to-desk:hover { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 999px) { .to-desk { display: none; } }

/* ---------- Desktop mode DM2a: desktop windows (dw-) ---------- */
.dw { height: 100vh; overflow: hidden; font-size: 13px; line-height: 1.38; background: var(--surface); }
.dw .mute { color: var(--muted); } .dw .red { color: var(--dm-red); } .dw .amber { color: var(--dm-amber); } .dw .green { color: var(--dm-green); }
.dw button, .dw input, .dw select, .dw textarea { font: inherit; color: inherit; }
.dw-win { height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.dw-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); flex: none; }
.dw-bar .dw-f { flex-direction: column; }
.dw-foot { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--surface-2); flex: none; flex-wrap: wrap; }
.dw-sp { flex: 1; } .dw-small { font-size: 12px; } .dw-hint { font-size: 12px; }
.dw-in { height: 28px; border: 1px solid var(--dm-line2); border-radius: 7px; padding: 0 9px; background: var(--surface); outline: none; min-width: 0; }
textarea.dw-in { height: auto; padding: 6px 9px; resize: vertical; }
select.dw-in { padding-right: 4px; } .dw-in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dw-in.r { text-align: right; font-variant-numeric: tabular-nums; } .dw-in.ro, .dw-in[readonly], .dw-in:disabled { background: var(--surface-2); color: var(--muted); }
.dw-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 980px; padding: 6px 13px; background: var(--surface-2); font-weight: 600; cursor: pointer; white-space: nowrap; }
.dw-b:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); } .dw-b.p { background: var(--accent); color: #fff; } .dw-b.p:hover:not(:disabled) { filter: brightness(1.08); color: #fff; background: var(--accent); }
.dw-b:disabled { opacity: .45; cursor: default; } .dw-b.sm { padding: 4px 10px; font-size: 12px; } .dw-b.big { padding: 9px 14px; width: 100%; }
.dw-b svg.dmi { width: 14px; height: 14px; } .dmi.sm { width: 13px; height: 13px; }
.dw-lnk { border: 0; background: none; color: var(--accent); padding: 0; cursor: pointer; text-align: left; font-size: 12.5px; } .dw-lnk:hover { text-decoration: underline; } .dw-lnk:disabled { color: var(--muted); }
.dw-cb { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; } .dw-cb input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.dw-cb.in { font-size: 11px; color: var(--muted); }
.dw-seg { display: flex; background: var(--surface-2); border-radius: 8px; padding: 2px; flex: none; }
.dw-seg button { border: 0; background: none; padding: 3px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 12px; cursor: pointer; white-space: nowrap; }
.dw-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 .5px var(--border), 0 1px 2px rgba(0,0,0,.08); }
.dw-grid { flex: 1; min-height: 0; overflow: auto; outline: none; }
.dw-boxed { border: 1px solid var(--border); border-radius: 10px; }
table.dw-t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.dw-t th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; text-align: left;
  padding: 6px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; user-select: none; }
.dw-t th[data-sort] { cursor: pointer; } .dw-t th[data-sort]:hover { color: var(--text); } .dw-t th .srt { color: var(--accent); font-size: 9px; }
.dw-t td { padding: 0 9px; height: 30px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.dw-t .n { text-align: right; font-variant-numeric: tabular-nums; } .dw-t .c { text-align: center; } .dw-t th.c svg { margin: 0 auto; }
.dw-t tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.dw-t tbody tr.sel td { background: var(--accent-soft) !important; } .dw-t tbody tr.par td { font-weight: 600; } .dw-t tbody tr.off td { color: var(--muted); }
.dw-t tbody tr.click { cursor: default; } .dw-t tbody tr.click:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.dw-t tfoot td { font-weight: 700; border-top: 2px solid var(--text); border-bottom: 0; }
.dw-empty { text-align: center; color: var(--muted); height: 80px !important; white-space: normal !important; }
.dw-tag { font-size: 10.5px; font-weight: 600; border-radius: 5px; padding: 0 5px; background: var(--surface-2); color: var(--muted); }
/* menus */
.dw-dd { position: fixed; z-index: 500; min-width: 270px; max-height: calc(100vh - 12px); overflow-y: auto; background: var(--dm-menu); backdrop-filter: blur(24px); border-radius: 10px; box-shadow: var(--dm-shadow); padding: 5px; font-size: 13px; color: var(--text); }
.dw-dd button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 10px 5px 6px; border-radius: 6px; text-align: left; cursor: default; white-space: nowrap; font: inherit; color: inherit; }
.dw-dd button .tk { width: 14px; display: grid; place-items: center; color: var(--accent); } .dw-dd button .tk svg { width: 12px; height: 12px; stroke-width: 2.6; }
.dw-dd button > svg.dmi { color: var(--muted); } .dw-dd button .tx { flex: 1; } .dw-dd kbd { font: inherit; font-size: 11.5px; color: var(--muted); padding-left: 18px; }
.dw-dd button:not(:disabled):hover { background: var(--accent); color: #fff; } .dw-dd button:not(:disabled):hover svg, .dw-dd button:not(:disabled):hover kbd { color: #fff; }
.dw-dd button:disabled { opacity: .45; } .dw-dd hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; } .dw-dd .hd { color: var(--muted); font-size: 11px; padding: 3px 10px; }
/* forms */
.dw-split { flex: 1; min-height: 0; display: flex; }
.dw-main { flex: 1; min-width: 0; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.dw-side { width: 172px; flex: none; border-left: 1px solid var(--border); background: var(--surface-2); padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.dw-side hr { border: 0; border-top: 1px solid var(--border); width: 100%; margin: 4px 0; } .dw-side .dw-b:not(.big) { justify-content: flex-start; }
.dw-row { display: flex; gap: 10px; } .dw-col { display: flex; flex-direction: column; min-width: 0; }
.dw-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .dw-f > span { font-size: 11px; color: var(--muted); }
.dw-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .dw-g3 { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; } .dw-g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dw-g7 { display: grid; grid-template-columns: 1.5fr 1fr .8fr .8fr .9fr .9fr 1fr; gap: 10px; align-items: end; } .dw-g2s { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dw-box { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dw-box legend, .dw-h5 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 4px; }
.dw-h5 { padding: 0; margin: 0 0 6px; } .dw-box legend .dw-lnk { text-transform: none; letter-spacing: 0; font-weight: 400; }
.dw-box2 { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; } .dw-links { display: flex; flex-direction: column; gap: 5px; }
.dw-typehelp { margin: 0 0 5px; font-size: 12px; max-width: 460px; } .dw-tabs { align-self: flex-start; }
.dw-pane[hidden] { display: none; } [hidden].dw-inv { display: none !important; }
.dw-kvs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; max-width: 640px; } .dw-kvs div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 5px 0; } .dw-kvs span { color: var(--muted); }
.dw-pic { display: flex; gap: 18px; align-items: flex-start; }
.dw-picbox { width: 220px; height: 220px; border: 1.5px dashed var(--dm-line2); border-radius: 12px; display: grid; place-items: center; color: var(--muted); overflow: hidden; text-align: center; font-size: 12px; }
.dw-picbox img { width: 100%; height: 100%; object-fit: contain; } .dw-picbox svg { width: 26px; height: 26px; margin: 0 auto 6px; display: block; } .dw-picbox.sm { width: 120px; height: auto; min-height: 120px; }
/* inventory center */
.dw-rb { display: flex; align-items: center; gap: 1px; padding: 5px 8px; border-bottom: 1px solid var(--border); flex: none; }
.dw-rb button { border: 0; background: none; border-radius: 8px; padding: 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 52px; font-size: 11.5px; cursor: pointer; }
.dw-rb button svg { width: 18px; height: 18px; } .dw-rb button:hover:not(:disabled) { background: var(--surface-2); } .dw-rb button:disabled { opacity: .4; cursor: default; }
.dw-rb .dv { width: 1px; height: 32px; background: var(--border); margin: 0 5px; }
.dw-list { width: 330px; flex: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.dw-ichead { display: grid; grid-template-columns: 1.25fr 1.05fr 1fr 120px; gap: 18px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dw-h2 { font-size: 17px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12.5px; } .dw-kv span { color: var(--muted); } .dw-kv b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dw-kv.tot { border-top: 1px solid var(--border); padding-top: 5px; margin-top: 2px; }
.dw-icbody { display: flex; gap: 14px; padding: 10px 16px 12px; flex: 1; min-height: 0; }
/* lists: columns sheet, editable grid, reports */
.ap-sheet.dw-wide { width: min(660px, 94vw); max-width: none; }
.dw-cc { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 12px; text-align: left; margin-top: 8px; } .dw-ccb { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.dw-lb { border: 1px solid var(--border); border-radius: 10px; height: 300px; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; }
.dw-lb button { border: 0; background: none; text-align: left; padding: 5px 8px; border-radius: 6px; cursor: default; font: inherit; color: var(--text); font-size: 13px; } .dw-lb button.on { background: var(--accent); color: #fff; }
.dw-edit td { padding: 2px 3px !important; height: auto; } .dw-cell { height: 26px; border: 1px solid transparent; border-radius: 5px; padding: 0 6px; background: transparent; outline: none; font: inherit; color: var(--text); }
.dw-cell:focus { border-color: var(--accent); background: var(--surface); } .dw-cell.r { text-align: right; } .dw-cell.chg { background: var(--accent-soft); } .dw-cell:disabled { color: var(--muted); }
.dw-rep { padding: 0 0 14px; } .dw-rhead { text-align: center; padding: 14px 0 10px; } .dw-rhead h2 { font-size: 18px; margin: 2px 0; }
.dw-sheet td.cnt { border-bottom: 1px solid var(--text); } .dw-sheet td { height: 34px; }
@media print { .dw, .dw-win { height: auto; overflow: visible; } .dw-grid { overflow: visible; } .no-print, .dw-foot, .dw-bar, .dw-rb { display: none !important; } .dw-t th { position: static; } }
@media (max-width: 1100px) { .dw-g7 { grid-template-columns: repeat(4, 1fr); } .dw-ichead { grid-template-columns: 1fr 1fr; } .dw-list { width: 270px; } .dw-g3 { grid-template-columns: 1fr 1fr; } }
/* DM2a: keep the app's general form styles out of the desktop windows */
.dw .dw-in { width: auto; padding: 0 9px; border-radius: 7px; border-color: var(--dm-line2); }
.dw textarea.dw-in { padding: 6px 9px; }
.dw .dw-f > .dw-in, .dw .dw-f > select, .dw .dw-f > textarea, .dw .dw-f > .dw-row { width: 100%; }
.dw input[type=checkbox] { width: 14px; height: 14px; padding: 0; }
.dw .dw-bar > span, .dw .dw-foot > span, #dw-count { white-space: nowrap; }
.dw .dw-b { border: 0; color: var(--text); }
.dw .dw-b.p { color: #fff; }
.dw-side .dw-b:not(.p) { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.dw-side .dw-b:not(.p):hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.dw .dw-cell { width: auto; padding: 0 6px; border-radius: 5px; border: 1px solid transparent; }
.dw .dw-um small { color: var(--muted); }
.dw-icbody .dw-row { flex-wrap: wrap; } .dw-icbody select.dw-in { width: auto; min-width: 110px; } .dw-icbody input[type=date].dw-in { width: 140px; }
@media (max-width: 1350px) { .dw-ichead { grid-template-columns: 1.2fr 1fr 1fr; } .dw-ichead .dw-picbox { display: none; } .dw-icbody > .dw-col:last-child { width: 220px !important; } }
.dw .dw-lnk { color: var(--accent); background: none; border: 0; padding: 0; border-radius: 0; font-weight: 400; }

/* ---------- DM2b ---------- */
.pm-scope { font-size: 13px; line-height: 1.38; } .pm-scope .mute { color: var(--muted); } .pm-scope .red { color: var(--dm-red); }
.pm-scope .mute { color: var(--muted); } .pm-scope .red { color: var(--dm-red); } .pm-scope .amber { color: var(--dm-amber); } .pm-scope .green { color: var(--dm-green); }
.pm-scope button, .pm-scope input, .pm-scope select, .pm-scope textarea { font: inherit; color: inherit; }
.pm-scope .dw-in { width: auto; padding: 0 9px; border-radius: 7px; border-color: var(--dm-line2); }
.pm-scope textarea.dw-in { padding: 6px 9px; }
.pm-scope .dw-f > .dw-in, .pm-scope .dw-f > select, .pm-scope .dw-f > textarea, .pm-scope .dw-f > .dw-row { width: 100%; }
.pm-scope input[type=checkbox] { width: 14px; height: 14px; padding: 0; }
.pm-scope .dw-bar > span, .pm-scope .dw-foot > span { white-space: nowrap; }
.pm-scope .dw-b { border: 0; color: var(--text); }
.pm-scope .dw-b.p { color: #fff; }
.pm-scope .dw-cell { width: auto; padding: 0 6px; border-radius: 5px; border: 1px solid transparent; }
.pm-scope .dw-um small { color: var(--muted); }
.pm-scope .dw-lnk { color: var(--accent); background: none; border: 0; padding: 0; border-radius: 0; font-weight: 400; }
/* payment methods */
.pm-wrap { display: flex; flex-direction: column; gap: 12px; }
.pm-top { display: flex; align-items: flex-start; gap: 14px; } .pm-lead { flex: 1; margin: 0; max-width: 640px; }
.pm-tw { border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.pm-t td { height: 40px; } .pm-t tr.off td { color: var(--muted); }
.pm-sm { font-size: 11.5px; margin: 0; }
.pm-mv button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; width: 22px; height: 22px; padding: 0; margin-right: 3px; cursor: pointer; color: var(--text); font-size: 12px; line-height: 1; }
.pm-mv button:disabled { opacity: .3; cursor: default; }
.pm-pill { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 980px; padding: 1px 8px; background: var(--surface-2); color: var(--muted); }
.pm-pill.g { background: color-mix(in srgb, var(--dm-green, #248a3d) 14%, transparent); color: var(--dm-green, #248a3d); }
.pm-pill.b { background: var(--accent-soft); color: var(--accent); }
.pm-sug { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pm-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 980px; padding: 4px 12px; cursor: pointer; color: var(--accent); font-weight: 500; }
.pm-chips button:hover { background: var(--accent-soft); }
.pm-form { display: flex; flex-direction: column; gap: 12px; font-size: 13px; text-align: left; }
.pm-kind { flex-wrap: wrap; } .pm-kind button:disabled { cursor: default; }
.pm-kind button:disabled:not(.on) { opacity: .45; }
.pm-opt { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; cursor: pointer; margin-top: 4px; }
.pm-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pm-opt input { margin-top: 3px; flex: none; } .pm-opt > span { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.pm-opt small { color: var(--muted); font-size: 11.5px; } .pm-opt select { max-width: 340px; }
.pm-checks { display: flex; gap: 16px; flex-wrap: wrap; } .pm-row { display: flex; gap: 12px; align-items: flex-start; }
.pm-scope .ap-sheet.pm-sheet h2 { text-align: left; }
.danger-text { color: var(--dm-red, #d70015) !important; }
/* sign-up */
.ax-pay { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.ax-pay span, .ax-pay button { border: 1px solid var(--ax-sep); border-radius: 980px; padding: 7px 14px; font: inherit; font-size: 14px; background: var(--ax-card); color: inherit; cursor: pointer; }
.ax-pay .on { background: color-mix(in srgb, #0071e3 12%, transparent); border-color: #0071e3; color: #0071e3; }
.ax-pay .fixed { cursor: default; }
.ax-payo { display: flex; gap: 8px; justify-content: center; }
.ax-payo input { border: 1px solid var(--ax-sep); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 14px; width: 240px; background: var(--ax-card); color: inherit; }
.ax-payo button { border: 0; background: none; color: #0071e3; font: inherit; font-weight: 500; cursor: pointer; }
/* desktop forms */
.df { font-size: 13px; }
.df-rb button { position: relative; } .df-tag { font-style: normal; font-size: 9px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 0 4px; margin-left: 3px; vertical-align: 1px; }
.df-rb button .df-tag { position: absolute; top: 0; right: 0; }
.df-chk { display: flex; flex-direction: column; gap: 3px; padding: 0 8px; font-size: 12px; }
.df-main { gap: 12px; }
.df-band { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; align-items: flex-end; }
.df-dm3 select, .df-dm3 .dw-in { opacity: .55; }
.df-head { display: flex; gap: 20px; align-items: flex-start; }
.df-hl { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.df-title { display: flex; align-items: center; gap: 12px; } .df-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.df-addr { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-height: 60px; max-width: 340px; background: var(--surface); line-height: 1.45; }
.df-grid4 { display: grid; grid-template-columns: repeat(4, minmax(120px, 160px)); gap: 8px 10px; }
.df-stamp { font-weight: 800; letter-spacing: .08em; font-size: 15px; border: 2.5px solid; border-radius: 6px; padding: 1px 10px; transform: rotate(-6deg); }
.df-stamp.r { color: var(--dm-red, #d70015); } .df-stamp.g { color: var(--dm-green, #248a3d); }
.df-pm .dw-h5 { margin-bottom: 6px; }
.df-pms { display: flex; flex-wrap: wrap; gap: 6px; }
.df-pms button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 9px; padding: 6px 11px; background: var(--surface); cursor: pointer; color: var(--text); font-weight: 500; }
.df-pms button svg { width: 15px; height: 15px; } .df-pms button kbd { font-size: 10px; color: var(--muted); font-family: inherit; }
.df-pms button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.df-pms button.add { border-style: dashed; color: var(--accent); }
.df-pms button:disabled:not(.on) { opacity: .45; cursor: default; }
.df-lines { border: 1px solid var(--border); border-radius: 10px; overflow: auto; min-height: 180px; flex: 1 1 auto; }
.df-t { table-layout: fixed; width: 100%; } .df-t td { padding: 0 3px; height: 30px; overflow: visible; }
.df-t td:first-child { padding-left: 9px; } .df-t td.df-amt { padding-right: 10px; }
.df .df-c { width: 100%; height: 26px; border: 1px solid transparent; border-radius: 5px; background: transparent; padding: 0 6px; font: inherit; color: inherit; min-width: 0; }
.df .df-c:hover:not(:disabled) { border-color: var(--border); }
.df .df-c:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.df .df-c.r { text-align: right; font-variant-numeric: tabular-nums; } .df select.df-c { padding: 0 2px; }
.df .df-c:disabled { opacity: 1; color: var(--text); -webkit-text-fill-color: var(--text); }
.df-foot, .df-pfoot { display: flex; gap: 24px; align-items: flex-start; }
.df-tot { width: 330px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.df-tot > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; min-height: 24px; }
.df-tot .big { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; font-size: 16px; font-weight: 700; }
.df-tot .big2 { font-weight: 700; font-size: 14px; }
.df-disc { display: flex; gap: 4px; align-items: center; } .df-disc .dw-in { width: 80px; } .df-disc select.dw-in { width: 84px; }
.df-side { width: 270px; flex: none; border-left: 1px solid var(--border); padding: 12px 14px; overflow-y: auto; background: var(--surface-2); font-size: 12.5px; }
.df-ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 14px; }
.df-rt { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 0; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; color: var(--text); font-size: 12px; }
.df-rt:hover { color: var(--accent); }
.df-note { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; white-space: pre-wrap; font-size: 12px; flex: 1; }
.df-hold { margin-top: 8px; color: var(--dm-red, #d70015); font-weight: 600; }
.df-acts .df-hints b { font-weight: 600; color: var(--text); }
.df-pk { position: fixed; z-index: 60; width: 560px; max-width: 96vw; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.18); overflow: hidden; font-size: 12.5px; }
.df-pkh, .df-pk button[data-i] { display: grid; grid-template-columns: 1.6fr 1.3fr 80px 70px; gap: 8px; padding: 5px 10px; align-items: center; }
.df-pkh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
.df-pk button[data-i] { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.df-pk button[data-i] small { display: block; color: var(--muted); font-size: 11px; }
.df-pk button[data-i].hl { background: var(--accent); color: #fff; } .df-pk button[data-i].hl small, .df-pk button[data-i].hl .red { color: #fff; }
.df-pk button[data-i]:disabled { opacity: .5; cursor: not-allowed; }
.df-pk .n { text-align: right; font-variant-numeric: tabular-nums; } .df-pk .red { color: var(--dm-red, #d70015); }
.df-pkf { padding: 5px 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }
.df-ptop { display: flex; gap: 20px; align-items: flex-start; }
.df-bal { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 12px 16px; border-radius: 10px; background: var(--surface-2); min-width: 200px; }
.df-bal b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.df .df-big { font-size: 15px; font-weight: 600; }
.df-plines { min-height: 160px; } .df-plines .df-c { max-width: 140px; margin-left: auto; display: block; }
.ap-sheet.df-wide { width: min(820px, 96vw); } .df-hist { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.dw-h2 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.dw-empty { color: var(--muted); text-align: center; padding: 18px !important; height: auto !important; }
@media (max-width: 1100px) { .df-side { display: none; } .df-grid4 { grid-template-columns: repeat(3, minmax(110px, 1fr)); } }
/* DM2b sheets: desktop-sized fields, scrolls when taller than the screen */
.ap-ov.pm-scope .ap-sheet { max-height: calc(100vh - 32px); overflow-y: auto; }
.pm-scope .ap-sheet.pm-sheet, .pm-scope .ap-sheet.df-wide { text-align: left; }
.pm-scope .ap-sheet .dw-in { height: 28px; margin: 0; padding: 0 9px; font-size: 13px; border: 1px solid var(--dm-line2); background: var(--surface); border-radius: 7px; width: 100%; }
.pm-scope .ap-sheet select.dw-in { padding-right: 4px; }
.pm-scope .ap-sheet .dw-in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pm-scope .ap-sheet input[type=radio], .pm-scope .ap-sheet input[type=checkbox] { width: 14px; height: 14px; padding: 0; margin: 0; flex: none; }
.pm-scope .ap-sheet .pm-opt input[type=radio] { margin-top: 3px; }
.pm-scope .ap-sheet h2 { font-size: 18px; }
.pm-scope .ap-sheet .cs-body { text-align: left; font-size: 13px; }

.df-ph > span { white-space: nowrap; font-size: 12px; }
.df-side[hidden] { display: none; }
.df-showside { writing-mode: vertical-rl; border: 0; border-left: 1px solid var(--border); background: var(--surface-2); color: var(--accent); cursor: pointer; padding: 12px 5px; font: inherit; font-size: 12px; font-weight: 500; }
.df-band { padding: 8px 12px; gap: 8px; }
/* the customer picker inside desktop forms looks like a field */
.df .dw-f .pk-btn { height: 28px; min-height: 28px; padding: 0 9px; justify-content: space-between; font-size: 13px; border: 1px solid var(--dm-line2); border-radius: 7px; background: var(--surface); }
.df .dw-f .pk-btn:hover { border-color: var(--accent); background: var(--surface); }
.df .dw-f .pk-btn .pk-chev { font-size: 15px; }
.df-rt > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .df-rt > span:last-child { white-space: nowrap; flex: none; }

/* ---------- DM2c: centers, to do list, letters ---------- */
.cc { font-size: 13px; }
.cc-tb { display: flex; align-items: center; gap: 3px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex: none; background: var(--surface); flex-wrap: wrap; }
.cc-b { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 8px; padding: 5px 10px; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; }
.cc-b svg { width: 15px; height: 15px; } .cc-b:hover:not(:disabled) { background: var(--surface-2); } .cc-b:disabled { opacity: .45; cursor: default; }
.cc-b.dd::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-1px, -2px); margin-left: 3px; }
.cc-b.on { background: var(--accent-soft); color: var(--accent); }
.cc-dv { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.cc-body { display: flex; flex: 1; min-height: 0; }
.cc-left { width: 318px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex: none; background: var(--surface); min-height: 0; }
.cc-ltabs { display: flex; padding: 8px 10px 0; gap: 4px; flex: none; }
.cc-ltabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 500; padding: 6px 0; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.cc-ltabs button.on { color: var(--text); border-bottom-color: var(--accent); }
#cc-lbody { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cc-flt { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--border); flex: none; }
.cc .cc-flt .dw-in { width: 100%; }
.cc-search { position: relative; display: flex; align-items: center; } .cc-search svg { position: absolute; left: 8px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.cc .cc-search .dw-in { padding-left: 28px; width: 100%; } .cc-fbar .cc-search .dw-in { width: 220px; }
.cc-lst { flex: 1; overflow: auto; outline: none; min-height: 0; }
.cc-lt td { height: 29px; } .cc-lt td:first-child { max-width: 200px; overflow: hidden; text-overflow: ellipsis; } .cc-lt tr.cc-top td:first-child { font-weight: 600; }
.cc-lt tr { cursor: default; } .cc-lt tr.off td { color: var(--muted); } .cc-lt th svg { width: 12px; height: 12px; }
.cc-lft { padding: 7px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; background: var(--surface-2); flex: none; }
.cc-lft b { color: var(--text); }
.cc-right { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cc-info { display: grid; grid-template-columns: 1.15fr 1fr 230px; gap: 18px; padding: 12px 16px 10px; border-bottom: 1px solid var(--border); flex: none; }
.cc-h { margin: 0; font-size: 20px; letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.cc-parent { font-size: 12px; margin-bottom: 1px; }
.cc-pill { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 980px; padding: 1px 8px; white-space: nowrap; background: var(--surface-2); color: var(--muted); font-style: normal; letter-spacing: 0; }
.cc-pill.r { background: color-mix(in srgb, var(--dm-red, #d70015) 13%, transparent); color: var(--dm-red, #d70015); }
.cc-pill.o { background: color-mix(in srgb, var(--dm-amber, #b25000) 15%, transparent); color: var(--dm-amber, #b25000); }
.cc-pill.g { background: color-mix(in srgb, var(--dm-green, #248a3d) 14%, transparent); color: var(--dm-green, #248a3d); }
.cc-pill.b { background: var(--accent-soft); color: var(--accent); }
.cc-dl { display: grid; grid-template-columns: 104px 1fr; gap: 4px 10px; font-size: 12.5px; margin-top: 8px; }
.cc-dl > span { color: var(--muted); } .cc-dl > b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cc-ics { display: flex; justify-content: flex-end; gap: 6px; }
.cc-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 0; color: var(--text); cursor: pointer; }
.cc-ic svg { width: 15px; height: 15px; } .cc-ic:hover { background: var(--accent-soft); color: var(--accent); }
.cc-links { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.cc-links .dw-lnk { display: flex; align-items: center; gap: 6px; } .cc-links svg { width: 14px; height: 14px; }
.cc-note { margin-top: 8px; font-size: 12px; background: #fffbea; border: 1px solid #efd98a; border-radius: 8px; padding: 7px 9px; color: #1d1d1f; white-space: pre-wrap; }
.cc-addnote { margin-top: 8px; }
.cc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex: none; background: var(--surface-2); }
.cc-kpi { background: var(--surface); border-radius: 10px; padding: 8px 11px; box-shadow: 0 0 0 1px var(--border); min-width: 0; }
.cc-kpi small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-kpi b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; } .cc-kpi b.red { color: var(--dm-red, #d70015); } .cc-kpi b.green { color: var(--dm-green, #248a3d); }
.cc-bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 5px; overflow: hidden; } .cc-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cc-btabs { display: flex; gap: 2px; padding: 6px 14px 0; border-bottom: 1px solid var(--border); flex: none; overflow-x: auto; }
.cc-btabs button { border: 0; background: none; font: inherit; font-weight: 500; padding: 6px 11px; color: var(--muted); border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.cc-btabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.cc-btabs em { font-style: normal; font-size: 10.5px; background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 0 6px; }
.cc-tab { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cc-fbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; flex: none; flex-wrap: wrap; }
.cc-fbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; } .cc-fbar label .dw-in { color: var(--text); }
.cc-tw { flex: 1; min-height: 0; overflow: auto; margin: 0 14px; border: 1px solid var(--border); border-radius: 10px; }
.cc-tw .dw-t td.cc-wrap { white-space: normal; max-width: 420px; }
.cc-bbar { display: flex; gap: 8px; padding: 8px 14px; align-items: center; flex: none; }
.cc-txh { padding: 12px 16px 2px; display: flex; align-items: baseline; gap: 12px; flex: none; }
.cc-nav { display: flex; flex-direction: column; gap: 1px; padding: 8px; }
.cc-nav button { display: flex; align-items: center; gap: 9px; border: 0; background: none; font: inherit; padding: 7px 10px; border-radius: 8px; text-align: left; color: var(--text); cursor: pointer; }
.cc-nav button svg { width: 16px; height: 16px; color: var(--muted); } .cc-nav button em { margin-left: auto; }
.cc-nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .cc-nav button.on svg { color: var(--accent); }
.cc-nav button:disabled { opacity: .5; cursor: default; } .cc-nav button .df-tag { margin-left: auto; }
.cc-navh { margin: 10px 18px 0; }
.cc-none { margin: auto; text-align: center; color: var(--muted); } .cc-none svg { width: 40px; height: 40px; }
.cc-todos { padding: 0; }
.cc-todo { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: default; }
.cc-todo.sel { background: var(--accent-soft); }
.cc-cbx { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--dm-line2, #c7c7cc); flex: none; margin-top: 1px; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; color: #fff; }
.cc-cbx svg { width: 11px; height: 11px; stroke-width: 3; } .cc-cbx:disabled { border-style: dashed; cursor: default; }
.cc-todo.done .cc-cbx { background: var(--dm-green, #248a3d); border-color: var(--dm-green, #248a3d); }
.cc-todo.done b { text-decoration: line-through; color: var(--muted); }
.cc-tdx { flex: 1; min-width: 0; } .cc-tdx b { font-weight: 500; } .cc-tdx small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; } .cc-tdd { white-space: pre-wrap; }
.cc-notes { padding: 0; }
.cc-nlog { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.cc-nlog small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.cc-nk { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.cc-nk svg { width: 14px; height: 14px; } .cc-nk.b { background: var(--accent-soft); color: var(--accent); }
.cc-nk.g { background: color-mix(in srgb, var(--dm-green, #248a3d) 14%, transparent); color: var(--dm-green, #248a3d); }
.cc-up { cursor: pointer; }
.cc-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; } .cc-g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
/* edit window */
.cc-edit { font-size: 13px; }
.cc-ehead { display: flex; align-items: flex-end; gap: 14px; padding: 12px 18px 10px; border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap; }
.cc-ehead .w300 { width: 300px; } .cc-ehead .w330 { width: 330px; } .cc-ehead .w260 { width: 260px; } .cc-ehead .w140 { width: 140px; } .cc-ehead .w120 { width: 120px; }
.cc-ehead input[name=displayName], .cc-ehead input[name=jobName] { font-weight: 600; }
.cc-sw { align-self: center; gap: 8px; } .cc-sw input { display: none; }
.cc-sw .sw { width: 30px; height: 18px; border-radius: 10px; background: var(--dm-line2, #c7c7cc); position: relative; flex: none; transition: background .15s; }
.cc-sw .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.cc-sw input:checked + .sw { background: var(--dm-green, #248a3d); } .cc-sw input:checked + .sw::after { left: 14px; }
.cc-ebody { display: flex; flex: 1; min-height: 0; }
.cc-etabs { display: flex; flex-direction: column; gap: 2px; width: 190px; padding: 12px 8px; border-right: 1px solid var(--border); background: var(--surface-2); flex: none; }
.cc-etabs button { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; padding: 7px 10px; border-radius: 8px; text-align: left; color: var(--text); cursor: pointer; }
.cc-etabs button svg { width: 15px; height: 15px; } .cc-etabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cc-etabs p { margin: auto 6px 0; }
.cc-eform { flex: 1; padding: 14px 18px; overflow: auto; }
.cc-eform > section { display: flex; flex-direction: column; gap: 12px; } .cc-eform > section[hidden] { display: none; }
.cc .dw-f > .dw-in, .cc-edit .dw-f > .dw-in, .cc-edit .dw-f textarea { width: 100%; }
.cc-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 4px 0 -4px; }
.cc-unit { display: flex; align-items: center; gap: 8px; } .cc-unit .dw-in { width: 80px !important; } .cc-unit i { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.cc-shh { display: flex; justify-content: space-between; }
.cc-ship { display: grid; grid-template-columns: 22px 130px 1fr 22px; gap: 6px; align-items: center; margin-bottom: 5px; }
.cc-hold { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.cc-hold > div { flex: 1; } .cc-hold small { display: block; font-size: 12px; }
.cc-call { display: flex; gap: 8px; border-radius: 10px; padding: 9px 12px; background: var(--accent-soft); font-size: 12.5px; margin: 0; }
.cc-call svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 1px; }
.cc-edit .dw-in:disabled { background: var(--surface-2); }
/* letters */
.cc-ltl { width: 270px; overflow-y: auto; } .cc-addt { color: var(--accent) !important; }
.cc-radios { display: flex; flex-direction: column; gap: 6px; padding: 8px 18px; } .cc-radios select { width: 100%; margin-top: 4px; height: auto; padding: 4px; }
.cc-ltr { background: var(--surface-2); }
.cc-paper { flex: 1; min-height: 0; overflow: auto; background: #fff; color: #1d1d1f; margin: 0 14px; border-radius: 12px; box-shadow: 0 0 0 1px var(--border), 0 4px 18px rgba(0,0,0,.06); padding: 28px 40px; font-size: 13px; line-height: 1.6; max-width: 760px; width: calc(100% - 28px); align-self: center; }
.cc-paper p { margin: 0 0 12px; } .cc-paper table { font-size: 12.5px; }
.cc-lhead { display: flex; justify-content: space-between; margin-bottom: 18px; font-size: 15px; } .cc-lhead .mute { font-size: 13px; color: #6e6e73; }
.cc-lto { margin-bottom: 14px; }
.cc-fields { padding: 8px 14px; margin: 0; }
@media (max-width: 1250px) { .cc-info { grid-template-columns: 1fr 1fr; } .cc-info > div:last-child { grid-column: 1 / -1; display: flex; gap: 20px; } .cc-left { width: 270px; } }
@media print { .cc-tb, .cc-left, .cc-bbar, .cc-btabs, .cc-fbar { display: none !important; } }
.cc .cc-radios select.dw-in { width: 100%; }
/* DM2d: bills, cheques, card charges, pay bills, transfers, deposits */
.pd .df-main { gap: 10px; }
.pd-band .dw-cb.pd-dm, .pd-dm { opacity: .55; }
.pd-sw { align-self: flex-end; margin-bottom: 2px; } .pd-sw button { padding: 4px 14px; font-size: 12.5px; }
.pd-sw button:disabled:not(.on) { opacity: .5; }
.pd-bal { display: flex; flex-direction: column; align-items: flex-end; gap: 0; padding: 0 4px 2px; font-size: 11.5px; }
.pd-bal b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pd-paper { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(280px, 1fr); gap: 10px 26px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.pd-paper.pd-chq, .pd-paper:has(.pd-crow) { display: flex; flex-direction: column; gap: 10px; }
.pd-chq { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface)); }
.pd-pl { display: flex; flex-direction: column; gap: 9px; } .pd-pl .df-addr { min-height: 46px; max-width: none; background: var(--surface-2); }
.pd-pr { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; align-content: start; padding-top: 34px; }
.pd-memo { grid-column: 1 / -1; }
.pd-ptitle { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.pd-crow { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .pd-crow .df-addr { min-height: 46px; max-width: none; background: var(--surface-2); }
.pd-co { font-size: 15px; align-self: center; }
.pd-words { border-bottom: 1px solid var(--dm-line2); padding: 4px 2px 6px; font-size: 13.5px; font-style: italic; color: var(--text); min-height: 26px; }
.pd .pd-big { font-size: 15px; font-weight: 700; } .pd .pd-bad { border-color: var(--dm-red) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--dm-red) 15%, transparent); }
.pd-stamp { position: absolute; left: 150px; top: 12px; z-index: 1; transform: rotate(-6deg); border: 3px solid; border-radius: 6px; padding: 1px 12px; font-weight: 800; letter-spacing: .08em; font-size: 16px; pointer-events: none; }
.pd-stamp.r { color: var(--dm-red); } .pd-stamp.g { color: var(--dm-green); } .pd-stamp.o { color: var(--dm-amber); }
.dp-stamp { position: relative; left: auto; top: auto; align-self: flex-start; }
.pd-tabs { display: flex; align-items: center; gap: 6px; margin-bottom: -10px; }
.pd-tabs > button[data-tab] { border: 1px solid var(--border); border-bottom: 0; background: var(--surface-2); padding: 6px 14px; border-radius: 9px 9px 0 0; font: inherit; color: var(--muted); cursor: pointer; font-weight: 500; }
.pd-tabs > button[data-tab] em { font-style: normal; font-variant-numeric: tabular-nums; margin-left: 6px; color: var(--text); font-weight: 600; }
.pd-tabs > button[data-tab].on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--surface); position: relative; z-index: 1; }
.pd-tabs > button[data-tab]:disabled { opacity: .45; cursor: not-allowed; }
.pd-tabs .dw-b.sm { height: 26px; }
.pd-lines { border-top-left-radius: 0; min-height: 170px; } .pd-lines[hidden] { display: none; }
.pd-lines tr.sel td { background: var(--accent-soft); }
.pd-lines td.c, .pd-lines th.c { text-align: center; } .pd-lines td.c input { opacity: .45; }
.pd-foot { display: flex; gap: 24px; align-items: flex-start; } .pd-tot { width: 300px; }
.pd-pays { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.pd-pays .dw-kv { padding: 3px 0; border-bottom: 1px solid var(--border); } .pd-pays .dw-kv:last-child { border-bottom: 0; }
.pd-seg { margin-bottom: 10px; width: 100%; } .pd-seg button { flex: 1; padding: 3px 6px; } .pd-seg button:disabled { opacity: .5; }
/* Pay bills */
.pb .pb-top { display: flex; flex-direction: column; gap: 6px; }
.pb-filt { align-items: flex-end; flex-wrap: wrap; gap: 10px; } .pb-filt > .dw-cb { padding-bottom: 6px; }
.pb-lines { min-height: 220px; } .pb-lines tbody tr { cursor: default; } .pb-lines tbody tr.sel td { background: var(--accent-soft); }
.pb-lines .df-c { max-width: 120px; margin-left: auto; display: block; } .pb-lines .pm-pill { font-size: 10px; margin-left: 4px; }
.pb-lines tfoot td { font-weight: 600; font-variant-numeric: tabular-nums; }
.pb-selb { gap: 8px; align-items: center; }
.pb-mid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.25fr); gap: 14px; }
.pb-info, .pb-pay { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.pb-pay .dw-row { align-items: flex-end; gap: 10px; flex-wrap: wrap; } #pb-chq { align-items: center; } #pb-chq[hidden] { display: none; }
.pb-ok { width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--dm-green) 15%, transparent); color: var(--dm-green); display: grid; place-items: center; }
.pb-ok svg { width: 17px; height: 17px; }
/* Transfer funds */
.tf-paper { max-width: 900px; }
.tf-grid { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 10px; align-items: center; }
.tf-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.tf-arrow { display: grid; place-items: center; color: var(--accent); } .tf-arrow svg { width: 22px; height: 22px; }
#tf-arr[hidden] { display: none; }
/* Make deposits */
.dp tr.dp-p td { background: color-mix(in srgb, var(--accent) 4%, transparent); height: 30px; }
.dp-cb { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.dp-cb .dw-row { gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dp .df-lines td.df-dm3 { opacity: .4; }
@media (max-width: 1280px) { .pd-paper { grid-template-columns: 1fr 1fr; gap: 8px 16px; } .pd-pr { padding-top: 0; } .pb-mid { grid-template-columns: 1fr 1fr; } }
.pd-it { min-width: 1060px; }        /* the Items tab scrolls sideways in a narrow window rather than squeezing Description */
#tf-note:empty, #dp-note:empty { display: none; }
.pb { padding: 10px 14px 0; display: flex; flex-direction: column; gap: 8px; } .pb > .dw-foot { margin: 0 -14px; }
/* DM2e: the shared picker */
.vp { position: fixed; z-index: 80; width: min(780px, calc(100vw - 12px)); background: var(--dm-menu, var(--surface)); backdrop-filter: blur(24px); border-radius: 12px;
  box-shadow: var(--dm-shadow, 0 12px 34px rgba(0,0,0,.18)); overflow: hidden; display: flex; flex-direction: column; font-size: 12.5px; color: var(--text); }
.vp svg { width: 14px; height: 14px; }
.vp-q { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--muted); flex: none; }
.vp-q b { color: var(--text); font-weight: 500; } .vp-q span { margin-left: auto; font-size: 11.5px; }
.vp-h, .vp-r { display: grid; gap: 12px; align-items: center; padding: 5px 12px; }
.vp-h { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); flex: none; }
.vp-b { overflow-y: auto; flex: 1; min-height: 0; }
.vp-r { cursor: default; min-height: 30px; } .vp-r > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-r small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.vp-r.h { background: var(--accent); color: #fff; } .vp-r.h small, .vp-r.h .mute, .vp-r.h .red { color: rgba(255,255,255,.85); }
.vp-r.off { opacity: .5; } .vp .n { text-align: right; font-variant-numeric: tabular-nums; } .vp .red { color: var(--dm-red); } .vp .mute { color: var(--muted); }
.vp-g { padding: 7px 12px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.vp-ps { display: flex; gap: 4px; justify-content: flex-end; }
.vp-p { font-size: 10.5px; font-weight: 600; border-radius: 9px; padding: 1px 7px; white-space: nowrap; }
.vp-p.r { background: color-mix(in srgb, var(--dm-red) 13%, transparent); color: var(--dm-red); } .vp-p.b { background: var(--accent-soft); color: var(--accent); }
.vp-p.o { background: color-mix(in srgb, var(--dm-amber) 15%, transparent); color: var(--dm-amber); } .vp-r.h .vp-p { background: rgba(255,255,255,.22); color: #fff; }
.vp-why { margin: 2px 8px 8px; border-radius: 10px; background: color-mix(in srgb, var(--dm-amber) 13%, var(--surface)); padding: 9px 11px; display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.vp-why:empty { display: none; }
.vp-acts { display: flex; gap: 8px; flex-wrap: wrap; } .vp-acts button { border: 0; border-radius: 980px; padding: 5px 12px; font: inherit; font-weight: 600; background: var(--surface-2); color: var(--text); cursor: pointer; }
.vp-acts button.p { background: var(--accent); color: #fff; }
.vp-f { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--border); padding: 6px 12px; color: var(--muted); font-size: 11.5px; flex: none; }
.vp-f span { margin-left: auto; } .vp-new { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; display: flex; align-items: center; gap: 5px; cursor: pointer; padding: 0; }
.vp-none { padding: 14px 12px; color: var(--muted); }
/* DM2e: the voucher grid — dense rows, fills the window, columns can be widened */
.df .df-main > :not(.df-lines):not(.pd-lines) { flex: none; }
.df .df-lines { flex: 1 1 auto; min-height: 210px; }
.df .pd-lines:not([hidden]) { flex: 1 1 auto; min-height: 210px; }
.df .df-t td { height: 25px; padding: 0 2px; border-right: 1px solid var(--border); }
.df .df-t td:last-child { border-right: 0; }
.df .df-t th { position: sticky; top: 0; z-index: 1; height: 26px; padding: 0 8px; border-right: 1px solid var(--border); background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.df .df-t td:first-child { padding-left: 2px; }
.df .df-c { height: 23px; border-radius: 4px; padding: 0 6px; }
.df .df-t tr.cur td { background: var(--accent-soft); }
.df .df-t tr.bad td { background: color-mix(in srgb, var(--dm-red) 10%, transparent); }
.df .df-t tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--dm-red); }
.vg-t th { position: sticky; } .vg-rz { position: absolute; right: -3px; top: 3px; bottom: 3px; width: 7px; cursor: col-resize; z-index: 2; }
.vg-rz:hover { background: linear-gradient(90deg, transparent 2px, var(--accent) 2px, var(--accent) 4px, transparent 4px); }
body.vg-resizing, body.vg-resizing * { cursor: col-resize !important; user-select: none; }
.vg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 6px 0 10px; }
/* DM2e: hide / show the side panel */
.vg-hide { border: 0; width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--surface); color: var(--muted); cursor: pointer; margin-left: 8px; flex: none; box-shadow: 0 0 0 .5px var(--border); }
.vg-hide svg { width: 13px; height: 13px; } .vg-hide:hover { color: var(--accent); }
.pd-segw { display: flex; align-items: center; margin-bottom: 10px; } .pd-segw .pd-seg { margin-bottom: 0; flex: 1; }
.df-showside { display: flex; flex-direction: column; align-items: center; gap: 8px; writing-mode: horizontal-tb; width: 30px; padding: 12px 0; }
.df-showside span { writing-mode: vertical-rl; font-weight: 600; } .df-showside svg { width: 14px; height: 14px; }
.vg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dm-red); display: block; }
.pb-adv { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); } .pb-adv svg { width: 14px; height: 14px; }
.pb-av { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; } .pb-av [hidden] { display: none; }
.pb-avsum { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); } .pb-avsum:empty { display: none; }
/* DM2e: a shorter form head, so more lines show */
.pd .pd-band { padding: 6px 12px; }
.pd-paper { padding: 10px 16px; gap: 6px 22px; }
.pd-ptitle { font-size: 19px; }
.pd-pl { gap: 6px; } .pd-pl .df-addr { min-height: 36px; padding: 5px 10px; }
.pd-pr { padding-top: 24px; gap: 6px 12px; }
.pd-paper .dw-f > span { margin-bottom: 1px; }
.pd-crow { gap: 10px; } .pd-words { padding: 2px 2px 4px; min-height: 22px; }
/* ===== DM2e-1b: QuickBooks layout, AisVeyora Cloud look ===== */
.dfw { --q-band: #e8eef6; --q-band-line: #d3ddea; --q-lab: #6b7480; --q-zebra: #f2f6fc; --q-in: #f3f4f6; --q-bill1: #f1f5fc; --q-bill2: #e6edf9; --q-billline: #c9d6ee; --q-chq1: #eef8ef; --q-chq2: #e3f2e6; --q-chqline: #b9d8c0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dfw { --q-band: #252b34; --q-band-line: #343c48; --q-lab: #9aa1ab; --q-zebra: #1f242b; --q-in: #2a2a2d; --q-bill1: #1e2430; --q-bill2: #222a38; --q-billline: #3a4760; --q-chq1: #1d2a22; --q-chq2: #203026; --q-chqline: #35553f; } }
:root[data-theme="dark"] .dfw { --q-band: #252b34; --q-band-line: #343c48; --q-lab: #9aa1ab; --q-zebra: #1f242b; --q-in: #2a2a2d; --q-bill1: #1e2430; --q-bill2: #222a38; --q-billline: #3a4760; --q-chq1: #1d2a22; --q-chq2: #203026; --q-chqline: #35553f; }
/* ribbon tabs and stacked small buttons */
.df-rtabs { display: flex; gap: 2px; padding: 4px 10px 0; background: var(--dm-wbar, var(--surface-2)); border-bottom: 1px solid var(--border); flex: none; }
.df-rtabs button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 500; padding: 4px 14px; border-radius: 7px 7px 0 0; color: var(--muted); cursor: pointer; }
.df-rtabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); clip-path: inset(-2px -2px 0 -2px); }
.df-rtabs button:disabled { opacity: .5; cursor: default; }
.df-stk { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 4px; }
.df-stk button { flex-direction: row !important; gap: 6px !important; min-width: 0 !important; padding: 2px 6px !important; font-size: 12px; justify-content: flex-start; height: auto !important; }
.df-stk button svg { width: 15px !important; height: 15px !important; }
/* the band across the top: labels before the fields */
.df .qband { border-radius: 0; margin: -12px -16px 0; padding: 8px 16px; background: var(--q-band); border-bottom: 1px solid var(--q-band-line); flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.df .qband .dw-f { flex-direction: row; align-items: center; gap: 8px; width: auto !important; }
.df .qband .dw-f > span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--q-lab); font-weight: 600; white-space: nowrap; margin: 0; }
.df .qband .dw-f > select, .df .qband .dw-f > input, .df .qband .dw-f .pk-btn { width: 200px; }
.df .qband .dw-f:first-child > select, .df .qband .dw-f:first-child .pk-btn { width: 260px; }
.df .qband .df-dm3 > select { width: 110px; }
/* the head: big title, date and number, address boxes */
.qhead { display: grid; gap: 8px 18px; align-items: start; padding-top: 6px; }
.qhead.iv { grid-template-columns: minmax(200px, 1fr) 150px minmax(170px, 1fr) minmax(170px, 1fr) 170px; }
.qhead.cm { grid-template-columns: minmax(200px, 1fr) 150px minmax(200px, 1.3fr) 170px; }
.qhead.rc { grid-template-columns: auto 150px minmax(200px, 1fr) 170px; }
.qhead .qh-c, .qhead .qh-r { display: flex; flex-direction: column; gap: 6px; }
.qhead .dw-f > span, .pd-paper .dw-f > span, .pd .pd-band .dw-f > span, .qfoot-l .dw-f > span { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--q-lab); }
.qtitle { font-size: 34px; font-weight: 300; letter-spacing: -.02em; line-height: 1.05; margin: 2px 0 6px; color: var(--text); }
.qhead .df-addr, .qhead textarea.df-addr { min-height: 66px; max-width: none; width: 100%; background: var(--q-in); resize: none; font: inherit; color: var(--text); }
.qhead textarea.df-addr { padding: 6px 9px; border-radius: 8px; border: 1px solid var(--border); height: 66px; }
.qst { display: inline-flex; align-items: center; gap: 6px; transform: none; border: 0; padding: 0; font-size: 12px; letter-spacing: .06em; }
.qst svg { width: 18px; height: 18px; background: var(--dm-green); color: #fff; border-radius: 50%; padding: 3px; }
.qhead .dw-lnk { display: block; margin-top: 2px; font-size: 12px; }
/* payment methods as one segmented strip */
.df .qpm { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-top: 8px; flex-wrap: nowrap; }
.df .qpm button { flex-direction: column; gap: 3px; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 6px 11px; min-width: 66px; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-2); }
.df .qpm button:last-child { border-right: 0; } .df .qpm button svg { width: 18px; height: 18px; }
.df .qpm button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.df .qpm button.add { border-style: none; color: var(--accent); font-size: 14px; }
/* the grid: zebra rows, light lines, empty rows empty, arrows only where you are */
.df .df-t tbody tr:nth-child(even) td { background: var(--q-zebra); }
.df .df-t tbody tr.cur td { background: var(--accent-soft); }
.df .df-t th { text-transform: uppercase !important; letter-spacing: .04em !important; font-size: 10.5px !important; color: var(--q-lab); font-weight: 500; background: var(--surface); border-bottom: 1px solid var(--dm-line2); }
.df .df-t tr.vg-empty select.df-c, .df .df-t tr.vg-empty span.df-amt { visibility: hidden; }
.df .df-t tr.vg-empty input.df-c::placeholder { color: transparent; }
.df .df-t select.df-c { appearance: none; -webkit-appearance: none; background-image: none; padding-right: 6px; }
.df .df-t tr:hover select.df-c:not(:disabled), .df .df-t select.df-c:focus { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center / 12px; padding-right: 18px; }
.df .df-t select.df-c:focus { border-color: var(--accent); }
.vg-cols .na { opacity: .55; }
/* the foot: message and memo on the left, totals on the right */
.df .df-foot .dw-f > span { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--q-lab); }
.df .df-foot .qmemo { flex-direction: row; align-items: center; gap: 8px; max-width: 340px; } .df .df-foot .qmemo > span { margin: 0; }
.df .df-tot > div > span.mute, .df .df-tot .big > span, .df .df-tot .big2 > span { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--q-lab); font-weight: 500; }
.df .df-tot .big > b { font-size: 19px; } .df .df-tot .big2 > b { font-size: 17px; }
.df .dw-foot #a-new, .df .dw-foot button[type=submit] { order: 2; } .df .dw-foot #a-close2 { order: 1; } .df .dw-foot #a-clear { order: 3; }
/* the side panel: arrow and name, then a card with tabs and sections */
.df-side { background: var(--surface-3, var(--surface-2)); padding: 8px; display: flex; flex-direction: column; gap: 0; }
.qph { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; font-size: 13.5px; }
.qph b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qph .vg-hide { margin: 0; order: -1; }
.qpc { background: var(--surface); border-radius: 10px; flex: 1; overflow-y: auto; box-shadow: 0 0 0 .5px var(--border); }
.qps { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--surface-2); border-radius: 10px 10px 0 0; }
.qps button { border: 0; background: none; font: inherit; font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 7px 7px 0 0; color: var(--muted); cursor: pointer; }
.qps button.on { background: var(--surface); color: var(--text); } .qps button:disabled { opacity: .5; cursor: default; }
.qpsec { padding: 10px 12px 4px; }
.qpsec h6 { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 5px; color: var(--text); }
.qpe { border: 0; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.qpe svg { width: 12px; height: 12px; } .qpe:hover { color: var(--accent); }
.qlnk { color: var(--accent) !important; } .qpnote { font-size: 12.5px; white-space: pre-wrap; color: var(--text); }
.qpsec .df-rt { border-bottom: 0; padding: 3px 0; }
/* bills: a soft blue box; cheques: a green cheque; tabs like folder tabs; buttons under the grid */
.pd .pd-paper:not(.pd-chq):not(.tf-paper) { background: linear-gradient(135deg, var(--q-bill1), var(--q-bill2)); border-color: var(--q-billline); }
.pd .pd-chq { background: linear-gradient(135deg, var(--q-chq1), var(--q-chq2)); border-color: var(--q-chqline); }
.pd .pd-chq .pd-words { border-bottom-color: var(--q-chqline); }
.pd .pd-ptitle { font-size: 30px; font-weight: 300; }
.pd-tabs { margin-bottom: 0; } .pd-tabs > button[data-tab] { background: var(--surface-2); }
.pd-under { display: flex; gap: 8px; padding-top: 2px; } .pd-under .dw-b.sm { border: 1px solid var(--border); background: var(--surface-2); }
.pd .pd-band { background: transparent; padding: 2px 0; }
.df-stk button { white-space: nowrap; } .df-stk button span, .df-stk button { line-height: 1.2; }
.df-stk button .rb-tag, .df-stk button .tag { position: static !important; margin-left: 4px; }
.qps button { padding: 5px 9px; white-space: nowrap; }
.df-stk button .df-tag { position: static !important; transform: none !important; margin-left: 4px; }

.qhead.rc { grid-template-columns: minmax(0, 1.4fr) 150px minmax(150px, 1fr) 150px; }
.qhead .qh-t { min-width: 0; }
.df .qpm { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.df .qpm button { min-width: 56px; padding: 6px 8px; flex: none; }
.df .df-main:has(.qhead) .df-lines { min-height: 160px; }
.df .df-foot .df-tot > div > span { white-space: nowrap; }
/* ===== B1: document numbers, sales orders, the orders list ===== */
.dn-main { padding: 14px 18px; overflow: auto; }
.dn-wrap { display: flex; gap: 16px; align-items: flex-start; }
.dn-left { width: 320px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.dn-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.dn-card h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.dn-card h4 .mute { text-transform: none; letter-spacing: 0; font-weight: 400; }
.dn-right { flex: 1; min-width: 0; }
.dn-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; font-weight: 600; letter-spacing: .02em; word-break: break-all; }
.dn-parts { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin-top: 10px; }
.dn-parts span { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.dn-parts i { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dn-parts b { background: var(--accent-soft); color: var(--accent); border-radius: 980px; padding: 2px 10px; font-size: 12px; font-weight: 500; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dn-parts em { font-style: normal; color: var(--muted); padding-bottom: 3px; }
.dn-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dn-row:last-child { border-bottom: 0; } .dn-row > span { flex: 1; } .dn-row small { display: block; color: var(--muted); font-size: 11.5px; }
.dn-row select { width: 110px; }
.dn-codes td { padding: 4px 6px; } .dn-code { width: 70px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.dn-tw { overflow-x: auto; }
.dn-tw th { white-space: nowrap; } .dn-pre { width: 78px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.dn-next { width: 72px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dn-pre.err, .dn-next.err { border-color: var(--red, #ff3b30); box-shadow: 0 0 0 3px rgba(255, 59, 48, .15); }
.dn-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: rgba(245, 158, 11, .14); margin-top: 10px; }
.dn-warn svg, .dn-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.dn-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: var(--accent-soft); margin: 0; }
.dn-note svg { color: var(--accent); }
.dn-prev { display: flex; gap: 14px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.dn-prev .dn-big { font-size: 17px; }
.dn-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dn-simple .dn-wrap { flex-wrap: wrap; } .dn-simple .dn-left { width: 100%; max-width: 360px; }
@media (max-width: 900px) { .dn-wrap { flex-direction: column; } .dn-left { width: 100%; } }
/* the orders list */
.ord-main { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.ord-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ord-tw { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.ord-tw .dw-t tbody tr:nth-child(even) td { background: var(--q-zebra, rgba(0, 0, 0, .02)); }
.vseg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; gap: 2px; }
.vseg button { border: 0; background: none; font: inherit; font-size: 13px; padding: 5px 14px; border-radius: 7px; color: var(--text); cursor: pointer; }
.vseg button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); font-weight: 600; }
.pm-pill.o { background: rgba(245, 158, 11, .16); color: #b45309; }
/* sales order: invoices made from it, columns */
.df-soinv { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; }
.qst.o { color: #b45309; }
.df .df-t td.df-bo, .df .df-t td.df-iv, .df .df-t td.df-cost { color: var(--muted); font-variant-numeric: tabular-nums; padding-right: 8px; }
.df .df-t td.c { text-align: center; }
/* sign-up: numbering */
.ax-num { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 12px 0 4px; background: var(--surface-2); }
.ax-numh { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ax-lnk { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; }
.ax-numb { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 600; margin-top: 4px; letter-spacing: .02em; }
.ax-numo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 8px; font-size: 13px; }
.ax-numo label { display: flex; flex-direction: column; gap: 3px; } .ax-numo input:not([type=checkbox]), .ax-numo select { height: 34px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; font: inherit; background: var(--surface); color: var(--text); }
.ax-numo .ax-numsw { flex-direction: row; align-items: center; gap: 8px; }
.dn-wrap .dn-pre { width: 84px !important; } .dn-wrap .dn-next { width: 78px !important; } .dn-wrap .dn-code { width: 76px !important; }
.dn-wrap .dn-row select { width: 120px !important; }
.dn-tw table { width: auto; min-width: 100%; } .dn-tw td, .dn-tw th { padding: 5px 8px; }
.dn-codes { width: 100%; } .dn-codes td.n { text-align: right; }
.df .df-t tr.vg-empty input[data-k=clsd] { visibility: hidden; }
.qhead.iv { grid-template-columns: minmax(200px, 1fr) 190px minmax(170px, 1fr) minmax(170px, 1fr) 170px; }
.qhead.cm { grid-template-columns: minmax(200px, 1fr) 190px minmax(200px, 1.3fr) 170px; }

/* ===== B2: users and roles, view-only branches ===== */
.br-view { display: flex; gap: 8px; align-items: center; padding: 8px 14px; margin: -4px 0 8px; border-radius: 9px; background: var(--surface-2); font-size: 12.5px; }
.br-view svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.ur-main { padding: 12px 16px; overflow: auto; }
.ur-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.ur-tabs > button[data-t] { border: 0; background: var(--surface-2); font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer; color: var(--text); }
.ur-tabs > button[data-t].on { background: var(--accent); color: #fff; font-weight: 600; }
.ur-tw { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.ur-users td { vertical-align: middle; } .ur-av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; margin-right: 8px; vertical-align: middle; }
.ur-person { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(280px, 1fr) minmax(240px, .8fr); gap: 14px; align-items: start; }
.ur-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.ur-card h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ur-name { font-size: 18px; font-weight: 600; } .ur-lab { display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 12px 0 5px; }
.ur-chips { display: flex; flex-wrap: wrap; gap: 6px; } .ur-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 980px; padding: 3px 10px; font-size: 12.5px; }
.ur-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; } .ur-row small { display: block; color: var(--muted); font-size: 11.5px; }
.ur-row.off { opacity: .55; } .ur-more summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin-top: 6px; }
.ur-note { font-size: 12px; background: var(--surface-2); border-radius: 8px; padding: 7px 9px; margin: 8px 0 0; }
.ur-brt { margin-top: 6px; } .ur-brt select { width: 130px; }
.ur-kv { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ur-roles { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
.ur-rlist { display: flex; flex-direction: column; gap: 2px; }
.ur-ri { border: 0; background: none; text-align: left; font: inherit; padding: 7px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; color: var(--text); }
.ur-ri b { font-weight: 600; font-size: 13px; flex: 1; } .ur-ri small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; } .ur-ri i { font-style: normal; color: var(--muted); font-size: 12px; }
.ur-ri svg { width: 14px; height: 14px; color: var(--muted); } .ur-ri.on { background: var(--accent-soft); }
.ur-edh { display: flex; gap: 12px; margin-bottom: 10px; }
.ur-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ur-area { border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; background: var(--surface); }
.ur-ah { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.ur-seg { display: inline-flex; background: var(--surface-2); border-radius: 7px; padding: 2px; } .ur-seg button { border: 0; background: none; font: inherit; font-size: 11.5px; padding: 3px 8px; border-radius: 5px; cursor: pointer; color: var(--text); }
.ur-seg button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); font-weight: 600; }
.ur-perms { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; } .ur-perms label { display: flex; gap: 7px; align-items: center; } .ur-perms label.off { opacity: .5; }
.ur-mx th, .ur-mx td { text-align: center; white-space: nowrap; } .ur-mx td:first-child, .ur-mx th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.ur-simple .ur-person { grid-template-columns: 1fr; } .ur-simple .ur-roles { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .ur-person { grid-template-columns: 1fr 1fr; } }

.ur-row input { flex: none; width: auto !important; margin: 3px 0 0; } .ur-row > span { flex: 1; text-align: left; }

/* ===== B3: change a posted document, versions, ask to change ===== */
.edbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: color-mix(in srgb, #f59e0b 16%, transparent); border-bottom: 1px solid color-mix(in srgb, #f59e0b 35%, transparent); font-size: 12.5px; }
.edbar svg { width: 16px; height: 16px; color: #b45309; flex: none; }
.oldv { display: flex; gap: 10px; align-items: center; padding: 8px 16px; background: var(--surface-2); font-size: 12.5px; border-bottom: 1px solid var(--border); }
.oldv svg { width: 16px; height: 16px; color: var(--text-2, #8a8a8e); flex: none; } .oldv.req svg { color: #b45309; }
.df-stamp.qst.o { color: #b45309; border-color: #f59e0b; }
.imp { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; }
.imp td, .imp th { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.imp th { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 500; opacity: .7; }
.imp td.n, .imp th.n { text-align: right; font-variant-numeric: tabular-nums; } .imp tr.t td { font-weight: 600; border-bottom: 0; }
.b3-note { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); margin: 8px 0; }
.b3-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--accent); } .b3-note.o svg { color: #b45309; }
.b3-note.o { background: color-mix(in srgb, #f59e0b 13%, transparent); }
.vs-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; text-align: left; margin: 8px 0; }
.vs-c { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; } .vs-c.now { border-color: var(--accent); }
.vs-h { display: flex; gap: 10px; align-items: baseline; } .vs-h .vs-t { margin-left: auto; font-variant-numeric: tabular-nums; }
.vs-ch { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; } .vs-ch span { background: color-mix(in srgb, #f59e0b 15%, transparent); border-radius: 6px; padding: 1px 7px; }
.vs-r { margin-top: 4px; font-style: italic; opacity: .85; }
.td-crs { margin: 0 0 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; } .td-crs .cc-navh { padding: 8px 12px 4px; }
.td-cr { display: flex; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 12.5px; align-items: flex-start; }
.td-cr .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, #f59e0b 16%, transparent); flex: none; }
.td-cr .ic svg { width: 15px; height: 15px; color: #b45309; } .td-cr .tx { flex: 1; min-width: 0; } .td-cr .m { opacity: .75; margin-top: 2px; }
.td-cr .acts { display: flex; gap: 6px; flex: none; }
#chg .cg-why { max-width: 320px; white-space: normal; }

/* ===== B3b: purchases and receipts changed after posting ===== */
.pd tr.pd-lk td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.pd tr.pd-lk input:disabled, .pd tr.pd-lk select:disabled { color: var(--muted); cursor: not-allowed; }
#cg-area { margin-left: 8px; }

/* ===== DM3a: memorized transactions, classes, profit and loss by class ===== */
.mz-f { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.mz-how { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.mz-row { display: grid; grid-template-columns: 1.4fr 1.2fr .8fr .8fr; gap: 10px; }
.mz-ind { display: inline-block; width: 18px; }
#mz-t tr.mz-g td, .pc-t tr.pc-h td { background: var(--surface-2); }
#mz-t tr.sel td, #cl-t tr.sel td { background: var(--accent-soft); }
.cl-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; padding: 12px 16px; flex: 1; min-height: 0; }
.cl-side { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.pc-t tr.pc-t td { font-weight: 600; border-top: 1px solid var(--border); }
.pc-t tr.pc-net td { font-weight: 700; border-top: 2px solid var(--text); }
@media (max-width: 1100px) { .cl-body { grid-template-columns: 1fr; } .mz-row { grid-template-columns: 1fr 1fr; } }

/* ---------- DM3b: templates (list, designer with a paper preview, defaults by branch) ---------- */
.tp-dz { flex: 1; min-height: 0; display: grid; grid-template-columns: 430px 1fr; gap: 18px; padding: 14px 16px; overflow: hidden; background: var(--surface-2); }
.tp-left { overflow: auto; min-height: 0; padding-right: 2px; }
.tp-right { overflow: auto; min-height: 0; }
.tp-cap { margin: 0 0 8px 2px; }
.tp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tp-tabs button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 14px; border-bottom: 2px solid transparent; cursor: pointer; }
.tp-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.tp-f2 { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; align-items: center; }
.tp-f2 .ql { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tp-f2 textarea { resize: vertical; }
.tp-lvl { display: grid; gap: 8px; margin-top: 10px; }
.tp-logorow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-sw { display: flex; gap: 8px; align-items: center; }
.tp-sw button { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; }
.tp-sw button.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-sw input[type=color] { width: 30px; height: 24px; border: 1px solid var(--border); border-radius: 6px; padding: 0 2px; background: var(--surface); cursor: pointer; }
.tp-colrow { display: grid; grid-template-columns: 52px 1fr 130px 64px; gap: 8px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tp-colrow:last-child { border-bottom: 0; }
.tp-colrow.h span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tp-colrow .dw-in { padding: 3px 8px; }
.tp-mv { display: inline-flex; gap: 2px; }
.tp-mv button { width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.tp-mv button:disabled { opacity: .35; cursor: default; }
.tl-brs { display: grid; gap: 8px; margin: 8px 0 4px; }
.tp-def td { padding: 6px 8px; } .tp-def select { min-width: 150px; font-size: 12.5px; }
/* the paper is always white: it is what prints */
.tp-paper { background: #fff; color: #0f172a; border-radius: 6px; box-shadow: 0 2px 14px rgba(0, 0, 0, .14); padding: 34px 36px 22px; max-width: 760px; min-height: 560px; display: flex; flex-direction: column; font-size: 11.5px; line-height: 1.45; }
.tp-paper .tp-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.tp-paper .tp-co { display: flex; gap: 10px; align-items: center; color: #5b6577; }
.tp-paper .tp-co.r { flex-direction: row-reverse; text-align: right; }
.tp-paper .tp-co b { color: #0f172a; font-size: 1.15em; }
.tp-paper .tp-logo { width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; overflow: hidden; flex: none; color: #fff; font-weight: 700; font-size: 18px; }
.tp-paper .tp-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tp-paper .tp-tt { text-align: right; }
.tp-paper h1 { margin: 0 0 4px; font-size: 2em; line-height: 1.1; font-weight: 700; }
.tp-paper .tp-party { display: flex; gap: 40px; margin-top: 18px; }
.tp-paper table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.tp-paper th { color: #fff !important; border: 0; text-align: left; font-size: .9em; padding: 6px 7px; font-weight: 600; }
.tp-paper td { padding: 6px 7px; border-bottom: 1px solid #dde2ea; }
.tp-paper .n { text-align: right; }
.tp-paper .tp-tot { margin-left: auto; width: 240px; margin-top: 10px; }
.tp-paper .tp-tot > div { display: flex; justify-content: space-between; padding: 3px 0; }
.tp-paper .tp-tot .b { font-weight: 700; border-top: 1px solid #0f172a; margin-top: 3px; padding-top: 5px; }
.tp-paper .tp-bal { color: #5b6577; font-size: .9em; margin: 4px 0 0; }
.tp-paper .tp-note { margin-top: 14px; font-size: .95em; } .tp-paper .tp-note b { color: #5b6577; font-size: .85em; letter-spacing: .04em; }
.tp-paper .tp-sig { display: flex; gap: 40px; margin-top: 34px; }
.tp-paper .tp-sig div { flex: 1; border-top: 1px solid #999; padding-top: 4px; color: #5b6577; font-size: .9em; }
.tp-paper .tp-foot { margin-top: 18px; color: #5b6577; }
.tp-paper .tp-pg { margin-top: auto; padding-top: 24px; display: flex; justify-content: space-between; color: #5b6577; font-size: 9.5px; }
.tp-thermal { width: 300px; margin: 0 auto; background: #fff; color: #111; font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 16px 14px; box-shadow: 0 2px 14px rgba(0, 0, 0, .18); border-radius: 4px; }
.tp-thermal.n58 { width: 220px; font-size: 10px; }
.tp-thermal .c { text-align: center; } .tp-thermal hr { border: 0; border-top: 1px dashed #555; margin: 8px 0; } .tp-thermal .r { display: flex; justify-content: space-between; gap: 8px; }
.tp-thermal .tp-tlogo { max-width: 90px; max-height: 44px; filter: grayscale(1); }
@media (max-width: 1100px) { .tp-dz { grid-template-columns: 360px 1fr; } }

/* ---------- DM3c: purchase orders, item receipts, returns to vendor, bills for received items ---------- */
.dg .dg-head { display: grid; grid-template-columns: 250px 1fr 1fr 210px; gap: 14px 22px; align-items: start; }
.dg .dg-head .qh-t p { margin: 4px 0 0; }
.dg .dg-head .df-addr { min-height: 58px; }
.dg-meta { display: grid; gap: 8px; }
.dg-bar { display: flex; gap: 10px; align-items: center; padding: 8px 16px; font-size: 12.5px; border-bottom: 1px solid var(--border); background: var(--accent-soft); color: var(--text); }
.dg-bar svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.dg-bar.o { background: #fff7e6; } .dg-bar.o svg { color: #b45309; }
.dg-prog { height: 6px; width: 160px; border-radius: 3px; background: var(--border); overflow: hidden; margin-left: auto; flex: none; }
.dg-prog i { display: block; height: 100%; background: #1a7f37; }
.dg-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 7px 12px; margin: 6px 16px 0; border-radius: 8px; background: #fff7e6; color: #8a4b00; border: 1px solid #f5d9a8; }
.dg-warn.r { background: #fdecec; color: #9b1c1c; border-color: #f3c0c0; }
.dg-warn svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.dg .dg-rc { color: #1a7f37; font-weight: 600; } .dg .dg-bo { color: #b45309; font-weight: 600; }
.dg tr.dg-grp td { background: var(--surface-2); font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 5px 9px; }
.dg .df-c.dg-chg { background: #fff3d6; }
.dg-pick td { padding: 7px 8px; }
:root[data-theme="dark"] .dg-bar.o, :root[data-theme="dark"] .dg-warn { background: #3a2a10; color: #f5d9a8; border-color: #5c4318; }
:root[data-theme="dark"] .dg-warn.r { background: #3a1616; color: #f3c0c0; border-color: #5c2424; }
:root[data-theme="dark"] .dg .df-c.dg-chg { background: #3a2a10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dg-bar.o, :root:not([data-theme="light"]) .dg-warn { background: #3a2a10; color: #f5d9a8; border-color: #5c4318; }
  :root:not([data-theme="light"]) .dg-warn.r { background: #3a1616; color: #f3c0c0; border-color: #5c2424; } }
@media (max-width: 1300px) { .dg .dg-head { grid-template-columns: 220px 1fr 190px; } .dg .dg-head > div:nth-child(3) { display: none; } }

/* ---------- DM3c-2: purchase order list, order what runs low, received and not billed, the store keeper ---------- */
.pol-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--border); flex: none; }
.pol-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.pol-card > b { font-size: 13.5px; }
.pol-card b.o { color: #b45309; } .pol-card b.g { color: #1a7f37; } .pol-card b.red { color: var(--dm-red, #d70015); }
.pol-todo { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.dg-prog.sm { width: 90px; margin: 0; display: inline-block; vertical-align: middle; }
.dg-hid { color: var(--muted); letter-spacing: .15em; }
.ro-qu { display: flex; align-items: center; gap: 6px; } .ro-qu .dw-in { flex: 1; min-width: 0; }
.ro-t td { padding: 4px 8px; } .ro-t .dw-in { height: 28px; padding: 2px 8px; }
.ro-t tr.ro-low { background: var(--accent-soft); }

/* ---------- AisVeyora Cloud · Hotel ---------- */
.hv-pill { display:inline-block; padding:1px 8px; border-radius:99px; font-size:12px; font-weight:600; background:var(--surface-2); color:var(--muted); vertical-align:middle; }
.hv-pill.ok, .hv-pill.green { background:color-mix(in srgb, var(--ok) 14%, transparent); color:var(--ok); }
.hv-pill.warn { background:var(--warn-soft); color:var(--warn); }
.hv-pill.bad, .hv-pill.red { background:var(--danger-soft); color:var(--danger); }
.hv-pill.blue { background:var(--accent-soft); color:var(--accent); }
.hv-legend { display:flex; flex-wrap:wrap; gap:12px; margin:4px 0 8px; font-size:12.5px; color:var(--muted); }
.hv-key::before { content:''; display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:-1px; background:var(--hv-c); }
.hv-floor { margin:14px 0 8px; font-size:13px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.hv-board { display:grid; grid-template-columns:repeat(auto-fill, minmax(124px, 1fr)); gap:10px; }
.hv-room { display:flex; flex-direction:column; gap:2px; min-height:92px; padding:10px 12px; border-radius:12px; background:var(--surface); border:1px solid var(--border);
  border-left:5px solid var(--hv-c); color:var(--text); text-decoration:none; box-shadow:var(--shadow); }
a.hv-room:hover { border-color:var(--hv-c); }
.hv-room b { font-size:19px; }
.hv-room .hv-type { font-size:11.5px; color:var(--muted); }
.hv-room .hv-who { font-size:13px; font-weight:600; margin-top:auto; overflow:hidden; text-overflow:ellipsis; }
.hv-room .hv-who small { display:block; font-weight:400; color:var(--muted); font-size:11.5px; }
.hv-room.free, .hv-key.free { --hv-c:#34c759; }
.hv-room.arr, .hv-key.arr { --hv-c:#0a84ff; }
.hv-room.occ, .hv-key.occ { --hv-c:#af52de; }
.hv-room.dirty, .hv-key.dirty { --hv-c:#ff9500; }
.hv-room.ooo, .hv-key.ooo { --hv-c:#ff3b30; }
.hv-cols { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:16px; margin-top:18px; }
.hv-cols h3 { margin:0 0 8px; }
.hv-acts { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.hv-form { display:flex; flex-direction:column; gap:10px; text-align:left; }
.hv-form label { display:flex; flex-direction:column; gap:4px; font-size:13px; font-weight:600; }
.hv-2, .hv-3 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.hv-3 { grid-template-columns:1fr 1fr 1fr; }
.hv-total { font-weight:700; margin:2px 0; }
.hv-hk { display:flex; flex-wrap:wrap; gap:6px; }
.hv-bars { display:flex; align-items:flex-end; gap:3px; height:140px; }
.hv-bars span { flex:1; min-width:3px; background:var(--accent); border-radius:3px 3px 0 0; opacity:.85; }
@media (max-width: 560px) { .hv-2, .hv-3 { grid-template-columns:1fr; } .hv-board { grid-template-columns:repeat(auto-fill, minmax(100px, 1fr)); } }
