/* Waverole admin — hq-8bcbe8e0/admin.css
   Hebrew / RTL, mobile-first. Brand palette + a selected dark variant.
   Chart series colors are validated (CVD + contrast) for both surfaces. */

:root {
  color-scheme: light;
  --bg: #F4F2EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --surface-3: #F1EEE9;
  --navy: #1B365D;
  --navy2: #64748B;
  --navy3: #A3B1C6;
  --brown: #C27A4E;
  --red: #B94B4B;
  --sand: #E6CBA8;
  --white: #FFFFFF;
  --border: #E8E4DC;
  --border-strong: #D8D2C7;

  --ink: #17293F;
  --ink-2: #435570;
  --muted: #6B7A90;

  --ok: #1F7A5C;
  --ok-bg: #E7F3EE;
  --ok-br: #BFDDD1;
  --warn: #93690F;
  --warn-bg: #FBF2DF;
  --warn-br: #E9D6AC;
  --danger: #A83E3E;
  --danger-bg: #F8EAEA;
  --danger-br: #EBC9C9;
  --info: #2E6BB0;
  --info-bg: #E9F0F8;
  --info-br: #C9DAEE;

  /* chart series (validated light, surface #FFFFFF) */
  --s1: #2E6BB0;
  --s2: #C9703A;
  --s3: #0E8C7E;
  --s4: #B08300;
  --s5: #8A6BB1;
  --s6: #B94B4B;
  --grid: #E8E4DC;
  --axis: #8A94A6;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-1: 0 1px 2px rgba(27, 54, 93, .06), 0 1px 3px rgba(27, 54, 93, .04);
  --shadow-2: 0 4px 16px rgba(27, 54, 93, .10);
  --shadow-3: 0 18px 48px rgba(27, 54, 93, .22);
  --nav-w: 248px;
  --gutter: 16px;
  --tabbar-h: 62px;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --display: 'Fredoka', 'Rubik', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1620;
    --surface: #182231;
    --surface-2: #1D2938;
    --surface-3: #22303F;
    --navy: #DCE7F4;
    --navy2: #93A6BF;
    --navy3: #5D6E86;
    --brown: #D9915F;
    --red: #DE7373;
    --sand: #E6CBA8;
    --white: #182231;
    --border: #2B3A4D;
    --border-strong: #3A4B61;

    --ink: #EAF1F9;
    --ink-2: #C0CEDF;
    --muted: #93A6BF;

    --ok: #56BE96;
    --ok-bg: #16302A;
    --ok-br: #2C5749;
    --warn: #DDAE4A;
    --warn-bg: #322816;
    --warn-br: #5A4A26;
    --danger: #E38181;
    --danger-bg: #331D1F;
    --danger-br: #5C3436;
    --info: #6FA6E0;
    --info-bg: #17263A;
    --info-br: #2E4767;

    /* chart series (validated dark, surface #182231) */
    --s1: #4A8ACF;
    --s2: #CE7B3F;
    --s3: #12957F;
    --s4: #B88A12;
    --s5: #9B7FC4;
    --s6: #D4605E;
    --grid: #2B3A4D;
    --axis: #7E8EA5;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .34);
    --shadow-2: 0 6px 18px rgba(0, 0, 0, .42);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, .56);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 .6em; }
a { color: var(--info); }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2.5px solid var(--info);
  outline-offset: 2px;
  border-radius: 6px;
}

.ic { width: 20px; height: 20px; flex: none; display: block; }
.ic-sm { width: 16px; height: 16px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; direction: ltr; unicode-bidi: isolate; }

/* ---------- boot ---------- */
.boot-root { min-height: 100vh; display: grid; place-items: center; }
.boot { text-align: center; padding: 32px; }
.boot-mark { font-family: var(--display); font-size: 30px; color: var(--navy); letter-spacing: .5px; }
.boot-bar { width: 180px; height: 5px; border-radius: 99px; background: var(--border); margin: 18px auto 12px; overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--brown); animation: bootslide 1.1s ease-in-out infinite; }
@keyframes bootslide { 0% { transform: translateX(150%); } 100% { transform: translateX(-150%); } }
.boot-txt { color: var(--muted); font-size: 14px; }

/* ---------- mock banner ---------- */
.mockbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 90;
  background: var(--red); color: #fff; text-align: center;
  font-size: 13px; font-weight: 600; padding: 5px 12px;
  letter-spacing: .2px;
}
body.has-mock { padding-top: 28px; }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; }

.sidenav {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--nav-w);
  background: var(--surface); border-inline-end: 1px solid var(--border);
  display: none; flex-direction: column; z-index: 40;
}
.sidenav .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
}
.brand-mark { font-family: var(--display); font-size: 22px; color: var(--navy); }
.brand-sub { font-size: 12px; color: var(--muted); }
.navlist { list-style: none; margin: 0; padding: 4px 10px 14px; overflow-y: auto; flex: 1; }
.navlist li { margin-bottom: 2px; }
.navlink {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: none; border: 0; cursor: pointer; text-align: start;
  color: var(--ink-2); font-size: 14.5px; text-decoration: none;
}
.navlink:hover { background: var(--surface-3); color: var(--ink); }
.navlink[aria-current="page"] { background: var(--navy); color: #fff; font-weight: 500; }
:root:not([data-theme="light"]) .navlink[aria-current="page"] { color: #0E1620; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .navlink[aria-current="page"] { background: var(--navy); color: #0E1620; } }
.navlink .ic { opacity: .9; }
.nav-foot { padding: 10px 14px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 8px;
}
body.has-mock .topbar { top: 28px; }
.topbar .tb-brand { font-family: var(--display); font-size: 19px; color: var(--navy); margin-inline-end: 2px; }
.searchwrap { position: relative; flex: 1; min-width: 0; }
.searchwrap .ic { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchwrap input {
  width: 100%; padding: 9px 36px 9px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.searchwrap input::placeholder { color: var(--navy3); }
.kbdhint { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--navy3); pointer-events: none; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--ink-2);
}
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }
.iconbtn.ghost { background: none; border-color: transparent; }

.avatarbtn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
  padding: 4px 10px 4px 4px; color: var(--ink-2);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--navy); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-size: 14px;
}
.avatarbtn .who { font-size: 13px; line-height: 1.1; text-align: start; }
.avatarbtn .who b { display: block; font-weight: 500; color: var(--ink); }
.avatarbtn .who span { color: var(--muted); font-size: 11.5px; }

main { padding: 16px var(--gutter) calc(var(--tabbar-h) + 28px); }
.page { max-width: 1180px; margin: 0 auto; }

.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; cursor: pointer; padding: 4px 2px;
  font-size: 11px; color: var(--muted); border-radius: 10px; min-height: 48px; justify-content: center;
}
.tabbar button[aria-current="page"] { color: var(--brown); font-weight: 600; }

@media (min-width: 900px) {
  :root { --gutter: 26px; }
  .sidenav { display: flex; }
  .tabbar { display: none; }
  .topbar, main { margin-inline-start: var(--nav-w); }
  .topbar .tb-brand, .topbar .tb-menu { display: none; }
  main { padding-bottom: 48px; }
}

/* ---------- page head ---------- */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 14px; }
.pagehead h1 { font-size: 23px; font-family: var(--display); font-weight: 500; color: var(--navy); }
.pagehead .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-inline-start: auto; }
.pagehead .sub { width: 100%; color: var(--muted); font-size: 13.5px; margin-top: -4px; }

/* ---------- controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 6px 12px; border-radius: 99px; font-size: 13.5px; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--white); font-weight: 500; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { color: #0E1620; } }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .18s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2.5px; inset-inline-start: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-1); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(-17px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--info); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  min-height: 40px; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0E1620; } }
.btn-primary:hover { filter: brightness(1.08); background: var(--navy); }
.btn-accent { background: var(--brown); border-color: var(--brown); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); background: var(--brown); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-br); color: var(--danger); }
.btn-ghost { background: none; border-color: transparent; }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 12px; }
.field > span.lbl { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.field .help { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 9px 11px; border-radius: 11px; min-height: 40px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.inp:disabled { background: var(--surface-3); color: var(--muted); }
textarea.inp { min-height: 76px; resize: vertical; }
.inp-sm { padding: 5px 8px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.inp-num { direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--ink-2);
}
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); display: flex; padding: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500; border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-br); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-br); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-br); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-br); }
.badge-neutral { background: var(--surface-3); color: var(--ink-2); border-color: var(--border); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1);
  margin-bottom: 14px;
}
.card > h2, .card > .card-h h2 { font-size: 16px; color: var(--navy); }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-h .spacer { margin-inline-start: auto; }
.card-h p { margin: 0; font-size: 12.5px; color: var(--muted); width: 100%; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 13px; box-shadow: var(--shadow-1); text-align: start;
  display: flex; flex-direction: column; gap: 3px; min-height: 104px;
}
.tile-link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tile-link:hover { border-color: var(--navy3); box-shadow: var(--shadow-2); }
.kpi.kpi-danger { border-inline-start: 3px solid var(--red); }
.kpi.kpi-danger .k-val:not(.empty) { color: var(--red); }
.kpi.kpi-ok { border-inline-start: 3px solid var(--ok); }
.kpi.kpi-ok .k-val:not(.empty) { color: var(--ok); }
.kpi.kpi-warn { border-inline-start: 3px solid var(--warn); }
/* the figure a block is read for (net income, everything out) */
.kpi.kpi-accent { border-color: var(--sand); background: color-mix(in srgb, var(--sand) 22%, var(--surface)); }
.card > .kpis { margin-bottom: 0; }
.kpi .k-lbl { font-size: 12.5px; color: var(--muted); }
.kpi .k-val { font-family: var(--display); font-size: 27px; font-weight: 500; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
.kpi .k-val.empty { font-family: var(--font); font-size: 14px; color: var(--navy3); direction: rtl; }
.kpi .k-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.delta-note { font-size: 11.5px; color: var(--navy3); }

/* ---------- charts ---------- */
.chartbox { position: relative; }
.chartbox svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend button.lg { background: none; border: 0; cursor: pointer; padding: 0; }
.legend button.lg[aria-pressed="false"] { opacity: .42; }
.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-2); padding: 8px 10px; font-size: 12.5px; min-width: 128px;
  transform: translate(-50%, -112%); transition: opacity .1s;
}
.tip .t-h { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.tip .t-r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip .t-r .nm { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.tip .t-r .vl { font-variant-numeric: tabular-nums; direction: ltr; }
.barlist { display: flex; flex-direction: column; gap: 9px; }
.barrow { display: grid; grid-template-columns: minmax(74px, 34%) 1fr auto; gap: 9px; align-items: center; font-size: 13px; }
.barrow .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .track { background: var(--surface-3); border-radius: 6px; height: 12px; overflow: hidden; }
.barrow .fill { height: 100%; border-radius: 0 6px 6px 0; background: var(--s1); }
.barrow .vl { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; min-width: 42px; text-align: start; direction: ltr; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 9px 10px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl th {
  font-weight: 500; color: var(--muted); font-size: 12.5px; white-space: nowrap;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
table.tbl th button { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
table.tbl th button[data-dir] { color: var(--ink); font-weight: 600; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.num, table.tbl th.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
table.tbl tfoot td { font-weight: 600; border-top: 2px solid var(--border); border-bottom: 0; }
.rowactions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 721px) {
  /* wide tables scroll inside their card instead of squeezing cells into tall wraps */
  table.tbl { min-width: min(880px, 100%); }
  table.tbl td .rowactions, table.tbl td .hstack { flex-wrap: nowrap; }
  table.tbl td .rowactions > * { flex: none; }
  table.tbl td:last-child, table.tbl th:last-child { white-space: nowrap; width: 1%; }
  .btn-txt { display: none; }
  table.tbl th, table.tbl td { padding: 8px 7px; }
  table.tbl td .btn-sm { padding: 4px 7px; }
}

@media (max-width: 720px) {
  .tablewrap { overflow-x: visible; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl thead { display: none; }
  table.tbl tr {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 9px; padding: 8px 10px; background: var(--surface-2);
  }
  table.tbl td { border: 0; padding: 4px 0; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
  table.tbl td::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; flex: none;
    max-width: 46%;
  }
  table.tbl td.cellwide { display: block; }
  table.tbl td.cellwide::before { display: block; margin-bottom: 3px; }
  table.tbl tfoot { display: block; }
  table.tbl tfoot td { background: var(--surface-3); }
}

/* ---------- states ---------- */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 260% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-line { height: 12px; margin-bottom: 8px; }
.skel-kpi { height: 104px; border-radius: var(--radius); }
.skel-chart { height: 220px; border-radius: var(--radius); }

.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
  margin-bottom: 12px; font-size: 13.5px;
}
.banner .ic { margin-top: 1px; }
.banner .bd { flex: 1; min-width: 0; }
.banner b { display: block; }
.banner-err { background: var(--danger-bg); border-color: var(--danger-br); color: var(--danger); }
.banner-warn { background: var(--warn-bg); border-color: var(--warn-br); color: var(--warn); }
.banner-info { background: var(--info-bg); border-color: var(--info-br); color: var(--info); }
.banner-ok { background: var(--ok-bg); border-color: var(--ok-br); color: var(--ok); }

.empty { text-align: center; padding: 26px 14px; color: var(--muted); font-size: 14px; }
.empty .ic { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--navy3); }
.nodata { color: var(--navy3); font-size: 13px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; inset-inline-start: 16px; bottom: calc(var(--tabbar-h) + 14px); z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
@media (min-width: 900px) { .toasts { bottom: 18px; } }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--navy2);
  border-radius: 12px; box-shadow: var(--shadow-2); padding: 10px 12px; font-size: 13.5px;
  animation: toastin .18s ease-out;
}
.toast.ok { border-inline-start-color: var(--ok); }
.toast.err { border-inline-start-color: var(--danger); }
.toast.warn { border-inline-start-color: var(--warn); }
.toast b { display: block; }
.toast .tx { color: var(--ink-2); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- layers: modal / drawer / sheet ---------- */
.layers:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 34, .46); z-index: 100; animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } }

.modal {
  position: fixed; z-index: 101; inset-inline: 0; bottom: 0; top: auto;
  background: var(--surface); border-radius: 20px 20px 0 0;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-3); animation: sheetup .22s ease-out;
}
@media (min-width: 720px) {
  .modal {
    inset: 0; margin: auto; height: fit-content;
    width: min(620px, calc(100vw - 48px)); border-radius: 18px; max-height: 88vh;
    animation: pop .16s ease-out;
  }
  .modal.wide { width: min(880px, calc(100vw - 48px)); }
}
@keyframes sheetup { from { transform: translateY(20px); opacity: .6; } }
@keyframes pop { from { transform: scale(.97); opacity: .5; } }

.drawer {
  position: fixed; z-index: 101; inset-block: 0; inset-inline-end: 0;
  width: min(560px, 100vw); background: var(--surface);
  display: flex; flex-direction: column; box-shadow: var(--shadow-3);
  animation: drawin .2s ease-out; border-inline-start: 1px solid var(--border);
}
@keyframes drawin { from { transform: translateX(-24px); opacity: .5; } }
:root[dir="rtl"] .drawer { animation-name: drawin; }

.lay-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.lay-h h2 { font-size: 17px; color: var(--navy); flex: 1; min-width: 0; }
.lay-b { padding: 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.lay-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.lay-f .spacer { margin-inline-start: auto; }

.menu {
  position: fixed; z-index: 101; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; min-width: 210px;
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: start;
  background: none; border: 0; cursor: pointer; padding: 9px 10px; border-radius: 9px;
  font-size: 14px; color: var(--ink); text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu .sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu .hdr { padding: 8px 10px 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- auth screens ---------- */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); }
.authcard {
  width: min(430px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-2); padding: 24px;
}
.authcard .mark { font-family: var(--display); font-size: 26px; color: var(--navy); text-align: center; }
.authcard .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.codeinp {
  letter-spacing: .5em; text-align: center; font-size: 22px; direction: ltr;
  font-variant-numeric: tabular-nums; padding: 12px; font-family: var(--display);
}
.qrbox { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--border); margin: 0 auto 12px; width: fit-content; }
.qrbox img, .qrbox canvas, .qrbox table { display: block; }
.qrbox svg { display: block; width: 184px; height: 184px; }
.secretbox {
  display: flex; align-items: center; gap: 8px; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 12px;
}
.secretbox code { flex: 1; word-break: break-all; font-size: 13px; direction: ltr; text-align: start; }
.backupcodes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0;
  font-family: ui-monospace, Menlo, monospace; font-size: 15px; direction: ltr;
}
.backupcodes span { background: var(--surface-3); border: 1px solid var(--border); border-radius: 9px; padding: 8px; text-align: center; }
.strength { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.strength i { display: block; height: 100%; border-radius: 99px; transition: width .2s; }

/* ---------- misc blocks ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; align-items: baseline; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); text-align: start; }
/* an LTR value (id, email, code) still hugs its Hebrew label on the right */
.kv dd.mono, .kv dd[dir="ltr"] { text-align: right; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 20px 14px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: auto; inset-inline-end: 4px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--brown); }
.timeline li::after { content: ""; position: absolute; inset-inline-end: 8px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t { font-size: 12px; color: var(--muted); }
.timeline .l { font-size: 13.5px; }
.timeline .d { font-size: 12.5px; color: var(--ink-2); }

.section-t { font-size: 13px; color: var(--muted); font-weight: 500; margin: 16px 0 8px; }
.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.wrapany { overflow-wrap: anywhere; }
.selcount { font-size: 13px; color: var(--ink-2); }
.resgroup { margin-bottom: 14px; }
.resgroup h3 { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.reslist { list-style: none; margin: 0; padding: 0; }
.reslist button {
  width: 100%; text-align: start; background: none; border: 1px solid transparent;
  border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; gap: 10px; align-items: center;
}
.reslist button:hover, .reslist button.hi { background: var(--surface-3); border-color: var(--border); }
.reslist .t { font-size: 14px; }
.reslist .s { font-size: 12px; color: var(--muted); }

.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 11px; }
.stat .s-l { font-size: 12px; color: var(--muted); }
.stat .s-v { font-family: var(--display); font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; direction: ltr; }
.stat .s-v.empty { font-family: var(--font); font-size: 13.5px; color: var(--navy3); direction: rtl; }
.stat.accent { border-color: var(--sand); background: color-mix(in srgb, var(--sand) 22%, var(--surface)); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }
.dot.off { background: var(--navy3); }

.stale { color: var(--danger); font-weight: 600; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.jsonlist { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.jsonlist li { display: flex; gap: 10px; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.jsonlist li:last-child { border-bottom: 0; }
.jsonlist .k { color: var(--muted); }
.jsonlist .v { font-variant-numeric: tabular-nums; direction: ltr; text-align: start; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; border-bottom: 2.5px solid transparent; cursor: pointer;
  padding: 8px 11px; font-size: 14px; color: var(--muted); white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--brown); font-weight: 500; }
.tabs .cnt { font-size: 12px; color: var(--muted); }

.expander { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2); }
.expander > summary { cursor: pointer; padding: 10px 12px; font-size: 13.5px; list-style: none; display: flex; gap: 10px; align-items: center; }
.expander > summary::-webkit-details-marker { display: none; }
.expander > div { padding: 0 12px 12px; }

.scorebar { display: grid; grid-template-columns: 82px 1fr 34px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.scorebar .track { height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.scorebar .fill { height: 100%; background: var(--s3); border-radius: 0 6px 6px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- phone overrides (last, so they win over the component defaults) ---------- */
@media (max-width: 899px) {
  .kbdhint { display: none; }
  .avatarbtn .who { display: none; }
  .avatarbtn { padding: 4px; }
  .kpis { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  .kpi { min-height: 92px; }
  .kpi .k-val { font-size: 24px; }
  .statgrid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* ---------- soft refresh of a screen's body (a filter or a search box changed) ---------- */
.is-loading { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* ---------- surveys: the two composite scores, and the per-package rows ---------- */
.svgroup { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.svgroup .svhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.svgroup .svlabel { font-weight: 800; color: var(--navy); font-size: 14.5px; }
.svgroup .svscore { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; direction: ltr; }
.svgroup .svscore.empty { font-family: var(--font); font-size: 13px; color: var(--muted); }
.svgroup .scorebar { grid-template-columns: 96px 1fr 34px; }
.svname { display: inline-flex; flex-direction: column; gap: 2px; min-width: 120px; }
.svpair { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pkgrow > summary { flex-wrap: wrap; }
.pkgrow > summary .svn { margin-inline-start: auto; }
.pkgrow > div .tablewrap { margin-top: 6px; }
@media (max-width: 640px) { .svgroups { grid-template-columns: 1fr; } }

/* a button that reads as a link (an order id inside a table cell) */
.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; }
.linklike:hover { color: var(--ink); }

/* ---------- customers (app accounts): avatars, list cell, drawer head ---------- */
.cavatar { position: relative; display: inline-block; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-3); box-shadow: 0 0 0 1px var(--border); vertical-align: middle; }
.cavatar svg { display: block; width: 100%; height: 100%; }
.cavatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cavatar .cav-init { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ink-2); font-weight: 600; }
.cust-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cust-cell b { font-weight: 500; overflow-wrap: anywhere; }
.cust-head { display: flex; align-items: center; gap: 14px; }
.cust-head .cust-name { font-size: 17px; color: var(--navy); font-weight: 600; overflow-wrap: anywhere; }
.cust-mix { align-items: center; margin: -4px 0 14px; }
.cust-settings { margin-bottom: 14px; background: var(--surface); }
.cust-settings > summary b { font-weight: 500; }
.cust-settings > div > div:last-child { border-bottom: 0 !important; }
@media (max-width: 720px) {
  table.tbl td.cellwide .cust-cell { margin-top: 2px; }
  .cust-head { align-items: flex-start; }
}
/* eight counters: two even rows of four, two columns on a phone */
.kpis.cust-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .kpis.cust-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .kpis.cust-kpis .kpi { min-height: 76px; }
  .kpis.cust-kpis .kpi .k-val { font-size: 22px; }
}
/* a word or a date inside a stat tile (the generic .empty carries an empty state's padding) */
.stat .s-v.cust-txt { font-family: var(--font); font-size: 14px; color: var(--ink-2); direction: rtl; margin-top: 4px; }
/* a list address stays on one line on a wide screen (the table scrolls instead) */
@media (min-width: 721px) { table.tbl .cust-mail { white-space: nowrap; } }
/* drawer: a value and its copy button stay side by side; the value breaks
   inside itself on a narrow screen instead of pushing the button down */
.cust-ddrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.cust-copy { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.cust-copy > span { min-width: 0; }
.cust-copy > .btn { flex: none; }
@media (max-width: 480px) { .cust-copy > .mono { font-size: .84em; } }

/* order drawer: מסמכים */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: 0; }

/* ---------- network tab (SCREENS.net) ---------- */
/* a fingerprint is read off another screen character by character, so it is
   big, monospace, LTR and split into its groups of four; the last group (the
   one the owner types) stands out */
.netfp { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-start; margin: 6px 0; }
.netfp span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 3px 7px;
}
.netfp-big span { font-size: 19px; padding: 5px 9px; }
.netfp span.last { border-color: var(--navy); color: var(--navy); font-weight: 700; }
.netprob { list-style: none; margin: 6px 0 0; padding: 0; }
.netprob li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; color: var(--ink); }
.netjoin { padding: 10px 0; border-bottom: 1px solid var(--border); }
.netjoin:last-of-type { border-bottom: 0; }
.netapprove { flex-wrap: wrap; gap: 8px; }
.netapprove .btn { flex: none; min-height: 44px; }
.net-fpfull {
  flex: 1 1 15em; min-width: 0; max-width: 100%; min-height: 44px; text-align: center; font-size: 17px; letter-spacing: .06em;
  text-transform: uppercase; direction: ltr;
}
.netpk { padding-top: 4px; }
.netnodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.netnode { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.netnode .kv { font-size: 12.5px; }
/* the main: a navy edge, so the eye finds it first in the grid */
.netnode-main { border-color: var(--navy3); border-inline-start: 3px solid var(--navy); }
.netlease .kv { margin-top: 8px; }
/* who reaches whom: one row per computer, its peers as chips that wrap */
.netreach { list-style: none; margin: 0; padding: 0; }
.netreach li { padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; gap: 4px; min-width: 0; }
.netreach li:last-child { border-bottom: 0; }
.netchip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; max-width: 100%; }
.netchip bdi { overflow: hidden; text-overflow: ellipsis; }
/* the events timeline */
.netevents { list-style: none; margin: 0; padding: 0; }
.netevents li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.netevents li:last-child { border-bottom: 0; }
.netevents li > div { min-width: 0; overflow-wrap: anywhere; }
.netalarms { list-style: none; margin: 0; padding: 0; }
.netalarms li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.netalarms li:last-child { border-bottom: 0; }
.netmeter { margin-bottom: 10px; font-size: 13.5px; }
.netbar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.netbar i { display: block; height: 100%; border-radius: 6px; background: var(--navy3); }
.netbar.ok i { background: var(--ok); }
.netbar.warn i { background: var(--warn); }
.netbar.bad i { background: var(--danger); }
@media (max-width: 560px) {
  .netnodes { grid-template-columns: 1fr; }
  .netfp-big span { font-size: 17px; padding: 5px 7px; }
}
/* long status pills wrap inside their card instead of widening the page */
.netpage .badge { white-space: normal; text-align: start; }
.netpage bdi { white-space: nowrap; }

/* ---------- network tab, v3.1: signed updates, emergency stop, release pins ---------- */
/* "new version X ready": an amber edge, the version jump big enough to read
   at arm's length, the notes as plain text, one full-width Face ID button */
.netrel { border-color: var(--warn-br); border-inline-start: 3px solid var(--warn); }
.netrel-ver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 22px; margin: 2px 0 10px; }
.netrel-ver bdi { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.netrel-new { font-weight: 700; color: var(--navy); }
.netrel-arrow { color: var(--muted); }
.netrel-notes {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 8px 10px;
}
.netrel-go { margin-top: 14px; }
.netrel-btn { width: 100%; min-height: 50px; font-size: 16px; white-space: normal; }
/* the file table: a sign column, the path (it wraps: a phone is narrow), size + hash under it */
.netfiles { list-style: none; margin: 0; padding: 0; }
.netfiles li { display: grid; grid-template-columns: 1.3em minmax(0, 1fr); gap: 1px 6px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.netfiles li:last-child { border-bottom: 0; }
.netfile-sign { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; text-align: center; }
.netpage bdi.netfile-p { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.netfile-meta { grid-column: 2; }
.netfile-add .netfile-sign { color: var(--ok); }
.netfile-chg .netfile-sign { color: var(--warn); }
.netfile-del .netfile-sign { color: var(--danger); }
.netfile-del .netfile-p { text-decoration: line-through; color: var(--muted); }
/* the rollout: one row per computer */
.netroll { list-style: none; margin: 0 0 8px; padding: 0; }
.netroll li { display: grid; gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.netroll li:last-child { border-bottom: 0; }
/* the emergency stop: a red button that is easy to hit and hard to mistake */
.netstop-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.netstop-btn, .netstop .btn { min-height: 44px; }
/* the release pins: now vs. proposed, side by side (stacked on a phone) */
.netpins-bad { border-color: var(--danger-br); border-inline-start: 3px solid var(--danger); }
.netpins-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.netpins-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
.netpins .btn { min-height: 44px; }
@media (max-width: 560px) {
  .netpins-cmp { grid-template-columns: 1fr; }
  .netrel-ver { font-size: 19px; }
}
