/* Zakaria dashboard.
   Look: security paper and cheque ink. The engraved rosette and the aging ribbon are the only decorative
   elements; everything else stays quiet so the numbers carry the page. */
@font-face { font-family: "Lora"; src: url("/fonts/lora.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --paper: #e9ece6;      /* the desk the sheet lies on */
  --sheet: #fcfcfa;      /* the page you read */
  --surface: #ffffff;
  --ink: #0d1736;        /* cheque ink: headings, primary buttons */
  --text: #1f2a44;
  --muted: #5d6980;
  --line: #d5d9d0;
  --line-soft: #e6e9e2;
  --accent: #2a3cb5;     /* ultramarine: links, focus, the active item */
  --accent-soft: #e8ebfa;
  --ok: #1d7a58;
  --bad: #8c1a2d;
  --warn-bg: #f7edcf;
  --warn-line: #e6d08e;

  /* aging: calm steel for "not due", then heat up to oxblood */
  --age-0: #7f93b8;
  --age-1: #d3ae4f;
  --age-2: #da8a3c;
  --age-3: #c24e2e;
  --age-4: #8c1a2d;

  --r-ctl: 10px;
  --r-card: 16px;
  --r-sheet: 22px;
  --serif: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--paper); line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, td, .legend dd, .rows li > span:last-child, .figures dd, .aging-total, .cred dd { font-variant-numeric: tabular-nums; }
.num { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
::selection { background: var(--accent); color: #fff; }

/* ---------- brand: the Z mark and the spaced wordmark ---------- */
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font); font-weight: 600; font-size: 1.05rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink); }
.brand-lg { font-size: 1.3rem; }
.mark { width: 1.9em; height: 1.9em; flex: none; background: url("/zakfin-mark.svg") center / contain no-repeat; }
[dir="rtl"] .brand { font-family: var(--font); font-weight: 700; }

.nav button[data-view="help"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M9.5 9.5a2.5 2.5 0 1 1 3.6 2.2c-.7.4-1.1.9-1.1 1.8M12 17h.01%22/%3E%3C/svg%3E"); }
.nav button[data-view="credit"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3l8 3v6c0 4.5-3.2 8-8 9-4.8-1-8-4.5-8-9V6z%22/%3E%3Cpath d=%22M9 12l2 2 4-4%22/%3E%3C/svg%3E"); }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line-soft); }
.tab { font: inherit; cursor: pointer; border: 1px solid transparent; border-bottom: 0; background: transparent; color: var(--text); padding: .5rem .9rem; border-radius: 10px 10px 0 0; display: inline-flex; align-items: center; gap: .5rem; margin-bottom: -1px; }
.tab:hover { background: #fff; }
.tab[aria-selected="true"] { background: #fff; border-color: var(--line-soft); font-weight: 600; color: var(--ink); }
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ws-tabs { margin-top: 1rem; }
table.kv { border-collapse: collapse; margin: .4rem 0 .8rem; }
table.kv th { text-align: start; font-weight: 600; padding: .25rem 1.5rem .25rem 0; white-space: nowrap; }
table.kv td { padding: .25rem 0; }
.help-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; counter-reset: step; }
.help-steps li { counter-increment: step; display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: .9rem 1rem; border: 1px solid var(--line-soft); border-radius: var(--r-card); background: #fff; }
.help-steps li.is-done { background: #f3faf6; border-color: #cbe6d9; }
.help-step-text { flex: 1; min-width: 0; }
.help-step-text strong::before { content: counter(step) ". "; color: var(--accent); }
.help-step-text .tag { margin-inline-start: .6rem; }
.help-step-text p { margin: .3rem 0 0; color: var(--text); line-height: 1.55; max-width: 62ch; }
.help-group { margin-top: 1.2rem; }
.help-group h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.help-item { border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: #fff; padding: .15rem .9rem; margin-bottom: .5rem; }
.help-item summary { cursor: pointer; padding: .6rem 0; font-weight: 600; }
.help-item ol { margin: .2rem 0 .6rem; padding-inline-start: 1.3rem; line-height: 1.6; }
.help-item p { margin: 0 0 .7rem; line-height: 1.6; }
@media (max-width: 640px) { .help-steps li { flex-direction: column; } }
.trial-line { margin-top: .5rem; font-size: .85rem; color: var(--accent); font-weight: 600; }
.bill-box { border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: .9rem 1rem; margin-bottom: 1rem; background: #fff; }
.bill-box h3 { margin: 0 0 .6rem; font-size: 1rem; }
.billing-card { max-width: 40rem; }
.billing-card .btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- sign-in ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--paper); }
.gate-brand { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; isolation: isolate; }
.gate-brand .brand { color: #fff; }
.rosette {
  position: absolute; z-index: -1; width: 130%; aspect-ratio: 1; inset-inline-end: -48%; top: -16%;
  background: linear-gradient(140deg, #aab8ff 0%, #5b73f5 45%, #2a3cb5 100%);
  -webkit-mask: url("/rosette.svg") center / contain no-repeat; mask: url("/rosette.svg") center / contain no-repeat;
  opacity: .95; animation: engrave 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes engrave { from { opacity: 0; transform: rotate(-10deg) scale(.94); } to { opacity: .95; transform: none; } }
.gate-tagline { font-family: var(--serif); font-size: 2.15rem; line-height: 1.22; letter-spacing: -.01em; max-width: 24rem; margin: 0; color: #fff; text-shadow: 0 0 28px var(--ink), 0 0 10px var(--ink); }
[dir="rtl"] .gate-tagline { font-family: var(--font); font-weight: 700; font-size: 1.8rem; line-height: 1.5; }
.gate-box { align-self: center; justify-self: center; width: min(25rem, calc(100% - 4rem)); margin: 2rem; padding: 0; }
.gate-top { display: flex; justify-content: flex-end; margin-bottom: 2.25rem; }
.gate-box .gate-top .brand { display: none; }
.gate-lead { font-family: var(--serif); font-size: 1.75rem; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); margin: 0 0 1.6rem; }
[dir="rtl"] .gate-lead { font-family: var(--font); font-weight: 700; font-size: 1.5rem; }
.gate-box label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink); }
.gate-box input { width: 100%; padding: .72rem .85rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.gate-box .btn-primary { width: 100%; padding: .8rem 1rem; margin-top: .5rem; }
.hint { font-size: .85rem; color: var(--muted); margin: .4rem 0 1.1rem; }
.msg { min-height: 1.4rem; margin: .8rem 0 0; font-size: .9rem; color: var(--bad); }
.msg.ok { color: var(--ok, #1f6b4a); }
.gate-title { margin: 1rem 0 .5rem; font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.gate-sub { margin: 1.1rem 0 .35rem; font-size: 1rem; color: var(--ink); }
.gate-links { display: flex; gap: 1.25rem; margin-top: 1.25rem; }
.gate-links .link-btn { margin: 0; }
.gate-form input { margin-bottom: .85rem; }
.gate-form .hint { margin-top: -.35rem; }
.gate-form .btn-primary + .hint { margin-top: 1rem; }
.gate-form .link-btn { margin-inline-start: .9rem; }

/* ---------- buttons and fields ---------- */
.btn-lang { font-size: .88rem; padding: .35rem .75rem; }
.btn {
  padding: .5rem 1rem; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
input, select, textarea { accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(42, 60, 181, .16); }
.tools input[type="search"], .tools select, .aging-head select, .inline-form input, .field input, .field select, .field textarea,
.pref-form select, .gateway-add select, .gateway-form select, .inline-field input[type="date"] {
  padding: .52rem .75rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--text);
}

/* ---------- shell: a rail on the desk, a sheet on top ---------- */
.app { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.side { padding: 1.5rem .9rem 1rem 1.2rem; display: flex; flex-direction: column; gap: 1.6rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; color: var(--text); }
[dir="rtl"] .side { padding: 1.5rem 1.2rem 1rem .9rem; }
.side .brand { padding-inline-start: .35rem; }
.nav { display: flex; flex-direction: column; gap: .12rem; }
.nav button {
  display: flex; align-items: center; gap: .7rem; text-align: start; background: none; border: 0; cursor: pointer;
  padding: .5rem .7rem; border-radius: 10px; color: #3a4764; font-weight: 500; transition: background .15s, color .15s;
}
.nav button::before {
  content: ""; width: 1.15rem; height: 1.15rem; flex: none; background: currentColor; opacity: .75;
  -webkit-mask: var(--ic, none) center / contain no-repeat; mask: var(--ic, none) center / contain no-repeat;
}
.nav button:hover { background: rgba(13, 23, 54, .06); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 0 0 1px var(--line), 0 6px 14px -8px rgba(13, 23, 54, .3); }
.nav button[aria-current="page"]::before { background: var(--accent); opacity: 1; }
.nav-gap { border: 0; border-top: 1px solid var(--line); margin: .55rem .5rem; }
.side-foot { margin-top: auto; font-size: .84rem; display: grid; gap: .85rem; }
.side-status { display: grid; gap: .3rem; color: var(--muted); }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-inline-end: .45rem; background: #9aa3b4; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--bad); }
.ws-name { margin: 0; font-family: var(--serif); font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.ws-name:empty { display: none; }
[dir="rtl"] .ws-name { font-family: var(--font); font-weight: 700; }
.me { display: flex; align-items: center; gap: .7rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.me > div { display: grid; min-width: 0; }
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .8rem; font-weight: 700; background: var(--ink); color: #fff; }
.who-name { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.who-role { color: var(--muted); }

.main {
  background: var(--sheet); min-width: 0; margin: .75rem .75rem .75rem 0; border-radius: var(--r-sheet);
  border: 1px solid var(--line); box-shadow: 0 1px 0 #fff inset, 0 40px 70px -50px rgba(13, 23, 54, .4);
  padding: 2.25rem 2.75rem 4rem; min-height: calc(100vh - 1.5rem);
}
[dir="rtl"] .main { margin: .75rem 0 .75rem .75rem; }
.main > * { max-width: 84rem; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
h1 { margin: 0; font-family: var(--serif); font-size: 2.15rem; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); font-weight: 600; }
[dir="rtl"] h1 { font-family: var(--font); font-weight: 700; font-size: 1.8rem; letter-spacing: 0; }
.subtitle { margin: .4rem 0 0; color: var(--muted); max-width: 46rem; }
.top-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.top-actions .btn { padding: .42rem .85rem; font-size: .9rem; background: transparent; }
.top-actions .btn:hover { background: var(--surface); }

.banner { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--r-ctl); padding: .7rem 1rem; margin-bottom: 1rem; font-size: .92rem; color: #5b4708; }
.banner.bad { border-color: #e2b9bf; background: #f9e8ea; color: #6f1624; }
.tools { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tools input[type="search"] { flex: 1 1 14rem; max-width: 24rem; }

/* ---------- the aging ribbon (signature) ---------- */
.aging { margin-bottom: 2.75rem; }
.aging-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.aging-total { font-family: var(--serif); font-size: 3.6rem; line-height: 1.05; font-weight: 600; letter-spacing: -.025em; color: var(--ink); }
[dir="rtl"] .aging-total { font-family: var(--font); font-weight: 700; letter-spacing: 0; }
.aging-total small { font-family: var(--font); font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-inline-start: .45rem; }
.aging-caption { color: var(--muted); margin: 0; }
.ribbon { display: flex; gap: 2px; height: 4.25rem; border-radius: 12px; overflow: hidden; background: var(--line-soft); }
.ribbon span {
  min-width: 3px; transition: flex-grow .6s cubic-bezier(.2, .7, .2, 1);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .26) 0 1px, transparent 1px 4px), linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .1));
}
.ribbon .b0 { background-color: var(--age-0); } .ribbon .b1 { background-color: var(--age-1); }
.ribbon .b2 { background-color: var(--age-2); } .ribbon .b3 { background-color: var(--age-3); } .ribbon .b4 { background-color: var(--age-4); }
.legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-top: .9rem; }
.legend div { border-top: 2px solid var(--line); padding-top: .5rem; }
.legend .b0 { border-color: var(--age-0); } .legend .b1 { border-color: var(--age-1); }
.legend .b2 { border-color: var(--age-2); } .legend .b3 { border-color: var(--age-3); } .legend .b4 { border-color: var(--age-4); }
.legend dt { font-size: .84rem; color: var(--muted); }
.legend dd { margin: 0; font-weight: 650; color: var(--ink); }

/* ---------- overview columns ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0; }
.cols > .block + .block { border-inline-start: 1px solid var(--line); padding-inline-start: 2.75rem; margin-inline-start: 2.75rem; }
.block h2 { font-family: var(--serif); font-size: 1.3rem; letter-spacing: -.01em; margin: 0 0 .75rem; color: var(--ink); font-weight: 600; }
[dir="rtl"] .block h2 { font-family: var(--font); font-weight: 700; font-size: 1.15rem; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 3px double var(--line); }
.rows li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.rows li > span:last-child { font-weight: 600; color: var(--ink); }
.rows .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rows .sub { display: block; font-size: .82rem; color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; margin: 0 0 1.75rem; }
.figures dt { font-size: .85rem; color: var(--muted); }
.figures dd { margin: 0; font-family: var(--serif); font-size: 1.5rem; overflow-wrap: anywhere; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.cols .figures { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
[dir="rtl"] .figures dd { font-family: var(--font); font-weight: 700; letter-spacing: 0; }

/* ---------- tables: ledger rules ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: start; padding: .7rem .8rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-weight: 600; font-size: .84rem; cursor: pointer; user-select: none; border-bottom: 3px double var(--line); padding-top: .8rem; padding-bottom: .65rem; }
thead th:hover { color: var(--ink); }
thead th[aria-sort="ascending"], thead th[aria-sort="descending"] { color: var(--accent); }
thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: .65em; }
thead th[aria-sort="descending"]::after { content: " ▼"; font-size: .65em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(42, 60, 181, .035); }
td.end, th.end { text-align: end; font-variant-numeric: tabular-nums; }
.count { color: var(--muted); font-size: .88rem; margin: .7rem 0 0; }

.tag { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid var(--line); background: var(--sheet); color: var(--text); }
.tag.paid, .tag.pay-succeeded { color: var(--ok); border-color: #b5dccb; background: #ecf7f1; }
.tag.open, .tag.pay-pending { color: #6d5206; border-color: var(--warn-line); background: var(--warn-bg); }
.tag.overdue, .tag.pay-failed, .tag.pay-disputed { color: var(--bad); border-color: #e2b9bf; background: #f9e8ea; }
.tag.role-owner { color: #fff; background: var(--ink); border-color: var(--ink); }
.tag.role-manager { color: var(--accent); border-color: #c5cbf2; background: var(--accent-soft); }
.src { font-size: .8rem; color: var(--muted); }

.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.2rem; margin-bottom: .3rem; }
.loading { color: var(--muted); padding: 2rem 0; }

/* ---------- connections ---------- */
.conn { display: grid; gap: .9rem; max-width: 46rem; }
.conn-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.1rem 1.3rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.conn-item h2 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.conn-item p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.conn-actions { flex-direction: column; align-items: stretch; gap: .4rem; }
.conn td .btn { width: 100%; }

/* ---------- client companies ---------- */
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.inline-form input { flex: 1 1 14rem; max-width: 24rem; }
.company { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 1.1rem; overflow: hidden; }
.company-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 3px double var(--line); }
.company-head h2 { margin: 0; font-family: var(--serif); font-size: 1.25rem; letter-spacing: -.01em; color: var(--ink); font-weight: 600; }
[dir="rtl"] .company-head h2 { font-family: var(--font); font-weight: 700; font-size: 1.1rem; }
.gateways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gateway { padding: 1.05rem 1.3rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.gateway + .gateway { border-inline-start: 1px solid var(--line-soft); }
.gateway h3 { margin: 0 0 .25rem; font-size: 1rem; color: var(--ink); }
.gateway p { margin: 0; color: var(--muted); font-size: .9rem; }
.gateway-form { display: grid; gap: .6rem; justify-content: stretch; align-content: start; }
.gateway-form .btn { justify-self: start; }
.field { display: grid; gap: .25rem; font-size: .88rem; color: var(--muted); }
.field select { max-width: 16rem; }
.field textarea { font: .82rem/1.4 ui-monospace, Consolas, monospace; resize: vertical; min-height: 7rem; }
.field input[type="file"] { padding: .35rem 0; border: 0; background: none; box-shadow: none; }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.gateway-add { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); }
.gateway-add select { max-width: 20rem; }
.gateways .gateway-form { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); max-width: 32rem; }
.company-sub { grid-column: 1 / -1; margin: 0; padding: .8rem 1.3rem .25rem; font-size: .82rem; font-weight: 650; color: var(--muted); border-top: 1px solid var(--line-soft); }
.company-head + .gateways .company-sub:first-child { border-top: 0; }
.company > .company-sub { grid-column: auto; }
.gateway + .gateway-add { border-inline-start: 0; }
.figures-wide { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 1.4rem; }
.section-title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin: 2.25rem 0 .7rem; font-weight: 600; }
[dir="rtl"] .section-title { font-family: var(--font); font-weight: 700; font-size: 1.15rem; }

/* ---------- accounts, roles, users ---------- */
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.user-card .company-head { align-items: flex-start; }
.user-card .company-head p { margin: .1rem 0 0; font-size: .88rem; }
.user-body { padding: 1.05rem 1.3rem 1.2rem; display: grid; gap: .85rem; }
.user-body .hint { margin: 0; }
.check { display: flex; align-items: center; gap: .55rem; font-size: .95rem; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; }
.access { border: 1px solid var(--line-soft); border-radius: var(--r-ctl); padding: .7rem .95rem .85rem; display: grid; gap: .45rem; margin: 0; min-width: 0; }
.access legend { padding: 0 .35rem; font-size: .88rem; color: var(--muted); }
.saved { color: var(--ok); font-size: .9rem; }
.cred { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r-card); padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.cred h2 { margin: 0 0 .6rem; font-size: 1.05rem; color: var(--ink); }
.cred dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 .6rem; }
.cred dt { color: var(--muted); }
.cred dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; user-select: all; }
.cred .num { white-space: normal; }
#security-body p { margin: .4rem 0 .9rem; }
#security-body h3 { margin: .2rem 0 .3rem; }
.secret { font-size: 1.05rem; padding: .75rem .9rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-ctl); overflow-wrap: anywhere; }
.secret .num { white-space: normal; font-weight: 700; letter-spacing: .06em; }
.codes { list-style: none; padding: 0; margin: .5rem 0 1.1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.codes li { padding: .45rem .7rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-ctl); font-weight: 650; }
.inline-field { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }
.tax-net dd { font-weight: 700; }
.pref-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.pref-form .btn { width: auto; margin-top: 0; padding: .5rem 1rem; }

/* ---------- navigation icons ---------- */
.nav button[data-view="workspaces"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223.5%22 y=%223.5%22 width=%2217%22 height=%2217%22 rx=%222.2%22/%3E%3Cpath d=%22M3.5 9.5h17M9.5 9.5v11%22/%3E%3C/svg%3E"); }
.nav button[data-view="overview"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223.5%22 y=%223.5%22 width=%227%22 height=%227%22 rx=%221.6%22/%3E%3Crect x=%2213.5%22 y=%223.5%22 width=%227%22 height=%227%22 rx=%221.6%22/%3E%3Crect x=%223.5%22 y=%2213.5%22 width=%227%22 height=%227%22 rx=%221.6%22/%3E%3Crect x=%2213.5%22 y=%2213.5%22 width=%227%22 height=%227%22 rx=%221.6%22/%3E%3C/svg%3E"); }
.nav button[data-view="receivables"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.5%22/%3E%3Cpath d=%22M12 7v5l3.2 2%22/%3E%3C/svg%3E"); }
.nav button[data-view="invoices"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6.5 3h8l4 4v14h-12z%22/%3E%3Cpath d=%22M14.5 3v4h4M9.5 12h6M9.5 16h6%22/%3E%3C/svg%3E"); }
.nav button[data-view="bills"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h12v18l-3-2-3 2-3-2-3 2z%22/%3E%3Cpath d=%22M9 8h6M9 12h6%22/%3E%3C/svg%3E"); }
.nav button[data-view="tax"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M18 6 6 18%22/%3E%3Ccircle cx=%227.5%22 cy=%227.5%22 r=%222.2%22/%3E%3Ccircle cx=%2216.5%22 cy=%2216.5%22 r=%222.2%22/%3E%3C/svg%3E"); }
.nav button[data-view="payments"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%225.5%22 width=%2218%22 height=%2213%22 rx=%222.5%22/%3E%3Cpath d=%22M3 10h18M7 15h4%22/%3E%3C/svg%3E"); }
.nav button[data-view="companies"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 21V6l8-3v18M12 9h8v12M3 21h18M7.5 9h1M7.5 13h1M7.5 17h1M15.5 13h1M15.5 17h1%22/%3E%3C/svg%3E"); }
.nav button[data-view="customers"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%223.6%22/%3E%3Cpath d=%22M5 20.5c.9-4 3.8-5.5 7-5.5s6.1 1.5 7 5.5%22/%3E%3C/svg%3E"); }
.nav button[data-view="accounts"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 4.5A1.5 1.5 0 0 1 6.5 3H18v15H6.5A1.5 1.5 0 0 0 5 19.5z%22/%3E%3Cpath d=%22M5 19.5A1.5 1.5 0 0 0 6.5 21H18v-3M9 8h6%22/%3E%3C/svg%3E"); }
.nav button[data-view="users"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223.2%22/%3E%3Cpath d=%22M3 20c.8-3.6 3-5 6-5s5.2 1.4 6 5%22/%3E%3Ccircle cx=%2217%22 cy=%229%22 r=%222.5%22/%3E%3Cpath d=%22M17.5 14.3c2 .3 3.2 1.8 3.5 4.2%22/%3E%3C/svg%3E"); }
.nav button[data-view="audit"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 6.5h16M4 12h16M4 17.5h9%22/%3E%3C/svg%3E"); }
.nav button[data-view="connections"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M10 14a4 4 0 0 1 0-5.7l2.3-2.3a4 4 0 0 1 5.7 5.7l-1.2 1.2%22/%3E%3Cpath d=%22M14 10a4 4 0 0 1 0 5.7L11.7 18A4 4 0 0 1 6 12.3l1.2-1.2%22/%3E%3C/svg%3E"); }
.nav button[data-view="plugins"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3 20 7.5v9L12 21l-8-4.5v-9z%22/%3E%3Cpath d=%22m4 7.5 8 4.5 8-4.5M12 12v9%22/%3E%3C/svg%3E"); }

.nav button[data-view="actions"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M13 3 5 13.5h6L10 21l8-10.5h-6z%22/%3E%3C/svg%3E"); }

/* ---------- actions ---------- */
.tag.as-done { color: var(--ok); border-color: #b5dccb; background: #ecf7f1; }
.tag.as-pending, .tag.as-executing, .tag.as-unknown { color: #6d5206; border-color: var(--warn-line); background: var(--warn-bg); }
.tag.as-failed { color: var(--bad); border-color: #e2b9bf; background: #f9e8ea; }
.msg-box { font: .95rem/1.55 var(--font); resize: vertical; min-height: 9rem; width: 100%; box-sizing: border-box; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sheet); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 7.5rem auto; gap: .5rem; align-items: center; }
.line-row input { width: 100%; box-sizing: border-box; }
.act-card .banner { margin-bottom: 0; }
tr.sum td { font-weight: 650; border-top: 3px double var(--line); }
details.company > summary { cursor: pointer; list-style: none; }
details.company > summary::-webkit-details-marker { display: none; }
details.company[open] > summary { border-bottom: 3px double var(--line); }
details.company:not([open]) > summary { border-bottom: 0; }

@media print {
  .side, .top-actions, .tools, .banner, #tools, .noprint { display: none !important; }
  .app { display: block; }
  .main { margin: 0; border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .line-row { grid-template-columns: minmax(0, 1fr) 5rem 6rem; }
  .line-row .btn { grid-column: 1 / -1; justify-self: start; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side, [dir="rtl"] .side { position: static; height: auto; padding: .9rem 1rem .6rem; gap: .7rem; min-width: 0; }
  .nav { flex-direction: row; overflow-x: auto; padding-bottom: .35rem; gap: .25rem; }
  .nav button { white-space: nowrap; padding: .45rem .75rem; }
  .nav-gap, .side-foot { display: none; }
  .main, [dir="rtl"] .main { margin: 0; border-radius: 20px 20px 0 0; border-inline: 0; border-bottom: 0; padding: 1.4rem 1rem 3rem; min-height: 0; }
  h1 { font-size: 1.6rem; }
  .cols { grid-template-columns: 1fr; gap: 2rem; }
  .cols > .block + .block { border-inline-start: 0; padding-inline-start: 0; margin-inline-start: 0; }
  .aging-total { font-size: 2.4rem; }
  .ribbon { height: 3rem; }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gateways { grid-template-columns: minmax(0, 1fr); }
  .gateway + .gateway { border-inline-start: 0; border-top: 1px solid var(--line-soft); }
  .figures-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-brand { padding: 1.6rem 1.5rem; min-height: 15rem; }
  .gate-tagline, [dir="rtl"] .gate-tagline { font-size: 1.35rem; }
  .rosette { width: 120%; inset-inline-end: -45%; top: -30%; }
  .gate-box { margin: 1.75rem auto 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .ribbon span { transition: none; } .rosette { animation: none; } .btn { transition: none; } }

.nav button[data-view="mine"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 20V8l8-4 8 4v12M9 20v-6h6v6%22/%3E%3C/svg%3E"); }
.nav button[data-view="toplatform"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M10 6l-6 6 6 6M4 12h16%22/%3E%3C/svg%3E"); }
.conn-sub { margin: 1.6rem 0 .6rem; font-size: 1.05rem; }
.conn .tools { align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.conn .tools p { margin: 0; }
.conn-actions { flex-direction: column; align-items: stretch; gap: .4rem; }
.conn td .btn { width: 100%; }

.nav button[data-view="reconcile"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 8h13l-3-3M20 16H7l3 3%22/%3E%3C/svg%3E"); }
.nav button[data-view="review"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%227%22/%3E%3Cpath d=%22M16.5 16.5L21 21%22/%3E%3C/svg%3E"); }
.nav button[data-view="close"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224%22 y=%224%22 width=%2216%22 height=%2216%22 rx=%222%22/%3E%3Cpath d=%22M8.5 12.5l2.5 2.5 4.5-5%22/%3E%3C/svg%3E"); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: .8rem 1rem; }
.card-n { font-size: 1.6rem; font-weight: 700; }
.card-l { font-size: .82rem; color: var(--muted, #5b6478); }
.card.tone-warn { border-color: var(--warn-line); background: var(--warn-bg); }
.close-list { display: grid; gap: .6rem; }
.close-item { display: flex; align-items: center; gap: .9rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: .8rem 1rem; }
.close-body { flex: 1; }
.close-mark { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--sheet); border: 1px solid var(--line); }
.close-ok .close-mark { color: var(--ok); border-color: #b5dccb; background: #ecf7f1; }
.close-warn .close-mark { color: #6d5206; border-color: var(--warn-line); background: var(--warn-bg); }
.close-fail .close-mark { color: var(--bad); border-color: #e2b9bf; background: #f9e8ea; }
.banner.ok { border-color: #b5dccb; background: #ecf7f1; color: #14573a; }

.nav button[data-view="disputes"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3l9 16H3L12 3zM12 10v4M12 17h.01%22/%3E%3C/svg%3E"); }
.nav button[data-view="autopilot"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12l18-8-8 18-2-8-8-2z%22/%3E%3C/svg%3E"); }
.disputes { display: grid; gap: .8rem; }
.dispute { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.dispute.urgent { border-color: #e2b9bf; }
.dispute-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.dispute-body { padding: .8rem 1rem; display: grid; gap: .5rem; }
.dispute-body p { margin: 0; }
.proofs { margin: .3rem 0 0; padding-inline-start: 1.2rem; display: grid; gap: .25rem; }

.team { margin-top: .5rem; display: grid; gap: .6rem; padding: 0 1rem 1rem; }
.team-member { border: 1px solid var(--line); border-radius: var(--r-card); padding: .7rem .9rem; display: grid; gap: .5rem; background: var(--surface); }
.team-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.team-head p { margin: 0; }
.tag.role-admin { background: #e8e4f5; color: #3d2f7a; }

.how { margin: .2rem 0 1.1rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sheet); }
.how summary { cursor: pointer; font-weight: 600; }
.how ol { margin: .6rem 0; padding-inline-start: 1.3rem; line-height: 1.6; }
.how .row { display: flex; flex-wrap: wrap; gap: .5rem; }
.how a.btn { text-decoration: none; }
.nav-title { margin: 1.1rem .75rem .3rem; font-size: .78rem; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.nav-title-bare { margin: .6rem .5rem; border-top: 1px solid var(--line); height: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.tabs button { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--sheet); color: var(--ink); font: inherit; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs .n { opacity: .65; margin-inline-start: .35rem; font-variant-numeric: tabular-nums; }
.table-wrap td .btn { padding: .25rem .65rem; font-size: .85rem; }

/* ======================================================================
   Professional, plain skin. Flat white cards on a light grey desk, one blue, sans-serif everywhere.
   Overrides the earlier "cheque" look; the login screen keeps its artwork.
   ====================================================================== */
:root {
  --paper: #f3f5f8; --sheet: #ffffff; --surface: #ffffff;
  --ink: #101828; --text: #27324a; --muted: #667085; --line: #dfe3ea; --line-soft: #eceff4;
  --accent: #1558d6; --accent-soft: #e8f0fe;
  --ok: #0f7b4f; --bad: #b42318;
  --r-ctl: 8px; --r-card: 12px; --r-sheet: 14px;
  --serif: var(--font);
}
body { font-size: 15px; }
.app { grid-template-columns: 16rem minmax(0, 1fr); }
.side { background: #fff; border-inline-end: 1px solid var(--line); padding: 1.25rem .8rem 1rem; }
.side .brand { letter-spacing: .18em; }
.nav button { padding: .55rem .75rem; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav button:hover { background: var(--line-soft); }
.nav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); box-shadow: none; font-weight: 600; }
.nav button[aria-current="page"]::before { background: var(--accent); }
.nav-title { margin: 1.2rem .75rem .35rem; font-size: .72rem; text-transform: none; font-weight: 600; color: var(--muted); }
.main { margin: 0; border: 0; border-radius: 0; background: var(--paper); box-shadow: none; padding: 1.75rem 2.25rem 4rem; }
[dir="rtl"] .main { margin: 0; }
h1 { font-size: 1.65rem; letter-spacing: -.01em; font-weight: 650; }
.subtitle { color: var(--muted); }
.top { margin-bottom: 1.25rem; }
.top-actions .btn { background: #fff; }
.btn { border-radius: 8px; font-weight: 500; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #0f46ae; border-color: #0f46ae; color: #fff; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(21, 88, 214, .18); }
.table-wrap, .company, .block, .bill-box, .gateway, .aging { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.aging { padding: 1.4rem 1.5rem; margin-bottom: 1.25rem; }
.aging-total { font-size: 2.6rem; font-weight: 650; }
.block { padding: 1.2rem 1.4rem; }
.block h2, .company-head h2 { font-size: 1.05rem; font-weight: 650; }
.company-head { border-bottom: 1px solid var(--line-soft); padding: .9rem 1.25rem; }
thead th { background: #f8f9fb; text-transform: none; font-size: .8rem; letter-spacing: 0; }
tbody tr:hover td { background: #f8fafe; }
th, td { padding: .75rem .9rem; }
.tag { border-radius: 999px; font-weight: 600; }
.tabs button { background: #fff; }
.tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.how { background: #fff; }
.next { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1.25rem; }
.next a, .next button { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 14rem; text-align: start; padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); text-decoration: none; font: inherit; }
.next button:hover { border-color: var(--accent); }
.next strong { color: var(--ink); font-size: 1rem; }
.next span { color: var(--muted); font-size: .85rem; }
.next .is-todo { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 800px) { .app { grid-template-columns: 1fr; } .main { padding: 1.1rem; } .side { height: auto; position: static; border: 0; border-bottom: 1px solid var(--line); } }
.ribbon span { background-image: none; }
.rows { border-top: 1px solid var(--line-soft); }
.company-head { border-bottom: 1px solid var(--line-soft); }
.glance, .block .figures { margin-inline-start: 0; }
.figures dd { font-size: 1.4rem; }

.inv-bar { margin: 0 0 1.25rem; }
.inv-editor { margin-top: .75rem; }
.inv-terms { gap: .4rem; align-items: center; margin: -.4rem 0 1rem; flex-wrap: wrap; }
.inv-lines { margin: 1rem 0; }
.line-row { display: grid; grid-template-columns: minmax(0, 3fr) 6rem 8rem 8rem 2.6rem; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.line-row input { padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.line-head { color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: .3rem; }
.inv-amt { text-align: end; padding-inline-end: .5rem; }
.inv-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: .75rem; font-size: 1.15rem; margin: 0 0 1rem; padding-top: .75rem; border-top: 1px solid var(--line-soft); }
.inv-total .hint { flex-basis: 100%; text-align: end; margin: 0; }
@media (max-width: 700px) { .line-row { grid-template-columns: 1fr 5rem 6rem; } .line-row .inv-amt, .line-head span:nth-child(4) { display: none; } }

/* ======================================================================
   Polish: navy sidebar, calmer forms, consistent controls.
   ====================================================================== */
:root { --navy: #0e1b3d; --navy-2: #16264f; }
.side { background: var(--navy); border-inline-end: 0; color: #c5cee6; }
.side .brand, .brand { color: #fff; }
.side .nav button { color: #c5cee6; }
.side .nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side .nav button[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #6ea4ff; }
[dir="rtl"] .side .nav button[aria-current="page"] { box-shadow: inset -3px 0 0 #6ea4ff; }
.side .nav button[aria-current="page"]::before { background: #fff; opacity: 1; }
.nav-title { color: #8593b8; }
.nav-title-bare { border-top-color: rgba(255, 255, 255, .12); }
.side-foot, .side-status { color: #9fb0d6; }
.ws-name, .who-name { color: #fff; }
.who-role { color: #9fb0d6; }
.side-foot .btn, .side .btn { background: transparent; color: #dbe3f7; border-color: rgba(255, 255, 255, .25); }

/* forms */
.field { display: grid; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0; }
.field input, .field select, .field textarea, .line-row input, .je-form-row input, .je-form-row select, .gateway-form select, .gateway-add select, .tools select, .tools input[type="search"] {
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; background-color: #fff; color: var(--text); font-weight: 400; font-size: .95rem; min-height: 2.5rem;
}
select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.1rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right .8rem center !important; background-size: .75rem !important; }
[dir="rtl"] select { background-position: left .8rem center !important; }
.field select { max-width: none; width: 100%; }
input[type="file"] { font-size: .9rem; color: var(--muted); }
input[type="file"]::file-selector-button { margin-inline-end: .75rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
.grid-form { display: grid; gap: 1rem; }
.grid-2 { gap: 1rem; align-items: start; }
.user-body { gap: 1rem; padding: 1.25rem 1.4rem 1.4rem; }
.user-body h3 { margin: .6rem 0 0; font-size: .95rem; }
.company-head { padding: 1rem 1.4rem; }
details.company > summary { cursor: pointer; list-style: none; }
details.company > summary::-webkit-details-marker { display: none; }
details.company > summary::after { content: "+"; margin-inline-start: auto; font-size: 1.4rem; color: var(--muted); }
details.company[open] > summary::after { content: "–"; }
.row { gap: .5rem; }
.banner { border-radius: 10px; }
.btn { min-height: 2.35rem; }
.table-wrap td select { min-height: 2.1rem; padding: .35rem .6rem; font-size: .88rem; }
.empty { padding: 2.5rem 1rem; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .3rem; }
.cards .card { border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-n { font-weight: 650; }
.table-wrap td select { background-color: #fff; }
.allow { margin-top: 1.25rem; }

.mailbox-status { margin: .35rem 0; }
.mailbox-status ul { margin: .35rem 0 0; padding-inline-start: 1.1rem; font-size: .85rem; line-height: 1.5; }
.mailbox-status .msg { margin: .35rem 0; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: .5rem 0; }
.inv-total { display: grid; grid-template-columns: auto auto; justify-content: end; gap: .25rem 1rem; align-items: baseline; }
.inv-total .hint { grid-column: 1 / -1; text-align: end; }

/* Books */
.fs td { padding: .4rem .6rem; }
.fs tr.head td { font-weight: 600; padding-top: 1rem; color: var(--muted, #5b6478); }
.fs tr.sum td { font-weight: 600; border-top: 1px solid var(--line-soft, #e3e6ee); }
.fs tr.grand td { font-weight: 700; border-top: 2px solid var(--line, #cfd4e0); }
.je { border: 1px solid var(--line-soft, #e3e6ee); border-radius: 10px; padding: .6rem .9rem; margin: .6rem 0; background: #fff; }
.je-off { opacity: .6; }
.je-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; }
.je-tags { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.tag { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: #eef1f8; color: #3a4666; }
.tag.warn { background: #fff3d6; color: #7a5200; }
.je-lines { width: 100%; margin-top: .4rem; font-size: .9rem; }
.je-lines td { padding: .15rem .4rem; }
.je-form-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .5rem; align-items: center; margin: .3rem 0; }
@media print { .tabs, .je button { display: none !important; } }

.nav button[data-view="books"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 4.5A1.5 1.5 0 0 1 6.5 3H19v15H6.5A1.5 1.5 0 0 0 5 19.5z%22/%3E%3Cpath d=%22M5 19.5A1.5 1.5 0 0 0 6.5 21H19v-3%22/%3E%3Cpath d=%22M9 7.5h6M9 11h6%22/%3E%3C/svg%3E"); }
.je-form-row select { max-width: none; }

/* ---------- legal details, tax by country, Gmail ---------- */
.legal { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); }
.legal > summary, .how > summary, .user-card > summary { cursor: pointer; }
.legal > summary.company-sub { border-top: 0; display: flex; align-items: center; gap: .6rem; }
.legal .user-body { padding-top: .6rem; }
.tag.warn { color: #6d5206; border-color: var(--warn-line); background: var(--warn-bg); }
.how { border: 1px solid var(--line-soft); border-radius: var(--r-ctl); padding: .55rem .9rem; font-size: .92rem; }
.how ul, .how ol, .banner ul { margin: .5rem 0 .2rem; padding-inline-start: 1.2rem; display: grid; gap: .3rem; }
.banner ul { margin: .3rem 0 0; }
textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; color: inherit; resize: vertical; }
.inv-legal { display: grid; gap: .75rem; margin: .5rem 0 1rem; }
.inv-legal .company-sub { padding: .4rem 0 0; border-top: 0; }
.inv-tax { align-items: end; }
.inv-taxsum { display: grid; gap: .25rem; }
.row-between { display: flex; justify-content: space-between; gap: 1rem; }
.inv-check .banner { margin-bottom: .5rem; }
.inv-check .hint { margin: 0; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.return-table { width: 100%; }
.return-table caption { text-align: start; font-weight: 650; padding: .6rem .2rem; }
.return-table tr.sum td { font-weight: 650; border-top: 1px solid var(--line); }
.return-notes { margin: .6rem 0 1rem; padding-inline-start: 1.2rem; display: grid; gap: .3rem; }
.lock-panel .lock-row { padding: .5rem 0; border-top: 1px solid var(--line-soft); }
.lock-panel .field { max-width: 24rem; }
@media print { .lock-panel { display: none; } }

.nav button[data-view="bank"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 9.5 12 4l9 5.5M5 10v8M9.5 10v8M14.5 10v8M19 10v8M3 20h18%22/%3E%3C/svg%3E"); }
/* Zakaria Books: bank lines, panels, summaries */
.zb-sum { display: flex; flex-wrap: wrap; gap: 1.2rem 2.2rem; align-items: center; margin: 0 0 1rem; padding: .85rem 1.1rem; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: #fff; }
.zb-sum > div { display: grid; gap: .1rem; }
.zb-lines { display: grid; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: #fff; margin-bottom: 1rem; }
.zb-item + .zb-item { border-top: 1px solid var(--line-soft); }
.zb-item.open { background: #fafbff; }
.zb-line { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto auto; gap: .8rem; align-items: center; padding: .7rem 1rem; }
.zb-desc { display: grid; gap: .1rem; min-width: 0; }
.zb-desc strong { overflow-wrap: anywhere; font-weight: 600; }
.zb-match { color: var(--ok); font-size: .88rem; }
.zb-amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: end; white-space: nowrap; }
.zb-amt.in { color: var(--ok); }
.zb-amt.out { color: var(--ink); }
.zb-act { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.zb-panel { padding: .9rem 1rem 1.1rem; border-top: 1px dashed var(--line-soft); display: grid; gap: .8rem; }
.zb-panel .tabs { margin-bottom: 0; }
.zb-block { display: grid; gap: .5rem; padding: .7rem .85rem; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: #fff; }
.zb-doc { display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.zb-check { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; cursor: pointer; }
.zb-check input[type="checkbox"] { width: 1.05rem; height: 1.05rem; flex: none; }
.zb-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
.zb-split input, .zb-split select { width: 100%; box-sizing: border-box; }
.zb-exclude { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: .5rem; border-top: 1px solid var(--line-soft); }
.row-between { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.zb-start .row { flex-wrap: wrap; }
@media (max-width: 700px) { .zb-line { grid-template-columns: minmax(0, 1fr) auto; } .zb-date { grid-column: 1 / -1; } .zb-act { grid-column: 1 / -1; justify-content: flex-start; } .zb-split { grid-template-columns: 1fr 1fr; } }
.table-wrap td .zb-cell { flex-direction: column; align-items: stretch; gap: .3rem; }
.table-wrap td .zb-cell .btn { white-space: nowrap; }
.zb-block input[type="search"], .zb-block input[type="text"], .zb-panel input[type="text"], .zb-panel input[type="number"], .zb-panel input[type="search"], .zb-panel select { font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; min-width: 0; }
.zb-block .row input[type="search"] { flex: 1 1 14rem; }
.tools input[type="number"], .tools input[type="date"] { font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; }

.nav button[data-view="assets"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 20V9l8-5 8 5v11M9 20v-6h6v6M2 20h20%22/%3E%3C/svg%3E"); }
.nav button[data-view="capital"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 4v16M16.5 7.5c-.8-1.2-2.4-2-4.5-2-2.6 0-4.2 1.2-4.2 3s1.6 2.5 4.2 3 4.2 1.2 4.2 3-1.6 3-4.2 3c-2.2 0-3.9-.9-4.8-2.3%22/%3E%3C/svg%3E"); }
.nav button[data-view="inventory"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 8l9-4 9 4-9 4-9-4zM3 8v8l9 4 9-4V8M12 12v8%22/%3E%3C/svg%3E"); }
.nav button[data-view="payroll"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 7h18v12H3zM3 11h18M7 15h3%22/%3E%3C/svg%3E"); }

.fs tr.head.sub td { font-weight: 600; padding-inline-start: 1.2rem; opacity: .85; }
.fs tr.head td { font-weight: 700; }
tr.muted td { opacity: .55; }

.ops-grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); align-items: end; }
.ops-grid .field { min-width: 0; }
.ops-grid .field input, .ops-grid .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.table-wrap td .field { margin: 0; }
.zb-block h4 { margin: .2rem 0 .5rem; }
.table-wrap td .zb-cell { display: flex; }
.table-wrap td .zb-cell .btn { text-align: center; }
.ops-run-row { display: grid; grid-template-columns: minmax(8rem, 1fr) repeat(3, minmax(0, 1fr)); gap: .75rem; align-items: end; margin: .5rem 0; }
.ops-run-row .check { padding-bottom: .6rem; }
.ops-run-row .field input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 760px) { .ops-run-row { grid-template-columns: 1fr 1fr; } }

/* Plans and prices, plan and billing */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 700px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1rem; }
@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; } }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.plain-list li { justify-content: space-between; align-items: center; gap: .75rem; }
.catalog-form { display: grid; gap: 1rem; }
.bill-custom { display: grid; gap: .5rem; margin: .75rem 0; }
a.btn { text-decoration: none; }

.nav button[data-view="billing"], .nav button[data-view="catalog"], .nav button[data-view="system"], .nav button[data-view="insights"], .nav button[data-view="statements"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%225%22 width=%2218%22 height=%2214%22 rx=%222%22/%3E%3Cpath d=%22M3 10h18M7 15h4%22/%3E%3C/svg%3E"); }
.grid-4 > *, .grid-2 > *, .catalog-form .field { min-width: 0; }
.catalog-form input[type=text], .catalog-form input[type=number], .catalog-form input[type=url], .bill-custom input { width: 100%; box-sizing: border-box; }

.stm-head { margin: 1rem 0 .5rem; }
.stm-head h2 { display: inline-block; margin-inline-end: .6rem; }
.stm-title { padding: 0 .5rem; }
tr.group th { text-align: start; background: var(--surface-2, #f3f5f9); font-weight: 600; }
tr.total td, tr.total th { font-weight: 700; border-top: 1px solid var(--line, #d9dee8); }
tr.clickable { cursor: pointer; }
.integrity { margin-top: 1rem; }

.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.mode-grid .user-card { margin: 0; }
.mode-current { outline: 2px solid var(--accent, currentColor); outline-offset: -2px; }
@media (max-width: 760px) { .mode-grid { grid-template-columns: 1fr; } }

.nav button[data-view="control"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3Cpath d=%22M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1%22/%3E%3C/svg%3E"); }
.nav button[data-view="revenue"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 17l5-5 4 4 8-9%22/%3E%3Cpath d=%22M15 7h5v5%22/%3E%3C/svg%3E"); }
.nav button[data-view="team"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223%22/%3E%3Cpath d=%22M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6%22/%3E%3Ccircle cx=%2217%22 cy=%2210%22 r=%222.5%22/%3E%3Cpath d=%22M17 15c2.2 0 4 1.8 4 4%22/%3E%3C/svg%3E"); }

.nav button[data-view="recovery"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 3-6.7%22/%3E%3Cpath d=%22M3 4v4h4%22/%3E%3Cpath d=%22M12 8v8M9.5 10.5h4a1.5 1.5 0 0 1 0 3h-3a1.5 1.5 0 0 0 0 3h4%22/%3E%3C/svg%3E"); }
.nav button[data-view="guardian"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3l7 3v5c0 5-3 8-7 10-4-2-7-5-7-10V6z%22/%3E%3Cpath d=%22M9 12l2 2 4-4%22/%3E%3C/svg%3E"); }
.nav button[data-view="caudit"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224%22 y=%223%22 width=%2216%22 height=%2218%22 rx=%222%22/%3E%3Cpath d=%22M8 8h8M8 12h8M8 16h5%22/%3E%3C/svg%3E"); }
.nav button[data-view="value"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 19V5%22/%3E%3Cpath d=%22M4 19h16%22/%3E%3Cpath d=%22M8 15l3-4 3 2 4-6%22/%3E%3C/svg%3E"); }
.nav button[data-view="assistant"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z%22/%3E%3Cpath d=%22M18 15l.8 2.2L21 18l-2.2.8L18 21l-.8-2.2L15 18l2.2-.8z%22/%3E%3C/svg%3E"); }
.nav button[data-view="brain"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z%22/%3E%3Cpath d=%22M5 17a3 3 0 0 1 3-3h11%22/%3E%3Cpath d=%22M9 8h6%22/%3E%3C/svg%3E"); }
.nav button[data-view="dna"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M7 3c0 6 10 6 10 12M17 3c0 6-10 6-10 12%22/%3E%3Cpath d=%22M8 7h8M8 17h8%22/%3E%3Cpath d=%22M7 21c0-3 2-4 5-4s5 1 5 4%22/%3E%3C/svg%3E"); }
.nav button[data-view="aiusage"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224%22 y=%224%22 width=%2216%22 height=%2216%22 rx=%222%22/%3E%3Cpath d=%22M9 9h6v6H9z%22/%3E%3Cpath d=%22M9 2v2M15 2v2M9 20v2M15 20v2M2 9h2M2 15h2M20 9h2M20 15h2%22/%3E%3C/svg%3E"); }
.ai-answer { white-space: pre-wrap; line-height: 1.7; }
.doc-text { white-space: pre-wrap; max-height: 24rem; overflow: auto; }
.nav button[data-view="workforce"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223%22/%3E%3Ccircle cx=%2217%22 cy=%2210%22 r=%222.4%22/%3E%3Cpath d=%22M3 20c0-3.5 2.7-6 6-6s6 2.5 6 6%22/%3E%3Cpath d=%22M15 20c.2-2.4 1.6-4 4-4.4%22/%3E%3C/svg%3E"); }
.ag-finding { border-top: 1px solid var(--line, #e5e7eb); padding-top: .6rem; margin-top: .6rem; }

.nav button[data-view="workflows"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%223%22 width=%226%22 height=%226%22 rx=%221%22/%3E%3Crect x=%2215%22 y=%2215%22 width=%226%22 height=%226%22 rx=%221%22/%3E%3Cpath d=%22M9 6h3a3 3 0 0 1 3 3v6%22/%3E%3C/svg%3E"); }
.ws-steps li { padding: 4px 0; border-bottom: 1px dashed var(--line, #e3e6ee); }
.ws-step.ws-approval { font-weight: 600; }
.ws-json { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* Release 15: Predict and the Digital Twin */
.nav button[data-view="predict"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 17l5-5 4 4 8-9%22/%3E%3Cpath d=%22M16 7h4v4%22/%3E%3C/svg%3E"); }
.nav button[data-view="twin"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%2212%22 r=%225.5%22/%3E%3Ccircle cx=%2215%22 cy=%2212%22 r=%225.5%22 stroke-dasharray=%222.2 2.2%22/%3E%3C/svg%3E"); }
/* .grid-3 already exists above and is reused */
.stat-row > div strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat-row { margin: .5rem 0 1rem; }
.chart-wrap { margin: .75rem 0 1rem; }
.chart { width: 100%; height: auto; max-height: 280px; display: block; }
.chart .ch-grid { stroke: var(--line-soft, #e6e9e2); stroke-width: 1; }
.chart .ch-zero { stroke: var(--muted, #5d6980); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ch-tick { fill: var(--muted, #5d6980); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .ch-line { stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ch-hist, .ch-key.ch-hist { stroke: var(--ink, #0d1736); fill: var(--ink, #0d1736); }
.chart .ch-fc, .ch-key.ch-fc { stroke: var(--accent, #2a3cb5); fill: var(--accent, #2a3cb5); }
.chart polyline.ch-fc { stroke-dasharray: 6 4; }
.chart .ch-worst, .ch-key.ch-worst { stroke: var(--bad, #8c1a2d); fill: var(--bad, #8c1a2d); }
.chart .ch-best, .ch-key.ch-best { stroke: var(--ok, #1d7a58); fill: var(--ok, #1d7a58); }
.chart polyline.ch-worst { stroke-dasharray: 2 4; }
.chart polyline.ch-best { stroke-dasharray: 10 4; }
.chart .ch-base, .ch-key.ch-base { stroke: var(--muted, #5d6980); fill: var(--muted, #5d6980); }
.chart polyline.ch-base { stroke-width: 1.4; }
.chart .ch-dot { stroke: none; }
.chart .ch-band { fill: var(--accent-soft, #e8ebfa); stroke: none; opacity: .85; }
.ch-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: .35rem 0 0; padding: 0; font-size: .85rem; color: var(--muted, #5d6980); }
.ch-key { display: inline-block; width: 18px; height: 0; border-top: 3px solid currentColor; vertical-align: middle; }
.ch-key.ch-hist { color: var(--ink, #0d1736); } .ch-key.ch-fc { color: var(--accent, #2a3cb5); border-top-style: dashed; } .ch-key.ch-worst { color: var(--bad, #8c1a2d); border-top-style: dotted; } .ch-key.ch-best { color: var(--ok, #1d7a58); border-top-style: dashed; } .ch-key.ch-base { color: var(--muted, #5d6980); border-top-width: 2px; }
.ch-key.ch-bandkey { height: 10px; border: 0; background: var(--accent-soft, #e8ebfa); outline: 1px solid var(--line, #d5d9d0); }
.case h3 { margin: 0 0 .35rem; font-size: .95rem; }
.case-worst { border-inline-start: 3px solid var(--bad, #8c1a2d); padding-inline-start: .75rem; }
.case-expected { border-inline-start: 3px solid var(--accent, #2a3cb5); padding-inline-start: .75rem; }
.case-best { border-inline-start: 3px solid var(--ok, #1d7a58); padding-inline-start: .75rem; }
.bar { display: inline-block; height: .7rem; border-radius: 3px; min-width: 2px; vertical-align: middle; }
.bar-neg { background: var(--bad, #8c1a2d); } .bar-pos { background: var(--ok, #1d7a58); }
.nav button[data-view="currencies"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 8h14l-3-3%22/%3E%3Cpath d=%22M20 16H6l3 3%22/%3E%3C/svg%3E"); }
.nav button[data-view="firm"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%227%22 width=%2218%22 height=%2213%22 rx=%222%22/%3E%3Cpath d=%22M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2%22/%3E%3Cpath d=%22M3 13h18%22/%3E%3C/svg%3E"); }
tr.selected td { background: rgba(37, 99, 235, 0.06); }
.nav button[data-view="portal"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1%22/%3E%3Cpath d=%22M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1%22/%3E%3C/svg%3E"); }
.nav button[data-view="sportal"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 7l9-4 9 4-9 4-9-4z%22/%3E%3Cpath d=%22M3 7v10l9 4 9-4V7%22/%3E%3Cpath d=%22M12 11v10%22/%3E%3C/svg%3E"); }
.nav button[data-view="market"], .nav button[data-view="pmarket"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 9l1-5h16l1 5%22/%3E%3Cpath d=%22M4 9v11h16V9%22/%3E%3Cpath d=%22M3 9a3 3 0 006 0 3 3 0 006 0 3 3 0 006 0%22/%3E%3C/svg%3E"); }

.nav button[data-view="mobile"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%226%22 y=%222.5%22 width=%2212%22 height=%2219%22 rx=%222.5%22/%3E%3Cpath d=%22M10.5 18.5h3%22/%3E%3C/svg%3E"); }
.pair-code { display: inline-block; font-size: 1.6rem; letter-spacing: .08em; padding: .3rem .6rem; margin: .25rem 0; border: 1px solid var(--line, #ccc); border-radius: 8px; user-select: all; }
.nav button[data-view="developers"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M8 7l-5 5 5 5%22/%3E%3Cpath d=%22M16 7l5 5-5 5%22/%3E%3Cpath d=%22M13.5 5l-3 14%22/%3E%3C/svg%3E"); }
.nav button[data-view="agent"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%224%22 width=%2218%22 height=%2216%22 rx=%222%22/%3E%3Cpath d=%22M3 9h18%22/%3E%3Cpath d=%22M9 14l2 2 4-4%22/%3E%3C/svg%3E"); }

.nav button[data-view="evidence"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z%22/%3E%3Cpath d=%22M14 3v5h5%22/%3E%3Cpath d=%22M9 13l2 2 4-4%22/%3E%3C/svg%3E"); }
.ev-excerpt { max-height: 14rem; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: .6rem .8rem; border: 1px solid var(--line, #ccc); border-radius: 8px; background: var(--sheet, #fff); font-size: .85rem; }
.field input.low { border-color: var(--warn-line, #e2c46d); background: var(--warn-bg, #fff8e1); }

/* ======================================================================
   ZakFin (Release 35): electric blue, Poppins, the ZAK robot. The workspace stays plain and calm;
   only the colours, the type and the sign-in and assistant screens change.
   ====================================================================== */
:root {
  --paper: #f3f6ff;
  --sheet: #ffffff;
  --ink: #0e1233;
  --text: #232a4a;
  --muted: #5a6285;
  --line: #dfe6fb;
  --line-soft: #e9eefc;
  --accent: #0b3cf5;
  --accent-soft: #e8eeff;
  --navy: #0e1233;
  --navy-2: #171c4a;
  --serif: var(--zf-sans, "Poppins", system-ui, sans-serif);
  --font: var(--zf-sans, "Poppins", "Segoe UI", system-ui, "Noto Sans Arabic", Tahoma, sans-serif);
}
.brand { text-transform: none; letter-spacing: -.02em; font-weight: 700; font-size: 1.3rem; }
.brand-lg { font-size: 1.7rem; }
.mark { width: 2.4em; height: 1.45em; }
.side .brand { letter-spacing: -.02em; }
.btn-primary, .btn.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0830cc; border-color: #0830cc; }
.side .nav button[aria-current="page"] { box-shadow: inset 3px 0 0 #7f9bff; }
[dir="rtl"] .side .nav button[aria-current="page"] { box-shadow: inset -3px 0 0 #7f9bff; }
.gate-tagline, .gate-lead, .gate-title { font-family: var(--font); font-weight: 700; letter-spacing: -.03em; }
[dir="rtl"] .gate-tagline, [dir="rtl"] .gate-lead { letter-spacing: 0; }

/* sign-in: a blue panel with ZAK */
.gate-brand { background: linear-gradient(150deg, #0b3cf5 0%, #1f4dff 55%, #3b63ff 100%); }
.gate-brand .rosette { display: none; }
.gate-brand .brand { color: #fff; }
.gate-zak { width: min(15rem, 60%); height: auto; align-self: center; filter: drop-shadow(0 18px 22px rgba(0, 0, 60, .35)); }
.gate-tagline { font-size: 2.6rem; line-height: 1.05; text-shadow: none; max-width: 22rem; }
.gate-sub-tag { margin: .9rem 0 0; color: rgba(255, 255, 255, .88); font-size: 1rem; max-width: 24rem; }
@media (max-width: 800px) { .gate-zak { width: 7rem; } .gate-tagline, [dir="rtl"] .gate-tagline { font-size: 1.7rem; } }

/* the ZAK assistant */
.zak-hello { display: flex; align-items: center; gap: 1rem; background: linear-gradient(110deg, #0b3cf5, #3b63ff); color: #fff; border-radius: 18px; padding: .9rem 1.3rem; margin-bottom: 1rem; }
.zak-hello img { width: 4rem; height: auto; flex: none; }
.zak-hello strong { font-size: 1.2rem; }
.zak-hello p { margin: .15rem 0 0; opacity: .92; font-size: .92rem; }
.ai-answer { background: var(--accent-soft); border-radius: 14px; padding: .8rem 1rem; }

.gate-brand .mark, .side .mark { filter: brightness(0) invert(1); }

/* simple menu (Release 37) */
.nav-more { font: inherit; cursor: pointer; margin: .2rem .35rem 0; padding: .55rem .8rem; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, .3); background: transparent; color: #dbe3f7; text-align: start; }
.nav-more:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Developer page (R38) */
.nav button[data-view="dev"] { --ic: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M8 7l-5 5 5 5M16 7l5 5-5 5M14 5l-4 14%22/%3E%3C/svg%3E"); }
.dev-text { padding: .7rem 0; border-top: 1px solid var(--line, rgba(14,18,51,.1)); display: grid; gap: .4rem; }
.dev-text:first-child { border-top: 0; }
.dev-text textarea { width: 100%; min-height: 0; resize: vertical; }
.dev-text .row { display: flex; gap: .5rem; }
.dev-text .row .btn { padding: .35rem .9rem; }
.dev-text .row-between { display: flex; justify-content: space-between; align-items: center; }
