/* =====================================================================
   SPLAT WORKSPACE -- one design system for People / Sales / Management
   SPLAT brand (guideline 2020): one corporate red, four background tints,
   Futura -> Jost on the web, Arial as the sanctioned fallback.
   EN / AR / KU. Light + dark. Loaded by every department page; nothing
   here is page-specific.
   ===================================================================== */

/* ---------------------------------------------------------------- TOKENS */
:root{
  /* Red is the only corporate colour. It carries meaning -- brand, primary
     action, selected state -- and is never used for danger (see --crit). */
  --brand:#BA0C2F; --brand-deep:#900924; --brand-ink:#FFFFFF;
  --brand-soft:#F9ECEE; --brand-line:#EDC0C9;

  /* The four guideline tints do the structural work: tint 1 is the page
     ground, tint 2 the surfaces, tint 4 the lines and the chart ground. */
  --bg:#F3F7FC; --surface:#EAF4FC; --surface-2:#E2EEF7; --surface-3:#D7ECED;
  --line:#D7ECED; --line-2:#E1F0F5; --line-strong:#B9D6DB;

  --ink:#12161C; --ink-2:#3B4451; --ink-3:#5A6472; --ink-4:#7F8A97;

  /* Semantic states sit outside the brand set: green (tint 3 is its
     surface), amber, and a vermilion for danger that is a different hue
     from the brand red so an alert never looks like branding. */
  --good:#0E7A58; --good-soft:#E6F3EB; --good-line:#B8DCCD;
  --warn:#96600A; --warn-soft:#FCF5E8; --warn-line:#EDDCBA;
  --crit:#B93D0B; --crit-soft:#FBEDE6; --crit-line:#EFC9B8;
  --info:#1A5C8A; --info-soft:#DBE8F2; --info-line:#B7CFE2;

  /* categorical series -- branches, reps, product lines (no red: red means SPLAT) */
  --s1:#1A5C8A; --s2:#0E7A58; --s3:#96600A; --s4:#6A3CA0;
  --s5:#B03A6B; --s6:#0E6C77; --s7:#547A1F; --s8:#4A5568;

  --grid:#D7ECED; --axis:#A8CDD1;
  --shadow-1:0 1px 2px rgba(18,32,48,.06);
  --shadow-2:0 1px 3px rgba(18,32,48,.07), 0 8px 24px -14px rgba(18,32,48,.30);
  --shadow-3:0 12px 40px -12px rgba(18,32,48,.32);

  --r:8px; --r-sm:6px; --r-md:10px; --r-lg:12px;
  --rail:236px; --rail-sm:62px;
  /* Futura is the brand face; Jost is its open web revival, Arial the
     fallback the guideline itself sanctions. Arabic and Kurdish keep IBM
     Plex Sans Arabic -- neither Futura nor Jost covers the script. */
  --f:"Jost",Arial,"Helvetica Neue",sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --f-ar:"IBM Plex Sans Arabic",var(--f);
  /* aliases the page bundles reach for */
  --bg-1:var(--surface); --bg-2:var(--surface-2); --sh-2:var(--shadow-2); --shadow-lg:var(--shadow-3);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --brand:#EE4C6B; --brand-deep:#E63A5E; --brand-ink:#1A0409;
    --brand-soft:#2B141B; --brand-line:#4D1F2B;
    --bg:#0C1116; --surface:#131A21; --surface-2:#1A232C; --surface-3:#232E38;
    --line:#253039; --line-2:#1E2730; --line-strong:#35434F;
    --ink:#EEF3F8; --ink-2:#B5C0CB; --ink-3:#8A97A4; --ink-4:#5F6B78;
    --good:#4FCB9B; --good-soft:#10281F; --good-line:#1D4536;
    --warn:#E9B155; --warn-soft:#2A2013; --warn-line:#463620;
    --crit:#F4834F; --crit-soft:#2E1A11; --crit-line:#4E2B1B;
    --info:#6FB3E0; --info-soft:#12212C; --info-line:#22384A;
    --s1:#6FB3E0; --s2:#4FCB9B; --s3:#E9B155; --s4:#B694E8;
    --s5:#EC8AB0; --s6:#4FBECB; --s7:#A9C95C; --s8:#9AA5B5;
    --grid:#1F2A33; --axis:#3A4855;
    --shadow-1:0 1px 2px rgba(0,0,0,.4);
    --shadow-2:0 1px 3px rgba(0,0,0,.5), 0 8px 24px -14px rgba(0,0,0,.7);
    --shadow-3:0 12px 40px -12px rgba(0,0,0,.75);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --brand:#EE4C6B; --brand-deep:#E63A5E; --brand-ink:#1A0409;
  --brand-soft:#2B141B; --brand-line:#4D1F2B;
  --bg:#0C1116; --surface:#131A21; --surface-2:#1A232C; --surface-3:#232E38;
  --line:#253039; --line-2:#1E2730; --line-strong:#35434F;
  --ink:#EEF3F8; --ink-2:#B5C0CB; --ink-3:#8A97A4; --ink-4:#5F6B78;
  --good:#4FCB9B; --good-soft:#10281F; --good-line:#1D4536;
  --warn:#E9B155; --warn-soft:#2A2013; --warn-line:#463620;
  --crit:#F4834F; --crit-soft:#2E1A11; --crit-line:#4E2B1B;
  --info:#6FB3E0; --info-soft:#12212C; --info-line:#22384A;
  --s1:#6FB3E0; --s2:#4FCB9B; --s3:#E9B155; --s4:#B694E8;
  --s5:#EC8AB0; --s6:#4FBECB; --s7:#A9C95C; --s8:#9AA5B5;
  --grid:#1F2A33; --axis:#3A4855;
  --shadow-1:0 1px 2px rgba(0,0,0,.4);
  --shadow-2:0 1px 3px rgba(0,0,0,.5), 0 8px 24px -14px rgba(0,0,0,.7);
  --shadow-3:0 12px 40px -12px rgba(0,0,0,.75);
  color-scheme:dark;
}

/* ------------------------------------------------------------------ BASE */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
/* Jost's x-height is 0.46em against Plex's 0.52em, so every size here
   sits about half a point above where the Plex build had it. */
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:400 14px/1.5 var(--f); font-variant-numeric:tabular-nums;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
/* Script follows the language, not the layout direction: Arabic and
   Kurdish get the Plex Arabic stack whichever way the frame is mirrored. */
html[lang="ar"] body, html[lang="ku"] body{font-family:var(--f-ar)}
/* Tracking is a Latin small-caps device; on a joined script it pulls the
   letters apart, so the letterspaced labels drop it for Arabic and Kurdish. */
html:is([lang="ar"],[lang="ku"]) :is(.navgrp > .gl, .phead .eyebrow, .stat .lab, table.tbl th, .cmdkgrp, .slipsec h4, .roster th, .repcol .rtot, .ring.lg > span small){letter-spacing:0}
h1,h2,h3,h4{margin:0; font-weight:600; letter-spacing:-.005em; color:var(--ink)}
p{margin:0}
a{color:inherit; text-decoration:none}
button,input,select,textarea{font:inherit; color:inherit}
img{max-width:100%; display:block}
table{border-collapse:collapse; color:inherit}
td,th{color:inherit}                     /* qweb quirks-mode guard */
::placeholder{color:var(--ink-4)}
:focus-visible{outline:2px solid var(--brand); outline-offset:2px; border-radius:3px}
.num{font-variant-numeric:tabular-nums}
.mono{font-family:var(--f-mono)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ----------------------------------------------------------------- FRAME */
#app{display:grid; grid-template-columns:var(--rail) minmax(0,1fr); min-height:100vh}
.main{min-width:0; display:flex; flex-direction:column; background:var(--bg)}

/* ------------------------------------------------------------------ RAIL */
.rail{
  background:var(--surface); border-inline-end:1px solid var(--line);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.brandbox{display:flex; gap:11px; align-items:center; padding:16px 14px; border-bottom:1px solid var(--line-2)}
/* The logo as the guideline's main version: the white wordmark on the
   red rectangular flat tint. The red is the literal corporate value in
   both themes (the dark theme's lighter --brand is for text and lines,
   not the logo), the shape stays a rectangle, and the padding is the
   clear space around the wordmark. The image is never filtered or tinted. */
.logo-sq{
  width:52px; height:34px; border-radius:0; background:#BA0C2F; flex:none;
  display:grid; place-items:center; overflow:hidden; padding:6px 7px; position:relative;
}
.logo-sq img{width:100%; height:100%; object-fit:contain; color:#fff}
/* Should the image be missing (the offline mock has none), the alt text
   stands in as a white mark on the same red. Browsers only render this
   pseudo-element on an image that failed to load. */
.logo-sq img::before{
  content:attr(alt); position:absolute; inset:0; display:grid; place-items:center;
  background:#BA0C2F; color:#fff; font:700 10px/1 var(--f); letter-spacing:.16em; text-transform:uppercase;
}
.brandbox .bn{font-size:13px; font-weight:700; letter-spacing:.08em; line-height:1.15}
/* With no department switcher below it, this line is what names the app,
   so it carries the brand weight rather than sitting as grey subtext. */
.brandbox .bs{font-size:11.5px; font-weight:600; color:var(--brand); line-height:1.2; margin-top:2px; letter-spacing:.02em}

.navwrap{flex:1; overflow-y:auto; padding:10px 10px 14px; scrollbar-width:thin}
.navgrp{margin-top:14px}
.navgrp > .gl{font-size:10.5px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-3); padding:0 6px 6px}
.navbtn{
  display:flex; align-items:center; gap:9px; width:100%; padding:7px 8px;
  border:0; background:none; border-radius:var(--r-sm); cursor:pointer;
  font-size:13.5px; color:var(--ink-2); text-align:start; line-height:1.3;
}
.navbtn:hover{background:var(--surface-2); color:var(--ink)}
.navbtn[aria-current="page"]{background:var(--surface-3); color:var(--ink); font-weight:600}
.navbtn .ic{flex:none; width:16px; display:grid; place-items:center; opacity:.8}
.navbtn .lb{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.navbtn .cnt{
  font-size:10.5px; font-weight:700; padding:1px 6px; border-radius:999px;
  background:var(--surface-3); color:var(--ink-2); font-variant-numeric:tabular-nums;
}
.navbtn .cnt.hot{background:var(--brand); color:var(--brand-ink)}
.navbtn[aria-current="page"] .cnt{background:var(--surface); color:var(--ink-2)}

.railfoot{
  border-top:1px solid var(--line-2); padding:10px 12px; display:flex; gap:9px;
  align-items:center; min-width:0;
}
.railfoot .txt{min-width:0; flex:1}
.railfoot .rn{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.railfoot .rr{font-size:11.5px; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

/* --------------------------------------------------------------- AVATARS */
.avatar{
  width:32px; height:32px; border-radius:50%; flex:none; display:grid; place-items:center;
  font-size:11.5px; font-weight:700; color:#fff; background:var(--s8); overflow:hidden;
  letter-spacing:.04em;
}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar.sm{width:26px;height:26px;font-size:10px}
.avatar.lg{width:46px;height:46px;font-size:15px}
.avatar.xl{width:64px;height:64px;font-size:20px}
.avatar.n1{background:var(--s1)} .avatar.n2{background:var(--s2)} .avatar.n3{background:var(--s3)}
.avatar.n4{background:var(--s4)} .avatar.n5{background:var(--s5)} .avatar.n6{background:var(--s6)}
.avatar.n7{background:var(--s7)} .avatar.n8{background:var(--s8)}
.avstack{display:flex}
.avstack .avatar{margin-inline-start:-8px; box-shadow:0 0 0 2px var(--surface)}
.avstack .avatar:first-child{margin-inline-start:0}

/* ---------------------------------------------------------------- TOPBAR */
.topbar{
  position:sticky; top:0; z-index:40; display:flex; gap:8px; align-items:center;
  padding:9px 18px; background:color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter:saturate(1.6) blur(10px); border-bottom:1px solid var(--line);
  min-height:52px; flex-wrap:wrap;
}
.topbar .spacer{flex:1}
.ctl{
  height:32px; padding:0 9px; border:1px solid var(--line-strong); border-radius:var(--r-sm);
  background:var(--surface); color:var(--ink); font-size:13px; cursor:pointer;
}
select.ctl{padding-inline-end:22px; appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--ink-3) 50%),linear-gradient(135deg,var(--ink-3) 50%,transparent 50%);
  background-position:right 10px center,right 5px center; background-size:5px 5px,5px 5px; background-repeat:no-repeat}
body[dir="rtl"] select.ctl{background-position:left 5px center,left 10px center}
.ctl:hover{border-color:var(--ink-4)}

/* Scope picker -- a tick list, not a dropdown, because the business is run
   on combinations of branches rather than one at a time. */
.scopewrap{position:relative}
.scopebtn{display:inline-flex; align-items:center; gap:6px; max-width:210px}
.scopebtn > span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.scopebtn svg{flex:none; opacity:.7}
.scopebtn[aria-expanded="true"]{border-color:var(--brand); color:var(--brand)}
.scopepop{
  position:absolute; z-index:40; inset-inline-start:0; top:calc(100% + 5px); min-width:236px;
  background:var(--surface); border:1px solid var(--line-strong); border-radius:var(--r-md);
  box-shadow:var(--shadow-lg, 0 10px 34px rgba(16,20,28,.16)); padding:5px;
}
.scoperow{
  display:flex; align-items:center; gap:8px; padding:6px 7px; border-radius:var(--r-sm);
  cursor:pointer; font-size:13px; color:var(--ink);
}
.scoperow:hover{background:var(--surface-2)}
.scoperow input{accent-color:var(--brand); width:14px; height:14px; flex:none; cursor:pointer}
.scoperow .nm{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.scoperow.alt{border-top:1px solid var(--line)}
.scoperow.alt + .scoperow.alt{border-top:0}
.pill.xs{font-size:10px; padding:0 5px}
.scopefoot{display:flex; gap:5px; padding:5px 3px 2px; border-top:1px solid var(--line); margin-top:3px}
.scopefoot .btn{flex:1; justify-content:center}
.scopenote{display:flex; align-items:center; gap:7px; margin:0 0 12px}
.scopenote svg{flex:none}
/* A segment with five options is wider than a phone. Let the buttons wrap
   onto a second row rather than pushing the page sideways -- a segmented
   control is one unbreakable flex item otherwise, so wrapping .acts around
   it does not help. */
.seg{display:inline-flex; flex-wrap:wrap; max-width:100%; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:2px; gap:2px}
.seg button{
  border:0; background:none; cursor:pointer; font-size:12.5px; font-weight:500;
  padding:4px 10px; border-radius:4px; color:var(--ink-3); white-space:nowrap;
}
.seg button[aria-pressed="true"]{background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow-1)}
.seg.brandy button[aria-pressed="true"]{background:var(--brand); color:var(--brand-ink)}
.seg.sm button{padding:3px 8px; font-size:12px}
.iconbtn{
  width:32px; height:32px; display:grid; place-items:center; border:1px solid var(--line-strong);
  background:var(--surface); border-radius:var(--r-sm); cursor:pointer; color:var(--ink-2);
}
.iconbtn:hover{color:var(--ink); border-color:var(--ink-4)}
.iconbtn.plain{border-color:transparent; background:none}
.iconbtn.plain:hover{background:var(--surface-2)}
.gsearch{
  display:flex; align-items:center; gap:7px; height:32px; padding:0 10px; min-width:200px;
  border:1px solid var(--line-strong); border-radius:var(--r-sm); background:var(--surface);
  color:var(--ink-3); cursor:pointer; font-size:13px;
}
.gsearch:hover{border-color:var(--ink-4)}
.gsearch kbd{
  margin-inline-start:auto; font:600 10px var(--f-mono); padding:2px 5px; border-radius:4px;
  background:var(--surface-2); border:1px solid var(--line); color:var(--ink-3);
}

/* ------------------------------------------------------------------ PAGE */
.page{padding:24px 22px 72px; max-width:1520px; width:100%; margin:0 auto; flex:1}
.phead{display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; margin-bottom:20px}
.phead .eyebrow{font-size:11px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:var(--ink-3); margin-bottom:4px}
.phead h1{font-size:27px; line-height:1.12; letter-spacing:-.012em}
.phead .sub{font-size:13px; color:var(--ink-3); margin-top:5px; max-width:70ch}
.phead .acts{margin-inline-start:auto; display:flex; gap:7px; flex-wrap:wrap; align-items:center; min-width:0}

/* ------------------------------------------------------------------ GRID */
.grid{display:grid; gap:14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g5{grid-template-columns:repeat(5,minmax(0,1fr))}
.g6{grid-template-columns:repeat(6,minmax(0,1fr))}
.g-2-1{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.g-1-2{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
.g-3-2{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}
.gap-lg{gap:18px}

/* ------------------------------------------------------------------ CARD */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); min-width:0; display:flex; flex-direction:column}
.card > header{display:flex; gap:10px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line-2); flex-wrap:wrap}
.card > header h3{font-size:14px; font-weight:600; letter-spacing:0}
.card > header .sub{font-size:12px; color:var(--ink-3); width:100%; margin-top:-2px}
.card > header .r{margin-inline-start:auto; display:flex; gap:6px; align-items:center; flex-wrap:wrap}
.card > .body{padding:16px; flex:1; min-width:0}
.card > .body.tight{padding:8px}
.card > .body.flush{padding:0}
.card > .foot{padding:9px 16px; border-top:1px solid var(--line-2); font-size:12px; color:var(--ink-3)}
.card.accent{border-color:var(--brand-line)}
.card.accent > header{background:var(--brand-soft)}

/* ------------------------------------------------------------------ STAT */
/* The editorial tile: a letterspaced small-caps label over a large
   tabular numeral, with room around both. */
.stat{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:14px 16px 15px; display:flex; flex-direction:column; gap:5px; min-width:0; position:relative; overflow:hidden;
}
.stat .lab{font-size:10.5px; color:var(--ink-3); font-weight:600; letter-spacing:.12em; text-transform:uppercase; display:flex; gap:5px; align-items:center; line-height:1.3}
/* 26px is the ceiling: a 13-digit IQD total has to fit a four-up tile at 1240px */
.stat .val{font-size:26px; font-weight:600; letter-spacing:-.015em; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums}
.stat .val.sm{font-size:20px}
.stat .delta{font-size:11.5px; color:var(--ink-3); display:flex; gap:4px; align-items:center}
.stat .delta.up{color:var(--good)} .stat .delta.dn{color:var(--crit)}
.stat.clickable{cursor:pointer} .stat.clickable:hover{border-color:var(--ink-4)}
.stat::before{content:""; position:absolute; inset-inline-start:0; top:0; bottom:0; width:3px; background:transparent}
.stat.accent::before{background:var(--brand)}
.stat.good::before{background:var(--good)}
.stat.warn::before{background:var(--warn)}
.stat.crit::before{background:var(--crit)}
.stat.info::before{background:var(--info)}
.stat .val.good{color:var(--good)} .stat .val.warn{color:var(--warn)} .stat .val.crit{color:var(--crit)}

/* ------------------------------------------------------------ PILL / CHIP */
.pill{
  display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600;
  padding:2px 8px; border-radius:999px; background:var(--surface-3); color:var(--ink-2);
  white-space:nowrap; border:1px solid transparent; line-height:1.55;
}
.pill .dot{width:5px;height:5px;border-radius:50%;background:currentColor;flex:none}
.pill.good{background:var(--good-soft); color:var(--good); border-color:var(--good-line)}
.pill.warn{background:var(--warn-soft); color:var(--warn); border-color:var(--warn-line)}
.pill.crit{background:var(--crit-soft); color:var(--crit); border-color:var(--crit-line)}
.pill.info{background:var(--info-soft); color:var(--info); border-color:var(--info-line)}
.pill.brand{background:var(--brand-soft); color:var(--brand); border-color:var(--brand-line)}
.pill.mut{background:transparent; color:var(--ink-3); border-color:var(--line-strong)}
.bcode{
  font:600 10.5px/1.6 var(--f-mono); padding:1px 6px; border-radius:4px; letter-spacing:.03em;
  background:var(--surface-3); color:var(--ink-2); white-space:nowrap;
}
.bcode.b1{background:color-mix(in srgb,var(--s1) 13%,transparent); color:var(--s1)}
.bcode.b3{background:color-mix(in srgb,var(--s4) 13%,transparent); color:var(--s4)}
.bcode.b4{background:color-mix(in srgb,var(--s2) 13%,transparent); color:var(--s2)}
.bcode.b5{background:color-mix(in srgb,var(--s3) 15%,transparent); color:var(--s3)}
.bcode.b7{background:color-mix(in srgb,var(--s6) 13%,transparent); color:var(--s6)}
.bcode.b6{background:color-mix(in srgb,var(--s8) 13%,transparent); color:var(--s8)}
.chipx{
  display:inline-flex; align-items:center; gap:4px; font-size:12px; padding:2px 4px 2px 8px;
  border-radius:999px; background:var(--surface-2); border:1px solid var(--line); white-space:nowrap;
}
.chipx button{border:0;background:none;cursor:pointer;color:var(--ink-4);padding:0 3px;font-size:13px;line-height:1}
.chipx button:hover{color:var(--crit)}

/* ---------------------------------------------------------------- BUTTON */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; height:32px;
  padding:0 12px; border:1px solid var(--line-strong); background:var(--surface); color:var(--ink);
  border-radius:var(--r-sm); font-size:13px; font-weight:500; cursor:pointer; white-space:nowrap;
}
.btn:hover{border-color:var(--ink-4); background:var(--surface-2)}
.btn.primary{background:var(--brand); border-color:var(--brand); color:var(--brand-ink)}
.btn.primary:hover{background:var(--brand-deep); border-color:var(--brand-deep)}
.btn.ok{background:var(--good); border-color:var(--good); color:#fff}
.btn.no{color:var(--crit); border-color:var(--crit-line)}
.btn.no:hover{background:var(--crit-soft)}
.btn.ghost{border-color:transparent; background:none; color:var(--ink-2)}
.btn.ghost:hover{background:var(--surface-2); color:var(--ink)}
.btn.sm{height:27px; padding:0 9px; font-size:12px}
.btn.lg{height:38px; padding:0 16px; font-size:14px}
.btn[disabled]{opacity:.45; pointer-events:none}
.btn.block{width:100%}

/* ----------------------------------------------------------------- TABLE */
.tblwrap{overflow-x:auto; -webkit-overflow-scrolling:touch}
table.tbl{width:100%; font-size:13px; min-width:640px}
table.tbl th{
  text-align:start; font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color:var(--ink-3); padding:9px 10px; border-bottom:1px solid var(--line); white-space:nowrap;
  position:sticky; top:0; background:var(--surface); z-index:1;
}
table.tbl th.sortable{cursor:pointer; user-select:none}
table.tbl th.sortable:hover{color:var(--ink)}
/* a figure never breaks across lines; a squeezed table scrolls in .tblwrap instead */
table.tbl th.num, table.tbl td.num{text-align:end; font-variant-numeric:tabular-nums; white-space:nowrap}
table.tbl td{padding:10px 10px; border-bottom:1px solid var(--line-2); vertical-align:middle}
table.tbl tbody tr:hover{background:var(--surface-2)}
table.tbl tbody tr:last-child td{border-bottom:0}
table.tbl td .who{display:flex; gap:8px; align-items:center; min-width:0}
table.tbl td .who .nm{font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
table.tbl td .who .s{font-size:11.5px; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
table.tbl tfoot td{padding:10px 10px; border-top:1px solid var(--line); font-weight:600; background:var(--surface-2)}
.lnk{color:var(--brand); cursor:pointer}
.lnk:hover{text-decoration:underline}
.ext::after{content:" \2197 "; font-size:.85em; opacity:.6}

/* ------------------------------------------------------------ ROWS/LISTS */
.rows{display:flex; flex-direction:column}
.rows > .row{display:flex; gap:10px; align-items:center; padding:10px 6px; border-bottom:1px solid var(--line-2)}
.rows > .row:last-child{border-bottom:0}
.rows > .row .grow{flex:1; min-width:0}
.rows > .row .t{font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.rows > .row .s{font-size:11.5px; color:var(--ink-3); margin-top:1px}
.rows > .row .end{margin-inline-start:auto; display:flex; gap:6px; align-items:center; flex-wrap:wrap; justify-content:flex-end}
.rows.hoverable > .row:hover{background:var(--surface-2); border-radius:var(--r-sm)}
.rows.clickrows > .row{cursor:pointer}

/* ----------------------------------------------------------- BARS/METERS */
.meter{height:6px; border-radius:99px; background:var(--surface-3); overflow:hidden; display:flex}
.meter > i{display:block; height:100%; background:var(--brand); border-radius:99px}
.meter > i.good{background:var(--good)} .meter > i.warn{background:var(--warn)}
.meter > i.crit{background:var(--crit)} .meter > i.info{background:var(--info)}
.meter > i.dim{background:var(--ink-4); opacity:.5}
.meter.lg{height:9px}
.meter > i.s1{background:var(--s1)} .meter > i.s2{background:var(--s2)} .meter > i.s3{background:var(--s3)}
.meter > i.s4{background:var(--s4)} .meter > i.s5{background:var(--s5)} .meter > i.s6{background:var(--s6)}
.hbar{display:grid; grid-template-columns:minmax(78px,auto) 1fr minmax(52px,auto); gap:9px; align-items:center; padding:5px 0; font-size:12.5px}
.hbar .hl{color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hbar .hv{text-align:end; font-variant-numeric:tabular-nums; font-weight:600; white-space:nowrap}
.ring{--p:0; --rc:var(--brand); width:44px; height:44px; border-radius:50%; flex:none; display:grid; place-items:center;
  background:conic-gradient(var(--rc) calc(var(--p)*1%), var(--surface-3) 0)}
.ring > span{width:34px;height:34px;border-radius:50%;background:var(--surface);display:grid;place-items:center;font-size:10.5px;font-weight:700;font-variant-numeric:tabular-nums}
.ring.lg{width:104px;height:104px}
.ring.lg > span{width:84px;height:84px;font-size:20px;font-weight:600;flex-direction:column}
.ring.lg > span small{font-size:9.5px;font-weight:600;color:var(--ink-3);letter-spacing:.1em;text-transform:uppercase}

/* ------------------------------------------------------------------- KV */
/* the value column keeps at least six characters, so a long label wraps
   instead of squeezing "60 days" into one character per line */
.kv{display:grid; grid-template-columns:minmax(96px,auto) minmax(6ch,1fr); gap:7px 12px; font-size:13px; align-items:baseline}
.kv dt{color:var(--ink-3); font-size:12px}
.kv dd{margin:0; font-weight:500; min-width:0; overflow-wrap:anywhere}

/* --------------------------------------------------------------- KANBAN */
.kan{display:grid; gap:10px; grid-auto-flow:column; grid-auto-columns:minmax(210px,1fr); overflow-x:auto; padding-bottom:6px; align-items:start}
.kancol{background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); padding:8px; min-height:120px}
.kancol > .kh{display:flex; gap:6px; align-items:center; font-size:12px; font-weight:600; padding:2px 4px 8px; color:var(--ink-2)}
.kancol > .kh .n{margin-inline-start:auto; font-size:10.5px; color:var(--ink-3); background:var(--surface); padding:1px 6px; border-radius:99px; border:1px solid var(--line)}
.kancol.dragover{background:var(--brand-soft); border-color:var(--brand-line)}
.kancard{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:9px;
  margin-bottom:7px; cursor:grab; box-shadow:var(--shadow-1);
}
.kancard:active{cursor:grabbing}
.kancard.dragging{opacity:.4}
.kancard .kt{font-size:13px; font-weight:600; line-height:1.3}
.kancard .ks{font-size:11.5px; color:var(--ink-3); margin-top:3px}

/* ---------------------------------------------------------------- BOARD */
.board{display:grid; gap:10px; grid-auto-flow:column; grid-auto-columns:minmax(238px,1fr); overflow-x:auto; padding-bottom:6px; align-items:start}
.repcol{background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); padding:9px; min-height:140px}
.repcol.dragover{background:var(--brand-soft); border-color:var(--brand-line)}
.repcol > .rh{display:flex; gap:8px; align-items:center; padding-bottom:8px; border-bottom:1px solid var(--line); margin-bottom:8px}
.repcol > .rh .txt{min-width:0; flex:1}
.repcol > .rh .nm{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.repcol > .rh .mt{font-size:11px; color:var(--ink-3)}
.repcol .rtot{display:grid; grid-template-columns:repeat(3,1fr); gap:4px; font-size:10px; color:var(--ink-3); margin-bottom:8px; letter-spacing:.06em; text-transform:uppercase}
.repcol .rtot b{display:block; font-size:12.5px; color:var(--ink); font-weight:600; letter-spacing:0; text-transform:none; font-variant-numeric:tabular-nums}
.ocard{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:8px;
  margin-bottom:6px; cursor:grab; font-size:12.5px; box-shadow:var(--shadow-1);
}
.ocard:active{cursor:grabbing}
.ocard.dragging{opacity:.4}
.ocard .on{font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.ocard .om{display:flex; gap:7px; font-size:11px; color:var(--ink-3); margin-top:3px; flex-wrap:wrap}

/* --------------------------------------------------------------- ROSTER */
.roster{width:100%; font-size:12px; border-collapse:separate; border-spacing:2px}
.roster th{font-size:10px; font-weight:600; color:var(--ink-3); text-align:center; padding:3px; text-transform:uppercase; letter-spacing:.08em}
.roster th.who, .roster td.who{text-align:start; white-space:nowrap; font-size:12.5px}
.roster td{text-align:center; padding:5px 3px; border-radius:5px; background:var(--surface-2); font-weight:600; color:var(--ink-3)}
.roster td.M{background:var(--info-soft); color:var(--info)}
.roster td.E{background:var(--warn-soft); color:var(--warn)}
.roster td.N{background:color-mix(in srgb,var(--s4) 14%,transparent); color:var(--s4)}
.roster td.L{background:var(--good-soft); color:var(--good)}
.roster td.O{background:var(--surface-2); color:var(--ink-4)}
.roster td.today{box-shadow:inset 0 0 0 1.5px var(--brand)}

/* ------------------------------------------------------------ FORM/INPUT */
.field{display:flex; flex-direction:column; gap:4px; min-width:0}
.field > label{font-size:11.5px; font-weight:500; color:var(--ink-2)}
.field .hint{font-size:11px; color:var(--ink-3)}
.field input,.field select,.field textarea{
  width:100%; padding:7px 9px; border:1px solid var(--line-strong); border-radius:var(--r-sm);
  background:var(--surface); font-size:13.5px;
}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--brand); outline:none; box-shadow:0 0 0 3px var(--brand-soft)}
.field textarea{min-height:74px; resize:vertical; font-family:inherit}
.field input[readonly]{background:var(--surface-2); color:var(--ink-3)}
.fields{display:grid; gap:10px; grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
.fields.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.fields.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.srch{
  display:flex; align-items:center; gap:7px; padding:0 10px; height:32px; min-width:160px;
  border:1px solid var(--line-strong); border-radius:var(--r-sm); background:var(--surface);
}
.srch input{border:0; background:none; outline:none; width:100%; font-size:13px}
.srch svg{flex:none; color:var(--ink-4)}
.bigin{
  width:100%; border:1px solid var(--line-strong); border-radius:var(--r); background:var(--surface);
  padding:10px 12px; font-size:26px; font-weight:600; letter-spacing:-.015em; font-variant-numeric:tabular-nums;
}
.bigin:focus{border-color:var(--brand); outline:none; box-shadow:0 0 0 3px var(--brand-soft)}
input[type=range]{width:100%; accent-color:var(--brand); height:22px}
.switch{display:inline-flex; align-items:center; gap:7px; cursor:pointer; font-size:13px}
.switch input{appearance:none; width:34px; height:19px; border-radius:99px; background:var(--surface-3);
  border:1px solid var(--line-strong); position:relative; cursor:pointer; transition:background .14s; flex:none}
.switch input::after{content:""; position:absolute; top:2px; inset-inline-start:2px; width:13px; height:13px;
  border-radius:50%; background:var(--surface); box-shadow:var(--shadow-1); transition:transform .14s}
.switch input:checked{background:var(--brand); border-color:var(--brand)}
.switch input:checked::after{transform:translateX(15px); background:#fff}
body[dir="rtl"] .switch input:checked::after{transform:translateX(-15px)}
.chk{width:16px;height:16px;border:1.5px solid var(--line-strong);border-radius:4px;cursor:pointer;
  display:grid;place-items:center;flex:none;background:var(--surface)}
.chk[aria-checked="true"]{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.done{text-decoration:line-through; color:var(--ink-4)}

/* ------------------------------------------------------------------ TABS */
.tabs{display:flex; gap:2px; border-bottom:1px solid var(--line); overflow-x:auto; margin-bottom:16px}
.tabs button{
  border:0; background:none; cursor:pointer; padding:8px 12px; font-size:13px; font-weight:500;
  color:var(--ink-3); border-bottom:2px solid transparent; white-space:nowrap; margin-bottom:-1px;
}
.tabs button:hover{color:var(--ink)}
.tabs button[aria-selected="true"]{color:var(--brand); border-bottom-color:var(--brand); font-weight:600}
.tabs.inner{border-bottom:0; margin-bottom:10px; gap:4px}
.tabs.inner button{padding:4px 10px; border-radius:99px; border-bottom:0; font-size:12px; background:var(--surface-2)}
.tabs.inner button[aria-selected="true"]{background:var(--brand); color:var(--brand-ink); border-bottom:0}

/* ----------------------------------------------------------------- CHART */
.chart{width:100%; overflow:visible}
.chart text{font-size:10.5px; fill:var(--ink-3); font-family:var(--f); font-variant-numeric:tabular-nums}
html[lang="ar"] .chart text, html[lang="ku"] .chart text{font-family:var(--f-ar)}
.chart .gridline{stroke:var(--grid); stroke-width:1}
.chart .axis{stroke:var(--axis); stroke-width:1}
.legend{display:flex; gap:12px; flex-wrap:wrap; font-size:11.5px; color:var(--ink-2); margin-top:8px}
.legend .li{display:flex; gap:5px; align-items:center; cursor:default}
.legend .sw{width:9px;height:9px;border-radius:2.5px;flex:none}
.tip{
  position:fixed; z-index:200; pointer-events:none; background:var(--ink); color:var(--bg);
  padding:6px 9px; border-radius:var(--r-sm); font-size:12px; box-shadow:var(--shadow-3);
  opacity:0; transition:opacity .08s; max-width:260px; line-height:1.45;
}
.tip.on{opacity:1}
.spark{display:block}

/* ----------------------------------------------------------------- MODAL */
.scrim{
  position:fixed; inset:0; background:rgba(8,14,20,.46); backdrop-filter:blur(2px);
  display:grid; place-items:center; z-index:120; padding:16px;
}
.modal{
  background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--shadow-3);
  width:min(720px,100%); max-height:88vh; display:flex; flex-direction:column; border:1px solid var(--line);
}
.modal.wide{width:min(1020px,100%)}
.modal.slim{width:min(460px,100%)}
.modal > header{display:flex; gap:10px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line)}
.modal > header h3{font-size:15px}
.mbody{padding:16px; overflow-y:auto; display:flex; flex-direction:column; gap:12px}
.mfoot{padding:11px 16px; border-top:1px solid var(--line); display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap}
.mfoot .start{margin-inline-end:auto}
/* side drawer -- opens from the inline-end edge, so it follows body[dir] */
.drawer{
  position:fixed; inset-block:0; inset-inline-end:0; width:min(560px,100%); background:var(--surface);
  border-inline-start:1px solid var(--line); box-shadow:var(--shadow-3); z-index:130;
  display:flex; flex-direction:column; animation:slidein .16s ease-out;
}
@keyframes slidein{from{transform:translateX(24px);opacity:.4}to{transform:none;opacity:1}}
body[dir="rtl"] .drawer{animation:slideinR .16s ease-out}
@keyframes slideinR{from{transform:translateX(-24px);opacity:.4}to{transform:none;opacity:1}}
.drawer > header{display:flex; gap:10px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line)}
.drawer .dbody{padding:16px; overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:14px}
.drawer .dfoot{padding:11px 16px; border-top:1px solid var(--line); display:flex; gap:8px; justify-content:flex-end}

/* ----------------------------------------------------------- CMDK SEARCH */
.cmdk{position:fixed; inset:0; background:rgba(8,14,20,.46); backdrop-filter:blur(2px); z-index:150; padding-top:12vh; display:grid; justify-items:center; align-items:start}
.cmdkbox{width:min(620px,92%); background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-3); overflow:hidden}
.cmdkin{display:flex; align-items:center; gap:9px; padding:12px 14px; border-bottom:1px solid var(--line)}
.cmdkin input{border:0;background:none;outline:none;width:100%;font-size:15.5px}
.cmdklist{max-height:52vh; overflow-y:auto; padding:6px}
.cmdkgrp{font-size:10.5px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);padding:8px 8px 4px}
.cmdkrow{display:flex;gap:9px;align-items:center;padding:7px 8px;border-radius:var(--r-sm);cursor:pointer;font-size:13px}
.cmdkrow[aria-selected="true"], .cmdkrow:hover{background:var(--surface-2)}
.cmdkrow .s{font-size:11.5px;color:var(--ink-3);margin-inline-start:auto}

/* ----------------------------------------------------------- MISC/STATES */
.empty{padding:28px 14px; text-align:center; color:var(--ink-3); font-size:13px}
.empty .big{font-size:30px; opacity:.28; margin-bottom:6px}
.note{font-size:12px; color:var(--ink-3); line-height:1.55}
.note.box{background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:9px 11px}
.note.warnbox{background:var(--warn-soft); border-color:var(--warn-line); color:var(--warn)}
.note.critbox{background:var(--crit-soft); border-color:var(--crit-line); color:var(--crit)}
.sep{height:1px; background:var(--line-2); margin:10px 0}
.skel{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 37%,var(--surface-2) 63%);
  background-size:400% 100%; animation:sk 1.3s ease-in-out infinite; border-radius:var(--r-sm)}
@keyframes sk{0%{background-position:100% 50%}100%{background-position:0 50%}}
.skelrow{height:52px; margin-bottom:8px}
#toast{position:fixed; inset-inline:0; bottom:22px; display:flex; flex-direction:column; align-items:center; gap:7px; z-index:300; pointer-events:none}
.toast{
  background:var(--ink); color:var(--bg); padding:9px 15px; border-radius:99px; font-size:13px;
  font-weight:500; box-shadow:var(--shadow-3); animation:tin .16s ease-out; max-width:88vw;
}
.toast.bad{background:var(--crit); color:#fff}
.toast.good{background:var(--good); color:#fff}
@keyframes tin{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}
#busy{
  position:fixed; top:11px; inset-inline-end:16px; z-index:250; background:var(--ink); color:var(--bg);
  padding:5px 13px; border-radius:99px; font-size:12px; font-weight:500; display:none; box-shadow:var(--shadow-2);
}
#busy.on{display:block}
.statusdot{width:7px;height:7px;border-radius:50%;background:var(--ink-4);flex:none}
.statusdot.live{background:var(--good)} .statusdot.err{background:var(--crit)} .statusdot.busy{background:var(--warn)}

/* ------------------------------------------------------------ RESPONSIVE */
/* Below 1400px a four-up tile is narrower than a 13-digit IQD figure at
   26px, so the numeral steps down to the size the Plex build used. */
@media (max-width:1399px){
  .stat .val{font-size:24px}
}
@media (max-width:1240px){
  .g6{grid-template-columns:repeat(3,minmax(0,1fr))}
  .g5{grid-template-columns:repeat(3,minmax(0,1fr))}
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g-2-1,.g-1-2,.g-3-2{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:980px){
  #app{grid-template-columns:var(--rail-sm) minmax(0,1fr)}
  .brandbox .txt,.railfoot .txt,.navbtn .lb,.navgrp > .gl{display:none}
  .navbtn{justify-content:center; padding:9px 6px}
  .navbtn .cnt{position:absolute; margin-inline-start:20px; margin-top:-14px; font-size:9px; padding:0 4px}
  .navbtn{position:relative}
  .brandbox{justify-content:center; padding:14px 4px}
  .logo-sq{width:48px; height:32px; padding:5px 6px}
  .railfoot{justify-content:center; padding:10px 6px}
  .g3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:700px){
  .page{padding:16px 14px 64px}
  .g2,.g3,.g4,.g5,.g6{grid-template-columns:minmax(0,1fr)}
  .fields,.fields.two,.fields.three{grid-template-columns:minmax(0,1fr)}
  .phead h1{font-size:22px}
  .stat .val{font-size:24px}
  .topbar{padding:8px 12px}
  .gsearch{min-width:0; flex:1}
  .gsearch kbd{display:none}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms !important; transition-duration:.01ms !important}}
@media print{
  .rail,.topbar,#busy,#toast,.noprint{display:none !important}
  #app{grid-template-columns:1fr} .page{padding:0} .card{break-inside:avoid; box-shadow:none}
  body{background:#fff}
}

/* --------------------------------------------------------------- PAYSLIP */
.slip{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden}
.sliphead{display:flex; gap:12px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); background:var(--surface-2)}
.slipsec{padding:12px 16px; border-bottom:1px solid var(--line-2)}
.slipsec h4{font-size:10.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-3); margin-bottom:8px; font-weight:600}
.slipline{display:flex; justify-content:space-between; gap:12px; padding:4px 0; font-size:13px}
.slipline .lbl{color:var(--ink-2)}
.slipline.tot{border-top:1px solid var(--line); margin-top:7px; padding-top:8px; font-weight:700; font-size:14px}
.slipline .neg{color:var(--crit)}
