/* Globalex Monitor — one stylesheet for the app and the wallboard.
   Plain operations-tool look: neutral surfaces, one accent, colour only for state. */

:root {
  --font: "Segoe UI", "Rubik", "Assistant", "Heebo", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --bg: #f3f4f2;
  --surface: #ffffff;
  --surface-2: #f7f8f6;
  --border: #d6dad5;
  --border-strong: #b9bfb8;
  --text: #1b2320;
  --muted: #59635f;
  --accent: #0e5b59;
  --accent-hover: #0a4644;
  --accent-soft: #e3efee;
  --focus: #1d6fd6;

  --idle: #1d7a3e;      --idle-bg: #e4f3e8;
  --ringing: #8f5a00;   --ringing-bg: #fdf1d8;
  --busy: #1c5ea6;      --busy-bg: #e4eefa;
  --hold: #6a3d9e;      --hold-bg: #efe8f8;
  --offline: #5f6670;   --offline-bg: #eceef0;
  --paused: #a2480b;    --paused-bg: #fbe9dc;
  --unknown: #5f6670;   --unknown-bg: #f1f2f3;

  --warn: #8f5a00;      --warn-bg: #fff3d6;
  --crit: #b42318;      --crit-bg: #fde7e4;
  --ok: #1d7a3e;        --ok-bg: #e4f3e8;

  /* charts (validated: light #1a7fa8 / #cc4f33, dark #3d9fd0 / #e2603f) */
  --ser-ans: #1a7fa8;
  --ser-ab: #cc4f33;
  --ser-join: #3b4542;
  --ser-3: #3b8f5a;
  --ser-4: #8a63b8;
  --ser-5: #b07d12;
  --spark: #7a8682;
  --grid: #e6e9e7;
  --track: #e4e8e6;
  --now-band: #eef4f3;
  --hover-band: rgba(27, 35, 32, .05);
  --zone-ok: #a9cfcc;  --zone-warn: #efd18a;  --zone-crit: #eeb0a8;
  --val-ok: #0e5b59;   --val-warn: #c48508;   --val-crit: #c4321f;
  /* q37: every colour a theme changes is a token */
  --on-accent: #ffffff; --on-crit: #ffffff; --seg-n-on: #d7ebe9;
  --ok-line: #b8dcc3;   --ok-text: #134f29;
  --crit-line: #efbdb6; --crit-text: #8a1a12; --danger-line: #e3b1ab;
  --info-line: #bcd8d6; --info-text: #0b3f3e;
  --warn-line: #f0d9a4; --tag-line: #b7d3d1;
  --row-hover: #fafbf9;
  --shadow: rgba(0, 0, 0, .18); --shadow-soft: rgba(0, 0, 0, .12); --backdrop: rgba(20, 26, 24, .45);
  --hm1: #e3eff4; --hm2: #c3dde9; --hm3: #93c2d8; --hm4: #2f7a9e; --hm5: #165f82; --hm-on: #ffffff;
  --grid-head: #f3f5f8; --grid-na: #fafbfc; --grid-text: #1f2937;

  --radius: 4px;
  --gap: 16px;
  --row-h: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
html[lang="he"] h3 { text-transform: none; letter-spacing: 0; font-size: 13px; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 12px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.num {
  unicode-bidi: isolate;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.muted { color: var(--muted); }
.sub { font-size: 12px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.boot { padding: 24px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; inset-inline-start: 8px; top: -40px; z-index: 10;
  background: var(--surface); padding: 6px 10px; border: 1px solid var(--border);
}
.skip:focus { top: 8px; }

/* ---------------------------------------------------------------- buttons, fields */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--crit); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--crit-bg); }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 4px; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 6px 0; min-height: 0; margin-top: 8px; text-decoration: underline; }
.btn-link:hover { background: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 13px; }
.field input, .field select {
  min-height: 34px; padding: 5px 9px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--crit); }
.field input[dir="ltr"] { text-align: left; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--crit); min-height: 0; }
.field-error:empty { display: none; }
.field-check { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-check input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }
.field-check label { font-weight: 400; }
.field-check .field-error { flex-basis: 100%; }
.code-input { font-family: var(--mono); font-size: 18px; letter-spacing: .2em; text-align: center !important; }

.form-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.form-row .field { flex: 1 1 200px; margin-bottom: 0; }
.form-row .field-btn { flex: 0 0 auto; padding-top: 23px; }
.form-narrow { max-width: 460px; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 12px; }
legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px; }
.perm-list .field { margin-bottom: 4px; }

.notice { padding: 8px 12px; border-radius: var(--radius); border: 1px solid; margin: 8px 0; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.notice-error { background: var(--crit-bg); border-color: var(--crit-line); color: var(--crit-text); }
.notice-info { background: var(--accent-soft); border-color: var(--info-line); color: var(--info-text); }

.secret { margin: 10px 0; }
.secret label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-input {
  flex: 1; min-width: 0; min-height: 34px; padding: 5px 9px; font-family: var(--mono); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); text-align: left;
}
.copy-status { font-size: 12px; color: var(--ok); min-width: 4em; }

/* ---------------------------------------------------------------- dialog */

.dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0;
  width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text);
  box-shadow: 0 8px 28px var(--shadow);
}
.dialog-wide { width: min(680px, calc(100vw - 32px)); }
.dialog-wide:has(.pf) { width: min(960px, calc(100vw - 32px)); }
.dialog::backdrop { background: var(--backdrop); }
.dialog-form { padding: 18px 20px 16px; max-height: calc(100vh - 64px); overflow: auto; }
.dialog-title { font-size: 17px; margin-bottom: 14px; }
.dialog-error { color: var(--crit); margin: 4px 0; }
.dialog-error:empty { display: none; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- shell */

.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.tb-brand { font-weight: 700; color: var(--accent); font-size: 15px; white-space: nowrap; }
.tb-tenant { font-weight: 600; }
.tb-tenant select { min-height: 30px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); max-width: 260px; }
.tb-spacer { flex: 1; }
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.lang-btn { background: var(--surface); border: 0; padding: 4px 10px; cursor: pointer; min-height: 28px; }
.lang-btn + .lang-btn { border-inline-start: 1px solid var(--border-strong); }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tb-user { display: flex; flex-direction: column; line-height: 1.2; }
.tb-name { font-weight: 600; }
.tb-role { font-size: 12px; color: var(--muted); }

.nav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 12px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  display: block; padding: 9px 12px; color: var(--muted); text-decoration: none; font-weight: 600;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.demo-band { padding: 6px 20px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-weight: 600; }

.page { padding: 18px 20px 40px; max-width: 1680px; margin: 0 auto; }
.page:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .intro { color: var(--muted); margin: 4px 0 0; max-width: 760px; }
.page-actions { display: flex; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 16px; margin-bottom: 16px; }
.card-pad h2 { margin-bottom: 6px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.card-body { padding: 10px 14px; }
.card-foot { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.empty { color: var(--muted); margin: 6px 0; }
.card-empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; }

/* ---------------------------------------------------------------- tables */

.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 7px 12px; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--border); }
.tbl thead th { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl .n { text-align: end; white-space: nowrap; }
.tbl .actions { text-align: end; white-space: nowrap; }
.tbl-compact th, .tbl-compact td { padding: 4px 8px; }
.tbl-compact thead th { background: transparent; border-bottom: 1px solid var(--border-strong); }
.row-dim td { color: var(--muted); }
.perm-cell { max-width: 320px; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- chips, badges */

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 3px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
/* q33: the state glyph (live.js STATE_ICON) - the state reads without colour */
.chip .st-ico { width: 13px; height: 13px; }
.lane-title .st-ico { width: 17px; height: 17px; }
.lane-title.st-idle .st-ico { color: var(--idle); }
.lane-title.st-ringing .st-ico { color: var(--ringing); }
.lane-title.st-busy .st-ico { color: var(--busy); }
.lane-title.st-hold .st-ico { color: var(--hold); }
.lane-title.st-paused .st-ico { color: var(--paused); }
.lane-title.st-offline .st-ico, .lane-title.st-unknown .st-ico { color: var(--offline); }
.st-idle    .dot, .chip.st-idle    { color: var(--idle); }
.chip.st-idle    { background: var(--idle-bg); }
.chip.st-ringing { color: var(--ringing); background: var(--ringing-bg); }
.chip.st-busy    { color: var(--busy); background: var(--busy-bg); }
.chip.st-hold    { color: var(--hold); background: var(--hold-bg); }
.chip.st-offline { color: var(--offline); background: var(--offline-bg); }
.chip.st-paused  { color: var(--paused); background: var(--paused-bg); }
.chip.st-unknown { color: var(--unknown); background: var(--unknown-bg); border-color: var(--border); }

.badge { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-paused { background: var(--paused-bg); color: var(--paused); margin-inline-start: 6px; }
.state-cell { white-space: nowrap; }

/* ---------------------------------------------------------------- live: shared */

.live-status { color: var(--muted); font-size: 13px; }
.live-status.is-bad { color: var(--warn); font-weight: 600; }
.page-head-live { align-items: center; }
.page-head-live h1 { margin-inline-end: 8px; }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.seg-btn {
  border: 0; background: none; padding: 4px 12px; min-height: 30px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.seg-btn + .seg-btn { border-inline-start: 1px solid var(--border); }
.seg-btn:hover { color: var(--text); background: var(--surface-2); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg-btn[aria-pressed="true"] .seg-n { color: var(--seg-n-on); }
.seg-n { font-weight: 400; color: var(--muted); }

.view { display: flex; flex-direction: column; gap: var(--gap); }
.view-manager { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.view-main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.view-side { display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 12px; }

.empty { color: var(--muted); margin: 6px 0; }
.kv { white-space: nowrap; }
.kv .k { color: var(--muted); margin-inline-end: 6px; }
.kv .v, .kv > .num { font-weight: 600; }
.kv.lvl-warn > .num { color: var(--warn); }
.kv.lvl-crit > .num, .kv.lvl-crit .v { color: var(--crit); }
.q-num { color: var(--muted); font-weight: 400; font-size: .82em; }
.tag { display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-radius: 3px; font-size: 12px; color: var(--muted); }
.tag-static { margin-inline-start: 6px; color: var(--text); border-color: var(--border-strong); background: var(--surface-2); font-weight: 600; vertical-align: middle; cursor: help; }
.today { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; }

/* ---------------------------------------------------------------- gauges */

.instruments {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(190px, 1.1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.instruments > * + * { border-inline-start: 1px solid var(--border); }
.gauge { margin: 0; padding: 12px 14px 12px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.gauge-label { align-self: stretch; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.g-svg { width: 100%; max-width: 200px; height: auto; display: block; overflow: visible; }
.gauge-sub { font-size: 12px; color: var(--muted); text-align: center; margin-top: 2px; line-height: 1.35; }
.g-track { fill: none; stroke: var(--track); stroke-width: 14; }
.g-zone { fill: none; stroke-width: 4; }
.g-zone-ok { stroke: var(--zone-ok); }
.g-zone-warn { stroke: var(--zone-warn); }
.g-zone-crit { stroke: var(--zone-crit); }
.g-tick { stroke: var(--muted); stroke-width: 1.25; }
.g-target { stroke: var(--text); stroke-width: 2.5; }
.g-value { fill: none; stroke-width: 14; }
.g-lvl-ok { stroke: var(--val-ok); }
.g-lvl-warn { stroke: var(--val-warn); }
.g-lvl-crit { stroke: var(--val-crit); }
.g-figure { font-family: var(--font); font-size: 36px; font-weight: 650; fill: var(--text); }
.g-fig-warn { fill: var(--warn); }
.g-fig-crit { fill: var(--crit); }
.g-unit { font-family: var(--font); font-size: 13px; fill: var(--muted); }
.g-end { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.gauge-sm { padding: 0; width: 112px; flex: none; }
.gauge-sm .g-svg { max-width: 112px; }
.gauge-sm .g-figure { font-size: 40px; }
.gauge-sm .g-end { display: none; }

.bignums { display: grid; grid-auto-rows: 1fr; }
.bignum { padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; }
.bignums .bignum + .bignum { border-top: 1px solid var(--border); }
.bignum-label { font-size: 13px; font-weight: 600; }
.bignum-value { font-size: 44px; font-weight: 650; line-height: 1.1; }
.bignum-value .num { font-variant-numeric: normal; }
.bignum.lvl-warn { background: var(--warn-bg); }
.bignum.lvl-warn .bignum-value { color: var(--warn); }
.bignum.lvl-crit { background: var(--crit-bg); }
.bignum.lvl-crit .bignum-value { color: var(--crit); }

/* ---------------------------------------------------------------- hourly chart */

.card-head .today-totals { font-size: 13px; }
.hchart { position: relative; }
.h-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.h-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.h-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.h-key-ans { background: var(--ser-ans); }
.h-key-ab { background: var(--ser-ab); }
.h-key-join { background: var(--ser-join); height: 2px; width: 14px; border-radius: 1px; }
.h-key-none { background: none; }
.h-plot { position: relative; direction: ltr; }
.h-svg { width: 100%; height: auto; display: block; }
.h-now { fill: var(--now-band); }
.h-grid { stroke: var(--grid); stroke-width: 1; }
.h-base { stroke: var(--border-strong); stroke-width: 1; }
.h-ytick, .h-xtick { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.h-xtick-now { fill: var(--text); font-weight: 600; }
.h-ans { fill: var(--ser-ans); }
.h-ab { fill: var(--ser-ab); }
.h-join { fill: none; stroke: var(--ser-join); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.h-join-dot { fill: var(--ser-join); stroke: var(--surface); stroke-width: 2; }
.h-hit { fill: transparent; cursor: default; }
.h-hit.is-hover { fill: var(--hover-band); }
.h-hit:focus { outline: none; }
.h-hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.h-tip {
  position: absolute; top: 0; transform: translateX(-50%); min-width: 170px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 8px 10px; box-shadow: 0 4px 14px var(--shadow-soft); font-size: 13px; z-index: 2;
}
html[dir="rtl"] .h-tip { direction: rtl; }
.h-tip-title { font-weight: 600; margin-bottom: 4px; }
.h-tip-row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 6px; }
.h-tip-v { font-weight: 600; }
.h-table { margin-top: 6px; font-size: 13px; }
.h-table summary { cursor: pointer; color: var(--accent); width: max-content; }
.h-table table { margin-top: 6px; max-width: 520px; }

/* ---------------------------------------------------------------- queue cards (manager) */

.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gap); }
.qcard { display: flex; flex-direction: column; }
.qcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 4px; }
.qcard-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; text-transform: none; letter-spacing: 0; }
html[lang="he"] .qcard-title { font-size: 16px; }
.qcard-body { display: flex; align-items: center; gap: 12px; padding: 4px 14px 8px; }
.qstats { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, .8fr); gap: 6px; flex: 1; min-width: 0; }
.qstat { padding: 6px 8px; border-radius: 3px; }
.qstat-label { font-size: 12px; color: var(--muted); line-height: 1.25; }
.qstat-value { font-size: clamp(20px, 1.7vw, 26px); white-space: nowrap; font-weight: 650; line-height: 1.15; }
.qstat.has-waiting .qstat-value { color: var(--accent); }
.qstat.lvl-warn { background: var(--warn-bg); }
.qstat.lvl-warn .qstat-value { color: var(--warn); }
.qstat.lvl-crit { background: var(--crit-bg); }
.qstat.lvl-crit .qstat-value { color: var(--crit); }
.qcard-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; margin-top: auto; }
.spark { width: 120px; height: 30px; flex: none; }
.spark-base { stroke: var(--grid); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--spark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--ser-ans); stroke: var(--surface); stroke-width: 2; }

.state-counts { list-style: none; margin: 0; padding: 8px 14px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.state-counts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.state-counts .cnt { font-weight: 600; font-size: 16px; }

/* ---------------------------------------------------------------- alerts */

.alerts .card-head h2 { font-size: 15px; }
.al-count { min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 3px; background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.al-count.has-crit { background: var(--crit); color: var(--on-crit); }
.al-list { list-style: none; margin: 0; padding: 0; }
.al { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.al:last-child { border-bottom: 0; }
.al-level { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 3px; white-space: nowrap; }
.al-crit .al-level { background: var(--crit); color: var(--on-crit); }
.al-warn .al-level { background: var(--warn-bg); color: var(--warn); }
.al-text { line-height: 1.4; }
.al-text .num { font-weight: 600; }
.al-crit .al-text .num { color: var(--crit); }
.al-empty { padding: 10px 14px; margin: 0; }
.alerts-prominent .al { padding: 11px 16px; font-size: 16px; }
.alerts-prominent .al-crit { background: var(--crit-bg); }
.alerts-prominent .al-level { font-size: 13px; padding: 2px 9px; }
.alerts-prominent .card-head h2 { font-size: 16px; }

/* ---------------------------------------------------------------- queue strip (leader, rep) */

.qstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.qcell { padding: 10px 14px; border-inline-end: 1px solid var(--border); }
.qcell:last-child { border-inline-end: 0; }
.qcell-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.qcell-nums { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.qcell.lvl-warn { background: var(--warn-bg); }
.qcell.lvl-crit { background: var(--crit-bg); }
.qcell[data-level-host].lvl-warn .kv > .num[data-tick] { color: var(--warn); }
.qcell[data-level-host].lvl-crit .kv > .num[data-tick] { color: var(--crit); }

/* ---------------------------------------------------------------- rep board (leader) */

.board-head { align-items: center; }
.board-count { font-weight: 400; font-size: 13px; margin-inline-start: 6px; }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-field select { min-height: 30px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.rep { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; background: var(--surface); }
.rep-ringing { border-color: var(--ringing); }
.rep-offline { background: var(--surface-2); }
.rep-offline .rep-name, .rep-offline .rep-stats { color: var(--muted); }
.rep-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rep-name { font-weight: 700; font-size: 17px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.rep-num { color: var(--text); font-weight: 600; font-size: 15px; }
.rep-state { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rep-time { font-size: 13px; font-weight: 600; color: var(--muted); }   /* owner 21.11: secondary */
.rep-pause { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 3px; background: var(--paused-bg); color: var(--paused); font-size: 13px; }
.rep-pause .num { font-size: 16px; font-weight: 700; }
.rep-pause.lvl-warn { background: var(--warn-bg); color: var(--warn); }
.rep-pause-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-stats { display: grid; grid-template-columns: auto 1fr; gap: 12px; font-size: 13px; }
.rep-stat .k { display: block; color: var(--muted); font-size: 11.5px; }
.rep-stat .v { font-weight: 600; font-size: 15px; }
.rep-occ { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
.rep-occ .k { grid-column: 1 / -1; }
.rep-occ .meter { grid-column: 1; grid-row: 2; }
.rep-occ .v { grid-column: 2; grid-row: 2; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--val-ok); border-radius: 3px; }
.meter-warn { background: var(--val-warn); }
.rep-queues { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------------------------------------------------------- rep view */

.rep-queues-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--gap); }
.rq-nums { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.rq-nums .bignum + .bignum { border-inline-start: 1px solid var(--border); }
.rq-nums .bignum[data-level-host].lvl-warn { background: var(--warn-bg); }
.rq-nums .bignum[data-level-host].lvl-warn .bignum-value { color: var(--warn); }
.rq-nums .bignum[data-level-host].lvl-crit { background: var(--crit-bg); }
.rq-nums .bignum[data-level-host].lvl-crit .bignum-value { color: var(--crit); }
.rq-callers { list-style: none; margin: 0; padding: 0; }
.rq-callers li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 15px; }
.rq-callers li:last-child { border-bottom: 0; }
.rq-pos { color: var(--muted); }
.rq-callers li.lvl-warn { background: var(--warn-bg); }
.rq-callers li.lvl-warn > .num:last-child { color: var(--warn); font-weight: 700; }
.rq-callers li.lvl-crit { background: var(--crit-bg); }
.rq-callers li.lvl-crit > .num:last-child { color: var(--crit); font-weight: 700; }
.bignum[data-level-host].lvl-warn { background: var(--warn-bg); }
.bignum[data-level-host].lvl-warn .bignum-value { color: var(--warn); }
.bignum[data-level-host].lvl-crit { background: var(--crit-bg); }
.bignum[data-level-host].lvl-crit .bignum-value { color: var(--crit); }

@media (max-width: 1360px) {
  .view-manager { grid-template-columns: minmax(0, 1fr) 300px; }
  .instruments { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .instruments .bignums { grid-column: 1 / -1; grid-template-rows: none; grid-template-columns: 1fr 1fr; border-inline-start: 0; border-top: 1px solid var(--border); }
  .instruments .bignums .bignum + .bignum { border-top: 0; border-inline-start: 1px solid var(--border); }
}
@media (max-width: 1100px) {
  .view-manager { grid-template-columns: minmax(0, 1fr); }
  .view-side { position: static; }
}
@media (max-width: 760px) {
  .instruments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .instruments > * + * { border-inline-start: 0; }
  .page { padding: 12px 16px 32px; }
}


/* ---------------------------------------------------------------- queue callbacks */

.tag-cb { margin-inline-start: 8px; color: var(--accent); border-color: var(--tag-line); background: var(--accent-soft); font-weight: 600; vertical-align: middle; }
.cb-line { font-size: 13px; color: var(--muted); }
.cb-line .cb-n { font-weight: 700; color: var(--text); font-size: 15px; }
.cb-line.has .cb-n { color: var(--accent); }
.cb-oldest .num { font-weight: 600; color: var(--text); }
.cb-line.lvl-warn .cb-oldest .num { color: var(--warn); }
.cb-line.lvl-crit .cb-oldest .num { color: var(--crit); }
.cb-details { margin-top: 4px; font-size: 13px; }
.cb-details summary { cursor: pointer; color: var(--accent); width: max-content; }
.cb-table { margin-top: 4px; }
.cb-table tr.lvl-warn .cb-age .num { color: var(--warn); font-weight: 700; }
.cb-table tr.lvl-crit .cb-age .num { color: var(--crit); font-weight: 700; }
.qcard-cb { padding: 6px 14px 8px; border-top: 1px solid var(--border); }
.qcell .cb-line { margin-top: 4px; }
.rq-cb { padding: 8px 14px; border-bottom: 1px solid var(--border); }

.cbsum { display: flex; flex-wrap: wrap; align-items: stretch; }
.cbsum-title { padding: 12px 16px; font-size: 15px; display: flex; align-items: center; border-inline-end: 1px solid var(--border); }
.cbsum-cell { padding: 8px 16px; display: flex; flex-direction: column; justify-content: center; border-inline-end: 1px solid var(--border); }
.cbsum-cell:last-child { border-inline-end: 0; }
.cbsum-cell .k { font-size: 12px; color: var(--muted); }
.cbsum-cell .v, .cbsum-cell > .num { font-size: 20px; font-weight: 650; }
.cbsum-cell.lvl-warn, .cbsum-cell[data-level-host].lvl-warn { background: var(--warn-bg); }
.cbsum-cell.lvl-warn .num { color: var(--warn); }
.cbsum-cell.lvl-crit, .cbsum-cell[data-level-host].lvl-crit { background: var(--crit-bg); }
.cbsum-cell.lvl-crit .num { color: var(--crit); }

.cbpanel-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; padding: 10px 14px 12px; }
@media (max-width: 1100px) { .cbpanel-body { grid-template-columns: minmax(0, 1fr); } }

/* settings: callback modes editor, tenants: modules */
.form-settings { max-width: 760px; }
.form-settings.kit { max-width: none; }
.cbm { margin-top: 8px; }
.cbm-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cbm-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.cbm-cell { display: flex; flex-direction: column; gap: 3px; }
.cbm-cell label { font-size: 12px; font-weight: 600; }
.cbm-cell input, .cbm-cell select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.cbm-cell input { width: 110px; text-align: left; }
.cbm-cell input[aria-invalid="true"] { border-color: var(--crit); }
.cbm-err { flex-basis: 100%; }
.mods-row { display: flex; gap: 18px; flex-wrap: wrap; }
.mods-row .field { margin-bottom: 0; }

/* reports (20.11) */
.rpt-result { margin-bottom: 24px; }
.rpt-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.rpt-head h2 { margin: 0; }
.rpt-sched { margin-top: 28px; }
.rpt-sched .page-head h2 { margin: 0; }

/* PBX actions (20.11) */
.act-msg { margin-bottom: 10px; }
.act-msg .notice { margin: 0; }
.act-hint { margin: 0 0 8px; }
.act-row { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.lt > .act-row { margin-top: 4px; }
.rep-actions { gap: 6px; flex-wrap: wrap; }
.rq-callers li.has-act { grid-template-columns: 28px 1fr auto auto; align-items: center; }
.tb-ext { white-space: nowrap; }

/* round 3 (21.11): caller marks, shifts, lists, queue names */
.badge-vip { background: var(--accent-soft); color: var(--accent); }
.cm-note { font-size: 12px; }
.rep-shift { font-size: 12px; color: var(--muted); }
.sh-st { font-weight: 600; }
.sh-st-late, .sh-st-left { color: var(--warn); }
.sh-st-on { color: var(--ok); }
.sh-table input, .sh-table select { padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.sh-table input[type="text"] { width: 7em; }
.sh-name { font-size: 12px; }
.row-bad td { background: var(--crit-bg); }
.ls-paste { width: 100%; max-width: 640px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-family: var(--mono); }
.qnames input { width: 100%; max-width: 260px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.qnames input[aria-invalid="true"] { border-color: var(--crit); }
.rq-acts { padding: 6px 16px 0; }
.rpt-queues { margin-top: 12px; }

/* round 4 (21.11): report extras, rep bar, matrix */
.rpt-notbuilt { margin-top: 8px; }
.rpt-notbuilt ul, .rpt-missing ul { margin: 4px 0 0; padding-inline-start: 20px; }
.col-note { display: inline-block; margin-inline-start: 4px; width: 14px; height: 14px; line-height: 12px; border: 1px solid var(--border-strong); border-radius: 50%; text-align: center; font-size: 10px; font-style: italic; color: var(--muted); cursor: help; font-weight: 600; }
.row-total td { font-weight: 700; background: var(--surface-2); }
.rpt-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.rpt-summary .bignum { flex: 0 1 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rpt-summary .bignum + .bignum { border-top: 1px solid var(--border); }
.rc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 12px; margin-bottom: 12px; }
.rc { margin: 0; max-width: 900px; }
.rc-title { font-weight: 600; margin-bottom: 6px; }
.rc-svg { width: 100%; height: auto; display: block; direction: ltr; }
.rc-s0 { fill: var(--ser-ans); } .rc-s1 { fill: var(--ser-ab); } .rc-s2 { fill: var(--ser-3); }
.rc-s3 { fill: var(--ser-4); } .rc-s4 { fill: var(--ser-5); } .rc-s5 { fill: var(--ser-join); }
.rc-sw.rc-s0 { background: var(--ser-ans); } .rc-sw.rc-s1 { background: var(--ser-ab); } .rc-sw.rc-s2 { background: var(--ser-3); }
.rc-sw.rc-s3 { background: var(--ser-4); } .rc-sw.rc-s4 { background: var(--ser-5); } .rc-sw.rc-s5 { background: var(--ser-join); }
.rc-line { fill: none; stroke-width: 2; }
.rc-ls0 { stroke: var(--ser-ans); } .rc-ls1 { stroke: var(--ser-ab); } .rc-ls2 { stroke: var(--ser-3); }
.rc-ls3 { stroke: var(--ser-4); } .rc-ls4 { stroke: var(--ser-5); } .rc-ls5 { stroke: var(--ser-join); }
.rc-target { stroke: var(--muted); stroke-dasharray: 4 3; stroke-width: 1; }
.rc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.rc-key { display: inline-flex; align-items: center; gap: 5px; }
.rc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.rc-pie { display: flex; gap: 20px; align-items: center; }
.rc-pie-svg { width: 200px; height: 200px; flex: 0 0 auto; }
.rc-slice { stroke: var(--surface); stroke-width: 1; }
.rc-pie-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.rc-pie-legend li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.rc-hm-table th, .rc-hm-table td { text-align: center; padding: 3px 2px; font-size: 12px; min-width: 20px; }
.rc-hm0 { background: var(--surface); }
.rc-hm1 { background: var(--hm1); } .rc-hm2 { background: var(--hm2); } .rc-hm3 { background: var(--hm3); }
.rc-hm4 { background: var(--hm4); color: var(--hm-on); } .rc-hm5 { background: var(--hm5); color: var(--hm-on); }
.bar-ext { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 16px; }
.bar-ext .notice { margin: 0; flex: 1; }
.bar-ext-n { font-size: 20px; font-weight: 700; }
.bar-state-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.bar-now .k { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.bar-now-v { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bar-now-v .chip { font-size: 16px; }
.bar-break { margin-inline-start: auto; }
.bar-big { font-size: 18px; padding: 10px 22px; }
.bar-today { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.bar-today .bignum { flex: 1 1 150px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.bar-today .bignum + .bignum { border-top: 1px solid var(--border); margin: 0; }
.bar-explain { margin: 0 0 16px; }
.bar-queues td, .bar-queues th { font-size: 16px; padding: 10px 12px; }
.bar-has-waiting .num { font-weight: 700; }
.bar-acts .btn { font-size: 14px; }
.mx-legend { margin: 0 0 8px; }
.mx th.mx-q { text-align: center; white-space: nowrap; }
.mx-td { text-align: center; }
.mx-cell { display: inline-block; min-width: 26px; padding: 1px 6px; border-radius: 3px; font-weight: 700; text-align: center; }
.mx-in { background: var(--idle-bg); color: var(--idle); }
.mx-paused { background: var(--paused-bg); color: var(--paused); }
.mx-offline { background: var(--offline-bg); color: var(--offline); }
.mx-none { color: var(--border-strong); }
.mod-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }


/* ---------------------------------------------------------------- queue colours (js/qcolor.js)
   8 validated categorical slots; light steps here, dark steps under .wb-body. Dot, header tint and
   rep queue tags only — never a side stripe or border. */
.qc-0 { --qc: #2a78d6; --qt: #eaf2fb; --qb: #b4d0f1; }
.qc-1 { --qc: #eb6834; --qt: #fdf0eb; --qb: #f8cab8; }
.qc-2 { --qc: #1baf7a; --qt: #e8f7f2; --qb: #afe3d0; }
.qc-3 { --qc: #eda100; --qt: #fdf6e6; --qb: #f9dea6; }
.qc-4 { --qc: #e87ba4; --qt: #fdf2f6; --qb: #f7d1df; }
.qc-5 { --qc: #008300; --qt: #e6f3e6; --qb: #a6d4a6; }
.qc-6 { --qc: #6250d6; --qt: #efeefb; --qb: #c8c2f1; }
.qc-7 { --qc: #e34948; --qt: #fceded; --qb: #f5bfbf; }
html[data-theme="dark"] .qc-0, .wb-body .qc-0 { --qc: #3987e5; --qt: #1f303e; --qb: #284e78; }
html[data-theme="dark"] .qc-1, .wb-body .qc-1 { --qc: #d95926; --qt: #39291f; --qb: #703a22; }
html[data-theme="dark"] .qc-2, .wb-body .qc-2 { --qc: #199e70; --qt: #1a342b; --qb: #1a5943; }
html[data-theme="dark"] .qc-3, .wb-body .qc-3 { --qc: #c98500; --qt: #363019; --qb: #694d11; }
html[data-theme="dark"] .qc-4, .wb-body .qc-4 { --qc: #d55181; --qt: #38282e; --qb: #6e364b; }
html[data-theme="dark"] .qc-5, .wb-body .qc-5 { --qc: #0ca30c; --qt: #18351b; --qb: #145b16; }
html[data-theme="dark"] .qc-6, .wb-body .qc-6 { --qc: #9085e9; --qt: #2d303e; --qb: #4f4d79; }
html[data-theme="dark"] .qc-7, .wb-body .qc-7 { --qc: #e66767; --qt: #3b2b2a; --qb: #76403f; }


.qdot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; background: var(--qc); margin-inline-end: .4em; vertical-align: .05em; flex: none; }
.qcard .qcard-head { background: var(--qt); border-bottom: 1px solid var(--border); padding-bottom: 8px; border-radius: var(--radius) var(--radius) 0 0; }
.qcard { cursor: pointer; }
.qcard:hover { border-color: var(--border-strong); }
.q-link { color: inherit; text-decoration: none; }
.q-link:hover { text-decoration: underline; }
.tag-q { display: inline-flex; align-items: center; background: var(--qt); border-color: var(--qb); color: var(--text); }
.tag-q .qdot { width: 7px; height: 7px; margin-inline-end: 4px; }
.more-link { font-size: 13px; color: var(--accent); }
.rep-actions { display: flex; justify-content: flex-end; }

/* ---------------------------------------------------------------- #queue/<n> */

.view-queue { display: flex; flex-direction: column; gap: var(--gap); }
.qv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--qt); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; }
.qv-title { font-size: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qv-title .qdot { width: 14px; height: 14px; }
.qv-tools { display: flex; align-items: center; gap: 8px; }
.qv-pbx { margin: 0; color: var(--text); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.qv-alerts { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.qv-alerts .al { font-size: 15px; }
.qv-alerts .al-crit { background: var(--crit-bg); }
.qv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, .8fr)) minmax(0, 1fr) minmax(0, 1.4fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.qv-kpis > * + * { border-inline-start: 1px solid var(--border); }
.qv-kpis .bignum-value { font-size: 52px; }
.qv-today { padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 14px; }
.qv-cb { margin-top: 4px; }
.qv-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--gap); align-items: start; }
.qv-wait td { font-size: 16px; }
.qv-wait tr.lvl-warn td { background: var(--warn-bg); }
.qv-wait tr.lvl-warn .wait-cell .num { color: var(--warn); font-weight: 700; }
.qv-wait tr.lvl-crit td { background: var(--crit-bg); }
.qv-wait tr.lvl-crit .wait-cell .num { color: var(--crit); font-weight: 700; }

.lanes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.lane { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; display: flex; flex-direction: column; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.lane-title { margin: 0; font-size: 15px; color: var(--text); font-weight: 700; display: flex; align-items: center; gap: 7px; text-transform: none; letter-spacing: 0; }
.lane-n { font-size: 20px; font-weight: 700; }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.st-dot.st-busy { background: var(--busy); } .st-dot.st-ringing { background: var(--ringing); } .st-dot.st-idle { background: var(--idle); }
.st-dot.st-paused { background: var(--paused); } .st-dot.st-offline { background: var(--offline); }
.lane-talking .lane-head { background: var(--busy-bg); }
.lane-ringing .lane-head { background: var(--ringing-bg); }
.lane-free .lane-head { background: var(--idle-bg); }
.lane-onBreak .lane-head { background: var(--paused-bg); }
.lane-offline .lane-head { background: var(--offline-bg); }
.lane-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.lane-empty { color: var(--muted); margin: 4px 2px; }
.lt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.lt-head { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.lt-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-num { color: var(--muted); font-size: 13px; }
.lt-time { font-size: 26px; font-weight: 650; line-height: 1.15; }
.lt-time .num { font-variant-numeric: normal; }
.lt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.lt-break { color: var(--paused); font-weight: 600; }
.lt-onBreak.lvl-warn { background: var(--warn-bg); }
.lt-onBreak.lvl-warn .lt-time .num { color: var(--warn); }
.lt-ringing { border-color: var(--ringing); }
.lt-offline .lt-time, .lt-offline .lt-name { color: var(--muted); }

.page:fullscreen { background: var(--bg); overflow: auto; padding: 20px 28px; }
.page:fullscreen .qv-kpis .bignum-value { font-size: 64px; }

/* #callbacks */
.view-callbacks { display: flex; flex-direction: column; gap: var(--gap); }
.view-callbacks .intro { margin: 0; max-width: 820px; }
.cbv-sum { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cbv-table tr.lvl-warn .cb-age .num { color: var(--warn); font-weight: 700; }
.cbv-table tr.lvl-crit .cb-age .num { color: var(--crit); font-weight: 700; }
.att-res { margin-inline-start: 6px; }

/* settings: break types */
.brt { margin-top: 8px; }
.brt-rows { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rsh-rows { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.rsh-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rsh-row input[type="text"] { flex: 1 1 160px; min-width: 0; }
.brt-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.brt-row input { min-height: 32px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); width: 240px; }
.brt-row input[aria-invalid="true"] { border-color: var(--crit); }
.brt-id { color: var(--muted); font-size: 12px; min-width: 80px; }
.br-types { border: 0; padding: 0; margin: 0; }

@media (max-width: 1280px) {
  .lanes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qv-bottom { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- sign-in / setup */

.auth { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.auth h1 { margin-bottom: 12px; }
.auth-msg:empty { display: none; }
.setup-who { margin: 8px 0 14px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.qr { display: flex; justify-content: center; padding: 12px; margin: 10px 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.qr-svg { width: 220px; height: 220px; }
.secret-label { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.secret-text { font-family: var(--mono); font-size: 15px; letter-spacing: .05em; word-break: break-all; }

/* ================================================================ wallboard (TV, 1920x1080, dark) */

/* q37: the ONE dark palette - the TV and the management screens' dark theme */
.wb-body, html[data-theme="dark"] {
  --bg: #121715;
  --surface: #1a201e;
  --surface-2: #20272a;
  --border: #2c3532;
  --border-strong: #3a4541;
  --text: #eef2f0;
  --muted: #9aa6a1;
  --accent: #5fb8b2;
  --warn: #f2b33d;      --warn-bg: #3a2d10;
  --crit: #ff6b5e;      --crit-bg: #47191a;
  --idle: #5cc97f;      --idle-bg: #173322;
  --ringing: #f2b33d;   --ringing-bg: #3a2d10;
  --busy: #6aa8ef;      --busy-bg: #172c45;
  --hold: #b48ce6;      --hold-bg: #2c2240;
  --offline: #9aa1aa;   --offline-bg: #262b31;
  --paused: #f08a4b;    --paused-bg: #3d2414;
  --unknown: #9aa1aa;   --unknown-bg: #262b31;
  --ser-ans: #3d9fd0;
  --ser-ab: #e2603f;
  --ser-join: #c9d2ce;
  --grid: #27302d;
  --track: #2a3330;
  --now-band: #1f2a28;
  --zone-ok: #2f6763;  --zone-warn: #6b5420;  --zone-crit: #6e2b25;
  --val-ok: #5fb8b2;   --val-warn: #f2b33d;   --val-crit: #ff6b5e;
  --accent-hover: #7fcac5; --accent-soft: #1f3533; --focus: #6aa8ef;
  --ok: #5cc97f;        --ok-bg: #173322;
  --ser-3: #5cc97f; --ser-4: #b48ce6; --ser-5: #e0a83a; --spark: #7f8b87; --hover-band: rgba(238, 242, 240, .06);
  --on-accent: #0c1413; --on-crit: #1a0d0c; --seg-n-on: #10302e;
  --ok-line: #2c5a3b;   --ok-text: #9fe0b3;
  --crit-line: #6e2b25; --crit-text: #ffb3ab; --danger-line: #6e2b25;
  --info-line: #2f6763; --info-text: #a9e0dc;
  --warn-line: #6b5420; --tag-line: #2f6763;
  --row-hover: #1f2725;
  --shadow: rgba(0, 0, 0, .5); --shadow-soft: rgba(0, 0, 0, .4); --backdrop: rgba(0, 0, 0, .6);
  --hm1: #17313d; --hm2: #1d4a5e; --hm3: #23667f; --hm4: #2c86a8; --hm5: #46a8d1; --hm-on: #0b1418;
  --grid-head: #20272a; --grid-na: #161c1a; --grid-text: #eef2f0;
  background: var(--bg);
  color: var(--text);
  font-size: clamp(14px, 1.15vw, 34px);   /* about 22px on a 1920 screen */
  overflow: hidden;
  cursor: none;
}
.wb {
  height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  padding: .9em 1.4em .5em; gap: .8em;
}
.wb-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1em; }
.wb-brand { color: var(--muted); font-size: .8em; font-weight: 600; }
.wb-tenant { font-size: 1.5em; font-weight: 700; line-height: 1.15; }
.wb-status { color: var(--muted); font-size: .9em; text-align: center; }
.wb-status.is-bad { color: var(--warn); }
.wb-time { text-align: end; }
.wb-clock { display: inline-block; font-size: 2.4em; font-weight: 700; line-height: 1; font-variant-numeric: normal; }
.wb-date { color: var(--muted); font-size: .85em; margin-top: .2em; }

.wb-content { display: contents; }
.wb-content > .wb-empty { grid-row: 2 / 5; align-self: center; text-align: center; font-size: 1.4em; }

/* top row: two huge numbers, three dials */
.wb-top { display: grid; grid-template-columns: .8fr 1.2fr .8fr 1fr 1fr 1fr; gap: .8em; }   /* owner 22.11: + callbacks waiting */
.wb-big, .wb-dial { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; min-width: 0; }
.wb-big { padding: .7em 1em; display: flex; flex-direction: column; justify-content: center; }
.wb-big-label { color: var(--muted); font-size: 1.05em; font-weight: 600; }
.wb-big-value { font-size: 5.4em; font-weight: 700; line-height: 1; white-space: nowrap; }
.wb-big-value .num { font-variant-numeric: normal; }
.wb-big.lvl-warn { background: var(--warn-bg); border-color: var(--warn); }
.wb-big.lvl-warn .wb-big-value { color: var(--warn); }
.wb-big.lvl-crit { background: var(--crit-bg); border-color: var(--crit); }
.wb-big.lvl-crit .wb-big-value { color: var(--crit); }
.wb-dial .gauge { padding: .5em .6em .55em; height: 100%; justify-content: flex-start; }
.wb-dial .gauge-label { font-size: 1.05em; color: var(--muted); }
.wb-dial .g-svg { max-width: 15em; }
.wb-dial .gauge-sub { font-size: .75em; }
.wb-dial .g-figure { font-size: 2em; }          /* q32: scales with the screen (was 44px) */
.wb-dial .g-end { font-size: .6em; }

.wb-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: .8em; min-height: 0; }
.wb-queues { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; min-height: 0; }
.wb-table { width: 100%; border-collapse: collapse; }
.wb-table th, .wb-table td { padding: .4em .6em; border-bottom: 1px solid var(--border); text-align: start; }
.wb-table thead th { color: var(--muted); font-size: .8em; font-weight: 600; white-space: nowrap; }
.wb-table tbody th { font-size: 1.4em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11em; }
.wb-table td { font-size: 1.6em; font-weight: 600; }
.wb-table .n { text-align: end; white-space: nowrap; }
.wb-table tbody tr:last-child th, .wb-table tbody tr:last-child td { border-bottom: 0; }
.wb-has-waiting { color: var(--accent); }
.wb-table { table-layout: fixed; }          /* q38: big figures never push the table past its panel - the queue name gives way (…) */
.wb-table thead th:first-child { width: 30%; }
.wb-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-table tbody th { max-width: none; }
.wb-lanes { padding: .5em; overflow: hidden; }
.wb-lanes .lanes { gap: .5em; height: 100%; }
.wb-lanes .lane { background: var(--bg); }
.wb-lanes .lane-title { font-size: .95em; }
.wb-lanes .lane-n { font-size: 1.3em; }
.wb-lanes .lt { padding: .35em .5em; }
.wb-lanes .lt-name { font-size: .9em; }
.wb-lanes .lt-time { font-size: 1.5em; }
.wb-lanes .lt-foot { font-size: .65em; }
.wb-qnum { color: var(--muted); font-size: .6em; font-weight: 400; }
.wb-table-wide th, .wb-table-wide td { padding: .4em .45em; }
.wb-table-wide td { font-size: 1.35em; }
.wb-table-wide tbody th { font-size: 1.2em; max-width: 8.5em; }
.wb-table .tag-cb { font-size: .5em; padding: .1em .5em; vertical-align: middle; background: #1f3533; border-color: #2f6763; color: var(--accent); }
.wb-sub { font-size: .6em; color: var(--muted); font-weight: 400; margin-left: .35em; }
.wb-table td.lvl-warn { color: var(--warn); background: var(--warn-bg); }
.wb-table td.lvl-crit { color: var(--crit); background: var(--crit-bg); }

.wb-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .8em; min-height: 0; }
.wb-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .55em .9em; min-height: 0; overflow: hidden; }
.wb-box h2 { font-size: .9em; color: var(--muted); margin-bottom: .35em; }
.wb-hourly .h-legend { font-size: .7em; gap: 1.2em; }
.wb-hourly .h-ytick, .wb-hourly .h-xtick { font-size: 15px; }
.wb-states { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4em 1.2em; }
.wb-state { display: flex; align-items: center; justify-content: space-between; gap: .4em; }
.wb-state .chip { font-size: .8em; padding: .1em .5em; }
.wb-state .chip .dot { width: .55em; height: .55em; }
.wb-state-n { font-size: 1.5em; font-weight: 700; line-height: 1.1; }
.wb-empty { color: var(--muted); margin: .4em 0; }

/* alert strip: up to three at a time, pages every 8 s */
.wb-alerts { min-width: 0; display: flex; gap: .8em; align-items: stretch; min-height: 2.6em; }
.wb-alert { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .6em; padding: .45em .8em; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-size: 1.05em; }
.wb-alert-crit { background: var(--crit-bg); border-color: var(--crit); }
.wb-alert-warn { background: var(--warn-bg); border-color: #6b5420; }
.wb-alert-level { font-weight: 700; font-size: .8em; padding: .1em .5em; border-radius: 4px; white-space: nowrap; }
.wb-alert-crit .wb-alert-level { background: var(--crit); color: #1a0d0c; }
.wb-alert-warn .wb-alert-level { background: var(--warn); color: #1d1606; }
.wb-alert-text { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-alert-text .num { font-weight: 700; }
.wb-alerts-none { color: var(--muted); align-self: center; font-size: 1em; }
.wb-alerts-page { align-self: center; color: var(--muted); font-size: .8em; }
.wb-foot { color: var(--muted); font-size: .7em; text-align: end; }

.wb-pair { grid-row: 2 / 6; align-self: center; justify-self: center; text-align: center; max-width: 60em; }
.wb-pair-hint, .wb-pair-exp { max-width: 40em; margin-inline: auto; }
.wb-pair-title { font-size: 1.8em; margin-bottom: .8em; }
.wb-pair-code {
  font-family: var(--mono); font-size: 6.5em; font-weight: 700; letter-spacing: .1em; line-height: 1; white-space: nowrap;
  padding: .25em .5em; border: 2px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: .5em;
}
.wb-pair-hint { font-size: 1.3em; color: var(--text); }
.wb-pair-exp { color: var(--muted); font-size: 1em; }

@media (max-width: 1100px) {
  .wb-body { overflow: auto; cursor: auto; }
  .wb { height: auto; min-height: 100vh; }
  .wb-top { grid-template-columns: 1fr 1fr 1fr; }
  .wb-main { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* q09 work shift */
.bar-shift-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.bar-shift-row > :first-child { flex: 1 1 160px; min-width: 0; }
.bar-shift-kv .k, .bar-shift .k { font-size: 13px; color: var(--muted); }
.bar-shift-kv .v { font-size: 18px; font-variant-numeric: tabular-nums; }
.bar-shift-since { font-size: 16px; font-weight: 600; }
.sh-queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.tb-shift-on { border-color: var(--ok, currentColor); }
.row-pending td { background: var(--warn-bg, transparent); }
.row-day td { font-weight: 700; border-top: 2px solid var(--border); }
.calls-summary { margin-bottom: 12px; max-width: 560px; }
.calls-summary .tbl th, .calls-summary .tbl td { padding: 6px 10px; }
/* q23 data health */
.health-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.health-green { background: var(--ok-bg); color: var(--ok); } .health-dot.health-green { background: var(--ok); }
.health-amber { background: var(--warn-bg); color: var(--warn); } .health-dot.health-amber { background: var(--warn); }
.health-red { background: var(--bad-bg, #fde8e8); color: var(--bad, #b42318); } .health-dot.health-red { background: var(--bad, #b42318); }
.health-tag { margin-inline-start: 6px; }

/* m03 permission groups: the rights grid (screens down, actions across) */
.grid-wrap { overflow-x: auto; max-height: 60vh; border: 1px solid var(--line, #d7dce2); border-radius: 6px; }
.rights-grid th, .rights-grid td { text-align: center; padding: 6px 8px; white-space: nowrap; }
.rights-grid tbody th { text-align: start; font-weight: 500; color: var(--grid-text); }
.rights-grid thead th { position: sticky; top: 0; background: var(--grid-head); color: var(--grid-text); }
.rights-grid .grid-na { background: var(--grid-na); }
.rights-grid input[type=checkbox] { width: 18px; height: 18px; }
.sub-head { margin: 28px 0 10px; }
.rights-grid .grid-more-cell { text-align: start; white-space: normal; } .rights-grid .grid-more { display: inline-flex; gap: 4px; align-items: center; margin-inline-end: 12px; color: #1f2937; }
.rights-grid .grid-more-cell { min-width: 230px; } .rights-grid .grid-more { white-space: nowrap; }
/* sh1 shift groups */
.sg-card { margin-bottom: 16px; }
.sg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.sg-head h2 { margin: 0 0 4px; }
.sg-member { margin-bottom: 10px; }

/* q30: live data that stopped updating is shown as such - dimmed, never bright as if current */
html.feed-stale [data-live] { opacity: .5; filter: grayscale(.6); transition: opacity .3s, filter .3s; }
.new-version { position: sticky; top: 0; z-index: 50; display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 0; border-radius: 0; }

/* q32: paged lists on the TV - the page counter sits under its list, readable from the room */
.wb-paged { display: flex; flex-direction: column; min-height: 0; }
.wb-paged > :first-child { flex: 1 1 auto; min-height: 0; }
.wb-pager { margin: .3em 0 0; text-align: center; color: var(--muted); font-size: .9em; font-weight: 600; }

/* ---------------------------------------------------------------- q33: levels readable without colour
   a warning value carries a triangle, a critical one a diamond and a thicker edge - the same on every screen
   (pseudo-element, so values that tick every second keep it) */
:is(.kpi, .bignum, .qstat, .wbl-n, .wbl-sf, .wb-big).lvl-warn :is(.kpi-v, .bignum-value, .qstat-value, .wbl-n-value, .wbl-sf-value, .wb-big-value)::before,
td.lvl-warn::before, .kv.lvl-warn > .num::before, .tt.v-warn .tt-v::before, .hb-v.v-warn::before, .row-warn > td:first-child::before { content: '\25B2'; font-size: .55em; vertical-align: .35em; margin-inline-end: .3em; }
:is(.kpi, .bignum, .qstat, .wbl-n, .wbl-sf, .wb-big).lvl-crit :is(.kpi-v, .bignum-value, .qstat-value, .wbl-n-value, .wbl-sf-value, .wb-big-value)::before,
td.lvl-crit::before, .kv.lvl-crit > .num::before, .tt.v-crit .tt-v::before, .hb-v.v-crit::before, .row-crit > td:first-child::before { content: '\25C6'; font-size: .6em; vertical-align: .3em; margin-inline-end: .3em; }
:is(.kpi, .bignum, .qstat, .qcell).lvl-crit { box-shadow: inset 0 0 0 2px var(--crit); }
td.lvl-crit { font-weight: 700; }
/* the TV's big numbers fill their card: the marker sits in the card's corner and takes no width */
.wb-big { position: relative; }
.wb-big.lvl-warn .wb-big-value::before, .wb-big.lvl-crit .wb-big-value::before {
  position: absolute; top: .5rem; inset-inline-end: .7rem; font-size: clamp(18px, 2vw, 40px); vertical-align: 0; margin: 0; line-height: 1; }

/* ---------------------------------------------------------------- q34: numbers with context
   the same time last week - small and quiet under / beside the number; when an alert started */
.lw { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.lw .num { font-weight: 600; color: var(--muted); }
.kv .lw { margin-inline-start: 8px; }
.tt-lw { margin-top: 2px; }
.al-since { font-size: 12px; color: var(--muted); white-space: nowrap; padding-inline-start: 8px; }
.wb-alert .al-since { margin-inline-start: auto; font-size: .8em; opacity: .85; }

/* ---------------------------------------------------------------- alert sound + flash (owner 21.11)
   desk screens: a bar under the top bar while a critical alert nobody here acknowledged is open; TV: new critical alerts
   flash for 30 s. Reduced motion: no blinking - a steady strong edge instead. */
.alarm-bar { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: var(--crit-bg); color: var(--crit); font-weight: 700; border-bottom: 2px solid var(--crit); }
.alarm-bar[hidden] { display: none; }
.alarm-bar .ico { width: 20px; height: 20px; }
.alarm-bar .alarm-text { flex: 1; min-width: 0; }
html.alarm-on .alarm-bar { animation: alarm-flash 1s steps(2, jump-none) infinite; }
.wb-alert-flash { animation: alarm-flash 1s steps(2, jump-none) infinite; }
@keyframes alarm-flash { from { background: var(--crit-bg); } to { background: var(--crit); color: var(--on-crit); } }
@media (prefers-reduced-motion: reduce) {
  html.alarm-on .alarm-bar, .wb-alert-flash { animation: none; box-shadow: inset 0 0 0 3px var(--crit); }
}
.alarm-sound[aria-pressed="true"] { color: var(--text); border-color: var(--border-strong); }
.alarm-sound[aria-pressed="false"] { color: var(--muted); }

/* alert messages card (owner 21.11) */
.am-card { margin-top: 16px; }
.am-card h3 { margin: 18px 0 8px; font-size: 15px; }
.am-hours { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.am-days { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; }
.am-days .field { margin: 0; }
.am-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.am-channels { display: flex; gap: 18px; }
/* the alert catalog (owner 21.11) */
.ar-box { margin: 16px 0; }
.ar-intro { margin: 0 0 12px; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ar-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.ar-card-h .field { margin: 0; }
.ar-card-h .field-check { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 10px; }
.ar-card-h .field-check label { font-weight: 600; font-size: 15px; }
.ar-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.ar-ths { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: auto; }
.ar-th { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ar-th input { width: 64px; padding: 4px 6px; text-align: center; }
.ar-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ar-th-warn .ar-dot { background: var(--warn); }
.ar-th-crit .ar-dot { background: var(--crit); }
.ar-th-l { font-weight: 600; }
.ar-unit { color: var(--muted); }
.ar-card-f { border-top: 1px solid var(--border); padding-top: 8px; }
.ar-card-f .btn { width: 100%; }
.ar-card > .field-error:empty { display: none; }
.ar-off { background: var(--surface-2); }
.ar-off .ar-desc, .ar-off .ar-ths, .ar-off .ar-card-f { opacity: .5; }
.ua-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; }
.ua-form fieldset { margin: 12px 0; }
/* q35: call path + numbers that open their calls */
.tt-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.tt-link:hover, .tt-link:focus-visible { border-bottom-style: solid; }
.cp-list { list-style: none; margin: 0; padding: 0; }
.cp-step { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cp-time { color: var(--muted); font-size: 13px; }
.cp-cause { grid-column: 2; font-size: 12px; }
.cp-good .cp-text { font-weight: 700; }
.cp-bad .cp-text, .cp-miss .cp-text { color: var(--crit); }
.cp-end .cp-text { font-weight: 700; }
.cp-text { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
/* owner 21.11: the queue choice of a TV screen (search for big organisations) */
.wb-qsearch { width: 100%; margin: 4px 0; }
.wb-qlist { max-height: 40vh; overflow: auto; }

/* ---------------------------------------------------------------- q37: themes
   html[data-theme] is set by the page (app.js): light (default), dark, or the system's choice resolved there - so the dark
   palette exists once (above, shared with the TV). Browser controls follow the theme. */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* Windows high contrast / forced colours: the system picks the colours; keep every boundary, state and marker visible */
@media (forced-colors: active) {
  .card, .panel, .tbl-wrap, .kpi, .bignum, .qstat, .tt, .chip, .badge, .btn, .dialog, .alarm-bar, .notice, .wb-big, .wbl-rep, .tile { border: 1px solid CanvasText; }
  .btn-primary, .seg-btn[aria-pressed="true"], .lang-btn[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .st-ico, .ico { color: CanvasText; }
  :focus-visible { outline: 3px solid Highlight !important; outline-offset: 2px; }
  :is(.kpi, .bignum, .qstat, .qcell).lvl-crit, td.lvl-crit { outline: 2px solid CanvasText; }
  html.alarm-on .alarm-bar, .wb-alert-flash { animation: none; outline: 3px solid Highlight; }
  .rc-hm-sw, .rc-hm { forced-color-adjust: none; }
  .tt-link { text-decoration: underline; }
}
/* q38: every big figure fits its own box - it shrinks with the box's width (6:00:36, 30,864,475), never spills or is cut */
.tt, .bignum, .qstat, .wb-big { container-type: inline-size; min-width: 0; }
.tt-v, .bignum-value, .qstat-value, .wb-big-value { white-space: nowrap; }
@supports (font-size: 1cqi) {
  .tt .tt-v { font-size: clamp(16px, 15cqi, 30px); }
  .bignum .bignum-value { font-size: clamp(20px, 17cqi, 44px); }
  .qstat-value { font-size: clamp(14px, 16cqi, 26px); }
  .wb-big-value { font-size: min(5.4em, 15cqi); }
}
/* owner 21.11: a callback queue's source queues, under it */
.cbq-row { padding: 4px 0; }
.cbq-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-inline-start: 28px; margin-bottom: 6px; font-size: 13px; }
/* owner 21.11: Reps & queues as a management screen */
.mx-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 8px 0; }
.mx-tools .field { margin: 0; min-width: 220px; }
.mx-wrap { max-height: 70vh; overflow: auto; }
.mx thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.mx tbody th { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.mx-btn { all: unset; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 4px; }
.mx-btn:hover .mx-cell, .mx-btn:focus-visible .mx-cell { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-btn:focus-visible { outline: 2px solid var(--focus); }
.mx-btn[disabled] { cursor: progress; }
.mx-pending { opacity: .7; }
.mx-repbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.mx-repbtn:focus-visible { outline: 2px solid var(--focus); }
.mx tr.mx-marked > *, .mx .mx-col { background: var(--accent-soft); }
.mx-ext { margin-inline-start: 6px; background: var(--hold-bg); color: var(--hold); }
.mx-extrow { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr auto; gap: 8px; align-items: end; margin-bottom: 6px; }
.mx-extrow .field { margin: 0; }
.mx-ro { font-size: 13px; }

/* x26 PBX "All settings": the PBX page's own tabs and sections, two columns of fields */
.pf { display: grid; gap: 14px; }
.pf-tab { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px 14px; margin: 0; min-width: 0; }
.pf-tab > legend { font-weight: 600; padding: 0 6px; }
.pf-sec-h { margin: 12px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.pf-field { min-width: 0; margin: 0; }
.pf-field select, .pf-field input[type=text], .pf-field textarea { width: 100%; }
.pf-field select + select { margin-top: 4px; }
.pf-wide { grid-column: 1 / -1; }
.pf-diff { margin: 6px 0 0; padding-inline-start: 18px; }
@media (max-width: 720px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } }

/* owner 21.11: the PBX page as a console - the parts down the side, one part beside it */
.pbx-status { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; }
.pbx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.pbx-dot.is-ok { background: var(--ok); }
.pbx-console { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.pbx-nav { position: sticky; top: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 6px; }
.pbx-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pbx-nav-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.pbx-nav-item:hover { background: var(--hover-band); }
.pbx-nav-item.is-on { background: var(--accent-soft); font-weight: 600; }
.pbx-nav-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pbx-main { display: grid; gap: 16px; min-width: 0; }
.pbx-part > h2 { margin-top: 0; }

/* owner 21.11: extension status + forwarding in the PBX console */
.ext-st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.ext-st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex: none; }
.ext-st-idle .ext-st-dot { background: var(--ok); }
.ext-st-busy .ext-st-dot { background: var(--busy); }
.ext-st-ringing .ext-st-dot { background: var(--warn); }
.ext-st-hold .ext-st-dot { background: var(--hold); }
.ext-st-dnd .ext-st-dot { background: var(--crit); }
.ext-st-offline, .ext-st-unknown { color: var(--muted); font-weight: 400; }
.fwd-chip { display: inline-block; margin: 0 0 2px 6px; padding: 1px 7px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 12px; white-space: nowrap; }

/* owner 21.11: time-condition state - one click (Automatic / Open / Closed), the current one marked */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); color: inherit; font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; }
.seg-btn + .seg-btn { border-inline-start: 1px solid var(--border); }
.seg-btn:hover:not(:disabled) { background: var(--hover-band); }
.seg-btn.is-on { font-weight: 700; cursor: default; }
.seg-btn.seg-auto.is-on { background: var(--accent-soft); }
.seg-btn.seg-open.is-on { background: var(--ok-bg); color: var(--ok); }
.seg-btn.seg-closed.is-on { background: var(--crit-bg); color: var(--crit); }
.seg-btn:disabled:not(.is-on) { opacity: .5; cursor: not-allowed; }
.tc-org { display: grid; gap: 8px; margin: 8px 0 12px; }
.tc-org-row { display: flex; align-items: center; gap: 12px; }

/* owner 21.11 (plan ui1): the settings kit - sections down the side, a card per section, two-column fields, switches, save bar */
.kit-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.kit-nav { position: sticky; top: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 6px; }
.kit-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kit-nav-item { width: 100%; padding: 9px 12px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.kit-nav-item:hover { background: var(--hover-band); }
.kit-nav-item.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.kit-main { min-width: 0; display: grid; gap: 16px; }
.kit-sec { min-width: 0; }
.kit-sec-h { margin: 0 0 4px; font-size: 18px; }
.kit-sec-intro { margin: 0 0 16px; max-width: 70ch; }
.kit-sec > .card, .kit-sec .am-card { border: 0; box-shadow: none; padding: 0; background: transparent; }
.kit-sec > .card > h2:first-child, .kit-sec .am-card > h2:first-child { display: none; }
.kit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; max-width: 760px; }
.kit-grid .field { margin: 0; }
/* switches: every checkbox inside a kit page */
.kit input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong);
  position: relative; flex: none; cursor: pointer; margin: 0; vertical-align: middle; transition: background .15s; }
.kit input[type="checkbox"]::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: inset-inline-start .15s; }
.kit input[type="checkbox"]:checked { background: var(--accent); }
.kit input[type="checkbox"]:checked::after { inset-inline-start: 16px; }
.kit input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kit input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .kit input[type="checkbox"], .kit input[type="checkbox"]::after { transition: none; } }
@media (forced-colors: active) { .kit input[type="checkbox"] { appearance: auto; -webkit-appearance: auto; width: auto; height: auto; } .kit input[type="checkbox"]::after { display: none; } }
.kit-savebar { position: sticky; bottom: 12px; z-index: 30; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.kit-savebar[hidden] { display: none; }
.kit-savebar-text { font-weight: 600; }
.kit-cards { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.kit-cards > .kit-savebar, .kit-cards > div[aria-live] { grid-column: 1 / -1; }

/* owner 21.11 (calldirect: 519 queues): Reps & queues - a list on the side, the chosen queue / rep beside it */
.mx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.mx-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.mx-side { position: sticky; top: 12px; display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px; max-height: calc(100vh - 40px); overflow: hidden; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
.mx-side .field { margin: 0; }
.mx-side .seg { flex-wrap: wrap; }
.mx-count { margin: 0; font-size: 12px; }
.mx-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 1px; align-content: start; }
.mx-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.mx-item:hover { background: var(--hover-band); }
.mx-item.is-on { background: var(--accent-soft); font-weight: 600; }
.mx-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-item-meta { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.mx-n { font-size: 12px; color: var(--muted); }
.badge.mx-wait { background: var(--crit-bg); color: var(--crit); }
.mx-detail { min-width: 0; }
.mx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.mx-head h2 { margin: 0; }
.mx-kpis { display: flex; gap: 10px; }
.mx-kpi { display: grid; justify-items: center; min-width: 78px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.mx-kpi-v { font-size: 20px; font-weight: 700; }
.mx-kpi-l { font-size: 12px; color: var(--muted); }
.mx-rowacts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mx-picker { display: grid; gap: 8px; max-width: 640px; justify-self: start; width: 100%; }
.mx-picklist { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; display: grid; gap: 1px; }
.mx-pickrow { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.mx-pickrow:hover { background: var(--hover-band); }

/* owner 21.11 (plan ui1): permission group rights - areas as cards, a screen per row, rights as pill buttons */
.dialog-wide:has(.rg) { width: min(980px, calc(100vw - 32px)); }
.rg { display: grid; gap: 12px; }
.rg-search { width: 100%; max-width: 320px; }
.rg-cards { display: grid; gap: 12px; max-height: 58vh; overflow-y: auto; padding-inline-end: 4px; }
.rg-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.rg-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rg-card-h h3 { margin: 0; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text, inherit); }
.rg-row { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); }
.rg-screen { font-weight: 600; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-chip { position: relative; display: inline-flex; align-items: center; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none; background: var(--surface); }
.rg-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rg-chip:hover { background: var(--hover-band); }
.rg-chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.rg-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rg-chip.is-locked { opacity: .45; cursor: not-allowed; }
@media (forced-colors: active) { .rg-chip input { position: static; opacity: 1; width: auto; height: auto; margin-inline-end: 6px; } }

/* owner 21.11: "waiting for a call back" as a tile beside "waiting now" */
.bignum-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bignum-sub a { color: inherit; text-decoration: underline; }
.qv-kpis:has(> :nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, .8fr)) minmax(0, 1fr) minmax(0, 1.4fr); }

/* rowMenu (kit, owner 21.11): a row's actions in one "⋯" menu */
.row-menu-wrap { position: relative; display: inline-flex; }
.row-menu-btn { min-width: 32px; justify-content: center; font-size: 18px; line-height: 1; padding-inline: 8px; }
.row-menu-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.row-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline-end: 0;
  min-width: 200px; max-width: min(320px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 6px 20px var(--shadow-soft); padding: 4px 0;
}
.row-menu ul { list-style: none; margin: 0; padding: 0; }
.row-menu li + li { border-top: 1px solid var(--border); }
.row-menu-item {
  display: flex; align-items: center; width: 100%; padding: 8px 14px; min-height: 36px;
  background: none; border: 0; text-align: start; cursor: pointer; color: var(--text); white-space: nowrap;
}
.row-menu-item:hover, .row-menu-item:focus-visible { background: var(--surface-2); }
.row-menu-item.is-danger { color: var(--danger, #b42318); }
.ext-acts { display: inline-flex; align-items: center; gap: 6px; }
.ext-rep-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 6px; }
.ext-rep-pick select { min-width: 220px; }
.users-lic { margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.users-lic.is-full { color: var(--warn-text, #8a5a00); }

/* t41 campaigns (owner 22.11) - tiles like the rest of the monitor */
.cp-lic { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cp-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.cp-card.cp-done { opacity: .75; }
.cp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cp-h h3 { margin: 0; font-size: 17px; }
.cp-meta { margin: 0; color: var(--muted); font-size: 13px; }
.cp-bar { block-size: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cp-bar span { display: block; block-size: 100%; background: var(--accent); }
.cp-prog { margin: 0; font-size: 13px; color: var(--muted); }
.cp-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cp-stat { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 8px; background: var(--surface-2); font-size: 12px; text-align: center; }
.cp-stat .cp-n { font-size: 18px; font-weight: 700; }
.cp-stat.is-good .cp-n { color: var(--accent); }
.cp-stat.is-warn .cp-n { color: var(--warn-text, #8a5a00); }
.cp-note { margin: 0; font-size: 13px; color: var(--warn-text, #8a5a00); }
.cp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip.cp-state-running { color: var(--accent); background: var(--accent-soft); }
.chip.cp-state-paused { color: var(--paused); background: var(--paused-bg); }
.cp-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cp-import { margin: 0 0 12px; }
.cp-import textarea { inline-size: 100%; font-family: inherit; }
.cp-seg { margin: 0 0 10px; flex-wrap: wrap; }
.cp-rep { margin-bottom: 16px; }
.cp-rep-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.cp-rep-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 6px 0 10px; }
.cp-big { font-size: 28px; font-weight: 700; letter-spacing: .02em; }
.cp-rep-name { font-size: 18px; }
.cp-results { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
/* m05 bulk actions */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin: 0 0 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.bulk-bar select { min-width: 200px; }
.bulk-cell { inline-size: 44px; text-align: center; }

/* owner 22.11: the rep rights fold behind one line in the user form */
.perm-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.perm-summary .field-hint { margin: 0; flex: 1 1 260px; }

/* owner 22.11: a wrong address */
.nf-page { max-width: 560px; margin: 12vh auto; padding: 0 16px; }
.nf-page h1 { margin-top: 0; }

/* owner 22.11: the wall screen in bright colours (screen setting 'צבעי המסך') - the app's own light tokens */
.wb-body.wb-light {
  --bg: #f3f4f2;
  --surface: #ffffff;
  --surface-2: #f7f8f6;
  --border: #d6dad5;
  --border-strong: #b9bfb8;
  --text: #1b2320;
  --muted: #59635f;
  --accent: #0e5b59;
  --accent-hover: #0a4644;
  --accent-soft: #e3efee;
  --focus: #1d6fd6;
  --idle: #1d7a3e;      --idle-bg: #e4f3e8;
  --ringing: #8f5a00;   --ringing-bg: #fdf1d8;
  --busy: #1c5ea6;      --busy-bg: #e4eefa;
  --hold: #6a3d9e;      --hold-bg: #efe8f8;
  --offline: #5f6670;   --offline-bg: #eceef0;
  --paused: #a2480b;    --paused-bg: #fbe9dc;
  --unknown: #5f6670;   --unknown-bg: #f1f2f3;
  --warn: #8f5a00;      --warn-bg: #fff3d6;
  --crit: #b42318;      --crit-bg: #fde7e4;
  --ok: #1d7a3e;        --ok-bg: #e4f3e8;
  --ser-ans: #1a7fa8;
  --ser-ab: #cc4f33;
  --ser-join: #3b4542;
  --ser-3: #3b8f5a;
  --ser-4: #8a63b8;
  --ser-5: #b07d12;
  --spark: #7a8682;
  --grid: #e6e9e7;
  --track: #e4e8e6;
  --now-band: #eef4f3;
  --hover-band: rgba(27, 35, 32, .05);
  --zone-ok: #a9cfcc;  --zone-warn: #efd18a;  --zone-crit: #eeb0a8;
  --val-ok: #0e5b59;   --val-warn: #c48508;   --val-crit: #c4321f;
  --on-accent: #ffffff; --on-crit: #ffffff; --seg-n-on: #d7ebe9;
  --ok-line: #b8dcc3;   --ok-text: #134f29;
  --crit-line: #efbdb6; --crit-text: #8a1a12; --danger-line: #e3b1ab;
  --info-line: #bcd8d6; --info-text: #0b3f3e;
  --warn-line: #f0d9a4; --tag-line: #b7d3d1;
  --shadow: rgba(0, 0, 0, .18); --shadow-soft: rgba(0, 0, 0, .12); --backdrop: rgba(20, 26, 24, .45);
  --hm1: #e3eff4; --hm2: #c3dde9; --hm3: #93c2d8; --hm4: #2f7a9e; --hm5: #165f82; --hm-on: #ffffff;
  --grid-head: #f3f5f8; --grid-na: #fafbfc; --grid-text: #1f2937;
}
.wb-body.wb-light .qc-0 { --qc: #2a78d6; --qt: #eaf2fb; --qb: #b4d0f1; }
.wb-body.wb-light .qc-1 { --qc: #eb6834; --qt: #fdf0eb; --qb: #f8cab8; }
.wb-body.wb-light .qc-2 { --qc: #1baf7a; --qt: #e8f7f2; --qb: #afe3d0; }
.wb-body.wb-light .qc-3 { --qc: #eda100; --qt: #fdf6e6; --qb: #f9dea6; }
.wb-body.wb-light .qc-4 { --qc: #e87ba4; --qt: #fdf2f6; --qb: #f7d1df; }
.wb-body.wb-light .qc-5 { --qc: #008300; --qt: #e6f3e6; --qb: #a6d4a6; }
.wb-body.wb-light .qc-6 { --qc: #6250d6; --qt: #efeefb; --qb: #c8c2f1; }
.wb-body.wb-light .qc-7 { --qc: #e34948; --qt: #fceded; --qb: #f5bfbf; }

/* owner 22.11: campaign hours as a 24-hour hour : minute pair (the browser's own picker shows AM/PM) */
.tp-row { display: inline-flex; align-items: center; gap: 6px; }
.tp-row select { min-inline-size: 4.5em; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
.tp-row select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tp-sep { font-weight: 700; color: var(--muted); }

/* owner 22.11: who works on a shared call-center extension */
.ea-people { display: flex; flex-wrap: wrap; gap: 8px; }
.ea-person { min-inline-size: 8em; }

/* owner 22.11: dashboard search + quick filters, monthly summary */
.ds-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.ds-input { flex: 1 1 280px; max-inline-size: 420px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.ds-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ds-count { font-size: .9em; }
.mo-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mo-k { color: var(--muted); font-weight: 600; }
.mo-v { display: block; font-size: 2.2em; font-weight: 700; line-height: 1.2; }
.mo-card { margin-bottom: 14px; }
.mo-card h2 { margin-top: 0; font-size: 1.1em; }
.mo-range { margin: 0 0 10px; }

/* owner 22.11: an explicit 'all' above a list in the user's 'what this user sees' */
.all-toggle { font-weight: 600; margin-bottom: 6px; }
.perm-list .is-off { opacity: .45; }

/* owner 22.11: searchable checkbox lists (shifts: reps + queues) */
.check-list .cl-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.check-list .cl-search { flex: 1 1 200px; min-width: 160px; }
.check-list .cl-items { max-height: 260px; overflow-y: auto; }
.check-list .cl-items [hidden] { display: none; }
.sg-simple { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* owner 22.11: the row menu floats against the window (never cut off by a table's scrolling box) */
.row-menu.is-floating { position: fixed; top: auto; inset-inline-end: auto; z-index: 1000; }

/* ob1: invitation status under the 2FA badge */
.invite-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; }

/* owner 22.11: long lists in the user form - a search, the list scrolls inside */
.list-search { width: 100%; margin: 6px 0; }
.perm-list-long { max-height: 280px; overflow-y: auto; }
.perm-list-long [hidden] { display: none; }

/* wb6: call-center phone label */
.tag-cc { margin-inline-start: 6px; background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-size: 11px; white-space: nowrap; }

/* ob1: getting-started checklist */
.ob-card { margin-bottom: 12px; }
.ob-head { display: flex; align-items: center; gap: 12px; }
.ob-head h2 { margin: 0; }
.ob-head .btn { margin-inline-start: auto; }
.ob-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ob-step { display: flex; align-items: center; gap: 10px; }
.ob-mark { width: 1.2em; text-align: center; color: var(--muted); }
.ob-step.is-done .ob-mark { color: var(--ok, #1a7f37); }
.ob-step.is-done .ob-text { color: var(--muted); }
.ob-go { margin-inline-start: auto; font-size: 13px; }

/* mr1 (owner 22.11): the logo in place of the name - top bar 32 px high (up to 180 px wide), sign-in 56 px (up to 260 px) */
.tb-brand.has-logo, .auth-brand.has-logo { display: flex; align-items: center; }
.tb-brand.has-logo .brand-logo { height: 32px; max-width: 180px; width: auto; object-fit: contain; }
.auth-brand.has-logo .brand-logo { height: 56px; max-width: 260px; width: auto; object-fit: contain; }
/* a logo made for white keeps a light plate in the dark theme */
[data-theme="dark"] .brand-logo { background: #fff; border-radius: 6px; padding: 3px 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo { background: #fff; border-radius: 6px; padding: 3px 6px; } }

/* mr1: resellers on the superadmin's users page */
.rs-box { margin-top: 16px; }
.rs-one + .rs-one { margin-top: 14px; }
.rs-one h3 { margin: 6px 0; }

/* owner 22.11: checkboxes in the monitor's own style (the settings "kit" switches keep theirs) */
.field-check:not(.kit .field-check) > input[type="checkbox"], input[type="checkbox"].bulk-pick {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 18px; height: 18px; margin: 0; border-radius: 5px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface) center / 12px 12px no-repeat;
  transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.field-check:not(.kit .field-check) > input[type="checkbox"]:hover, input[type="checkbox"].bulk-pick:hover { border-color: var(--accent); }
.field-check:not(.kit .field-check) > input[type="checkbox"]:checked, input[type="checkbox"].bulk-pick:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.field-check:not(.kit .field-check) > input[type="checkbox"]:focus-visible, input[type="checkbox"].bulk-pick:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.field-check:not(.kit .field-check) > input[type="checkbox"]:disabled { opacity: .45; cursor: default; }
.field-check { gap: 8px; align-items: center; }

/* owner 22.11: a queue's colour picker (settings -> queues) */
.qc-pick { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.qc-pick button { border: 1.5px solid transparent; background: none; border-radius: 6px; padding: 3px; cursor: pointer; line-height: 1; }
.qc-pick .qc-auto { font-size: 12px; padding: 2px 6px; border-color: var(--border); color: var(--muted); }
.qc-pick button.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.qc-pick .qdot { width: 14px; height: 14px; margin: 0; display: block; }
.qc-pick button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* the call cannon's direction picker (owner 22.11): one row per direction, the whole row is the target */
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.cp-dirs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cp-dir { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.cp-dir:hover { border-color: var(--accent); }
.cp-dir:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cp-dir input { margin-block-start: 3px; accent-color: var(--accent); }
.cp-dir-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-dir-t small { color: var(--muted); line-height: 1.35; }
.cp-target { margin-block: 8px; }
.cp-warn .notice { margin-block-end: 6px; }
.cp-dirline strong { font-weight: 600; }

/* ob1 part 5: help per screen */
.help-h { font-size: 14px; margin: 14px 0 4px; color: var(--muted); font-weight: 600; }
.help-h:first-child { margin-top: 0; }
.help-p { margin: 0; line-height: 1.55; }
.help-list { margin: 0; padding-inline-start: 20px; line-height: 1.6; }
.help-tip { margin: 14px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); line-height: 1.5; }
.help-more { margin: 12px 0 0; font-size: 13px; }

/* ui1 (owner 23.11): users list - one line per user, rights in a side panel */
.ul-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.ul-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.ul-sum .badge { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.ul-sum .badge-ok { background: var(--ok-bg); border-color: transparent; }
.ul-sum .badge-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.ul-top .users-lic { margin: 0; }
.ul-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.ul-search { flex: 1 1 260px; min-width: 0; padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
.ul-seg, .qt-seg, .qt-filters { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
.ul-seg-b, .qt-seg-b { font: inherit; font-size: 13px; padding: 5px 12px; border: 0; border-inline-start: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; }
.ul-seg-b:first-child, .qt-seg-b:first-child { border-inline-start: 0; }
.ul-seg-b.is-on, .qt-seg-b.is-on { background: var(--accent); color: var(--on-accent); }
.ul-seg-b:focus-visible, .qt-seg-b:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ul-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.ul-split.has-panel { grid-template-columns: minmax(0, 1fr) 290px; }
.ul-panel-top { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.ul-close { font-size: 18px; line-height: 1; padding: 2px 8px; }
.qt-ab { display: inline-flex; gap: 6px; }
.ul-main { min-width: 0; }
.ul-main .tbl td { white-space: nowrap; }
.ul-who b { display: block; font-weight: 600; }
.ul-who small { color: var(--muted); font-size: 12px; }
.ul-row.ul-on td { background: var(--accent-soft); }
.ul-scope { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.ul-shown { margin: 6px 0 0; font-size: 12.5px; }
.chip-role { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chip-role-manager, .chip-role-reseller, .chip-role-superadmin { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.link-btn { font: inherit; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: start; }
.ul-panel { position: sticky; top: 12px; display: grid; gap: 10px; }
.ul-panel-h { margin: 0; font-size: 15px; }
.ul-panel-sub { margin: 0; font-size: 12.5px; }
.ul-area { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; }
.ul-bar, .qt-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ul-bar { grid-column: 1 / -1; }
.ul-bar i, .qt-bar i { display: block; height: 100%; background: var(--accent); }
.ul-list summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.ul-list ul { margin: 6px 0 0; padding-inline-start: 18px; max-height: 260px; overflow: auto; font-size: 12.5px; line-height: 1.6; }
@media (max-width: 1100px) { .ul-split.has-panel { grid-template-columns: minmax(0, 1fr); } .ul-panel { position: static; } }

/* ui1: permission groups as cards */
.gc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin: 0 0 8px; }
.gc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; align-content: start; }
.gc-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gc-h b { font-size: 15.5px; }
.gc-h .muted { font-size: 12.5px; }
.gc-faces { display: flex; align-items: center; }
.gc-faces i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border: 2px solid var(--surface); margin-inline-start: -6px; }
.gc-faces i:first-child { margin-inline-start: 0; }
.gc-faces .muted { margin-inline-start: 8px; font-size: 12.5px; }
.gc-rights { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-chip { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.gc-tpl .gc-chip { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.gc-f { display: flex; flex-wrap: wrap; gap: 6px; }

/* ui1: the dashboard's queue table (above 30 queues) */
.qt { display: grid; gap: 8px; }
.qt-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qt-hint { font-size: 12.5px; }
.qt-n { font-weight: 600; margin-inline-start: 2px; }
.qt-tbl td { white-space: nowrap; }
.qt-row { cursor: pointer; }
.qt-row:focus-visible td { outline: 2px solid var(--accent); outline-offset: -2px; }
.qt-row.is-waiting td:first-child { box-shadow: inset -3px 0 0 var(--crit); }
[dir="ltr"] .qt-row.is-waiting td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.qt-row.is-waiting .qt-wait { color: var(--crit); font-weight: 700; }
.qt-name .qdot { margin-inline-end: 6px; }
.qt-num { margin-inline-start: 6px; font-size: 12px; }
.qt-crit { color: var(--crit); font-weight: 700; }
.qt-warnc { color: var(--warn); }
.qt-sla { display: flex; align-items: center; gap: 6px; }
.qt-bar { width: 64px; }
.qt-bar i.is-crit { background: var(--crit); }
.qt-bar i.is-warn { background: var(--warn); }
.qt-bar i.is-ok { background: var(--ok); }
.qt-more { margin: 0; font-size: 12.5px; }
.dw-tools .qt-seg { margin-inline-end: 4px; }

/* ui1 (d): lists */
.ls-explain { margin: 8px 0 10px; color: var(--muted); font-size: 13.5px; max-width: 90ch; }

/* ui1 (d): shifts - the week and a card per shift */
.sg-sum { margin: 0 0 10px; }
.sw-wrap { border: 0; background: none; margin: 0 0 12px; }
.sw { display: grid; gap: 6px; min-width: 720px; }
.sw-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.sw-day { font-size: 12.5px; color: var(--muted); }
.sw-row.is-today .sw-day { color: var(--text); font-weight: 600; }
.sw-track { position: relative; height: 24px; background: var(--surface-2); border-radius: 4px; }
.sw-ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); direction: ltr; }
[dir="rtl"] .sw-ticks { direction: rtl; }
.sw-ticks span { position: absolute; transform: translateX(50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
[dir="ltr"] .sw-ticks span { transform: translateX(-50%); }
.sw-bar { position: absolute; top: 3px; height: 18px; border-radius: 3px; font-size: 11.5px; line-height: 18px; padding: 0 6px; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-bar, .sc2-dot { background: var(--qc, var(--accent)); }
.sw-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--crit); }
.sc2 { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; align-content: start; }
.sc2-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc2-h b { font-size: 15.5px; }
.sc2-h .muted { font-size: 12.5px; }
.sc2-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sc2-l { font-size: 12.5px; align-self: center; }
.sc2-more summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.sc2-more .tbl-wrap { margin-top: 8px; }

/* ui1 (d): wall screens */
.wb-sum { margin: 0 0 10px; }
.wb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; align-content: start; }
.wb-top { display: flex; gap: 12px; align-items: center; }
.wb-top b { display: block; font-size: 15px; margin-bottom: 3px; }
.wb-thumb { flex: none; width: 96px; height: 56px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 5px; }
.wb-thumb i { background: var(--accent-soft); border-radius: 2px; }
.wb-thumb i.k { background: var(--accent); opacity: .55; }
.wb-chip { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: normal; }
.wb-ip { font-size: 12px; align-self: center; }
.wb-created { margin: 0; font-size: 12px; }
.wb-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 14px; }
.wb-steps p { margin: 0 0 6px; }
.wb-url { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-url-text { font-size: 15px; font-weight: 600; padding: 4px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }

/* ui1 (d): costs */
.cost-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; margin: 0 0 10px; border-radius: 6px; background: var(--accent-soft); font-size: 13px; }
.cost-bulk input, .cost-bulk select { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); }

/* ui1 (e): report queue filter */
.rh-qfind { width: 100%; margin: 0 0 6px; }
.rh-qchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
[dir="rtl"] .rh-qchip { padding: 2px 10px 2px 4px; }
.rh-qchip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 999px; }
.rh-qchip-x:hover { background: var(--surface); }
.rh-qchip-s { margin: 0; }

/* ui1 (e): outgoing mail */
.smtp-sum { margin: 0 0 12px; }
.smtp-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.smtp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.smtp-test { display: grid; gap: 8px; align-content: start; }
.smtp-test .btn { justify-self: start; }
.smtp-last { margin: 0; font-size: 12.5px; }
@media (max-width: 1000px) { .smtp-split { grid-template-columns: minmax(0, 1fr); } }
