/* =====================================================================
   DANITURK Business OS — design system
   Ledger ink, cool paper, cedi green; marigold is reserved for plan and
   edition signals so it always means "this is about your plan".
   ===================================================================== */

:root {
  --paper: #F5F7F6;
  --surface: #FFFFFF;
  --surface-2: #EEF2F0;
  --ink: #1B2A33;
  --ink-2: #4A5A63;
  --ink-3: #5C6B73;
  --rule: #D9E0DD;
  --brand: #0E6B5A;
  --brand-ink: #FFFFFF;
  --brand-soft: #E1F0EB;
  --rail: #0B4F43;
  --rail-ink: #E6F2EE;
  --rail-dim: #A9C9BF;
  --rail-active: #12614F;
  --gold: #E0A21A;
  --gold-soft: #FBF0D4;
  --gold-ink: #6B4A00;
  --danger: #B42318;
  --danger-soft: #FCE9E7;
  --ok: #1B7A3E;
  --focus: #E0A21A;
  --chart: #0B8A6E;          /* validated: chroma ≥ 0.1, ≥ 3:1 on surface */
  --chart-grid: #DCE3E0;

  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-pop: 0 12px 32px rgba(17, 38, 34, 0.18);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --t-xs: 0.8125rem;   /* 13 */
  --t-s: 0.875rem;     /* 14 */
  --t-m: 1rem;         /* 16 */
  --t-l: 1.25rem;      /* 20 */
  --t-xl: 1.625rem;    /* 26 */
  --t-xxl: 2.25rem;    /* 36 */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10171D; --surface: #17212A; --surface-2: #1E2A34; --ink: #E7EEEB; --ink-2: #B6C3C9; --ink-3: #9AAAB0;
    --rule: #2A3843; --brand: #3FB39A; --brand-ink: #06231D; --brand-soft: #173A33; --rail: #0A2620; --rail-ink: #DDEDE8;
    --rail-dim: #8FB3A8; --rail-active: #13382F; --gold: #F0B83A; --gold-soft: #3A2E10; --gold-ink: #F6D58A;
    --danger: #F2867C; --danger-soft: #3B1A17; --ok: #6FD39A; --chart: #3FB39A; --chart-grid: #2A3843; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10171D; --surface: #17212A; --surface-2: #1E2A34; --ink: #E7EEEB; --ink-2: #B6C3C9; --ink-3: #9AAAB0;
  --rule: #2A3843; --brand: #3FB39A; --brand-ink: #06231D; --brand-soft: #173A33; --rail: #0A2620; --rail-ink: #DDEDE8;
  --rail-dim: #8FB3A8; --rail-active: #13382F; --gold: #F0B83A; --gold-soft: #3A2E10; --gold-ink: #F6D58A;
  --danger: #F2867C; --danger-soft: #3B1A17; --ok: #6FD39A; --chart: #3FB39A; --chart-grid: #2A3843; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: var(--t-m); line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-l); }
h3 { font-size: var(--t-m); }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.boot { padding: 3rem; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-s); }
.skip-link { position: absolute; left: 0.75rem; top: -3rem; z-index: 100; padding: 0.5rem 0.9rem; border-radius: var(--radius, 8px);
  background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.2); font-weight: 600; }
.skip-link:focus { top: 0.75rem; }
.content h1:focus, .content:focus { outline: none; }
.table-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------------
   Buttons & form controls
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.5rem; padding: 0 1rem; border-radius: var(--radius-s);
  border: 1px solid var(--rule); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: var(--t-s); text-decoration: none; color: var(--ink);
}
.btn:hover { background: var(--surface-2); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--rule)); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-block { width: 100%; }

.field { display: grid; gap: 0.3rem; }
.field label, .field .label { font-size: var(--t-s); font-weight: 600; }
.field .hint { font-size: var(--t-xs); color: var(--ink-3); }
.field .error { font-size: var(--t-xs); color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; min-height: 2.6rem; padding: 0.5rem 0.7rem; border-radius: var(--radius-s);
  border: 1px solid var(--rule); background: var(--surface);
}
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.form-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--t-s); }
.check input { margin-top: 0.2rem; width: 1rem; height: 1rem; accent-color: var(--brand); }
.check .why { display: block; color: var(--ink-3); font-size: var(--t-xs); }

/* ---------------------------------------------------------------------
   Sign-in & sign-up
   --------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-story {
  background: var(--rail); color: var(--rail-ink); padding: clamp(2rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
}
.auth-story h1 { font-size: var(--t-xxl); max-width: 14ch; font-weight: 700; }
.auth-story .lede { color: var(--rail-dim); max-width: 38ch; margin-top: 1rem; font-size: 1.0625rem; }
.edition-ladder { display: grid; gap: 0.15rem; list-style: none; margin: 0; padding: 0; max-width: 24rem; }
.edition-ladder li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid rgba(255,255,255,0.12); font-size: var(--t-s); }
.edition-ladder strong { color: #F2C14E; font-weight: 650; }
.edition-ladder span { color: var(--rail-dim); }
.auth-panel { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(28rem, 100%); display: grid; gap: 1.5rem; }
.auth-card .switch { font-size: var(--t-s); color: var(--ink-2); }
.brandmark { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: -0.01em; }
.brandmark img { width: 28px; height: 28px; }

/* ---------------------------------------------------------------------
   Application shell
   --------------------------------------------------------------------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 16rem minmax(0, 1fr); }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem 0.85rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail .brandmark { padding: 0 0.4rem; color: var(--rail-ink); }
.org-switch { display: grid; gap: 0.3rem; }
.org-switch select {
  width: 100%; background: var(--rail-active); color: var(--rail-ink); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-s); padding: 0.55rem 0.6rem; font-weight: 600;
}
.org-switch .org-name { font-weight: 650; padding: 0.55rem 0.6rem; background: var(--rail-active); border-radius: var(--radius-s); }
.edition-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; align-self: start; margin: 0 0.4rem;
  font-size: var(--t-xs); font-weight: 650; color: #062F28; background: var(--gold);
  padding: 0.15rem 0.55rem; border-radius: 999px;
}
.nav { display: grid; gap: 0.15rem; }
.nav-group { font-size: var(--t-xs); color: var(--rail-dim); padding: 0.9rem 0.6rem 0.25rem; }
/* Menu entries and drop-down group headings share one look: icon, label, then tags/arrow on the right. */
.nav a, .nav-group-btn {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.5rem 0.6rem; border-radius: var(--radius-s); color: var(--rail-ink); text-decoration: none; font: inherit; font-size: var(--t-s); font-weight: 550;
}
.nav-label { flex: 1 1 auto; min-width: 0; text-align: left; }
.nav-icon { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.nav a:hover, .nav-group-btn:hover { background: var(--rail-active); }
.nav a[aria-current="page"] { background: var(--rail-active); box-shadow: inset 3px 0 0 var(--gold); }
.nav a.locked { color: var(--rail-dim); }
.nav-group-btn { background: none; border: 0; cursor: pointer; margin-top: 0.15rem; font-weight: 650; }
.nav-group-btn.has-current { color: var(--gold); }
.nav-group-btn:focus-visible, .nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.nav-chevron { width: 0.95rem; height: 0.95rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; transition: transform 0.15s ease; }
.nav-section.open .nav-chevron { transform: rotate(90deg); }
.nav-sub { display: grid; gap: 0.1rem; margin: 0.1rem 0 0.35rem 0.95rem; padding-left: 0.55rem; border-left: 1px solid color-mix(in srgb, var(--rail-dim) 35%, transparent); }
.nav-sub[hidden] { display: none; }
.nav-sub:not([hidden]) { animation: nav-open 0.14s ease-out; }
.nav-sub .nav-icon { width: 1.05rem; height: 1.05rem; }
.nav-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); flex: none; }
@keyframes nav-open { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Working without internet: the status bar under the top bar, and the saved-work page. */
.offline-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.6rem clamp(1rem, 3vw, 2rem); font-size: var(--t-s); border-bottom: 1px solid var(--rule); background: var(--surface-2); color: var(--ink); }
.offline-bar.off { background: var(--gold-soft); color: var(--gold-ink); }
.offline-bar.attention { background: var(--danger-soft); color: var(--danger); }
.offline-bar[hidden] { display: none; }
.saved-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; }
.saved-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.5rem 1rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.saved-actions { display: flex; gap: 0.35rem; }
.bullets { margin: 0.5rem 0 0.75rem; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
@media (max-width: 560px) { .saved-list li { grid-template-columns: 1fr auto; } .saved-actions { grid-column: 1 / -1; } }
.lock-tag { font-size: 0.6875rem; font-weight: 700; color: var(--rail); background: var(--gold); border-radius: 999px; padding: 0.05rem 0.45rem; }
.rail-foot { margin-top: auto; display: grid; gap: 0.5rem; font-size: var(--t-s); padding: 0 0.4rem; }
.rail-foot .who { color: var(--rail-dim); overflow-wrap: anywhere; }
.rail-foot button { background: none; border: 0; color: var(--rail-ink); padding: 0.35rem 0; text-align: left; cursor: pointer; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 0.75rem; justify-content: space-between;
  padding: 0.75rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--rule); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar .menu-btn { display: none; }
.topbar-tools { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.topbar select.input { min-height: 2.25rem; padding: 0.3rem 0.5rem; width: auto; font-size: var(--t-s); }
.plan-banner { padding: 0.7rem clamp(1rem, 3vw, 2rem); font-size: var(--t-s); border-bottom: 1px solid var(--rule); }
.plan-banner.grace { background: var(--gold-soft); color: var(--gold-ink); }
.plan-banner.restricted { background: var(--danger-soft); color: var(--danger); }
.content { padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 4rem; width: 100%; max-width: 72rem; display: grid; gap: 1.75rem; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin-top: 0.35rem; max-width: 60ch; }

/* Panels: one container style, used only where grouping helps. */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); }
.panel-pad { padding: 1.25rem; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); }
.panel-head > h2 { flex: 0 1 auto; }
.panel-head > .muted { flex: 1 1 16rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 0.65rem 1.25rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--ink-3); font-size: var(--t-xs); }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }

.pill { display: inline-block; font-size: var(--t-xs); font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--brand-soft); color: var(--brand); }
.pill.warn { background: var(--gold-soft); color: var(--gold-ink); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pills { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* Empty / notice states */
.empty { padding: 2rem 1.25rem; text-align: left; color: var(--ink-2); display: grid; gap: 0.75rem; justify-items: start; }
.notice { padding: 0.9rem 1rem; border-radius: var(--radius-s); background: var(--surface-2); font-size: var(--t-s); }
.notice.gold { background: var(--gold-soft); color: var(--gold-ink); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.secret {
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 1.25rem; font-weight: 600;
  letter-spacing: 0.04em; background: var(--surface-2); padding: 0.7rem 1rem; border-radius: var(--radius-s); user-select: all;
}

/* Overview checklist — a real sequence, so it is numbered. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 2.25rem 1fr auto; gap: 0.9rem; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); counter-increment: step; }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step); width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: var(--t-s); border: 2px solid var(--rule); color: var(--ink-2);
}
.steps li.done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps li p { color: var(--ink-3); font-size: var(--t-s); }

/* Plan page: usage meters are the memorable element. */
.meters { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.meter { display: grid; gap: 0.4rem; }
.meter .figure { font-size: var(--t-xl); font-weight: 700; }
.meter .figure small { font-size: var(--t-s); font-weight: 500; color: var(--ink-3); }
.meter .bar { height: 0.5rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter .bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.meter.full .bar span { background: var(--gold); }
.plan-hero { display: grid; gap: 0.5rem; padding: 1.5rem 1.25rem; border-bottom: 1px solid var(--rule); }
.plan-hero .edition { font-size: var(--t-xxl); font-weight: 750; letter-spacing: -0.02em; }
.matrix td, .matrix th { text-align: center; padding: 0.55rem 0.75rem; }
.matrix td:first-child, .matrix th:first-child { text-align: left; padding-left: 1.25rem; }
.matrix th.current { color: var(--gold-ink); background: var(--gold-soft); }
.matrix td.current { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.matrix .yes { color: var(--brand); font-weight: 700; }
.matrix .no { color: var(--ink-3); }
.matrix .module td { background: var(--surface-2); font-weight: 650; text-align: left; padding-left: 1.25rem; }

/* Permission picker */
.perm-groups { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.perm-group { display: grid; gap: 0.5rem; align-content: start; }
.perm-group h3 { font-size: var(--t-s); color: var(--ink-2); }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: minmax(8rem, 11rem) 1fr; gap: 1rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--rule); font-size: var(--t-s); }
.activity time { color: var(--ink-3); }
.activity .what { font-weight: 600; }
.activity .detail { color: var(--ink-2); overflow-wrap: anywhere; }

/* Dialog */
dialog {
  border: 0; border-radius: var(--radius-m); padding: 0; width: min(36rem, calc(100vw - 2rem));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(10, 30, 26, 0.45); }
dialog[open] { animation: rise 160ms ease-out; }
.dialog-body { padding: 1.5rem; display: grid; gap: 1.25rem; max-height: calc(100vh - 4rem); overflow-y: auto; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Toasts */
.toasts { position: fixed; bottom: 1rem; right: 1rem; display: grid; gap: 0.5rem; z-index: 50; width: min(24rem, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; border-radius: var(--radius-s); font-size: var(--t-s); box-shadow: var(--shadow-pop); }
.toast.bad { background: var(--danger); color: #fff; }


/* ---------------------------------------------------------------------
   Phase 2: operations
   --------------------------------------------------------------------- */
.num { text-align: right; white-space: nowrap; }
th.num { text-align: right; }
td.neg { color: var(--danger); }
td.pos { color: var(--ok); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus-visible td { background: var(--surface-2); }
tfoot td { font-weight: 650; border-top: 2px solid var(--rule); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.toolbar .input { width: auto; min-width: 12rem; }
.toolbar input[type=search] { flex: 1 1 16rem; }
.row-actions.start { justify-content: flex-start; align-items: flex-end; }
.prewrap { white-space: pre-wrap; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.inline-form .field { flex: 1 1 10rem; }
.chosen { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: var(--brand-soft); border-radius: var(--radius-s); }
.notes p + p { margin-top: 0.4rem; }
.error { color: var(--danger); font-size: var(--t-s); }

/* Ledger strip of key figures: one panel, cells divided by rules. */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.figure-cell { display: grid; gap: 0.15rem; padding: 1.1rem 1.25rem; border-right: 1px solid var(--rule); align-content: start; }
.figure-cell:last-child { border-right: 0; }
.figure-label { font-size: var(--t-s); color: var(--ink-2); }
.figure-label[title] { text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; cursor: help; }
.figure-value { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.01em; }
.figure-note { font-size: var(--t-xs); color: var(--ink-3); }
.two-col { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); align-items: start; }
.definitions summary { cursor: pointer; color: var(--ink-2); font-size: var(--t-s); }
.definitions dl { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.5rem 1rem; font-size: var(--t-s); margin-top: 0.75rem; }
.definitions dt { font-weight: 600; }
.definitions dd { margin: 0; color: var(--ink-2); }

/* Chart */
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-bar { fill: var(--chart); }
.chart-bar.on { fill: color-mix(in srgb, var(--chart) 75%, var(--ink)); }
.chart-axis { stroke: var(--chart-grid); stroke-width: 1; }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-label { fill: var(--ink-3); font-size: 12px; font-family: var(--font); }
.chart-tip { position: absolute; top: -0.25rem; transform: translate(-50%, -100%); background: var(--ink); color: var(--paper);
  font-size: var(--t-xs); padding: 0.3rem 0.55rem; border-radius: var(--radius-s); white-space: nowrap; pointer-events: none; }

/* Picker */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 15; left: 0; right: 0; top: 100%; margin: 0.25rem 0 0; padding: 0.25rem; list-style: none;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s); box-shadow: var(--shadow-pop); max-height: 18rem; overflow-y: auto; }
.picker-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.6rem; border-radius: 4px; cursor: pointer; font-size: var(--t-s); }
.picker-list li.active, .picker-list li:hover { background: var(--brand-soft); }
.picker-meta { color: var(--ink-3); white-space: nowrap; }

/* Sell screen: cart on the left, money on the right. */
.sell { display: grid; grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr); gap: 1.25rem; align-items: start; }
.sell-cart, .sell-side { display: grid; gap: 1rem; }
.sell-side { position: sticky; top: 4.5rem; }
.cart-lines { display: grid; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) 5rem 6.5rem 7rem auto; gap: 0.6rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.cart-line:not(:has(.disc)) { grid-template-columns: minmax(0, 1fr) 5rem 7rem auto; }
.cart-item { display: grid; }
.cart-line .input { min-height: 2.3rem; }
.total-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; font-size: var(--t-s); }
.total-row.grand { font-size: var(--t-l); font-weight: 700; border-top: 1px solid var(--rule); padding-top: 0.6rem; margin-top: 0.3rem; }
.pay { display: grid; gap: 0.6rem; }
.pay h3 { font-size: var(--t-s); color: var(--ink-2); }
.pay-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.pay-row .input { flex: 1 1 8rem; width: auto; }
.change { font-weight: 650; color: var(--brand); min-height: 1.4em; }
.btn-big { min-height: 3.25rem; font-size: var(--t-m); }

/* Document lines (invoice / purchase order editors) */
.doc-lines { display: grid; }
.doc-line { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 8rem auto; gap: 0.6rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.doc-line.with-price { grid-template-columns: minmax(0, 1fr) 5.5rem 7.5rem 7.5rem auto; }
.doc-line-head { font-size: var(--t-xs); color: var(--ink-3); border-bottom: 0; padding-bottom: 0; }
.doc-total { text-align: right; color: var(--ink-2); font-size: var(--t-s); }
.doc-summary { max-width: 22rem; margin-left: auto; padding: 1rem 1.25rem; }

/* Printable documents */
.print-page { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.print-actions { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.print-doc { background: #fff; color: #1B2A33; padding: 2.5rem; border: 1px solid var(--rule); border-radius: var(--radius-m); display: grid; gap: 1.5rem; }
.print-doc table, .print-doc th, .print-doc td { color: #1B2A33; border-color: #D9E0DD; }
.print-head { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; border-bottom: 2px solid #0E6B5A; padding-bottom: 1rem; }
.print-head h1 { font-size: 1.4rem; }
.print-head p, .print-to p { font-size: var(--t-s); }
.print-meta { text-align: right; }
.print-meta h2 { font-size: 1.6rem; color: #0E6B5A; }
.print-to .muted { font-size: var(--t-xs); }
.print-doc .doc-summary { padding: 0; }
.print-notes { font-size: var(--t-s); white-space: pre-wrap; }
.print-foot { font-size: var(--t-xs); color: #6B7A82; border-top: 1px solid #D9E0DD; padding-top: 0.75rem; }
.stamp { color: #B42318; font-weight: 800; letter-spacing: 0.08em; }

/* Phase 3: returns, bills, approvals, cash-up, accounts */
.nav-count { min-width: 1.35rem; text-align: center; font-size: 0.6875rem; font-weight: 700; color: var(--rail); background: var(--gold); border-radius: 999px; padding: 0.05rem 0.4rem; }
.return-lines { display: grid; }
.return-line { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 13rem; gap: 0.6rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); font-size: var(--t-s); }
.return-line.bill { grid-template-columns: minmax(0, 1fr) 5.5rem 7.5rem 5rem; }
.return-line.journal { grid-template-columns: minmax(0, 1fr) 8rem 8rem; }
.return-line.head { font-size: var(--t-xs); color: var(--ink-3); font-weight: 600; padding-bottom: 0.3rem; }
.return-line .sub { display: block; color: var(--ink-3); font-size: var(--t-xs); }
.return-lines > .error { padding-top: 0.4rem; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.tab { font: inherit; font-size: var(--t-s); font-weight: 600; color: var(--ink-2); background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.6rem 0.9rem; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.statement { padding: 1rem 1.25rem; display: grid; gap: 1.25rem; }
.statement h2 { font-size: var(--t-m); margin-bottom: 0.3rem; }
.total-row.subtotal { font-weight: 650; border-top: 1px dashed var(--rule); margin-top: 0.2rem; }
.code { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: var(--t-xs); }
td.indent { padding-left: 2.25rem; }
.journal-entry .panel-head h2 { font-size: var(--t-s); }
.journal-entry .panel-head .pill { margin-left: 0.4rem; }
.figure-cell.warn .figure-value { color: var(--danger); }
.figure-cell.strong .figure-value { color: var(--brand); }
.policy-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.policy-amt { display: flex; align-items: center; gap: 0.5rem; }
.policy-amt .input { width: 9rem; }
.form-actions.start { justify-content: flex-start; }

/* Phase 4: notifications, messages, payments page, security */
.bell { position: relative; min-width: 2.5rem; padding: 0.35rem 0.55rem; color: var(--ink-2); }
.bell:hover { color: var(--ink); }
.bell-count { position: absolute; top: 0.05rem; right: 0.05rem; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 999px;
  background: var(--gold); color: var(--rail); font-size: 0.6875rem; font-weight: 800; line-height: 1.15rem; text-align: center; }
.panel-head.flush { padding: 0 0 0.6rem; border: 0; }
.note-list { list-style: none; margin: 0 0 0.5rem; padding: 0; max-height: min(60vh, 32rem); overflow: auto; display: grid; gap: 0.15rem; min-width: min(30rem, 80vw); }
.note-list a { display: grid; gap: 0.15rem; padding: 0.65rem 0.75rem; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; }
.note-list a:hover { background: var(--surface-2); }
.note-list li.unread a { background: var(--brand-soft); }
.note-list .sub { color: var(--ink-2); font-size: var(--t-s); }
.note-list .when { color: var(--ink-3); font-size: var(--t-xs); }
.secret.wrap, code.wrap { word-break: break-all; }
.secret.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1.5rem; font-variant-numeric: tabular-nums; }
.kv { display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.kv > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.75rem; font-size: var(--t-s); align-items: baseline; }
.kv > div > span:first-child { color: var(--ink-3); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.35rem 1rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); }
.bad-text { color: var(--danger) !important; }
.center { text-align: center; }
textarea.input { min-height: 5rem; resize: vertical; font: inherit; line-height: 1.5; }

.pay-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; background: var(--paper); }
.pay-card { width: min(28rem, 100%); background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--brand);
  border-radius: var(--radius-m); padding: 1.75rem 1.5rem; display: grid; gap: 0.75rem; box-shadow: var(--shadow-pop); }
.pay-card h1 { font-size: var(--t-xl); margin: 0; }
.pay-card h2 { font-size: var(--t-l); margin: 0; }
.pay-card p { margin: 0; }
.pay-amount { font-size: var(--t-xxl); font-weight: 800; letter-spacing: -0.02em; color: var(--brand); font-variant-numeric: tabular-nums; }
.pay-done { width: 3rem; height: 3rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }
.pay-foot { color: var(--ink-3); font-size: var(--t-xs); border-top: 1px solid var(--rule); padding-top: 0.75rem; margin-top: 0.5rem !important; }

/* Responsive */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story { padding-bottom: 2rem; }
  .auth-story .edition-ladder { display: none; }
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(18rem, 85vw); z-index: 20; transform: translateX(-100%); transition: transform 180ms ease; }
  .shell.menu-open .rail { transform: none; box-shadow: var(--shadow-pop); }
  .topbar .menu-btn { display: inline-flex; }
  .activity li { grid-template-columns: 1fr; gap: 0.2rem; }
  .sell { grid-template-columns: 1fr; }
  .sell-side { position: static; }
  .cart-line, .cart-line:not(:has(.disc)) { grid-template-columns: minmax(0, 1fr) 4.5rem auto; }
  .cart-line .disc { grid-column: 1 / 2; }
  .doc-line, .doc-line.with-price { grid-template-columns: 1fr 1fr; }
  .return-line, .return-line.bill, .return-line.journal { grid-template-columns: 1fr 1fr; }
  .return-line > :first-child { grid-column: 1 / -1; }
  .return-line.head { display: none; }
  .kv > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .secret.codes { grid-template-columns: 1fr; }
  .figure-cell { border-right: 0; border-bottom: 1px solid var(--rule); }
  .print-doc { padding: 1.25rem; }
  th, td { padding-left: 1rem; padding-right: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .rail, .topbar, .toasts, .print-actions, .plan-banner { display: none; }
  .shell { display: block; }
  body { background: #fff; }
  .print-page { padding: 0; max-width: none; }
  .print-doc { border: 0; padding: 0; }
}
.doc-summary.flush { max-width: none; padding: 0; }
.change-row { font-size: var(--t-l); font-weight: 700; color: var(--brand); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Phase 5 */
.plan-banner.demo { background: var(--brand-soft); color: var(--brand); }
.plan-banner a { color: inherit; font-weight: 650; }
.edition-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); padding: 1rem 1.25rem 1.25rem; }
.edition-card { display: grid; gap: 0.6rem; align-content: start; padding: 1rem; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); }
.edition-card.current { border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.edition-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.edition-card h3 { margin: 0; font-size: var(--t-l); }
.edition-limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: var(--t-s); }
.edition-limits li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--rule); padding: 0.2rem 0; }
.edition-card .row-actions { justify-content: flex-start; flex-wrap: wrap; }
.import-kinds { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.import-kind { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; align-items: start; padding: 0.75rem 0.9rem; border: 1px solid var(--rule);
  border-radius: var(--radius-s); cursor: pointer; background: var(--surface); }
.import-kind input { grid-row: span 2; margin-top: 0.2rem; accent-color: var(--brand); }
.import-kind.chosen { border-color: var(--brand); background: var(--brand-soft); }
.import-kind.disabled { opacity: 0.6; cursor: not-allowed; }
.danger-zone h3 { margin: 1.25rem 0 0.25rem; font-size: var(--t-m); }
.danger-zone .btn-danger { margin-top: 0.6rem; }
.org-switch select option[value="__new"], .org-switch select option[value="__demo"] { font-style: italic; }
/* Keep the rail colour running the full height of long pages (screenshots, print preview). */
@media (min-width: 861px) { .shell { background: linear-gradient(to right, var(--rail) 16rem, transparent 16rem); } }
/* Wide tables scroll inside their panel instead of stretching the page. */
.content > * { min-width: 0; }
.panel { min-width: 0; }

/* ---------------------------------------------------------------- Phase 6 */
.target-list { display: grid; gap: 1.1rem; }
.target { display: grid; gap: 0.4rem; }
.target-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; font-size: var(--t-s); }
.target .bar { position: relative; height: 0.6rem; background: var(--surface-2); border-radius: 999px; overflow: visible; }
.target .bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.target .bar .pace { position: absolute; top: -0.25rem; bottom: -0.25rem; width: 2px; background: var(--ink); opacity: 0.55; }
.target .btn.small { justify-self: start; padding: 0.15rem 0.4rem; }
.insights { list-style: none; margin: 0; padding: 0; }
.insights li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: center; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--rule); }
.insights li:last-child { border-bottom: 0; }
.insights p { margin: 0.15rem 0 0; }
.trend-note { margin: 0.4rem 0.25rem 0; }
.ai-panel .panel-head.flat { padding: 0 0 0.6rem; border: 0; }
.ai-out { margin-top: 0.75rem; display: grid; gap: 0.4rem; }
.ai-out p { margin: 0; }
.ai-label { color: var(--gold-ink); background: var(--gold-soft); padding: 0.35rem 0.6rem; border-radius: var(--radius-s); justify-self: start; }
.check-grid { display: grid; gap: 0.35rem 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0.75rem 0.9rem; display: grid; gap: 0.6rem; margin: 0; min-width: 0; }
legend { font-weight: 650; font-size: var(--t-s); padding: 0 0.3rem; }
.conds { display: grid; gap: 0.5rem; }
.offline-queue { display: grid; gap: 0.4rem; justify-items: start; }
.sso { border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.sso summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: var(--t-s); }
.sso form { margin-top: 0.75rem; }

/* Feedback: in the top bar on wide screens, in the menu on phones (the top bar is full there). */
.rail-feedback { display: none; }
@media (max-width: 860px) {
  .topbar-feedback { display: none; }
  .rail-feedback { display: block; }
}
@media (max-width: 480px) {
  .topbar { padding-left: 0.75rem; padding-right: 0.75rem; }
  .topbar-tools { gap: 0.3rem; min-width: 0; }
  .topbar select.input { max-width: 7.5rem; text-overflow: ellipsis; }
}

/* Phase 8.1: documents settings */
.logo-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.logo-row input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.logo-preview { max-height: 56px; max-width: 200px; border: 1px solid var(--rule); border-radius: 6px; padding: 4px; background: #fff; }
.stack-sm { display: grid; gap: 0.25rem; }
.form h3 { font-size: var(--t-s); margin: 1rem 0 0.25rem; }
.statement-tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.statement-tools label { display: flex; align-items: center; gap: 0.4rem; }
.statement-tools .input { width: auto; }
/* Phase 8.2 */
.fieldset { border: 1px solid var(--rule); border-radius: 10px; padding: 0.75rem 1rem 1rem; margin: 0.5rem 0 0; display: grid; gap: 0.6rem; }
.fieldset legend { font-weight: 650; padding: 0 0.35rem; font-size: var(--t-s); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1.25rem; }
.tag { display: inline-block; font-size: var(--t-xs); padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin: 0 0.25rem 0.15rem 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0.65rem 1.25rem; border-top: 1px solid var(--rule); display: grid; gap: 0.15rem; }
.timeline li:first-child { border-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
/* Phase 8.3: count sheets print cleanly; numbers line up */
.count-sheet td .input.qty { max-width: 7rem; margin-left: auto; }
.count-sheet td.pos { color: var(--ok, #0e6b5a); }
.count-sheet td.neg { color: var(--bad, #b42318); }
@media print {
  .no-print, .page-head .row-actions, .count-sheet .form-actions { display: none !important; }
  .count-sheet .input.qty { border: 0; border-bottom: 1px solid #000; border-radius: 0; }
  .count-sheet tr[hidden] { display: table-row !important; }
}
/* Phase 8.4: files and money accounts */
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus, #f5b301); outline-offset: 2px; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; padding: 0.6rem 1.25rem; border-top: 1px solid var(--rule); }
.file-list li:first-child { border-top: 0; }
.file-list li a { font-weight: 600; word-break: break-all; }
.file-list li button { margin-left: auto; }
.account-field[hidden] { display: none; }
.sub.error { color: var(--bad, #b42318); }
/* Phase 8.5 */
.layout-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.25rem; }
.layout-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0.5rem; border: 1px solid var(--rule); border-radius: 8px; }
.day-boxes { flex-wrap: wrap; gap: 0.5rem 1rem; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1rem; }
dl.kv dd { margin: 0; word-break: break-all; }
.policy-row { flex-wrap: wrap; }
/* Phase 9.1: product photos, variants, custom fields */
.thumb { display: inline-block; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--rule); flex: none; }
.thumb-small { width: 40px; height: 40px; }
.thumb-large { width: 160px; height: 160px; }
.thumb-empty { border-style: dashed; }
.picker-list li .thumb-small { width: 32px; height: 32px; margin-right: 0.25rem; }
.picker-list li > span:first-of-type { margin-right: auto; }
.photo-grid { list-style: none; margin: 0; padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.photo-grid li { display: grid; gap: 0.35rem; justify-items: start; }
.photo-grid a { display: block; line-height: 0; border-radius: var(--radius-s); }
.crumb { margin: -0.5rem 0 1rem; color: var(--ink-3); font-size: var(--t-s); }
.options-box { display: grid; gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface-2); }
.options-box[hidden] { display: none; }
@media (max-width: 640px) { .thumb-large { width: 120px; height: 120px; } }
/* Phase 9.2: batches, serial numbers, held-back stock */
.lot-note { display: block; color: var(--ink-3); }
.cart-line .input.serials { grid-column: 1 / -1; font-size: var(--t-s); }
.lot-row { flex-basis: 100%; }
.lot-slot:empty { display: none; }
/* Phase 9.3: till quick buttons, parked sales, exchanges */
.quick-box { display: grid; gap: 0.6rem; margin: 0.75rem 0 0.25rem; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 0.3rem 0.8rem; font: inherit; font-size: var(--t-s); cursor: pointer; min-height: 2rem; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink, #fff); }
.chip-quiet { border-style: dashed; color: var(--ink-3); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.5rem; }
.quick-btn { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0.5rem; align-items: center; text-align: left;
  border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); padding: 0.45rem; font: inherit; cursor: pointer; min-height: 3.2rem; }
.quick-btn:hover, .quick-btn:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.quick-btn .thumb { grid-row: 1 / 3; }
.quick-name { font-size: var(--t-s); font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.quick-price { font-size: var(--t-s); color: var(--ink-3); }
.till-extra-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.till-extra-actions .btn { flex: 1 1 8rem; }
.fav-list li .row-actions { display: flex; gap: 0.25rem; }
.exchange-summary { border-top: 1px solid var(--rule); padding-top: 0.5rem; }
.take-list li { gap: 0.5rem; }
.take-list .row-actions { display: flex; align-items: center; gap: 0.25rem; flex-wrap: nowrap; }
.take-list .input.qty { width: 5rem; }
/* Phase 9.4: budgets, rota, attendance */
.budget-cell { display: flex; align-items: center; gap: 0.5rem; min-width: 8rem; }
.budget-bar { flex: 1; height: 0.5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--rule); }
.budget-bar span { display: block; height: 100%; background: var(--brand); }
.budget-bar.close span { background: #c98a04; }
.budget-bar.over span { background: var(--danger, #b42318); }
.rota { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.rota-day { padding: 0.75rem 1rem; }
.rota-day.today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.rota-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.rota-head h2 { font-size: var(--t-m, 1rem); margin: 0; }
.rota-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.rota-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.5rem; align-items: center; font-size: var(--t-s); padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.rota-list li:first-child { border-top: 0; }
.rota-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.clock-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.clock-card h2 { margin: 0 0 0.25rem; }
.neg { color: var(--danger, #b42318); }
.rota-list .sub { display: block; color: var(--ink-3); }

/* Phase 9.6: E-VAT record preview */
.code-block { max-height: 22rem; overflow: auto; margin: 0.6rem 0 0; padding: 0.8rem; border-radius: var(--radius-s); background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre; }
details > summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-top: 0.6rem; }

/* SMS bundles: one card per bundle on offer. */
.bundles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; padding: 1.25rem; }
.bundle { display: grid; gap: 0.3rem; align-content: start; padding: 1rem; border: 1px solid var(--rule); border-radius: var(--radius-s); }
.bundle-name { font-weight: 650; }
.bundle-units { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.01em; }
.bundle-price { color: var(--ink-2); }
.bundle .btn { margin-top: 0.5rem; justify-self: start; }
.stack { display: grid; gap: 0.75rem; justify-items: start; }
.stack > .notice, .stack > form { justify-self: stretch; }

/* "A new version is ready" (after an upgrade, while a page was open). */
.update-ready { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem; background: var(--ink, #1b2b27); color: #fff; border-radius: var(--radius-s); box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: calc(100vw - 2rem); }

/* Free trial (Plan and billing) */
.plan-banner.trial { background: var(--brand-soft); color: var(--brand); }
.trial-panel { display: grid; gap: 0.9rem; border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.trial-panel.ended { border-color: var(--danger); box-shadow: inset 0 3px 0 var(--danger); }
.trial-panel h2 { margin: 0; }
.trial-points { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; color: var(--ink-2); max-width: 70ch; }
.trial-count { display: flex; align-items: center; gap: 1rem; }
.trial-count .figure { font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.trial-count h2 { font-size: var(--t-l); }
.trial-count p { margin: 0.2rem 0 0; }
.trial-panel .bar { height: 0.5rem; border-radius: 999px; background: var(--rule); overflow: hidden; }
.trial-panel .bar span { display: block; height: 100%; background: var(--gold); }
.edition-price { margin: 0; font-size: var(--t-l); font-weight: 650; font-variant-numeric: tabular-nums; }
