/* ==========================================================================
   Ledger UI — RTL Arabic accounting interface (v1.8 "Gulf blue" theme)
   Blue carries navigation and actions; teal-green is reserved for money-in,
   balanced and successful states, so colour itself tells the user something.
   ========================================================================== */
:root {
  --navy: #0A2240;          /* sidebar, headings on light */
  --navy-2: #12325C;        /* sidebar hover / active surface */
  --brand: #1C5BA8;         /* actions, links, focus */
  --brand-dark: #144681;
  --tint: #EAF1FA;          /* row hover, sheet headers */
  --tint-strong: #D4E3F5;
  --pos: #0E8A6E;           /* positive / balanced / success */
  --pos-dark: #0A6A55;
  --pos-bg: #E3F4EE;
  --pos-line: #B4DECF;
  --ink: #13263E;
  --ink-soft: #586880;
  --paper: #F1F4F9;
  --panel: #FFFFFF;
  --rule: #D9E1EC;
  --line: #E8EDF4;
  --field: #C6D2E1;
  --red: #B4232F;
  --red-bg: #FCEDEE;
  --amber: #8E5B00;
  --amber-bg: #FFF4DB;
  --focus: #2F80ED;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "Segoe UI", "SF Arabic", "Noto Sans Arabic", "IBM Plex Sans Arabic", Tahoma, "Geeza Pro", sans-serif;
  /* Legacy names used across module stylesheets — mapped onto the new palette. */
  --green: var(--brand);
  --green-dark: var(--brand-dark);
  --green-deep: var(--navy);
  --ledger: var(--tint);
  --ledger-strong: var(--tint-strong);
  --ok-bg: var(--pos-bg);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; color: var(--navy); }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.005em; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 75ch; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: left; direction: ltr; white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.ltr { direction: ltr; unicode-bidi: embed; }
.sr-only { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
body { overflow-x: hidden; }
.sidebar {
  background: var(--navy);
  color: #C9D7EA;
  padding: 0 0 1.5rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: .5rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 1.3rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.brand img { max-height: 38px; max-width: 110px; background: #fff; border-radius: 8px; padding: 3px; }
.brand strong { font-size: .98rem; color: #fff; display: block; line-height: 1.35; }
.brand span { font-size: .76rem; color: #8FA6C4; }
.nav-group { padding: .35rem 0; }
.nav-group > .nav-title { font-size: .76rem; font-weight: 600; color: #7891B3; padding: .45rem 1.4rem .2rem; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: .65rem; margin: 1px .6rem; padding: .44rem .8rem;
  color: #C9D7EA; text-decoration: none; border-radius: 8px; font-size: .93rem; position: relative;
}
.sidebar a.nav-link .ico { color: #7F9BC2; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.nav-link:hover .ico { color: #B9CCE6; }
/* Active item: a ledger "double rule" in teal — the accountant's mark for a closed total. */
.sidebar a.nav-link.active { background: var(--navy-2); color: #fff; font-weight: 600; }
.sidebar a.nav-link.active .ico { color: #5FD3B5; }
.sidebar a.nav-link.active::before {
  content: ""; position: absolute; inset-inline-start: -.6rem; top: 22%; bottom: 22%; width: 5px;
  border-inline-start: 2px solid #3FC6A3; border-inline-end: 2px solid #3FC6A3;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.75rem; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(1.2) blur(6px);
}
.topbar .who { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.topbar form { margin: 0; }
.topbar-date { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }
.who-name { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.who-name:hover { color: var(--brand); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-strong); color: var(--brand-dark); font-weight: 800; font-size: .85rem; }
.content { padding: 1.6rem 1.75rem 3rem; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem; }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-head .actions form { margin: 0; }

.btn.menu-btn, .menu-backdrop { display: none; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; margin-bottom: 1.25rem; }
.panel > h2:first-child { margin-top: 0; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush > h2 { padding: 1rem 1.25rem .85rem; margin: 0; border-bottom: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

/* Dashboard figures: a ledger summary row, not a card grid */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--panel); margin-bottom: 1.25rem; overflow: hidden; }
.figure { padding: 1rem 1.25rem; border-inline-start: 1px solid var(--line); }
.figure:first-child { border-inline-start: 0; }
.figure .label { color: var(--ink-soft); font-size: .85rem; }
.figure .label a { color: inherit; }
.figure .value { font-size: 1.45rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.figure .value.neg { color: var(--red); }

/* ---------- Tables (ledger book) ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table.ledger { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.ledger th {
  text-align: right; font-weight: 600; font-size: .84rem; color: var(--ink-soft); background: #F6F8FC;
  border-bottom: 1px solid var(--rule); padding: .6rem .8rem; white-space: nowrap;
}
table.ledger td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.ledger tbody tr:last-child td { border-bottom: 0; }
table.ledger tbody tr:nth-child(even) td { background: #FBFCFE; }
table.ledger tbody tr:hover td { background: var(--tint); }
table.ledger tfoot td { font-weight: 700; border-top: 2px solid var(--navy); border-bottom: 3px double var(--navy); background: var(--panel); }
table.ledger td.actions { white-space: nowrap; text-align: left; }
table.ledger tr.group td { font-weight: 700; color: var(--navy); }
table.ledger tr.inactive td { color: #98A3B3; }
.tree-name { display: inline-block; }
.lvl-2 { padding-inline-start: 1.1rem; }
.lvl-3 { padding-inline-start: 2.2rem; }
.lvl-4 { padding-inline-start: 3.3rem; }
.lvl-5 { padding-inline-start: 4.4rem; }
.lvl-6 { padding-inline-start: 5.5rem; }
.lvl-7 { padding-inline-start: 6.6rem; }
.lvl-8 { padding-inline-start: 7.7rem; }
.empty { padding: 2.25rem 1.25rem; text-align: center; color: var(--ink-soft); }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--rule); background: #F4F7FB; color: var(--ink-soft); white-space: nowrap; }
.badge.green { background: var(--pos-bg); border-color: var(--pos-line); color: var(--pos-dark); }
.badge.red { background: var(--red-bg); border-color: #EFC2C6; color: var(--red); }
.badge.amber { background: var(--amber-bg); border-color: #EBD3A0; color: var(--amber); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; color: #22374F; }
.field { margin-bottom: 1rem; }
.field .hint, .hint { font-size: .82rem; color: var(--ink-soft); margin-top: .25rem; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--field); border-radius: var(--radius); padding: .5rem .7rem; min-height: 40px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #A9BAD0; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px rgba(28,91,168,.18); }
input[disabled], select[disabled] { background: var(--paper); color: var(--ink-soft); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.inline-form { display: inline; margin: 0; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
/* A page's own filter bar (directly under the heading) reads as one toolbar. */
.content > .filters { margin-bottom: 1.1rem; padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.filters .field { margin: 0; min-width: 150px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
  padding: .55rem 1.05rem; min-height: 40px; border-radius: var(--radius);
  border: 1px solid var(--field); background: #fff; color: var(--navy); cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--tint); border-color: #A9BAD0; color: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(10,34,64,.15); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: var(--red); border-color: #E7B7BB; }
.btn-danger:hover { background: var(--red-bg); color: var(--red); border-color: #DFA3A9; }
.btn-link { border: 0; background: none; color: var(--brand); padding: .2rem .35rem; min-height: 0; font-weight: 600; }
.btn-link:hover { background: none; text-decoration: underline; color: var(--brand-dark); }
.btn-link.danger { color: var(--red); }
.btn-sm { padding: .3rem .7rem; min-height: 32px; font-size: .84rem; }
.btn-ghost-light { background: transparent; color: #C9D7EA; border-color: rgba(255,255,255,.25); }

/* ---------- Alerts ---------- */
.alert { border: 1px solid; border-inline-start-width: 4px; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; white-space: pre-line; }
.alert-success { background: var(--pos-bg); border-color: var(--pos-line); border-inline-start-color: var(--pos); color: var(--pos-dark); }
.alert-error { background: var(--red-bg); border-color: #EFC2C6; border-inline-start-color: var(--red); color: var(--red); }
.alert-warning { background: var(--amber-bg); border-color: #EBD3A0; border-inline-start-color: #C88A12; color: var(--amber); }
.alert-info { background: var(--tint); border-color: var(--tint-strong); border-inline-start-color: var(--brand); color: var(--brand-dark); }

/* ---------- Journal sheet (the signature element) ---------- */
.sheet { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.sheet table { width: 100%; min-width: 720px; border-collapse: collapse; }
.sheet th { background: var(--tint); color: var(--navy); font-weight: 600; font-size: .86rem; padding: .55rem .5rem; text-align: right; border-bottom: 1px solid var(--tint-strong); }
.sheet td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sheet td.amount { width: 150px; background: #FAFCFE; border-inline-start: 1px solid var(--line); }
.sheet td.amount input { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.sheet td.line-no { width: 36px; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.sheet td.remove { width: 44px; text-align: center; }
.sheet .line-account { min-width: 220px; }
.balance-strip {
  display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 1.5rem; align-items: center;
  padding: .85rem 1rem; border-top: 2px solid var(--rule); background: #F6F8FC;
  font-variant-numeric: tabular-nums;
}
.balance-strip .tot { text-align: left; direction: ltr; }
.balance-strip .tot small { display: block; direction: rtl; text-align: right; color: var(--ink-soft); font-size: .78rem; }
.balance-strip .tot b { font-size: 1.1rem; }
.balance-strip .state { font-weight: 700; }
.balance-strip.is-balanced { background: var(--pos-bg); border-top-color: var(--pos); }
.balance-strip.is-balanced .state { color: var(--pos-dark); }
.balance-strip.is-off .state { color: var(--red); }
@media (prefers-reduced-motion: no-preference) {
  .sidebar { transition: transform .2s ease, visibility .2s; }
  .balance-strip { transition: background-color .25s ease, border-color .25s ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.meta-list { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: .4rem 1.25rem; margin: 0; }
.meta-list dt { color: var(--ink-soft); }
.meta-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Guest pages (login, 2FA, installer) ---------- */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--paper); position: relative; isolation: isolate; }
.guest::before { content: ""; position: absolute; inset: 0; z-index: -1; background-color: var(--navy);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 28px); }
.guest-box { width: 100%; max-width: 440px; }
.guest-box.wide { max-width: 760px; }
.guest-head { color: #fff; text-align: center; margin-bottom: 1.35rem; }
.guest-head .brand-mark { margin: 0 auto .7rem; width: 52px; height: 52px; font-size: 1.4rem; border-radius: 14px; }
.guest-head img { max-height: 56px; background: #fff; border-radius: 10px; padding: 4px; margin-bottom: .5rem; }
.guest-head h1 { margin: 0; font-size: 1.4rem; color: #fff; }
.guest-head p { margin: .25rem auto 0; color: #9DB3D1; font-size: .92rem; }
.guest .panel { padding: 1.6rem; box-shadow: 0 12px 32px -18px rgba(10,34,64,.45); }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.req-list .ok { color: var(--pos); font-weight: 700; }
.req-list .bad { color: var(--red); font-weight: 700; }

/* ---------- 2FA ---------- */
.qr-box { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.qr-box svg { width: 200px; height: 200px; border: 1px solid var(--rule); border-radius: var(--radius); }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; direction: ltr; background: var(--paper); border: 1px dashed var(--rule); padding: .4rem .6rem; border-radius: 4px; word-break: break-all; display: inline-block; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: .4rem 2rem; font-family: ui-monospace, Consolas, monospace; direction: ltr; font-size: 1.05rem; margin: .75rem 0; }
.code-input { font-size: 1.5rem !important; letter-spacing: .4em; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }

/* ---------- Permission matrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: right; }
.matrix .module-row td { background: var(--ledger) !important; font-weight: 700; text-align: right; color: var(--green-deep); }

.pager { display: flex; gap: .4rem; justify-content: center; padding: 1rem; }
.diff { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-word; max-width: 420px; color: var(--ink-soft); margin: 0; }
details summary { cursor: pointer; color: var(--green); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure:nth-child(3) { border-inline-start: 0; }
  .figure:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: 270px; z-index: 50; transform: translateX(100%); visibility: hidden; }
  .menu-toggle:checked ~ .shell .sidebar { transform: translateX(0); visibility: visible; }
  .menu-toggle:checked ~ .shell .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(10,34,64,.5); }
  .btn.menu-btn { display: inline-flex; }
  .topbar-date { display: none; }
  .topbar { padding: .6rem 1rem; }
  .content { padding: 1rem 1rem 3rem; }
  .who .who-label, .who .badge { display: none; }
  .balance-strip { grid-template-columns: 1fr 1fr; }
  .balance-strip .state { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .figures { grid-template-columns: 1fr; }
  .figure { border-inline-start: 0 !important; border-top: 1px solid var(--rule); }
  .figure:first-child { border-top: 0; }
}

@media print {
  .sidebar, .topbar, .page-head .actions, .filters, .no-print, .pager { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  body { background: #fff; font-size: 12px; }
}
.btn-block { width: 100%; }
.center { text-align: center; margin-inline: auto; }
.mt { margin-top: 1.25rem; }
.panel-pad { padding: 1rem 1.25rem; margin: 0; }
.logo-preview { max-height: 90px; max-width: 240px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px; background: #fff; }
input[aria-invalid=true] { border-color: var(--red); background: var(--red-bg); }

/* ---------- Journal entry modes ---------- */
.mode-tabs { display: flex; gap: 0; margin-bottom: -1px; position: relative; z-index: 1; }
.mode-tab {
  margin: 0; padding: .55rem 1.1rem; cursor: pointer; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--rule); border-bottom: 0; background: var(--paper); color: var(--ink-soft);
}
.mode-tab.tab-simple { border-start-start-radius: var(--radius); }
.mode-tab.tab-multi { border-start-end-radius: var(--radius); border-inline-start: 0; }
#mode-simple:checked ~ .mode-tabs .tab-simple,
#mode-multi:checked ~ .mode-tabs .tab-multi { background: #fff; color: var(--green-deep); box-shadow: inset 0 3px 0 var(--green); }
#mode-simple:focus-visible ~ .mode-tabs .tab-simple,
#mode-multi:focus-visible ~ .mode-tabs .tab-multi { outline: 3px solid var(--focus); outline-offset: -3px; }
#mode-simple:checked ~ .pane-multi,
#mode-multi:checked ~ .pane-simple { display: none; }
.pane.sheet { border-start-start-radius: 0; }
.simple-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; padding: 1.1rem 1.1rem 0; background: var(--ledger); }
.simple-grid .field { margin-bottom: 1.1rem; }
.amount-input { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; font-size: 1.15rem !important; font-weight: 700; }
.party-slot { margin-top: .45rem; }
.party-slot:has(select[disabled]) { display: none; }
.party-cell { min-width: 170px; }
.party-cell select[disabled] { color: #A3AEB8; background: var(--paper); border-style: dashed; }
.hint-line { margin: 0; padding: .7rem 1.1rem; font-size: .85rem; color: var(--ink-soft); border-top: 1px solid var(--ledger-strong); max-width: none; }
.sheet table { min-width: 900px; }
@media (max-width: 820px) {
  .simple-grid { grid-template-columns: 1fr; }
}

/* ---------- Phase 2 ---------- */
.figures-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.neg-text { color: var(--red); }
.stock-table { min-width: 640px !important; }
.stock-strip { grid-template-columns: 1fr auto; }
.rename-form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.rename-form input { min-height: 34px; padding: .3rem .5rem; }
.recon-ok { color: var(--pos-dark); }
@media (max-width: 1000px) { .figures-3 { grid-template-columns: 1fr; } .figures-3 .figure { border-inline-start: 0; border-top: 1px solid var(--rule); } .figures-3 .figure:first-child { border-top: 0; } }
.breakdown { direction: rtl; text-align: left; white-space: nowrap; }
.unit-cell { min-width: 110px; }
.units-sheet table { min-width: 760px; }

/* ---------- Phase 3: sales ---------- */
.sales-sheet table { min-width: 960px; }
.sales-sheet .item-cell { min-width: 240px; }
.sales-sheet .desc-input { margin-top: .3rem; min-height: 32px; font-size: .85rem; padding: .25rem .5rem; }
.sales-sheet td.narrow { width: 100px; }
.sales-sheet td.disc-type { width: 92px; }
.sales-sheet td.line-total { width: 120px; font-weight: 600; }
.sales-totals { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .9rem 1rem; border-top: 2px solid var(--rule); background: var(--paper); flex-wrap: wrap; }
.sales-totals dl { display: grid; grid-template-columns: auto auto; gap: .25rem 1.5rem; margin: 0; min-width: 260px; }
.sales-totals dt { color: var(--ink-soft); }
.sales-totals dd { margin: 0; text-align: left; direction: ltr; font-variant-numeric: tabular-nums; font-weight: 600; }
.sales-totals .grand { font-size: 1.15rem; font-weight: 700; color: var(--green-deep); border-top: 1px solid var(--rule); padding-top: .3rem; }

.status-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); margin-bottom: 1.25rem; overflow: hidden; }
.sb-item { display: flex; flex-direction: column; gap: .1rem; padding: .75rem 1rem; text-decoration: none; color: var(--ink); border-inline-start: 1px solid var(--rule); border-top: 3px solid transparent; }
.sb-item:first-child { border-inline-start: 0; }
.sb-item:hover { background: var(--paper); color: var(--ink); }
.sb-item.active { border-top-color: var(--green); background: var(--ledger); }
.sb-label { font-size: .85rem; color: var(--ink-soft); }
.sb-count { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-total { font-size: .8rem; color: var(--ink-soft); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.sb-expired .sb-count { color: var(--amber); }
.sb-rejected .sb-count { color: var(--red); }
.sb-accepted .sb-count, .sb-converted .sb-count { color: var(--pos); }
.badge.blue { background: var(--tint); border-color: var(--tint-strong); color: var(--brand-dark); }

.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.doc-preview { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem; overflow-x: auto; }
.doc-preview .doc { min-width: 640px; }
.doc-side .panel h2 { font-size: 1rem; }
.status-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-wa { background: #1F7A4D; border-color: #1F7A4D; color: #fff; }
.btn-wa:hover { background: #18603C; color: #fff; }
.mt-s { margin-top: .75rem; }
.breakall { word-break: break-all; }
@media (max-width: 1100px) { .doc-layout { grid-template-columns: 1fr; } .status-board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .status-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sb-item:nth-child(odd) { border-inline-start: 0; } }
@media print { .doc-side { display: none; } .doc-layout { display: block; } .doc-preview { border: 0; padding: 0; } }

/* ---- Phase 4: e-invoicing */
ul.plain { list-style: none; margin: .35rem 0 0; padding: 0; white-space: normal; }
ul.plain li { padding: .15rem 0; border-top: 1px dashed rgba(0,0,0,.08); overflow-wrap: anywhere; }
ul.plain li:first-child { border-top: 0; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding: .9rem 3rem .9rem 0; border-top: 1px solid var(--rule); }
.steps > li:first-child { border-top: 0; }
.steps > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: .9rem; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--tint); color: var(--brand-dark); }
.steps > li.done::before { content: "✓"; background: var(--pos); color: #fff; }
.steps > li.locked { opacity: .55; }
.steps h3 { margin: 0 0 .35rem; font-size: 1rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem; margin: .5rem 0; }
.check-grid .item { border: 1px solid var(--rule); border-radius: var(--radius, 6px); padding: .45rem .6rem; font-size: .85rem; }
.note-lines td input { max-width: 8rem; }
.code-block { background: #F6F8FC; border: 1px solid var(--rule); border-radius: var(--radius); padding: .5rem .75rem; overflow-x: auto; font-size: .8rem; white-space: pre; }
.grid-2 > * { min-width: 0; }
.steps .form-row > .field { min-width: 0; }
.alert-static { white-space: normal; }
.doc-layout > * { min-width: 0; }

/* ---- financial statements (same markup on screen, print and PDF) ---- */
table.stmt { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.stmt th { background: var(--green-deep); color: #fff; font-weight: 600; padding: .5rem .75rem; text-align: right; }
table.stmt th.amt, table.stmt td.amt { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; width: 11rem; }
table.stmt td { padding: .4rem .75rem; border-bottom: 1px solid var(--line); }
table.stmt tr.sec td { background: var(--ledger-strong); font-weight: 700; color: var(--green-deep); padding-top: .6rem; }
table.stmt tr.sec2 td { font-weight: 700; color: var(--green-dark); padding-top: .55rem; }
table.stmt tr.grp td { font-weight: 600; }
table.stmt tr.subtotal td { font-weight: 700; border-top: 1px solid var(--ink-soft); }
table.stmt tr.result td { font-weight: 700; background: var(--ledger); border-top: 1px solid var(--ink); }
table.stmt tr.final td { font-weight: 800; background: var(--ledger); border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); font-size: 1rem; }
table.stmt .d0 { padding-inline-start: 1.2rem; }
table.stmt .d1 { padding-inline-start: 2.2rem; }
table.stmt .d2 { padding-inline-start: 3.2rem; }
table.stmt .d3, table.stmt .d4 { padding-inline-start: 4.2rem; }
table.stmt .code { color: var(--ink-soft); font-size: .8rem; font-variant-numeric: tabular-nums; }
table.stmt .neg { color: var(--red); }
table.vat td.box { width: 2.5rem; text-align: center; font-weight: 700; color: var(--green-deep); }
table.vat tr.manual td { background: var(--amber-bg); }
.check-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.statement-head { text-align: center; margin-bottom: 1rem; }
.statement-head .co { font-weight: 700; font-size: 1.1rem; }
.statement-head .ttl { font-weight: 800; font-size: 1.25rem; color: var(--green-deep); }

/* ---- dashboard ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: .85rem 1rem; min-width: 0; }
.kpi .label { color: var(--ink-soft); font-size: .85rem; }
.kpi .value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.kpi .value.neg { color: var(--red); }
.kpi .delta { font-size: .8rem; color: var(--ink-soft); }
.kpi .delta.up { color: var(--pos-dark); }
.kpi .delta.down { color: var(--red); }
.kpi.warn { border-color: #EBD3A0; background: var(--amber-bg); }
.chart-wrap { overflow-x: auto; }
.chart svg { width: 100%; height: auto; display: block; min-width: 640px; }
.kpi .delta .num { unicode-bidi: isolate; }
.chart .bar-a { fill: var(--green); }
.chart .bar-b { fill: #2BB394; }
.chart .axis { stroke: var(--rule); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { font-size: 11px; fill: var(--ink-soft); font-family: var(--font); }
.chart-legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--ink-soft); margin-top: .35rem; }
.chart-legend .sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: middle; margin-inline-end: .3rem; }
.chart-legend .sw.a { background: var(--green); }
.chart-legend .sw.b { background: #2BB394; }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.stmt th.amt, table.stmt td.amt { width: auto; }
  table.stmt td, table.stmt th { padding: .35rem .45rem; }
  table.stmt .d0 { padding-inline-start: .5rem; }
  table.stmt .d1 { padding-inline-start: 1rem; }
  table.stmt .d2, table.stmt .d3, table.stmt .d4 { padding-inline-start: 1.5rem; }
}
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--green); }
a.kpi:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
table.vat td.amt, table.vat th.amt { width: 9.5rem; }
table.vat th.box { width: 2.5rem; text-align: center; }
table.stmt td.amt, table.stmt th.amt { font-family: inherit; font-size: inherit; }
pre { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: .6rem .8rem; overflow-x: auto; white-space: pre; max-width: 100%; }
code { font-size: .88em; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  table.vat td.amt, table.vat th.amt { width: auto; }
  table.vat td:nth-child(2) { min-width: 9rem; }
}

/* ==========================================================================
   v1.8 refinements — dashboard tiles, statements, mobile shell
   ========================================================================== */
.kpi { border-radius: var(--radius-lg); padding: .95rem 1.1rem; border-inline-start: 4px solid var(--tint-strong); transition: border-color .15s ease, background-color .15s ease; }
.kpi .value { font-weight: 800; color: var(--navy); margin: .1rem 0; }
a.kpi:hover { border-color: var(--rule); border-inline-start-color: var(--brand); background: #FBFCFF; }
.kpi.warn { border-inline-start-color: #D79A1E; }
a.kpi.warn:hover { background: #FFF0CC; border-inline-start-color: #C88A12; }
.chart .bar-a { fill: var(--brand); }
.chart-legend .sw.a { background: var(--brand); }
table.stmt th { background: var(--navy); }
table.stmt tr.sec td { background: var(--tint-strong); color: var(--navy); }
table.stmt tr.sec2 td { color: var(--brand-dark); }
table.stmt tr.result td, table.stmt tr.final td { background: var(--tint); }
table.vat td.box { color: var(--brand-dark); }
.status-board { border-radius: var(--radius-lg); }
.sb-item.active { border-top-color: var(--brand); background: var(--tint); }
.doc-preview { border-radius: var(--radius-lg); }
.steps > li::before { background: var(--tint-strong); color: var(--brand-dark); }
.mode-tab { background: #F6F8FC; }
details summary { color: var(--brand); font-weight: 600; }
pre { background: #F6F8FC; }
.btn .ico { width: 16px; height: 16px; }
.menu-btn .ico { width: 18px; height: 18px; }
.topbar-date .ico { width: 16px; height: 16px; color: #8A9AB0; }
@media (max-width: 820px) {
  .sidebar { box-shadow: -12px 0 32px rgba(10,34,64,.35); }
  .topbar { gap: .5rem; }
  .who { gap: .5rem; }
  .who .btn { padding-inline: .6rem; }
  .content > .filters { padding: .7rem; }
}
@media (max-width: 520px) {
  .who form .btn { font-size: .8rem; }
  h1 { font-size: 1.35rem; }
}
@media (max-width: 820px) {
  .table-wrap > table.ledger { min-width: 620px; }
  .kpi .value { font-size: 1.15rem; }
}
table.ledger td .ltr, table.ledger td a.ltr { white-space: nowrap; }
.guest > .guest-box > .muted, .guest > .guest-box > p.muted { color: #9DB3D1; }
.guest > .guest-box > p a { color: #CFE0F5; }

/* ==========================================================================
   v1.9 dashboard — navy headline tiles, stat cards with sparklines, donuts, trend cards
   ========================================================================== */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-head h1 { margin: 0; }
.dash-hello { margin: .2rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.dash-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* headline tiles: icon medallion sits on the top edge */
.hero-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin: 2.4rem 0 1.25rem; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; min-width: 0;
  padding: 2.5rem 1rem 1.1rem; border-radius: var(--radius-lg); color: #fff; text-decoration: none;
  background: linear-gradient(165deg, #173E72 0%, var(--navy) 70%);
  box-shadow: 0 14px 26px -18px rgba(10, 34, 64, .75); border-bottom: 3px solid #1C5BA8;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.hero:hover { transform: translateY(-2px); border-bottom-color: #5FD3B5; box-shadow: 0 18px 30px -18px rgba(10, 34, 64, .85); text-decoration: none; color: #fff; }
.hero:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hero .orb { position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); border: 4px solid var(--paper); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22); }
.hero .orb .ico { width: 26px; height: 26px; color: #fff; stroke-width: 1.7; }
.hero .label { color: #B9CCE6; font-size: .88rem; font-weight: 600; }
.hero .value { font-size: 1.55rem; font-weight: 800; direction: ltr; font-variant-numeric: tabular-nums; letter-spacing: .01em; overflow-wrap: anywhere; }
.hero .delta { color: #9FB3CF; font-size: .76rem; line-height: 1.4; }
.hero .delta.up { color: #6FE0C2; }
.hero .delta.down { color: #FFA3A3; }
.hero .delta .num { unicode-bidi: isolate; }
.hero.warn { border-bottom-color: #E0A93A; }
.hero.warn .orb { background: #7A4B06; }

/* layout rows */
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; margin-bottom: 1.25rem; align-items: start; }
.dash-row.single { grid-template-columns: minmax(0, 1fr); }
.dash-row > .panel { margin-bottom: 0; }

/* stat cards */
.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .75rem; }
.mini { display: flex; flex-direction: column; gap: .45rem; min-width: 0; padding: .8rem .95rem .85rem;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-lg); color: inherit; text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease; }
a.mini:hover { border-color: #B7CBE6; box-shadow: 0 8px 18px -14px rgba(10, 34, 64, .5); text-decoration: none; color: inherit; }
a.mini:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mini .m-label { font-size: .84rem; font-weight: 600; color: var(--ink-soft); padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.mini .m-body { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; }
.mini .m-text { display: flex; flex-direction: column; min-width: 0; }
.mini .m-value { font-size: 1.3rem; font-weight: 800; color: var(--navy); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.mini .m-sub { font-size: .76rem; color: var(--ink-soft); line-height: 1.4; }
.mini .m-ico { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--brand); }
.mini .m-ico .ico { width: 21px; height: 21px; }
.mini.warn { background: #FFFBF1; border-color: #EBD3A0; }
.mini.warn .m-label { border-bottom-color: #F1E2BF; }
.mini.warn .m-ico { background: var(--amber-bg); color: #A86F0C; }
.mini.warn .m-value { color: #7A4B06; }

/* sparklines */
svg.spark { flex: none; width: 104px; height: 42px; overflow: visible; }
.spark .sp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .sp-area { stroke: none; opacity: .16; }
.spark.tone-brand .sp-line, .spark.tone-brand .sp-dot { stroke: var(--brand); fill: var(--brand); }
.spark.tone-brand .sp-area { fill: var(--brand); }
.spark.tone-slate .sp-line, .spark.tone-slate .sp-dot { stroke: #5B7190; fill: #5B7190; }
.spark.tone-slate .sp-area { fill: #5B7190; }
.spark.tone-pos .sp-line, .spark.tone-pos .sp-dot { stroke: var(--pos); fill: var(--pos); }
.spark.tone-pos .sp-area { fill: var(--pos); }
.spark.tone-red .sp-line, .spark.tone-red .sp-dot { stroke: var(--red); fill: var(--red); }
.spark.tone-red .sp-area { fill: var(--red); }
.spark .sp-line { fill: none !important; }

/* donut panels */
.donut-panel { padding: 1rem 1.1rem; }
.dp-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.dp-head h2 { margin: 0; font-size: 1rem; }
.dp-head.pad { padding: .9rem 1.1rem .2rem; margin: 0; }
.dp-body { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
svg.donut { width: 190px; height: 190px; display: block; }
.donut .dn-track { stroke: var(--line); }
.donut .dn-seg { transition: stroke-width .15s ease; }
.donut .dn-seg:hover { stroke-width: 6.4; }
.donut .dn-cap { font-size: 2.7px; fill: var(--ink-soft); font-family: var(--font); }
.donut .dn-val { font-size: 4.4px; font-weight: 800; fill: var(--navy); font-family: var(--font); }
.dn-legend { list-style: none; margin: 0; padding: 0; width: 100%; font-size: .84rem; }
.dn-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 2.8rem; align-items: center; gap: .5rem; padding: .32rem 0; border-top: 1px solid var(--line); }
.dn-legend li:first-child { border-top: 0; }
.dn-legend .sw { width: .7rem; height: .7rem; border-radius: 3px; }
.dn-legend .dl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-legend .dl-val { color: var(--navy); font-weight: 600; direction: ltr; }
.dn-legend .dl-pct { color: var(--ink-soft); text-align: left; direction: ltr; }
.dp-empty { text-align: center; color: var(--ink-soft); padding: 1.5rem .5rem; }
.dp-empty .ico { width: 40px; height: 40px; color: #B7CBE6; }
.dp-empty p { margin: .4rem 0 0; }
/* aging palette: current → oldest (teal → blues → red) */
.ag0 { stroke: #0E8A6E; } .sw.ag0 { background: #0E8A6E; }
.ag1 { stroke: #7FA9DD; } .sw.ag1 { background: #7FA9DD; }
.ag2 { stroke: #3F7FCB; } .sw.ag2 { background: #3F7FCB; }
.ag3 { stroke: #1C4E8F; } .sw.ag3 { background: #1C4E8F; }
.ag4 { stroke: #B4232F; } .sw.ag4 { background: #B4232F; }
/* expense mix palette: blue ramp */
.mx0 { stroke: #0A2240; } .sw.mx0 { background: #0A2240; }
.mx1 { stroke: #1C5BA8; } .sw.mx1 { background: #1C5BA8; }
.mx2 { stroke: #3F7FCB; } .sw.mx2 { background: #3F7FCB; }
.mx3 { stroke: #7FA9DD; } .sw.mx3 { background: #7FA9DD; }
.mx4 { stroke: #2BB394; } .sw.mx4 { background: #2BB394; }
.mx5 { stroke: #B7C4D6; } .sw.mx5 { background: #B7C4D6; }

/* trend cards */
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.trend { min-width: 0; border-radius: var(--radius-lg); color: #fff; padding: 1rem 1.1rem .55rem;
  background: linear-gradient(160deg, #173E72 0%, var(--navy) 75%); box-shadow: 0 14px 26px -18px rgba(10, 34, 64, .75); }
.tr-name { color: #B9CCE6; font-size: .88rem; font-weight: 600; }
.tr-name a { color: inherit; }
.tr-name a:hover { color: #fff; }
.tr-value { font-size: 1.45rem; font-weight: 800; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.tr-value.neg { color: #FFA3A3; }
.tr-sub { color: #9FB3CF; font-size: .76rem; }
.tr-sub .num { unicode-bidi: isolate; color: #DCE7F5; }
svg.trend-svg { width: 100%; height: auto; display: block; margin-top: .35rem; direction: ltr; }
.trend-svg .tr-base { stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.trend-svg .tr-line { fill: none; stroke: #6FE0C2; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trend-svg .tr-dot { fill: var(--navy); stroke: #6FE0C2; stroke-width: 1.4; }
.trend-svg .tr-dot.last { fill: #6FE0C2; stroke: #fff; stroke-width: 1.6; }
.trend-svg .tr-dot:hover { fill: #fff; }
.trend-svg .tr-lbl { font-size: 10px; fill: #8DA3C2; font-family: var(--font); }

.recent-panel .table-wrap { border-top: 1px solid var(--line); margin-top: .6rem; }

@media (max-width: 1100px) {
  .dash-row { grid-template-columns: minmax(0, 1fr); }
  .dp-body { flex-direction: row; align-items: center; }
  svg.donut { width: 170px; height: 170px; flex: none; }
}
@media (max-width: 640px) {
  .hero-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem .7rem; }
  .hero { padding: 2.2rem .6rem .9rem; }
  .hero:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hero .value { font-size: 1.15rem; }
  .hero .delta { font-size: .7rem; }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .mini { padding: .7rem .75rem; }
  .mini .m-label { font-size: .78rem; }
  .mini .m-value { font-size: 1.05rem; }
  .mini .m-body { flex-direction: column-reverse; align-items: stretch; gap: .35rem; }
  .mini .m-ico { width: 32px; height: 32px; }
  .mini .m-ico .ico { width: 17px; height: 17px; }
  svg.spark { width: 100%; height: 34px; }
  .dp-body { flex-direction: column; }
  .dash-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .hero, .mini, .donut .dn-seg { transition: none; } .hero:hover { transform: none; } }

/* v2.0 — country selection */
[hidden] { display: none !important; }
.country-note { margin-top: 1.55rem; padding: .55rem .75rem; border-radius: var(--radius); background: var(--tint); color: var(--navy); font-size: .85rem; line-height: 1.6; }
.static-value { padding: .5rem .7rem; border: 1px dashed var(--rule); border-radius: var(--radius); background: var(--paper); min-height: 2.4rem; }

/* v2.1 — language switch */
.lang-switch { font-weight: 700; }
.guest-lang { text-align: center; margin: 1rem 0 0; }
.guest-lang a { color: #B9CCE6; font-weight: 600; }
.guest-lang a:hover { color: #fff; }


/* ==========================================================================
   v2.1 — left-to-right interface (English): mirrors the direction-dependent rules above
   ========================================================================== */
html[dir="ltr"] .num, html[dir="ltr"] td.num, html[dir="ltr"] th.num { text-align: right; }
html[dir="ltr"] .figure .value { text-align: left; }
html[dir="ltr"] table.ledger th { text-align: left; }
html[dir="ltr"] table.ledger td.actions { text-align: right; }
html[dir="ltr"] .sheet th { text-align: left; }
html[dir="ltr"] .sheet td.amount input { text-align: right; }
html[dir="ltr"] .balance-strip .tot { text-align: right; }
html[dir="ltr"] .balance-strip .tot small { direction: ltr; text-align: left; }
html[dir="ltr"] .matrix th:first-child, html[dir="ltr"] .matrix td:first-child { text-align: left; }
html[dir="ltr"] .matrix .module-row td { text-align: left; }
html[dir="ltr"] .amount-input { text-align: right; }
html[dir="ltr"] .breakdown { direction: ltr; text-align: right; }
html[dir="ltr"] .sales-totals dd { text-align: right; }
html[dir="ltr"] .sb-total { text-align: left; }
html[dir="ltr"] table.stmt th { text-align: left; }
html[dir="ltr"] table.stmt th.amt, html[dir="ltr"] table.stmt td.amt { text-align: right; }
html[dir="ltr"] .kpi .value { text-align: left; }
html[dir="ltr"] .mini .m-value { text-align: left; }
html[dir="ltr"] .dn-legend .dl-pct { text-align: right; }
html[dir="ltr"] .tr-value { text-align: left; }
@media (max-width: 820px) {
  html[dir="ltr"] .sidebar { inset: 0 auto 0 0; transform: translateX(-100%); }
}
.mini .m-text { flex: 1 1 auto; }
.mini .m-value { white-space: nowrap; overflow-wrap: normal; }
svg.spark { flex: 0 1 104px; min-width: 56px; }
