/* Inovizec admin panel, styled from the Inovizec Brand System.
   Every colour, size and font comes from tokens.css; logical properties keep RTL working. */

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--surface-page); color: var(--ink);
  font: 400 14px/22px var(--font-text);
  -webkit-font-smoothing: antialiased;
}
[lang="ar"], .ar { font-family: var(--font-arabic); font-size: 15px; line-height: 26px; direction: rtl; text-align: right; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font: 600 28px/36px var(--font-display); }
h2 { font: 600 20px/28px var(--font-text); }
h3 { font: 600 16px/24px var(--font-text); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.num { font-family: var(--font-figures); font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.mono { font: 500 13px/20px var(--font-figures); word-break: break-all; }
.muted { color: var(--ink-muted); }
.small { font-size: 12px; line-height: 18px; }
.nowrap { white-space: nowrap; word-break: normal; }

/* Shell: navy side menu, top bar, page band ------------------------------------------------- */
:root { --side-w: 256px; --side-bg: #0B1F3A; --side-bg-2: #102A4C; --side-ink: rgba(234, 242, 251, 0.78); --side-ink-strong: #FFFFFF; --side-line: rgba(234, 242, 251, 0.10); --band-bg: #0B1F3A; --band-ink: #FFFFFF; --band-muted: rgba(234, 242, 251, 0.74); --topbar-h: 60px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --side-bg: #08162A; --side-bg-2: #0E2240; --band-bg: #14253A; } }
:root[data-theme="dark"] { --side-bg: #08162A; --side-bg-2: #0E2240; --band-bg: #14253A; }
.icon { flex: none; display: block; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.shell.menu-closed { grid-template-columns: 0 minmax(0, 1fr); }
.shell.menu-closed .side { visibility: hidden; }
.side {
  background: var(--side-bg); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-3) var(--space-6); scrollbar-width: thin; scrollbar-color: rgba(234,242,251,.2) transparent;
}
.brand { display: flex; align-items: center; justify-content: space-between; padding: var(--space-1) var(--space-2) 0; }
.brand img { display: block; width: 138px; height: auto; }
.side-close { display: none; border: 0; background: none; color: var(--side-ink); padding: 6px; border-radius: var(--radius-xs); cursor: pointer; }
.quick { position: relative; }
.quick-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; border: 0; border-radius: var(--radius-sm); background: #FFFFFF; color: #0B1F3A; font: 600 14px/20px var(--font-text); cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.quick-btn:hover { background: #E3EEFD; }
.quick .menu { inset-inline: 0; top: calc(100% + 6px); }
.menu { position: absolute; z-index: 40; min-width: 220px; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: var(--space-1); display: grid; }
.menu.right { inset-inline-end: 0; top: calc(100% + 8px); min-width: 260px; }
.menu a, .menu button { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 0; background: none; border-radius: var(--radius-xs); color: var(--ink); font: 500 14px/20px var(--font-text); text-align: start; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.menu .danger { color: var(--status-void); }
.menu-head { padding: var(--space-2) var(--space-3) var(--space-3); display: grid; border-bottom: 1px solid var(--line); margin-bottom: var(--space-1); }
.menu-sep { margin-top: var(--space-1); padding: var(--space-2) var(--space-3) var(--space-1); border-top: 1px solid var(--line); font: 600 11px/16px var(--font-text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.seg { display: flex; gap: 2px; padding: 0 var(--space-2) var(--space-2); }
.seg button { flex: 1; justify-content: center; padding: 6px 8px; font-size: 12px; border: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.setup-box { position: relative; border-radius: var(--radius-sm); background: linear-gradient(135deg, #123A6B 0%, #0E2A52 55%, #0B1F3A 100%); border: 1px solid rgba(14, 221, 252, 0.30); }
.setup-box a { display: grid; gap: 6px; padding: var(--space-3); color: #FFFFFF; text-decoration: none; }
.setup-box a:hover { text-decoration: none; color: #FFFFFF; background: rgba(255,255,255,.04); border-radius: var(--radius-sm); }
.sb-title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #FFFFFF; }
.sb-title .icon { color: var(--brand-cyan); }
.sb-sub { font-size: 12px; line-height: 16px; color: rgba(234,242,251,.75); }
.sb-hide { position: absolute; top: 6px; inset-inline-end: 6px; border: 0; background: none; color: rgba(234,242,251,.6); padding: 4px; border-radius: var(--radius-xs); cursor: pointer; }
.sb-hide:hover { color: #FFFFFF; background: rgba(255,255,255,.08); }
.progress { display: block; height: 6px; border-radius: var(--radius-pill); background: rgba(127, 150, 180, 0.28); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-cyan), var(--brand-azure)); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-top { width: 100%; display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; color: var(--side-ink); font: 500 14px/20px var(--font-text); cursor: pointer; text-align: start; text-decoration: none; }
.nav-top span { flex: 1; }
.nav-top:hover { background: rgba(255,255,255,.06); color: var(--side-ink-strong); text-decoration: none; }
.nav-top.on { background: rgba(50, 144, 251, 0.22); color: var(--side-ink-strong); box-shadow: inset 3px 0 0 var(--brand-cyan); }
.nav-top .chev { transition: transform 150ms ease-out; opacity: .7; }
.nav-group.open > .nav-top { color: var(--side-ink-strong); }
.nav-group.open > .nav-top .chev { transform: rotate(180deg); }
.nav-items { margin: 2px 0 6px; padding: var(--space-1) 0; border-radius: var(--radius-sm); background: var(--side-bg-2); display: grid; }
.nav-item { display: flex; align-items: center; border-radius: var(--radius-xs); }
.nav-item > a:first-child { flex: 1; padding: 7px var(--space-3) 7px 44px; color: var(--side-ink); font-size: 13.5px; line-height: 20px; text-decoration: none; border-radius: var(--radius-xs); }
.nav-item > a:first-child:hover { color: var(--side-ink-strong); text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,.05); }
.nav-item.on { background: rgba(50, 144, 251, 0.26); }
.nav-item.on > a:first-child { color: var(--side-ink-strong); font-weight: 600; }
.nav-add { display: grid; place-items: center; width: 28px; height: 28px; margin-inline-end: 6px; border-radius: var(--radius-xs); color: var(--side-ink); opacity: .55; }
.nav-add:hover { opacity: 1; background: rgba(255,255,255,.1); color: #FFFFFF; }
.nav-item:hover .nav-add, .nav-item.on .nav-add { opacity: 1; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; height: var(--topbar-h); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-5); background: var(--surface-card); border-bottom: 1px solid var(--line); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-card); color: var(--ink); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--ink); text-decoration: none; }
.biz { display: grid; line-height: 18px; padding-inline: var(--space-2); border-inline-end: 1px solid var(--line); padding-inline-end: var(--space-4); min-width: 0; }
.biz b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.biz span { font: 500 12px/16px var(--font-figures); color: var(--accent); }
.search-btn { flex: 1; max-width: 460px; display: flex; align-items: center; gap: var(--space-2); height: 38px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); font: 400 14px/20px var(--font-text); cursor: pointer; text-align: start; }
.search-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-btn:hover { border-color: var(--line-strong); }
kbd { font: 500 11px/16px var(--font-figures); padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface-card); color: var(--ink-muted); white-space: nowrap; }
.top-right { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-3); }
.welcome { color: var(--ink-muted); white-space: nowrap; }
.welcome b { color: var(--ink); }
.usermenu { position: relative; }
.user-btn { display: flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-2) 0 4px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-card); color: var(--ink); cursor: pointer; font: 500 14px/20px var(--font-text); }
.user-btn:hover { background: var(--surface-sunken); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-sky), var(--brand-azure)); color: #FFFFFF; font: 600 12px/1 var(--font-text); }
.user-name { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-scrim { display: none; }

.main { padding: var(--space-5) var(--space-6) var(--space-8); max-width: 1320px; width: 100%; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); min-height: 40px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.crumbs a { color: var(--ink-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }
.crumbs .sep { opacity: .5; }
.band { position: relative; background: var(--band-bg); color: var(--band-ink); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); overflow: hidden; box-shadow: var(--shadow-card); }
.band::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand-cyan), var(--brand-sky) 45%, var(--brand-azure)); }
.band h1 { font: 600 24px/32px var(--font-display); color: var(--band-ink); }
.band p { margin-top: 2px; color: var(--band-muted); max-width: 80ch; font-size: 13.5px; line-height: 20px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.head p { color: var(--ink-muted); margin-top: var(--space-1); max-width: 64ch; }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* Search palette */
.palette-back { padding-top: 10vh; }
.palette { width: 100%; max-width: 640px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--line); color: var(--ink-muted); }
.palette-input input { flex: 1; border: 0; outline: 0; background: none; min-height: 54px; padding: 0; font-size: 15px; color: var(--ink); }
.palette-input input:focus { outline: 0; }
.palette-list { list-style: none; margin: 0; padding: var(--space-2); max-height: 60vh; overflow-y: auto; }
.palette-list li[role="option"] { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); }
.palette-list li.sel { background: var(--accent-soft); }
.palette-list li .icon { color: var(--ink-muted); }
.pl-label { font-weight: 500; white-space: nowrap; }
.pl-sub { color: var(--ink-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.pl-enter { margin-inline-start: auto; }
.palette-kind { padding: var(--space-2) var(--space-3) 2px; font: 600 11px/16px var(--font-text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.palette-none { padding: var(--space-5); text-align: center; color: var(--ink-muted); }

/* Setup steps */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps li > div { display: grid; }
.steps .mark { color: var(--line-strong); }
.steps li.done .mark { color: var(--status-paid); }
.steps li.done b { color: var(--ink-muted); }

/* Empty states */
.empty.rich { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-7) var(--space-5); }
.empty.rich h3 { color: var(--ink); }
.empty.rich p { max-width: 52ch; }
.empty.rich .btn { margin-top: var(--space-2); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-sunken); color: var(--accent); margin-bottom: var(--space-1); }

/* Buttons (fw-btn) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding-inline: var(--space-4); border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-card); color: var(--ink);
  font: 600 14px/20px var(--font-text); cursor: pointer; white-space: nowrap;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
a.btn { color: var(--ink); }
.btn:hover { background: var(--surface-sunken); text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.danger { color: var(--status-void); border-color: var(--status-void); }
.btn.danger:hover { background: var(--status-void-bg); color: var(--status-void); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 32px; padding-inline: var(--space-3); font-size: 13px; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.link:hover { color: var(--accent-hover); text-decoration: underline; }
.link.danger { color: var(--status-void); }

/* Cards and tables (fw-card, fw-table) */
.panel { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }
.panel + .panel, .panel + .grid, .grid + .panel { margin-top: var(--space-5); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.panel-body { padding: var(--space-5); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--surface-sunken); color: var(--ink-muted); text-align: start;
  font: 600 12px/16px var(--font-text); letter-spacing: .04em; text-transform: uppercase;
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); white-space: nowrap;
}
th:first-child, td:first-child { padding-inline-start: var(--space-5); }
th:last-child, td:last-child { padding-inline-end: var(--space-5); }
td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { font-size: 13px; }
tr:last-child td { border-bottom: 0; }
th.num { text-align: end; font-family: var(--font-text); }
.num a, .num button, .num .link { font-family: var(--font-text); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td, tbody tr:hover td { background: var(--accent-soft); }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--surface-sunken); }
.empty { padding: var(--space-7) var(--space-5); text-align: center; color: var(--ink-muted); }
.empty .btn { margin-top: var(--space-4); }

/* Status badges (fw-badge) */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2) 2px 6px;
  border-radius: var(--radius-pill); font: 600 12px/18px var(--font-text); white-space: nowrap;
  color: var(--status-draft); background: var(--status-draft-bg);
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.draft { color: var(--status-draft); background: var(--status-draft-bg); }
.chip.issued { color: var(--status-issued); background: var(--status-issued-bg); }
.chip.paid { color: var(--status-paid); background: var(--status-paid-bg); }
.chip.overdue { color: var(--status-overdue); background: var(--status-overdue-bg); }
.chip.void { color: var(--status-void); background: var(--status-void-bg); }

/* Forms (fw-field) */
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }
label.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
label.field > span:first-child { font: 600 12px/16px var(--font-text); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
label.field > span:first-child:lang(ar), label.field > span.ar-label { letter-spacing: 0; text-transform: none; font-family: var(--font-arabic); font-size: 13px; }
label.field .hint { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-card); color: var(--ink); font: 400 14px/22px var(--font-text);
}
textarea { min-height: 72px; padding-block: var(--space-2); resize: vertical; }
input[dir="rtl"], textarea[dir="rtl"] { font-family: var(--font-arabic); font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--focus-ring); }
input.num { text-align: end; font-family: var(--font-figures); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); border-radius: var(--radius-xs); }
input[type="color"] { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-card); }
.check { display: flex; gap: var(--space-2); align-items: center; font-size: 14px; color: var(--ink); font-weight: 400; letter-spacing: 0; text-transform: none; }
.form-foot { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); }
.filters { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.filters input[type="search"] { width: 260px; }
.filters select, .actions select { width: auto; max-width: 100%; }
.tabs { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.tabs button, .tabs a.tab { display: inline-flex; align-items: center; border: 0; background: none; min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill); cursor: pointer; color: var(--ink-muted); font-weight: 500; text-decoration: none; }
.tabs button:hover, .tabs a.tab:hover { background: var(--surface-sunken); color: var(--ink); text-decoration: none; }
.tabs button.on, .tabs a.tab.on { background: var(--accent-soft); color: var(--accent); }
.error { background: var(--status-void-bg); color: var(--status-void); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.note { background: var(--accent-soft); color: var(--ink); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); }
.note.warn { background: var(--status-overdue-bg); color: var(--ink); }
.secret { display: block; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin-top: var(--space-1); user-select: all; font: 500 13px/20px var(--font-figures); word-break: break-all; }
code { font-family: var(--font-figures); font-size: 13px; }

/* Dialogs */
.modal-back { position: fixed; inset: 0; background: rgba(11, 31, 58, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh var(--space-4); overflow-y: auto; z-index: 20; }
.modal { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); width: 100%; max-width: 760px; box-shadow: var(--shadow-pop); }
.modal.narrow { max-width: 480px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.modal-body { padding: var(--space-5); }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-muted); padding: 2px 6px; border-radius: var(--radius-xs); }
.x:hover { background: var(--surface-sunken); color: var(--ink); }

/* Toasts */
.toasts { position: fixed; bottom: var(--space-5); inset-inline-end: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); z-index: 30; }
.toast { background: var(--brand-navy); color: #FFFFFF; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); max-width: 380px; box-shadow: var(--shadow-pop); }
.toast.bad { background: var(--status-void); }

/* Sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--space-4); background: var(--surface-page); }
.login form { width: 100%; max-width: 380px; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.login .lockup { display: block; width: 168px; margin: 0 auto var(--space-2); }
.login .lockup.logo-dark { display: none; }
.login .tagline { text-align: center; color: var(--ink-muted); }
.login .tagline [lang="ar"] { display: block; text-align: center; }
.login .btn { width: 100%; }

/* Document page */
.trail { display: flex; flex-wrap: wrap; align-items: stretch; margin-bottom: var(--space-5); }
.trail a, .trail span.step { display: block; padding: var(--space-2) var(--space-5) var(--space-2) var(--space-4); background: var(--surface-card); border: 1px solid var(--line); border-inline-end: 0; color: var(--ink-muted); font-size: 12px; line-height: 18px; }
.trail > :first-child { border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); }
.trail > :last-child { border-inline-end: 1px solid var(--line); border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.trail span.step.here { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trail b { display: block; font: 500 13px/20px var(--font-figures); color: inherit; }
.trail a b { color: var(--ink); }
.trail a:hover { text-decoration: none; background: var(--accent-soft); }
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.parties { display: grid; grid-template-columns: 1fr 1fr; }
.parties > div { padding: var(--space-5); }
.parties > div + div { border-inline-start: 1px solid var(--line); }
.parties h3.muted { font: 600 12px/16px var(--font-text); letter-spacing: .04em; text-transform: uppercase; }
/* The totals panel carries the mark's leaf corner, the one place it appears in the interface. */
.totals {
  margin: var(--space-3) var(--space-5) var(--space-5); margin-inline-start: auto; width: 340px; max-width: calc(100% - 2 * var(--space-5));
  background: var(--surface-sunken); border-start-start-radius: var(--radius-leaf); border-end-end-radius: var(--radius-leaf);
  padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-2);
}
.totals div { display: flex; justify-content: space-between; gap: var(--space-4); color: var(--ink-muted); }
.totals .num { color: var(--ink); }
.totals .grand { border-top: 1px solid var(--line-strong); padding-top: var(--space-3); margin-top: var(--space-1); align-items: baseline; color: var(--ink); font-weight: 600; }
.totals .grand .num { font: 500 28px/36px var(--font-figures); }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--space-2) var(--space-3); }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd.num { text-align: end; }
.stack { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.stack > .panel { margin-top: 0; }
.lines-edit td { padding: var(--space-2) var(--space-1); vertical-align: top; }
.lines-edit th { padding: var(--space-2) var(--space-1); }
.lines-edit td:first-child, .lines-edit th:first-child { padding-inline-start: var(--space-5); }
.lines-edit tbody tr:hover td { background: transparent; }
details > summary { cursor: pointer; color: var(--ink-muted); font-weight: 500; padding: var(--space-4) var(--space-5); }
.logo-box { width: 170px; height: 76px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: grid; place-items: center; background: #FFFFFF; overflow: hidden; color: #4A5D75; font-size: 12px; padding: var(--space-2); }
.logo-box img { max-width: 100%; max-height: 100%; }

/* Overview figures */
.stat { font: 500 14px/22px var(--font-figures); }

/* Theme switch: show the reversed lockup on dark grounds */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

@media (max-width: 900px) {
  .shell, .shell.menu-closed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 50; transform: translateX(-102%); transition: transform 180ms ease-out; visibility: hidden; }
  .side.open { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .side-close { display: grid; }
  .menu-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(7, 17, 30, 0.5); }
  .topbar { padding: 0 var(--space-3); gap: var(--space-2); }
  .biz { border: 0; padding-inline-end: 0; }
  .biz b { max-width: 40vw; }
  .search-btn { flex: none; width: 38px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd, .welcome, .user-name, .top-right > .icon-btn { display: none; }
  .main { padding: var(--space-4) var(--space-4) var(--space-7); }
  .band { padding: var(--space-4); }
  .band h1 { font-size: 21px; line-height: 28px; }
  .panel-head, .filters, .panel-body, .parties > div { padding-inline: var(--space-4); }
  th:first-child, td:first-child { padding-inline-start: var(--space-4); }
  th:last-child, td:last-child { padding-inline-end: var(--space-4); }
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .parties { grid-template-columns: 1fr; }
  .parties > div + div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .c2, .c3, .c4, .c5, .c6, .c8, .c9 { grid-column: span 12; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Business switcher and helpers (multi-business) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.switcher { display: block; padding: 0 var(--space-2); margin-bottom: var(--space-3); }
.switcher select { width: 100%; font-size: 13px; }
.chip.warn { background: var(--status-overdue-bg); }

/* Sign-up and customer portal */
.login form.signup { max-width: 460px; }
.kinds { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.kinds legend { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--space-2); }
.kind { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); align-items: center; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.kind input { grid-row: span 2; margin: 0; }
.kind span { grid-column: 2; color: var(--ink-muted); font-size: 13px; }
.kind.on { border-color: var(--accent); background: var(--accent-soft); }
.kind-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2); }
.kind:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
tr.on td { background: var(--accent-soft); }
.login .tagline .link { width: auto; }

.link.strong { font-weight: 700; }
.login .card-like { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); }

/* Dashboard ----------------------------------------------------------------------------------- */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.kpi { display: block; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); }
a.kpi:hover { border-color: var(--accent); }
.kpi-label { font-size: 12px; color: var(--ink-muted); font-weight: 600; letter-spacing: .02em; }
.kpi-value { font-family: var(--font-figures); font-size: 24px; font-weight: 600; margin-top: 6px; }
.kpi-unit { font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.kpi-sub { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.kpi-sub.up { color: var(--status-paid); }
.kpi-sub.down { color: var(--status-overdue); }
.kpis + .panel { margin-bottom: var(--space-4); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.dash-grid > .panel, .dash-grid > div > .panel { margin: 0; }
.dash-grid .span2 { grid-column: span 2; }
.dash-grid .span3 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-grid .span2 { grid-column: auto; } }
.viz { position: relative; }
.viz-scroll { overflow-x: auto; }
.viz svg { width: 100%; min-width: 560px; height: auto; display: block; }
.viz .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.viz .baseline { stroke: var(--ink-muted); stroke-width: 1; }
.viz .axis { fill: var(--ink-muted); font-size: 12px; }
.viz .mark.s1 { fill: var(--series-1); }
.viz .mark.s2 { fill: var(--series-2); }
.viz .mark.s3 { fill: var(--series-3); }
.viz .crosshair { stroke: var(--ink-muted); stroke-width: 1; }
.viz-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.viz-legend .link { margin-inline-start: auto; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; }
.sw.s1 { background: var(--series-1); } .sw.s2 { background: var(--series-2); } .sw.s3 { background: var(--series-3); }
.viz-tip { position: absolute; top: 28px; transform: translateX(-50%); background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 170px; }
.ageing { display: grid; gap: 10px; }
.ageing-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 12px; }
.ageing-label { color: var(--ink-muted); }
.ageing-track { grid-column: 1 / -1; height: 10px; background: var(--surface-page); border-radius: 4px; overflow: hidden; }
.ageing-bar { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.ageing-bar.late { background: var(--series-2); }
.ageing-value { text-align: end; white-space: nowrap; font-family: var(--font-figures); }
.attention { list-style: none; margin: 0; padding: 4px 0; }
.attention li a { display: flex; gap: 10px; align-items: center; padding: 8px var(--space-5); color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-soft, var(--line)); }
.attention li:first-child a { border-top: 0; }
.attention li a:hover { background: var(--surface-page); }
.attn-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; flex: none; }
.attn-icon.critical { background: var(--status-void-bg); color: var(--status-void); }
.attn-icon.warning { background: var(--status-overdue-bg); color: var(--status-overdue); }
.attn-icon.info { background: var(--status-issued-bg); color: var(--status-issued); }
.attn-icon.ok { background: var(--status-paid-bg); color: var(--status-paid); }
.attention-ok { display: flex; gap: 10px; align-items: center; }
.bad-text { color: var(--status-void); }
h3.mini { font-size: 12px; font-weight: 600; color: var(--ink-muted); margin: 0 0 6px; letter-spacing: .02em; }

/* --- Sign-up journey ------------------------------------------------------------------------ */
.login .wizard { width: 100%; max-width: 600px; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); scroll-margin-top: var(--space-4); }
.wizard-brand .lockup { display: block; width: 150px; margin: 0 auto; }
.wizard-brand .lockup.logo-dark { display: none; }
.wizard .btn { width: auto; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.stepper::before { content: ''; position: absolute; inset-inline: 8.33%; top: 15px; height: 2px; background: var(--line); }
.stepper li { position: relative; display: flex; justify-content: center; }
.stepper li:not(:first-child)::before { content: ''; position: absolute; inset-inline-end: 50%; width: 100%; top: 15px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.stepper li.done::before, .stepper li.now:not(:first-child)::before { transform: scaleX(1); }
.stepper button { position: relative; background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--ink-muted); font: 500 12px/16px var(--font-text); }
.stepper button:disabled { cursor: default; }
.stepper .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-card); border: 2px solid var(--line-strong); font: 600 13px/1 var(--font-figures); transition: background .25s, border-color .25s, transform .25s; }
.stepper .dot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.stepper li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepper li.now .dot { border-color: var(--accent); color: var(--accent); transform: scale(1.1); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper li.now button, .stepper li.done button { color: var(--ink); }
.stepper .lbl { text-align: center; }
.wizard-count { text-align: center; color: var(--ink-muted); font-size: 13px; margin-top: calc(-1 * var(--space-2)); }
.wizard-count [lang="ar"] { font-family: var(--font-arabic); }
.wizard-step { display: flex; flex-direction: column; gap: var(--space-4); animation: step-in .35s ease both; }
.wizard-step.back { animation-name: step-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes step-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.wizard-step h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.wizard-sub { margin: calc(-1 * var(--space-3)) 0 0; color: var(--ink-muted); }
.wizard .error { margin: 0; }
.wgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-3) var(--space-3); }
.wgrid .full { grid-column: 1 / -1; }
.wgrid .half { grid-column: span 3; }
.wgrid .third { grid-column: span 2; }
.reveal { animation: step-in .3s ease both; }
.field-error { display: block; color: var(--status-void); font-style: normal; font-size: 13px; }
label.field.has-error input, label.field.has-error select { border-color: var(--status-void); }
.check.has-error { color: var(--status-void); }
.wizard .check { align-items: flex-start; line-height: 1.45; }
.wizard .check input { margin-top: 3px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.choice-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--space-4); border: 1.5px solid var(--line); border-radius: var(--radius-md); cursor: pointer; transition: border-color .2s, background .2s, transform .15s, box-shadow .2s; }
.choice-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.choice-card.on { border-color: var(--accent); background: var(--accent-soft); }
.choice-card.on::after { content: ''; position: absolute; top: 12px; inset-inline-end: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.2); } to { transform: scale(1); } }
.choice-card.compact { align-items: center; text-align: center; padding: var(--space-4) var(--space-3); }
.choice-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface-sunken); display: grid; place-items: center; color: var(--accent); margin-bottom: var(--space-2); }
.choice-card.on .choice-icon { background: var(--surface-card); }
.choice-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ar-sub { font-family: var(--font-arabic); color: var(--ink-muted); }
.trial-note { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--status-paid-bg); color: var(--ink); font-size: 13px; }
.with-tick { position: relative; display: flex; }
.with-tick input { flex: 1; padding-inline-end: 40px; }
.with-tick .tick { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); color: var(--status-paid); display: grid; animation: pop .25s ease; }
.tick svg, .pw-toggle svg, .filedrop-icon svg, .celebrate-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; color: var(--ink-muted); cursor: pointer; display: grid; }
.pw-toggle[aria-pressed="true"] { color: var(--accent); }
.pw-meter { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.pw-meter i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .25s; }
.pw-meter span { font-size: 12px; color: var(--ink-muted); min-width: 72px; text-align: end; }
.pw-meter.s1 i:nth-child(-n+1) { background: var(--status-void); }
.pw-meter.s2 i:nth-child(-n+2) { background: var(--status-overdue); }
.pw-meter.s3 i:nth-child(-n+3) { background: var(--status-issued); }
.pw-meter.s4 i:nth-child(-n+4) { background: var(--status-paid); }
.filedrop { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-sunken); transition: border-color .2s, background .2s; flex-wrap: wrap; }
.filedrop.over { border-color: var(--accent); background: var(--accent-soft); }
.filedrop.has-file { border-style: solid; border-color: var(--status-paid); background: var(--status-paid-bg); }
.filedrop.has-error { border-color: var(--status-void); }
.filedrop-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-card); color: var(--accent); }
.filedrop.has-file .filedrop-icon { color: var(--status-paid); animation: pop .3s ease; }
.filedrop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.filedrop-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filedrop-text span { font-size: 13px; color: var(--ink-muted); }
.filedrop label.link { cursor: pointer; color: var(--accent); text-decoration: underline; }
.filedrop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filedrop .field-error { flex-basis: 100%; }
.wizard-nav { display: flex; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.wizard-nav .btn.primary { min-width: 140px; }
.rv { display: grid; gap: var(--space-3); }
.rv-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.rv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rv-head h3 { margin: 0; font-size: 14px; }
.rv-row { display: grid; grid-template-columns: 130px 1fr; gap: var(--space-3); font-size: 13px; padding: 2px 0; }
.rv-row span { color: var(--ink-muted); }
.rv-row b { font-weight: 500; overflow-wrap: anywhere; }
.wizard.done { text-align: center; max-width: 520px; }
.celebrate { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); animation: step-in .4s ease both; }
.celebrate h1 { margin: 0; font-size: 26px; }
.celebrate p { margin: 0; }
.celebrate-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; animation: pop .5s ease; }
.celebrate-icon svg { width: 32px; height: 32px; stroke-width: 1.8; }
.next-steps { text-align: start; margin: 0; padding-inline-start: 22px; display: grid; gap: var(--space-2); }
.btn.big { padding: 12px 20px; font-size: 15px; }
.wizard.done .btn.big { width: 100%; }
.legal h1 { margin: 0; }
.legal-points { margin: 0; padding-inline-start: 20px; display: grid; gap: var(--space-2); }
@media (max-width: 640px) {
  .login .wizard { padding: var(--space-5) var(--space-4); }
  .stepper .lbl { display: none; }
  .stepper .dot { width: 28px; height: 28px; }
  .stepper::before, .stepper li:not(:first-child)::before { top: 13px; }
  .choice-cards { grid-template-columns: 1fr; }
  .choice-cards.two { grid-template-columns: 1fr 1fr; }
  .wgrid .half, .wgrid .third { grid-column: 1 / -1; }
  .wgrid .third { grid-column: span 2; }
  .rv-row { grid-template-columns: 1fr; gap: 0; }
}

/* Bilingual field labels in the sign-up journey: English at the start, Arabic at the end. */
.wizard label.field > .bi-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--space-2); }
.wizard .bi-label .ar { font-family: var(--font-arabic); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-muted); white-space: nowrap; }
.filedrop-text b.ar { font-family: var(--font-arabic); font-weight: 600; font-size: 14px; text-align: start; }
.wizard .ar-line { display: block; font-family: var(--font-arabic); text-align: right; color: var(--ink-muted); margin-top: 2px; }

/* Cost centres */
.cc-table .share-col { width: 18%; min-width: 90px; }
.share-bar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); }
.lines-edit .line-cc { margin-top: 4px; width: 100%; font-size: 12px; color: var(--ink-muted); }
.panel-head .check.small { font-weight: 400; font-size: 13px; margin: 0; }

/* Purchases ---------------------------------------------------------------------------------- */
.tabs-bar { display: flex; gap: var(--space-1); padding: 0 var(--space-5); border-bottom: 1px solid var(--line); overflow-x: auto; }
.utab { display: inline-flex; align-items: center; min-height: 46px; padding: 0 var(--space-3); color: var(--ink-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.utab:hover { color: var(--ink); text-decoration: none; }
.utab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.date-range { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); }
.date-range input[type="date"] { width: auto; min-width: 140px; }
.btn.ghost-danger { color: var(--status-void); border-color: var(--status-void); background: transparent; }
.btn.ghost-danger:hover { background: var(--status-void-bg); color: var(--status-void); }
.icon.inline { display: inline-block; vertical-align: -2px; }
.btn .icon { margin-inline-start: -2px; }
.status-row { display: flex; align-items: center; gap: var(--space-2); margin: -8px 0 var(--space-4); }
.kpis-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi-value small { font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.share-bar.neg { background: var(--series-2); }
.purchase-lines select, .purchase-lines input { min-height: 36px; }
.purchase-lines .line-total { padding-top: 14px; font-weight: 600; }
.purchase-lines input:disabled { background: var(--surface-sunken); color: var(--ink-muted); }
.drop { position: relative; display: flex; align-items: center; gap: var(--space-2); min-height: 72px; padding: var(--space-3) var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); cursor: pointer; font-weight: 400; letter-spacing: 0; text-transform: none; }
.drop:hover { border-color: var(--accent); color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { font-size: 14px; }
@media (max-width: 900px) { .tabs-bar { padding: 0 var(--space-3); } .date-range input[type="date"] { min-width: 0; } }
.vat-net { margin: var(--space-4) var(--space-5); margin-inline-start: auto; width: 380px; max-width: calc(100% - 2 * var(--space-5)); display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5); background: var(--surface-sunken); border-start-start-radius: var(--radius-leaf); border-end-end-radius: var(--radius-leaf); }
.vat-net div { display: flex; justify-content: space-between; gap: var(--space-4); color: var(--ink-muted); }
.vat-net .num { color: var(--ink); }
.vat-net .grand { border-top: 1px solid var(--line-strong); padding-top: var(--space-3); color: var(--ink); font-weight: 600; align-items: baseline; }
.vat-net .grand .num { font: 500 24px/32px var(--font-figures); }
.vat-net small { font-size: 12px; color: var(--ink-muted); }
.profit-table .share-col { width: 9%; min-width: 64px; }
.profit-table th { white-space: normal; }
.profit-table td:first-child { min-width: 150px; }
.parties.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .parties.three { grid-template-columns: 1fr 1fr; } .parties.three > div:last-child { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line); } }
@media (max-width: 900px) { .parties.three { grid-template-columns: 1fr; } }
.parties .kv { grid-template-columns: 110px minmax(0, 1fr); font-size: 13.5px; }
.purchase-lines { min-width: 780px; }

/* Site notice (the test site): a fixed label in the corner of every page. */
.site-notice { position: fixed; inset-block-end: var(--space-4); inset-inline-start: var(--space-4); z-index: 60; display: flex; align-items: center; gap: var(--space-2); max-width: min(420px, calc(100vw - 32px)); padding: 6px 12px 6px 6px; border-radius: var(--radius-pill); background: #FFF4E0; color: #5A3A00; border: 1px solid #F0B44C; box-shadow: var(--shadow-pop); font: 500 12.5px/1.3 var(--font-text); pointer-events: none; }
.site-notice b { background: #B86E00; color: #FFFFFF; border-radius: var(--radius-pill); padding: 3px 9px; letter-spacing: 0.04em; font-weight: 700; flex: none; }
@media (max-width: 560px) { .site-notice span { display: none; } }

/* Overview: the figures in even rows of three (sales above purchases, like above like), and the
   panels one above another, full width. */
.kpi-caption { font: 600 12px/1.2 var(--font-text); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); margin: 0 0 var(--space-2); }
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.kpi-row .kpi { height: 100%; }
@media (max-width: 760px) { .kpi-row { grid-template-columns: minmax(0, 1fr); } }
.dash-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.dash-stack > .panel, .dash-stack > div > .panel { margin: 0; }
.kpi-row + .panel { margin-bottom: var(--space-4); }
