/* ============================================================
   DEVICE REGISTER — design tokens
   Brand: Saudi Water Authority visual identity. Navy Blue carries
   the chrome, Cobalt Blue the text that acts, Bright Navy Blue the
   fills, Robin Egg Blue the single accent. Red and amber survive
   untouched: they are status signals, not decoration.
   Self-hosted type only — the SWA network has no CDN.
   ============================================================ */

/* ---------- Arabic type ----------
   IBM Plex Sans Arabic, four weights, uploaded beside this file. The
   guideline sets Arabic in Plex; it also carries Latin, so a mixed line
   (DEV-0007 — جهاز) stays one family on one baseline. Declared only for
   [lang="ar"] below, so an English reader downloads none of it. */
@font-face{
  font-family:"IBM Plex Sans Arabic";
  src:url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-weight:400;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"IBM Plex Sans Arabic";
  src:url("fonts/IBMPlexSansArabic-Medium.woff2") format("woff2");
  font-weight:500;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"IBM Plex Sans Arabic";
  src:url("fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
  font-weight:600;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"IBM Plex Sans Arabic";
  src:url("fonts/IBMPlexSansArabic-Bold.woff2") format("woff2");
  font-weight:700;font-style:normal;font-display:swap;
}
:root{
  color-scheme: light;
  /* structure — the SWA blues (brand guideline §2) */
  --void:#000633;
  --deep:#000066;          /* Navy Blue, the darkest of the five */
  --deep-2:#000A45;
  --deep-line:#1B2470;
  /* chrome — the top bar, the login panel, primary buttons */
  --chrome:#000066;        /* Navy Blue */
  --chrome-2:#000A45;
  --chrome-line:#1B2470;
  --chrome-ink:#EDEDED;    /* Bright Gray */
  --chrome-2text:#C7CBE8;
  --chrome-3text:#A9AFD6;
  --chrome-seg:#B9C3E8;
  --brass:#1AD9C7;         /* Robin Egg Blue replaces brass as the one accent */
  --brass-ink:#00231F;
  /* interaction */
  --tide:#1971E5;          /* Bright Navy Blue, the interactive fill */
  --tide-ink:#003EB1;      /* Cobalt Blue, legible as text: 9.04:1 on white */
  --tide-soft:#E8F0FC;
  --tide-rule:#B9CEF2;
  --ring:rgba(25,113,229,.18);
  /* surfaces */
  --paper:#F2F4F7;
  --surface:#FFFFFF;
  --sunken:#E9ECF2;
  --well:#F8FAFC;
  --row-hover:#F6F9FD;
  /* rules */
  --rule:#DDE2EA;
  --rule-2:#C5CCD8;
  /* text */
  --ink:#0D1C1E;
  --ink-2:#33413E;
  --ink-3:#5A6764;
  --ink-4:#6C7773;
  /* signals */
  --amber:#A9661C;
  --amber-ink:#7C4A12;
  --amber-soft:#FBF1E3;
  --amber-rule:#E8D2AE;
  --clay:#9C3823;
  --clay-ink:#7E2C1B;
  --clay-soft:#FBE9E4;
  --clay-rule:#EFC9BC;
  /* controls that need their own colour in each theme */
  --btn-hover:#F7F9FC;
  --pri-bg:#003EB1;        /* Cobalt Blue; white on it is 9.04:1 */
  --pri-bg-2:#00349C;
  --pri-ink:#FFFFFF;
  --avatar-bg:#003EB1;
  --avatar-ink:#EAF1FE;
  --toast-bg:#000066;
  --toast-ink:#EDEDED;
  --tag-stripe:#000066;
  --scrim:rgba(8,25,28,.44);
  --sh-modal:0 24px 56px -16px rgba(8,25,28,.45);
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%235A6764' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  /* ---------- data viz ----------
     Four categorical slots, in a fixed order, never cycled and never assigned
     by rank — a colour follows the thing it names. The order is validated:
     every adjacent pair clears ΔE 18 under protan/deutan simulation and ΔE 19
     unsimulated, and every slot is at least 3:1 against the white panel.

     Slot 1 is the brand's Bright Navy; 2, 3 and 4 are the teal, violet and
     amber that read as distinct from it and from each other. Amber sits in
     slot 4 deliberately, so a chart never places the colour that means
     "late" beside a series that does not.

     --series-* are the two series of the throughput chart, which are also
     distinguished by a fill pattern, so the pair survives greyscale print.
     --ramp-1..5 are an ordinal blue ramp for the memory distribution: light to
     dark, one hue, used only where the categories have a natural order. */
  --series-1:#1971E5;
  --series-2:#1B9E8F;
  --series-3:#6F5BD6;
  --series-4:#C2701E;
  --series-a:#1971E5;
  --series-b:#1B9E8F;
  --series-b-hatch:rgba(255,255,255,.55);
  --stack-1:#1971E5;
  --stack-2:#1B9E8F;
  --stack-3:#C2701E;
  --stack-4:#6F5BD6;   /* the fourth categorical slot */
  --stack-5:#B4552F;   /* fifth, only if a whole ever splits that far */
  --stack-gap:#8A93A6; /* a gap, not a kind: a neutral belongs to an unknown */
  --stack-ink:#FFFFFF;      /* label ink on the dark slots */
  --stack-ink-alt:#04101F;  /* label ink on the light slots */
  --ramp-1:#7FA8E6;
  --ramp-2:#5490E0;
  --ramp-3:#2F72CE;
  --ramp-4:#1B54A8;
  --ramp-5:#0D3A72;
  --grid:#E2E6F0;
  /* type — system stack, guaranteed present on the target machines */
  --sans:"Segoe UI Variable Text","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;
  --mono:"Cascadia Mono","Consolas",ui-monospace,"SF Mono",Menlo,monospace;
  --sans-ar:"IBM Plex Sans Arabic","Segoe UI","Segoe UI Variable Text",Tahoma,Arial,sans-serif;
  --mono-ar:"IBM Plex Sans Arabic","Cascadia Mono","Consolas",ui-monospace,monospace;
  --r:3px;
  --sh:0 1px 2px rgba(8,25,28,.04),0 6px 20px -10px rgba(8,25,28,.14);
}

/* ============================================================
   DARK THEME
   Not an inverted screenshot. Same register: the paper becomes
   the colour of a plant at night, the ink becomes chalk, and the
   tide gets brighter rather than darker so a bar still reads as
   a bar. Brass and clay keep their jobs.
   ============================================================ */
[data-theme="dark"]{
  color-scheme: dark;
  --void:#030D0F;
  --deep:#0C2428;
  --deep-2:#081C1F;
  --deep-line:#16205C;
  --chrome:#070E38;
  --chrome-2:#050A2C;
  --chrome-line:#1A2560;
  --chrome-ink:#EDEDED;
  --chrome-2text:#AEB8DE;
  --chrome-3text:#9AA5D2;
  --chrome-seg:#9AA5D2;
  --brass:#1AD9C7;          /* Robin Egg Blue reads at 9.35:1 on the dark surface */
  --brass-ink:#00231F;
  --tide:#11A2F7;           /* Vivid Cerulean: 5.97:1 on --surface */
  --tide-ink:#90D4FA;       /* Pale Cyan: 10.29:1, for link text */
  --tide-soft:#0B2038;
  --tide-rule:#1B4670;
  --ring:rgba(17,162,247,.28);
  --paper:#040A1C;
  --surface:#0A1226;
  --sunken:#070E20;
  --well:#070E20;
  --row-hover:#111C36;
  --rule:#16213C;
  --rule-2:#26334F;
  --ink:#E9EDF6;
  --ink-2:#C3CCE0;
  --ink-3:#9AA6BF;
  --ink-4:#8A96AF;
  --amber:#D9A05A;
  --amber-ink:#E9BE84;
  --amber-soft:#251A0C;
  --amber-rule:#4A3418;
  --clay:#E4795F;
  --clay-ink:#F0A896;
  --clay-soft:#2A1512;
  --clay-rule:#55281F;
  --btn-hover:#13203C;
  --pri-bg:#1971E5;
  --pri-bg-2:#1659BE;
  --pri-ink:#FFFFFF;
  --avatar-bg:#123A6B;
  --avatar-ink:#CFE4FF;
  --toast-bg:#070E38;
  --toast-ink:#EDEDED;
  --tag-stripe:#11A2F7;
  --scrim:rgba(2,5,16,.68);
  --sh-modal:0 28px 64px -20px rgba(0,0,0,.8);
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%239AA6BF' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --series-1:#3987E5;
  --series-2:#2AA79A;
  --series-3:#8E7BE8;
  --series-4:#C9832E;
  --series-a:#3987E5;
  --series-b:#2AA79A;
  --series-b-hatch:rgba(4,10,28,.55);
  --stack-1:#3987E5;
  --stack-2:#2AA79A;
  --stack-3:#C9832E;
  --stack-4:#8E7BE8;
  --stack-5:#B96A3A;
  --stack-gap:#6C7791;
  --stack-ink:#04101F;
  --stack-ink-alt:#FFFFFF;
  --ramp-1:#1B4A8C;
  --ramp-2:#2762B4;
  --ramp-3:#3B82D6;
  --ramp-4:#63A2E8;
  --ramp-5:#9CC6F4;
  --grid:#14203A;
  --sh:0 1px 2px rgba(0,0,0,.4),0 8px 26px -12px rgba(0,0,0,.72);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--paper);color:var(--ink);
  font-family:var(--sans);font-size:13px;line-height:1.5;
  -webkit-font-smoothing:antialiased;
  font-variant-numeric:tabular-nums;
}
button{font-family:inherit;font-size:inherit;cursor:pointer}
a{color:inherit;text-decoration:none}
.mono{font-family:var(--mono);font-style:normal}
.hidden{display:none!important}

/* ---------- Arabic ----------
   One rule changes the type for the whole interface. Arabic is slightly
   taller than Segoe at the same size, so the base size comes down a
   notch and the line height goes up; without both, Arabic lists breathe
   worse than the English ones they replace. */
[lang="ar"] body{font-family:var(--sans-ar);font-size:13.5px;line-height:1.72}
[lang="ar"] .theme.lang{font-family:var(--sans)}
[lang="ar"] .mono,
[lang="ar"] .idtag,
[lang="ar"] .tag-id{font-family:var(--mono-ar);letter-spacing:0}

/* Identifiers are not Arabic and must not be reordered by the bidi
   algorithm when they end an Arabic sentence. MAC addresses, serials,
   public IDs and hostnames all carry .mono. */
.mono,.tag-id,.idtag,.cell-b.mono{unicode-bidi:isolate;direction:ltr;display:inline-block}
[dir="rtl"] .mono,[dir="rtl"] .tag-id,[dir="rtl"] .idtag{text-align:right}

/* Arabic-Indic digits are deliberately not used: every technical system
   this register sits beside uses Western digits, and a MAC address in
   Arabic-Indic digits cannot be read aloud to a colleague. */

.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- focus: never removed, always visible ---------- */
:focus-visible{outline:2px solid var(--tide);outline-offset:2px}

/* ============================ top bar ============================ */
.top{
  background:var(--chrome);color:var(--chrome-ink);height:54px;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 20px;position:sticky;top:0;z-index:50;
  border-bottom:1px solid var(--chrome-line);
}
.top-l{display:flex;align-items:center;gap:12px;min-width:0}
.brand-mark{display:block;flex:none}
/* The mark was 26px in a 54px bar — legible only if you already knew what it
   was. 34px is the size at which the water motif resolves at arm's length on a
   desk monitor, and it still leaves the bar's optical centre intact. The logo
   is an inline width/height attribute on the <img>, so this rule and that
   attribute have to move together; layout.php carries the same two numbers. */
.top .brand-mark img{width:54px;height:57px;display:block}
.brand-txt{line-height:1.2}
.brand-txt b{display:block;font-size:13px;font-weight:600;letter-spacing:.005em;color:var(--chrome-ink)}
.brand-txt span{display:block;font-size:11.5px;color:var(--chrome-2text)}
.top-sep{width:1px;height:22px;background:var(--chrome-line);margin:0 2px}
.top-crumb{font-size:12px;color:var(--chrome-2text)}

/* demo role switch */
.switch{display:flex;align-items:center;gap:10px}
.switch label{font-size:11.5px;color:var(--chrome-3text)}
.seg{display:inline-flex;border:1px solid var(--chrome-line);border-radius:var(--r);overflow:hidden;background:var(--chrome-2)}
.seg button{
  background:none;border:0;border-inline-end:1px solid var(--chrome-line);
  color:var(--chrome-seg);padding:5px 11px;font-size:11.5px;font-weight:500;
  transition:background .12s,color .12s;
}
.seg button:last-child{border-inline-end:0}
.seg button:hover{color:var(--chrome-ink);background:rgba(255,255,255,.06)}
.seg button[aria-pressed="true"]{background:var(--brass);color:var(--brass-ink);font-weight:600}
.seg button:focus-visible{outline:2px solid var(--brass);outline-offset:-2px}

/* ---------- theme toggle ---------- */
.top-r{display:flex;align-items:center;gap:14px}
.theme{
  display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 10px;
  border:1px solid var(--chrome-line);border-radius:var(--r);
  background:var(--chrome-2);color:var(--chrome-seg);
  font-size:11.5px;font-weight:500;white-space:nowrap;
  transition:background .12s,color .12s,border-color .12s;
}
.theme:hover{color:var(--chrome-ink);border-color:var(--chrome-seg)}
.theme:focus-visible{outline:2px solid var(--brass);outline-offset:2px}
.theme svg{flex:none}
.theme .ico-sun{display:none}
[data-theme="dark"] .theme .ico-sun{display:block}
[data-theme="dark"] .theme .ico-moon{display:none}
.theme-plain{
  background:transparent;border-color:var(--rule-2);color:var(--ink-3);
  width:32px;height:32px;padding:0;justify-content:center;
}
/* The language switch sits in the chrome, so it takes the chrome's colours
   rather than the page's. */
.top .theme.lang{border-color:var(--chrome-line);background:var(--chrome-2);color:var(--chrome-seg);padding:0 11px;font-weight:600}
.top .theme.lang:hover{color:var(--chrome-ink);border-color:var(--chrome-seg)}
.top .theme.lang:focus-visible{outline:2px solid var(--brass);outline-offset:2px}
.theme-plain:hover{background:var(--sunken);border-color:var(--ink-4);color:var(--ink)}
.theme-plain:focus-visible{outline:2px solid var(--tide);outline-offset:2px}

/* ============================ shell ============================ */
.shell{display:grid;grid-template-columns:196px minmax(0,1fr);min-height:calc(100vh - 54px)}
.rail{
  border-inline-end:1px solid var(--rule);padding:16px 10px;
  display:flex;flex-direction:column;justify-content:space-between;
  position:sticky;top:54px;height:calc(100vh - 54px);background:var(--paper);
}
.nav-sec{margin-bottom:16px}
.nav-h{font-size:10.5px;font-weight:600;color:var(--ink-4);padding:0 8px 6px;letter-spacing:.04em}
.nav-i{
  display:flex;align-items:center;gap:9px;width:100%;
  padding:7px 8px;border-radius:var(--r);border:0;border-inline-start:2px solid transparent;
  background:none;color:var(--ink-2);font-size:13px;text-align:start;
  margin-inline-start:-2px;transition:background .1s,color .1s;
}
.nav-i svg{flex:none;color:var(--ink-4)}
.nav-i:hover{background:var(--sunken);color:var(--ink)}
.nav-i[aria-current="page"]{background:var(--surface);border-inline-start-color:var(--tide);color:var(--ink);font-weight:600;box-shadow:inset 0 0 0 1px var(--rule)}
.nav-i[aria-current="page"] svg{color:var(--tide)}
.nav-count{margin-inline-start:auto;font-family:var(--mono);font-size:10.5px;color:var(--clay);background:var(--clay-soft);border:1px solid var(--clay-rule);border-radius:9px;padding:0 5px;line-height:15px}

.who{display:flex;align-items:center;gap:9px;padding:9px 6px 0;border-top:1px solid var(--rule)}
.who-av{width:28px;height:28px;border-radius:50%;background:var(--avatar-bg);color:var(--avatar-ink);display:grid;place-items:center;font-size:10.5px;font-weight:600;flex:none}
.who-t{min-width:0;line-height:1.25}
.who-t b{display:block;font-size:12px;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.who-t span{display:block;font-size:10.5px;color:var(--ink-4)}
.who-out{margin-inline-start:auto;background:none;border:0;padding:4px;border-radius:var(--r);color:var(--ink-4);line-height:0}
.who-out:hover{color:var(--clay);background:var(--clay-soft)}

.main{padding:22px 26px 60px;min-width:0}
/* The ceiling that was declared but never applied: without it the whole
   application pinned to the left of a wide monitor and the right third of
   the screen was empty. Centred, with a generous ceiling — a manager's report
   page uses the room, and the two-column report grid is what stops a line of
   text from running 1560px wide. */
.wrap{max-width:1440px;margin-inline:auto}

/* ============================ page head ============================ */
.ph{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:18px}
.ph h1{margin:0;font-size:21px;line-height:1.25;font-weight:650;letter-spacing:-.018em;color:var(--ink)}
.ph p{margin:4px 0 0;font-size:12.5px;color:var(--ink-3);max-width:68ch}
.ph-a{display:flex;gap:8px;flex:none}

/* ============================ buttons ============================ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:32px;padding:0 13px;border-radius:var(--r);
  border:1px solid var(--rule-2);background:var(--surface);color:var(--ink-2);
  font-size:12.5px;font-weight:500;white-space:nowrap;
  transition:background .12s,border-color .12s,color .12s;
}
.btn:hover{background:var(--btn-hover);border-color:var(--ink-4);color:var(--ink)}
.btn-pri{background:var(--pri-bg);border-color:var(--pri-bg);color:var(--pri-ink)}
.btn-pri:hover{background:var(--pri-bg-2);border-color:var(--pri-bg-2);color:var(--pri-ink)}
.btn-ghost{background:none;border-color:transparent;color:var(--ink-3);height:27px;padding:0 7px}
.btn-ghost:hover{background:var(--sunken);border-color:transparent;color:var(--ink)}
.btn-danger{color:var(--clay);border-color:var(--clay-rule);background:var(--surface)}
.btn-danger:hover{background:var(--clay-soft);border-color:var(--clay);color:var(--clay-ink)}
.btn-sm{height:27px;padding:0 9px;font-size:12px}
.btn-icon{width:27px;height:27px;padding:0;line-height:0}
.btn[disabled]{opacity:.45;cursor:not-allowed}

/* ============================ KPI row ============================ */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--rule);border:1px solid var(--rule);border-radius:var(--r);overflow:hidden;margin-bottom:16px}
.kpi{background:var(--surface);padding:14px 16px 13px;position:relative}
.kpi-h{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11.5px;font-weight:500;color:var(--ink-3);margin-bottom:9px}
.kpi-v{font-family:var(--mono);font-size:31px;line-height:1;font-weight:500;letter-spacing:-.03em;color:var(--ink)}
.kpi-n{margin-top:8px;font-size:11.5px;color:var(--ink-4)}
.kpi[data-k="withit"] .kpi-v{color:var(--tide-ink)}
.kpi[data-k="over"] .kpi-v{color:var(--clay)}
.kpi[data-k="over"]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--clay)}
.kpi[data-k="withit"]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--tide)}
.tick{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--clay-ink);background:var(--clay-soft);border:1px solid var(--clay-rule);border-radius:9px;padding:0 6px;line-height:16px}
.tick i{width:5px;height:5px;border-radius:50%;background:currentColor}

/* ============================ strip (attention) ============================ */
.strip{display:grid;grid-template-columns:3px minmax(0,1fr);border:1px solid var(--clay-rule);border-radius:var(--r);background:var(--surface);overflow:hidden;margin-bottom:16px}
.strip-bar{background:var(--clay)}
.strip-in{padding:13px 16px 15px}
.strip-h{display:flex;align-items:baseline;gap:9px;margin-bottom:9px;flex-wrap:wrap}
.strip-h b{font-size:13.5px;font-weight:650;color:var(--clay-ink)}
.strip-h span{font-size:12px;color:var(--ink-3)}

/* ============================ panel + table ============================ */
.panel{background:var(--surface);border:1px solid var(--rule);border-radius:var(--r)}
.panel-h{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 14px;border-bottom:1px solid var(--rule);min-height:44px}
.panel-h h2{margin:0;font-size:13.5px;font-weight:650;letter-spacing:-.005em;color:var(--ink)}
.panel-h .meta{font-family:var(--mono);font-size:11.5px;color:var(--ink-4);font-weight:400}
.tw{overflow-x:auto}
table.t{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px}
.t thead th{
  position:sticky;top:0;z-index:1;
  text-align:start;font-weight:600;font-size:11px;color:var(--ink-3);
  padding:8px 12px;background:var(--sunken);
  border-bottom:1px solid var(--rule-2);white-space:nowrap;
}
.t thead th:first-child{padding-inline-start:14px}
.t thead th:last-child{padding-inline-end:14px}
.t tbody td{padding:9px 12px;border-bottom:1px solid var(--rule);vertical-align:middle;color:var(--ink-2)}
.t tbody td:first-child{padding-inline-start:14px}
.t tbody td:last-child{padding-inline-end:14px}
.t tbody tr:last-child td{border-bottom:0}
.t tbody tr{transition:background .1s}
.t tbody tr:hover{background:var(--row-hover)}
.t tbody tr[data-click]{cursor:pointer}
.cell-b{display:block;font-size:11px;color:var(--ink-4);margin-top:1px;line-height:1.35}
.idtag{font-family:var(--mono);font-size:10.5px;color:var(--ink-4);background:var(--sunken);border-radius:2px;padding:1px 5px;white-space:nowrap}
.strong{font-weight:600;color:var(--ink)}
.num{font-family:var(--mono);text-align:end;font-size:12px}
.t .r{text-align:end}
.empty-td{padding:0!important}

/* ---------- pills: status + state ---------- */
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;padding:1px 8px 1px 6px;border-radius:10px;border:1px solid transparent;white-space:nowrap;line-height:16px}
.pill i{width:5px;height:5px;border-radius:50%;background:currentColor;flex:none}
.p-open{color:var(--tide-ink);background:var(--tide-soft);border-color:var(--tide-rule)}
.p-pend{color:var(--amber-ink);background:var(--amber-soft);border-color:var(--amber-rule)}
.p-done{color:var(--ink-3);background:var(--sunken);border-color:var(--rule)}
.p-over{color:var(--clay-ink);background:var(--clay-soft);border-color:var(--clay-rule)}
.p-due{color:var(--amber-ink);background:var(--amber-soft);border-color:var(--amber-rule)}
.p-spare{color:var(--ink-3);background:transparent;border-color:var(--rule-2);border-style:dashed}
.p-ret{color:var(--ink-4);background:transparent;border-color:var(--rule);text-decoration:line-through}

/* ---------- filter bar ---------- */
.fbar{display:flex;gap:8px;padding:11px 14px;border-bottom:1px solid var(--rule);flex-wrap:wrap;align-items:center;background:var(--surface)}
.search{position:relative;flex:1 1 240px;min-width:200px}
.search svg{position:absolute;inset-inline-start:9px;top:50%;transform:translateY(-50%);color:var(--ink-4);pointer-events:none}
.search input{width:100%;height:32px;padding:0 10px 0 30px;font-family:var(--sans);font-size:12.5px;color:var(--ink);border:1px solid var(--rule-2);border-radius:var(--r);background:var(--surface)}
.search input::placeholder{color:var(--ink-4)}
.search input:focus{outline:none;border-color:var(--tide);box-shadow:0 0 0 3px var(--ring)}
select.sel{height:32px;padding:0 26px 0 9px;font-family:var(--sans);font-size:12px;color:var(--ink-2);border:1px solid var(--rule-2);border-radius:var(--r);background:var(--surface) var(--chev) no-repeat right 9px center;-webkit-appearance:none;appearance:none;cursor:pointer}
/* A background image cannot be logical, so the chevron gets an explicit
   mirror. The arrow is a shape, not a texture: pointing it the wrong way in
   an RTL form is the one place a logical property cannot save us. */
[dir="rtl"] select.sel{padding:0 9px 0 26px;background-position:left 9px center}
[dir="rtl"] .fld select{padding-right:9px;padding-left:26px;background-position:left 9px center}
[dir="rtl"] .search input{padding-left:10px;padding-right:30px}
select.sel:hover{border-color:var(--ink-4)}
select.sel:focus{outline:none;border-color:var(--tide);box-shadow:0 0 0 3px var(--ring)}
.fclear{font-size:12px;color:var(--tide-ink);background:none;border:0;padding:5px 2px;display:none}
.fclear.on{display:inline}
/* Shown by the script the moment it submits, so a slow query reads as work in
   progress rather than as a click that did nothing. */
.fbar-note{font-size:11.5px;color:var(--ink-4);margin-inline-start:auto}
.fclear:hover{text-decoration:underline}

/* ---------- empty state ---------- */
.empty{padding:38px 20px;text-align:center}
.empty b{display:block;font-size:13.5px;font-weight:650;color:var(--ink);margin-bottom:3px}
.empty p{margin:0 0 12px;font-size:12.5px;color:var(--ink-3)}

/* ---------- pager ---------- */
.pager{display:flex;align-items:center;justify-content:space-between;padding:9px 14px;border-top:1px solid var(--rule);font-size:12px;color:var(--ink-3)}
.pager .pg{display:flex;gap:4px}
.pg button{min-width:26px;height:26px;padding:0 7px;border:1px solid var(--rule-2);background:var(--surface);border-radius:var(--r);font-size:12px;color:var(--ink-2)}
.pg button[aria-current="true"]{background:var(--pri-bg);border-color:var(--pri-bg);color:var(--pri-ink);font-weight:600}
.pg button:hover:not([aria-current="true"]){background:var(--sunken)}

/* ============================ asset tag + device page ============================ */
.tag{
  position:relative;background:var(--surface);border:1px solid var(--rule-2);
  border-radius:var(--r);padding:15px 17px 14px;margin-bottom:16px;
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:start;
}
.tag::before{
  content:"";position:absolute;left:0;right:0;top:0;height:3px;
  background:repeating-linear-gradient(90deg,var(--tag-stripe) 0 10px,transparent 10px 16px);
}
.tag-h{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:3px}
.tag-h h1{margin:0;font-size:20px;font-weight:650;letter-spacing:-.02em;line-height:1.2;color:var(--ink)}
.tag-sub{display:flex;gap:12px;flex-wrap:wrap;align-items:center;font-size:12px;color:var(--ink-3)}
.tag-id{font-family:var(--mono);font-size:11.5px;color:var(--ink-3)}
.tag-a{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}

/* chain of custody strip — the one expressive element */
.chain{background:var(--surface);border:1px solid var(--rule);border-radius:var(--r);padding:15px 17px 13px;margin-bottom:16px}
.chain-h{font-size:11px;font-weight:600;color:var(--ink-4);margin-bottom:11px;letter-spacing:.04em}
.chain-track{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:0;align-items:start}
.node{position:relative;padding:0 14px 0 0}
.node:last-child{padding-inline-end:0}
.node::after{content:"";position:absolute;inset-inline-start:9px;inset-inline-end:0;top:6px;height:1px;background:var(--rule-2)}
.node:last-child::after{display:none}
.node-dot{width:13px;height:13px;border-radius:50%;background:var(--surface);border:1.5px solid var(--rule-2);position:relative;z-index:1;margin-bottom:8px;display:block}
.node.now .node-dot{background:var(--tide);border-color:var(--tide);box-shadow:0 0 0 3px var(--tide-soft)}
.node.now.over .node-dot{background:var(--clay);border-color:var(--clay);box-shadow:0 0 0 3px var(--clay-soft)}
.node.now.due .node-dot{background:var(--amber);border-color:var(--amber);box-shadow:0 0 0 3px var(--amber-soft)}
.node b{display:block;font-size:12.5px;font-weight:600;color:var(--ink);line-height:1.3}
.node span{display:block;font-size:11px;color:var(--ink-4);margin-top:2px;line-height:1.35}
.node .mono{font-size:10.5px;color:var(--ink-3)}

/* spec grid */
.specs{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:1px;background:var(--rule);border:1px solid var(--rule);border-radius:var(--r);overflow:hidden;margin-bottom:16px}
.spec{background:var(--surface);padding:11px 13px 12px}
.spec dt{font-size:10.5px;font-weight:600;color:var(--ink-4);margin-bottom:3px;letter-spacing:.02em}
.spec dd{margin:0;font-size:13px;color:var(--ink);font-weight:500}
.spec dd.m{font-family:var(--mono);font-size:12px;font-weight:400}
.spec dd.none{color:var(--ink-4);font-weight:400;font-style:italic}

.duo{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:16px;align-items:start}

/* ---------- timeline ---------- */
.tl{list-style:none;margin:0;padding:0}
.tl li{position:relative;padding:0 0 16px 22px;border-inline-start:1px solid var(--rule-2);margin-inline-start:6px}
.tl li:last-child{border-inline-start-color:transparent;padding-bottom:0}
.tl li::before{content:"";position:absolute;inset-inline-start:-4.5px;top:4px;width:8px;height:8px;border-radius:50%;background:var(--surface);border:1.5px solid var(--rule-2)}
.tl li.open::before{background:var(--tide);border-color:var(--tide)}
.tl li.over::before{background:var(--clay);border-color:var(--clay)}
.tl li.due::before{background:var(--amber);border-color:var(--amber)}
.tl-h{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin-bottom:2px}
.tl-h b{font-size:12.5px;font-weight:650;color:var(--ink)}
.tl-h .mono{font-size:10.5px;color:var(--ink-4)}
.tl-meta{font-size:11.5px;color:var(--ink-3);line-height:1.5}
.tl-note{margin:6px 0 0;font-size:12px;color:var(--ink-2);background:var(--row-hover);border-inline-start:2px solid var(--rule-2);padding:5px 9px;line-height:1.5}
.chg{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.chg span{font-family:var(--mono);font-size:10.5px;color:var(--ink-2);background:var(--sunken);border:1px solid var(--rule);border-radius:2px;padding:1px 6px}
.chg span b{font-weight:600;color:var(--ink)}
.chg .was{color:var(--ink-4)}

/* ============================ counter ============================ */
.counter{max-width:640px}
.cx{background:var(--surface);border:1px solid var(--rule-2);border-radius:var(--r);padding:20px 20px 18px;margin-bottom:16px}
.cx-lead{margin:0 0 14px;font-size:12.5px;color:var(--ink-3)}
.cx-big{position:relative;margin-bottom:6px}
.cx-big input{
  width:100%;height:52px;padding:0 14px 0 42px;font-family:var(--mono);font-size:16px;
  border:1px solid var(--rule-2);border-radius:var(--r);background:var(--surface);color:var(--ink);
  letter-spacing:.02em;
}
.cx-big input::placeholder{font-family:var(--sans);font-size:14px;color:var(--ink-4);letter-spacing:0}
.cx-big input:focus{outline:none;border-color:var(--tide);box-shadow:0 0 0 3px var(--ring)}
.cx-big svg{position:absolute;inset-inline-start:14px;top:50%;transform:translateY(-50%);color:var(--ink-4)}
.cx-hint{font-size:11.5px;color:var(--ink-4)}

.result{border:1px solid var(--tide-rule);background:var(--tide-soft);border-radius:var(--r);padding:14px 16px;margin-top:14px}
.result .r-h{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.result .r-h b{font-size:14px;font-weight:650;color:var(--ink)}
.result .r-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin-bottom:12px}
.result .r-grid dt{font-size:10.5px;color:var(--tide-ink);font-weight:600}
.result .r-grid dd{margin:1px 0 0;font-size:12.5px;color:var(--ink);font-weight:500}
.result .r-grid dd.m{font-family:var(--mono);font-size:11.5px;font-weight:400}
.nomatch{border:1px solid var(--amber-rule);background:var(--amber-soft);border-radius:var(--r);padding:13px 16px;margin-top:14px;font-size:12.5px;color:var(--amber-ink)}
.nomatch b{display:block;margin-bottom:3px;font-weight:650}
.nomatch .btn{margin-top:10px}

/* ============================ forms ============================ */
.form{max-width:940px}
.fgroup{margin-bottom:20px}
.fgroup-h{display:flex;align-items:baseline;gap:9px;padding-bottom:7px;border-bottom:1px solid var(--rule-2);margin-bottom:13px}
.fgroup-h h2{margin:0;font-size:13.5px;font-weight:650;color:var(--ink)}
.fgroup-h p{margin:0;font-size:11.5px;color:var(--ink-3)}
.fgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:11px 13px}
.fld{min-width:0}
.fld.wide{grid-column:1/-1}
.fld label{display:block;font-size:11.5px;font-weight:600;color:var(--ink-2);margin-bottom:4px}
.fld label .req{color:var(--clay);margin-inline-start:2px}
.fld label .opt{font-weight:400;color:var(--ink-4);margin-inline-start:4px;font-size:10.5px}
.fld input,.fld select,.fld textarea{
  width:100%;font-family:var(--sans);font-size:12.5px;color:var(--ink);
  border:1px solid var(--rule-2);border-radius:var(--r);background:var(--surface);
  padding:7px 9px;height:33px;
}
.fld input.m,.fld .m{font-family:var(--mono);font-size:12px;letter-spacing:.02em}
.fld textarea{height:auto;min-height:60px;resize:vertical;line-height:1.5}
.fld input::placeholder,.fld textarea::placeholder{color:var(--ink-4)}
.fld select{
  padding-inline-end:26px;-webkit-appearance:none;appearance:none;cursor:pointer;
  background:var(--surface) var(--chev) no-repeat right 9px center;
}
.fld input:focus,.fld select:focus,.fld textarea:focus{outline:none;border-color:var(--tide);box-shadow:0 0 0 3px var(--ring)}
.fld input:disabled,.fld select:disabled{background:var(--sunken);color:var(--ink-3);cursor:not-allowed}
.fld .hint{font-size:10.5px;color:var(--ink-4);margin-top:3px;line-height:1.4}
.fld .err{display:none;font-size:10.5px;color:var(--clay);margin-top:3px;font-weight:500}
.fld.bad input,.fld.bad select{border-color:var(--clay);box-shadow:0 0 0 3px rgba(156,56,35,.10)}
.fld.bad .err{display:block}

/* error summary */
.errsum{display:none;border:1px solid var(--clay-rule);background:var(--clay-soft);border-radius:var(--r);padding:12px 14px;margin-bottom:16px}
.errsum.on{display:block}
.errsum h2{margin:0 0 6px;font-size:13px;font-weight:650;color:var(--clay-ink)}
.errsum ul{margin:0;padding-inline-start:16px}
.errsum a{font-size:12px;color:var(--clay-ink);text-decoration:underline}
.form-act{display:flex;align-items:center;gap:9px;padding-top:4px;flex-wrap:wrap}
.form-act .sp{flex:1}

/* ============================ reports ============================ */
/* Two columns, explicitly. The old auto-fit resolved to four equal columns at
   1360px, so the four distribution cards were each ~328px while the model
   panel below them spanned the full width — two widths for one page of data.
   Collapses to one column under 1000px, below. */
.rep-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.rep-grid .wide{grid-column:1/-1}
.rep-list{padding:6px 14px 12px}
.dist{display:grid;grid-template-columns:minmax(0,1fr) 40px;gap:10px;align-items:center;padding:7px 0;border-bottom:1px solid var(--rule)}
.dist:last-child{border-bottom:0}
.dist-l{min-width:0}
.dist-l b{display:block;font-size:12px;font-weight:500;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:4px}
.dist-sub{color:var(--ink-4);font-weight:400}
.dist-track{height:5px;background:var(--sunken);border-radius:1px;overflow:hidden}
.dist-fill{display:block;height:100%;background:var(--tide);border-radius:1px}
.dist-fill.due{background:var(--amber)}
.dist-fill.over{background:var(--clay)}
.dist-n{font-family:var(--mono);font-size:12px;text-align:end;color:var(--ink)}
.dist-h{display:flex;justify-content:space-between;align-items:baseline;padding:11px 14px 7px;gap:12px}
.dist-h b{font-size:12px;font-weight:650;color:var(--ink)}
.dist-h span{font-size:10.5px;color:var(--ink-4)}
.rep-empty{margin:8px 0;font-size:12px;color:var(--ink-4)}
.rep-note{margin:14px 0 0;font-size:11.5px;color:var(--ink-4);line-height:1.6;max-width:96ch}

/* big chart */
.chart{padding:14px 16px 16px}
/* The label used to be a fixed 120px, so "Lenovo ThinkCentre M70q" truncated
   to "Lenovo Think…" while its own bar was allowed to run 1000px. It now
   grows to 30% of the row, which is enough for a real model name at any
   width the page is actually shown at. */
.crow{display:grid;grid-template-columns:minmax(120px,30%) minmax(0,1fr) 44px;gap:10px;align-items:center;margin-bottom:9px}
.crow:last-child{margin-bottom:0}
.crow-l{font-size:12px;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crow-sub{color:var(--ink-4)}
.crow-t{height:16px;background:var(--sunken);border-radius:1px;overflow:hidden;display:flex}
.crow-f{height:100%;background:var(--tide)}
.crow-n{font-family:var(--mono);font-size:12px;text-align:end;color:var(--ink)}
.crow:hover .crow-f{background:var(--tide-ink)}

/* stack bar (part-to-whole) */
.stack-w{padding:4px 16px 16px}
.stack{height:26px;display:flex;border-radius:2px;overflow:hidden;margin:0 0 10px}
.stack div{display:grid;place-items:center;font-family:var(--mono);font-size:10.5px;color:var(--stack-ink);overflow:hidden;white-space:nowrap;transition:opacity .12s}
.stack div:hover{opacity:.86}
.stack .s1{background:var(--tide)}
.stack .s2{background:var(--stack-2)}
.stack .s3{background:var(--stack-3)}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--ink-3)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:8px;height:8px;border-radius:1px;display:block}

/* ============================ throughput ============================ */
.wk-wrap{display:grid;grid-template-columns:minmax(0,1.62fr) minmax(0,1fr)}
.week{padding:13px 16px 12px;border-inline-end:1px solid var(--rule);min-width:0}
.wk-legend{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:11px}
.wk-legend span{display:inline-flex;align-items:center;gap:7px;font-size:11.5px;color:var(--ink-3)}
.wk-key{width:11px;height:11px;border-radius:1px;flex:none;display:block}
.wk-key.in{background:var(--series-a)}
.wk-key.out{background:repeating-linear-gradient(135deg,var(--series-b) 0 2.5px,var(--series-b-hatch) 2.5px 5px);outline:1px solid var(--series-b);outline-offset:-1px}
/* The column count comes from PHP now, as --wk-cols, instead of being written
   into the rule as 8. THROUGHPUT_WEEKS is the one constant the handover says
   Salman may change, and a hardcoded 8 meant the chart broke silently the day
   he did. */
.wk-plot{display:grid;grid-template-columns:repeat(var(--wk-cols,8),minmax(0,1fr));gap:4px;height:150px;position:relative;border-bottom:1px solid var(--rule-2)}
.wk-plot::before{
  content:"";position:absolute;left:0;right:0;top:0;height:calc(100% - 1px);pointer-events:none;
  background:repeating-linear-gradient(to top,var(--grid) 0 1px,transparent 1px 50%);
}
.wk-grp{display:flex;align-items:center;justify-content:center;gap:3px;position:relative;z-index:1;padding:0 1px}
.wk-grp.now{background:var(--sunken);border-radius:2px 2px 0 0}
.wk-col{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;flex:1 1 0;min-width:0;height:100%}
.wk-n{font-family:var(--mono);font-size:10px;line-height:1;color:var(--ink-4);margin-bottom:4px}
.wk-grp.now .wk-n{color:var(--ink-2);font-weight:600}
.wk-b{width:100%;max-width:17px;border-radius:1px 1px 0 0;display:block}
.wk-b.in{background:var(--series-a)}
.wk-b.out{background:repeating-linear-gradient(135deg,var(--series-b) 0 2.5px,var(--series-b-hatch) 2.5px 5px);outline:1px solid var(--series-b);outline-offset:-1px}
.wk-b.zero{background:var(--rule-2)}
.wk-b.out.zero{background:var(--rule-2);outline:0}
.wk-x{display:grid;grid-template-columns:repeat(var(--wk-cols,8),minmax(0,1fr));gap:4px;margin-top:6px}
.wk-x span{text-align:center;font-size:10.5px;line-height:1.3;color:var(--ink-4)}
.wk-x span.now{color:var(--ink-2);font-weight:600}
.wk-sum{margin:11px 0 0;padding-top:10px;border-top:1px solid var(--rule);font-size:11.5px;color:var(--ink-3);line-height:1.55}
.wk-sum b{font-family:var(--mono);font-weight:600;color:var(--ink);font-size:12px}

.wk-side{padding:13px 16px 14px;min-width:0}
.wk-side h3{margin:0 0 2px;font-size:11px;font-weight:650;color:var(--ink-4);letter-spacing:.045em}
.wk-side .sub{margin:0 0 10px;font-size:11.5px;color:var(--ink-3)}
.wk-tbl{width:100%;border-collapse:collapse;font-size:12px}
.wk-tbl th{text-align:end;font-size:10.5px;font-weight:600;color:var(--ink-4);padding:0 0 6px;border-bottom:1px solid var(--rule-2);white-space:nowrap}
.wk-tbl th:first-child{text-align:start}
.wk-tbl td{padding:6px 0;border-bottom:1px solid var(--rule);color:var(--ink-2);vertical-align:middle}
.wk-tbl tr:last-child td{border-bottom:0}
.wk-tbl td.n{font-family:var(--mono);text-align:end;font-size:12px;color:var(--ink);width:38px}
.wk-tbl td.net{font-family:var(--mono);text-align:end;font-size:12px;width:44px;color:var(--ink-4)}
.wk-tbl td.net.up{color:var(--clay-ink);font-weight:600}
.wk-tbl tfoot td{border-top:1px solid var(--rule-2);border-bottom:0;padding-top:8px;font-weight:600;color:var(--ink)}
.wk-tbl tfoot td.n,.wk-tbl tfoot td.net{color:var(--ink);font-weight:600}
.wk-note{margin:10px 0 0;font-size:11px;line-height:1.5;color:var(--ink-4);border-top:1px solid var(--rule);padding-top:9px}

/* ============================ admin ============================ */
.tabs{display:flex;gap:1px;border-bottom:1px solid var(--rule-2);margin-bottom:16px}
.tab{padding:8px 14px;font-size:12.5px;font-weight:500;color:var(--ink-3);background:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px}
.tab:hover{color:var(--ink)}
.tab[aria-selected="true"]{color:var(--tide-ink);border-bottom-color:var(--tide);font-weight:650}
.tab:focus-visible{outline-offset:-3px}

.lists{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;align-items:start}
.lbox{background:var(--surface);border:1px solid var(--rule);border-radius:var(--r);overflow:hidden}
.lbox-h{display:flex;justify-content:space-between;align-items:center;padding:9px 12px;border-bottom:1px solid var(--rule);background:var(--sunken)}
.lbox-h b{font-size:12px;font-weight:650;color:var(--ink)}
.lbox-h span{font-family:var(--mono);font-size:10.5px;color:var(--ink-4)}
.lbox ul{list-style:none;margin:0;padding:0;max-height:240px;overflow-y:auto}
.lbox li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;border-bottom:1px solid var(--rule);font-size:12px;color:var(--ink-2)}
.lbox li:last-child{border-bottom:0}
.lbox li .g{font-size:10.5px;color:var(--ink-4);margin-inline-start:5px}
.lbox .x{background:none;border:0;padding:2px;color:var(--ink-4);border-radius:2px;line-height:0}
.lbox .x:hover{color:var(--clay);background:var(--clay-soft)}
.lbox form{display:flex;gap:5px;padding:8px 10px;border-top:1px solid var(--rule);background:var(--well)}
.lbox form input{flex:1;min-width:0;height:27px;padding:0 8px;font-family:var(--sans);font-size:11.5px;border:1px solid var(--rule-2);border-radius:2px;background:var(--surface);color:var(--ink)}
.lbox form input:focus{outline:none;border-color:var(--tide)}

.rules{display:grid;gap:8px}
.rule-row{display:grid;grid-template-columns:150px minmax(0,1fr);gap:12px;padding:10px 12px;border:1px solid var(--rule);border-radius:var(--r);background:var(--surface);align-items:start}
.rule-row>b{font-size:12px;font-weight:650;color:var(--ink)}
.rule-chips{display:flex;flex-wrap:wrap;gap:4px}
.chip{font-size:10.5px;font-family:var(--mono);padding:1px 6px;border-radius:9px;border:1px solid var(--rule-2);color:var(--ink-4);background:var(--surface);line-height:16px}
.chip.req{color:var(--tide-ink);border-color:var(--tide-rule);background:var(--tide-soft);font-weight:600}

/* audit */
.act{font-family:var(--mono);font-size:10.5px;font-weight:600;padding:1px 6px;border-radius:2px;letter-spacing:.02em}
.a-ins{color:var(--tide-ink);background:var(--tide-soft);border:1px solid var(--tide-rule)}
.a-upd{color:var(--amber-ink);background:var(--amber-soft);border:1px solid var(--amber-rule)}
.a-del{color:var(--clay-ink);background:var(--clay-soft);border:1px solid var(--clay-rule)}
.a-other{color:var(--ink-3);background:var(--sunken);border:1px solid var(--rule)}
.who-c{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.av{width:20px;height:20px;border-radius:50%;background:var(--sunken);color:var(--ink-2);display:grid;place-items:center;font-size:9px;font-weight:650;flex:none}
.diff{font-family:var(--mono);font-size:10.5px;color:var(--ink-3);line-height:1.6}
.diff b{color:var(--ink);font-weight:600}

/* ============================ login ============================ */
.login{min-height:100vh;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)}
.login-l{background:var(--chrome);color:var(--chrome-ink);padding:32px 40px 28px;display:flex;flex-direction:column;position:relative;overflow:hidden}
.grid-lines{position:absolute;inset:0;opacity:.5;pointer-events:none}
.login-brand{display:flex;align-items:center;gap:11px;position:relative}
.login-brand b{display:block;font-size:13px;font-weight:600;color:var(--chrome-ink);line-height:1.2}
.login-brand span{display:block;font-size:11.5px;color:var(--chrome-2text);line-height:1.2}
.login-hero{position:relative;margin:auto 0;padding:40px 0;max-width:440px}
.login-hero h1{margin:0 0 14px;font-size:clamp(24px,3.1vw,34px);line-height:1.18;font-weight:600;letter-spacing:-.025em;color:var(--chrome-ink)}
.login-hero p{margin:0;font-size:13.5px;line-height:1.65;color:var(--chrome-2text);max-width:44ch}
.hero-stats{display:flex;gap:30px;margin-top:34px;padding-top:18px;border-top:1px solid var(--chrome-line);max-width:420px}
.hero-stats div b{display:block;font-family:var(--mono);font-size:19px;color:var(--chrome-ink);line-height:1}
.hero-stats div span{display:block;font-size:11px;color:var(--chrome-3text);margin-top:5px}
.login-foot{position:relative;font-size:11px;color:var(--chrome-2text);line-height:1.6;max-width:52ch}

.login-r{background:var(--paper);display:grid;place-items:center;padding:32px;position:relative}
/* The language and theme controls, pinned to the corner of the form panel.
   inset-inline-end keeps the language switch on the far side in both
   directions, so it does not sit under the theme button in Arabic. */
.login-corner{position:absolute;top:16px;inset-inline-end:16px;display:flex;align-items:center;gap:8px}
.theme-lang{width:auto;padding:0 10px;font-size:11.5px;font-weight:500;letter-spacing:.01em}
.theme-lang:hover{background:var(--sunken);border-color:var(--ink-4);color:var(--ink)}
.login-card{width:100%;max-width:340px}
.login-card h2{margin:0;font-size:19px;font-weight:650;letter-spacing:-.015em;color:var(--ink)}
.login-card .sub{margin:4px 0 22px;font-size:12.5px;color:var(--ink-3)}
.lerr{display:none;align-items:flex-start;gap:8px;background:var(--clay-soft);border:1px solid var(--clay-rule);border-radius:var(--r);padding:9px 11px;font-size:12px;color:var(--clay-ink);margin-bottom:14px;line-height:1.45}
.lerr.on{display:flex}
.lerr svg{flex:none;margin-top:1px}
.login-card .fld{margin-bottom:13px}
.login-card .fld input{height:36px;font-size:13px}
.login-card .btn{width:100%;height:36px;margin-top:5px;font-size:13px}
.login-help{margin-top:20px;padding-top:15px;border-top:1px solid var(--rule);font-size:11.5px;color:var(--ink-3);line-height:1.9}
.login-help code{font-family:var(--mono);font-size:11px;background:var(--sunken);border:1px solid var(--rule);padding:0 5px;border-radius:2px;color:var(--ink-2)}
.login-sec{display:flex;align-items:center;gap:6px;margin-top:14px;font-size:11px;color:var(--ink-4)}

/* ============================ toast + modal ============================ */
.toasts{position:fixed;bottom:18px;inset-inline-end:18px;display:flex;flex-direction:column;gap:7px;z-index:90;max-width:340px}
.toast{display:flex;align-items:center;gap:9px;background:var(--toast-bg);color:var(--toast-ink);font-size:12.5px;padding:9px 14px 9px 11px;border-radius:var(--r);box-shadow:0 8px 26px -8px rgba(8,25,28,.5);animation:tin .16s ease-out}
.toast svg{color:var(--brass);flex:none}
@keyframes tin{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}

.mbk{position:fixed;inset:0;background:var(--scrim);display:grid;place-items:center;z-index:80;padding:20px;animation:fin .13s ease-out}
.modal{background:var(--surface);border-radius:4px;width:100%;box-shadow:var(--sh-modal);animation:min .15s ease-out;max-height:86vh;display:flex;flex-direction:column}
@keyframes fin{from{opacity:0}to{opacity:1}}
@keyframes min{from{opacity:0;transform:translateY(4px) scale(.995)}to{opacity:1;transform:none}}
.modal-b{padding:18px 20px 4px;overflow-y:auto}
.modal-b h3{margin:0 0 5px;font-size:15px;font-weight:650;color:var(--ink)}
.modal-b p{margin:0 0 6px;font-size:12.5px;color:var(--ink-2);line-height:1.55}
.modal-b pre{margin:10px 0 4px;font-family:var(--mono);font-size:10.5px;line-height:1.5;background:var(--sunken);border:1px solid var(--rule);border-radius:2px;padding:10px;max-height:240px;overflow:auto;color:var(--ink-2)}
.modal-f{display:flex;justify-content:flex-end;gap:7px;padding:14px 20px 16px}

/* ---------- segmented bar: one whole, split into parts ---------------------
   The form the data-viz reference prescribes for part-to-whole read at a
   glance, six parts or fewer. Each part is its own block at its true share,
   with the percentage printed inside when the block is wide enough and left to
   the key when it is not — no part ever clips its own label.

   A 2px surface gap between blocks is what separates them; no borders, no
   shadows. The key names every part and repeats no number the blocks print. */
.segbar-w{padding:16px}
.segbar{display:flex;gap:2px;height:30px;margin-bottom:13px}
.segbar-p{
  display:grid;place-items:center;min-width:3px;border-radius:3px;
  font-family:var(--mono);font-size:11px;font-weight:600;color:var(--stack-ink);
  overflow:hidden;white-space:nowrap;
}
.segbar-key{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:11.5px;color:var(--ink-3)}
.segbar-key span{display:inline-flex;align-items:center;gap:6px}
.segbar-key i{width:9px;height:9px;border-radius:2px;display:block;flex:none}
.segbar-key b{font-family:var(--mono);font-weight:600;color:var(--ink)}
.segbar-key em{font-style:normal;color:var(--ink-4);font-family:var(--mono);font-size:10.5px}

/* ---------- meter: a single ratio against a whole ---------------------------
   "What share is SSD" is one number, so it gets one number's form: a figure and
   a track. The track is a lighter step of the fill's own hue, so the state reads
   across the whole bar, and the fill is thin — a meter is an instrument, not a
   poster. */
.meter-w{padding:14px 16px 16px}
.meter-v{display:flex;align-items:baseline;gap:8px;margin-bottom:9px}
.meter-v b{font-size:28px;font-weight:600;line-height:1;letter-spacing:-.03em;color:var(--ink)}
.meter-v span{font-size:11.5px;color:var(--ink-3)}
.meter{height:10px;border-radius:5px;background:var(--tide-soft);border:1px solid var(--tide-rule);overflow:hidden}
.meter>i{display:block;height:100%;background:var(--tide);border-radius:5px 0 0 5px}
[dir="rtl"] .meter>i{border-radius:0 5px 5px 0}
.meter-key{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:11px;font-size:11.5px;color:var(--ink-3)}
.meter-key span{display:inline-flex;align-items:center;gap:6px}
.meter-key i{width:8px;height:8px;border-radius:1px;display:block}
.meter-key b{font-family:var(--mono);font-weight:600;color:var(--ink)}

/* ---------- ordered scale: bars whose shade IS their position ----------------
   Memory is the only report whose categories have a natural order, so it is the
   only one that gets a ramp: light for the smallest size, dark for the largest.
   That burns the hue channel on information the bar length already carries, and
   it is right here precisely because the order is the point — a reader looking
   for "4 GB or less" looks for the lightest bar. Categorical data never gets a
   ramp. */
.scale{padding:14px 16px 16px}
.scale-row{display:grid;grid-template-columns:64px minmax(0,1fr) 34px;gap:10px;align-items:center;margin-bottom:8px}
.scale-row:last-child{margin-bottom:0}
.scale-l{font-size:12px;color:var(--ink-2);white-space:nowrap}
.scale-t{height:14px;background:var(--sunken);border-radius:1px;overflow:hidden}
.scale-f{display:block;height:100%;border-radius:1px}
.scale-n{font-family:var(--mono);font-size:12px;text-align:end;color:var(--ink)}
.scale-row.gap .scale-l{color:var(--ink-4);font-style:italic}
.scale-cap{margin:10px 0 0;padding-top:9px;border-top:1px solid var(--rule);font-size:11px;line-height:1.5;color:var(--ink-4)}

/* ---------- line: a trend, which columns cannot show -------------------------
   The week-by-week median was eight columns, and a column chart asks the eye to
   compare height across positions — fine for counts, wrong for a trend, where
   the shape between the points is the information. Two series would need a
   legend; this has one, so it carries none, and its axis is the week label. */
.lineplot{display:block;width:100%;height:auto;overflow:visible}
.lineplot .ax{stroke:var(--rule-2);stroke-width:1}
.lineplot .gl{stroke:var(--grid);stroke-width:1}
.lineplot .target{stroke:var(--clay);stroke-width:1.25;stroke-dasharray:3 3;opacity:.75}
.lineplot .ser{fill:none;stroke:var(--series-1);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.lineplot .dot{fill:var(--series-1);stroke:var(--surface);stroke-width:2}
.lineplot .peak{fill:var(--clay);stroke:var(--surface);stroke-width:2}
.lineplot text{fill:var(--ink-4);font-family:var(--mono);font-size:9.5px}
.lineplot text.now{fill:var(--ink-2);font-weight:600}
.lineplot text.lbl{fill:var(--ink);font-weight:600}
.lineplot text.tgt{fill:var(--clay-ink);font-size:9px}
.line-x{display:grid;gap:2px;margin-top:4px}
.line-x span{text-align:center;font-size:9.5px;color:var(--ink-4);line-height:1.25}
.line-x span.now{color:var(--ink-2);font-weight:600}

/* ============================ dashboard: seven days ============================ */
/* The technician's chart. Same construction as .wk-plot — divs with a height
   — but seven columns and a weekday label under each, because the question it
   answers is "how is this week going", which is a question about days. */
.day-plot{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;height:132px;position:relative;border-bottom:1px solid var(--rule-2)}
.day-plot::before{
  content:"";position:absolute;left:0;right:0;top:0;height:calc(100% - 1px);pointer-events:none;
  background:repeating-linear-gradient(to top,var(--grid) 0 1px,transparent 1px 50%);
}
.day-grp{display:flex;align-items:flex-end;justify-content:center;gap:3px;position:relative;z-index:1;padding:0 2px}
.day-grp.now{background:var(--sunken);border-radius:2px 2px 0 0}
.day-col{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;flex:1 1 0;min-width:0;height:100%}
.day-n{font-family:var(--mono);font-size:10px;line-height:1;color:var(--ink-4);margin-bottom:4px}
.day-grp.now .day-n{color:var(--ink-2);font-weight:600}
.day-b{width:100%;max-width:18px;border-radius:1px 1px 0 0;display:block}
.day-b.in{background:var(--series-a)}
.day-b.out{background:repeating-linear-gradient(135deg,var(--series-b) 0 2.5px,var(--series-b-hatch) 2.5px 5px);outline:1px solid var(--series-b);outline-offset:-1px}
.day-b.zero{background:var(--rule-2);outline:0}
.day-x{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-top:6px}
.day-x span{text-align:center;font-size:10.5px;line-height:1.3;color:var(--ink-4)}
.day-x span.now{color:var(--ink-2);font-weight:600}

/* ============================ reports: controls and sections ============================ */
/* The period and scope bar. One form, applied with a button, so half a chosen
   range never runs a query. */
.filters{border:1px solid var(--rule);border-radius:var(--r);background:var(--surface);padding:12px 14px;margin-bottom:16px}
.filters-g{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.filters-g + .filters-g{margin-top:10px;padding-top:10px;border-top:1px solid var(--rule)}
.filters-now{font-family:var(--mono);font-size:11px;color:var(--ink-4);padding-bottom:9px}
.filters-g label{display:flex;flex-direction:column;gap:4px;min-width:0}
.filters-l{font-size:10.5px;font-weight:600;color:var(--ink-4);letter-spacing:.02em}
.filters input[type="date"]{height:32px;padding:0 9px;font-family:var(--sans);font-size:12px;color:var(--ink);border:1px solid var(--rule-2);border-radius:var(--r);background:var(--surface)}
.filters input[type="date"]:focus{outline:none;border-color:var(--tide);box-shadow:0 0 0 3px var(--ring)}
.filters-n{margin:10px 0 0;font-size:11px;line-height:1.55;color:var(--ink-4);max-width:96ch}

/* Sticky jump-nav. Sits under the 54px top bar, which is itself sticky, so the
   two offsets add up rather than fight. */
.jump{position:sticky;top:54px;z-index:20;display:flex;gap:2px;flex-wrap:wrap;background:var(--paper);border-bottom:1px solid var(--rule);padding:7px 0;margin:0 0 18px}
.jump a{font-size:12px;font-weight:500;color:var(--ink-3);padding:5px 11px;border-radius:var(--r);border:1px solid transparent}
.jump a:hover{background:var(--surface);border-color:var(--rule);color:var(--ink)}
.jump a:focus-visible{outline:2px solid var(--tide);outline-offset:1px}

/* Section heading. The anchors the jump-nav targets carry a scroll offset so a
   section does not land under the two sticky bars. */
.sec-h{margin:26px 0 12px;padding-top:4px;scroll-margin-top:118px;display:flex;align-items:baseline;justify-content:space-between;gap:16px;border-bottom:1px solid var(--rule-2);padding-bottom:7px}
.sec-h h2{margin:0;font-size:15px;font-weight:650;letter-spacing:-.01em;color:var(--ink)}
.sec-h p{margin:0;font-size:11.5px;color:var(--ink-4)}
.sec-h:first-of-type{margin-top:0}

/* The workload panel's disclaimer: it says "a login, not a person" and it is
   part of the panel, not a footnote, because the figure is easy to misread. */
.team-lead{margin:0;padding:10px 14px 12px;font-size:11.5px;line-height:1.6;color:var(--ink-3);border-bottom:1px solid var(--rule);max-width:110ch}

/* ============================ responsive ============================ */
@media (max-width:1080px){
  .shell{grid-template-columns:1fr}
  .rail{position:static;height:auto;flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;border-inline-end:0;border-bottom:1px solid var(--rule);padding:8px 14px;overflow-x:auto}
  .rail-main{display:flex;align-items:center;gap:2px}
  .nav-sec{margin:0}
  .nav-h{display:none}
  .who{border-top:0;padding:0;flex:none}
  .who-t{display:none}
  .main{padding:16px 14px 48px}
  .duo{grid-template-columns:1fr}
  /* The rail is no longer sticky above this width, so the jump-nav only has
     the top bar to clear. */
  .jump{top:54px}
}
@media (max-width:1000px){
  .rep-grid{grid-template-columns:1fr}
  .sec-h{flex-direction:column;gap:2px}
}
@media (max-width:900px){
  .wk-wrap{grid-template-columns:1fr}
  .week{border-inline-end:0;border-bottom:1px solid var(--rule)}
}
@media (max-width:820px){
  .kpis{grid-template-columns:repeat(2,1fr)}
  .login{grid-template-columns:1fr}
  .login-l{display:none}
  .tag{grid-template-columns:1fr}
  .tag-a{justify-content:flex-start}
}
@media (max-width:560px){
  .kpis{grid-template-columns:1fr}
  .ph{flex-direction:column;gap:10px}
  .top{padding:0 12px}
  .brand-txt span,.top-crumb{display:none}
  .switch label,.theme [data-theme-label]{display:none}
  .theme{padding:0;width:30px;justify-content:center}
  .top-r{gap:8px}
  .crow{grid-template-columns:minmax(88px,38%) minmax(0,1fr) 34px}
  .filters-g{gap:8px}
  .filters-g label{flex:1 1 44%}
  .jump{overflow-x:auto;flex-wrap:nowrap}
  .jump a{white-space:nowrap}
  /* A ring beside a four-line legend does not fit in 536px of content width:
     the ring goes above its legend rather than being squeezed to a thumbnail. */
  .ring-row{grid-template-columns:1fr;justify-items:center;gap:12px}
  .ring-legend{width:100%}
  .scale-row{grid-template-columns:52px minmax(0,1fr) 30px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important}
}

/* ============================================================
   SERVER-RENDERED ADDITIONS
   The block above is the approved prototype, unchanged. Everything
   below exists because a real page renders things a prototype did
   not: flash messages, an empty state after a failed search, links
   that need to look like the buttons they replace, and the print
   rule the department will actually use.
   ============================================================ */

/* ---------- inline alerts (flash messages) ---------- */
.alert{display:flex;align-items:flex-start;gap:9px;padding:10px 13px;border-radius:var(--r);font-size:12.5px;line-height:1.5;margin-bottom:14px;border:1px solid}
.alert svg{flex:none;margin-top:1px}
.alert-ok{background:var(--tide-soft);border-color:var(--tide-rule);color:var(--tide-ink)}
.alert-warn{background:var(--amber-soft);border-color:var(--amber-rule);color:var(--amber-ink)}
.alert-bad{background:var(--clay-soft);border-color:var(--clay-rule);color:var(--clay-ink)}
.alert b{font-weight:650}

/* ---------- links that behave like controls ---------- */
a.btn{text-decoration:none}
a.nav-i{text-decoration:none}
a.tab{text-decoration:none;display:inline-block}
a.lnk{color:var(--tide-ink);text-decoration:none}
a.lnk:hover{text-decoration:underline}
a.lnk-b{color:var(--ink);font-weight:600;text-decoration:none}
a.lnk-b:hover{color:var(--tide-ink)}

/* ---------- description lists used as the spec grid ---------- */
dl.specs{margin:0}
dl.specs .spec dt{margin:0}
dl.specs .spec dd{margin:0}

/* ---------- disabled pager arrows ---------- */
.pg span.dis{min-width:26px;height:26px;padding:0 7px;border:1px solid var(--rule);background:var(--sunken);border-radius:var(--r);font-size:12px;color:var(--ink-4);display:inline-grid;place-items:center;opacity:.55}

/* ---------- a table cell that holds a form ---------- */
.cell-form{display:inline}
.cell-form button{background:none;border:0;padding:0;color:var(--tide-ink);font-size:12px}
.cell-form button:hover{text-decoration:underline}

/* ---------- login card as a real form ---------- */
.login-card form{display:block}
.login-card .fld input.m{font-family:var(--mono)}

/* ---------- inline code ---------- */
code{font-family:var(--mono);font-size:11.5px;background:var(--sunken);border:1px solid var(--rule);padding:0 4px;border-radius:2px;color:var(--ink-2)}

/* ---------- message page (errors, installer lock) ---------- */
.msgwrap{min-height:100vh;display:grid;place-items:center;padding:32px;background:var(--paper)}
.msgcard{max-width:520px;background:var(--surface);border:1px solid var(--rule);border-radius:var(--r);padding:26px 28px 24px;position:relative}
.msgcard::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:repeating-linear-gradient(90deg,var(--tag-stripe) 0 10px,transparent 10px 16px)}
.msgcard .code{font-family:var(--mono);font-size:34px;line-height:1;color:var(--clay);font-weight:500;letter-spacing:-.03em;margin-bottom:10px}
.msgcard h1{margin:0 0 10px;font-size:18px;font-weight:650;color:var(--ink);letter-spacing:-.015em}
.msgcard p{margin:0 0 16px;font-size:13px;line-height:1.6;color:var(--ink-2)}
.msgcard .acts{display:flex;gap:8px;flex-wrap:wrap}

/* ---------- the print rule ----------
   A monthly summary leaves this department as paper. Bars keep their shape,
   the chrome goes, and the two themes collapse to the light one so nothing
   prints as white text on white. */
@media print{
  :root,[data-theme="dark"]{
    --paper:#FFFFFF;--surface:#FFFFFF;--sunken:#F2F4F3;--well:#FFFFFF;
    --rule:#CFD6D4;--rule-2:#B7C0BD;--ink:#000000;--ink-2:#222222;
    --ink-3:#444444;--ink-4:#555555;--grid:#DCE2E0;--row-hover:#FFFFFF;
  }
  .top,.rail,.theme,.ph-a,.fbar,.pager,.toasts,.btn,.tabs,.jump,.filters{display:none!important}
  .shell{display:block;min-height:0}
  .main{padding:0}
  .panel,.tag,.specs,.kpis{break-inside:avoid}
  .sec-h{break-after:avoid}
  a[href]::after{content:""}
}
