/* ── 00-fonts.css ─────────────────────────────── */

/* ============================================================
   Type — one family, bundled, never fetched: Cairo, the warehouse program's
   face (multiwarehouse/assets/fonts), in the same four weights.

   Every Latin digit has one advance (560/1000 em in all four weights), so a
   column of money aligns with or without `tnum`. Cairo's line box is tall
   (1.874em) and its letters sit well inside it, so a line-height of 1.5
   clips nothing.

   The woff2 files live flat in app/renderer/assets/ (the app runs offline; the
   build rewrites every assets/… reference below). The OFL text sits beside
   them. font-display: block — a local file decodes on the first frame.
   ============================================================ */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(assets/cairo-400.woff2?v=aaf525151628) format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url(assets/cairo-500.woff2?v=aaf525151628) format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url(assets/cairo-600.woff2?v=aaf525151628) format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(assets/cairo-700.woff2?v=aaf525151628) format('woff2');
}

/* ── 10-tokens.css ─────────────────────────────── */

/* ============================================================
   دفتر الدوام v6 — tokens

   The palette is the warehouse program's (multiwarehouse/lib/core/constant/
   color.dart), value for value where a role exists in both, so the two
   programs are one family: navy rail, blue primary, cool bench, white cards,
   application mark. Where a warehouse value cannot carry a job here it moves one
   step along its own hue: --accent is a shade under #3D63F5 so small text
   clears 4.5:1 on the bench, --good / --warn are darker steps for text, and
   --warn-2 is a shade under the warehouse amber so a mark clears 3:1.

   Attendance still needs what a warehouse does not — colour rationed by meaning:

     1. ROYAL (--accent) — structure, links, selection, focus, the primary
        action.
     2. STATE — green surplus, red deficit, amber a diagnostic.
     3. GOLD — the application mark, and "this value was customised away from the layer
        above it".
     4. MEASURE HUES (--m-1 … --m-8) — one hue per measured quantity.
     5. CATEGORY RAMP (--c-1 … --c-6, --c-rest) — slices that are NAMES.
     6. STAMP (--stamp, the warehouse's «فترة» violet) — the locked month.
        DAY STATES (--day-*) — what became of one calendar day; each keeps the
        hue its figure wears elsewhere.

   Every pair is checked by test/design/contrast.py.

   The dark values are written ONCE, between @dark-start / @dark-end. The
   build stamps that body into :root[data-theme="dark"] at @dark-explicit.
   Token NAMES are v5's; stylesheets read them, none is removed.
   ============================================================ */

:root {
  color-scheme: light;

  /* ---------- surfaces ----------
     The card is WHITE and the bench is a cool near-white a step below it.
     The 1px border does the separating, not a value step, which is why the
     contrast check holds --line against BOTH surfaces. */
  --paper:   #F4F5F9;   /* the bench: the page behind everything */
  --card:    #FFFFFF;   /* a raised surface, bordered */
  --card-2:  #F4F5F9;   /* sunken: wells, progress tracks, chart grounds */
  --card-3:  #F1F4FE;   /* the sticky table header — near-white, not grey */

  /* ---------- ink ---------- */
  --ink:     #1D2333;   /* headings and figures */
  --ink-2:   #454D66;   /* secondary prose */
  --muted:   #616984;   /* labels and captions — checked against every
                           surface it may sit on; the bench is the tightest */

  /* ---------- rules: three weights, never interchangeable ---------- */
  --line:      #E7E9F0;  /* a card's edge — the load-bearing one */
  --line-soft: #EEF0F5;  /* a row rule inside a table */
  --grid:      #E9ECF2;  /* a chart gridline */

  /* ---------- royal: structure, action, selection ---------- */
  --accent:      #3859EE;
  --accent-2:    #5B7BF7;   /* the lighter stroke: charts, hover */
  --accent-soft: #EEF2FF;   /* the chip ground */
  --on-accent:   #FFFFFF;
  --sel:         #F0F4FF;   /* a selected row — NOT accent-soft, so the two
                               roles can diverge */

  /* ---------- the solid button ----------
     The primary action is MIDNIGHT, not blue. Blue is data.
     Its own token because in dark mode it inverts to near-white. */
  --solid:    #3859EE;
  --on-solid: #FFFFFF;

  /* ---------- state ---------- */
  --good:      #15803D;   /* a surplus figure, as text */
  --good-2:    #16A34A;   /* the bar, the line, the fill — non-text; it has to
                             clear 3:1 against its own TRACK, not only the card */
  --good-soft: #E8F6ED;
  --crit:      #C81E1E;
  --crit-2:    #DC2626;
  --crit-soft: #FCE9E9;
  --on-crit:   #FFFFFF;   /* a token, because dark mode's --crit is a LIGHT red */

  /* ---------- orange: a diagnostic that wants the eye ---------- */
  --warn:      #B45309;
  --warn-2:    #D97706;
  --warn-soft: #FEF5E6;

  /* ---------- gold: customised, and nothing else ---------- */
  --gold-ink:  #7A6330;   /* a customised VALUE, as text */
  --brand-gold: #B8A57B;  /* the application mark */
  --brand-navy: #0B1E39;  /* the sign-in's ground */
  --gold-mark: #84703E;   /* the 3px field edge, the row dot, the rail marker */
  --gold-fill: #B8A57B;   /* large decorative fills ONLY, never an indicator */
  --gold-soft: #F6F2E9;

  /* ---------- the stamp: a locked month, and nothing else ----------
     A stamp-pad violet pushed toward plum, so it cannot be read as the royal
     accent (26° away on the wheel is not enough) nor as the mission violet
     (--m-3, brighter and bluer). Form does the rest: it is only ever a ringed
     mark, never a fill behind text or a button. */
  --stamp:      #6F3CCB;   /* the ink: rings, the word, the tab mark */
  --stamp-soft: #F1EBFB;   /* the ground of the lock banner */
  --on-stamp:   #FFFFFF;

  /* ---------- day states: the grid's language ----------
     One cell per calendar day. Aliases keep a state on the hue its figure
     already wears elsewhere; the two literal values are the two new states. */
  --day-ok:      #7985A1;          /* present, an ordinary day — a calm slate
                                      that recedes so the exceptions speak */
  --day-ot:      var(--m-7);       /* present with overtime — the addition green */
  --day-short:   #F59E0B;          /* present, short of the required hours */
  --day-single:  var(--m-5);       /* one punch only — hours not computable */
  --day-absent:  var(--m-8);       /* absent, or not yet decided (then hollow) */
  --day-leave:   var(--m-4);       /* approved leave */
  --day-mission: var(--m-3);       /* on a mission */
  --day-off:     #E7E9F0;          /* weekend / not a working day: a pale cell */
  --day-rule:    #B9C1D1;          /* the outline of a hollow cell: outside
                                      service, no data, and the hatch of a day off */

  --focus: #3859EE;

  /* The label on a small SATURATED filled indicator. A token and not a literal
     white: in dark mode those fills invert to light values. */
  --on-fill: #FFFFFF;

  /* ---------- measure hues ----------
     -ink is the text-safe value (4.5 on a card); the bare value is the chip
     fill / stroke and is non-text (3.0); -soft is the chip ground. */
  --m-1: #3D63F5;  --m-1-ink: #2F50D8;  --m-1-soft: #EEF2FF;
  --m-2: #0891B2;  --m-2-ink: #0E7490;  --m-2-soft: #E6F6FA;
  --m-3: #8B5CF6;  --m-3-ink: #6D3FE0;  --m-3-soft: #F3EEFE;
  --m-4: #0D9488;  --m-4-ink: #0F766E;  --m-4-soft: #E3F5F3;
  --m-5: #D4660E;  --m-5-ink: #B45309;  --m-5-soft: #FEF4E9;
  --m-6: #616984;  --m-6-ink: #4F5670;  --m-6-soft: #EFF0F5;
  --m-7: #16A34A;  --m-7-ink: #15803D;  --m-7-soft: #EFFAF3;
  --m-8: #DC2626;  --m-8-ink: #C81E1E;  --m-8-soft: #FCE9E9;

  /* ---------- راتب ثابت: not bound to attend, and nothing else ----------
     A magenta no measure wears, so the row reads as «a different kind of
     person» before it reads as any figure — far from the deduction red and
     the mission violet. */
  --fixed:      #C2357F;   /* the mark, the edge, the day cell */
  --fixed-ink:  #A3226A;   /* as text */
  --fixed-soft: #FCEAF4;   /* the chip ground, the row tint */

  /* ---------- the category ramp: slices that are NAMES ---------- */
  --c-1: #3D63F5;
  --c-2: #161D33;
  --c-3: #0D9488;
  --c-4: #7C4DDB;
  --c-5: #E08A09;
  --c-6: #1D2333;
  --c-rest: #9AA1B2;

  /* ---------- the rail: MIDNIGHT, its own plane in BOTH themes ----------
     A deep indigo ink rather than flat black — the same family as the royal
     accent, so the rail and the selection belong to one object. In dark mode
     it is LIGHTER than the page rather than darker, which is what keeps it
     reading as a separate object instead of merging into the canvas. */
  --spine:        #161D33;
  --spine-2:      #242B3F;   /* the hovered nav row */
  --spine-3:      #273152;   /* the ACTIVE nav row — a lift, not a pill */
  --spine-line:   #232C4A;
  --spine-ink:    #FFFFFF;
  --spine-muted:  #A8B1C7;
  --spine-accent: #819AF8;   /* the mark and the active marker */
  --spine-focus:  #AAB5FF;

  /* ---------- type ----------
     Cairo for everything (00-fonts.css). --lh-cell keeps ج ح خ ع غ and a
     final ى inside a cell with overflow:hidden; do not lower it. */
  --font: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  --font-title: 'Cairo', 'Segoe UI', system-ui, sans-serif;

  --fs-micro:  12px;    /* the floor for any Arabic chrome — never below */
  --fs-label:  12.5px;
  --fs-cell:   13.5px;  /* table cells */
  --fs-body:   14px;
  --fs-lead:   15px;
  --fs-h3:     15.5px;  /* a card's title */
  --fs-h2:     18px;
  --fs-h1:     22px;    /* the page title — Kufi */
  --fs-num-lg: 20px;
  --fs-num-xl: 27px;    /* the summary figure */

  --lh-tight: 1.3;
  --lh-title: 1.5;    /* Kufi's marks sit high; a title line needs the room */
  --lh-cell:  1.5;    /* the descender floor — do not lower */
  --lh-body:  1.65;
  --lh-lead:  1.75;

  /* Weights are tokens, applied as font-weight: var(--w-NNN). Each lands on a
     face the app ships (400/500/600/700), so nothing is synthesised. */
  --w-300: 400;
  --w-400: 400;
  --w-500: 500;
  --w-600: 600;
  --w-700: 700;
  --w-title: 700;

  /* ---------- shape: AppLayout's radii ---------- */
  --r-xs:   6px;    /* a tag, a day cell's big form */
  --r-sm:   8px;    /* radiusS: a button, a rail row, an icon button */
  --r:      8px;
  --r-field: 10px;  /* radiusField: every input */
  --r-lg:  12px;    /* radiusM: a card, a table card, a dialog */
  --r-xl:  20px;    /* radiusL: the page head card */
  --r-pill: 999px;  /* the warehouse's filter pills and action pills */

  /* ---------- depth ----------
     The warehouse's doubled soft shadow: a small contact plus a low glow, both
     navy-tinted. --sh-card sits on every card; the others float. */
  --sh-1: 0 1px 2px rgba(22, 29, 51, .06);
  --sh-2: 0 4px 10px -4px rgba(22, 29, 51, .10), 0 16px 32px -20px rgba(22, 29, 51, .24);
  --sh-3: 0 8px 20px -8px rgba(22, 29, 51, .18), 0 32px 64px -28px rgba(22, 29, 51, .36);
  --sh-card: 0 2px 6px rgba(22, 29, 51, .04), 0 10px 24px rgba(22, 29, 51, .06);
  --sh-table: 0 4px 18px rgba(22, 29, 51, .06);
  --sh-accent: 0 4px 10px color-mix(in srgb, var(--accent) 32%, transparent);
  --sh-inset: none;
  --grad-primary: linear-gradient(180deg, #5B7BF7, #3D63F5);
  --grad-hero: linear-gradient(135deg, #161D33 0%, #1F2C5C 52%, #3D63F5 100%);
  --stripe: #F9FAFD;      /* tableStripe */
  --strip: #F8F9FC;       /* filterStrip: the head card's filter band */
  --spine-section: #6B7490;

  /* ---------- layout ---------- */
  --spine-w: 264px;
  --spine-w-min: 66px;
  --drawer-w: 384px;   /* narrow enough that the register behind it stays
                          readable — the whole case for a non-modal editor */
  --gutter: 16px;
  --page-max: 1720px;
  --ctrl-h: 36px;      /* every control: button, input, select */
  --ctrl-h-sm: 32px;   /* the same controls inside a filter band */
  --ubar-h: 65px;      /* the top bar, its rule included — the head card sticks
                          under it, so the two must agree */
  --phead-h: 172px;    /* the head card with its bands; screens that size a
                          scrollport against the window read it, and
                          91-v6-month.js keeps it true */

  /* ---------- motion ---------- */
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: .12s;
  --t: .18s;
  --t-slow: .28s;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* @dark-start */
    /* darkPalette: a deep navy bench, cards a step above it, indigo borders. */
    --paper:   #070D1E;
    --card:    #0D1731;
    --card-2:  #101E3E;
    --card-3:  #142347;

    --ink:     #E9EEFC;
    --ink-2:   #C3CCE6;
    --muted:   #A6B2D2;

    --line:      #1E2B4D;
    --line-soft: #182444;
    --grid:      #1C2848;

    --accent:      #7C97FF;
    --accent-2:    #9DB1FF;
    --accent-soft: #1F2B52;
    --on-accent:   #0A1226;
    --sel:         #1A2750;

    /* the solid button inverts: near-white ground, midnight label */
    --solid:    #7C97FF;
    --on-solid: #0A1226;

    --good:      #2FD896;
    --good-2:    #0AC77E;
    --good-soft: #0D2B33;
    --crit:      #FF8A90;
    --crit-2:    #FF6B72;
    --crit-soft: #2F1C33;
    --on-crit:   #2A0D0A;   /* dark ink on a light red, not white on it */

    --warn:      #FFB224;
    --warn-2:    #F5A623;
    --warn-soft: #2E2A2B;

    --gold-ink:  #C9B68C;
    --brand-gold: #C9B68C;
    --gold-mark: #C9B68C;
    --gold-fill: #A8966C;
    --gold-soft: #25283A;

    /* the stamp lifts toward orchid: on a dark card a deep plum is a bruise */
    --stamp:      #C9A2F5;
    --stamp-soft: #2A1F4C;
    --on-stamp:   #1A0F2E;

    /* On a dark card the ordinary day is a mid slate BELOW the ink, the
       off-day a step above the card, and the hollow outline clear of both. */
    --day-ok:    #6F7C9E;
    --day-short: #FFB224;
    --day-off:   #16233F;
    --day-rule:  #3C4A6E;

    --focus: #7C97FF;
    --on-fill: #0E1424;   /* dark ink on a light fill, not white on it */

    /* The measure hues lift and desaturate for a dark ground. */
    --m-1: #7C97FF;  --m-1-ink: #93ABFF;  --m-1-soft: #1A2750;
    --m-2: #38BDF8;  --m-2-ink: #57C8FA;  --m-2-soft: #0E2A42;
    --m-3: #A78BFA;  --m-3-ink: #BBA5FF;  --m-3-soft: #231F4C;
    --m-4: #2DD4BF;  --m-4-ink: #4FDECB;  --m-4-soft: #0C2E36;
    --m-5: #FF9240;  --m-5-ink: #FFB06A;  --m-5-soft: #2F2430;
    --m-6: #8E9BBC;  --m-6-ink: #A6B2D2;  --m-6-soft: #17233F;
    --m-7: #0AC77E;  --m-7-ink: #2FD896;  --m-7-soft: #0D2B33;
    --m-8: #FF6B72;  --m-8-ink: #FF8A90;  --m-8-soft: #2F1C33;

    --fixed:      #EE82C0;
    --fixed-ink:  #F59ACD;
    --fixed-soft: #2E1426;

    --c-1: #7C97FF;
    --c-2: #4F66C9;
    --c-3: #2DD4BF;
    --c-4: #B69CFF;
    --c-5: #FFB224;
    --c-6: #C3CCE6;
    --c-rest: #6F7C9E;

    --spine:        #131C39;
    --spine-2:      #1A2442;
    --spine-3:      #24315C;
    --spine-line:   #232F52;
    --spine-ink:    #E9EEFC;
    --spine-muted:  #9AA6C6;
    --spine-accent: #7C97FF;
    --spine-focus:  #9DB1FF;

    --sh-card: 0 2px 6px rgba(0, 0, 0, .20), 0 10px 24px rgba(0, 0, 0, .30);
    --sh-table: 0 4px 18px rgba(0, 0, 0, .30);
    --grad-primary: linear-gradient(180deg, #7C97FF, #5B7BF7);
    --grad-hero: linear-gradient(135deg, #142347 0%, #1F2C5C 52%, #5B7BF7 100%);
    --stripe: #0F1B38;
    --strip: #0B1428;
    --spine-section: #5F6C90;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .45);
    --sh-2: 0 4px 10px -4px rgba(0, 0, 0, .55), 0 18px 36px -22px rgba(0, 0, 0, .9);
    --sh-3: 0 8px 22px -8px rgba(0, 0, 0, .6), 0 34px 68px -30px rgba(0, 0, 0, .95);
    --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .04);
    /* @dark-end */
  }
}

/* The build stamps the block above into :root[data-theme="dark"] here. */
:root[data-theme="dark"] {
  color-scheme: dark;
  /* darkPalette: a deep navy bench, cards a step above it, indigo borders. */
  --paper:   #070D1E;
  --card:    #0D1731;
  --card-2:  #101E3E;
  --card-3:  #142347;

  --ink:     #E9EEFC;
  --ink-2:   #C3CCE6;
  --muted:   #A6B2D2;

  --line:      #1E2B4D;
  --line-soft: #182444;
  --grid:      #1C2848;

  --accent:      #7C97FF;
  --accent-2:    #9DB1FF;
  --accent-soft: #1F2B52;
  --on-accent:   #0A1226;
  --sel:         #1A2750;

  /* the solid button inverts: near-white ground, midnight label */
  --solid:    #7C97FF;
  --on-solid: #0A1226;

  --good:      #2FD896;
  --good-2:    #0AC77E;
  --good-soft: #0D2B33;
  --crit:      #FF8A90;
  --crit-2:    #FF6B72;
  --crit-soft: #2F1C33;
  --on-crit:   #2A0D0A;   /* dark ink on a light red, not white on it */

  --warn:      #FFB224;
  --warn-2:    #F5A623;
  --warn-soft: #2E2A2B;

  --gold-ink:  #C9B68C;
  --brand-gold: #C9B68C;
  --gold-mark: #C9B68C;
  --gold-fill: #A8966C;
  --gold-soft: #25283A;

  /* the stamp lifts toward orchid: on a dark card a deep plum is a bruise */
  --stamp:      #C9A2F5;
  --stamp-soft: #2A1F4C;
  --on-stamp:   #1A0F2E;

  /* On a dark card the ordinary day is a mid slate BELOW the ink, the
     off-day a step above the card, and the hollow outline clear of both. */
  --day-ok:    #6F7C9E;
  --day-short: #FFB224;
  --day-off:   #16233F;
  --day-rule:  #3C4A6E;

  --focus: #7C97FF;
  --on-fill: #0E1424;   /* dark ink on a light fill, not white on it */

  /* The measure hues lift and desaturate for a dark ground. */
  --m-1: #7C97FF;  --m-1-ink: #93ABFF;  --m-1-soft: #1A2750;
  --m-2: #38BDF8;  --m-2-ink: #57C8FA;  --m-2-soft: #0E2A42;
  --m-3: #A78BFA;  --m-3-ink: #BBA5FF;  --m-3-soft: #231F4C;
  --m-4: #2DD4BF;  --m-4-ink: #4FDECB;  --m-4-soft: #0C2E36;
  --m-5: #FF9240;  --m-5-ink: #FFB06A;  --m-5-soft: #2F2430;
  --m-6: #8E9BBC;  --m-6-ink: #A6B2D2;  --m-6-soft: #17233F;
  --m-7: #0AC77E;  --m-7-ink: #2FD896;  --m-7-soft: #0D2B33;
  --m-8: #FF6B72;  --m-8-ink: #FF8A90;  --m-8-soft: #2F1C33;

  --fixed:      #EE82C0;
  --fixed-ink:  #F59ACD;
  --fixed-soft: #2E1426;

  --c-1: #7C97FF;
  --c-2: #4F66C9;
  --c-3: #2DD4BF;
  --c-4: #B69CFF;
  --c-5: #FFB224;
  --c-6: #C3CCE6;
  --c-rest: #6F7C9E;

  --spine:        #131C39;
  --spine-2:      #1A2442;
  --spine-3:      #24315C;
  --spine-line:   #232F52;
  --spine-ink:    #E9EEFC;
  --spine-muted:  #9AA6C6;
  --spine-accent: #7C97FF;
  --spine-focus:  #9DB1FF;

  --sh-card: 0 2px 6px rgba(0, 0, 0, .20), 0 10px 24px rgba(0, 0, 0, .30);
  --sh-table: 0 4px 18px rgba(0, 0, 0, .30);
  --grad-primary: linear-gradient(180deg, #7C97FF, #5B7BF7);
  --grad-hero: linear-gradient(135deg, #142347 0%, #1F2C5C 52%, #5B7BF7 100%);
  --stripe: #0F1B38;
  --strip: #0B1428;
  --spine-section: #5F6C90;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .45);
  --sh-2: 0 4px 10px -4px rgba(0, 0, 0, .55), 0 18px 36px -22px rgba(0, 0, 0, .9);
  --sh-3: 0 8px 22px -8px rgba(0, 0, 0, .6), 0 34px 68px -30px rgba(0, 0, 0, .95);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* ── 20-base.css ─────────────────────────────── */

/* ============================================================
   Base: reset, typography, the number contract, focus.
   ============================================================ */

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

html, body, h1, h2, h3, h4, p, figure, ul, ol, dl, dd, fieldset {
  margin: 0;
  padding: 0;
}
ul, ol { list-style: none; }
fieldset { border: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--w-400);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* Weight is always a token through `font-weight`, never a bare number: the
   tokens step down in dark mode and come back on paper (10-tokens, 80-print),
   and a literal 600 would follow neither. Every weight the tokens name is a
   face the app ships, so nothing here is ever synthesised — a faux-bold
   Arabic smears its joins. The UA's own `bold` (700) on these elements is
   replaced for the same reason. */
h1, h2, h3, h4, b, strong, th {
  font-weight: var(--w-600);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-title); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); }
h4 { font-size: var(--fs-body); }

/* No synthesis, anywhere: a weight or a slant the bundle does not carry is
   shown in the nearest real face rather than faked by the rasteriser. */
html { font-synthesis: none; }

/* Arabic is cursive: tracking breaks the joins, and text-transform is
   meaningless on it. The "this is a label" signal comes from weight and
   colour instead. Nothing in this file may reintroduce either. */
h1, h2, h3, h4, p, span, b, label, th, td, button, a, li {
  letter-spacing: 0;
  text-transform: none;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

/* <i> is used all over this app as a neutral inline box — a bar's fill, a
   chart marker, a toggle's track, a caption under a name — and never to mean
   emphasis. Arabic has no italic: the browser fakes one by shearing the
   glyphs, which breaks the cursive joins and reads as a rendering fault.
   Reset it once, here. Eight component stylesheets were each patching this
   locally and the two newest chart markers were still slanted. */
i, cite, address, var, dfn { font-style: normal; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:disabled { cursor: not-allowed; }

/* stroke-width 1.7, not v2's 1.9: this design's icons are fine-lined, and the
   rail's 18px glyphs on near-black bloom a full quarter-pixel heavier than the
   same path on paper. Note that `stroke` INHERITS — any inline SVG carrying
   text needs stroke:none on it, or the labels render as outlines. */
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7;
      stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- focus ----------
   The ring changes by CONTEXT, not by theme: the page indigo on the near-black
   rail is under 2:1, so anything inside the rail takes the lifted ring
   instead. Both are checked by test/contrast.py against the ground they
   actually land on. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.spine :focus-visible { outline-color: var(--spine-focus); }

/* Visually hidden, still in the accessibility tree.
   PUT THIS ON A WRAPPER, NEVER ON A <table>. `height: 1px` on a table box is
   a MINIMUM, not a maximum, and `overflow: hidden` does not clip one either —
   so a hidden 800-row chart twin renders at its full height, and because it is
   absolutely positioned it extends the DOCUMENT rather than its parent. That
   is 450px of dead scroll under a dashboard, with nothing on screen to explain
   it. A plain <div class="sr"> around the table clips it and keeps the table a
   table for a screen reader. */
.sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

/* ============================================================
   Numbers — the bidi contract.

   Every figure in the app goes through this, with no exceptions and no
   call-site special cases:

       <bdi class="num">1,240.50</bdi><span class="cur">ر.س</span>
       <bdi class="num">−88.50</bdi>

   The sign lives INSIDE the isolate, or −88.50 renders as 88.50−. The unit
   lives OUTSIDE it, because a number and its currency must never share a bidi
   run. Digits are Latin, from Intl.NumberFormat("en-US") — the bare "ar"
   locale yields Arabic-Indic digits, which will not align in a column.
   ============================================================ */
.num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.cur {
  /* a step under its figure, but never under the floor: .82em of a 13.5px
     cell is 11px, and «ر.س» at 11px is two blurred marks */
  font-size: max(.82em, var(--fs-micro));
  font-weight: var(--w-400);
  color: var(--muted);
  margin-inline-start: .3em;
  unicode-bidi: isolate;
}
/* Belt and braces: if the shipped subset ever lacks tnum, the column still
   lines up on its trailing edge. */
td.n, th.n { text-align: end; }

/* An employee or department name is untrusted data out of a fingerprint
   export — one of them in the real file is literally named "11". Isolated with
   bdi's implicit dir=auto, never a forced direction. */
bdi { unicode-bidi: isolate; }

.pos { color: var(--good); }
.neg { color: var(--crit); }
.mute { color: var(--muted); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--ink-2); }

/* A label: weight and size carry the register, never tracking or caps. */
.lbl {
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--muted);
}

/* ---------- the customisation mark ----------
   Gold means exactly one thing: this value was set away from the layer above.
   Nothing decorative may use these. */
.is-own { position: relative; }
.is-own::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--gold-mark);
}
.gold-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-mark); display: inline-block; flex: none;
}

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

/* ── 30-shell.css ─────────────────────────────── */

/* ============================================================
   Shell: the frame, the rail, the top bar, the head card.

   The arrangement is the warehouse program's (main_layout.dart): a
   264px navy rail, a 64px white top bar, and under it the page, which
   opens with one card of stacked bands (page_header.dart).

   The rail is FIRST in the DOM and lands on the right because the grid
   is RTL — never by float, never by a hard-coded `right:`.
   ============================================================ */

.frame {
  display: grid;
  grid-template-columns: var(--spine-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
/* minmax(0, 1fr), never 1fr: a grid column defaults to min-content, and one
   long Arabic employee name would push the register past the viewport. */

.spine-min .frame { grid-template-columns: var(--spine-w-min) minmax(0, 1fr); }

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

/* ============================================================
   1. The rail (side_bar.dart)

   Navy in BOTH themes, and everything on it is light. Each group's
   title is a row the size of its items, its glyph in a faint square;
   the items hang from a thread that drops out of that square, and the
   thread lights beside the open screen.
   ============================================================ */

.spine {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--spine);
  color: var(--spine-ink);
  overflow: hidden;
}
:root[data-theme="dark"] .spine { border-inline-end: 1px solid var(--spine-line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .spine { border-inline-end: 1px solid var(--spine-line); }
}

.spine-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 14px 12px;
  padding-inline: 14px 10px;
  min-width: 0;
}

/* Shared size for the application mark on the rail. */
.mark {
  flex: none;
  width: 46px;
  height: 46px;
  color: var(--brand-gold);
  display: grid;
  place-items: center;
}
.mark img { width: 100%; height: 100%; display: block; object-fit: contain; }

.spine-name { flex: 1 1 auto; min-width: 0; }
.spine-name b {
  display: block;
  font-size: var(--fs-lead);
  font-weight: var(--w-700);
  line-height: 1.35;
}
.spine-name span {
  display: block;
  font-size: var(--fs-micro);
  line-height: 1.4;
  color: var(--spine-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-foldall {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--spine-ink) 6%, transparent);
  color: var(--spine-muted);
  display: grid;
  place-items: center;
  transition: background var(--t-fast) var(--ease);
}
.nav-foldall svg { width: 18px; height: 18px; }
.nav-foldall:hover { background: color-mix(in srgb, var(--spine-ink) 10%, transparent); }

/* A faint gold thread under the brand, from the application mark's own colour. */
.spine-rule {
  flex: none;
  height: 1px;
  margin-inline: 14px;
  background: color-mix(in srgb, var(--brand-gold) 28%, transparent);
}

/* ---------- nav ---------- */
.nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--spine-3) transparent;
}

.nav-group { margin-block: 2px; }
.nav-fold {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-block: 7px;
  padding-inline: 10px 8px;
  border-radius: var(--r-sm);
  color: var(--spine-ink);
  text-align: start;
  transition: background var(--t-fast) var(--ease);
}
.nav-fold:hover { background: color-mix(in srgb, var(--spine-ink) 6%, transparent); }
.nav-fold-i {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--spine-ink) 6%, transparent);
  color: color-mix(in srgb, var(--spine-ink) 85%, transparent);
  display: grid;
  place-items: center;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav-fold-i svg { width: 18px; height: 18px; }
.nav-group.holds-active .nav-fold-i {
  background: color-mix(in srgb, var(--spine-accent) 18%, transparent);
  color: var(--spine-accent);
}
.nav-fold > span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-cell);
  font-weight: var(--w-700);
  line-height: var(--lh-cell);
}
.nav-fold-c {
  flex: none;
  width: 18px;
  height: 18px;
  color: color-mix(in srgb, var(--spine-muted) 80%, transparent);
  transition: transform var(--t) var(--ease);
}
.nav-group.is-folded .nav-fold-c { transform: rotate(90deg); }

.nav-i {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  max-height: 44px;
  margin-block: 1px;
  /* where the thread falls: under the middle of the group's 30px square */
  margin-inline-start: 36px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--spine-muted);
  text-decoration: none;
  text-align: start;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              max-height var(--t) var(--ease), opacity var(--t) var(--ease),
              padding var(--t) var(--ease), margin var(--t) var(--ease);
}
.nav-i::after {                     /* the thread */
  content: "";
  position: absolute;
  inset-block: -1px;
  inset-inline-start: -12px;
  width: 1.5px;
  background: color-mix(in srgb, var(--spine-ink) 9%, transparent);
}
.nav-i svg { width: 17px; height: 17px; flex: none; }
.nav-i > span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-cell);
  line-height: var(--lh-cell);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-i:hover { background: color-mix(in srgb, var(--spine-ink) 6%, transparent); }

/* The active row is a tint of the accent, not a solid block: the brightest
   text and the coloured glyph say «here», and the thread lights beside it. */
.nav-i[aria-current="page"] {
  background: color-mix(in srgb, var(--spine-accent) 16%, transparent);
  color: var(--spine-ink);
}
.nav-i[aria-current="page"] svg { color: var(--spine-accent); }
.nav-i[aria-current="page"] > span { font-weight: var(--w-700); }
.nav-i[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset-inline-start: -12.75px;
  inset-block: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--spine-accent);
}

/* A folded group keeps the open screen's row: nobody loses where they are. */
.nav-i.is-folded:not([aria-current="page"]) {
  max-height: 0;
  margin-block: 0;
  padding-block: 0;
  opacity: 0;
  visibility: hidden;
}

/* A counter is a quiet figure; the ones that ask for something are the
   warehouse's unread pill. */
.nav-n {
  flex: none;
  min-width: 0;
  padding: 0;
  background: none;
  color: var(--spine-muted);
  font-size: 11.5px;
  font-weight: var(--w-600);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums lining-nums;
}
.nav-i[aria-current="page"] .nav-n { color: var(--spine-ink); }
.nav-n:empty { display: none; }
.nav-n.is-warn {
  padding: 3px 7px;
  border-radius: 20px;
  background: var(--crit-2);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: var(--w-700);
}
.nav-i[aria-current="page"] .nav-n.is-warn { color: #FFFFFF; }
.nav-n.is-gold::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--brand-gold);
}
.nav-n.is-gold { color: var(--spine-ink); }

/* ---------- collapsed ---------- */
.spine-min .spine-top { justify-content: center; padding-inline: 0; }
.spine-min .mark { width: 40px; height: 40px; }
.spine-min .spine-name,
.spine-min .nav-foldall,
.spine-min .nav-group,
.spine-min .nav-i > span,
.spine-min .nav-i::after,
.spine-min .nav-i::before { display: none; }
.spine-min .nav-i,
.spine-min .nav-i.is-folded:not([aria-current="page"]) {
  justify-content: center;
  max-height: 44px;
  margin-block: 2px;
  margin-inline-start: 0;
  padding: 10px 0;
  opacity: 1;
  visibility: visible;
}
.spine-min .nav-i svg { width: 20px; height: 20px; }
/* a counter has no room for its digits, so it becomes a presence indicator */
.spine-min .nav-n {
  position: absolute;
  top: 7px;
  inset-inline-end: 12px;
  width: 7px;
  height: 7px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  border-radius: 50%;
  background: var(--spine-muted);
}
.spine-min .nav-n.is-gold { background: var(--brand-gold); }
.spine-min .nav-n.is-warn { background: var(--crit-2); }
.spine-min .nav-n::before { display: none; }

/* ============================================================
   2. The top bar (top_bar.dart)

   The screen's name, what the figures below are about, then the tools,
   the account and the way out. The name is the only elastic thing in
   the row, so everything else stays against the far edge.
   ============================================================ */

.ubar {
  position: sticky;
  top: 0;
  z-index: 40;
  container: ubar / inline-size;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--ubar-h);
  padding: 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.ubar-t {
  flex: 1 1 0;
  min-width: 0;
  font-size: 16px;
  font-weight: var(--w-700);
  line-height: var(--lh-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ubtn {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ubtn svg { width: 21px; height: 21px; }
.ubtn:hover { background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--ink); }
.ubtn.is-help { color: var(--accent); }

/* The finding count on the bell: the warehouse's unread pill. */
.ubtn-n {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--crit-2);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: var(--w-700);
  line-height: 1;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums lining-nums;
  box-shadow: 0 0 0 2px var(--card);
}

/* The open month: the warehouse's scope chip, beside the title. */
.plate {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding-inline: 5px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  text-align: start;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.plate:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
}
.plate-ico {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: var(--fs-micro);
  font-weight: var(--w-700);
  overflow: hidden;
}
.plate-txt { min-width: 0; display: flex; align-items: baseline; gap: 6px; line-height: 1.3; }
.plate-name {
  font-size: var(--fs-label);
  font-weight: var(--w-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plate-when {
  font-size: var(--fs-micro);
  color: var(--muted);
  white-space: nowrap;
}
.plate-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* The theme: the warehouse's quick toggle, keeping v6's third state. */
.theme {
  flex: none;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--card-2);
}
.theme button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme button svg { width: 17px; height: 17px; }
.theme button:hover { color: var(--ink); }
.theme button[aria-checked="true"] {
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--sh-1);
}

/* The window is narrower than the row: the words give way first. */
@container ubar (max-width: 860px) {
  .plate-when, .pnav > span { display: none; }
}
@container ubar (max-width: 700px) {
  .plate-txt { display: none; }
  .plate { padding-inline: 5px; }
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  height: var(--ctrl-h-sm);
  padding: 0 10px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--fs-label);
}
.file-chip svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.file-chip b {
  min-width: 0;
  font-weight: var(--w-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   3. The head card (page_header.dart)

   One card of stacked bands, so every tool of the page is one block:

     [badge] [title · meta]            [search] [actions]
     ──────────────────────────────────────────────────────
     [⚙ filters, on the tinted strip]
     ──────────────────────────────────────────────────────
     [📅 the year ribbon, on white]

   Sticky under the top bar: the filters and the month decide what every
   figure on the screen means, so they may not scroll away. --phead-h
   follows its height (91-v6-month.js), and screens that size a scrollport
   against the window read that.
   ============================================================ */

.phead {
  position: sticky;
  top: var(--ubar-h);
  z-index: 30;
  container: phead / inline-size;
  padding: 12px var(--gutter) 8px;
  background: var(--paper);
}
.phead-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
}

.phead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px var(--gutter);
}

/* the gradient badge: the rail row's glyph (71-v6-shell.js) */
.phead-ico {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-lg);
  background: var(--grad-primary);
  box-shadow: var(--sh-accent);
  color: var(--on-solid);
  display: grid;
  place-items: center;
}
.phead-ico svg { width: 22px; height: 22px; }

.phead-t {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.phead-t h1 {
  font-size: var(--fs-h1);
  font-weight: var(--w-700);
  line-height: 1.35;
  white-space: nowrap;
}
.phead-t .meta {
  min-width: 0;
  font-size: 12px;
  font-weight: var(--w-500);
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phead-t .meta:empty { display: none; }
.phead-a { flex: none; display: flex; align-items: center; gap: 8px; }

.phead .fld-q { flex: 0 1 260px; min-width: 150px; }

/* ---------- the filter strip ---------- */
.tb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px var(--gutter);
  background: var(--strip);
  border-top: 1px solid var(--line);
  min-width: 0;
  flex-wrap: nowrap;
}
.tb-row[hidden] { display: none; }
.tb-row .sp { flex: 1 1 auto; }
.strip-i { flex: none; width: 15px; height: 15px; color: var(--muted); opacity: .75; }

.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld-l,
.fld > label {
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--muted);
}
/* A pill says its own value, so the band draws no labels; every control keeps
   its accessible name through the clipped one. */
.tb-row .fld { position: relative; flex-direction: row; align-items: center; gap: 0; }
.tb-row .fld-l,
.tb-row .fld > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.tb-row .inp {
  height: var(--ctrl-h-sm);
  border-color: var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--muted);
}
/* A select takes its value's own width up to a ceiling, and GIVES WAY before
   anything overlaps. */
.tb-row .fld:has(> select) { flex: 0 1 auto; min-width: 118px; }
.tb-row select.inp { width: 100%; min-width: 0; max-width: 260px; padding-inline-start: 14px; }
.fld-period { flex: 0 0 auto; }

/* Two native date inputs inside one pill: it reads as a single period control
   and keeps every keyboard, locale and calendar behaviour the platform gives. */
.period {
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--ctrl-h-sm);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  transition: border-color var(--t-fast) var(--ease);
}
.period:hover { border-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.period:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.period .inp-ico {
  position: static;
  transform: none;
  flex: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  margin-inline-end: 4px;
}
.period .inp-ico svg { width: 15px; height: 15px; }
.tb-row .inp-date,
.inp-date {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
  font-size: var(--fs-label);
  font-variant-numeric: tabular-nums lining-nums;
  width: auto;
}
.inp-date:hover { border: 0; }
.inp-date:focus-visible { outline: none; box-shadow: none; }
.period-sep { color: var(--muted); padding: 0 2px; }

/* The slot is permanent and only its VISIBILITY flips: animating its width
   would shove القياس sideways every time the department changes. */
.fld-tune {
  flex: none;
  transition: opacity var(--t) var(--ease);
}
.fld-tune.is-off { visibility: hidden; opacity: 0; }

/* ---------- the filter chips ---------- */
.chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px var(--gutter);
  background: var(--strip);
  border-top: 1px solid var(--line);
}
.chips[hidden] { display: none; }

/* a window narrower than the band: the filters wrap, as a last resort */
@container phead (max-width: 760px) {
  .tb-row { flex-wrap: wrap; }
}

/* A wide window gives its height back: the filters and the ribbon share one
   band, and the rows of a register get what they would have stood on. */
@container phead (min-width: 1500px) {
  .phead-card { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .phead-row, .chips { grid-column: 1 / -1; }
  .chips { order: 3; }
  .tb-row {
    border-inline-end: 1px solid var(--line);
    border-end-start-radius: calc(var(--r-xl) - 1px);
  }
  .tb-row .sp { display: none; }
  .tb-row select.inp { max-width: 170px; }
  .v6-yearbar { border-end-start-radius: 0; }
  .tb-row[hidden] ~ .v6-yearbar {
    grid-column: 1 / -1;
    border-end-start-radius: calc(var(--r-xl) - 1px);
  }
}

/* A short window (a 768px laptop) tightens the chrome rather than the rows. */
@media (max-height: 780px) {
  :root { --ubar-h: 57px; }
  .phead { padding-block: 8px 6px; }
  .phead-row { padding-block: 6px; }
  .phead-ico { width: 34px; height: 34px; }
  .phead-ico svg { width: 19px; height: 19px; }
  .phead-t { flex-direction: row; align-items: baseline; gap: 10px; }
  .phead-t h1 { font-size: 18px; }
  .tb-row, .v6-yearbar { padding-block: 4px; }
}

/* ============================================================
   4. The page
   ============================================================ */

.page {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px var(--gutter);
  padding-bottom: 48px;
}
.screen { max-width: var(--page-max); margin-inline: auto; }

/* Five screens hand the page their blocks bare — a summary band, a run of
   notices, a table card — with no wrapper to space them, and in v5 those
   blocks simply touched. One rhythm for all five: 12px between blocks, 6px
   between two notices in a row (they are one message in several lines).
   Margins, not a grid on the screen: `display` stays the [hidden]
   attribute's to decide, and print re-flows these screens as blocks. */
:is(#scRegister, #scOt, #scAbsence, #scMissions, #scDepts) > * + * { margin-top: 12px; }
:is(#scRegister, #scOt, #scAbsence, #scMissions, #scDepts) > .note + .note { margin-top: 6px; }

/* v2 gave every screen its own heading block. v3 hoisted that into .phead, so
   one page title exists and route() owns it. A screen that still emits
   .screen-head would double it — this keeps such a slip visible rather than
   silently stacked. */
.screen-head { display: none; }

/* Feedback for the local department filters, independent of the table redraw. */
.dept-filter-status:not(:empty) {
  position: fixed;
  z-index: 110;
  inset-block-start: calc(var(--bar-h, 64px) + 12px);
  inset-inline-end: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  box-shadow: var(--sh-card);
  font-size: var(--fs-label);
  pointer-events: none;
}
.dept-filter-status:not(:empty)::before {
  content: "";
  inline-size: 15px;
  block-size: 15px;
  box-sizing: border-box;
  border: 2px solid var(--accent);
  border-inline-end-color: transparent;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .dept-filter-status:not(:empty)::before { animation: dept-filter-spin .75s linear infinite; }
  @keyframes dept-filter-spin { to { transform: rotate(360deg); } }
}
@media print {
  .dept-filter-status { display: none !important; }
}

/* ── 31-v6-nav.css ─────────────────────────────── */

/* ============================================================
   «رجوع» / «تقدّم» — at the start of the top bar (71-v6-nav.js)

   Before the title, on every screen, in the same place: the reader's eye
   finds it where the way back always is. Quiet until there is somewhere to
   go — off, it is a faint outline, not a hole the title jumps into.
   ============================================================ */

.phead-nav {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pnav {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}
.pnav svg { width: 17px; height: 17px; flex: none; }
.pnav:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent);
}
.pnav:disabled { opacity: .45; cursor: default; }

/* icon only: the arrow says it, the tooltip says where */
.pnav-fwd { padding: 0; }
/* the sprite's chevron points right, which is back; forward is its mirror */
.pnav-fwd svg { transform: scaleX(-1); }

/* ── 40-controls.css ─────────────────────────────── */

/* ============================================================
   Controls and containers — the shared vocabulary.

   Every screen builds from these. A screen that needs a variant adds a
   modifier class in its own stylesheet; it never redefines .btn or .inp.

   v6's rules for this file:
     · one control height — 36px (--ctrl-h); 32px (--ctrl-h-sm) inside a
       dense toolbar (the filter band, a card's head, a table cell);
     · radius by role, the warehouse's — card 12, field 10, button 8; the
       head card's and a card head's tools are PILLS (.btn inside them);
     · the focus ring is one thing everywhere: 2px of --focus, offset;
     · a card has a border AND the warehouse's soft shadow (--sh-card).
   ============================================================ */

/* ============================================================
   0. The measure hue carrier

   One attribute sets the hue for everything inside it. Put data-m="3" on a
   figure and its bar and its chart series are violet, because the quantity
   is إجمالي الساعات and violet is what that quantity looks like. It only
   holds if nothing else reaches for these values directly.
   ============================================================ */
[data-m="1"] { --m: var(--m-1); --m-ink: var(--m-1-ink); --m-soft: var(--m-1-soft); }
[data-m="2"] { --m: var(--m-2); --m-ink: var(--m-2-ink); --m-soft: var(--m-2-soft); }
[data-m="3"] { --m: var(--m-3); --m-ink: var(--m-3-ink); --m-soft: var(--m-3-soft); }
[data-m="4"] { --m: var(--m-4); --m-ink: var(--m-4-ink); --m-soft: var(--m-4-soft); }
[data-m="5"] { --m: var(--m-5); --m-ink: var(--m-5-ink); --m-soft: var(--m-5-soft); }
[data-m="6"] { --m: var(--m-6); --m-ink: var(--m-6-ink); --m-soft: var(--m-6-soft); }
[data-m="7"] { --m: var(--m-7); --m-ink: var(--m-7-ink); --m-soft: var(--m-7-soft); }
[data-m="8"] { --m: var(--m-8); --m-ink: var(--m-8-ink); --m-soft: var(--m-8-soft); }

/* The measure glyph. v5 set it in a tinted square, and five squares in five
   hues across the summary band were the loudest thing on the page while
   saying the least. It is a bare glyph now, in the label's own muted ink:
   the measure's hue is spent where the measure is DRAWN — its bar, its line,
   its day cell — and the figure carries the weight. */
.ichip {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.ichip svg { width: 16px; height: 16px; }
.ichip-sm { width: 16px; height: 16px; }
.ichip-sm svg { width: 14px; height: 14px; }

/* ---------- panels: the warehouse's card ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2, .panel-head h3 {
  font-size: var(--fs-h3);
  font-weight: var(--w-700);
  line-height: var(--lh-cell);
  margin-inline-end: auto;
}
.panel-head .meta { font-size: var(--fs-label); color: var(--muted); }
.panel-head .inp { width: auto; height: var(--ctrl-h-sm); padding-block: 0; font-size: var(--fs-label); }
/* the warehouse's action pills: an outline that tints with the accent */
.panel-head .btn:not(.btn-solid, .btn-primary, .btn-danger) {
  height: var(--ctrl-h-sm);
  padding: 0 14px;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  color: var(--accent);
  font-size: var(--fs-label);
  font-weight: var(--w-700);
}
.panel-head .btn:not(.btn-solid, .btn-primary, .btn-danger):hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.panel-head :is(.btn-solid, .btn-primary, .btn-danger) { height: var(--ctrl-h-sm); padding: 0 16px; border-radius: var(--r-pill); font-size: var(--fs-label); }
.panel-head .btn svg { width: 15px; height: 15px; }
.panel-body { padding: 16px; }

/* ---------- buttons ----------
   Four kinds and no fifth:
     .btn              the bordered secondary — most buttons
     .btn-solid        THE primary action of a page: the warehouse's gradient
                       with its coloured shadow, one per view
     .btn-primary      the primary inside a surface that floats (a dialog's or
                       the drawer's footer), a flat fill — one per footer
     .btn-ghost        a quiet action with no border until hovered
     .btn-danger       destroys something; only ever inside a confirm */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--ctrl-h);
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--card-2); border-color: var(--day-rule); color: var(--ink); }
.btn:active { background: var(--line-soft); }
.btn:disabled { opacity: .5; background: var(--card-2); border-color: var(--line); color: var(--muted); }
.btn:disabled:hover { background: var(--card-2); border-color: var(--line); color: var(--muted); }
.btn:focus-visible { outline-offset: 2px; border-radius: var(--r); }

/* THE primary action: the gradient the warehouse wraps its «إضافة» in. */
.btn-solid {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: var(--sh-accent);
  color: var(--on-solid);
  font-weight: var(--w-700);
}
.btn-solid:hover {
  background: var(--grad-primary);
  border-color: transparent;
  color: var(--on-solid);
  filter: brightness(1.06);
}
.btn-solid:active { filter: brightness(.96); }
.btn-solid:disabled,
.btn-solid:disabled:hover { background: var(--grad-primary); border-color: transparent; color: var(--on-solid); opacity: .4; box-shadow: none; filter: none; }
.phead .btn-solid { height: 40px; padding: 0 20px; border-radius: var(--r-pill); }

/* The flat action, for the ONE primary inside a floating surface — the
   drawer's احفظ, a dialog's confirm. */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: var(--w-600);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: transparent; color: var(--on-accent); }
.btn-primary:active { background: var(--accent); }
.btn-primary:disabled,
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); opacity: .45; }

.btn-danger { background: var(--crit); border-color: var(--crit); color: var(--on-crit); font-weight: var(--w-600); }
.btn-danger:hover {
  background: color-mix(in srgb, var(--crit) 88%, var(--ink));
  border-color: color-mix(in srgb, var(--crit) 88%, var(--ink));
  color: var(--on-crit);
}

.btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-label); border-radius: var(--r-sm); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { border-color: var(--line); background: var(--card-2); }

/* The customisation trigger. */
.btn-tune { height: var(--ctrl-h); }
.tb-row .btn-tune { height: var(--ctrl-h-sm); padding: 0 12px; border-radius: var(--r-pill); font-size: var(--fs-label); color: var(--muted); }
.btn-tune svg { color: var(--accent); }
.btn-tune .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-mark); flex: none;
}

.link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  font-weight: var(--w-500);
}
.link:hover { color: var(--accent-2); text-decoration-color: currentColor; }

/* ---------- inputs ---------- */
.inp {
  width: 100%;
  height: var(--ctrl-h);
  padding: 0 12px;
  border-radius: var(--r-field);
  border: 1px solid color-mix(in srgb, var(--day-rule) 62%, var(--line));
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-body);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.inp::placeholder { color: var(--muted); opacity: 1; }
textarea.inp { height: auto; padding: 8px 11px; line-height: var(--lh-body); }
.inp:hover { border-color: var(--day-rule); }
/* inputDecorationTheme's focusedBorder: the frame itself thickens in the accent. */
.inp:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 .6px var(--accent);
  outline: none;
  border-radius: var(--r-field);
}
.inp:disabled { background: var(--card-2); color: var(--muted); }

/* The caret is drawn from currentColor through color-mix, so a select carries
   a muted caret without a literal hex escaping into a component stylesheet.
   Positions are PHYSICAL px from the left edge, which in RTL is the trailing
   edge of the control. */
select.inp {
  appearance: none;
  padding-inline-end: 30px;
  text-overflow: ellipsis;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, currentColor 58%, transparent) 50%),
    linear-gradient(135deg, color-mix(in srgb, currentColor 58%, transparent) 50%, transparent 50%);
  background-position: 12px calc(50% + 1px), 17px calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* The search field: the glyph sits inside the control. */
.fld-q { position: relative; }
/* The warehouse's capsule: filled with the bench, no frame until focused. */
.fld-q .inp {
  padding-inline-start: 38px;
  height: 38px;
  font-size: var(--fs-cell);
  background: var(--paper);
  border-color: transparent;
  border-radius: var(--r-pill);
}
.fld-q .inp:hover { border-color: var(--line); }
.fld-q .inp:focus-visible { background: var(--card); border-color: var(--accent); border-radius: var(--r-pill); }
.inp-ico {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  line-height: 0;
}
.inp-ico svg { width: 17px; height: 17px; }
.fld-q label + .inp-ico { top: 19px; }

/* A numeric field still reads left-to-right, but it must sit at the trailing
   edge of a right-aligned Arabic form, not float away from its label. */
input.inp.n {
  direction: ltr;
  text-align: end;
  font-variant-numeric: tabular-nums lining-nums;
  /* No stepper: the figure is typed, never clicked up to. */
  appearance: textfield;
  -moz-appearance: textfield;
}
input.inp.n::-webkit-outer-spin-button,
input.inp.n::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body);
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  width: 34px; height: 20px; flex: none;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--muted) 62%, var(--card));   /* 3:1 on a card: the track is the control
                                                                     when it is off */
  border: 1px solid transparent;
  position: relative;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.switch i::after {
  content: "";
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--sh-1);
  transition: transform var(--t) var(--ease), background var(--t) var(--ease);
}
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { background: var(--on-accent); transform: translateX(-14px); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }

/* a segmented control: a sunken track, the pressed segment a raised card */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r);
       background: var(--card-2); border: 1px solid var(--line); }
.seg button {
  min-height: 26px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg button:hover { color: var(--ink); }
/* both attributes: a toggle group presses, a radio group checks */
.seg button[aria-pressed="true"],
.seg button[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font-weight: var(--w-700);
}

/* ---------- menus ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 288px;
  padding: 5px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
}
.menu button {
  display: block;
  width: 100%;
  text-align: start;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) var(--ease);
}
.menu button:hover { background: var(--card-2); }
.menu button b { display: block; font-size: var(--fs-body); font-weight: var(--w-600); }
.menu button i { display: block; font-style: normal; font-size: var(--fs-micro); color: var(--muted); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px; }
.caret { width: 14px; height: 14px; opacity: .7; }

/* ---------- notes ----------
   A notice is a LINE, not a slab. v5 filled these with the state's tint, and
   a salmon block carrying a whole paragraph above a table was louder than
   the table. Now: a card-coloured strip, a 3px edge in the state's colour at
   the reading side, the glyph in that colour, and the sentence in secondary
   ink — with anything the author marked <b> lifted to full ink, so the count
   reads first and the explanation reads as explanation. */
.note {
  position: relative;
  display: flex;
  gap: 9px;
  padding: 8px 12px;
  padding-inline-start: 14px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: var(--fs-label);
  color: var(--ink-2);
  line-height: var(--lh-body);
  --_edge: var(--day-rule);
}
.note::before {
  content: "";
  position: absolute;
  inset-block: -1px;
  inset-inline-start: -1px;
  width: 3px;
  border-start-start-radius: var(--r);
  border-end-start-radius: var(--r);
  background: var(--_edge);
}
.note b { color: var(--ink); font-weight: var(--w-600); }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.note.is-warn { --_edge: var(--warn-2); }
.note.is-warn svg { color: var(--warn); }
.note.is-crit { --_edge: var(--crit-2); }
.note.is-crit svg { color: var(--crit); }
.note.is-gold { --_edge: var(--gold-mark); }
.note.is-gold svg { color: var(--gold-mark); }
.note.is-info { --_edge: var(--accent); }
.note.is-info svg { color: var(--accent); }

/* ---------- badges, tags, chips ----------
   Three sizes of small thing, and they are not interchangeable:
     .badge  a pill that states a status          (pill, tinted)
     .tag    a square-ish marker on a figure      (--r-xs, no border)
     .chip   a removable filter                   (--r-sm, carries a ✕)
*/
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: var(--w-700);
  line-height: var(--lh-cell);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
/* StatusChip's dot: the state is caught at a glance */
.badge:is(.is-good, .is-crit, .is-warn, .is-accent, .is-gold)::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.is-gold { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold-mark) 30%, transparent); color: var(--gold-ink); }
.badge.is-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.badge.is-good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 24%, transparent); color: var(--good); }
.badge.is-crit { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 24%, transparent); color: var(--crit); }
.badge.is-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 26%, transparent); color: var(--warn); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  background: var(--card-2);
  color: var(--muted);
  white-space: nowrap;
}
.tag.is-warn { background: var(--warn-soft); color: var(--warn); }
.tag.is-gold { background: var(--gold-soft); color: var(--gold-ink); }
/* راتب ثابت — not bound to attend (50-pay.js payFixed) */
.tag.tag-fixed {
  background: var(--fixed-soft);
  color: var(--fixed-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fixed) 35%, transparent);
}
/* a sum in two currencies, one per line (56-v6-cur.js curStackHtml) */
.cur-line { display: block; white-space: nowrap; }
.cur-line.is-more { font-size: .62em; font-weight: var(--w-600); opacity: .85; margin-top: 2px; }
td .cur-line.is-more { font-size: .9em; }
/* what is taken home in another currency, under a net (56-v6-cur.js curPaidHtml) */
.cur-paid { display: block; white-space: nowrap; font-size: .82em; font-weight: var(--w-600, 600); color: var(--muted); margin-top: 2px; }
.cur-paid.is-nofx { color: var(--warn); white-space: normal; }

/* paid in another currency than the general one — «$» (56-v6-cur.js) */
.tag.tag-cur {
  background: var(--good-soft);
  color: var(--good);
  font-weight: var(--w-600, 600);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 30%, transparent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: var(--fs-label);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip b { font-weight: var(--w-500); color: var(--muted); }
.chip button {
  width: 18px; height: 18px;
  border-radius: 50%;
  color: var(--muted);
  display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chip button svg { width: 11px; height: 11px; }
.chip button:hover { background: var(--crit-soft); color: var(--crit); }

/* ---------- the change indicator ----------
   Only ever drawn from a real comparison against a real preceding period. A
   tile with nothing to compare against shows a fact instead — never a zero
   dressed as a delta. */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: var(--w-600);
  color: var(--muted);
}
.delta::before { font-size: .85em; line-height: 1; }
.delta.is-up { color: var(--good); }
.delta.is-up::before { content: "▲"; }
.delta.is-down { color: var(--crit); }
.delta.is-down::before { content: "▼"; }
.delta.is-flat::before { content: "—"; }

/* ---------- the progress bar ----------
   Its fill is the MEASURE's hue, inherited through --m, so a bar is never
   coloured by hand. The track has to clear 3:1 against the fill. */
.bar {
  position: relative;
  height: 5px;
  min-width: 40px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--m, var(--accent));
}
.bar.is-good i { background: var(--good-2); }
.bar.is-crit i { background: var(--crit-2); }

/* ---------- the initial square ----------
   The name's own first letter, as a quiet monogram: a neutral square, not a
   tinted one. v5 tinted it per screen; a column of coloured letter chips is
   the most recognisable mark of an admin template and told the clerk
   nothing. It stays because it gives a row a fixed starting point for the
   eye — and nothing more is asked of it. */
.avat {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  line-height: 1;
}

/* a legend dot — anything whose slices are NAMES */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  background: var(--c, var(--muted));
}

/* ---------- the source chip ----------
   A word beside a name saying which layer governs this person: عام · إدارة ·
   خاص. It is a word because a clerk tracing a wrong figure reads words.

   Weighted by how rare, and how suspect, each answer is. «عام» is what most
   of the rows say — so it is bare muted text with no box at all, and only
   shows that it can be pressed when its row is hovered or it is focused.
   A bordered «عام» on every one of 144 rows was 144 boxes saying "nothing
   to see here". «إدارة» wears the accent; «خاص» wears gold, the app's one
   reserved meaning — "set away from the layer above it". */
.src {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
  line-height: var(--lh-cell);
  white-space: nowrap;
  vertical-align: middle;
}
.src[data-src="d"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  font-weight: var(--w-500);
}
.src[data-src="e"] {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold-mark) 30%, transparent);
  color: var(--gold-ink);
  font-weight: var(--w-500);
}
/* It opens the rule it names, so it says it is pressable on hover. The
   general chip is written both ways in the markup — with no attribute, and
   with data-src="g" — so both are named. */
tr:hover button.src:not([data-src]),
tr:hover button.src[data-src="g"],
button.src:not([data-src]):focus-visible,
button.src[data-src="g"]:focus-visible { border-color: var(--line); }
button.src:hover { border-color: currentColor; }

/* ---------- empty states ----------
   An empty state that names the filter to drop is worth ten that say
   "no results". */
.empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty b {
  font-family: var(--font-title);
  font-size: var(--fs-lead);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.empty p { max-width: 48ch; font-size: var(--fs-body); }

/* ---------- skeletons ---------- */
.skel {
  background: linear-gradient(90deg, var(--card-2) 25%, var(--card-3) 37%, var(--card-2) 63%);
  background-size: 400% 100%;
  animation: skel 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- the changed-value flash ----------
   What makes a non-modal editor worth the engineering: the difference between
   "I changed something" and "I can see what it did". */
@keyframes flash-gold {
  0%   { background: var(--gold-soft); }
  100% { background: transparent; }
}
.flash { animation: flash-gold .9s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .flash {
    animation: none;
    box-shadow: inset 0 -1px 0 0 var(--gold-mark);
    transition: box-shadow 1.2s step-end;
  }
}

/* ── 41-v6-pick.css ─────────────────────────────── */

/* The searching list of a long <select> — 58-v6-pick.js. Built like .menu:
   a card, its edge, --sh-3; the rows are the select's options. Above every
   dialog and drawer (they stop at 95), because it opens from inside them. */
.pk {
  position: fixed;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
  border-radius: var(--r-field);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  color: var(--ink);
}
.pk-q.inp { flex: none; height: var(--ctrl-h-sm); font-size: var(--fs-label); }
.pk-l {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pk-o {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-body);
  line-height: 1.45;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.pk-o.is-act { background: var(--card-2); }
.pk-o[aria-selected="true"] { background: var(--sel); color: var(--accent); font-weight: var(--w-600); }
.pk-o[aria-selected="true"].is-act { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.pk-o[aria-disabled="true"] { color: var(--muted); cursor: default; }
.pk-g {
  padding: 8px 10px 3px;
  font-size: var(--fs-micro);
  font-weight: var(--w-700);
  color: var(--muted);
}
.pk-tag {
  margin-inline-start: 8px;
  padding: 0 6px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: var(--w-400, 400);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.pk-none { padding: 10px; font-size: var(--fs-label); color: var(--muted); text-align: center; }

/* data-multi (2026-11-25): several options ticked at once — a box before each */
.pk-hint { margin: 0; padding: 0 6px; font-size: var(--fs-micro); color: var(--muted); }
.pk.is-multi .pk-o.pk-ck { position: relative; padding-inline-start: 32px; }
.pk.is-multi .pk-o.pk-ck::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 1.5px solid var(--line-2, var(--muted));
  border-radius: 3px;
  background: var(--card);
}
.pk.is-multi .pk-o.pk-ck[aria-selected="true"]::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--card);
}
.pk.is-multi .pk-o[aria-selected="true"] { background: transparent; color: var(--ink); font-weight: var(--w-600); }
.pk.is-multi .pk-o[aria-selected="true"].is-act,
.pk.is-multi .pk-o.is-act { background: var(--card-2); }

/* ── 50-tables.css ─────────────────────────────── */

/* ============================================================
   Tables — the register and everything shaped like it.

   A payroll register is a WORKING table, so it is drawn like one:
   45px rows (49px where the name cell carries a second line),
   figures in tabular numerals on the trailing edge of their
   column, the warehouse's tinted header and alternate stripe, a
   header that stays, and two states that cannot be mistaken for
   each other — a hovered row is a faint wash, a selected row is an
   accent wash with an accent bar at its reading edge.
   ============================================================ */

.tw {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
/* A table that is the FIRST thing inside its card has no head above it, so it
   has to round the card's top corners itself — otherwise the sticky header
   paints a square block inside the card's radius and the card reads as
   broken. With a .panel-head above, .tw is not :first-child and only the
   bottom rounds, which keeps the head flush against the table. */
.panel > .tw:first-child { border-radius: var(--r-lg); }
/* a table card sits lower than a plain card, as AppTable's does */
.panel:has(> .tw) { box-shadow: var(--sh-table); }

table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  /* fixed, so a column keeps its width whatever lands in it */
  table-layout: fixed;
  font-size: var(--fs-cell);
  line-height: var(--lh-cell);
  font-variant-numeric: tabular-nums lining-nums;
}

table.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card-3);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: var(--w-700);
  text-align: start;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* `top: 0` above resolves against the nearest SCROLLPORT, not against the
   viewport — which is .tw once a screen gives it a max-height, as .reg-panel
   does. */

/* The end cells clip to the card themselves as well. .tw's radius is on a
   scroll container, and a position:sticky child inside one is painted in its
   own layer that the container's rounded corner does not reliably cut.
   Logical corners, so the pair mirrors for free. */
.panel > .tw:first-child table.tbl thead tr:first-child th:first-child {
  border-start-start-radius: var(--r-lg);
}
.panel > .tw:first-child table.tbl thead tr:first-child th:last-child {
  border-start-end-radius: var(--r-lg);
}

table.tbl th.n, table.tbl td.n { text-align: end; }

/* A 45px row, bought with padding rather than `height`: the print sheet
   re-declares this padding in points, and a height in px would survive that
   re-declaration and blow every row on paper up to a screen measurement. */
table.tbl tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  /* --lh-cell is the descender floor (10-tokens): ج ح خ ع غ and a final ى
     would clip inside an ellipsised cell on a tighter line. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
/* the warehouse's alternate stripe. Before everything below, which wins over it. */
table.tbl tbody tr:nth-child(even) td { background: var(--stripe); }

/* راتب ثابت — somebody not bound to attend (50-pay.js payFixed): a magenta
   wash and a bar at the reading edge, so the row is told apart before a
   figure in it is read. Before hover and selection, which win over it. */
table.tbl tbody tr.is-fixed td { background: color-mix(in srgb, var(--fixed-soft) 75%, var(--card)); }
table.tbl tbody tr.is-fixed td:first-child { box-shadow: inset 3px 0 0 var(--fixed); }
[dir="rtl"] table.tbl tbody tr.is-fixed td:first-child { box-shadow: inset -3px 0 0 var(--fixed); }

/* Row hover and selection are a mix with the accent, never a flat tint —
   a flat dark tint reads as a hole punched in the table. */
table.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
table.tbl tbody tr.is-sel td { background: var(--sel); }
/* …and the selected row carries a bar at its reading edge, so selection
   survives a monitor that cannot show a 4% wash. An inset shadow, not a
   border: a border would move the first cell's content by its own width. */
table.tbl tbody tr.is-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] table.tbl tbody tr.is-sel td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
table.tbl tbody tr.is-open td { background: var(--card-2); }

/* A column group opens with AIR, not with a rule. There are no vertical
   gridlines anywhere in this design: the row rule alone carries the grid. */
table.tbl .grp { padding-inline-start: 20px; }

/* ---------- sortable headers ---------- */
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card-3)); }
table.tbl th[aria-sort="ascending"],
table.tbl th[aria-sort="descending"] { color: var(--accent); }
table.tbl th .sort-i {
  display: inline-block;
  width: 0; height: 0;
  margin-inline-start: 5px;
  vertical-align: middle;
  border-inline: 3.5px solid transparent;
}
table.tbl th[aria-sort="descending"] .sort-i { border-top: 4.5px solid var(--accent); }
table.tbl th[aria-sort="ascending"]  .sort-i { border-bottom: 4.5px solid var(--accent); }

/* ---------- the rank and the row expander ----------
   Every table that folds a detail row open shares this one expander; a
   second copy under a second name is how two expanders start pointing in
   different directions. */
.row-x {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  border-radius: var(--r-xs);
  color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.row-x svg {
  width: 13px;
  height: 13px;
  /* The chevron points at the inline-start edge while closed and straight
     down while open. rotate() is not mirrored by dir=rtl, and 90° on a
     down-chevron lands on the left — which IS the start edge here. */
  transform: rotate(90deg);
  transition: transform var(--t) var(--ease);
}
.row-x[aria-expanded="true"] svg { transform: rotate(0); }
.row-x[aria-expanded="true"] { color: var(--accent); }
.row-x:hover { background: var(--accent-soft); color: var(--accent); }
.rk-n {
  font-size: var(--fs-micro);
  color: var(--muted);
  margin-inline-start: 4px;
}

/* ---------- the name cell ----------
   The initial, the name on the first line, and the thing it belongs to on a
   quieter second line. Two lines in ONE cell, so the pair is read as a single
   fact instead of as two columns the eye has to join back together. */
.cell-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
/* A table row carries no monogram. The markup still emits .avat first in the
   cell; inside a table it is not drawn: a column of letter squares told the
   clerk nothing, and its 35px is what lets a four-part Arabic name stand
   whole beside fourteen figure columns. (.avat itself is unchanged — cards
   and lists outside a table still use it.) */
table.tbl .cell-name > .avat { display: none; }
/* min-width:0 on the flex item AND on its children, or one long Arabic name
   sets the column's min-content width and the ellipsis never engages. */
.cell-name .nm-wrap { display: grid; gap: 0; min-width: 0; }
.cell-name .nm-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cell-name .nm {
  font-weight: var(--w-500);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cell-name .sub {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
  min-width: 0;
}

/* ---------- a figure with its own bar ----------
   Any numeric cell may carry one, and the fill's hue arrives from the MEASURE
   the column reports — put data-m on the cell and .bar's own
   `background: var(--m)` picks it up. Nothing here names a colour.

   The bar leads and the figure follows, matching .reg-meter, so a reader
   scanning two bar columns finds both bars on the same side of the figure. */
.cell-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.cell-bar .bar { flex: 1 1 auto; max-width: 52px; min-width: 24px; height: 4px; }

/* ---------- the department cell, with its inline تخصيص ----------
   Quiet until the row is hovered or the control is focused — the register is
   for reading, and a button on every one of 144 rows would shout. */
.cell-dept { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cell-dept .dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* 18px: this button rides on the name cell's SECOND line, whose own box is
   12px × 1.5 = 18px. A taller button would set the line height itself and
   push every row past the height the design asks for. */
.tune-i {
  flex: none;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.tune-i svg { width: 13px; height: 13px; }
tr:hover .tune-i, .tune-i:focus-visible { opacity: 1; }
.tune-i:hover { background: var(--accent-soft); color: var(--accent); }
/* a department that already carries a rule always shows its mark */
.tune-i.has-rule { opacity: 1; color: var(--gold-mark); }

/* ---------- the expanded day detail ---------- */
tr.detail > td {
  padding: 0;
  background: var(--card-2);
  box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line);
}
.detail-in { padding: 12px 16px 14px; display: grid; gap: 10px; }
.detail-in h4 { font-size: var(--fs-label); color: var(--muted); font-weight: var(--w-600); }

table.days {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-label);
  font-variant-numeric: tabular-nums lining-nums;
}
table.days th {
  text-align: start;
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}
table.days td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); }
table.days tr:last-child td { border-bottom: 0; }
table.days th.n, table.days td.n { text-align: end; }
table.days tr.is-off td { color: var(--muted); }

.day-note {
  font-size: var(--fs-micro);
  color: var(--muted);
}
.day-note.is-warn { color: var(--warn); }
.day-note.is-crit { color: var(--crit); }

/* ---------- selection bar ----------
   It floats, so it is one of the few things with a shadow. A rounded bar, not
   a pill: it carries buttons, and pills are for status. */
.selbar {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px auto 0;
  width: fit-content;
  max-width: 100%;
  padding: 7px 8px 7px 8px;
  padding-inline-start: 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
}
.selbar b { font-weight: var(--w-600); }
.selbar .btn { height: var(--ctrl-h-sm); padding: 0 11px; font-size: var(--fs-label); }

/* ── 51-v6-lazy.css ─────────────────────────────── */

/* Long tables show the rows on screen first (59-v6-lazy.js).
   A waiting row costs no style, layout or paint; the spacer after the table
   holds its place so the scrollbar is the length of the whole table. */
table.tbl > tbody > tr.lz-wait { display: none !important; }
.lz-pad { display: block; pointer-events: none; }
@media print {
  .lz-pad { display: none !important; }
}

/* ── 60-intake.css ─────────────────────────────── */

/* ============================================================
   البداية — the landing screen, and the column mapper.

   There is no reference image for a landing screen, so this one is built
   out of the same parts as every other screen: the page ground, one big
   honest hero, and nothing invented. A centred 720px column on --paper;
   the mark and the wordmark; a headline at --fs-h1; the drop zone as a
   --r-xl card with a DASHED --line border and a --m-1 tinted chip at hero
   size; «تابِع من حيث توقّفت» above it as up to four mini cards on the same
   card system; the template line below; the dedication as a quiet credit.

   Everything here is assembled from 40-controls.css — .btn, .inp, .badge,
   .note, .skel and the .ichip recipe. Nothing shared is redefined; where
   this screen needs a variant it scopes one to its own container, which is
   why .mark is re-grounded under .intake-brand and nowhere else.

   Colour discipline: an extension square is not a measured quantity, so it
   stays --card-2 / --muted. The one measure hue on this screen is the drop
   zone's chip, which DESIGN.md §3 assigns --m-1 by name.
   ============================================================ */

/* ============================================================
   1. The centred column
   ============================================================ */

.intake {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--paper);
  padding: clamp(24px, 6vh, 60px) var(--gutter) 48px;
}
.intake-in {
  width: 100%;
  max-width: 720px;
  display: grid;
  gap: 22px;
  align-content: start;
}

/* ---------- the mark and the wordmark ----------
   The rail grounds its mark in --spine-accent because it sits on near-black.
   On the white bench the same square would read as a pastel sticker, so the
   landing takes the page's own primary value: black in light, near-white in
   dark, exactly like .btn-solid. Scoped to .intake-brand — the rail's mark
   is untouched. */
.intake-brand { display: flex; align-items: center; gap: 12px; }
/* the application mark on the rail's navy: the same object in both themes */
.intake-brand .mark { width: 44px; height: 44px; padding: 6px; border-radius: var(--r-lg); background: var(--spine); }
.intake-brand h1 {
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  line-height: var(--lh-title);
  font-weight: var(--w-title);
}
.intake-brand p { font-size: var(--fs-label); color: var(--muted); }

/* ---------- the headline ----------
   --fs-h1 here and --fs-h2 on the wordmark, deliberately: the biggest type
   on the screen states what the tool does, not what it is called. */
.intake-head { display: grid; gap: 8px; }
.intake-head h2 {
  font-family: var(--font-title);
  font-size: 26px;
  line-height: var(--lh-title);
  font-weight: var(--w-title);
}
.intake-head p {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--ink-2);
  max-width: 58ch;
}

/* ============================================================
   2. «تابِع من حيث توقّفت»

   A returning user's first move is almost never a new import — it is the
   file they were working on yesterday. Four mini cards on the card system:
   1px --line, --r-lg, no shadow. The strip disappears entirely when nothing
   is saved, so a first-time user meets the drop zone and nothing else.
   ============================================================ */

.il-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.il-head h2 { font-size: var(--fs-h3); }
.il-head .meta { font-size: var(--fs-label); color: var(--muted); }
/* pushed to the far edge: the strip is a shortcut, the full list is the escape */
.il-all { margin-inline-start: auto; font-size: var(--fs-label); }

.il-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 10px;
}
.il-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 5px;
  align-items: center;
  text-align: start;
  min-width: 0;
  padding: 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.il-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
}

/* The extension square, where the bookplate puts the same thing. It names a
   FILE, not a measure, so it stays quiet: no measure hue may leak here. */
.il-ext {
  grid-column: 1;
  grid-row: 1;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: var(--fs-micro);
  font-weight: var(--w-700);
  overflow: hidden;
}
.il-txt {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: grid;
  line-height: 1.35;
}
.il-name {
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.il-src,
.il-meta,
.il-when {
  font-size: var(--fs-micro);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* Block, not flex, and deliberately: these three lines truncate with an
   ellipsis, and text-overflow governs a block's own inline content — a flex
   container would simply overflow its items instead. */
.il-meta {
  grid-column: 1 / -1;
  color: var(--ink-2);
}
.il-when { grid-column: 1 / -1; }
.il-to { font-style: normal; color: var(--muted); margin-inline: 4px; }

/* ============================================================
   3. The drop zone — the hero of the screen

   --r-xl and dashed, per DESIGN.md §2: dashed says "put something here",
   and the one card on the page that is an invitation rather than a report
   is allowed the depth that goes with it.
   ============================================================ */

.drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding: 38px 26px 34px;
  border-radius: var(--r-xl);
  /* dashed says "put something here"; no shadow — it sits on the bench like
     any card, and --day-rule is the one rule dark enough to read dashed */
  border: 1.5px dashed var(--day-rule);
  background: var(--card);
  color: var(--ink-2);
  text-align: center;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.drop:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--card));
}
/* The dragged file is over the target: solid, not dashed — the border stops
   being an invitation and becomes a boundary. */
.drop.over {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop b {
  font-size: var(--fs-h3);
  color: var(--ink);
  line-height: var(--lh-tight);
  font-weight: var(--w-700);
}
.drop #dropHint {
  font-size: var(--fs-label);
  color: var(--muted);
  line-height: var(--lh-body);
  max-width: 52ch;
}
/* Latin-only, and next to Arabic: isolate it or the leading dot migrates. */
.drop .fmt {
  margin-top: 2px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  font-size: var(--fs-micro);
  color: var(--muted);
  direction: ltr;
  unicode-bidi: isolate;
}

/* The .ichip recipe at hero size — 48px instead of 32px, because on this
   screen the chip is the thing the eye lands on first. --m-1 by name from
   DESIGN.md §3; it is the only measure hue the landing screen spends. */
.drop-ico {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.drop-ico svg { width: 24px; height: 24px; }

/* ---------- parsing ----------
   Nothing at all for the first 350ms (the JS holds the fuse), then this. The
   skeleton is positioned OVER the hint, which keeps its space while hidden,
   so the zone does not change height the moment work starts. */
.drop.is-busy {
  cursor: progress;
  border-style: solid;
  border-color: var(--accent);
}
.drop.is-busy:hover { background: var(--card); }
.drop.is-busy #dropHint,
.drop.is-busy .fmt { visibility: hidden; }
.drop.is-busy .drop-ico { animation: intake-pulse 1.15s var(--ease) infinite; }
@keyframes intake-pulse { 50% { opacity: .42; } }

.drop-skel {
  position: absolute;
  inset-inline: 16%;
  inset-block-end: 28px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.drop-skel i { display: block; width: 100%; height: 9px; border-radius: var(--r-pill); }
.drop-skel i:nth-child(2) { width: 72%; }
.drop-skel i:nth-child(3) { width: 44%; }

/* ---------- the template line ---------- */
.intake-tmpl {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  font-size: var(--fs-body);
  color: var(--ink-2);
}
.intake-tmpl .hint {
  flex: 1 1 100%;
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: var(--lh-body);
}

/* ============================================================
   4. The column spec — what the detector actually looks for

   A card like any other: the landing screen has no second surface system.
   ============================================================ */

.intake-spec {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.intake-spec h3 { font-size: var(--fs-h3); }
.spec-lead {
  font-size: var(--fs-label);
  color: var(--muted);
  line-height: var(--lh-body);
  margin: 5px 0 14px;
}
.spec-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 11px 20px;
}
.spec-list li { display: grid; gap: 3px; min-width: 0; }
.spec-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
/* Arabic in a monospace face is a Latin habit with no meaning here: the
   "this is a literal column name" signal comes from the chip, not the font. */
.spec-list code {
  font-family: var(--font);
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 1px 8px;
}
.spec-list i {
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: var(--lh-body);
}

/* ---------- the dedication ----------
   Kept word for word, at the foot: a returning user should not scroll past
   it every session, and it is a credit, not a banner. */
.credit {
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
  text-align: center;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.credit .who { color: var(--ink-2); font-weight: var(--w-600); }
.credit .dua { margin-top: 2px; font-size: var(--fs-micro); }

/* ============================================================
   5. The column mapper — #scSetup
   ============================================================ */

#setupNote:empty { display: none; }
#setupNote { margin-bottom: var(--gutter); }

.setup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.setup-row .fld { min-width: 188px; }
.setup-p {
  font-size: var(--fs-label);
  color: var(--muted);
  line-height: var(--lh-body);
  margin-bottom: 14px;
}
#scSetup .panel + .panel { margin-top: var(--gutter); }

/* ---------- the preview ----------
   Not .tbl: this is the sheet as it really is, at whatever width it really
   has, so the column widths follow the data instead of a fixed layout. */
.prev-wrap {
  overflow: auto;
  max-height: 350px;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
table.prev {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
}
table.prev th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card-3);
  color: var(--muted);
  font-weight: var(--w-600);
  text-align: start;
  white-space: nowrap;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
}
table.prev td {
  padding: 5px 9px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}
table.prev th.is-mapped { color: var(--accent); }
table.prev td.is-mapped { background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--ink); }
.pv-f { color: var(--accent); }

table.prev tbody tr { cursor: pointer; }
table.prev tbody tr:hover td { background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
table.prev tr.is-hdr td {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: var(--w-600);
}

/* the row-number column stays put while the sheet scrolls sideways */
table.prev .rn {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--card-2);
  border-inline-end: 1px solid var(--grid);
  padding: 3px 6px;
}
table.prev th.rn { z-index: 3; background: var(--card-3); }
.rn-b {
  min-width: 26px;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: var(--fs-micro);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.rn-b:hover { background: var(--accent-soft); color: var(--accent); }
.rn-b[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: var(--w-600);
}

/* ---------- the ten fields ----------
   One ROW per field, not a grid of selects: the label says what is wanted,
   the select says which column answers it, and the samples say what that
   column actually holds. The third cell is the whole point — a mapping is
   only ever verified by reading the values it would read. */
.map-list {
  display: grid;
  border-top: 1px solid var(--line-soft);
}
.map-r {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(190px, 1.3fr) minmax(0, 2fr);
  align-items: center;
  gap: 10px 14px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.map-l {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink);
  min-width: 0;
}
.map-r .inp { height: 38px; font-size: var(--fs-label); }
/* An unmapped field is a gap in the form, not a value: dashed says "nothing
   here yet" without spending a colour on it. */
.map-r .inp.is-unset { color: var(--muted); border-style: dashed; }
/* Except when the engine cannot run without it — then it is not a gap, it
   is the thing standing between the user and their report. */
.map-r.is-missing .inp { border-color: var(--crit); }

.map-s {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
/* Three values out of the chosen column, verbatim. Bidi-isolated at the call
   site, because a fingerprint export holds names, numbers and both at once. */
.map-v {
  max-width: 100%;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  font-size: var(--fs-micro);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-none { font-size: var(--fs-micro); color: var(--muted); }
.map-none.is-need { color: var(--crit); }

/* ---------- the footer: the live count, and the one button that matters ---- */
.setup-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
}
.setup-stat {
  flex: 1 1 340px;
  display: grid;
  gap: 5px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.setup-stat.is-bad { color: var(--crit); }
.ss-head b { font-size: var(--fs-h3); color: var(--good); margin-inline-end: 3px; }
.ss-skip { font-size: var(--fs-micro); color: var(--warn); }
.ss-samples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
/* Three rows read with the current mapping, shown verbatim: the only proof
   that the columns are the right ones is a row that came out right. */
.ss-s {
  font-size: var(--fs-micro);
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setup-acts { display: flex; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }

@media (max-width: 860px) {
  .map-r {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .map-s { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .intake { padding-inline: 16px; }
  .intake-head h2 { font-size: var(--fs-h2); }
  .drop { padding: 30px 18px; }
  .map-r { grid-template-columns: minmax(0, 1fr); }
  .map-s { grid-column: auto; }
  .setup-acts { margin-inline-start: 0; width: 100%; }
  .setup-acts .btn { flex: 1; justify-content: center; }
}

/* ── 61-absence.css ─────────────────────────────── */

/* ============================================================
   الغياب — the absence sheet and the verdict on each day.

   Builds on .panel, .panel-head, .kpis, .tbl, .bar, .cell-name,
   .cell-bar, .row-x, .detail-in, table.days, .seg, .note, .badge and
   .btn. None of them is redefined here: what follows is only what an
   absence row needs that an overtime row does not — four verdict columns
   that add up to the first, and a day list whose every row carries a
   four-way control instead of a figure.

   «مهمة» borrows the m-3 violet the way «إجازة» borrows the m-4 teal: a
   verdict is not a measure of its own, and DESIGN §6 has no sixth system
   to give it. Violet and not teal, because on a signed sheet a mission
   and a leave are two different things, and the eye has to tell them
   apart down a column without reading the word.

   The sortable header is الإضافي's own component (.ot-sort, .ot-th-2,
   63-ot.css) and so is the share meter (.ot-share). They are reused by
   class rather than respelled, for the reason 63-ot.css gives about the
   summary band: a second spelling is a second thing to keep in step.

   Colour arrives only from a token, and only through the measure. The
   deduction is measure 8 everywhere in this design, so `data-m="8"` on
   the cell hands .bar and .avat their hue and nothing here names one.
   ============================================================ */

/* Eight columns and a floor — ten with payroll — because they do not
   compress usefully: past it .tw scrolls sideways rather than wrapping
   «غياب غير مبرّر» to three lines on a laptop. The floor is the sum of the
   sized columns plus the 260px the name may not go below — min-width on a
   <col> is not honoured under table-layout:fixed, so a floor set too low
   does not scroll, it silently takes the difference out of the name column
   instead. The «مهمة» column is the last 104px of each. */
.abs-t { min-width: 992px; }
.abs-t.has-pay { min-width: 1216px; }

.abs-t .abs-c-rk  { width: 68px; }    /* the rank and its expander, at three digits */
.abs-t .abs-c-emp { width: auto; min-width: 260px; }
.abs-t .abs-c-n   { width: 132px; }   /* a figure AND a bar */
.abs-t .abs-c-d   { width: 104px; }   /* the four verdict counts, and غياب محتسب */
.abs-t .abs-c-w   { width: 116px; }
.abs-t .abs-c-m   { width: 120px; }

/* Header labels wrap; cells do not. The shared thead rule sets nowrap +
   ellipsis, which on a right-aligned header clips from the START — and a
   header cut at the start has no ellipsis to say so, it simply reads as a
   different word. «غياب غير مبرّر» loses its غ that way.

   `.tbl.abs-t`, not `.abs-t`: the rule being overridden is
   `table.tbl thead th` at (0,1,3), and a plain `.abs-t thead th` is
   (0,1,2) — LOWER, so it would never apply however late this file is
   concatenated. Two classes on the table itself beat it honestly. */
.tbl.abs-t thead th {
  white-space: normal;
  vertical-align: bottom;
  line-height: var(--lh-cell);
}

/* ---------- the rows ---------- */
.abs-t td.abs-c-rk { white-space: nowrap; }
/* The name cell is two lines and the shared cell rule clips to one, so
   this column alone is allowed to be as tall as its content. */
.abs-t td.abs-c-emp { white-space: normal; overflow: visible; }
/* `table.tbl` and the child combinators on purpose: the shared row rule is
   (0,1,3), so a bare `.abs-t tbody td` loses to it and the row keeps 12px;
   and without `>` the rule would reach into the day table folded inside. */
table.tbl.abs-t > tbody > tr > td { padding-block: 5px; }
table.tbl.abs-t > tbody > tr.detail > td { padding: 0; }

.abs-t .nm-line .badge {
  flex: none;
  font-size: var(--fs-micro);
}
/* The اعتماد control rides on the SECOND line beside the source marker,
   because both name the RULE rather than the person. That line's own box
   is 12px × 1.62 ≈ 19.4px — the ceiling .tune-i was sized to — so a badge
   with its full padding-block would set the line's height itself and push
   every row past the 46px the design asks for. */
.abs-t .cell-dept .badge {
  flex: none;
  padding-block: 0;
  border-radius: var(--r-xs);
}
/* It is a button and not a label, so it has to look pressable and it has
   to keep a focus ring inside the cell — the row clips. */
.abs-apply { cursor: pointer; }
.abs-apply:hover { border-color: var(--gold-mark); color: var(--gold-ink); }
.abs-apply:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---------- the four verdict columns ----------
   They add up to «أيام لم يحضرها» by construction, and their colour is
   what lets a reader check that without adding: the leave and mission
   columns are the two that leave the deduction, the other two are the ones
   that stay in it. Ink only — a filled cell would make a count look like a
   warning. */
.abs-t td.abs-leave b, .abs-t td.abs-leave .num { color: var(--m-4-ink); }
.abs-t td.abs-msn .num { color: var(--m-3-ink); }
.abs-t td.abs-bad .num { color: var(--m-8-ink); }
/* Undecided, and the one count on the row that asks the reader to act. */
.abs-t td.abs-unset .num {
  color: var(--warn);
  font-weight: var(--w-600);
}

/* The star beside «غياب محتسب» when the engine's count is not the number
   of dates on the row. It carries a title, so it must not be the only
   carrier of the fact — the note under the band says it in words too. */
.abs-gap { color: var(--muted); }

/* The share meter is الإضافي's, and only its fill changes: this screen
   measures a deficit, so the bar is the deduction's hue and not the
   overtime's.

   TWO classes on the element itself, `.ot-share.abs-share`, and it is not a
   flourish: `.ot-share .fill` in 63-ot.css is (0,2,0) and so is
   `.abs-share .fill` — equal specificity, and 63 is concatenated AFTER 61,
   so the overtime green won and a 95% absence rate was drawn in the hue
   this design reserves for surplus. Raising it to (0,3,0) beats that
   honestly and does not depend on the file order, which the build derives
   from the filename and nothing here should have an opinion about. */
.ot-share.abs-share .fill { background: var(--m-8); }

/* ---------- the totals foot ----------
   The same ground as the sticky header, so the table is bracketed by its
   own chrome rather than trailing off into the page. */
.abs-t tfoot td {
  background: var(--card-3);
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  font-weight: var(--w-600);
  white-space: nowrap;
}
.abs-t tfoot td.abs-c-emp { color: var(--muted); }

/* ---------- the folded days ----------
   The one table in this app whose rows are not read but answered. The
   verdict column is sized for the control rather than for its heading,
   and the rows are a little taller than a day list's because a 30px
   control inside a 26px row is what makes a table feel cramped. */
.abs-days { min-width: 620px; }
.abs-days td { padding-block: 5px; }
.abs-days .abs-d-v { width: 320px; }

/* The fold's own cell wraps, the register's rule (64-register.css) for the
   register's reason. It inherits the shared cell's nowrap, so the sentences
   under the day table — the sum line with its gap sentence, the gold
   اعتماد line — never broke: the grid grew to the longest of them, 1,700px
   on a laptop, and the cell's overflow:hidden cut the day table's far end
   off, «أضف حضوره» with it. Exactly the moment the «مهمة» over an approved
   leave sends the clerk to this row. The nested cells keep their nowrap:
   50-tables.css sets it on them directly, not by inheritance. */
.abs-t tr.detail > td {
  white-space: normal;
  overflow: visible;
}
.abs-t .detail-in { overflow-x: auto; }

/* The note is the one cell of a day row that can run to a sentence — an
   hours mission that cannot apply says why, and carries the button that
   puts it right. The shared cell rule is one ellipsised line (50-tables.css
   reaches this nested table too), which would cut the reason off exactly
   where it starts to say something, so this cell alone wraps. */
.tbl .abs-days td.abs-d-n {
  white-space: normal;
  overflow: visible;
  line-height: var(--lh-cell);
}
.abs-days .abs-msn-full {
  margin-inline-start: 6px;
  vertical-align: middle;
}

/* The verdict itself. .seg is the shared segmented control; what it needs
   here is to be a little tighter than the settings panels' copy, because
   thirty of them may be on screen at once. */
.abs-seg { padding: 2px; }
.abs-seg button {
  padding: 3px 9px;
  font-size: var(--fs-micro);
  white-space: nowrap;
}
/* The pressed segment carries the verdict's own hue, so a day list can be
   read down the column without reading the words: teal and violet leave
   the deduction — a leave, a mission — and red stays in it. The unpressed
   state stays neutral — a control that colours every option colours
   nothing. */
.abs-seg button[data-abs-mark="leave"][aria-pressed="true"] {
  background: var(--m-4-soft);
  color: var(--m-4-ink);
}
.abs-seg button[data-abs-mark="mission"][aria-pressed="true"] {
  background: var(--m-3-soft);
  color: var(--m-3-ink);
}
.abs-seg button[data-abs-mark="absent"][aria-pressed="true"] {
  background: var(--m-8-soft);
  color: var(--m-8-ink);
}

/* A day still without a verdict is the row that wants the eye, so it is
   the row that is marked — not the thirty that are already settled.

   A positioned ::before and not `box-shadow: inset`, because box-shadow has
   no logical form: `inset 2px` is the LEFT edge in every direction, and in
   this RTL table the left edge of the first cell is its INNER one — the
   marker drew a line down the middle of the day list instead of down its
   start. inset-inline-start is the only spelling that mirrors. */
.abs-days tr.abs-d-row:not(.is-set) td:first-child { position: relative; }
.abs-days tr.abs-d-row:not(.is-set) td:first-child::before {
  content: "";
  position: absolute;
  inset-block: 3px;
  inset-inline-start: 0;
  width: 2px;
  border-radius: var(--r-pill);
  background: var(--warn);
}

/* The two sentences under the day table: what the counts come to, and
   what pressing اعتماد would write. Micro type, because they are read
   once and then never again. */
.abs-d-note {
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: var(--lh-cell);
}
.abs-d-apply {
  font-size: var(--fs-micro);
  color: var(--gold-ink);
  line-height: var(--lh-cell);
}
.abs-d-act { display: flex; flex-wrap: wrap; gap: 8px; }
/* The door to the missions dialog wears the mission's hue on its icon, the
   way «أضف حضوره» wears gold beside it: the word says where it goes, the
   colour says which verdict it belongs to. */
.abs-d-act .abs-msn-open svg { color: var(--m-3-ink); }

/* The double-relief warning (73-absence.js, absCarriedSay). toast()'s
   error form is the only one that stays on screen, and it is red; this
   one reports nothing that failed — a leave count now disagrees with the
   dates it was carried from — so it wears the gold that means exactly
   that everywhere else. Three classes, so it wins over `.toast.is-err`
   (70-drawer.css) whatever the file order. */
.toast.is-err.abs-carried {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold-mark) 40%, transparent);
}
.toast.abs-carried .toast-ico { color: var(--gold-mark); }
/* The name of the control it sends the clerk to, whole on one line. */
.toast.abs-carried b { white-space: nowrap; }

/* ---------- the holiday offer ----------
   Buttons inside a note, which nothing else in this app does — and they
   earn it: the note's whole content is «these dates look like a holiday»,
   and the act it invites is per date. */
.abs-hol {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-inline-start: 4px;
  vertical-align: middle;
}
.note .abs-hol .btn,
.note .btn { vertical-align: middle; }

/* ---------- print ----------
   The sheet is read on paper without the controls that made it: the
   verdict is a WORD there, not a segmented control, so the three unpressed
   segments are dropped and the pressed one is left standing as plain
   text. A printed row that showed four options would be unreadable as a
   record of what was decided. */
@media print {
  .abs-t { min-width: 0; }
  .abs-t .tune-i, .abs-d-act, .abs-hol, .abs-apply, .abs-msn-full { display: none; }
  /* 80-print.css drops every .seg from paper with !important, and this one
     went with them — the verdict column printed EMPTY on every signed sheet,
     «غير محدّد» included, since the ::after below hangs off the same span.
     Two classes and !important bring this segment back; the unpressed
     buttons inside it are still dropped by the next rules. */
  .abs-days .abs-seg { display: inline-flex !important; }
  .abs-seg { padding: 0; border: 0; background: none; }
  .abs-seg button[aria-pressed="false"] { display: none; }
  .abs-seg button[aria-pressed="true"] {
    box-shadow: none;
    padding: 0;
    background: none;
  }
  /* An undecided day prints «غير محدّد» in the warn colour, the one it wears
     on screen, so it reads as a day nobody decided rather than one nobody
     looked at. Its own segment IS pressed (its key is "", and so is the
     day's mark) but would print in a control's neutral ink — so that button
     is dropped and the ::after says it instead, once. */
  .abs-seg button[data-abs-mark=""] { display: none; }
  .abs-days tr.abs-d-row:not(.is-set) .abs-seg::after {
    content: "غير محدّد";
    font-size: var(--fs-micro);
    color: var(--warn);
  }
  .abs-days tr.abs-d-row:not(.is-set) td:first-child::before { display: none; }

  .abs-t .bar, .abs-t .bar i, .abs-share .track, .abs-share .fill,
  .abs-t .avat, .abs-t .badge, .abs-t tfoot td,
  .abs-seg button[aria-pressed="true"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* The name button is a control on screen and plain text on paper. */
  .abs-t .nm-btn { color: var(--ink); }
}

/* ── 62-overview.css ─────────────────────────────── */

/* ============================================================
   نظرة عامة — the instrument panel.

   Six cards and a closed disclosure, and the count is the binding part:
   DESIGN.md §3 fixes the grid at six areas and no seventh. Adding a card
   means replacing one.

     1 الخلاصة              ONE card, five figures, hairlines between them
     2 الحضور اليومي        the screen's only SVG, and its only line chart
     3 الساعات حسب الإدارة  ranked HTML bars — the donut is gone
     4 توزيع ساعات اليوم    an HTML histogram, v3's own card
     5 أعلى الموظفين        a table with progress bars
     6 جودة البيانات        a table with progress bars

   Why so little ink: the first build of this screen put fourteen bordered
   rectangles on the bench, each with a glyph and a sparkline, and the
   owner's verdict was «بدائي وغير منظم». DESIGN.md §2 now quotes
   Justinmind against it — five or six cards in the initial view, cut the
   decoration, big bold numbers, embrace white space — and this file is
   built to that. There are no sparklines here, no donut, and nothing
   animates on entrance except the one attendance line.

   Builds on .panel / .panel-head / .ichip / .tag / .delta / .bar / .avat /
   .note / .empty / .link from 40-controls.css and table.tbl from
   50-tables.css. Nothing here redefines a shared component — every variant
   is a modifier class.

   The one colour rule this file lives by: a MEASURE hue arrives only
   through var(--m), set by data-m on an ancestor. No value in this file
   names a colour itself.
   ============================================================ */

.ov {
  display: grid;
  gap: 16px;
  align-content: start;
}

/* ---------- small shared bits ---------- */

/* ٪ is a glyph of the figure, not a unit riding beside it, so it does not
   take .cur: .82em would put it at 9.8px inside a caption, under the 12px
   floor Arabic chrome may not go below. It hugs its number instead. */
.ov-pct {
  font-size: 1em;
  unicode-bidi: isolate;
}
.ov-note { align-items: flex-start; }
/* the ← between the two dates in the page head's meta line */
.ov-ar { color: var(--muted); }

/* One quiet link per card, to the screen that acts on that card's answer —
   DESIGN.md §3 gives one each to الإدارات, الموظفون and فحص الملف. It sits
   at the far end of the card's head, after the meta string. */
.ov-more {
  margin-inline-start: auto;
  flex: none;
  font-size: var(--fs-label);
}
.ov-foot {
  padding: 0 18px 16px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}

/* ============================================================
   1. الخلاصة — one card, one row of figures

   Five bordered rectangles in a row are five things to look at. This is
   one thing — the size of the month — so it is one card, divided by
   hairlines and nothing else. Each cell is a label above, a figure, and a
   note below. There is no tinted chip: the glyph beside the label is a
   small monochrome mark (40-controls, .ichip), and the FIGURE carries the
   weight.

   The rows (.kpi-row, and .kpi-row.is-pay for the payroll figures) are
   dissolved with display:contents, so every cell of the card sits on ONE
   grid. That is what lets a four-figure band take its one payroll figure
   onto the same line (الإضافي, الغياب) instead of giving a lone number a
   110px row of its own — while a five-figure band (نظرة عامة) still starts
   its payroll figures on a new line, under the first three.

   Every breakpoint on this screen is quoted in VIEWPORT width but sized
   for the BENCH, which is ~270px narrower: the rail plus the page gutter.
   ============================================================ */
.kpis {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  /* the cells draw their own start and top hairlines and overhang the card
     by 1px on those two sides; this cuts the overhang off, so no cell ever
     needs to know whether it is first in its row */
  overflow: hidden;
}
/* The band the «مُصفّى» tag sits in. Reserving it on the CARD rather than
   on a cell is what keeps the tag off the last cell's wrapped label at
   every column count — the rows shift down together and their baselines
   stay aligned. */
.kpis.is-filtered { padding-block-start: 30px; }
.kpi-flag {
  position: absolute;
  top: 8px;
  inset-inline-start: 14px;
}

.kpi-row { display: contents; }
/* A full first row (five figures) sends the payroll figures to a line of
   their own at every column count, so money never starts mid-row beside a
   count. A four-figure band leaves a free cell, and the money takes it. */
.kpi-row:has(> .kpi:nth-child(5)) + .kpi-row.is-pay > .kpi:first-child { grid-column-start: 1; }

.kpi {
  padding: 13px 16px 14px;
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
  margin-block-start: -1px;
  margin-inline-start: -1px;
  border-block-start: 1px solid var(--line-soft);
  border-inline-start: 1px solid var(--line-soft);
}

.kpi-h {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.kpi-l {
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  font-weight: var(--w-500);
  color: var(--muted);
}
/* The figure is the hierarchy: nothing else on the screen is this size or
   this weight, and it is --ink in every cell — a coloured figure would make
   the palette mean two things at once. Tabular, so a band of five figures
   reads as a ledger line rather than as five headlines. */
.kpi-v {
  font-size: var(--fs-num-xl);
  line-height: var(--lh-tight);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The unit rides at about half the figure: .82em of the figure would read
   as a second number standing beside the first. */
.kpi-v .cur { font-size: .48em; font-weight: var(--w-400); }
/* A money figure is two digits longer than a count and carries a currency
   besides, so it drops one step rather than ellipsising. */
.kpi.is-money .kpi-v { font-size: var(--fs-num-lg); line-height: 1.75; }
.kpi.is-money .kpi-v .cur { font-size: .62em; }

.kpi-s {
  min-width: 0;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.kpi-s .cur { margin-inline-start: 0; }

/* ---------- the change indicator, by goodness ----------
   .delta in 40-controls.css colours ▲ green and ▼ red, which is right for
   hours and wrong for «أيام بلا ساعات محسوبة» — a rise there is a fall in
   data quality. The arrow keeps naming the DIRECTION; these two name the
   MEANING, and a cell that needs the inversion asks for it by name. */
.delta.ov-ok { color: var(--good); }
.delta.ov-bad { color: var(--crit); }

@media (min-width: 680px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 1280px of viewport is ~1010px of bench, which splits five ways at 202px —
   the first width at which the figure and a two-line note both hold without
   the figure ellipsising. */
@media (min-width: 1280px) {
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.ov-empty .empty { padding: 34px 20px; }

/* ============================================================
   2. The layout

   Row 1: الخلاصة, full bench.
   Row 2: الحضور اليومي beside الساعات حسب الإدارة — the line chart gets
          the widest card, because it is the only thing here with a
          horizontal axis to spend width on.
   Row 3: توزيع ساعات اليوم · أعلى الموظفين · جودة البيانات.
   Under them: the processing log, as a disclosure rather than a card.
   ============================================================ */
.ov-grid,
.ov-grid3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.ov-grid > *,
.ov-grid3 > * { min-width: 0; }

.ov-hero { margin-bottom: 0; }   /* .ov's own gap spaces it; v5 added a second 16px here */

/* Cards are paired by HEIGHT as well as by subject — see the comment in
   renderOverview(). The two ranked lists are both eight rows, so they take
   equal columns; the histogram wants the width and the quality card does
   not, so they split 1.6/1. 1080px of viewport is the first width at which a
   department name still clears three words beside its figure. */
@media (min-width: 1080px) {
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid3 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

/* align-items: start above, not the default stretch. These cards hold
   unrelated amounts of content — thirteen histogram columns, twelve
   employees and up to four quality lines — and stretching them to the
   tallest leaves two with a hand's width of empty white under their last
   row, which reads as data that failed to load. */
.ov-cp,
.ov-wide { min-width: 0; }
.ov-cp .panel-head .inp { flex: none; }

/* ============================================================
   3. الحضور اليومي — the one line chart

   The SVG is a 0 0 100 100 box stretched with preserveAspectRatio="none",
   so every coordinate in 74-overview.js is a percentage and the chart is
   responsive without arithmetic. Two rules make that safe:

     · the stroke carries vector-effect: non-scaling-stroke, or the
       stretch draws a 2px line as a smear horizontally and a hairline
       vertically;
     · nothing that must keep its shape lives inside the SVG. The
       gridlines, the dashed reference, every label and the hover dot are
       HTML positioned over the box — a <circle> in a stretched viewBox is
       an ellipse and a <text> is a caricature of itself.

   Inside the plot, left/top are PHYSICAL: an SVG viewBox is always
   left-to-right, so the overlays share its coordinate system rather than
   the page's, and the value axis sits on the left.
   ============================================================ */
/* The plot carries `ov-chart` as well as `ov-plot`, and the extra class is
   not decoration: 80-print.css — which this file may not edit — hangs
   `break-inside: avoid` and the paper sizing off `.ov-chart`. Dropping it
   would let a chart be torn across the fold. */
.ov-chart { min-width: 0; }

.ov-plot {
  direction: ltr;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: 236px 26px;
  padding: 14px 18px 10px;
}
.ov-yax {
  grid-column: 1;
  grid-row: 1;
  position: relative;
}
.ov-box {
  grid-column: 2;
  grid-row: 1;
  position: relative;
}
.ov-xax {
  grid-column: 2;
  grid-row: 2;
  position: relative;
}

/* Every label sits at the 12px floor. They are HTML, so a user unit is not
   involved at all and the type cannot be scaled soft by the viewBox. */
.ov-tick,
.ov-xl,
.ov-ref-l {
  position: absolute;
  font-size: var(--fs-micro);
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
.ov-tick {
  right: 10px;
  transform: translateY(-50%);
}
.ov-xl {
  top: 8px;
  transform: translateX(-50%);
}
/* The first and last labels hang off their own end of the axis otherwise;
   they anchor to the edge instead of to their own centre. */
.ov-xl.is-s { transform: none; }
.ov-xl.is-e { transform: translateX(-100%); }

.ov-gl {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid var(--grid);
}

.ov-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ov-area {
  fill: var(--m, var(--accent));
  fill-opacity: .13;
  stroke: none;
}
/* non-scaling-stroke is not cosmetic here: without it the 2 in stroke-width
   is 2 user units of a box stretched to ~580 × 236, which is a 23px band
   across and a 5px one down. */
.ov-line {
  fill: none;
  stroke: var(--m, var(--accent));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* The headcount the period expects. Dashed and in the accent because it is
   a structural reference, not a measured series — DESIGN.md §6 reserves the
   accent for "expected". It is an HTML rule, so the dash pattern is not
   stretched with the box. */
.ov-ref {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1.5px dashed var(--accent);
  pointer-events: none;
}
.ov-ref-l {
  left: 2px;
  transform: translateY(-100%);
  padding-bottom: 4px;
  color: var(--accent);
}

/* The marker the hit strip lights. An HTML circle, because a <circle> in a
   stretched viewBox is an ellipse. .ov-bar is the class ovBindTips reaches
   for, kept across the rebuild so the tooltip wiring is unchanged. */
.ov-bar {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 2px solid var(--m, var(--accent));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease);
}
.ov-bar.is-hot { opacity: 1; }
/* The hit strip covers the whole column so the tooltip is reachable from
   anywhere above the day, not only from the point. */
.ov-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  cursor: default;
}

/* ---------- the one orchestrated moment ----------
   DESIGN.md §7: the first time a file's نظرة عامة paints, the attendance
   line draws itself and the area fades in behind it. Once per file — a
   recompute must never set the chart redrawing under the user's hand while
   they are dragging a date.

   v5 drew the line with stroke-dasharray: 100 over pathLength="100". That
   cannot be used here: the line carries vector-effect: non-scaling-stroke
   (it must — see .ov-line), and the Chromium this program ships measures the
   dashes of such a stroke in SCREEN pixels and ignores pathLength. The line
   then came in as 100px dashes and STAYED dashed once the animation had
   ended. So the drawing is a wipe instead: the plot is uncovered from the
   first day to the last, which takes the same time whatever the month's
   length, and leaves nothing behind it — the clip exists only while the
   animation runs (no `forwards`), and the insets are negative so a stroke
   that rides the top edge is never shaved. */
@keyframes ov-draw {
  from { clip-path: inset(-8px 100% -8px -8px); }
  to   { clip-path: inset(-8px -8px -8px -8px); }
}
@keyframes ov-fade { from { opacity: 0; } to { opacity: 1; } }
.ov-plot.ov-draw .ov-svg {
  animation: ov-draw 620ms var(--ease);
}
.ov-plot.ov-draw .ov-area {
  animation: ov-fade 620ms var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .ov-plot.ov-draw .ov-svg,
  .ov-plot.ov-draw .ov-area { animation: none; }
}

/* ============================================================
   4. الساعات حسب الإدارة — ranked bars

   The reference has a donut here and DESIGN.md §3 removes it: a ranked bar
   says «النقل is the biggest, and by this much» in one pass, while a ring
   makes you compare angles and shrinks Arabic labels to fit around a
   circle.

   The fill is measure 3's hue, inherited through --m from data-m on the
   list: what these bars measure is إجمالي الساعات. The category ramp is
   for slices that are NAMES, and it has no consumer on this screen.
   ============================================================ */
.ov-rank {
  display: grid;
  gap: 13px;
  padding: 16px 18px 18px;
}
.ov-rank-r {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.ov-rank-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
}
.ov-rank-n {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.ov-rank-v {
  flex: none;
  color: var(--ink);
  font-weight: var(--w-600);
}
.ov-rank-p {
  flex: none;
  min-width: 48px;
  text-align: end;
  color: var(--muted);
}
.ov-rank .bar { height: 8px; }

/* ============================================================
   5. توزيع ساعات اليوم — the histogram

   Plain HTML: one column per hour, real widths at real sizes. A total says
   how much was worked and cannot say whether that came from everyone doing
   eight hours or from half the staff doing twelve and half doing four.

   gap is 0 and the air comes from each column's own inline padding, so the
   dashed target marker — placed at a percentage of the whole strip — lands
   where it says it does instead of drifting by the accumulated gap.
   ============================================================ */
/* The bar area's height, declared ONCE. The markers and the count gridlines
   are positioned through it from 74-overview.js, so neither the JS nor the
   marker rules need to know the number. */
.ovh { padding: 44px 18px 14px; --ovh-h: 150px; }
.ovh-cols {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
}
.ovh-col {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding-inline: 3px;
  min-width: 0;
}
.ovh-b {
  width: 100%;
  height: var(--ovh-h);
  display: flex;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}
.ovh-b i {
  display: block;
  width: 100%;
  background: var(--m, var(--accent));
  border-radius: 3px 3px 0 0;
}
.ovh-col:hover .ovh-b i { opacity: .82; }
.ovh-l {
  font-size: var(--fs-micro);
  line-height: 1;
  color: var(--muted);
  min-height: 12px;
}
/* Two markers: where the middle day is, and where the policy wants it.
   Dashed, like the chart's reference line, and for the same reason — they
   are what the data is measured AGAINST, not something measured.
   inset-inline-start does the RTL arithmetic for free: the columns run the
   low end at the reading edge, so a fraction of the strip from the inline
   start is that fraction of the axis. */
.ovh-mk {
  position: absolute;
  top: 0;
  height: var(--ovh-h);
  width: 0;
  border-inline-start: 1.5px dashed var(--ink-2);
  z-index: 2;
}
.ovh-mk b {
  position: absolute;
  top: -20px;
  inset-inline-start: 5px;
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  color: var(--ink-2);
  white-space: nowrap;
}
.ovh-mk.is-target { border-inline-start-color: var(--accent); }
/* Both labels sit ABOVE the bars — below would land them in the hour axis —
   and they are staggered by a line, because on a healthy file the median IS
   near the target and the two would otherwise print on top of each other. */
.ovh-mk.is-median b { top: -34px; }
.ovh-mk.is-target b { color: var(--accent); top: -18px; }

/* The count axis, so a column's height is a number and not a mood. */
.ovh-gl {
  position: absolute;
  inset-inline: 0;
  height: 0;
  border-top: 1px solid var(--grid);
  pointer-events: none;
}
.ovh-gl b {
  position: absolute;
  top: -8px;
  /* At the reading edge, which is the LOW end of the axis. The other end is
     where the median and the target land on any normal file, and the count
     printed itself on top of «المستهدف ٨:٠٠» there. */
  inset-inline-start: 0;
  padding-inline: 5px;
  background: var(--card);
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   6. The two tables

   table-layout is fixed in 50-tables.css, so the columns are declared once
   here rather than guessed per row. The figures take exactly what their
   widest value and their own header need; the first column takes the rest
   and ellipsises — which is the only behaviour that survives a department
   called «إدارة النقل والمواصلات البرية».
   ============================================================ */
.ov-tbl { min-width: 0; }
.ov-tbl col.c-h { width: 70px; }
/* 84px was too narrow to do its job. The top eight are all within 13% of the
   leader, so at 84px every bar was the same eleven-pixel stub and the column
   implied a difference it could not show. At 168px that same 13% is twenty
   pixels — which is the difference actually being reported. */
.ov-tbl col.c-b { width: 168px; }
.ov-tbl col.c-p { width: 76px; }
.ov-tbl col.c-n { width: 72px; }
.ov-tbl tbody td { padding-block: 7px; }
.ov-tbl .cell-name .nm { font-size: var(--fs-cell); }
.ov-tbl .bar { min-width: 0; }
/* جودة البيانات leads with the total and then breaks it down, so the first
   row carries the weight and the «منها» lines sit under it. */
.ov-tbl tbody tr.is-lead td {
  color: var(--ink);
  font-weight: var(--w-600);
}

/* ============================================================
   7. سجلّ المعالجة — a disclosure, not a card

   It is a record of how the file was read, not a figure anyone signs, so
   it sits under the six cards with no card ground of its own and opens
   only when asked.
   ============================================================ */
.ov-log {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ov-log[open] { background: var(--card); }
.ov-log > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  transition: background var(--t-fast) var(--ease);
}
.ov-log > summary::-webkit-details-marker { display: none; }
.ov-log > summary:hover { background: var(--card-2); }
.ov-log-c {
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
  color: var(--muted);
}
.ov-log-chev {
  width: 15px;
  height: 15px;
  margin-inline-start: auto;
  color: var(--muted);
  transition: transform var(--t) var(--ease);
}
.ov-log[open] .ov-log-chev { transform: rotate(180deg); }

.ov-log-body {
  display: grid;
  gap: 8px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--line-soft);
}
.ov-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--ink-2);
}
/* The figures form a column, so they take a fixed gutter and sit on their
   trailing edge — a ragged one reads as noise beside twelve sentences. */
.ov-log-n {
  flex: none;
  min-width: 50px;
  text-align: end;
  color: var(--ink);
  font-weight: var(--w-600);
}
.ov-log-s { flex: 1; min-width: 0; }

/* ============================================================
   8. The drawer takes 384px of bench with it

   Below 1560px the تخصيص drawer is an overlay and the page keeps its
   width, so nothing here applies. At and above it, 70-drawer.css pushes
   .main by --drawer-w — and a media query cannot see that, because it
   measures the viewport and the drawer is spending the bench. Without
   these the department names ellipsise to three letters and the histogram
   loses its labels, both only while a rule is open, which is the hardest
   kind of layout bug to catch.

   1624 = 1240 + 384. 1904 = 1520 + 384. 1704 = 1320 + 384.
   ============================================================ */
@media (min-width: 1560px) and (max-width: 1623px) {
  body.drawer-open .ov-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1560px) and (max-width: 1703px) {
  body.drawer-open .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1560px) and (max-width: 1903px) {
  body.drawer-open .ov-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   9. Print

   80-print.css forces .kpis to a four-column grid, because on paper the
   summary is the report's headline and it keeps its tiles. `display:
   contents` on the rows hands it the cells directly, which is what makes
   that rule mean what it says. The «مُصفّى» tag is absolutely positioned,
   so it is out of that flow and cannot eat a tile.
   ============================================================ */
@media print {
  .ov { gap: 8pt; }
  .kpi-row { display: contents; }
  /* on paper each figure is a whole bordered tile (80-print.css), so the
     screen's hairline overhang and the clip that trims it both go */
  .kpis { overflow: visible; }
  .kpi { margin: 0; }
  .kpi-row:has(> .kpi:nth-child(5)) + .kpi-row.is-pay > .kpi:first-child { grid-column-start: auto; }
  .kpis.is-filtered { padding-block-start: 16pt; }
  .kpi-flag { top: 2pt; }
  .ov-grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt; }
  .ov-plot {
    grid-template-columns: 34pt minmax(0, 1fr);
    grid-template-rows: 130pt 16pt;
    padding: 4pt 6pt 2pt;
    break-inside: avoid;
  }
  .ovh-b, .ovh-tgt { height: 80pt; }
  /* The draw is an entrance animation; on paper there is no entrance, and a
     plot caught at the start of its wipe would print as nothing at all. */
  .ov-plot.ov-draw .ov-svg { animation: none; clip-path: none; }
  .ov-plot.ov-draw .ov-area { animation: none; opacity: 1; }
  /* A fill the printer drops is a blank chart. */
  .ov-area, .ov-line, .ovh-b i, .ov-rank .bar i, .ichip, .avat, .bar, .bar i, .tag {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ov-cp, .ov-note, .ov-rank-r, .ovh { break-inside: avoid; }
  /* v1 kept the processing log off the printed report: it is a record of how
     the file was read, not a figure anyone signs. */
  .ov-log { display: none; }
}

/* ── 63-ot.css ─────────────────────────────── */

/* ============================================================
   الإضافي — the overtime table.

   Builds on .panel, .panel-head, .kpis, .tbl, .bar, .cell-name, .cell-bar,
   .row-x, .detail-in, table.days, .note, .badge and .btn. None of them is
   redefined here: what follows is only what an overtime row needs that a
   register row does not — a narrower set of columns, a share meter, and a
   day list whose every row is an إضافي day.

   The summary band is the same component the نظرة عامة draws (.kpis /
   .kpi, 62-overview.css) and the ٪ glyph is the same .ov-pct. Both are
   figure primitives rather than that screen's property, and a second
   spelling of either would be a second thing to keep in step.

   Colour arrives only from a token, and only through the measure: الإضافي
   is measure 7 everywhere in this design, so `data-m="7"` on the cell
   hands .bar and .avat their hue and nothing here names one.
   ============================================================ */

/* Nine columns and a floor, because they do not compress usefully: past
   it .tw scrolls sideways rather than wrapping «متوسط اليوم الإضافي» to
   three lines on a laptop. The floor is the sum of the sized columns plus
   the 260px the name may not go below — a floor smaller than the sized
   columns would hand the name nothing.

   +96px on both, for the second .ot-c-d — «أيام زائدة». This figure is
   arithmetic and not a declaration: min-width on a <col> is not honoured
   under table-layout:fixed, so a floor left at eight columns does not
   scroll, it takes the 96px out of the name column instead, silently. */
.ot-t { min-width: 1142px; }
.ot-t.has-pay { min-width: 1262px; }

.ot-t .ot-c-rk  { width: 68px; }    /* the rank and its expander, at three digits */
.ot-t .ot-c-emp { width: auto; min-width: 260px; }
.ot-t .ot-c-req { width: 108px; }
.ot-t .ot-c-d   { width: 96px; }    /* both day columns: hours-days and extra days */
.ot-t .ot-c-h   { width: 140px; }   /* a figure AND a bar, inside .grp's 20px opening */
.ot-t .ot-c-w   { width: 116px; }
.ot-t .ot-c-m   { width: 120px; }

/* Header labels wrap; cells do not. The shared thead rule sets nowrap +
   ellipsis, which on a right-aligned header clips from the START — and a
   header cut at the start has no ellipsis to say that it happened: it just
   reads as a different word. «متوسط اليوم الإضافي» lost its م this way.

   `.tbl.ot-t`, not `.ot-t`: the rule being overridden is
   `table.tbl thead th` at (0,1,3), and a plain `.ot-t thead th` is (0,1,2) —
   LOWER, so it never applies however late the file is concatenated. Two
   classes on the table itself beat it honestly. The same trap is why a
   header must be checked in the browser rather than in the source. */
.tbl.ot-t thead th {
  white-space: normal;
  vertical-align: bottom;
  line-height: var(--lh-cell);
}

/* ---------- sortable headers ----------
   A real <button> inside the th, not a handler on the th: a sort control
   that Tab cannot reach is one half the staff cannot use. The focus ring is
   drawn inside the button, because the th keeps the shared overflow:hidden
   and thead is sticky with a z-index — a ring 2px outside would be clipped
   by the cell it belongs to and painted over by the header next to it. */
.ot-sort {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;      /* the header's own weight: a sortable header is
                                a header first */
  text-align: start;
}
.ot-sort:focus-visible { outline-offset: -2px; }
.ot-sort:hover { color: var(--ink); }
.ot-t thead th.n .ot-sort { justify-content: flex-end; }

/* The name header answers to two orders — the person and their إدارة — so
   it carries two buttons stacked the way the cell below stacks its two
   lines. aria-sort stays on the th and names whichever is in force: there
   is only ever one order, so there is only ever one arrow. */
.ot-th-2 { display: block; width: 100%; }
.ot-th-2 .ot-sort { padding-block: 8px 0; }
.ot-th-2 .ot-sort-sub {
  padding-block: 0 8px;
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
}

/* ---------- the rows ---------- */
.ot-t td.ot-c-rk { white-space: nowrap; }
/* The name cell is two lines and the shared cell rule clips to one, so this
   column alone is allowed to be as tall as its content. */
.ot-t td.ot-c-emp { white-space: normal; overflow: visible; }
/* see 61-absence.css: the selector has to outrank the shared row rule */
table.tbl.ot-t > tbody > tr > td { padding-block: 5px; }
table.tbl.ot-t > tbody > tr.detail > td { padding: 0; }

/* The badges beside a name say the rule did something to the figure —
   «بلغ السقف الشهري». They sit on the name's own line, so they may not set
   its height. */
.ot-t .nm-line .badge {
  flex: none;
  font-size: var(--fs-micro);
}

/* The kind badge — «ساعات فقط» / «أيام فقط» / «لا إضافي» — rides on the
   SECOND line, beside the source marker, because both name the rule rather
   than the person. That line's own box is 12px × 1.62 ≈ 19.4px, which is
   the same ceiling .tune-i was sized to (19px): a badge with its full
   padding-block would set the line's height itself and push every row past
   the 46px the design asks for. */
.ot-t .cell-dept .badge {
  flex: none;
  padding-block: 0;
  border-radius: var(--r-xs);
}

/* ---------- habit or exception ----------
   The share of this person's counted days that carried إضافي. A meter and
   not a bare percentage: the column is read by scanning, and ٦٨٪ and ٦٪
   look alike at 12.5px in a hurry. The fill is the measure's hue, taken
   from the row's own data-m rather than named here. */
.ot-share {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: 100%;
}
.ot-share .track {
  flex: 1 1 auto;
  max-width: 44px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--card-3);
  overflow: hidden;
}
.ot-share .fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--m-7);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

/* ---------- the totals foot ----------
   The same ground as the sticky header, so the table is bracketed by its
   own chrome rather than trailing off into the page. */
.ot-t tfoot td {
  background: var(--card-3);
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  font-weight: var(--w-600);
  white-space: nowrap;
}
.ot-t tfoot td.ot-c-emp { color: var(--muted); }

/* ---------- the folded days ----------
   Every row here is an إضافي day, so the figure that matters is the last
   column of the pair: what the day held, and what was credited for it. */
.ot-days { min-width: 720px; }
.ot-plus {
  color: var(--m-7-ink);
  font-weight: var(--w-600);
}
/* The monthly cap is applied to the SUM and never pushed back into the
   days, so this line is what keeps the day list adding up to the row above
   it. It is a sentence, not a footnote: it explains a difference the
   reader would otherwise have to discover by adding the column up. */
.ot-d-note {
  font-size: var(--fs-micro);
  color: var(--warn);
  line-height: var(--lh-cell);
}
/* The extra DAYS in a sentence, because they have no rows: an extra day is
   a count — attended minus required — and an authorised leave day raises it
   as readily as a worked one, so there is no date to put in the table above.
   Muted and not --warn like the cap line: nothing went wrong here, this is
   simply what the rule pays for them. */
.ot-d-extra {
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: var(--lh-cell);
}
.ot-d-act { display: flex; }

/* ---------- the empty state ---------- */
.ot-empty-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* ---------- print ----------
   The report is read on paper without the controls that made it, and every
   bar is a figure rather than a decoration — so it has to survive the
   browser's background-dropping. */
@media print {
  .ot-t { min-width: 0; }
  .ot-t .tune-i, .ot-d-act { display: none; }
  .ot-t .bar, .ot-t .bar i, .ot-share .track, .ot-share .fill,
  .ot-t .avat, .ot-t .badge, .ot-t tfoot td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* The name button is a control on screen and plain text on paper. */
  .ot-t .nm-btn { color: var(--ink); }
}

/* ── 63-v6-ded.css ─────────────────────────────── */

/* ============================================================
   الخصومات — who had money deducted, and why (75-v6-ded.js).

   Builds on the overtime table (63-ot.css: .ot-t, .ot-sort, .ot-th-2) and on
   .panel, .kpis, .tbl, .bar, .cell-name, .row-x, .detail-in, table.days,
   .seg / .abs-seg (61-absence.css) and .btn. Only what a deduction row needs
   that an overtime row does not is written here: two-line money cells, the
   «للتحقق» chips, and the day lists of the fold.

   The deduction is measure 8 everywhere in this design: `data-m="8"` hands
   .bar and .avat their hue, and nothing here names one.
   ============================================================ */

.dd-t { min-width: 1120px; }
.dd-t .dd-c-rk  { width: 60px; }
.dd-t .dd-c-emp { width: auto; min-width: 220px; }
.dd-t .dd-c-m   { width: 128px; }
.dd-t .dd-c-t   { width: 146px; }
.dd-t .dd-c-p   { width: 70px; }
.dd-t .dd-c-f   { width: 196px; }

.dd-t td.dd-c-f { white-space: normal; overflow: visible; }

/* a figure, and under it what it counts */
.dd-two { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.dd-two b { font-weight: var(--w-600); }
.dd-two i { font-style: normal; font-size: var(--fs-micro); color: var(--muted); }
.dd-cap { color: var(--good); }
.dd-t td.dd-c-p.is-hi { color: var(--crit); font-weight: var(--w-600); }

/* a row with a reason to look twice: a hairline of the warn colour at its start */
.dd-t tr.dd-row.is-check > td:first-child { box-shadow: inset -3px 0 0 var(--warn); }

/* ---------- the reasons ---------- */
.dd-flags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.dd-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  white-space: nowrap;
  background: var(--card-2);
  color: var(--muted);
}
.dd-flag.is-crit { background: var(--crit-soft); color: var(--crit); }
.dd-flag.is-warn { background: var(--warn-soft); color: var(--warn); }
.dd-flag.is-info { background: var(--card-2); color: var(--ink-2, var(--muted)); }
.dd-ok { font-size: var(--fs-micro); color: var(--good); }

/* ---------- the views ---------- */
.dd-views { margin-inline-start: 12px; }
.dd-views button bdi { opacity: .7; }
.dd-panel .panel-head { flex-wrap: wrap; gap: 6px 10px; }

/* ---------- the fold ---------- */
.dd-in h4 { margin-bottom: 4px; }
.dd-h {
  margin: 14px 0 6px;
  font-size: var(--fs-small, 13px);
  font-weight: var(--w-600);
  color: var(--ink);
}
.dd-days { min-width: 720px; }
.dd-days tr.is-relieved td { color: var(--muted); }
.dd-days .dd-d-v { white-space: nowrap; }
.dd-days .dd-d-note { white-space: normal; }
.dd-n {
  display: inline-block;
  margin-inline-end: 4px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  font-size: var(--fs-micro);
  background: var(--card-2);
  color: var(--muted);
}
.dd-n.is-crit { background: var(--crit-soft); color: var(--crit); }
.dd-n.is-warn { background: var(--warn-soft); color: var(--warn); }
.dd-n.is-ok   { background: var(--good-soft); color: var(--good); }
.dd-minus { color: var(--m-8-ink); font-weight: var(--w-600); }

.dd-sum, .dd-rec {
  margin: 4px 0;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.dd-rec { color: var(--muted); }
.dd-why {
  margin: 8px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.dd-why li {
  padding: 5px 9px;
  border-radius: var(--r-sm);
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  background: var(--card-2);
}
.dd-why li.is-crit { background: var(--crit-soft); color: var(--crit); }
.dd-why li.is-warn { background: var(--warn-soft); color: var(--warn); }
.dd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- print ---------- */
@media print {
  .dd-views, .dd-acts, .dd-t .row-x { display: none !important; }
  .dd-days .abs-seg button:not([aria-pressed="true"]) { display: none !important; }
  .dd-flag, .dd-n, .dd-why li {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ── 64-register.css ─────────────────────────────── */

/* ============================================================
   The register — الموظفون

   Builds on .panel / .tbl / .btn / .badge from 40-controls.css and
   50-tables.css. Nothing shared is redefined here: everything below is
   either a modifier on .tbl (.reg) or a class this screen alone owns.

   Colour arrives only from a token. There is no hex in this file, and
   nothing gold: gold means "customised away from the layer above", and the
   only gold on this screen is the .tune-i mark and the .gold-dot beside a
   name — both of which say exactly that.

   Violet — the m-3 family — marks a mission (49-mission.js) on the day
   lists, the one hue «مهمة» wears on every screen, borrowed the way الغياب
   borrows m-4 teal for «إجازة»: DESIGN §6 allows no sixth system, and these
   pairs are the measure chip's own, which test/contrast.py already holds.
   The bar in «إجمالي الساعات» wears the same hue; the two never meet — one
   is a fill in a figure column, the other a worded chip in a day's row.
   ============================================================ */

/* ---------- the table ----------
   A floor width, because these columns do not compress usefully: past it the
   .tw scrolls sideways. The floor covers the FIGURES; the headers are allowed
   to wrap to two lines instead of setting the floor themselves, because
   «متوسط المغادرة» on one line would cost 120px for a column whose content is
   five characters wide, and fifteen such columns push the table past 2000px. */
.reg { min-width: 1004px; }
/* 1328px is what a 1600px window leaves the bench with the rail open — so the
   whole payroll register, net pay included, is on screen without a sideways
   scroll at the width the app is designed at. The sum of the columns below
   is held to it. */
.reg.has-pay { min-width: 1328px; }

/* Header labels wrap; cells do not.
   The shared thead rule sets nowrap + ellipsis, which on a right-aligned flex
   header clips from the START — «إجمالي الساعات» rendered as «نالي الساعات»,
   a truncation with no ellipsis to say it had happened. Two lines, aligned to
   the bottom so the row sits on one baseline. */
table.tbl.reg thead th {
  /* `table.tbl` in the selector on purpose: the shared header rule is
     (0,1,3) and a bare `.reg thead th` loses to it — which is how the one
     header that is not a button («أيام محتسبة») kept nowrap and ellipsised
     the moment its column was narrowed. */
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.4;
}
.reg thead th .reg-th-btn { align-items: flex-end; }

/* table-layout is fixed (50-tables.css), so the colgroup decides. Every
   figure column is fixed and sized to its widest real value in Cairo's 0.56em
   tabular digits; the NAME column takes whatever is left (it is the one
   column whose content may be long) and ellipsises.

     rank 60 · days 62 ×4 · hours 104 · average 86 · clock 58 ×2 · money 104 ×3
     = 914, + fingerprint ids 124 = 1038, leaving the name at the floor. */
.reg col.c-sel  { width: 34px; }
.reg col.c-rk   { width: 60px; }   /* the rank plus its expand chevron, at three digits */
.reg col.c-emp  { width: auto; }
.reg col.c-ids  { width: 124px; }
.reg col.c-d    { width: 62px; }   /* a count of days; its header wraps to two lines */
/* wider than the other figures: this column carries a bar as well as a
   number, and box-sizing is border-box, so .grp's 20px opening eats into
   this width rather than adding to the table's */
.reg col.c-h    { width: 104px; }
.reg col.c-avg  { width: 86px; }
.reg col.c-t    { width: 58px; }
/* «‎−1,611.08 ر.س» and a bold net of «12,909.80 ر.س» both hold here; v5's 94px
   ellipsised the currency off every money cell. */
.reg col.c-m    { width: 104px; }

/* ---------- the row ----------
   The shared sheet buys a 45px row with 12px of padding; the name cell here
   is TWO lines (20px + 18px at --lh-cell, which must not be lowered — it is
   the floor that keeps ج ح خ ع غ and final ى out of the clip), so the
   register pays 5px instead and lands at 49px. `height` is deliberately not
   used — the print sheet re-declares padding in points and a px height would
   survive it. Inline padding drops to 8px: fourteen columns at 10px spend
   56px more than the bench has.

   The selector carries `table.tbl` on purpose: the shared rule is
   `table.tbl tbody td` at (0,1,3), and a bare `.reg tbody td` is (0,1,2) —
   it loses, silently, and every row keeps the 12px it was meant to drop. */
table.tbl.reg tbody td { padding: 5px 8px; }
table.tbl.reg tbody td.grp { padding-inline-start: 18px; }
table.tbl.reg tbody tr.detail > td { padding: 0; }
/* The rank and the net are the two ends of the row: the rank is the quietest
   thing on it, the net — the figure somebody signs — the firmest. */
.reg td.c-rk { color: var(--muted); }
/* the selection column holds a 16px box and nothing to ellipsise */
table.tbl.reg :is(td, th).c-sel { padding-inline: 10px 0; text-overflow: clip; }
/* the fingerprint numbers are reference, not a figure: a step smaller and
   quieter, which is also what lets «‎+1 AB16192 · 58» fit its column */
.reg td.c-ids { font-size: var(--fs-label); color: var(--ink-2); }
.reg td.c-m b { font-weight: var(--w-600); color: var(--ink); }

/* The sticky header needs a scrollport to stick to.
   `.tw` already computes to a scroll container (overflow-x:auto beside
   overflow-y:visible makes the visible axis auto), so `position:sticky; top:0`
   on the header resolves against .tw — and a .tw with no height of its own
   never scrolls, so the header simply leaves with the page. Giving .tw a
   max-height makes it the real scrollport and the header holds.
   `overflow:hidden` on the panel would make the panel a scrollport too, which
   is the other half of the same bug. */
.reg-panel .tw {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  /* What is above the scrollport, summed: the utility bar, the page head,
     the page's 16px top padding, the card's 49px head — and 18px left under
     the card so its bottom edge is visible. Read from the tokens, so the
     table grows when the chrome shrinks. A notice above the card pushes the
     card down by its own height and the page scrolls by that much. */
  max-height: calc(100vh - var(--ubar-h) - var(--phead-h) - 16px - 49px - 18px);
  overflow: auto;
}

/* ---------- sortable headers ----------
   The button carries the padding so the whole header cell is a hit target;
   a th whose padding is dead space reads as a broken control. */
.reg thead th.sortable { padding: 0; }
.reg-th-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 7px 8px;
  color: inherit;
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  line-height: 1.4;
  text-align: start;
  white-space: normal;   /* the label wraps rather than clipping from the start */
}
.reg thead th:not(.sortable) { padding-inline: 8px; }
.reg th.n .reg-th-btn { text-align: end; }
.reg th.grp .reg-th-btn { padding-inline-start: 18px; }
/* The label is targeted by position, not by the shared .lbl utility: .lbl
   declares `color: var(--muted)`, and a declared colour beats the inherited one
   that `table.tbl th.sortable:hover { color: var(--ink) }` relies on — so a
   sortable header styled with .lbl would stop lightening on hover and lose its
   affordance. */
.reg-th-btn > span:not(.sort-i) {
  min-width: 0;
  white-space: normal;
}
.reg th.n .reg-th-btn { justify-content: flex-end; }
/* The button aligns its items to flex-END so a two-line label sits on the
   same baseline as a one-line one. The arrow is a 4.5px box with no text in
   it, so bottom-aligning it parks it under the baseline, in the descender
   space; the margin lifts it back to the label's optical centre. */
.reg .sort-i { flex: none; margin-bottom: 6px; }

/* ---------- the merged name header ----------
   One column, two orders. The header stacks its two labels the way the cell
   stacks its two lines, so «الموظف» sits over the name and «الإدارة» over
   the department — the header is a picture of the cell beneath it.
   Only the button that owns the current order draws an arrow, so the pair
   can never claim two orders at once. */
.reg-th-2 { display: block; width: 100%; }
.reg-th-2 .reg-th-btn { padding-block: 7px 0; }
.reg-th-2 .reg-th-sub {
  padding-block: 0 7px;
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
}

/* ---------- the rank and the expander ----------
   .row-x and .rk-n moved to 50-tables.css when الإضافي grew a foldable row
   of its own: they are table primitives, not the register's property, and a
   second copy under a second name is how two expanders start behaving
   differently. Only the column's own rule stays here. */
.reg td.c-rk { white-space: nowrap; }

/* ---------- the name ----------
   A real button, so the dialog is reachable from the keyboard without
   turning the whole <tr> into a control. */
.nm-btn {
  padding: 0;
  color: var(--ink);
  text-align: start;
  max-width: 100%;
  border-radius: 3px;
}
.nm-btn:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- days without hours ----------
   Its own column, immediately beside أيام محتسبة so the two are still read as
   a pair — but a column, because the engine owns an `incomplete` comparator
   and a figure with no header is an order the reader cannot ask for. It takes
   cell size and cell ink like the two figures beside it; only the crit state
   is styled, for a row where most of the days went unmeasured. */
.reg-inc { color: var(--muted); }
.reg-inc.is-crit { color: var(--crit); }

/* ---------- the daily-average meter ----------
   Measured against CFG.expected, never against the best row in the filter:
   a bar that rescales to whoever happens to be on top says nothing about
   the dawam itself. Amber is reserved for diagnostics, so the middle band
   is neutral — full, short, and neither. */
.reg-meter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: 100%;
}
.reg-meter .track {
  flex: 1 1 auto;
  max-width: 44px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--card-3);
  overflow: hidden;
}
.reg-meter .fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.reg-meter .fill.is-full { background: var(--good); }
.reg-meter .fill.is-part { background: var(--muted); }
.reg-meter .fill.is-low  { background: var(--crit); }

/* ---------- the expanded day detail ----------
   The register's own cells clip and never wrap; the detail row must do
   neither, or the day table is cut off at the first column boundary. */
.reg tr.detail > td {
  white-space: normal;
  overflow: visible;
}
.reg .detail-in { overflow-x: auto; }
.reg .detail-in table.days { min-width: 840px; }
.reg .detail-in h4 bdi { font-weight: var(--w-600); }
/* The fold's doors sit right after its title, not at the far end of the
   line (69-punches.css's .detail-head, which the dialog keeps). The fold
   spans the WHOLE register, 1480px with payroll on, and the register opens
   scrolled to its right edge: the far end is off-screen, and «أضف مهمة»
   beside «أضف بصمات ليوم آخر» there was a door nobody would scroll to find.
   Three classes, because .detail-head's rule loads after this file. */
.reg .detail-in .detail-head h4 { flex: 0 1 auto; }

/* ---------- the day's own punch record ----------
   Visible chips, not a title attribute: a tooltip is unreachable by keyboard,
   unreachable on touch, and prints nothing — and print is where this column
   earns its width, because in pairs mode the middle punches are what produced
   the hours. Colour carries the direction, the title carries the words. */
.punch-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.punch {
  padding: 0 6px;
  border-radius: var(--r-sm);
  background: var(--card-3);
  color: var(--ink-2);
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.punch.in  { background: var(--good-soft); color: var(--good); }
.punch.out { background: var(--accent-soft); color: var(--accent); }

/* ---------- a mission on the day lists ----------
   Shared by the fold and the employee dialog, the two lists being twins.
   The chip is a .badge in the m-3 family, two classes so it beats .badge's
   own ground wherever the sheets land; «مهمة» as a day KIND in الاحتساب
   wears the same, since the day was credited and neither green (surplus) nor
   amber (short) is what happened to it. The border prints (80-print.css), so
   the mark survives a printer that drops the tint. */
.badge.is-msn {
  background: var(--m-3-soft);
  border-color: color-mix(in srgb, var(--m-3) 30%, transparent);
  color: var(--m-3-ink);
}

/* The dates no row can show — a whole day away with no punch — named under
   the table. A record, not a warning, so it takes the mission's violet rather
   than amber; the .is-warn twin beside it (an hours mission on a day with no
   punch, which credits nothing) keeps the shared amber, hence :not(). Smaller
   than a page-level note: it sits inside a fold, under a 12px table. */
.note.reg-loose {
  margin-top: 10px;
  padding: 8px 12px;
  gap: 8px;
  font-size: var(--fs-label);
}
.note.reg-loose svg { width: 15px; height: 15px; margin-top: 3px; }
.note.reg-loose b { font-weight: var(--w-600); }
.note.reg-loose:not(.is-warn) {
  background: var(--m-3-soft);
  border-color: color-mix(in srgb, var(--m-3) 24%, transparent);
  color: var(--ink);
}
.note.reg-loose:not(.is-warn) svg { color: var(--m-3-ink); }
.note.reg-loose + .note.reg-loose { margin-top: 6px; }
/* The amber twin lists its dates one per line, each with its two doors: a
   run of dates and buttons wrapped into one paragraph would leave a button
   at the start of a line, far from the date it acts on. */
.reg-loose-in {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.reg-loose-d {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.reg-loose-d .px-edit { margin-inline-start: 0; }

/* «عدّل المهمة» — the door beside a mission the day could not credit. The
   punch record's «عدّل» in form (a word, a border, 22px, never hover-only),
   with the briefcase in the mission's violet where that one's pencil is
   gold: side by side on a one-punch row, the two are told apart before they
   are read. Screen-only (print, below). */
.msn-ed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  margin-inline-start: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--fs-micro);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.msn-ed svg { width: 12px; height: 12px; color: var(--m-3-ink); }
.msn-ed:hover,
.msn-ed:focus-visible { background: var(--m-3-soft); border-color: var(--m-3); color: var(--ink); }
.reg-loose-d .msn-ed { margin-inline-start: 0; }

/* The doors into the mission dialog — the card head's «أضف مهمة», the
   fold's, the dialog's and the selection bar's. Each is a .btn with its
   word; only the briefcase takes the violet, as the punch doors' pencil
   takes the gold, so the two doors side by side are told apart before they
   are read. */
.reg-panel .msn-open svg,
.selbar .msn-open svg,
.empd .msn-open svg { color: var(--m-3-ink); }

/* ---------- the selection bar ---------- */
.selbar-hint {
  font-size: var(--fs-label);
  color: var(--muted);
}
/* A selection the current filter no longer reaches is a correctness warning,
   not a decoration — it earns weight and full-strength ink rather than the
   amber that belongs to the diagnostics list. */
.selbar-hint.is-warn {
  color: var(--ink);
  font-weight: var(--w-600);
}

/* ---------- the empty state's removable filters ---------- */
.reg-empty-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.reg-empty-chips .btn { color: var(--ink-2); }
.reg-empty-chips .btn b { font-weight: var(--w-600); }
.reg-empty-chips .btn svg { width: 12px; height: 12px; stroke-width: 2.6; color: var(--muted); }
.reg-empty-chips .btn:hover svg { color: var(--crit); }

/* ============================================================
   The employee dialog

   Scoped to .back.has-emp so it cannot collide with the shell's own dialog
   vocabulary: the class is added by openEmp() and removed by closeEmp(),
   and every rule below needs both.
   ============================================================ */

.back.has-emp {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  /* --spine is the one surface that is dark in BOTH themes, so the scrim
     keeps its meaning without a second declaration for dark mode. */
  background: color-mix(in srgb, var(--spine) 64%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.empd {
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3), var(--sh-inset);
}

.emp-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.emp-id { flex: 1 1 auto; min-width: 0; }
.emp-head h3 {
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
}
.emp-sub {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.emp-head .src { margin-top: 4px; }
.emp-head .badge { margin-top: 4px; }
.emp-x { width: 30px; height: 30px; padding: 0; flex: none; }
.emp-x svg { width: 16px; height: 16px; }

.emp-head + .note { margin: 14px 18px 0; }

/* ---------- the figures ---------- */
.emp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 0;
  margin: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
/* The six figures are ONE band, the same form as the summary band on the
   screens (62-overview, .kpis): a label above, the figure, a note below,
   hairlines between — not six tinted boxes. The figure's own colour says
   deduction, addition, net; the ground stays the card's. */
.emp-card {
  display: grid;
  gap: 1px;
  align-content: start;
  padding: 10px 14px 11px;
  margin-block-start: -1px;
  margin-inline-start: -1px;
  border-block-start: 1px solid var(--line-soft);
  border-inline-start: 1px solid var(--line-soft);
}
.emp-card .c-l {
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--muted);
}
.emp-card .c-v {
  font-size: var(--fs-h2);
  line-height: var(--lh-cell);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
}
.emp-card .c-s {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.emp-card.is-ded .c-v { color: var(--crit); }
.emp-card.is-add .c-v { color: var(--good); }
/* the net is the figure somebody signs: the one cell with a ground */
.emp-card.is-net { background: var(--card-2); }
.emp-card.is-fixed { background: var(--fixed-soft); }
.emp-card.is-fixed .c-v { color: var(--fixed-ink); }
.emp-card.is-net .c-v { color: var(--ink); font-weight: var(--w-700); }

/* ---------- the arithmetic ----------
   A figure that reaches a payslip has to be arguable, so every line carries
   the sum it came from underneath it. */
.emp-calc { padding: 0 18px 16px; }
.emp-ln {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-body);
}
.emp-ln .l { color: var(--ink-2); }
.emp-ln .why {
  grid-column: 1 / -1;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
/* «الساعات المدفوعة» — the subtotal an hourly ledger closes its hours on,
   before the rate turns them into money (76-register.js, payHourLedger). */
.emp-ln.is-sub { border-top: 1px solid var(--line); }
.emp-ln.is-sub .l { color: var(--ink); font-weight: var(--w-600); }
.emp-ln.is-tot {
  margin-top: 8px;
  border-bottom: 0;
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: var(--fs-lead);
}

/* The arithmetic's own head, and its groups (76-register.js, regGrpHtml):
   a dot in the group's hue, the name, and the group's total where it has
   one the cards already print. Lines inside a group are indented under it. */
.emp-calc-h {
  margin: 4px 0 6px;
  font-size: var(--fs-h3);
  font-weight: var(--w-600);
}
.emp-grp {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 14px 10px 6px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
}
.emp-grp .l { display: flex; align-items: center; gap: 8px; }
.emp-grp .l i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hue, var(--muted));
}
.emp-grp .q,
.emp-grp .v { text-align: end; }
.emp-grp.g-att { --hue: var(--m-2); }
.emp-grp.g-msn { --hue: var(--m-3); }
.emp-grp.g-leave { --hue: var(--m-4); }
.emp-grp.g-abs { --hue: var(--m-8); }
.emp-grp.g-add { --hue: var(--m-7); }
.emp-ln.is-in { padding-inline-start: 26px; }

/* Paid by the hour: three columns — the line, its hours, its money — under
   a quiet column head, so every hour stands beside what it was paid. The
   rate and total lines (empLineHtml) carry no hours: their value is pinned
   to the money column by name, not by position. */
.emp-calc.is-led .emp-ln,
.emp-calc.is-led .emp-lh,
.emp-calc.is-led .emp-grp { grid-template-columns: minmax(0, 1fr) 6.5em 9em; }
.emp-calc.is-led .emp-ln .l { grid-column: 1; }
.emp-calc.is-led .emp-ln .q { grid-column: 2; text-align: end; }
.emp-calc.is-led .emp-ln .v { grid-column: 3; text-align: end; }
.emp-calc.is-led .emp-ln .why { grid-column: 1 / -1; }
.emp-lh {
  display: grid;
  gap: 4px 10px;
  padding: 10px 10px 4px;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.emp-lh span + span { text-align: end; }
.emp-ln.is-rate {
  border-radius: var(--r-sm);
  background: var(--card-2);
  border-bottom: 0;
}

/* ---------- «أيام الفترة وأثرها في الراتب» ----------
   The required days as one bar and five tiles, each tile's foot saying what
   its days did to the pay (76-register.js, regSplitHtml). Each part wears the
   hue its verdict wears on الغياب — see the note there. */
.emp-split {
  margin: 0 18px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.sp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 10px;
}
.sp-head h4 {
  font-size: var(--fs-h3);
  font-weight: var(--w-600);
}
.sp-req-say { font-size: var(--fs-label); color: var(--muted); }

.sp-bar {
  position: relative;
  display: flex;
  gap: 2px;
  height: 10px;
  margin-bottom: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--card-2);
}
.sp-bar i { flex: 1 1 0; min-width: 3px; }
.sp-bar .b-att { background: var(--m-2); }
.sp-bar .b-msn { background: var(--m-3); }
.sp-bar .b-leave { background: var(--m-4); }
.sp-bar .b-unpaid { background: var(--m-5); }
.sp-bar .b-abs { background: var(--m-8); }
.sp-bar .b-undated {
  background: repeating-linear-gradient(135deg, var(--m-8) 0 3px, var(--m-8-soft) 3px 6px);
}
/* More days than asked: where the requirement ends. */
.sp-bar .sp-req {
  position: absolute;
  inset-block: 0;
  width: 2px;
  background: var(--ink);
}

.sp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.sp-t {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-2);
  overflow: hidden;
}
.sp-t.t-att { --hue: var(--m-2); --hue-ink: var(--m-2-ink); }
.sp-t.t-msn { --hue: var(--m-3); --hue-ink: var(--m-3-ink); }
.sp-t.t-leave { --hue: var(--m-4); --hue-ink: var(--m-4-ink); }
.sp-t.t-unpaid { --hue: var(--m-5); --hue-ink: var(--m-5-ink); }
.sp-t.t-absent { --hue: var(--m-8); --hue-ink: var(--m-8-ink); }
.sp-l {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink-2);
}
.sp-l i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hue);
}
.sp-v {
  font-size: var(--fs-h2);
  line-height: var(--lh-cell);
  font-weight: var(--w-600);
  color: var(--hue-ink);
}
.sp-s {
  flex: 1 1 auto;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
/* The foot: what these days did to the pay — the words, and under them the
   money. Stacked on purpose: side by side, a currency suffix wrapped some
   feet and not others, and five tiles read five different ways. */
.sp-m {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 8px -12px -10px;
  padding: 7px 12px 8px;
  border-top: 1px solid var(--line);
  background: var(--card);
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--ink-2);
}
.sp-m b {
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
  white-space: nowrap;
}
.sp-m.is-plus b { color: var(--good); }
.sp-m.is-minus b { color: var(--crit); }
.sp-m.is-off b { color: var(--muted); }
/* A part with nothing in it stays, quiet: «no missions» is an answer too. */
.sp-t.is-zero { background: var(--card); }
.sp-t.is-zero .sp-l { color: var(--muted); }
.sp-t.is-zero .sp-l i { background: var(--line); }

.sp-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
}
.sp-dh { color: var(--muted); font-weight: var(--w-600); }
.sp-d {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 2px;
  padding-inline: 8px 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink-2);
  white-space: nowrap;
}
.sp-dv {
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--hue-soft);
  color: var(--hue-ink);
  font-weight: var(--w-600);
}
.sp-d.is-msn { --hue-soft: var(--m-3-soft); --hue-ink: var(--m-3-ink); }
.sp-d.is-leave { --hue-soft: var(--m-4-soft); --hue-ink: var(--m-4-ink); }
.sp-d.is-abs { --hue-soft: var(--m-8-soft); --hue-ink: var(--m-8-ink); }
.sp-d.is-unset { --hue-soft: var(--warn-soft); --hue-ink: var(--warn); }

.sp-notes {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.sp-notes li { position: relative; padding-inline-start: 14px; }
.sp-notes li::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: 0.8em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

/* ---------- the days ---------- */
.emp-days { padding: 0 18px 16px; overflow-x: auto; }
.emp-days h4 {
  font-size: var(--fs-label);
  color: var(--muted);
  margin-bottom: 8px;
}
.emp-days table.days { min-width: 680px; }
/* Every cell on one line but the status. A mission's chip and its reason
   («في اليوم بصمة واحدة — أكمل البصمة…») made الحالة the widest cell, and
   the table then took the room out of the date — «2026-» over «08-17» — and
   out of «أول بصمة». A date read in two halves is a date misread; the status
   is prose and wraps like prose. The box scrolls sideways on a narrow
   screen (above) rather than break a figure. */
.emp-days table.days th,
.emp-days table.days td { white-space: nowrap; }
.emp-days table.days td.day-st { white-space: normal; min-width: 180px; }

/* ---------- the footer ---------- */
.emp-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--card-3);
  border-top: 1px solid var(--line);
}
/* It names the layer AND the settings it carries now, so it is a sentence that
   may wrap — given the row's slack rather than squeezed against the button. */
.emp-scope {
  flex: 1 1 260px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}

@media (max-width: 720px) {
  .back.has-emp { padding: 0; place-items: stretch; }
  .empd { max-height: 100vh; border-radius: 0; border: 0; }
}

/* ============================================================
   Print — a report is the whole report, and none of it is a control.
   The token re-declaration belongs to the print stylesheet; this block
   only removes what cannot be pressed on paper.
   ============================================================ */
@media print {
  .row-x,
  .tune-i,
  .selbar,
  .reg td.c-sel,
  .reg th.c-sel,
  #btnPickMode,
  .reg-empty-chips { display: none !important; }

  .reg { min-width: 0; }
  .reg-panel .tw { overflow: visible; }
  /* the day table lays itself out on paper; a screen floor width would push
     the extra column off the sheet instead of scrolling, which paper cannot */
  .reg .detail-in { overflow: visible; }
  .reg .detail-in table.days { min-width: 0; }
  .reg-th-btn { padding: 4px 6px; }
  /* On paper the chips are a record, not a control: an outline instead of a
     fill, so the printer's background-off default cannot erase them. */
  .punch {
    font-size: 7pt;
    padding: 0 3pt;
    border: .4pt solid var(--line);
    background: none !important;
  }
  /* the bar is data, not decoration: it has to survive the printer's
     background-off default */
  .reg-meter .fill { print-color-adjust: exact; }
  /* The mission dates under a printed fold are part of the record (90-export
     opens every fold for the day detail); the screen's padding would cost a
     sheet a line per note. */
  .note.reg-loose { margin-top: 4pt; padding: 3pt 6pt; }
  /* The doors go, the dates stay: a button is no use on paper. */
  .msn-ed { display: none !important; }
  .back.has-emp { display: none !important; }
}

/* ── 65-depts.css ─────────────────────────────── */

/* ============================================================
   الإدارات — the department table.

   Builds on .panel, .panel-head, .tbl, .bar, .badge, .tag and .btn from
   40-controls.css and 50-tables.css; it redefines none of them. What is
   here is only what a department row needs that a register row does not: a
   two-line name cell, a two-line hours cell carrying the comparison bar, and
   a totals foot.
   ============================================================ */

/* The nine columns do not compress usefully — a department name, six figures,
   a bar and a button — so the table keeps a floor and .tw scrolls beneath it
   rather than letting «متوسط الموظف» wrap to three lines on a laptop.

   The floor is the sum of what is measured below, not a round number: every
   other column is sized, so the name is handed whatever is left, and a floor
   smaller than the sized columns hands it nothing.
   3×96 + 2×112 + 126 + 150 + 116 = 904, + the 260px the name may not go
   below = 1164. */
.dp-t { min-width: 1164px; }

/* table-layout is fixed, so every column is measured here. The name is the one
   column left auto — it takes the remainder, which the floor above guarantees
   is at least 260px: enough for a department and its «قاعدة إدارة» badge at
   the ~990px well of a 1280 laptop and at the ~930px left once the drawer is
   open, which is the workflow this screen exists for.
   A percentage here cannot do that job: 34% of a 1002px table leaves the name
   0px and the badge spills across «الموظفون».

   The three figure widths are measured from their own headers, not guessed:
   a header is the label + the 4px gap + the 12px sort arrow + 20px of cell
   padding, and at 12.5px semibold «أيام الحضور» wants 55px, «متوسط اليوم»
   66px and «متوسط الموظف» 85px — which is why the widest of the three has a
   width of its own rather than being crammed into the shared one. The hours
   column is wider than any of them because it carries a figure AND a bar with
   its share beside it. */
.dp-t .dp-c-name { width: auto; min-width: 260px; }
.dp-t .dp-c-num  { width: 96px; }    /* ≤ 55px of label */
.dp-t .dp-c-hrs  { width: 150px; }   /* figure over bar + share */
.dp-t .dp-c-wide { width: 112px; }   /* ≤ 70px */
.dp-t .dp-c-w2   { width: 126px; }   /* «متوسط الموظف», 85px */
.dp-t .dp-c-act  { width: 116px; }

/* ---------- sortable headers ----------
   The clickable element is a real button inside the th. The th keeps the
   shared overflow:hidden: a header that escapes its 96px cell paints over its
   neighbour, and thead is sticky with a z-index, so it paints on top. The
   focus ring — a sort control whose focus is invisible is one the keyboard
   cannot use — is bought back by drawing it inside the button instead of 2px
   outside it, and the label carries its own ellipsis because text-overflow on
   the th cannot reach inside a flex child. */
.dp-sort:focus-visible { outline-offset: -2px; }
.dp-sort > span:not(.sort-i) {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.dp-sort {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;      /* the header's own weight */
  white-space: nowrap;
}
.dp-t thead th.n .dp-sort { justify-content: flex-end; }
.dp-sort:hover { color: var(--ink); }

/* ---------- the تخصيص button that cannot open ----------
   The «بلا إدارة محدّدة» group has no key to hang a rule on. It still gets a
   real, reachable button: a `disabled` one leaves the tab order and takes its
   title with it, so the keyboard and the screen reader are told nothing at all.
   It is aria-disabled, looks it, and says why when pressed. */
.dp-t .btn[aria-disabled="true"] {
  opacity: .5;
  background: var(--card-2);
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}
.dp-t .btn[aria-disabled="true"]:hover {
  background: var(--card-2);
  border-color: var(--line);
  color: var(--muted);
}
/* The row's own action is a small button, not a filter-row control: .btn-tune
   sizes itself to --ctrl-h for the filter row, which is 12px taller than the
   .btn-sm this cell asks for and would set the row height on its own. */
.dp-t .btn-tune { height: 28px; padding: 0 10px; font-size: var(--fs-label); border-radius: var(--r-sm); }
/* the row is sized by its button and its bar, not by 12px of padding */
table.tbl.dp-t > tbody > tr > td { padding-block: 8px; }

/* ---------- the name cell ----------
   Two lines: the department with its rule badge, and — when there are any —
   the people whose own override outranks that rule. The shared rule sets every
   cell to nowrap + ellipsis, which is right for a figure and wrong for this.

   No initial square here, unlike the register: eight of ten departments in a
   real file are «مديرية …» and every square would read «م». */
.dp-t td.dp-name {
  white-space: normal;
  overflow: visible;
}
.dp-nm {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.dp-nm > bdi {
  font-weight: var(--w-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dp-sub {
  display: block;
  font-size: var(--fs-micro);
  color: var(--muted);
  /* The face.s ج ح خ ع غ drop below the baseline far enough that a tighter line
     box clips them; --lh-cell is the floor, not a preference. */
  line-height: var(--lh-cell);
}

/* ---------- the hours cell ----------
   v1 drew a bare track in a column of its own, whose width was the
   department's share of the largest department. v3 puts it where the quantity
   it measures already is — under the figure — and gives it the number it was
   missing: the share of the whole period, so the cell reads as a proportion as
   well as a comparison. The fill's hue arrives through data-m="3" on .dp-h;
   إجمالي الساعات is measure 3 everywhere in this design, so nothing here
   names a colour. */
.dp-t td.dp-c-hrs {
  white-space: normal;
  overflow: visible;
}
.dp-h {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
/* Figure and share on one line, the bar beneath it across the whole cell.
   Stacking the share under the bar instead would add a third line box and
   make every department row taller than a register row for no gain. */
.dp-h-v {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
}
.dp-pct {
  flex: none;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.dp-h .bar { width: 100%; }

/* ---------- the measure-tinted count ----------
   «بلا ساعات» is measure 5, and the tag takes its hue from data-m rather than
   from a token named here — that is the rule that keeps a hue attached to its
   quantity instead of to a component. */
.tag.dp-m {
  background: var(--m-soft, var(--card-2));
  color: var(--m-ink, var(--muted));
}

/* ---------- the totals foot ----------
   The same ground as the sticky header, so the table is bracketed by its
   chrome rather than trailing off into the page. */
.dp-t tfoot td {
  background: var(--card-3);
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  font-weight: var(--w-600);
  white-space: nowrap;
}
.dp-t tfoot td.dp-c-name { color: var(--muted); }

/* ---------- print ----------
   A report is read on paper without the buttons that made it. The bar is a
   figure, so it has to survive the browser's background-dropping. */
@media print {
  .dp-t { min-width: 0; }
  .dp-t .dp-c-act { display: none; }
  .dp-t .bar, .dp-t .bar i, .dp-t .tag, .dp-t tfoot td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ── 66-check.css ─────────────────────────────── */

/* ============================================================
   66-check.css — فحص الملف · دمج الأسماء

   Two lists that are read rather than scanned: a finding and a merge proposal
   are both arguments the reader has to weigh, so neither is compressed into a
   dense row. Built from .panel, .ichip, .btn, .inp, .seg, .avat, .badge and
   .empty in 40-controls.css — nothing here redefines one of them, every
   variant below is a modifier.

   This is also the one screen where --warn and --crit are allowed to be loud.
   Everywhere else a state colour has to be earned by a figure; here the whole
   point of the page is which findings want the reader's eye. The eight
   MEASURE hues stay out of it — a finding is not a measured quantity, so it
   colours itself from the state tokens and from --muted, per DESIGN.md §6.
   ============================================================ */

/* Both screens stack cards with the same gap every other screen uses. v2 gave
   that to .screen once, in the shell; the v3 shell no longer carries the rule,
   so each of mine states it for itself. Same value, so nothing moves if the
   shared rule comes back. */
#scCheck,
#scMerge {
  display: grid;
  gap: 16px;
  align-content: start;
}

/* ============================================================
   فحص الملف
   ============================================================ */

/* ---------- the level tallies ----------
   Three cards above the list: how much needs the reader, how much was handled
   for them, and how much is merely worth knowing. It answers "is this file
   fine?" before a single finding is read. Built to the KPI tile's own order —
   chip and label on top, the figure under them — because it is the same kind
   of object and a second layout for it would be a second design. */
.ck-tallies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}
.ck-tally {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 13px 15px;
  min-width: 0;
}
.ck-tally-l {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--muted);
}
.ck-tally-n {
  font-size: var(--fs-num-xl);
  line-height: var(--lh-tight);
  font-weight: var(--w-700);
  color: var(--ink);
}
.t-warn  .ck-tally-n { color: var(--warn); }
.t-fixed .ck-tally-n { color: var(--good); }
.t-info  .ck-tally-n { color: var(--muted); }
/* A zero tally is still shown — the absence of warnings is information — but
   it must not compete with the count that is not zero. */
.ck-tally.is-zero .ck-tally-n {
  color: var(--muted);
  font-weight: var(--w-500);
}

/* ---------- the tinted glyph chip ----------
   .ichip takes its hue from --m, which only a measure sets. A finding has no
   measure, so its level supplies the pair by hand. Ground and ink move
   together: a chip that keeps a light ground in dark mode is a hole. */
/* v6: .ichip is a bare glyph now (40-controls). A finding's level is a STATE,
   and a state earns its tint — so this chip keeps a ground, and sizes itself. */
.ck-i { width: 26px; height: 26px; border-radius: var(--r-sm); }
.ck-i.is-warn  { background: var(--warn-soft); color: var(--warn); }
.ck-i.is-fixed { background: var(--good-soft); color: var(--good); }
.ck-i.is-info  { background: var(--card-2);    color: var(--muted); }

/* ---------- the findings ---------- */
.ck-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.ck-list > li:last-child { border-bottom: 0; }

.ck-i { margin-top: 1px; }

.ck-t {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
}
/* The level in words as well as in colour: the glyph is decorative, and a
   coloured square is not a status to anyone reading this list to decide
   whether to pay someone. */
.ck-lvl {
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
}
.d-warn  .ck-lvl { color: var(--warn); }
.d-fixed .ck-lvl { color: var(--good); }
.d-info  .ck-lvl { color: var(--muted); }

.ck-d {
  margin-top: 4px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 84ch;
}
/* diagnose() wraps a column header or a sample value in <code>. There is one
   family in this app, so the chip does the work a monospace face would. */
.ck-d code {
  font-family: var(--font);
  font-size: var(--fs-micro);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xs);
  padding: 1px 6px;
  color: var(--ink-2);
  unicode-bidi: plaintext;   /* dir=auto, not RTL: a header like "AC-No." has a
                                trailing neutral that would jump to the far edge */
}
.ck-d b { font-weight: var(--w-600); color: var(--ink); }

/* The fix. Drawn only where one genuinely exists — a finding whose remedy is
   somewhere else in the app gets the button that goes there, and a finding
   that is simply a fact about the file gets nothing rather than a button that
   would have to apologise when pressed. */
.ck-fix { margin-top: 10px; }

.ck-n {
  font-size: var(--fs-num-lg);
  line-height: var(--lh-tight);
  font-weight: var(--w-600);
  white-space: nowrap;
}
.d-warn  .ck-n { color: var(--warn); }
.d-fixed .ck-n { color: var(--good); }
.d-info  .ck-n { color: var(--muted); }

.ck-foot {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  padding-inline: 2px;
}

/* ============================================================
   دمج الأسماء
   ============================================================ */

.mg-auto { white-space: nowrap; }

.mg-p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 88ch;
}
.mg-lead {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 88ch;
  margin-bottom: 14px;
}

/* ---------- a proposal ----------
   Two names, side by side, each over its own evidence — the claim the tool is
   making is that these two columns are one person, and the card is that
   sentence drawn. Wide enough for two names and their fingerprint numbers;
   below that the pair stacks rather than shrinking the evidence away. */
.mg-list {
  display: grid;
  /* min() and not a bare 440px: auto-fit keeps the track at its minimum when
     the bench is narrower than one card, so the list would push a horizontal
     scrollbar onto the page rather than letting the pair stack — which is
     exactly what the 560px rule below is for. 440 is the widest minimum in
     the app, so this is the one grid where that actually bites. */
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 12px;
}
.mg-card {
  display: grid;
  gap: 11px;
  padding: 14px 16px;
  min-width: 0;
  align-content: start;
}

.mg-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.mg-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mg-who { min-width: 0; }
.mg-name {
  display: block;
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
  line-height: var(--lh-cell);
  overflow-wrap: anywhere;
}
.mg-ids {
  display: block;
  margin-top: 1px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
  overflow-wrap: anywhere;
}
/* The equals sign is the whole claim, so it gets a ground of its own rather
   than sitting as loose punctuation between two names. */
.mg-eq {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
}

.mg-why {
  font-size: var(--fs-micro);
  line-height: var(--lh-body);
  color: var(--ink-2);
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.mg-why .badge { margin-inline-start: 5px; }

.mg-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mg-days {
  margin-inline-start: auto;
  font-size: var(--fs-micro);
  color: var(--muted);
  white-space: nowrap;
}
.mg-days b {
  font-weight: var(--w-600);
  color: var(--ink-2);
}

/* The decision, as two buttons rather than one box: "merged" and "separate"
   are both positions a reader takes, and a lone tick makes only one of them
   say anything. Both stay on screen after the choice — this is the one panel
   in the app whose whole point is reconsidering. */
.mg-seg { flex: none; }

/* A refused proposal stays, quietened rather than gone. A decision that
   disappears when it is taken cannot be taken back. */
.mg-card.is-off { background: var(--card-2); }
.mg-card.is-off .mg-name { color: var(--muted); font-weight: var(--w-500); }
.mg-card.is-off .mg-eq { color: var(--muted); background: var(--card-3); }

/* Paper only. The buttons do not print — a printed button is a lie — so the
   state has to survive as a word, and grey ink is not a state on a mono
   printer. Hidden here rather than with the `hidden` attribute because it is
   not a state the app toggles: it is a fact about the medium. */
.mg-state { display: none; }

.mg-add {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.mg-add .fld { min-width: 200px; }
.mg-add select.inp { max-width: 280px; }

/* ---------- narrow ---------- */
@media (max-width: 560px) {
  .mg-pair { grid-template-columns: minmax(0, 1fr); }
  .mg-eq { width: auto; }
  .ck-item { grid-template-columns: auto minmax(0, 1fr); }
  .ck-n { grid-column: 2; }
}

/* ---------- print ----------
   Print reveals every screen, so these two land on paper. The controls do not:
   .btn, .seg, input and select are already gone from the global print block,
   and what is left here is the prose that only makes sense beside them. */
@media print {
  .ck-tallies,
  .ck-fix,
  .ck-foot,
  #scMerge .panel-head .check,
  .mg-add,
  .mg-lead,
  /* the one sentence in .mg-p that tells the reader which button to press */
  .mg-act { display: none !important; }

  .ck-item { break-inside: avoid; padding: 6pt 0; }
  .ck-d { max-width: none; }

  .mg-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6pt; }
  .mg-card { break-inside: avoid; padding: 4pt 0; border: 0; }
  .mg-card.is-off { background: transparent; }
  .mg-state { display: inline-flex; }

  .ck-i, .ck-tally, .mg-state, .avat {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ── 67-library.css ─────────────────────────────── */

/* ============================================================
   الملفات المحفوظة — the local library and backup.

   Built entirely from the shared vocabulary: .panel, .panel-head,
   .btn, .note, .empty, .badge, .num. Everything below is either a
   layout, a two-line cell, or a variant that vocabulary does not
   carry. Nothing here redefines a shared class.

   v3 drops the seven-column table. A saved record is an OBJECT the
   user recognises by name — not a row to be scanned across — so it
   gets the reference's card-row treatment: the extension square, an
   identity block, its facts, and its verbs. The two columns the
   table forced on it (البصمات، الحجم) were also the first two it
   hid at every breakpoint, which is the table admitting the same
   thing.
   ============================================================ */

/* .screen carries no spacing of its own in v3, so the screen owns its
   own stack. One column: a list and the two notes that belong under it. */
.lib-screen {
  display: grid;
  gap: 16px;
  align-content: start;
}

/* ---------- the backup pair, in the panel head ---------- */
.lib-bak {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- the open file, when no record holds it ----------
   Sits above the list rather than inside it: it is a statement about the
   session, not a record, and putting it in the list would invite the reader
   to look for فتح and حذف on it. */
.lib-cta {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.lib-cta .note { align-items: center; }
.lib-cta .btn { flex: none; align-self: center; margin-inline-start: auto; }

/* ---------- the list ----------
   Edge to edge inside the panel, with the row rule doing the separating —
   the same instrument the register uses, at a larger scale. */
.lib-list {
  display: block;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}

.lib-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t-fast) var(--ease);
}
.lib-row:last-child { border-bottom: 0; }
.lib-row:hover { background: color-mix(in srgb, var(--accent) 5%, var(--card)); }

/* The record this session is editing. Fill AND marker, never colour alone —
   the same rule the rail's active row follows. The badge in the name carries
   it in words for anyone the 3px bar does not reach. */
.lib-row.is-open { background: var(--sel); }
.lib-row.is-open::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--accent);
}

/* ---------- the extension square ----------
   The same object the rail's bookplate carries, on a page ground instead of
   on the rail. Latin, upper-cased in JS — text-transform is forbidden across
   every stylesheet here, because Arabic has no uppercase to transform to. */
.lib-ext {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: var(--fs-micro);
  font-weight: var(--w-700);
  overflow: hidden;
}
.lib-row.is-open .lib-ext {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--accent);
}

/* ---------- name and provenance ----------
   Two stacked lines, each clipping on its own: the name the user gave the
   record, and beneath it the file it was made from with the period it covers.
   Those two are very often not the same name at all. */
.lib-id { min-width: 0; line-height: var(--lh-tight); }

.lib-name {
  display: block;
  font-size: var(--fs-lead);
  font-weight: var(--w-600);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-name .badge { margin-inline-start: 6px; vertical-align: 1px; }

.lib-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  min-width: 0;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.lib-file {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-per { flex: none; white-space: nowrap; }
.lib-dot { flex: none; color: var(--line); }

/* the ← between the two dates of a period: a connector, not a figure */
.lib-arrow {
  color: var(--muted);
  padding-inline: .4em;
}

/* ---------- the facts ----------
   Figure above, name beneath — the tile's hierarchy at row scale. They are
   metadata about a record, not one of the eight measures, so they take --ink
   and stay out of the measure palette entirely. */
.lib-facts {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  flex: none;
}
.lib-fact {
  display: grid;
  gap: 1px;
  justify-items: end;
  text-align: end;
  line-height: var(--lh-tight);
  white-space: nowrap;
}
.lib-fact b {
  font-size: var(--fs-lead);
  font-weight: var(--w-600);
  color: var(--ink);
}
.lib-fact i {
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--muted);
}

/* the clock, quieter than the date it follows */
.lib-time {
  margin-inline-start: .45em;
  font-size: var(--fs-micro);
  color: var(--muted);
}

/* ---------- row actions ----------
   Three named buttons rather than icons: فتح is the whole point of the screen
   and حذف is irreversible, and neither survives being guessed from a glyph. */
.lib-acts {
  display: flex;
  gap: 6px;
  flex: none;
  justify-content: flex-end;
}

/* Destructive, but only once the pointer is on it — a red button on every row
   of a list whose main verb is «فتح» misreads the screen. */
.lib-del:hover {
  background: var(--crit-soft);
  border-color: color-mix(in srgb, var(--crit) 40%, transparent);
  color: var(--crit);
}

/* ---------- prose inside a .note ----------
   .note is a flex row of icon + content; this is the content column. */
.lib-note-in { display: grid; gap: 5px; min-width: 0; }
.lib-note-in b { font-weight: var(--w-600); }
.lib-note-in p { max-width: 78ch; }

/* The browser's own error text: English, technical, and not ours to translate.
   It is bidi-isolated by nameHtml() and held below the Arabic that explains
   what it means — never above it. */
.lib-why {
  font-size: var(--fs-micro);
  color: var(--muted);
}

/* ---------- the empty state ---------- */
.empty #btnLibSaveNow { margin-top: 6px; }

/* ---------- narrow ----------
   The row folds rather than scrolls. First the facts drop under the identity
   block — they are what the reader checks second; then the actions follow
   them, and the extension square keeps its place as the row's anchor. */
@media (max-width: 1180px) {
  .lib-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .lib-ext { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .lib-id { grid-column: 2; grid-row: 1; }
  .lib-acts { grid-column: 3; grid-row: 1; }
  .lib-facts {
    grid-column: 2 / -1;
    grid-row: 2;
    gap: 18px;
    justify-content: flex-start;
  }
  .lib-fact { justify-items: start; text-align: start; }
}
@media (max-width: 760px) {
  .lib-row { grid-template-columns: auto minmax(0, 1fr); }
  .lib-ext { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
  .lib-id { grid-column: 2; grid-row: 1; }
  .lib-facts { grid-column: 2; grid-row: 2; flex-wrap: wrap; gap: 10px 16px; }
  .lib-acts { grid-column: 2; grid-row: 3; justify-content: flex-start; flex-wrap: wrap; }
  .lib-sub { flex-wrap: wrap; }
  .lib-cta .note { flex-wrap: wrap; }
  .lib-cta .btn { margin-inline-start: 0; }
}

/* ---------- print ----------
   There is none. 80-print.css hides #scLibrary outright — a list of what is
   stored on this machine says nothing about the month being printed — so any
   @media print rule here would be dead the moment it was written. If a printed
   library is ever wanted, it starts by removing #scLibrary from that rule. */

/* ── 68-settings.css ─────────────────────────────── */

/* ============================================================
   الإعدادات — the general payroll layer, the per-file reading
   decisions, the theme twin, the template.

   The field row here is deliberately the same object as the
   drawer's (70-drawer.css): label on the start edge, control at
   the end, the sentence that explains it beneath the label. The
   general layer and a department rule edit the SAME twenty
   settings, and two different-looking forms for one set of fields
   is how a user stops believing they are one set of fields.

   DESIGN.md is explicit about the row: «label on the start edge,
   control on the end edge, and the explanation beneath the label
   in var(--muted) — never a bare control with no sentence saying
   what it does». Every row below carries one.

   Nothing here redefines .panel, .btn, .inp, .seg, .switch or
   .ichip — this file is modifiers and layout only.
   ============================================================ */

/* ---------- the two columns ----------
   One column until there is genuinely room for two: the side column
   carries the override counts, and a 220px-wide count of who ignores
   the settings is not worth the width it costs the settings. */
.gs-cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.gs-main, .gs-side { display: grid; gap: 16px; align-content: start; min-width: 0; }

@media (min-width: 1180px) {
  .gs-cols { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

.gs-body { display: grid; gap: 14px; }

/* the switch in the payroll panel's head, after the meta line */
.gs-on { font-size: var(--fs-body); }

/* ---------- groups ----------
   A fieldset, because these controls really are one group and a screen reader
   should say so. Kept display:block: a grid fieldset takes the legend out of
   the flow in more than one engine. A sunken well rather than a second card —
   a card inside a card is a border the design cannot explain.

   The floor is 340px and not v2's 292: the row now holds a 138px control
   column beside a label that has to fit «الساعات المطلوبة يومياً», and below
   340 the label column collapses to three words a line. */
.gs-groups {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: start;
}
.gs-groups-file { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* A group is a ruled block on the card's own ground — a title, a hairline,
   its fields — not a grey well: five wells on one card made the settings
   screen read as five disabled panels. */
.gs-group {
  display: block;
  min-width: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.gs-legend {
  width: 100%;
  padding: 0 0 7px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink);
}

/* ---------- one field ----------
   Two columns and two rows: the label and its sentence stack down the start
   edge, and the control sits at the end edge spanning both — so a long
   explanation never pushes the control out of line with the one above it. */
.gs-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  align-items: center;
  column-gap: 14px;
  row-gap: 3px;
}
.gs-field + .gs-field,
.gs-field + .gs-wrap,
.gs-wrap + .gs-field { margin-top: 13px; }

.gs-field > label {
  grid-column: 1;
  grid-row: 1;
  font-size: var(--fs-body);
  color: var(--ink-2);
  min-width: 0;
}
/* The placement is scoped to a field: .gs-body is itself a grid, and a bare
   .gs-hint sitting in a panel body — the theme panel has one — would take the
   row and column meant for a field's caption. */
.gs-hint {
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: 1.55;
}
.gs-hint:empty { display: none; }
.gs-field > .gs-hint { grid-column: 1; grid-row: 2; }

.gs-ctl {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.gs-ctl .inp { min-width: 0; }

/* The signature titles: «اعتمده مدير الإدارة» is read back in
   full before it is printed, not guessed at through a 138px slot. */
.gs-field.is-sig { grid-template-columns: minmax(0, 1fr) minmax(138px, 320px); }
.gs-field.is-sig .gs-ctl .inp { flex: 1; }

/* The rows whose control is a long Arabic select. «الراتب ÷ (الأيام ×
   الساعات)» does not survive a 138px column — it is clipped to «الراتب ÷»,
   which reads as a different rule — so those rows give the control its own
   full-width line under the explanation instead. */
.gs-field.is-stack { grid-template-columns: minmax(0, 1fr); }
.gs-field.is-stack > label { grid-column: 1; grid-row: 1; }
.gs-field.is-stack > .gs-hint { grid-column: 1; grid-row: 2; }
.gs-field.is-stack .gs-ctl {
  grid-column: 1;
  grid-row: 3;
  display: block;
  margin-top: 3px;
}

/* ---------- a group's own verdict ----------
   الإضافي is set by two independent controls — a switch for the hours and a
   select for the days — so the state they add up to was nowhere on the screen:
   the user had to hold both in their head and infer which of four policies
   they had just chosen. #gsOtSay states it, and this is the plate it sits on.

   A RAISED surface inside the sunken well, the same figure/ground flip .gs-rates
   uses under the groups: it is a consequence of the fields above it and not
   another one of them, and a flat paragraph in the well reads as a third hint.
   --fs-label and not --fs-micro — it carries the answer, not a footnote — and
   both sit above the 12px Arabic floor. */
.gs-note {
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  font-size: var(--fs-label);
  color: var(--ink-2);
  line-height: var(--lh-body);
}
/* Empty between the first paint and the sync that fills it — an empty plate is
   a border with nothing in it, which reads as a bug rather than as a pending
   sentence. */
.gs-note:empty { display: none; }

/* ---------- the twin note under القياس ----------
   The same switch exists in the filter row. Saying so is cheaper than letting
   a user discover two controls for one setting and wonder which wins. */
.gs-twin {
  margin-top: 11px;
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- what the settings produce ----------
   The only three figures on the screen, and every خصم and every إضافي in the
   register is built from them. Figure large, name small and quiet beneath it —
   the KPI tile's hierarchy, at panel scale. */
.gs-rates {
  display: grid;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.gs-rate-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.gs-fact {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: var(--lh-tight);
}
.gs-fact b {
  font-size: var(--fs-num-lg);
  font-weight: var(--w-700);
  color: var(--ink);
}
.gs-fact span {
  font-size: var(--fs-micro);
  color: var(--muted);
}
.gs-rates-say {
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: 1.6;
}

.gs-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- who overrides all of this ----------
   Gold, and gold is not decoration here: it is the one reserved meaning in the
   palette — «this was set away from the layer above» — and that is precisely
   what both tiles count. The same hue marks the drawer's field edge and the
   rail's التخصيصات counter, so this panel needs no legend. */
.gs-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gs-tile {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
}
.gs-chip {
  background: var(--gold-soft);
  color: var(--gold-ink);
}
.gs-tile b {
  font-size: var(--fs-num-xl);
  font-weight: var(--w-700);
  line-height: 1.12;
  color: var(--ink);
}
/* 12px is the floor for Arabic chrome — ق ف ث merge below it. */
.gs-tile span { font-size: var(--fs-micro); color: var(--muted); line-height: 1.45; }

.gs-say {
  font-size: var(--fs-body);
  color: var(--ink-2);
  line-height: var(--lh-body);
}
.gs-say.is-mute { font-size: var(--fs-micro); color: var(--muted); }

/* ---------- the theme control's twin ----------
   The spine carries the same three states as icons alone. Here they are
   named, which is the only reason to repeat a control at all. A radiogroup
   marks its choice with aria-checked, where .seg's base marks aria-pressed. */
.gs-theme { width: 100%; }
.gs-theme button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gs-theme button svg { width: 15px; height: 15px; }
.gs-theme button[aria-checked="true"] {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  font-weight: var(--w-600);
}

/* ---------- narrow ---------- */
@media (max-width: 560px) {
  .gs-field, .gs-field.is-sig { grid-template-columns: minmax(0, 1fr); }
  .gs-field > label { grid-row: 1; }
  .gs-field > .gs-hint { grid-row: 2; }
  .gs-field .gs-ctl {
    grid-column: 1;
    grid-row: 3;
    display: block;
    margin-top: 3px;
  }
  .gs-field.is-sig .gs-ctl { display: flex; }
  .gs-tiles { grid-template-columns: 1fr; }
}

/* ---------- print ----------
   The rules that produced the figures belong in the printed report: an
   auditor reading a payroll sheet needs to know it was measured at 8 hours
   with 15 minutes of grace. The controls print; the things that only act
   on screen do not. */
@media print {
  .gs-cols { grid-template-columns: minmax(0, 1fr); }
  .gs-acts,
  .gs-theme,
  .gs-theme + .gs-hint { display: none; }
  .gs-group { break-inside: avoid; }
}

/* ============================================================
   Sections (2026-10-01). The screen is six sections, one shown at a
   time: a list of them at the inline start with a search over every
   setting's words, and the chosen section beside it. The list stays
   in view while the section scrolls.
   ============================================================ */
.gs-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.gs-nav {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  min-width: 0;
}
.gs-q .inp { height: var(--ctrl-h-sm); font-size: var(--fs-label); }
.gs-cats { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.gs-cat-b {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r);
  color: var(--ink-2);
  font: inherit;
  text-align: start;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.gs-cat-b:hover { background: var(--card-2); color: var(--ink); }
.gs-cat-b[aria-current="page"] { background: var(--sel); color: var(--ink); box-shadow: inset -3px 0 0 var(--accent); }
.gs-cat-i {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.gs-cat-i svg { width: 17px; height: 17px; }
.gs-cat-t { display: grid; gap: 1px; min-width: 0; }
.gs-cat-t > b { font-size: var(--fs-body); font-weight: var(--w-600); }
.gs-cat-t > span { font-size: var(--fs-micro); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gs-found { border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--card-2); overflow: hidden; }
.gs-found ul { margin: 0; padding: 4px; list-style: none; display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.gs-found button {
  display: grid;
  gap: 1px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  text-align: start;
  font: inherit;
  color: var(--ink);
}
.gs-found button:hover, .gs-found button:focus-visible { background: var(--sel); }
.gs-found button > b { font-size: var(--fs-label); font-weight: var(--w-500); }
.gs-found button > span { font-size: var(--fs-micro); color: var(--muted); }
.gs-found-none { margin: 0; padding: 8px 10px; font-size: var(--fs-label); color: var(--muted); }

.gs-pane { min-width: 0; }
.gs-sec { display: grid; gap: 16px; min-width: 0; }
.gs-sec-h { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.gs-sec-h h2 { margin: 0; font-family: var(--font-title); font-size: var(--fs-h2); font-weight: var(--w-title); color: var(--ink); }
.gs-sec-h p { margin: 2px 0 0; font-size: var(--fs-label); color: var(--muted); max-width: 820px; }
.gs-sec-h .gs-cat-i { width: 40px; height: 40px; }
.gs-sec-h .gs-cat-i svg { width: 20px; height: 20px; }
.gs-sec-b { display: grid; gap: 16px; min-width: 0; }

/* the payroll section keeps its side column only where the list leaves room */
.gs-pane .gs-cols { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1560px) {
  .gs-pane .gs-cols { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* a setting found by the search, lit for a moment */
.gs-lit { animation: gs-lit 2.2s var(--ease); border-radius: var(--r-sm); }
@keyframes gs-lit {
  0%, 40% { box-shadow: 0 0 0 3px var(--accent); background: var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 1180px) {
  .gs-shell { grid-template-columns: minmax(0, 1fr); }
  .gs-nav { position: static; }
  .gs-cats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* the payroll section's parts, one press away */
.gs-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-jump .btn { background: var(--card); }

.gs-app-logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-block-end: 8px;
}

/* ── 69-punches.css ─────────────────────────────── */

/* ============================================================
   البصمات اليدوية — the punch editor, and the marks a correction
   leaves behind it on the screens that list punches.

   Builds on .modal, .btn, .inp, .badge, .note, table.days and
   .punch. None of them is redefined here.

   Gold, and only gold, for what the user typed: DESIGN.md §6 gives
   that hue to «every customised thing» and nothing decorative, and a
   punch entered by hand is a customisation of the record in exactly
   that sense — a reader scanning the day list for what was not the
   device's finds it by colour alone.
   ============================================================ */

/* ---------- the marks on the day list ----------
   A corrected punch keeps its direction's fill and gains a gold dashed
   edge. Dashed and not solid, so the mark survives a printer that drops
   backgrounds and a reader who does not see the hue. */
.punch.is-man {
  outline: 1px dashed var(--gold-mark);
  outline-offset: -1px;
}

/* «✎ عدّل» — ends a day's punch record. A word beside the pencil and a
   border around both: the bare, muted glyph this started as was looked for
   by the owner and not found. Never hover-only — a control that appears on
   hover does not exist on a touch screen. */
.px-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  margin-inline-start: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--fs-micro);
  line-height: 1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.px-edit svg { width: 12px; height: 12px; color: var(--gold-mark); }
.px-edit:hover,
.px-edit:focus-visible { background: var(--card-2); border-color: var(--muted); color: var(--ink); }

/* The same word in the employee dialog's day table, in a narrow end column. */
.empd .px-col { width: 1%; white-space: nowrap; text-align: end; }
.empd .px-open svg { color: var(--gold-mark); }
.emp-days .detail-head { margin-bottom: 8px; }

/* The front door on الموظفون's card head: the pencil wears the gold that
   every hand correction wears. */
#btnPxAdd svg { color: var(--gold-mark); }

/* The day list's own head: its title, and «أضف بصمات ليوم آخر» at the
   far end of the same line. */
.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-head h4 { flex: 1 1 auto; margin: 0; }

/* الغياب's per-date button sits in its own narrow column at the row's end. */
.abs-days .px-col { width: 1%; white-space: nowrap; text-align: end; }
.abs-days .px-open { color: var(--ink-2); }
.abs-days .px-open svg { color: var(--gold-mark); }

/* ============================================================
   The dialog
   ============================================================ */

/* `.modal.pxd`, two classes: .modal is declared in 70-drawer.css, which is
   concatenated AFTER this file, so a single class here would lose to it on
   order at equal weight. */
.modal.pxd { gap: 12px; padding: 0; width: min(760px, 100%); }
.pxd .modal-body,
.pxd .modal-acts { padding-inline: 18px; }
.pxd .modal-acts { padding-block-end: 16px; align-items: center; }

.pxd-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
}
.pxd-id { flex: 1 1 auto; min-width: 0; }
.pxd-head h3 { font-size: 16.5px; line-height: var(--lh-title); }
.pxd-lead {
  margin-top: 4px;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.pxd-x { width: 30px; height: 30px; padding: 0; flex: none; }
.pxd-x svg { width: 16px; height: 16px; }

/* ---------- who ----------
   The person picker heads the body; with nobody chosen yet it is the whole
   of it, with one sentence under it saying what comes next. */
.pxd-pick {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}

/* ---------- the day, and the steps either side of it ---------- */
.pxd-day {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.pxd-date { flex: 1 1 auto; }
.pxd-day .btn { height: var(--ctrl-h); flex: none; }
/* The chevron points at the end of the line in RTL; «التالي» goes the
   other way, and a mirrored glyph is the honest spelling of that. */
.pxd-flip { transform: scaleX(-1); }

/* ---------- the punches ---------- */
.pxd-t { min-width: 0; }
.pxd-t td { padding-block: 6px; vertical-align: middle; }
.pxd-t .pxd-c-k { width: 124px; }
.pxd-t .pxd-c-t { width: 112px; }
.pxd-t .pxd-c-a { width: 1%; white-space: nowrap; text-align: end; }
.pxd-t .inp { height: var(--ctrl-h-sm); font-size: var(--fs-label); }
.pxd-t select.inp { padding-inline-start: 10px; }
.pxd-t input.inp.n { text-align: center; }

/* An unreadable time is said in the field itself as well as in the note
   below it — the note names the day, the border names the box. */
.pxd-t .inp[aria-invalid="true"] {
  border-color: var(--crit);
  box-shadow: 0 0 0 3px var(--crit-soft);
}

.pxd-c-s { font-size: var(--fs-label); color: var(--ink-2); }
.pxd-c-s .badge { vertical-align: 1px; }
.pxd-dev { color: var(--muted); }
.pxd-c-a .btn { color: var(--ink-2); }

/* A punch set aside is still listed — what the device said stays on the
   page — but struck, so it cannot be read as counted. */
.pxd-r.is-x .inp { text-decoration: line-through; }
.pxd-r.is-x td { color: var(--muted); }

/* An added row is the user's own, so its start edge carries the gold
   thread. A positioned ::before rather than box-shadow: inset, which has
   no logical form and would draw on the wrong edge in RTL — the trap
   61-absence.css records. */
.pxd-r.is-add td:first-child,
.pxd-r.is-edit td:first-child { position: relative; }
.pxd-r.is-add td:first-child::before,
.pxd-r.is-edit td:first-child::before {
  content: "";
  position: absolute;
  inset-block: 6px;
  inset-inline-start: 0;
  width: 2px;
  border-radius: var(--r-pill);
  background: var(--gold-mark);
}

.pxd-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pxd-hint {
  margin-inline-start: auto;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.pxd-avg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  color: var(--muted);
}

/* ---------- before and after ----------
   The engine's own day measurement over the device's punches and over the
   draft, one line each, so the effect of a correction is read before it
   is saved. */
.pxd-res {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: var(--fs-label);
}
.pxd-res-l { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pxd-res-l .l {
  min-width: 108px;
  color: var(--muted);
  font-weight: var(--w-600);
}
.pxd-res-l.is-now .l { color: var(--ink); }
.pxd-mode { font-size: var(--fs-micro); color: var(--muted); }

.pxd-pend {
  margin-inline-end: auto;
  font-size: var(--fs-label);
  color: var(--gold-ink);
  font-weight: var(--w-600);
}

@media (max-width: 620px) {
  .pxd-t .pxd-c-k { width: 96px; }
  .pxd-t .pxd-c-t { width: 88px; }
  .pxd-c-a .btn span { display: none; }
  .pxd-hint { margin-inline-start: 0; }
}

/* ---------- paper ----------
   The controls are the screen's; the page records what was decided. The
   gold edge on a corrected punch prints, and so does «تعديل يدوي». */
@media print {
  .px-edit,
  .px-open,
  .px-col { display: none !important; }
  .punch.is-man { outline: .6pt dashed var(--gold-mark); }
}

/* ── 70-drawer.css ─────────────────────────────── */

/* ============================================================
   The customisation drawer, التخصيصات — the ledger,
   dialogs, toasts, tooltip.
   ============================================================ */

/* ---------- the drawer ----------
   Non-modal by design: the register keeps recomputing behind it, and that is
   the entire case for not using a modal. --drawer-w, because the case only
   holds if the register stays readable — at 1440px this leaves 812px of table
   after the rail, and a 460px drawer would not. Below 1560px it becomes an
   overlay.

   It is one of the handful of objects in this design that genuinely float, so
   it is one of the few places a surface gets --r-xl, a border AND a shadow at
   once. A card on the bench gets the border alone.

   Structure is v5's, unchanged: head · scroll · foot. The foot carries the
   impact, the sentence, and ONE primary action beside cancel. */
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 60;
  width: var(--drawer-w);
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* so the head and the foot meet the radius */
  background: var(--card);
  /* The line and the radius go on the INNER edge — the one facing the
     register. In RTL the drawer sits at inset-inline-end, which is the
     physical left, so its inner edge is inline-start; a border on the other
     edge would be a hairline drawn against the viewport. */
  border-inline-start: 1px solid var(--line);
  border-start-start-radius: var(--r-xl);
  border-end-start-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  animation: dr-in var(--t-slow) var(--ease);
}
@keyframes dr-in {
  from { transform: translateX(-24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: color-mix(in srgb, var(--paper) 62%, transparent);
  backdrop-filter: blur(2px);
}
@media (min-width: 1560px) {
  .drawer-scrim { display: none; }
  /* Wide enough for both: the bench makes room for the drawer instead of
     being covered by it, which is what makes leaving the register live worth
     the engineering. In RTL padding-inline-end is the page's left side, and
     the left side is where the drawer is. */
  body.drawer-open .main { padding-inline-end: var(--drawer-w); }
}

.dr-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
/* a floating surface's title is a title: Kufi, like a dialog's */
.dr-head h3 {
  flex: 1;
  min-width: 0;
  font-family: var(--font-title);
  font-size: var(--fs-lead);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
}
.dr-x { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); }
.dr-x svg { width: 16px; height: 16px; }
.dr-x:hover { background: var(--card-2); color: var(--ink); }

.dr-scroll { flex: 1; overflow-y: auto; padding: 14px 16px; display: grid; gap: 14px; align-content: start; }
.dr-sub { font-size: var(--fs-label); color: var(--ink-2); line-height: var(--lh-body); }

/* ---------- the precedence ladder ----------
   The model stays on screen for as long as it is being edited: three
   connected steps, and the one being edited is FILLED with the accent rather
   than tinted by it. Fill and not tint, because at a glance the question the
   ladder answers is "which layer am I writing to", and a tint answers it at
   the same volume as the two layers that are only context. Steps take the
   control radius, not a pill: a pill is a status, and these are layers. */
.ladder {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;                      /* the connector lives in this gap */
}
.ladder li {
  position: relative;
  padding: 6px 8px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card-2);
  text-align: center;
  min-width: 0;
  line-height: var(--lh-cell);
}
.ladder li b { display: block; font-size: var(--fs-label); }
.ladder li i {
  display: block;
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--muted);
}
/* The connector points LEFT, because the reading order is right-to-left and
   precedence runs with it: عام ← إدارة ← موظف.

   inset-inline-END: 100%, which lands it in the gap BEFORE its own pill —
   between عام and إدارة, then between إدارة and موظف. Drawn from
   inset-inline-start it would sit in the gap AFTER the pill instead, which
   puts the last one outside the ladder altogether and leaves the first gap
   empty. Both are logical properties, so the whole thing mirrors if the app
   is ever localised LTR. */
.ladder li + li::after {
  content: "←";
  position: absolute;
  inset-inline-end: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  text-align: center;
  font-size: var(--fs-micro);
  line-height: 1;
  color: var(--muted);
}
.ladder .is-editing {
  background: var(--accent);
  border-color: var(--accent);
}
.ladder .is-editing b { color: var(--on-accent); font-weight: var(--w-600); }
.ladder .is-editing i { color: var(--on-accent); }
/* A layer that outranks the one being edited: gold, because what it means is
   "a customisation up there would win over what you type here". */
.ladder .is-below b { color: var(--gold-ink); }

/* ---------- the shadowed-employee strip ---------- */
.dr-shadow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold-mark) 34%, transparent);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
}

/* ---------- fields ---------- */
.dr-group { display: grid; gap: 10px; }
/* The group title is --ink and --w-700 where the field labels below it are
   --muted and --w-600: both are small, so the hierarchy between "which part
   of the rule" and "which setting" has to be carried by weight and value.
   Setting them at the same volume — as a section head at --muted would —
   flattens a fourteen-field form into one undifferentiated list. */
.dr-group h4 {
  font-size: var(--fs-label);
  color: var(--ink);
  font-weight: var(--w-600);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}

/* The group's own result sentence — today only الإضافي has one, where two
   switches make four states and the reader would otherwise have to multiply
   them. It sits under the heading, not beside a control, because it is the
   whole group's answer and not any one field's caption.

   Which is also why it may not look like a caption: .cap is 12px --muted under
   a control and the eye has learned to read it as «where this value came
   from». A sunken well and --ink-2 put this sentence with the heading above it
   instead. --fs-micro is the floor and not below it — the sentence runs to
   four lines in the balance model at 384px, and Arabic ق ف ث need the room. */
.dr-note {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: var(--fs-micro);
  line-height: var(--lh-body);
  color: var(--ink-2);
}

.dr-field {
  display: grid;
  /* 164px: the control column has to hold «الراتب ÷ الأيام ÷ الساعات» in a
     select AND the 32px revert button beside it. */
  grid-template-columns: 1fr 164px;
  align-items: center;
  gap: 3px 10px;
  padding-inline-start: 10px;
  position: relative;
}
/* DESIGN.md §4: --w-600 / --fs-label / --muted, zero tracking. The quiet
   label and the confident value is the reference's own form pattern and the
   same one the filter row uses — the ink in a field row belongs to what the
   control says, not to what it is called. --lh-cell, never 1.5: «المطلوبة»
   and «يومياً» carry ج and ى and this label wraps at two lines. */
.dr-field > label {
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  color: var(--ink-2);
  font-weight: var(--w-500);
}
.dr-ctl { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.dr-ctl .inp { min-width: 0; height: var(--ctrl-h-sm); font-size: var(--fs-label); }

/* The gold edge bar: the one carrier of "this value is customised". It is a
   graphical object that conveys content, so it uses --gold-mark (3:1+), never
   the decorative --gold-fill. */
.dr-field.is-own::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 2px;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--gold-mark);
}

.cap {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: 1.5;
}
.cap.is-own-cap { color: var(--gold-ink); }
.cap.is-mixed { color: var(--warn); font-weight: var(--w-600); }

/* Release ONE field back to inheritance. v1 could only wipe all thirteen.
   Sized to sit level with the 32px control rather than floating beside it. */
.dr-revert {
  width: var(--ctrl-h-sm); height: var(--ctrl-h-sm); flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--gold-ink);
  background: var(--gold-soft);
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dr-revert svg { width: 15px; height: 15px; }
.dr-revert:hover { background: var(--gold-soft); border-color: var(--gold-mark); }

/* ---------- the foot: impact, sentence, actions ---------- */
.dr-foot {
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
  background: var(--card-3);
  display: grid;
  gap: 9px;
}

/* ---------- the impact strip ----------
   Three mini KPI tiles, built from the same parts as the ones on نظرة عامة
   and carrying the SAME hues, because they report the same quantities: the
   drawer's before→after is «الموظفون» and «إجمالي الساعات» moving. A hue that
   means a measure on one screen and something else on another means nothing.
   The hue arrives through data-m on the tile — never named here. */
/* TWO columns, not three. The drawer is 384px wide and its foot has 36px of
   padding, so three equal tiles are 110px each — and «186,484.44 ر.س» does not
   fit in 110px at --fs-body. A money figure that ellipsises is worse than no
   money figure at all: «186,484.4…» is a number the reader cannot check and
   cannot tell is wrong. So the two counts share the first row and صافي المستحق
   takes the whole of the second, where it also gets the row layout its length
   wants. With payroll off there are two tiles and the row is simply full. */
.dr-impact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dr-imp {
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 7px 10px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  min-width: 0;
}
.dr-imp i {
  display: block;
  max-width: 100%;
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dr-imp-v {
  display: block;
  max-width: 100%;
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dr-imp-v b { font-size: var(--fs-micro); margin-inline-start: 4px; }

/* The money tile, alone on the second row: wide enough to lay its three parts
   out in a line instead of stacking them, with the figure at the far end —
   the same shape as the sentence under it, and the only tile in this strip
   whose value carries a unit. */
.dr-imp.is-wide {
  grid-column: 1 / -1;
  grid-auto-flow: column;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.dr-imp.is-wide .dr-imp-v { justify-self: end; text-align: end; }

.dr-say {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
  font-size: var(--fs-label);
  color: var(--ink-2);
  line-height: var(--lh-body);
}
/* Removing the customisation: a quiet door beside the sentence, never the
   footer's primary. Crit ink because it destroys; the filled .btn-danger waits
   inside the confirm it opens. */
.dr-remove { flex: none; color: var(--crit); text-decoration-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.dr-remove:hover { color: var(--crit); text-decoration-color: currentColor; }
.dr-acts { display: flex; gap: 8px; }
.dr-acts .btn { flex: 1; justify-content: center; }

/* The action pair inside a ledger cell. It is a DIV inside the <td> and never
   the <td> itself: a cell set to display:flex stops being a table cell, and
   the row rule every other cell draws as its border-bottom breaks off at that
   column. Same reason .cell-name is a div inside its cell. */
.row-acts { display: flex; gap: 6px; }

/* ============================================================
   التخصيصات — the ledger

   A read-only audit of every rule that exists, not a door: the editor opens
   from where the data is. Built entirely from .panel / .tbl / .badge — what
   is here is only the column measurement a fixed-layout table needs, because
   `table-layout: fixed` with no widths hands six very unequal columns exactly
   one sixth of the table each.
   ============================================================ */

.rl-stack { display: grid; gap: 16px; align-content: start; }

/* The floor is the sum of what is measured below, so .tw scrolls rather than
   letting «الإعدادات المخصَّصة» collapse to a badge and an ellipsis. */
.rl-t { min-width: 980px; }
.rl-t .rl-c-name { width: auto; min-width: 220px; }
.rl-t .rl-c-set  { width: auto; min-width: 250px; }
.rl-t .rl-c-num  { width: 104px; }
.rl-t .rl-c-num2 { width: 148px; }    /* «لهم استثناء أقوى» — a long header */
.rl-t .rl-c-via  { width: 168px; }
.rl-t .rl-c-act  { width: 92px; }
.rl-t .rl-c-act2 { width: 196px; }    /* تعديل + فكّ الاستثناء */

/* The badge counts, the names spell out. They are one cell because they are
   one fact, and the count has to stay readable when the names run out of
   room — so the badge is the part that may not shrink. */
.rl-set { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rl-set .badge { flex: none; }
.rl-set .rl-set-n {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

/* ============================================================
   Dialogs
   ============================================================ */

/* The scrim is the rail's midnight at half strength, in both themes — the one
   surface that is dark in both, so the dim keeps its meaning without a second
   declaration. A light blur: enough to push the page back, not enough to
   smear it into a photograph. */
.back {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--spine) 52%, transparent);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade var(--t) var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* A dialog is: a title, a body, and a footer with ONE primary action —
   cancel first in the DOM (it takes focus), the action after it, at the
   footer's end. */
.modal {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  /* --r-xl, not --r-lg: the radius is tiered by role and a dialog is in the
     same tier as the drawer — the things that genuinely float. A card on the
     bench is the one below it. */
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  animation: pop var(--t-slow) var(--ease);
}
@keyframes pop {
  from { transform: translateY(8px) scale(.99); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal.modal-wide { width: min(880px, 100%); }
.modal h3 {
  font-family: var(--font-title);
  font-size: 16.5px;
  font-weight: var(--w-title);
  line-height: var(--lh-title);
}
.modal-body { display: grid; gap: 10px; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-2); }
.modal-body b { color: var(--ink); }
.modal-list { display: grid; gap: 4px; font-size: var(--fs-label); color: var(--ink-2); }
.modal-list li { padding-inline-start: 14px; position: relative; }
.modal-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: .65em;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.modal-acts { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
/* askConfirm()'s o.go refused: the reason, said over what was typed */
.cf-say { color: var(--crit); font-weight: var(--w-500); margin: 0; }

/* ============================================================
   Toasts

   Anchored at the bottom inline-start so they never cover the register's
   money column.
   ============================================================ */

.toasts {
  position: fixed;
  inset-block-end: 16px;
  inset-inline-start: 16px;
  z-index: 90;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  padding-inline-start: 14px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink);
  overflow: hidden;
  animation: toast-in var(--t-slow) var(--ease);
}
/* the same reading-edge bar a notice carries: neutral for a confirmation,
   red for an error — an edge, never a filled slab */
.toast::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--accent);
}
.toast.is-err::before { background: var(--crit-2); }
@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.toast.out { opacity: 0; transform: translateY(6px); transition: all var(--t) var(--ease); }
.toast-body { display: flex; gap: 8px; flex: 1; min-width: 0; }
.toast-ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--crit); }
.toast.is-err { border-color: color-mix(in srgb, var(--crit) 34%, var(--line)); }
.toast-x {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.toast-x:hover { background: var(--card-2); color: var(--ink); }
.toast-x svg { width: 12px; height: 12px; stroke-width: 2.4; }

/* The hairline: a toast that vanishes mid-read is its own bug report, so the
   countdown is visible and hovering pauses it. An error toast has no bar,
   because it does not dismiss itself at all. */
.toast-bar {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  height: 2px;
  background: var(--muted);
  animation: toast-bar linear forwards;
}
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }

/* ============================================================
   Tooltip
   ============================================================ */

.tip {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--solid);
  color: var(--on-solid);
  box-shadow: var(--sh-2);
  font-size: var(--fs-micro);
  line-height: 1.5;
  max-width: 260px;
}
.tip.on { opacity: 1; transform: none; }

/* ── 70-v6-tune.css ─────────────────────────────── */

/* ============================================================
   70. التخصيص as a page (98-v6-tune.js)

   The drawer's own form (70-drawer.css), out of its overlay: the
   page's right column, its fields scrolling under a head and over a
   foot that stay put — «احفظ التخصيص» never leaves the screen — and
   the preview at the inline end (the left), sticky beside it.
   ============================================================ */
.tn {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(380px, 1.05fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.tn-form, .tn-prev { min-width: 0; }

.drawer.is-page {
  position: relative;
  inset: auto;
  z-index: auto;
  width: auto;
  max-width: none;
  height: calc(100vh - var(--ubar-h) - var(--phead-h) - 48px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  animation: none;
  transform: none;
}
.drawer.is-page .dr-x { display: none; }

.tn-prev {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  max-height: calc(100vh - var(--ubar-h) - var(--phead-h) - 48px);
  overflow-y: auto;
}
.tn-prev-h h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-title);
  font-size: var(--fs-h3);
  color: var(--ink);
}
.tn-prev-h p { margin: 2px 0 0; font-size: var(--fs-label); color: var(--muted); }
/* «مباشرة»: a dot that breathes while the preview follows the form */
.tn-live {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
  animation: tn-live 1.8s var(--ease) infinite;
}
@keyframes tn-live {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.tn-net {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.tn-net > span { font-size: var(--fs-label); color: var(--ink-2); }
.tn-net > b { font-size: var(--fs-num-xl); font-weight: var(--w-700); color: var(--ink); line-height: var(--lh-tight); }
.tn-net > i { font-style: normal; font-size: var(--fs-label); color: var(--muted); }
.tn-d { font-weight: var(--w-600); }
.tn-d.is-up { color: var(--good); }
.tn-d.is-down { color: var(--crit); }
.tn-d.is-0 { color: var(--muted); font-weight: var(--w-500); }

.tn-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-label); }
.tn-tbl th, .tn-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: start; }
.tn-tbl thead th { font-size: var(--fs-micro); font-weight: var(--w-500); color: var(--muted); }
.tn-tbl .n { text-align: end; white-space: nowrap; }
.tn-tbl tbody th { font-weight: var(--w-500); color: var(--ink-2); }
.tn-sub { display: block; font-size: var(--fs-micro); font-weight: var(--w-400); color: var(--muted); }
.tn-tbl td.tn-b { color: var(--muted); }
.tn-tbl td.tn-a { color: var(--ink); font-weight: var(--w-600); }
.tn-tbl tr.is-changed td.tn-a { background: var(--gold-soft); color: var(--gold-ink); }
.tn-tbl tr.is-quiet th, .tn-tbl tr.is-quiet td { font-size: var(--fs-micro); }
.tn-tbl tr.is-ded th { color: var(--m-8); }
.tn-tbl tr.is-add th { color: var(--m-7); }
.tn-tbl tr.is-sum th, .tn-tbl tr.is-sum td { border-bottom-color: var(--line); }
.tn-tbl tr.is-net th, .tn-tbl tr.is-net td { font-size: var(--fs-body); font-weight: var(--w-700); color: var(--ink); border-bottom: 0; }
.tn-people tbody th { font-weight: var(--w-500); }

.tn-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.tn-facts > div { padding: 8px 10px; border-radius: var(--r-sm); background: var(--card-2); }
.tn-facts dt { font-size: var(--fs-micro); color: var(--muted); }
.tn-facts dd { margin: 0; font-size: var(--fs-label); color: var(--ink); }
.tn-h4 { margin: 4px 0 0; font-size: var(--fs-label); font-weight: var(--w-600); color: var(--ink-2); }
.tn-note { margin: 0; font-size: var(--fs-label); color: var(--muted); }
.tn-note.is-warn { padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); }

@media (max-width: 1280px) {
  .tn { grid-template-columns: minmax(0, 1fr); }
  .tn-prev { position: static; max-height: none; }
  .drawer.is-page { height: auto; max-height: 75vh; }
}
@media print { #scTune { display: none !important; } }
.drawer.is-page .dr-impact { display: none; }

/* how the salary is computed — the bar at the top of the form */
.tn-kind { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); }
.tn-kind-l { font-size: var(--fs-label); font-weight: var(--w-600); color: var(--ink); }
.tn-kind-seg { display: flex; flex-wrap: wrap; }
.tn-kind-seg > button { flex: 1 1 auto; }
.tn-kind-say { margin: 0; font-size: var(--fs-label); color: var(--ink-2); }
.tn-kind-say.is-warn { padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); }
.drawer.is-page .dr-scroll { overflow-anchor: none; }

/* ── 71-missions.css ─────────────────────────────── */

/* ============================================================
   المهمات — the missions sheet, its fold, and the dialog that
   writes a mission.

   Builds on .panel, .panel-head, .kpis, .tbl, .bar, .cell-name,
   .cell-bar, .row-x, .detail-in, .detail-head, table.days, .seg,
   .check, .fld, .inp, .note, .badge and .btn, and on الإضافي's sortable
   header (.ot-sort, .ot-th-2, 63-ot.css). None of them is redefined
   here: what follows is only what a mission needs that an absence row
   does not.

   The mission's colour is the m-3 violet family, borrowed the way
   الغياب borrows m-4 teal for leave — no new token, because DESIGN §6
   says there is no sixth system. `data-m="3"` on a cell hands .bar and
   .avat the hue; the figures below name the -ink directly, as
   61-absence.css does for its leave column.
   ============================================================ */

/* Seven columns and a floor, for 61-absence.css's reason: past it .tw
   scrolls sideways rather than wrapping the headers to three lines.
   The floor is the sum of the sized columns plus the 260px the name may
   not go below — min-width on a <col> is not honoured under
   table-layout:fixed, so a floor set too low takes the difference out of
   the name column instead, silently. 68 + 260 + 140 + 124 + 132 + 112 + 108. */
.msn-t { min-width: 944px; }

.msn-t .msn-c-rk  { width: 68px; }    /* the rank and its expander, at three digits */
.msn-t .msn-c-emp { width: auto; min-width: 260px; }
.msn-t .msn-c-d   { width: 140px; }   /* a figure AND a bar */
.msn-t .msn-c-h   { width: 124px; }
.msn-t .msn-c-v   { width: 132px; }   /* money and its currency */
.msn-t .msn-c-i   { width: 112px; }   /* inside .grp's 20px opening */
.msn-t .msn-c-n   { width: 108px; }

/* Header labels wrap; cells do not. `.tbl.msn-t`, two classes, because the
   rule being overridden is `table.tbl thead th` at (0,1,3) and a plain
   `.msn-t thead th` is (0,1,2) — it would never apply, and a right-aligned
   Arabic header then clips from its START with no ellipsis to say so. */
.tbl.msn-t thead th {
  white-space: normal;
  vertical-align: bottom;
  line-height: var(--lh-cell);
}
/* A numeric header's sort button sits at the figure's end, as الإضافي's. */
.msn-t thead th.n .ot-sort { justify-content: flex-end; }

/* ---------- the rows ---------- */
.msn-t td.msn-c-rk { white-space: nowrap; }
/* The name cell is two lines and the shared cell rule clips to one, so
   this column alone is allowed to be as tall as its content. */
.msn-t td.msn-c-emp { white-space: normal; overflow: visible; }
/* see 61-absence.css: the selector has to outrank the shared row rule */
table.tbl.msn-t > tbody > tr > td { padding-block: 5px; }
table.tbl.msn-t > tbody > tr.detail > td { padding: 0; }

/* The two figures that ARE the mission — days and credited hours — carry
   its ink, as الغياب's leave column carries teal. Ink only: a filled cell
   would make a count look like a warning. */
.msn-t td.msn-fig b,
.msn-t td.msn-fig .num { color: var(--m-3-ink); }
/* The entries that moved nothing, and the one count on the row that asks
   the reader to look. */
.msn-t td.msn-idle .num {
  color: var(--warn);
  font-weight: var(--w-600);
}

/* ---------- the totals foot ----------
   The same ground as the sticky header, so the table is bracketed by its
   own chrome rather than trailing off into the page. */
.msn-t tfoot td {
  background: var(--card-3);
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  font-weight: var(--w-600);
  white-space: nowrap;
}
.msn-t tfoot td.msn-c-emp { color: var(--muted); }

/* The band's one caption that asks for something. */
.msn-band .msn-warn {
  color: var(--warn);
  font-weight: var(--w-600);
}

/* Every door into the mission dialog on this screen wears the mission's
   violet on its glyph — the word says where it goes, the colour says what
   it writes — except the filled primary, whose glyph is its label's. Kept
   to this screen: الموظفون and الغياب colour their own doors. */
.msn-panel .msn-open:not(.btn-primary) svg { color: var(--m-3-ink); }

/* ---------- the fold ----------
   The day list sits INSIDE a .tbl row, so the register's own cell rule —
   `table.tbl tbody td`, (0,1,3), nowrap + ellipsis + a 46px row's padding
   — reaches into it. The reason sentence and the note are the columns
   that must wrap, so the list takes its cells back at (0,3,1). */
.msn-dl { min-width: 760px; }
.tbl.msn-t .msn-dl td {
  padding: 7px 8px;
  white-space: normal;
  overflow: visible;
  vertical-align: middle;
  line-height: var(--lh-cell);
}
.msn-dl .msn-l-date { width: 104px; }
.msn-dl .msn-l-wd   { width: 84px; }
.msn-dl .msn-l-kind { width: 116px; }
.msn-dl .msn-l-got  { width: 88px; }
.msn-dl .msn-l-note { width: 22%; }
.tbl.msn-t .msn-dl td:nth-child(-n+4) { white-space: nowrap; }

/* The kind is a word in the mission's colour, the one mark a reader scans
   the list for — soft ground, violet ink, the pair .badge.is-* use. */
.msn-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--m-3-soft);
  border: 1px solid color-mix(in srgb, var(--m-3) 28%, transparent);
  color: var(--m-3-ink);
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  white-space: nowrap;
}
.msn-got {
  color: var(--m-3-ink);
  font-weight: var(--w-600);
}
.day-note.msn-ok { color: var(--m-3-ink); }

/* The two remedies sit under the reason that asks for them. */
.msn-l-why .day-note { display: block; }
.msn-fix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.msn-fix .btn { height: 26px; }
.msn-fix .px-open { color: var(--ink-2); }
/* The punch door wears the gold every hand correction wears, as it does
   on الغياب — it opens the punch editor, not this screen's dialog. */
.msn-fix .px-open svg { color: var(--gold-mark); }

/* «عدّل» and «احذف» in a narrow end column, never wrapping apart. */
.msn-dl .msn-acts { width: 1%; white-space: nowrap; text-align: end; }
.tbl.msn-t .msn-dl td.msn-acts { white-space: nowrap; }
.msn-acts .btn + .btn { margin-inline-start: 4px; }
.msn-acts .btn { height: 28px; }
.msn-del { color: var(--ink-2); }
.msn-del:hover { color: var(--crit); }

/* An entry a decision can still turn into money is the row that wants the
   eye. A positioned ::before and never `box-shadow: inset`, which has no
   logical form and drew down the middle of الغياب's RTL day list. */
.msn-dl tr.is-idle td:first-child { position: relative; }
.msn-dl tr.is-idle td:first-child::before {
  content: "";
  position: absolute;
  inset-block: 4px;
  inset-inline-start: 0;
  width: 2px;
  border-radius: var(--r-pill);
  background: var(--warn);
}

/* The sentence under the day list: the row's figures once more, and the
   absence the payslip still charges. Micro type, because it is read once. */
.msn-d-note {
  font-size: var(--fs-micro);
  color: var(--muted);
  line-height: var(--lh-cell);
}
.msn-d-note b { color: var(--ink-2); }
.msn-d-act { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- the empty state ---------- */
.msn-empty p { max-width: 58ch; }
.msn-kinds {
  display: grid;
  gap: 4px;
  max-width: 58ch;
  font-size: var(--fs-label);
  color: var(--ink-2);
  line-height: var(--lh-body);
}
.msn-kinds b { font-size: inherit; color: var(--m-3-ink); }
.msn-other { font-size: var(--fs-label); }
.msn-empty-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

/* The double-relief instruction after a save (83-missions.js,
   msnuiCarriedToast). toast()'s error form is the only one that stays on
   screen, and it is red; this one reports nothing that failed — a leave
   count now disagrees with the dates it was carried from — so it wears
   the gold that means exactly that everywhere else. Three classes, so it
   wins over `.toast.is-err` (70-drawer.css) whatever the file order. */
.toast.is-err.msd-carried {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold-mark) 40%, transparent);
}
.toast.msd-carried .toast-ico { color: var(--gold-mark); }
/* The button's name on one line — it is what the clerk goes looking for. */
.toast.msd-carried b { white-space: nowrap; }

/* ============================================================
   The dialog
   ============================================================ */

/* `.modal.msd`, two classes: this file loads after 70-drawer.css today,
   but a single class would win or lose against `.modal` on file order
   alone, and nothing here should depend on the build's sort. */
.modal.msd { gap: 0; padding: 0; width: min(700px, 100%); max-height: 90vh; }
.msd .modal-body { padding: 16px 18px; gap: 14px; }

.msd-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
}
.msd-id { flex: 1 1 auto; min-width: 0; }
.modal.msd .msd-head h3 { font-size: 16.5px; line-height: var(--lh-title); }
.msd-lead {
  margin-top: 4px;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.msd-x { width: 30px; height: 30px; padding: 0; flex: none; }
.msd-x svg { width: 16px; height: 16px; }

/* The actions stay in reach while a long picker scrolls under them: the
   save is the one control the whole form exists for. */
.msd .modal-acts {
  position: sticky;
  bottom: 0;
  z-index: 2;
  align-items: center;
  padding: 12px 18px 16px;
  background: var(--card);
  border-top: 1px solid var(--line-soft);
}
/* Edit mode's delete sits at the far start, away from the save it is not. */
.msd-del { margin-inline-end: auto; color: var(--crit); }
.msd-del:hover { border-color: var(--crit); color: var(--crit); background: var(--crit-soft); }

.msd-hint {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.msd-opt { color: var(--muted); font-weight: var(--w-400); }

/* ---------- who ---------- */
.msd-who-h { display: flex; align-items: baseline; gap: 10px; }
.msd-cnt {
  margin-inline-start: auto;
  font-size: var(--fs-label);
  color: var(--m-3-ink);
  font-weight: var(--w-600);
}
.msd-pick { display: flex; align-items: center; gap: 8px; }
.msd-pick .msd-q { flex: 1 1 auto; height: var(--ctrl-h); font-size: var(--fs-label); }
.msd-pick .btn { flex: none; }

/* The list scrolls inside the form: 144 names would otherwise push the
   dates and the save below the fold. */
.msd-list {
  display: grid;
  align-content: start;
  max-height: 228px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
/* Two classes: it overrides the shared .check (40-controls.css), and a
   single class would win on file order alone — the trap DESIGN §9 names. */
.check.msd-p {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-label);
}
.msd-p:hover { background: var(--card-2); }
.msd-p:has(input:checked) { background: var(--sel); }
.msd-pn {
  font-weight: var(--w-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.msd-pm {
  color: var(--muted);
  font-size: var(--fs-micro);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.msd-nohit {
  padding: 10px 8px;
  font-size: var(--fs-label);
  color: var(--muted);
}

/* Fixed people: their names, and the way back to the picker. */
.msd-fixed {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: var(--fs-label);
}
.msd-names { flex: 1 1 auto; min-width: 0; line-height: var(--lh-body); color: var(--ink-2); }
.msd-names b { color: var(--ink); font-weight: var(--w-600); }
.msd-names .msd-pm { font-size: var(--fs-label); }
.msd-fixed .btn { flex: none; }
.msd-fixed .btn svg { color: var(--m-3-ink); }

/* ---------- the kind ----------
   A radiogroup marks its choice with aria-checked, where .seg's base marks
   aria-pressed; the chosen kind wears the mission's violet. */
.seg.msd-kind { align-self: flex-start; }
.seg.msd-kind button { padding: 6px 18px; font-size: var(--fs-body); }
.seg.msd-kind button[aria-checked="true"] {
  background: var(--m-3-soft);
  border-color: color-mix(in srgb, var(--m-3) 28%, transparent);
  color: var(--m-3-ink);
  font-weight: var(--w-600);
}
.seg.msd-kind button:focus-visible { outline-offset: -2px; }

/* ---------- the dates ---------- */
.msd-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.msd-dates.is-one { grid-template-columns: minmax(0, 1fr); }
.msd-dates .inp { font-size: var(--fs-label); }

/* ---------- the hours ---------- */
.msd-hrs { display: flex; align-items: center; gap: 10px; }
.msd-hrs .inp { width: 128px; flex: none; }
/* An unreadable duration is said in the field itself as well as in the
   note below it — the note names the problem, the border names the box. */
.msd-hrs .inp[aria-invalid="true"] {
  border-color: var(--crit);
  box-shadow: 0 0 0 3px var(--crit-soft);
}
.msd-say { font-size: var(--fs-label); color: var(--m-3-ink); }
.msd-say-bad { color: var(--warn); }

/* ---------- what the save will do ----------
   The punch editor's before/after box, restated: one sentence per effect,
   and only the effects this save actually has. */
.msd-res {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
}
.msd-l { color: var(--ink-2); }
.msd-l.is-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--ink); }
.msd-l.is-main .l {
  color: var(--muted);
  font-weight: var(--w-600);
}
.msd-l.is-main b { color: var(--m-3-ink); }
.msd-l.is-warn { color: var(--warn); }
.msd-l.is-gold { color: var(--gold-ink); font-weight: var(--w-600); }

@media (max-width: 620px) {
  .msd-dates { grid-template-columns: minmax(0, 1fr); }
  .msd-pick { flex-wrap: wrap; }
  .msd-pick .msd-q { flex-basis: 100%; }
}

/* ---------- paper ----------
   The sheet records missions, not the controls that made them: the doors
   go (80-print.css takes .btn, .msn-open and the dialog), the column that
   held them goes with them, and the kind prints as its word inside its
   outline. */
@media print {
  .msn-t { min-width: 0; }
  .msn-dl { min-width: 0; }
  .msn-t .tune-i, .msn-d-act, .msn-fix, .msn-dl .msn-acts { display: none; }
  .msn-dl tr.is-idle td:first-child::before { display: none; }
  .msn-kind { border: .5pt solid currentColor; padding: 0 4pt; }
  .msn-t .bar, .msn-t .bar i, .msn-t .avat, .msn-t tfoot td, .msn-kind {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* The name button is a control on screen and plain text on paper. */
  .msn-t .nm-btn { color: var(--ink); }
}

/* ── 72-report.css ─────────────────────────────── */

/* ============================================================
   The report — تقرير الدوام والرواتب on paper.

   This is the stylesheet for #scReport: the sheet 85-report.js builds,
   paginates by hand and prints at one of three scopes — موظف, إدارة,
   الجهة كلها. #scReport carries `hidden` on screen and is revealed only for
   the duration of a print, so almost nothing here is ever seen on a monitor.
   Two things are: the scope picker inside the existing PDF dialog (§2), and
   the off-screen measuring container the paginator lays its blocks out in
   (§3.1).

   ── why the file is numbered 72 and not 82 ────────────────────
   build.py concatenates every stylesheet under src/styles into one sheet, in
   filename order. A report stylesheet numbered above 80 would cascade AFTER
   80-print.css and would silently outrank every unflagged rule in it — the
   paper palette, the pt type scale, the whole «chrome does not print» list —
   for any selector the two happened to share. Below it, this file wins
   nothing by accident: the four rules in §4 that must beat the print block
   earn it with specificity, and say so where they are written.

   ── why the metrics are NOT inside @media print ───────────────
   repPaginate() measures the report on SCREEN. It has to: `beforeprint` is
   synchronous and hands out no paged layout to measure against, so §5.2 of
   the contract lays the blocks out in a hidden container whose width is set
   in millimetres and reads offsetHeight after each one. mm and pt are
   ABSOLUTE units in both media — 1pt is 1/72in is 4/3 CSS px on a monitor as
   surely as on a sheet — which is the entire trick that makes an on-screen
   measurement predict a printed page.

   So every metric below is declared once, outside any media query, and
   applies in both media. Do not "tidy" this file by moving §3 inside the
   print block: the report would then measure at the app's screen scale (a
   14px body, a 12.5px label) and print at the paper scale (an 8.4pt body),
   every block would be measured about a third too tall, and every page break
   would land in the wrong place — on paper only, where nobody sees it until
   the sheet is in their hand.

   ── self-sufficiency (contract §7) ───────────────────────────
   The report declares its own ink, its own rules and its own weights rather
   than reaching for the app's palette. Two reasons. The report's ink is not
   the app's ink: paper is white, ink is near-black, and a rule is a grey
   hairline, none of which is derivable from a screen token. And a
   self-sufficient sheet cannot break when the app's palette is revised — it
   is being revised as this is written.

   ── the inner element vocabulary ─────────────────────────────
   CONTRACT §7 fixes the .rep-* class list and this file mints no name
   outside it, so the elements INSIDE a report block carry the meaning, the
   same way #exportMenu's rows do in 80-print.css. 85-report.js emits, and
   this file styles:

       <b>     the title of a block, or the figure a card reports
       <i>     the quiet second line under it, and the signature rule —
               a neutral inline box, never emphasis. 20-base.css resets
               font-style on <i> for the whole app, so nothing here has to
               undo an italic the design never asked for.
       <span>  a label, a caption line, one line of a footer
       <h4>    the heading of the appendix
       th/td   a real table, never divs pretending to be one

   ── there is no @page rule in this file, on purpose ──────────
   80-print.css already declares one (A4 landscape, 12mm), and
   repPageStyleOn(kind) injects <style id="repPage"> at runtime carrying the
   report's own — portrait with 14mm margins for a موظف sheet, landscape with
   12mm for the other two. That injected sheet is the last stylesheet in the
   document, so it governs. A third @page here would be a third voice in that
   argument, and which one won would depend only on filename order.
   ============================================================ */

/* ============================================================
   1. The report's tokens — the screen copy

   Five colours and four weights. The values are repeated verbatim inside
   @media print in §4, where they carry !important; the reason is written
   there. This copy is what the MEASURER resolves against: a token that
   existed only in the print block would leave `border-bottom: .75pt solid
   var(--rep-rule)` invalid at computed-value time during the measuring pass,
   which unsets the whole shorthand — border-style becomes `none` and the
   used width becomes 0. Every hairline in the report would measure as
   nothing and print as .4pt, and the error accumulates down a 40-row table.

   The ratios in the comments are computed, not estimated. test/contrast.py
   reads 10-tokens.css and nothing else, so these five are not machine-checked
   and the arithmetic is written down beside them instead: --rep-mute is the
   tightest pair at 5.44 on a band, and it carries no text below 7pt.
   ============================================================ */
:root {
  --rep-ink:   #0e1424;   /* 18.9 on the sheet · 17.6 on a band */
  --rep-mute:  #535d75;   /*  6.6 on the sheet ·  6.1 on a band */
  --rep-rule:  #d6dbe5;   /*  1.40 — a hairline, and never text */
  --rep-band:  #f4f6fb;   /*  1.07 on the sheet: the lightest tint a laser
                              still lays down. A banded row is an aid to the
                              eye tracking across thirteen columns; any
                              darker and it reads as a HIGHLIGHTED row on a
                              payroll sheet somebody signs. */
  --rep-paper: #ffffff;

  /* The program's own identity, carried onto paper: the midnight of its
     solid button and a royal one step darker than the screen's --accent, so
     it still separates from the midnight on a one-colour laser (midnight
     prints near-black, royal a mid grey). Midnight is structure — the
     letterhead rule, the table head, the total, the page number; royal is
     the marker — a section bar, the scope, a note. The tint is royal at 8%
     on white, the ground of the scope and of a sum. */
  --rep-navy:  #10142b;   /* 18.3 on the sheet; white on it 18.3 */
  --rep-royal: #2f3fc4;   /*  7.6 on the sheet — text-safe */
  --rep-tint:  #eceffd;   /*  1.13 on the sheet; royal on it 6.7 */
  --rep-on-navy: #ffffff;
  --rep-on-navy-2: #c3c9ee; /* the quiet line inside the navy card: 10.6 */

  /* The report's weights are its own, and this is not tidiness. The app's
     --w-* tokens drop a notch in dark mode (light type blooms on a dark ground)
     and 80-print.css puts them back at their light values on paper. The
     report is MEASURED in whatever theme the user has on and PRINTED at the
     paper values, so borrowing --w-700 would mean measuring a masthead at
     wght 640 and printing it at 700 — different glyph advances, and a title
     that fitted one line in the measurer taking two on the sheet.

     --rep-w-400 is the one that looks redundant, and it is the most important
     of the four. 400 is not a weight this file emphasises with: it is the
     weight of ORDINARY text — every td, every card label, .rep-meta,
     .rep-note, the signature cells, the footer — which is about nineteen
     glyphs in twenty on the sheet. It is declared because §3.1 has to PIN it.
     Left undeclared, all of that text inherited 20-base.css's
     `body { "wght" var(--w-400) }`, which is the APP's token: 380 on a
     dark-mode monitor and 400 on paper. The report then measured at one
     weight and printed at the other — the exact failure the three tokens
     above were minted to prevent, still live on the 95% of the sheet that
     none of them covered. */
  --rep-w-400: 400;
  --rep-w-500: 500;
  --rep-w-600: 600;
  --rep-w-700: 700;
}

/* ============================================================
   2. The scope picker, inside the existing PDF dialog (on screen)

   90-export.js's dialog already asks WHAT goes on the paper (.pdf-opts).
   This asks WHO the paper is about, which is the more dangerous question:
   the answer decides whether the sheet is one person's salary or 144
   people's. It is a radio group, never checkboxes — the three scopes are
   exclusive and a control that can express «موظف + الجهة كلها» would be
   lying about what REP.kind can hold.

   The markup, so the emitter and this file agree:

       <p class="lbl">نطاق التقرير</p>
       <div class="pdf-scope">
         <label class="check"><input type="radio" name="…" value="all">
           <b>الجهة كلها</b><i>كل الموظفين في الفترة</i></label>
         <label class="check">… إدارة …</label>
         <label class="check">… موظف …</label>
         <select class="inp" …>…</select>     ← who, once إدارة or موظف is picked
         <p class="note">…</p>                ← what the sheet may claim
       </div>
       <label class="check" id="pdfPlainWrap">… الشاشات كما هي …</label>

   One new class, deliberately: the select and the note are placed by
   spanning the grid rather than by inventing wrappers for them.

   THE FOURTH CHOICE SITS OUTSIDE THE GRID, and this section still has to
   reach it. 90-export.js emits a fourth radio in the SAME name="pdfKind"
   group — «الشاشات كما هي», the sectioned sheet every print made until now —
   and keeps it out of .pdf-scope deliberately, because a fourth cell in a
   three-column grid of scopes reads as a fourth scope. It is nonetheless one
   of four mutually exclusive choices, and four choices in one radio group
   that do not look alike are read as two unrelated controls. Left to .check
   alone it came out as a bare inline-flex row beneath three bordered cards,
   with its explanatory <i> at body size in the body colour and on the same
   line as its own title. So every rule below names it beside .pdf-scope
   .check.

   That id is the only id this file spells outside the print block, and it is
   spelled because the element carries no class of its own that it does not
   share with every checkbox in the dialog. If the emitter ever gives it a
   .pdf-scope wrapper of its own the first arm of each selector reaches it and
   the id arm becomes harmless duplication — the two arms are written to
   survive either markup.

   BEWARE THE NEAR-COLLISION. `#pdfScope` — id, camel — already exists: it is
   the «١٤٤ موظفاً · ٢٢ يوماً» line in .modal-acts, written by openPdfDialog().
   `.pdf-scope` — class, hyphen — is this picker. They are different objects
   and neither may be renamed into the other.
   ============================================================ */
.pdf-scope {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

/* .check comes from 40-controls.css as an inline-flex row. The picker needs
   two lines per choice — the scope and the sentence saying what it means —
   so the row becomes a two-column grid: the radio, then a text column the
   second line can sit under. Anything the emitter leaves as a bare text node
   lands in that same second column as an anonymous grid item. */
.pdf-scope .check,
#pdfPlainWrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: var(--fs-label);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
/* The three scopes are spaced by the grid's own `gap`. The fourth label is
   outside the grid, so its separation from it has to be declared here, or it
   sits flush against the bottom edge of the last card and reads as part of
   the grid it was deliberately kept out of. This is the one rule in the
   section that must NOT reach .pdf-scope .check: a margin on a grid item
   would push each of the three cards down inside its own cell. */
#pdfPlainWrap { margin-top: 8px; }

.pdf-scope .check:hover,
#pdfPlainWrap:hover {
  border-color: var(--muted);
}

/* A chosen scope is a filled control, not a ticked box in a list — same
   treatment .pdf-opts gives a chosen section, because the two rows of the
   dialog should read as one dialog. */
.pdf-scope .check:has(input:checked),
#pdfPlainWrap:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}
.pdf-scope .check b,
#pdfPlainWrap b {
  min-width: 0;
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
}
.pdf-scope .check i,
#pdfPlainWrap i {
  grid-column: 2;
  min-width: 0;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}

/* The «who» select and the note that states what the sheet may claim both
   span the whole row. A scope of إدارة is the one that most needs the
   sentence: those people's hours are their WHOLE attendance in the period,
   including days punched under another department's name. */
.pdf-scope .inp,
.pdf-scope .note,
.pdf-scope p {
  grid-column: 1 / -1;
  margin-top: 2px;
}

/* The same breakpoint .pdf-opts uses, so the two grids in one dialog collapse
   together rather than one at a time. */
@media (max-width: 520px) {
  .pdf-scope { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   3. The sheet itself — declared in BOTH media (see the header)
   ============================================================ */

/* ---------- 3.1 the page box, and the measurer that imitates it ----------
   The two share every metric that can change where a line wraps, because a
   measurement taken under different metrics than the print is not a
   measurement of anything.

   The widths are the CONTENT box of the @page repPageStyleOn() injects:
   landscape A4 at 12mm margins is 297 − 24 = 273mm, portrait at 14mm is
   210 − 28 = 182mm. §5.2 has repPaginate() set the width inline as well;
   the two agree, and if they ever disagree the inline value wins, which is
   the right way round — the paginator is the thing that has to be believed.

   Landscape is the default and portrait is the exception, keyed on
   body.pdf-person. That is deliberate: الإدارة (body.pdf-unit) and
   الجهة كلها (no third class of its own) are both landscape by the owner's
   decision, so the default covers two of the three scopes and a missing
   class degrades to the commoner sheet rather than to a broken one. */
.rep-page,
.rep-measure {
  box-sizing: border-box;
  width: 273mm;
  margin: 0;
  padding: 0;
  /* A column flex box, so .rep-foot can be pinned to the foot of the sheet
     with margin-top:auto on a short page. The measurer copies it because
     flex items do NOT collapse adjacent margins and block children DO: a
     measurer left as a block box would under-report every gap it measured
     by the smaller of the two margins around it. */
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 8.4pt;
  /* 1.62 is 10-tokens' descender floor, written out rather than borrowed:
     The text face (Cairo) has a natural line box of 1.5em, so ج ح خ ع غ م and a final ى clip at
     1.5. It must not be tightened to buy a row. */
  line-height: 1.62;
  /* The base weight, pinned here beside every other metric that can move a
     line break — and it moves more of them than any of the others, because it
     is the weight of every run of ordinary text on the sheet.

     Inherited instead, it arrives from 20-base.css's
     `body { "wght" var(--w-400) }`, and --w-400 is 380 under
     `:root:not([data-theme="light"])` while 80-print.css puts it back to 400
     on paper. repPaginate() measures ON SCREEN, so a dark-mode reader's report
     was broken into pages at 380 and printed at 400. Measured on the real
     bundle with the real font, that was the ONLY computed difference between
     the measuring pass and the printed page — one property on twenty-three
     elements — and one was enough. Arabic advances grow about 0.9% between the
     two weights, a 40mm cell that measured 49px printed 66px, six realistic
     boxes in a hundred gained a whole extra line, and repLayout() closes a
     page with at most one row of slack left in it. A page that gains a line
     overruns its 186mm content box, Chrome fragments it, and the sheet whose
     footer reads «صفحة ١ من ٤» comes out on two pieces of paper — with the
     page numbers naming sheets that no longer exist.

     It flattens nothing. The b/strong/th floor below, and every .rep-* rule
     that wants another weight, declare it ON the element; a declared value
     beats an inherited one at any specificity, so this is a base, not a cap. */
  font-weight: var(--rep-w-400);
  color: var(--rep-ink);
  /* Columns of figures align on the digit, not on the glyph's own width —
     this is what makes a payroll column readable at 7.6pt. */
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
body.pdf-person .rep-page,
body.pdf-person .rep-measure {
  width: 182mm;
}

/* min-height belongs to the PAGE and must never reach the measurer: §5.2
   reads offsetHeight as blocks are appended, and a measurer with a floor of
   184mm would report 184mm for the very first block and hand the paginator a
   full page before it had measured anything.

   These two floors are the FALLBACK, not the operating value. 85-report.js's
   repPageStyleOn() writes the real one into `<style id="repPage">` from
   repPageMM(), because it has to agree with the paginator's break limit and
   because it differs by scope. These apply only if that element is missing.

   They are deliberately far under the 186mm (269mm portrait) content box.
   184mm was the shipped value and it was wrong: with «الرؤوس والتذييلات» left
   on in the print dialog, the browser lays its own date and file:// lines
   inside the @page margin and shrinks the content box to about 174mm — so a
   floor of 184mm overflowed the sheet with NO content in the page at all, and
   the footer alone spilled onto a sheet of its own. See REP_CHROME_MM in
   85-report.js for the whole account. */
.rep-page {
  min-height: 168mm;
  background: var(--rep-paper);
  break-inside: avoid;
}
body.pdf-person .rep-page { min-height: 251mm; }

/* Every page but the last opens a new sheet. :last-child and not a class,
   so the paginator cannot forget to mark the last one — and so a report that
   ends up with exactly one page prints on exactly one sheet.

   break-inside:avoid above is a safeguard and not the mechanism: because
   every .rep-page but the first already starts at the top of a sheet, there
   is nowhere for the browser to move an over-tall one to, so the flag can
   only be honoured or ignored — it can never cost a blank sheet. The blocks
   that genuinely must not be torn carry their own, below. */
.rep-page:not(:last-child) { break-after: page; }

/* The off-screen measuring container (contract §5.2).

   `left`, physically, and not inset-inline-start: in an RTL document the
   inline start is the RIGHT edge, and the overflow that is reachable by
   scrolling is the one past the inline END — the left. This box is therefore
   on the scrollable side, which is the price of the contract's own wording;
   it is bounded because repPaginate() appends, measures and removes the
   container inside one synchronous pass with no paint between, so the
   scrollbar it could imply is never presented. Do not add `contain` to it:
   its useful neighbour `contain: size` zeroes the very offsetHeight the pass
   reads.

   visibility:hidden rather than display:none, because a display:none box has
   no layout and therefore no height to read — which is the one thing this
   element exists to provide. */
.rep-measure {
  position: absolute;
  visibility: hidden;
  left: -10000px;
  top: 0;
}

/* 20-base.css's `h1,h2,h3,h4,b,strong,th { font-weight: var(--w-600) }`
   would reach anything in the report this file does not name — at the APP's
   weight token, which may differ between a dark-mode monitor and the sheet,
   and a different weight is a different glyph advance in the measurer than
   on the page. This is the floor that stops it. Both prefixes are listed
   because §5.2 does not say whether the measurer is handed whole .rep-page
   boxes or the loose blocks that are about to become one, and a weight that
   holds in only one of the two is a measurement that is right half the time.

   :where() is load-bearing here and the rule is wrong without it. A plain
   `.rep-page h1` is (0,1,1) and .rep-title is (0,1,0), so the floor would
   OUTRANK the component that is meant to set the exception and the report's
   own title would print at 600 — it did, until this was measured in a
   browser. :where() contributes nothing to specificity, which leaves this
   rule at (0,1,0): above 20-base.css's bare element selectors at (0,0,1),
   level with a bare .rep-* class — which is written later in this file and
   therefore wins on order — and below anything named more tightly. A floor
   is supposed to lose to everything above it. */
.rep-page :where(b, strong, th, h1, h2, h3, h4),
.rep-measure :where(b, strong, th, h1, h2, h3, h4) {
  font-weight: var(--rep-w-600);
}

/* The app's semantic ink does not follow the data onto the report. Red for a
   deficit and green for a surplus are a screen shorthand; on an office
   monochrome laser they are the same grey, and the sign inside the <bdi>
   already carries the meaning. The report restates them in its own ink so
   the sheet has exactly one palette.

   THE FLAG IS THE RULE, and it is not about specificity. 80-print.css already
   declares `@media print { .pos, .neg { color: var(--ink) !important } }`, and
   an important author declaration beats a normal one at ANY specificity — the
   cascade settles origin-and-importance before it ever looks at a selector. So
   an unflagged rule here, however tightly written, WON on the screen, where
   the report is visible for sixty milliseconds and the colour does not matter,
   and LOST on the paper, which is the one medium it was written for: the sheet
   printed the app's --ink and the sentence above it was simply untrue. .mute
   and .cur need no flag — 20-base.css declares both at (0,1,0) and normal, and
   80-print.css declares neither. */
.rep-page .pos,
.rep-page .neg,
.rep-measure .pos,
.rep-measure .neg {
  color: var(--rep-ink) !important;
}
.rep-page .mute,
.rep-page .cur,
.rep-measure .mute,
.rep-measure .cur {
  color: var(--rep-mute);
}

/* ---------- 3.2 the masthead ----------
   Contract §5.3, in order: the letterhead row (logo · الجهة · الإدارة
   الفرعية · the reference), a hairline, the title, the scope, the period.

   It is repeated at the top of EVERY page and not only the first. A loose
   sheet from the middle of a report is the normal way one of these is read,
   and a sheet of figures that does not say whose figures they are is the one
   document this program must never produce. */
.rep-head {
  flex: none;
  padding-bottom: 6pt;
  margin-bottom: 9pt;
  /* The letterhead carries the heavy rule (below); the masthead closes on a
     hairline, so the eye reads one block — letterhead, title, scope — and
     then the body. */
  border-bottom: .6pt solid var(--rep-rule);
  break-inside: avoid;
  break-after: avoid;
}

/* The letterhead row. flex-wrap with a full-basis .rep-sub means the block
   lays out correctly whether the emitter wraps الجهة and الإدارة in a div
   (the sub is then a plain block inside it and its flex values are ignored)
   or drops them straight into the row (the sub takes its own line). */
.rep-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 9pt;
  row-gap: 1pt;
  padding-bottom: 5pt;
  /* The one heavy line of the sheet: midnight, the program's own ink — the
     line a letterhead is recognised by across a desk. */
  border-bottom: 2.2pt solid var(--rep-navy);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* The anonymous wrapper 84-brand.js's brandHeadHtml() puts the two names in —
   and NOTHING else in the letterhead. The `:not([class])` is the rule, not a
   refinement of it. Written as a bare `.rep-brand > div` this is (0,1,1), and
   85-report.js emits the reference as `<div class="rep-ref">` straight into
   this same flex row, so the wrapper's `flex: 1 1 auto; min-width: 0` outranked
   .rep-ref's own (0,1,0) `flex: none` and the reference silently became a
   growing, shrinkable item. On a wide letterhead that is invisible — the auto
   margin and `text-align: end` still carry it to the edge — but on a narrow one
   the reference is the item that gets squeezed, and «دف-20260921-3f9a» is a
   token whose whole job is to be quoted back off the sheet intact.

   [class] is a safe test for «anonymous name column or named component»
   precisely because CONTRACT §7 fixes the .rep-* list: no fourth classed name
   can appear inside this row without the contract being reopened. It also
   makes the hazard brandHeadHtml() documents disappear — with the names dropped
   straight into the row rather than wrapped, .rep-sub's own `flex: 1 1 100%`
   now applies and they stack instead of running together on one line.

   brandHeadHtml()'s doc comment cites this selector by its old specificity,
   (0,1,1). It is (0,2,1) now, and the wrapper it describes is unclassed, so
   nothing about that function changes — only the figure quoted in its prose. */
.rep-brand > div:not([class]) {
  flex: 1 1 auto;
  min-width: 0;
}

/* Always an <img>, never an inline <svg> (contract §1.7): 20-base.css sets
   `svg { stroke: currentColor }` and stroke INHERITS, so an inlined emblem
   would print as an outline of itself. An <img> is a replaced element that
   page CSS cannot cascade into, which is exactly why brandLogoImgHtml()
   returns one.

   14mm tall, and the 600px longest edge §4.1 stores is ≈1090dpi at that
   height — far above any office laser, so the emblem never prints soft. The
   height is fixed and the width follows, so a wide emblem cannot push the
   reference off the row; max-width stops an extreme one from trying. */
.rep-logo {
  flex: none;
  width: auto;
  height: 14mm;
  max-width: 42mm;
  object-fit: contain;
}
.rep-org {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-title);
  font-size: 12.5pt;
  line-height: 1.5;
  font-weight: var(--rep-w-700);
  color: var(--rep-navy);
}
.rep-sub {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 9pt;
  line-height: 1.5;
  font-weight: var(--rep-w-500);
  color: var(--rep-mute);
}

/* The reference and the issue date, where §5.3's diagram puts them: the
   trailing edge of the letterhead, opposite the organisation's name. An auto
   margin on the inline start carries the block there and `end` aligns its two
   lines against that same edge — both logical, so the pair is the LEFT edge
   in this RTL sheet and would mirror without a second rule if the app were
   ever localised the other way. The figures are tabular for one reason: a
   reference and a date printed a month apart should line up when the two
   sheets are laid side by side. */
/* A small boxed slip — the reference is the thing quoted back off the sheet,
   so it is set apart as a thing, not left as a loose line. The reference in
   royal, the issue date under it in the quiet ink. */
.rep-ref {
  flex: none;
  /* fit-content for the old sectioned sheet, where the slip sits in a block
     box (90-export.js #repFoot) and would otherwise run the full width */
  width: fit-content;
  margin-inline-start: auto;
  padding: 2pt 7pt 2.4pt;
  border: .6pt solid var(--rep-rule);
  border-inline-start: 2.2pt solid var(--rep-royal);
  background: var(--rep-band);
  text-align: start;
  font-size: 7.2pt;
  line-height: 1.6;
  color: var(--rep-mute);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.rep-ref b {
  display: block;
  font-size: 8pt;
  font-weight: var(--rep-w-700);
  color: var(--rep-royal);
  letter-spacing: .02em;
}
.rep-ref span { display: block; }

/* The title in the program's title face, at the start edge like every
   heading in the program — a centred title is a certificate; this is a
   working document. */
.rep-title {
  margin-top: 8pt;
  text-align: start;
  font-family: var(--font-title);
  font-size: 16pt;
  line-height: 1.5;
  font-weight: var(--rep-w-700);
  color: var(--rep-navy);
}

/* THE SCOPE LINE IS NOT DECORATION.

   DESIGN's standing rule — a filtered figure must never be mistakable for a
   total — is the one a report is most at risk of breaking, because a report
   IS a filtered view by construction and the paper carries no filter row
   above it to explain itself. So the scope is boxed, banded and set at 10pt
   in the middle of every masthead, where it cannot be read past. It is the
   difference between «هؤلاء موظفو الإدارة» and a sheet that looks like the
   whole organisation's payroll. */
.rep-scope {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 5pt 0 0;
  padding: 2.2pt 10pt 2.2pt 12pt;
  border-inline-start: 3pt solid var(--rep-royal);
  background: var(--rep-tint);
  text-align: start;
  font-size: 9.6pt;
  line-height: 1.55;
  font-weight: var(--rep-w-600);
  color: var(--rep-navy);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* A page after the first has no title: the scope is the first thing under
   the letterhead and needs the title's gap. */
.rep-brand + .rep-scope { margin-top: 7pt; }
.rep-meta {
  margin-top: 4pt;
  text-align: start;
  font-size: 7.8pt;
  line-height: 1.62;
  color: var(--rep-mute);
}

/* ---------- 3.3 the body ----------
   A block box inside the page's flex column, not a nested flex container: if
   a measurement is ever off by a line the block box spills onto the next
   sheet, where a flex container would be liable to clip it. flex:1 1 auto
   makes it absorb the free space on a short page, which is what carries the
   signature block and the footer down to the bottom of the sheet. */
.rep-body {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
}
/* The gap between whatever the body happens to hold — cards, a table, the
   appendix — set here rather than on each component, because the emitter
   composes this list and this file does not know its order. */
.rep-body > * + * { margin-top: 7pt; }

/* ---------- 3.4 the figure cards ----------
   Four across the landscape sheet and two across the portrait one. A card is
   bounded by its rule, never by a corner and never by a shadow: on paper a
   shadow is a grey smear and a radius is a printer artefact. */
.rep-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5pt;
}
body.pdf-person .rep-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* A card is a tinted slab with a royal edge on its start side — the same
   marker as a section heading, so the eye learns one sign. */
.rep-card {
  min-width: 0;
  padding: 4pt 8pt 5pt;
  border-inline-start: 2.2pt solid var(--rep-royal);
  background: var(--rep-band);
  break-inside: avoid;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* `>` and not a descendant: the label is the card's own <span>, and the
   currency regMoney() puts beside a figure is a <span class="cur"> inside the
   <b>, which a descendant rule turned into a block of its own — رمز العملة on a
   line under every amount. */
.rep-card > span {
  display: block;
  font-size: 7.2pt;
  line-height: 1.5;
  font-weight: var(--rep-w-500);
  color: var(--rep-mute);
}
.rep-card b {
  display: block;
  margin-top: 1pt;
  font-size: 13pt;
  line-height: 1.35;
  font-weight: var(--rep-w-700);
  color: var(--rep-navy);
}
.rep-card i {
  display: block;
  font-size: 6.8pt;
  line-height: 1.5;
  color: var(--rep-mute);
}
.rep-card b .cur {
  margin-inline-start: 2.5pt;
  font-size: 7.4pt;
  font-weight: var(--rep-w-500);
}
/* The last card of a strip is the bottom line of the sheet — المستحق on a
   salary report, the headcount on a list — every emitter in 85-report.js
   and 97-v6-lists.js closes its strip with it. Midnight with white figures:
   the one dark block on the page, where the eye should land last. */
.rep-cards > .rep-card:last-child {
  background: var(--rep-navy);
  border-inline-start-color: var(--rep-royal);
}
.rep-cards > .rep-card:last-child b { color: var(--rep-on-navy); }
.rep-cards > .rep-card:last-child > span,
.rep-cards > .rep-card:last-child i,
.rep-cards > .rep-card:last-child .cur,
.rep-cards > .rep-card:last-child .mute { color: var(--rep-on-navy-2); }

/* ---------- 3.5 tables ----------
   border-collapse, unlike the app's .tbl: on a sheet a single hairline
   between two rows is a ruled table, and two abutting borders at .4pt each
   print as a smudge at 300dpi.

   table-layout:auto, also unlike the screen: the column count changes with
   the scope and with payroll on or off, and letting the engine distribute
   what is actually there beats a set of guessed percentages that stop adding
   up the moment a column is dropped. */
.rep-tbl {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  font-size: 7.6pt;
  line-height: 1.62;
}
/* The portrait sheet carries a موظف's own days: far fewer columns, so the
   type can come back up to something a person reads rather than scans. */
body.pdf-person .rep-tbl { font-size: 8.2pt; }

/* A table that is split across pages repeats its header — that is the whole
   point of table-header-group — and the continuation says «تابع» in its
   caption so a loose sheet is never mistaken for a fresh table. */
.rep-tbl thead { display: table-header-group; }
.rep-tbl tr { break-inside: avoid; }
.rep-tbl caption {
  caption-side: top;
  text-align: start;
  padding-bottom: 3.5pt;
  font-size: 9.6pt;
  line-height: 1.5;
  font-weight: var(--rep-w-700);
  color: var(--rep-navy);
}
/* The section marker: a royal bar at the start of every table's heading. A
   pseudo-element rather than a border, so the bar is the height of the
   words and not of the caption's padding. */
.rep-tbl caption::before {
  content: "";
  display: inline-block;
  width: 3pt;
  height: .95em;
  margin-inline-end: 5pt;
  vertical-align: -.1em;
  background: var(--rep-royal);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* «تابع» is a <span class="rep-cont"> INSIDE the caption, not a class on the
   caption element. No display is set here, so the marker behaves as whatever
   carries it; only the box is sized, for one word. */
.rep-cont {
  margin-inline-start: 6pt;
  padding: 0 5pt;
  border-radius: 2pt;
  background: var(--rep-tint);
  font-size: 7pt;
  font-weight: var(--rep-w-600);
  color: var(--rep-royal);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.rep-tbl th,
.rep-tbl td {
  padding: 2.5pt 4.5pt;
  border-bottom: .4pt solid var(--rep-rule);
  vertical-align: middle;
  text-align: start;
  /* A truncated employee name on a payroll sheet is worse than a tall row:
     there is no hover on paper to reveal what the ellipsis ate.

     break-word and NOT anywhere — 20-base.css's own setting for the whole app,
     and the only safe one under the `table-layout: auto` above. The two behave
     identically once a box has a width; they differ in what a box contributes
     to MIN-CONTENT, and min-content is the figure the auto table algorithm
     distributes width from. `anywhere` drops a cell's min-content to a single
     character, so on an over-constrained thirteen-column payroll sheet the
     engine is free to hand «الراتب المستحق» less width than the figure standing
     in it and break 12,450.00 across two lines inside its own <bdi class="num">
     — a broken number on a sheet somebody signs. `break-word` keeps the
     unbroken run as the column's floor: the money and time columns hold their
     width, the name column absorbs the squeeze (it can afford to, every name in
     it has spaces), and a long unbroken id run still breaks rather than
     overflowing, which is all this declaration was ever here to do. */
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
}

/* THIS RULE IS LOAD-BEARING, and it is here because of a specificity tie.
   20-base.css declares `td.n, th.n { text-align: end }` at (0,1,1) — exactly
   the specificity of `.rep-tbl td` above, and 20-base is concatenated FIRST,
   so `text-align: start` would win and every figure in the report would
   align under the wrong edge of its column. (0,2,1) settles it. */
.rep-tbl th.n,
.rep-tbl td.n {
  text-align: end;
}

/* A figure is one word on paper, and a date is a figure. «2026-08-02» may
   break at its hyphens, and the auto layout above hands the narrow columns
   their min-content whenever one long cell claims the width — so a day table
   whose «الحالة» carried a mission's reason printed every date on two lines,
   «2026-08-» over «02». nowrap on num()'s own isolate and nothing wider: the
   words round it still wrap, and every other figure on the sheet (money,
   times, counts) has no break opportunity inside it to lose. */
.rep-tbl td bdi.num { white-space: nowrap; }

/* The head is midnight with white words — it repeats on every sheet a table
   crosses (table-header-group, above), so it is also what tells a reader at
   a glance that the table continues. */
.rep-tbl thead th {
  padding-top: 3.2pt;
  padding-bottom: 3.2pt;
  border-bottom: 0;
  background: var(--rep-navy);
  font-size: 7pt;
  line-height: 1.5;
  color: var(--rep-on-navy);
  font-weight: var(--rep-w-600);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* The band is the lightest tint in §1 and it is an aid to the eye tracking
   across a wide row, nothing more. print-color-adjust on the cells and not
   on the row: a <tr> has no background box of its own to force. */
.rep-tbl tbody tr:nth-child(even) td {
  background: var(--rep-band);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* The totals line. It is the ONE row on the sheet that is a sum, so it is
   ruled off above and set in the heavy weight — and it is never banded,
   because a total that looks like every second row is a total nobody finds.

   ── why this rule does not say `tfoot` ────────────────────────
   It did, and it selected nothing at all. repTbl() carries opt.total INSIDE
   <tbody> on purpose and says so in its own doc comment, because that is what
   survives the splitter: repTableShell() builds a continuation table by
   cloning the caption, the colgroup, the <thead> and an EMPTY <tbody>, and it
   clones no <tfoot>. A total parked in one would simply not be copied onto the
   sheet it belongs on — and on a table short enough never to split it would be
   a footer GROUP, which the browser is entitled to repeat.

   So there is no <tfoot> in this report to style. The total fell through to
   the zebra rule above instead, and on a department of FIVE people — where the
   total is tbody child six — it printed tinted, at --rep-w-600, under the
   ordinary .4pt hairline; six people and the same total printed clean. A sum
   whose appearance is decided by the parity of the headcount is precisely the
   «total nobody finds» this rule was written against.

   ── how the row is named instead ──────────────────────────────
   By the one thing that makes it a total: repTbl() wraps every non-empty cell
   of that row in <b>, and no data cell anywhere carries a <b> as its OWN
   child. Emphasis inside a data cell rides one level down, inside a <span> —
   the day table's «تعديل يدوي» is `<span><b>…</b></span>` for exactly this
   reason: written bare, it ruled off the last day of every page chunk as a
   sum. Every data cell reaches the page through num(), nameHtml() or
   regMoney(), and each of those emits a <bdi> around esc()'d text — so a <b>
   child of a <td> cannot be forged by workbook content either. It can only
   be opt.total.

   `:last-child` is joined to it because the total is always the last row of
   its tbody; `tbody tr:last-child` ALONE is the trap, and the reason this is
   spelled out here. The splitter gives every continuation chunk its own tbody,
   so that selector also matches the last DATA row of every page but the last,
   and would rule off and un-band a row that sums nothing — a subtotal the
   reader would look for and not find.

   No class is minted for the row. CONTRACT §7 fixes the .rep-* list, and a
   class would make the appearance of the sum depend on two files staying in
   agreement, which is the failure being repaired here and not a cure for it.

   The arithmetic, because it is what keeps the band off: :has() contributes
   the specificity of its argument, `> td > b` at (0,0,2), so the selector is
   (0,2,5) against the zebra rule's (0,2,3). The heavy weight is set on the <b>
   as well as on the cell, because §3.1's floor declares a weight on b/strong/th
   directly and a value declared on the element beats one inherited from its
   parent — setting it only on the <td> is what left the total at 600.

   If a browser without :has() ever opens this file the two rules below drop
   out together and the total prints as an ordinary row, which is the state the
   sheet was already in. That is also why the zebra rule above deliberately
   carries no `:not(:has(…))` exclusion: written that way, the same missing
   support would strip the banding from every table in the report instead. */
.rep-tbl tbody tr:last-child:has(> td > b) > td {
  border-top: 1pt solid var(--rep-navy);
  border-bottom: 1pt solid var(--rep-navy);
  background: var(--rep-tint);
  color: var(--rep-navy);
  font-weight: var(--rep-w-700);
}
.rep-tbl tbody tr:last-child:has(> td > b) > td > b {
  font-weight: var(--rep-w-700);
}

/* ---------- 3.6 the appendix and its note ----------
   The owner's decision (contract §3): people who punched under this
   department's name but belong to another are listed BELOW the
   signature-bearing totals and explicitly outside them. The 1.2pt ink rule
   is that «outside» made visible — it is heavier than any rule inside the
   table above it, so the eye reads a new document rather than a continuation
   of the last one. If the set is empty the emitter omits the whole block; it
   is never printed empty, which is why nothing here styles an empty state. */
.rep-appendix {
  margin-top: 9pt;
  padding-top: 6pt;
  border-top: 1.2pt solid var(--rep-navy);
}
.rep-appendix h4 {
  font-family: var(--font-title);
  font-size: 9.6pt;
  line-height: 1.6;
  font-weight: var(--rep-w-700);
  color: var(--rep-navy);
}
.rep-appendix .rep-tbl {
  margin-top: 4pt;
  font-size: 7.2pt;
}
/* body.pdf-unit is the إدارة sheet, and the appendix only ever appears on
   one. The rule is ADDITIVE — the appendix is fully styled without it — so a
   missing body class costs a millimetre of emphasis and never silently drops
   a table the contract says must be printed. */
body.pdf-unit .rep-appendix { border-top-width: 1.6pt; }

/* One line, and it must be read: this table is for information and is not
   counted in anything above it. */
.rep-note {
  margin-top: 3pt;
  padding: 3pt 8pt;
  border-inline-start: 2.2pt solid var(--rep-royal);
  background: var(--rep-tint);
  font-size: 7.4pt;
  line-height: 1.62;
  color: var(--rep-ink);
  break-inside: avoid;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ---------- 3.7 the signature block ----------
   Printed once, at the end of the last page, and never split (contract
   §5.4). A signature block torn across a fold is a document nobody can
   certify, which is why break-inside:avoid is on the block AND on each cell.

   One cell per entry in BRAND.sig, so the column count is whatever the
   الإعدادات panel was left holding — grid-auto-flow:column with
   1fr auto-columns takes two cells or five without a media query. An empty
   BRAND.sig prints no block at all, which is a decision 84-brand.js makes,
   not this file.

       <div class="rep-sign">
         <div class="rep-sigcell"><b>أعدّه</b><i></i>
           <span>الاسم</span><span>التاريخ</span></div>
         …
         <div class="rep-sigcell">…<div class="rep-seal">الختم</div></div>
       </div>

   The <i> is the signature rule: an empty box with a height and a bottom
   border. If the emitter ever drops it the cell still reserves its space —
   min-height is on the cell, not on the rule. */
.rep-sign {
  flex: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  column-gap: 10pt;
  margin-top: 10pt;
  padding-top: 7pt;
  border-top: .75pt solid var(--rep-rule);
  break-inside: avoid;
}
.rep-sigcell {
  position: relative;
  min-width: 0;
  min-height: 27mm;
  display: flex;
  flex-direction: column;
  padding: 4pt 8pt 5pt;
  border: .5pt solid var(--rep-rule);
  border-top: 2pt solid var(--rep-navy);
  background: var(--rep-paper);
  break-inside: avoid;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.rep-sigcell b {
  font-family: var(--font-title);
  font-size: 8.6pt;
  line-height: 1.6;
  font-weight: var(--rep-w-700);
  color: var(--rep-navy);
}
.rep-sigcell i {
  display: block;
  height: 10mm;
  margin: 3pt 0 4pt;
  border-bottom: .6pt solid var(--rep-ink);
}
.rep-sigcell span {
  display: block;
  font-size: 7.4pt;
  /* 1.9, not the 1.62 floor: these two lines are written ON, by hand, and
     the leading is the space the pen gets. */
  line-height: 1.9;
  color: var(--rep-mute);
}

/* The seal is a reserved square, not a drawn object: a dashed hairline says
   «something goes here» where a solid box would say «this is a box». It sits
   at the trailing edge of the last cell, level with the name lines. */
/* the cell that carries the seal stops its signature rule short of it */
.rep-sigcell:has(> .rep-seal) > i { margin-inline-end: 20mm; }
.rep-seal {
  /* beside the name lines, not under them: in the flow the seal made the
     block ~64mm tall, and a block that cannot be split moved to a sheet of
     its own whenever the last page had less than that left. Out of the flow
     it costs the block nothing; min-height on the cell keeps its room. */
  position: absolute;
  inset-inline-end: 7pt;
  bottom: 5pt;
  width: 17mm;
  height: 17mm;
  display: grid;
  place-items: center;
  /* round, as a seal is */
  border: .6pt dashed var(--rep-mute);
  border-radius: 50%;
  font-size: 7pt;
  line-height: 1.5;
  color: var(--rep-mute);
}

/* ---------- 3.8 the footer ----------
   «صفحة ١ من ٤» is produced by repPaginate(), not by CSS. Chrome and Firefox
   implement neither `@page { @bottom-center { … } }` nor counter(pages), so
   the owner's requirement is simply not reachable from a stylesheet — which
   is the entire reason 85-report.js paginates the report itself. What is
   left here is where the string sits.

   margin-top:auto pins the footer to the foot of a short page. .rep-body's
   flex:1 1 auto already does that on any page that has a body; the auto
   margin is what keeps the footer down on one that does not. */
.rep-foot {
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8pt;
  margin-top: auto;
  padding-top: 4pt;
  border-top: 1.2pt solid var(--rep-navy);
  font-size: 7pt;
  line-height: 1.6;
  color: var(--rep-mute);
  break-inside: avoid;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.rep-foot span { min-width: 0; }
/* The page number is a midnight tab hanging off the footer's rule. */
.rep-pageno {
  flex: none;
  padding: .4pt 7pt;
  border-radius: 2pt;
  background: var(--rep-navy);
  color: var(--rep-on-navy);
  font-size: 7.2pt;
  font-weight: var(--rep-w-600);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ============================================================
   4. Paper
   ============================================================ */
@media print {

  /* ──────────────────────────────────────────────────────────
     The tokens again, with !important.

     10-tokens.css declares the dark palette under
     `:root:not([data-theme="light"])`, which is (0,2,0); a bare `:root` is
     (0,1,0) and loses to it. That block names none of the five below TODAY,
     so nothing currently outranks §1 — and the flags are still not
     decoration. The moment one of these names is added to it, and a palette
     revision that wants the report to follow the app's ink is exactly the
     change that adds it, a reader whose OS is in dark mode prints the dark
     theme's pale ink onto white paper and does not find out until the sheet
     is in their hand. 80-print.css flags all 81 of its tokens for this
     reason; these nine cost one line each and close the same hole.
     ────────────────────────────────────────────────────────── */
  :root {
    --rep-ink:   #0e1424 !important;
    --rep-mute:  #535d75 !important;
    --rep-rule:  #d6dbe5 !important;
    --rep-band:  #f4f6fb !important;
    --rep-paper: #ffffff !important;
    --rep-navy:  #10142b !important;
    --rep-royal: #2f3fc4 !important;
    --rep-tint:  #eceffd !important;
    --rep-on-navy: #ffffff !important;
    --rep-on-navy-2: #c3c9ee !important;

    --rep-w-400: 400 !important;
    --rep-w-500: 500 !important;
    --rep-w-600: 600 !important;
    --rep-w-700: 700 !important;
  }

  /* ──────────────────────────────────────────────────────────
     THE RULE NOBODY WOULD THINK TO WRITE — do not simplify it away.

     #scReport carries class="screen" and the `hidden` attribute. On screen
     that settles it: 20-base.css's `[hidden] { display: none !important }`
     is the only display declaration that applies. On PAPER it does not,
     because 80-print.css re-declares `.screen { display: grid !important }`
     — also (0,1,0), also flagged, and concatenated LATER. Between two
     !important declarations of equal specificity the later one wins, so as
     the cascade stands today `.screen` beats `[hidden]` and a hidden
     #scReport PRINTS.

     restoreAfterPrint() empties the section, so most of the time what leaks
     is a blank box. But `afterprint` is not guaranteed to fire — a preview
     cancelled in the wrong way never fires it in more than one engine — and
     the moment it does not, the next ordinary ctrl+P carries the previous
     employee's salary sheet to the printer, stapled silently to the end of
     the company report. On paper, and only on paper, which is the worst
     place for a bug to live.

     (1,1,0) beats (0,1,0) outright, so this rule wins on specificity even
     though this file is concatenated BEFORE 80-print.css. That is the whole
     reason it can be written here at all — see the file header on the
     numbering.
     ────────────────────────────────────────────────────────── */
  #scReport[hidden] { display: none !important; }

  /* ---------- a scoped print is the report and nothing else ----------
     preparePrint() reveals every route screen, because for an ordinary print
     a report is the whole report. A scoped print is the opposite claim: this
     sheet is about ONE subject, and the register, the departments and the
     diagnostics behind it are not that subject's business — printing them
     under an employee's masthead would be exactly the «a filtered figure
     mistaken for a total» failure, inverted.

     The three specificities, since all three land on the same element:
     `body.pdf-scoped .screen` is (0,2,1), `body.pdf-scoped #scReport` is
     (1,1,1), and the guard above is (1,1,0). An id outranks any number of
     classes, so the reveal beats the blanket hide; and against the guard the
     two are level on ids and on classes-or-attributes, with the reveal
     carrying one more element name, so it wins there too.

     That last one is deliberate and not an accident of arithmetic. The
     scoped branch of preparePrint() clears `hidden` before it prints, so the
     guard should not be in play at all — and if that branch ever failed to,
     a scoped print puts the report on paper rather than handing the user a
     blank sheet with a page number on it. */
  body.pdf-scoped .screen { display: none !important; }
  body.pdf-scoped #scReport { display: block !important; }

  /* And the app's own masthead comes off. printHeadEl() builds #printHead
     into #page on the first print and LEAVES IT THERE, and 80-print.css
     turns it on with `.print-head { display: block !important }` at (0,1,0).
     So on the second print — the scoped one — the app's «تقرير الدوام ·
     الفترة · المرشّحات» block would print above the ministry masthead, two
     letterheads on one sheet, each naming a different scope. (0,2,1) takes
     it off. It is not inside a .screen — printHeadEl() inserts it as #page's
     first child — so the blanket hide above never reaches it. */
  body.pdf-scoped .print-head { display: none !important; }

  /* The measurer is removed by repPaginate() before the pass returns. This
     is for the pass that DOESN'T return: one exception mid-measure leaves an
     absolutely-positioned box up to 269mm tall in the document, and from
     then on every print in the session ends with blank sheets that nothing
     on screen explains. */
  .rep-measure { display: none !important; }
}

/* ============================================================
   5. Screen — the sixty milliseconds nobody should see

   preparePrint() reveals the report and window.print() follows 60ms later,
   so the sheet is briefly in the live document at its paper width: 273mm is
   1032px, wider than the bench on most screens, and the app would jump into
   a horizontal scroll and back. Clipping is enough — the flash is already
   there for every print this program does, and this only stops it moving the
   page under the user's hand. Scoped to @media screen so no clip can ever
   reach the printed sheet.
   ============================================================ */
@media screen {
  #scReport { overflow-x: hidden; }
}

/* ── 73-calc.css ─────────────────────────────── */

/* ============================================================
   حاسبة الساعات — the rail's one button, and the panel it opens
   (86-calc.js).
   ============================================================ */

/* The rail's items are links; this one is a button, so it takes the link's
   box explicitly. Open is the hover fill, held — the panel is not a page, so
   it never takes the active marker a route does. */
button.nav-i { width: 100%; text-align: start; }
.nav-i[aria-expanded="true"] { background: var(--spine-2); color: var(--spine-ink); }

/* ---------- the panel ----------
   It floats against the rail's own edge, at the foot of the window: that is
   the corner of the bench a table's figures are least often read from, and
   the button that opened it is right beside it. A floating object, so it
   gets the drawer's radius, border and shadow together. */
.calc {
  position: fixed;
  z-index: 58;                 /* under the drawer (60) and every dialog */
  inset-block-end: 16px;
  inset-inline-start: calc(var(--spine-w) + 16px);
  width: 340px;
  max-width: calc(100vw - var(--spine-w) - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  animation: calc-in var(--t-slow) var(--ease);
}
.calc[hidden] { display: none; }
.spine-min .calc {
  inset-inline-start: calc(var(--spine-w-min) + 16px);
  max-width: calc(100vw - var(--spine-w-min) - 32px);
}
@keyframes calc-in {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.calc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.calc-head h3 { flex: 1; font-size: var(--fs-h3); min-width: 0; }

.calc-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 16px;
  display: grid;
  gap: 16px;
  align-content: start;
}
.calc-fld { display: grid; gap: 7px; }
.calc-lbl {
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink-2);
}
.calc-lbl i { font-style: normal; font-weight: var(--w-400); color: var(--muted); margin-inline-start: 6px; }

.calc-rate { display: flex; gap: 8px; align-items: center; }
.calc-rate .inp { flex: 1; min-width: 0; }
.calc-rate .seg { flex: none; }
.calc-eq { font-size: var(--fs-micro); color: var(--muted); min-height: 1em; }
.calc-eq:empty { display: none; }

/* ---------- the durations ----------
   hours : minutes, then the row's own price once there is more than one
   row, then its remove button. The boxes are LTR figures, but the row itself
   stays RTL, so the hours box is the one nearest the label. */
.calc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 6px;
}
.calc-row .inp { height: 36px; padding-inline: 10px; }
.calc-row .inp::placeholder { color: var(--muted); opacity: .8; }
.calc-colon { color: var(--muted); font-weight: var(--w-600); }
.calc-sub {
  font-size: var(--fs-micro);
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
  direction: ltr;
  text-align: end;
  min-width: 0;
}
.calc-sub:empty { display: none; }
.calc-rm {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  color: var(--muted);
}
.calc-rm svg { width: 14px; height: 14px; }
.calc-rm:hover { background: var(--card-2); color: var(--crit); }
.calc-rm[hidden] { display: grid; visibility: hidden; }
.calc-add { justify-self: start; }

/* ---------- the result ---------- */
.calc-out {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}
.calc-sum {
  font-size: var(--fs-num-xl);
  line-height: 1.15;
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}
.calc-sum .cur { font-size: var(--fs-label); color: var(--muted); margin-inline-start: 6px; }
.calc-sum.is-zero { color: var(--muted); }
.calc-how { display: grid; gap: 2px; font-size: var(--fs-micro); color: var(--ink-2); line-height: var(--lh-body); }
.calc-how span[dir="ltr"] { font-variant-numeric: tabular-nums lining-nums; unicode-bidi: isolate; }

.calc-foot {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
}

/* ── 74-v6-month.css ─────────────────────────────── */

/* ============================================================
   The month in the chrome (v6) — what the SHELL adds around the
   kit's parts: the menu of an empty month under the year ribbon,
   what a LOCKED month looks like on every screen, the lock screen,
   and the landing's list of months to go back to.

   The ribbon, the stamp, the banner, the doors and the day cells
   themselves are the kit's (76-v6-kit.css, which loads after this
   file). Built from the existing tokens and nothing else: no
   colour, no radius, no shadow is named here that 10-tokens.css
   does not already define, so both themes and the print sheet
   follow for free.
   ============================================================ */

/* ============================================================
   1. The year ribbon's menu — a month with nothing in it

   Pressing an empty tab offers the two ways a month begins. It is
   the shared .menu (40-controls.css), which hangs from the inline
   end of its wrap; this one stands under whichever of twelve tabs
   was pressed, so 91-v6-month.js measures the tab and writes
   `left`. Selectors carry the ribbon so they outrank the kit's
   own, which load later.
   ============================================================ */

.v6-yearbar > .v6-ymenu {
  inset-inline-end: auto;
  left: 0;
  top: calc(100% + 5px);
  width: 276px;
  min-width: 0;
}
.v6-ymenu-h {
  margin: 0 0 4px;
  padding: 5px 10px 7px;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  color: var(--muted);
}

/* The window opens 1440px wide, and with the kit's 220px of search that
   leaves the ribbon 856px — four short of the 860 at which its tabs can wear
   their names. The search gives up 24px, so the program's own default window
   names its months. (An id, because the kit's rule loads after this file.) */
#ubar:has(> .v6-yearbar) .fld-q { flex-basis: 196px; }

/* What a tab can carry depends on the names in use as much as on the width:
   «مايو» fits where «تشرين الثاني» does not. The kit decides by width alone
   (numbers under 860px of ribbon, counts from 1240px); 91-v6-month.js then
   MEASURES the names it actually drew, and gives up first the counts and then
   the names themselves rather than ever showing one cut short. */
.v6-yearbar[data-fit="names"] .v6-mtab-c,
.v6-yearbar[data-fit="nums"] .v6-mtab-c,
.v6-yearbar[data-fit="nums"] .v6-mtab-l { display: none; }
.v6-yearbar[data-fit="nums"] .v6-mtab-n { display: block; }
.v6-yearbar[data-fit="nums"] .v6-mtab { padding-inline: 2px; }
/* between the two widths the kit names, a name needs the tab's whole width */
@container yearbar (min-width: 860px) and (max-width: 1039px) {
  .v6-yearbar .v6-mtab { padding-inline: 2px; }
}

/* The tab whose menu is open holds its hover ground while it is. */
.v6-yearbar .v6-mtab[aria-expanded="true"] { background: var(--card-2); color: var(--ink); }

/* A month that has not come yet: there, so the year reads as twelve, and
   plainly not something to press. */
.v6-yearbar .v6-mtab[aria-disabled="true"] { opacity: .5; cursor: default; }
.v6-yearbar .v6-mtab[aria-disabled="true"]:hover { background: none; color: var(--muted); }

/* A month is being loaded from the ribbon: the pointer says so, the tabs
   stay where they are. */
.v6-yearbar .v6-months[aria-busy="true"] .v6-mtab { cursor: progress; }

/* ============================================================
   2. A locked month, everywhere else

   While the open month is locked (<html class="v6-locked">) every
   write the engine reads is refused by the database. These rules
   are the VISIBLE half of that: the doors that lead to a write are
   greyed and do not take the pointer, so the reader is told before
   pressing rather than after. They are not the guard — a door
   reached some other way still ends in a refusal and a sentence
   (55-v6-seam.js lsSet) — and they are listed by the attribute each
   door already carries, so nothing here depends on how a screen
   lays itself out.

   A screen written for v6 joins in without touching this file: put
   data-v6-lockable on the control, or on a container whose
   controls should all go quiet.
   ============================================================ */

:root.v6-locked #modeSel,
:root.v6-locked #btnDeptTune,
:root.v6-locked [data-tune-dept],
:root.v6-locked [data-tune-none],
:root.v6-locked [data-edit-dept],
:root.v6-locked [data-edit-emp],
:root.v6-locked [data-px-emp],
:root.v6-locked [data-msn-emp],
:root.v6-locked [data-msn-full],
:root.v6-locked [data-msn-del],
:root.v6-locked [data-msn-reg],
:root.v6-locked [data-abs-mark],
:root.v6-locked [data-abs-all],
:root.v6-locked [data-abs-apply],
:root.v6-locked [data-abs-msnfull],
:root.v6-locked [data-abs-holiday],
:root.v6-locked [data-abs-act="applyall"],
:root.v6-locked [data-reg-act="selmsn"],
:root.v6-locked [data-reg-act="selrules"],
:root.v6-locked button[data-v6-lockable],
:root.v6-locked input[data-v6-lockable],
:root.v6-locked select[data-v6-lockable],
:root.v6-locked [data-v6-lockable] button,
:root.v6-locked [data-v6-lockable] input,
:root.v6-locked [data-v6-lockable] select:not(#gsDaysMonth),
:root.v6-locked [data-v6-lockable] textarea,
:root.v6-locked [data-v6-lockable] .switch {
  opacity: .42;
  pointer-events: none;
  cursor: default;
}

/* ============================================================
   3. The lock screen — the program behind a password

   The landing screen's centred column, narrower: one card, one
   field, one button. boot-theme.js marks <html> before the first
   paint, so the card is already there on the first frame and the
   landing screen never shows behind it — hence the two rules that
   overrule [hidden], which the script lifts a moment later anyway.
   ============================================================ */

/* The first screen: signing in as «مدير النظام» (91-v6-month.js 91d).
   One card on the bench, the brand above it, the dedication below. */
.v6-lock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--paper);
  padding: clamp(24px, 7vh, 72px) var(--gutter) 40px;
}
.v6-lock-in {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 18px;
}
.v6-lock-brand { display: flex; align-items: center; gap: 11px; justify-content: center; }
.v6-lock-brand b {
  display: block;
  font-family: var(--font-title);
  font-size: var(--fs-lead);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
}
.v6-lock-brand span:not(.mark) { display: block; font-size: var(--fs-micro); color: var(--muted); }

.v6-lock-box {
  display: grid;
  gap: 12px;
  padding: 24px 24px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.v6-lock-box .ichip { justify-self: start; }
.v6-lock-box h2 {
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.v6-lock-box > p { color: var(--ink-2); line-height: var(--lh-body); }
.v6-lock-box .v6-field { display: grid; gap: 5px; }
.v6-lock-box .v6-field label { font-size: var(--fs-label); font-weight: var(--w-600); color: var(--ink-2); }
.v6-lock-box .btn { justify-content: center; }
.v6-lock-box .btn-solid { margin-top: 4px; min-height: 40px; }
.v6-lock-box.is-busy { cursor: progress; }

/* a password field with its worded show/hide at the reading end's far side */
.v6-lock-inp { position: relative; display: grid; }
.v6-lock-inp .inp { width: 100%; }
/* Physical sides on purpose: a password is typed left to right (dir=auto turns
   the field LTR), so a logical «end» would put the padding on the right and the
   button on the left, over the dots. The button sits left; the text keeps clear of it. */
.v6-lock-inp.has-eye .inp { padding-left: 64px; }
.v6-lock-eye {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  color: var(--accent);
  background: transparent;
}
.v6-lock-eye:hover { background: var(--card-2); }

.v6-lock-hint { font-size: var(--fs-micro); color: var(--muted); margin-top: -6px; }
.v6-lock-err {
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--crit);
}
.v6-lock-link { justify-self: center; font-size: var(--fs-label); }

/* the account's recovery code — large, selectable, printed-looking */
.v6-lock-code {
  padding: 16px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--card-2);
  text-align: center;
  font-size: 22px;
  font-weight: var(--w-700);
  line-height: 1.4;
  direction: ltr;
  user-select: all;
  -webkit-user-select: all;
  font-variant-numeric: tabular-nums;
  word-spacing: 2px;
}
.v6-lock-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v6-lock-warn {
  padding: 10px 12px;
  border-inline-start: 3px solid var(--warn);
  background: var(--card-2);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
}
.v6-lock-check { display: flex; align-items: center; gap: 8px; font-weight: var(--w-600); cursor: pointer; }
.v6-lock-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* first run on a new machine: bring the old machine's data instead */
.v6-lock-alt {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.v6-lock-alt p { font-size: var(--fs-label); color: var(--muted); line-height: var(--lh-body); }
.v6-lock .credit { text-align: center; }

/* The top bar's end: who is signed in, the key, and the way out. */
.v6-user {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 8px;
}
.v6-user[hidden] { display: none; }
.v6-user-who { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.v6-user-av {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--spine);
  color: var(--spine-muted);
  display: grid;
  place-items: center;
}
.v6-user-av svg { width: 20px; height: 20px; }
.v6-user-who bdi {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: var(--w-700);
  color: var(--ink);
}
/* the warehouse's «تسجيل الخروج»: a red tint, not a red block */
.v6-user-lock {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--crit-2) 8%, transparent);
  color: var(--crit);
  font-size: var(--fs-body);
  font-weight: var(--w-700);
  transition: background var(--t-fast) var(--ease);
}
.v6-user-lock:hover { background: color-mix(in srgb, var(--crit-2) 14%, transparent); }

/* The program's start when no month is open — inside the frame, in the
   overview's place (72-intake.js v6StartHtml). The landing's doors, without
   the landing's full-window page. */
.v6-start { display: grid; gap: 12px; max-width: 900px; }
.v6-start h2 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.v6-start .v6-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
.v6-start .v6-landing-tmpl { margin-top: 4px; }

:root.v6-app-locked #v6Lock[hidden] { display: grid !important; }
:root.v6-app-locked #intake,
:root.v6-app-locked .frame { display: none !important; }

/* A month is about to be reopened: the landing screen holds its breath
   instead of flashing on the way to the report. 99-boot.js lifts this as
   soon as it knows — month or no month. */
:root.v6-resuming #intake { visibility: hidden; }

/* ============================================================
   4. The landing (#intake) — what the kit's three doors leave to
      the shell
   ============================================================ */

/* The months to go back to, above the doors: when there are months, opening
   one is what most starts are for. A card like any other. */
.v6-recent { margin-top: 8px; }

/* The main door while a file is being read (72-intake.js dropShow()). */
.v6-door.is-busy { cursor: progress; border-color: var(--accent); }
.v6-door.is-busy:hover { background: var(--card); }

/* The line under the doors. Not a fourth door: it is for whoever has no
   device export to bring, and it says so quietly. */
.v6-landing-tmpl {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}

/* ============================================================
   5. The months list — two small additions to the card-row
      vocabulary of 67-library.css
   ============================================================ */

/* «مقفل» — a status pill with its padlock. */
.badge.mon-lock svg { width: 12px; height: 12px; flex: none; }

/* An import that was undone stays on its month's row, struck through: the
   line still has to answer «where did these punches go». */
.mon-undone .lib-file { text-decoration: line-through; color: var(--muted); }

.lib-row .lib-sub + .lib-sub { margin-top: 2px; }

/* ============================================================
   6. Print

   None of this is the report. The ribbon leaves with .ubar and the
   landing with the kit's own print block; the banner and the lock
   screen are named here because 80-print.css, written for v5,
   cannot know them.
   ============================================================ */

@media print {
  .v6-lockbar,
  .v6-lock,
  #intake { display: none !important; }
  /* 80-print.css forces every .screen onto the sheet (display: grid
     !important, which outranks the `hidden` attribute), and then names the
     ones that are tools rather than report. These are v6's: a register of
     people and a list of months say nothing about the month being printed,
     and #scMerge is a v5 host that is no longer a screen at all. */
  #scMonths, #scStaff, #scPerson, #scMerge, #scDepartments { display: none !important; }
}

/* ── 75-v6-import.css ─────────────────────────────── */

/* ============================================================
   75. The import wizard — #impBack (92-v6-import.js)

   Built from the kit (76-v6-kit.css): the dialog layout, the steps,
   choices, notices, fields — and table.tbl for every list. What is
   here is only what the kit has no word for:

     .impw-drop     the zone a file is dropped on (the landing's door
                    is a page-sized thing; this one lives in a dialog)
     .impw-file     the file that was read, as one line
     .impw-facts    a band of counted facts (rows read, punches added)
     .impw-hero     a step that amounts to one sentence
     .impw-sec      a titled section with its count and bulk actions
     .impw-nil      the quiet line a section collapses to
     .impw-tbl      table.tbl carrying controls instead of text
     .impw-busy     the veil that names the stage

   This sheet loads BEFORE the kit (75 < 76), so a rule that has to
   beat a kit rule says `.impw …` — one class more — instead of
   relying on order. Tokens only; nothing here names a colour.
   ============================================================ */

/* the veil is laid over the dialog, so the dialog is its box */
.modal.impw { position: relative; }

/* The kit's body is a grid of auto rows inside a box of fixed height. An auto
   row may shrink to its item's minimum, and an item with overflow:hidden — a
   notice, a bordered table — has a minimum of nothing: once a step is taller
   than the dialog, those are the blocks that get crushed instead of the body
   scrolling. Every row takes the height of what is in it. */
.impw .v6-dialog-b { grid-auto-rows: max-content; }

/* ---------- the veil: a stage, named ----------
   Nothing for 350 ms (the JS holds the fuse), then the step dims and
   says what is being done. No spinner: the sentence is the progress. */
.impw-busy {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: color-mix(in srgb, var(--card) 84%, transparent);
  cursor: progress;
}
.impw-busy > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-2);
}
.impw-busy b {
  font-size: var(--fs-body);
  font-weight: var(--w-500);
  color: var(--ink);
}
.impw-busy i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: impw-pulse 1.15s var(--ease) infinite;
}
@keyframes impw-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .impw-busy i { animation: none; }
}

/* ---------- step 1: the zone ---------- */
.impw-drop {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-height: 300px;
  padding: 32px 24px;
  border-radius: var(--r-lg);
  /* dashed says «put something here»; solid once a file is held over it */
  border: 1.5px dashed var(--day-rule);
  background: var(--card-3);
  color: var(--ink-2);
  text-align: center;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.impw-drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.impw-drop.is-over { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.impw-drop > b {
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.impw-drop > span {
  max-width: 54ch;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.impw-drop-i {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.impw-drop-i svg { width: 30px; height: 30px; }
/* Latin-only beside Arabic: isolated, or the leading dot migrates */
.impw-drop > .impw-fmt {
  margin-top: 4px;
  font-size: var(--fs-micro);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- the file that was read ---------- */
.impw-file {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-3);
}
.impw-file-i { flex: none; display: grid; place-items: center; color: var(--muted); }
.impw-file-i svg { width: 20px; height: 20px; }
.impw-file-b { flex: 1 1 auto; min-width: 0; display: grid; gap: 0; }
.impw-file-b > b {
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.impw-file-b > span { font-size: var(--fs-micro); line-height: var(--lh-cell); color: var(--muted); }
.impw-file > .btn { flex: none; }

/* ---------- a band of facts ----------
   The summary band's grammar (label above, figure, note below), at a
   dialog's size: hairlines between the cells, no tint, the figure ink. */
.impw-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}
.impw-facts > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 9px 12px 10px;
  border-inline-start: 1px solid var(--line-soft);
}
.impw-facts > div:first-child { border-inline-start: 0; }
.impw-facts dt { font-size: var(--fs-micro); line-height: var(--lh-cell); color: var(--muted); }
.impw-facts dd {
  font-size: var(--fs-h3);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.impw-facts dd.impw-fact-n {
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
  color: var(--muted);
  white-space: normal;
}
.impw-facts.is-big dd:not(.impw-fact-n) { font-size: var(--fs-num-lg); line-height: var(--lh-tight); padding-block: 2px; }

.impw-cols,
.impw-say {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.impw-cols > span { color: var(--muted); }
.impw-say b { color: var(--ink); font-weight: var(--w-600); }

/* ---------- a step that is one sentence ---------- */
.impw-hero { display: grid; gap: 3px; }
.impw-lead {
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.impw-hero > p {
  max-width: 78ch;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.impw-hero > p b { color: var(--ink); font-weight: var(--w-600); }

/* ---------- sections ---------- */
.impw-sec,
.impw-map { display: grid; gap: 8px; min-width: 0; }
.impw-sec-h {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.impw-sec-h > h4 {
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.impw-sec-a { margin-inline-start: auto; display: flex; gap: 6px; }
.impw-sec-p {
  max-width: 96ch;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.impw-sec-p b { color: var(--ink-2); font-weight: var(--w-600); }

/* a section with nothing to decide: its name, and «لا فروق» */
.impw-nil {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.impw-nil > b { font-weight: var(--w-500); color: var(--ink-2); }
/* consecutive quiet lines read as one list, not as separate blocks */
.impw .v6-dialog-b > .impw-nil + .impw-nil { margin-top: -14px; }

/* a list behind a disclosure: the notice's body, widened to carry a table */
.impw .v6-notice-d.impw-wide { padding: 10px 12px 12px; display: grid; gap: 8px; }
.impw .v6-notice-d.impw-wide > * { max-width: none; margin-top: 0; }

/* ---------- table.tbl carrying controls ----------
   The shared rule is (0,1,3); these say one class more. Cells wrap —
   a name cell holds a field and the small print under it — and the
   padding leaves the 3px a focus ring stands off its control. */
table.tbl.impw-tbl { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.tbl.impw-tbl > thead > tr > th { position: static; padding: 7px 8px; }
table.tbl.impw-tbl > tbody > tr > td {
  padding: 6px 8px;
  white-space: normal;
  overflow: visible;
  vertical-align: top;
}
table.tbl.impw-tbl > tbody > tr:hover > td { background: none; }
table.tbl.impw-tbl > tbody > tr > td.n { padding-top: 13px; }
table.tbl.impw-tbl .inp { height: var(--ctrl-h-sm); font-size: var(--fs-cell); }
table.tbl.impw-tbl .btn { white-space: nowrap; }

/* plain-text tables (missing, moved, the mapper's preview): the row's text sits on the control's line */
table.tbl.impw-miss > tbody > tr > td,
table.tbl.impw-moved > tbody > tr > td,
table.tbl.impw-prev > tbody > tr > td { vertical-align: middle; padding-block: 7px; }
table.tbl.impw-miss > tbody > tr > td.n,
table.tbl.impw-moved > tbody > tr > td.n { padding-top: 7px; }
table.tbl.impw-prev > tbody > tr > td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.impw-tbl col.c-on { width: 38px; }
.impw-tbl col.c-ids { width: 128px; }
.impw-tbl col.c-dept { width: 212px; }
.impw-tbl col.c-n { width: 72px; }
.impw-tbl col.c-n2 { width: 132px; }
.impw-tbl col.c-act { width: 158px; }
.impw-tbl col.c-seg3 { width: 214px; }
.impw-tbl col.c-seg2 { width: 236px; }
.impw-tbl col.c-id { width: 104px; }
.impw-tbl col.c-ts { width: 164px; }
.impw-tbl col.c-ty { width: 76px; }

.impw-tbl td.c-on { padding-top: 13px; text-align: center; }
.impw-tbl td.c-on input,
.impw-tbl th input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.impw-tbl td.c-act { text-align: end; }
.impw-tbl td.c-seg .seg { display: flex; }
.impw-tbl td.c-seg .seg > button { flex: 1 1 auto; padding-inline: 8px; }
.impw-tbl .seg > button:disabled { opacity: .45; cursor: not-allowed; }

/* a person left out: the row stays, read as set aside */
.impw-tbl tr.is-off > td { background: var(--card-3); }
.impw-tbl tr.is-off .impw-raw,
.impw-tbl tr.is-off .impw-ids,
.impw-tbl tr.is-off td.n { color: var(--muted); }

.impw-raw {
  display: block;
  padding-top: 6px;
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.impw-note {
  margin-top: 3px;
  font-size: var(--fs-micro);
  line-height: 1.55;
  color: var(--muted);
}
.impw-err {
  margin-top: 3px;
  font-size: var(--fs-micro);
  line-height: 1.55;
  font-weight: var(--w-500);
  color: var(--crit);
}
.impw-idl,
.impw-idn { display: block; line-height: var(--lh-cell); }
.impw-idn { font-size: var(--fs-micro); color: var(--muted); }
table.tbl.impw-tbl > tbody > tr > td.c-ids { padding-top: 12px; }

/* «اربطه بموظف موجود»: a search that narrows the list under it */
.impw-pick { display: grid; gap: 4px; }

/* ---------- departments ---------- */
.impw-depts { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.impw-depts > li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--card);
}
.impw-depts > li:last-child { border-bottom: 0; }
.impw-dept-b { flex: 1 1 auto; min-width: 0; display: grid; gap: 0; }
.impw-dept-b > b { font-size: var(--fs-cell); font-weight: var(--w-500); line-height: var(--lh-cell); color: var(--ink); }
.impw-dept-b > span { font-size: var(--fs-micro); line-height: var(--lh-cell); color: var(--muted); }
.impw-dept-c { flex: none; display: flex; align-items: center; gap: 8px; }
.impw-dept-c .inp { width: 210px; height: var(--ctrl-h-sm); font-size: var(--fs-cell); }
.impw-dept-c .impw-note { margin-top: 0; }

/* ---------- conflicts ---------- */
.impw-conf {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-3);
}
.impw-conf-t { font-size: var(--fs-label); line-height: var(--lh-body); color: var(--ink-2); }
.impw-conf-t b { color: var(--ink); font-weight: var(--w-600); }

/* ---------- lists of sentences ---------- */
.impw-pairs,
.impw-list { display: grid; gap: 5px; }
.impw-list > li {
  position: relative;
  padding-inline-start: 14px;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.impw-list > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: .72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--day-rule);
}
.impw-list b { color: var(--ink); font-weight: var(--w-600); }

/* ---------- the mapper ---------- */
.impw-mapgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 10px 12px;
  align-items: start;
}
.impw-map .v6-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 76-v6-kit.css ─────────────────────────────── */

/* ============================================================
   The v6 kit — what the new screens are built from.

   v5's vocabulary (.panel, .tbl, .btn, .inp, .note, .badge …) is
   unchanged and still the base. This file adds the parts v6's own
   screens need — the import wizard, the staff register, the
   employee's year, the months list, backups — and the three
   things the design is ABOUT:

     1  .v6-yearbar     the year ribbon: twelve month tabs
     2  .v6-daystrip    one cell per calendar day, one colour language
     3  .v6-yeargrid    twelve strips: a person's year
     4  .v6-stamp       «مُعتمَد» — the locked month, the one bold moment
     5  .v6-steps       the import wizard's sequence
     6  .v6-tabs        in-page tabs
     7  .v6-form …      fields, a chip input, choice rows
     8  .v6-list        dense rows: months, imports, backups, audit
     9  .v6-empty       an empty state that directs
    10  .v6-notice      the compact notice, with a disclosure
    11  .v6-dialog      head · body · foot for the three new dialogs
    12  .v6-lockbar     the banner under the page head, month locked
    13  .v6-landing     the first-run screen
    14  print

   Every component's HTML contract is in DESIGN.md §6 with a snippet
   to copy. Nothing here names a colour, a radius or a shadow that
   10-tokens.css does not define. Numbered 76 so it loads after the
   screens (60–73) and after 74-v6-month.css, whose month switcher
   and lock banner it re-measures.
   ============================================================ */

/* ============================================================
   1. The year ribbon

   "Which month am I in, and is it settled?" — answerable from any
   screen. A year stepper and twelve pills, on the head card's white
   band: the warehouse's filter pills, its «فترة» band and its event
   glyph. Month 1 is at the reading edge (the right, in RTL) because
   the list is in DOM order.

   A tab's state is an attribute, and each state has a form as well
   as a colour:

     data-state="none"    no data      muted label, hollow dot
     data-state="open"    has data     slate dot
     data-state="locked"  approved     stamp dot + the mini stamp
     aria-current="true"  the open month: the accent's tint
     data-stale           a dot: its figures need refreshing
   ============================================================ */
.v6-yearbar {
  container: yearbar / inline-size;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px var(--gutter);
  border-top: 1px solid var(--line);
  border-radius: 0 0 calc(var(--r-xl) - 1px) calc(var(--r-xl) - 1px);
  background: var(--card);
}

/* ---------- the year stepper: ‹ 2026 › ---------- */
.v6-year {
  flex: none;
  display: inline-flex;
  align-items: stretch;
  height: var(--ctrl-h-sm);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
}
.v6-year-step {
  width: 26px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.v6-year-step svg { width: 16px; height: 16px; }
/* The sprite's chevron points to the physical right — the past, in an Arabic
   timeline — so the first button (السنة السابقة) wears it as drawn and the
   second wears it turned. */
.v6-year-step:last-child svg { transform: rotate(180deg); }
.v6-year-step:hover:not(:disabled) { background: var(--card-2); color: var(--ink); }
.v6-year-step:disabled { opacity: .38; cursor: default; }
.v6-year-n {
  display: grid;
  place-items: center;
  min-width: 42px;
  padding: 0 2px;
  font-size: var(--fs-label);
  font-weight: var(--w-700);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}

/* ---------- the twelve pills ---------- */
.v6-months {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.v6-months > li { flex: 1 1 0; min-width: 0; }

.v6-mtab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: var(--ctrl-h-sm);
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--muted);
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.v6-mtab:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  color: var(--ink);
}
.v6-mtab:focus-visible { outline-offset: 1px; border-radius: var(--r-pill); }

.v6-mtab-l {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
}
/* the month's number: what the tab shrinks to when there is no room for names */
.v6-mtab-n {
  display: none;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
}
/* a tiny count (people, or days) — only where the tab has the width */
.v6-mtab-c {
  display: none;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}

/* The warehouse's semantic dot: what the month holds, in the day cells' own
   language — a month is a cell of the year. */
.v6-mtab::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--day-ok);
}
.v6-mtab[data-state="none"]::before {
  background: none;
  box-shadow: inset 0 0 0 1px var(--day-rule);
}
.v6-mtab[data-state="locked"]::before { background: var(--stamp); }

/* The mini stamp rides the pill's far end, so it costs the label no width. */
.v6-mtab > .v6-stamp.is-mini {
  position: absolute;
  top: 50%;
  inset-inline-end: 7px;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0;
  outline-offset: 1px;
}
.v6-mtab > .v6-stamp.is-mini::after { width: 5px; height: 2.5px; margin-top: -1.5px; }

/* stale: a small dot at the pill's shoulder */
.v6-mtab[data-stale]::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn-2);
}

/* THE open month: the selected filter pill. */
.v6-mtab[aria-current="true"] {
  z-index: 1;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent);
}
.v6-mtab[aria-current="true"] .v6-mtab-l { font-weight: var(--w-700); }
.v6-mtab[aria-current="true"]::before { background: var(--accent); }
/* locked AND open: the accent gives way to the stamp */
.v6-mtab[aria-current="true"][data-state="locked"] {
  background: color-mix(in srgb, var(--stamp) 10%, var(--card));
  border-color: color-mix(in srgb, var(--stamp) 38%, transparent);
  color: var(--stamp);
}
.v6-mtab[aria-current="true"][data-state="locked"]::before { background: var(--stamp); }

/* narrow: the names give way to numbers (a 1100px window) */
@container yearbar (max-width: 800px) {
  .v6-mtab-l { display: none; }
  .v6-mtab-n { display: block; }
  .v6-mtab { padding-inline: 2px; }
}
/* wide: room for the count beside the name */
@container yearbar (min-width: 1240px) {
  .v6-mtab-c { display: block; }
}

.v6-month { height: var(--ctrl-h-sm); }

/* ============================================================
   2. The day strip — one cell per calendar day

   <span class="v6-daystrip" role="img" aria-label="…">
     <i data-s="ok"></i><i data-s="ot"></i><i class="wk" data-s="off"></i>…
   </span>

   A state is a colour AND a form, so the strip survives a greyscale
   printer and a reader who cannot tell red from green:

     ok       present                a full slate cell
     ot       present, overtime      a full green cell, TALLER than the row
     short    present, short hours   a half-filled amber cell (a glass half full)
     single   one punch              a hollow orange cell with one dot in it
     absent   absent                 a full red cell
     unset    not yet decided        a hollow red cell — the same day, no verdict
     leave    approved leave         a teal cell, diagonally striped
     mission  on a mission           a violet cell with a slit through its middle
     off      not a working day      a pale cell (hatched at the large size)
     out      outside service        a dotted outline
     none     no data                a tick on the baseline

   Height carries hours — short is half, ok is full, overtime stands
   above the line — which is why the strip is bottom-aligned.

   Three sizes: default (9×18, a table row), .is-sm (6×14, a dense
   column), .is-lg (22×22 with the day number over each cell — put
   the number in data-d).
   ============================================================ */
.v6-daystrip {
  --_w: 9px;
  --_h: 18px;
  --_ot: 4px;         /* how far an overtime cell stands above the line */
  --_g: 2px;
  --_wk: 3px;         /* what a week boundary adds to the gap */
  --_r: 2px;
  display: inline-flex;
  align-items: flex-end;
  gap: var(--_g);
  height: calc(var(--_h) + var(--_ot));
  vertical-align: middle;
  line-height: 0;
}
.v6-daystrip.is-sm { --_w: 6px; --_h: 14px; --_ot: 3px; --_g: 1px; --_wk: 2px; --_r: 1.5px; }
.v6-daystrip.is-lg {
  --_w: 22px; --_h: 22px; --_ot: 5px; --_g: 3px; --_wk: 6px; --_r: var(--r-xs);
  height: calc(var(--_h) + var(--_ot) + 19px);     /* + the line of day numbers */
}

/* One cell. The same rule paints a cell in a strip, a swatch in the legend,
   and a loose <i class="v6-day"> anywhere a state needs naming. */
.v6-daystrip > :is(i, button),
.v6-day {
  position: relative;
  flex: none;
  display: block;
  box-sizing: border-box;
  width: var(--_w, 9px);
  height: var(--_h, 18px);
  padding: 0;
  border-radius: var(--_r, 2px);
  /* default = none: a tick on the baseline */
  background: linear-gradient(var(--day-rule), var(--day-rule)) 50% 100% / 3px 1.5px no-repeat;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.v6-daystrip > .wk { margin-inline-start: var(--_wk); }
.v6-day { display: inline-block; vertical-align: -3px; }

:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="ok"] { background: var(--day-ok); }
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="ot"] {
  background: var(--day-ot);
  height: calc(var(--_h, 18px) + var(--_ot, 4px));
}
/* The amber fill is bright on purpose (a 3:1 amber on white is a mustard, and
   reads as gold); the outline is what is held to 3:1 — 62% fill, 38% ink.
   test/design/contrast.py checks that mix; change the two together. */
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="short"] {
  background: linear-gradient(to top, var(--day-short) 50%, transparent 50%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--day-short) 62%, var(--ink));
}
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="single"] {
  background: radial-gradient(circle at 50% 50%, var(--day-single) 0 1.4px, transparent 1.9px);
  box-shadow: inset 0 0 0 1.5px var(--day-single);
}
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="absent"] { background: var(--day-absent); }
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="unset"] {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--day-absent);
}
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="leave"] {
  background: repeating-linear-gradient(135deg,
    var(--day-leave) 0 2px,
    color-mix(in srgb, var(--day-leave) 24%, var(--card)) 2px 4px);
}
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="mission"] {
  background: linear-gradient(to bottom,
    var(--day-mission) 0 34%, transparent 34% 66%, var(--day-mission) 66%);
  box-shadow: inset 0 0 0 1px var(--day-mission);
}
/* راتب ثابت: a working day nobody owed — a pale magenta cell, never the red
   of an absence */
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="free"] {
  background: color-mix(in srgb, var(--fixed) 22%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fixed) 55%, transparent);
}
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="off"] { background: var(--day-off); }
:is(.v6-daystrip > i, .v6-daystrip > button, .v6-day)[data-s="out"] {
  background: none;
  border: 1px dotted var(--day-rule);
}

/* ---------- the large size: the forms scale, the number appears ---------- */
/* The number hangs from the cell's BOTTOM edge by a fixed distance — every
   cell stands on the same line, so the numbers stay on one line too, even
   over an overtime cell that is taller than its neighbours. */
.v6-daystrip.is-lg > :is(i, button)::before {
  content: attr(data-d);
  position: absolute;
  inset-inline: -4px;
  bottom: calc(var(--_h) + var(--_ot) + 3px);
  text-align: center;
  font-size: var(--fs-micro);
  line-height: 1.3;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
}
.v6-daystrip.is-lg > :is(i, button) {
  background-size: 8px 2px;
}
.v6-daystrip.is-lg > [data-s="ok"],
.v6-daystrip.is-lg > [data-s="ot"],
.v6-daystrip.is-lg > [data-s="absent"],
.v6-daystrip.is-lg > [data-s="short"],
.v6-daystrip.is-lg > [data-s="mission"] { background-size: auto; }
.v6-daystrip.is-lg > [data-s="single"] {
  background: radial-gradient(circle at 50% 50%, var(--day-single) 0 3px, transparent 3.6px);
  box-shadow: inset 0 0 0 2px var(--day-single);
}
.v6-daystrip.is-lg > [data-s="unset"] { box-shadow: inset 0 0 0 2px var(--day-absent); }
.v6-daystrip.is-lg > [data-s="leave"] {
  background: repeating-linear-gradient(135deg,
    var(--day-leave) 0 3px,
    color-mix(in srgb, var(--day-leave) 24%, var(--card)) 3px 6px);
}
.v6-daystrip.is-lg > [data-s="off"] {
  background:
    repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--day-rule) 55%, transparent) 4px 5px),
    var(--day-off);
}
.v6-daystrip.is-lg > [data-s="off"]::before { color: color-mix(in srgb, var(--muted) 62%, var(--card)); }
/* a cell that can be pressed (a day opens its punches) says so */
.v6-daystrip > button { cursor: pointer; }
.v6-daystrip > button:hover { filter: brightness(1.12); }
.v6-daystrip > button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the day the reader is looking at */
.v6-daystrip.is-lg > [aria-current="true"]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1.5px solid var(--accent);
  border-radius: calc(var(--_r) + 2px);
}

/* ---------- the legend ---------- */
.v6-daystrip-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--ink-2);
}
.v6-daystrip-legend > li {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.v6-daystrip-legend .v6-day { flex: none; vertical-align: 0; margin-bottom: 1px; }

/* ============================================================
   3. The year grid — twelve strips, one person's year

   <div class="v6-yeargrid">
     <div class="v6-yg-row" [data-state="locked|open|none"] [aria-current="true"]>
       <b class="v6-yg-m">يناير</b>
       <span class="v6-daystrip">…</span>
       <span class="v6-yg-t">
         <span><i class="v6-day" data-s="ok"></i><bdi class="num">21</bdi></span>…
         <b class="v6-yg-net"><bdi class="num">4,412.64</bdi><span class="cur">ر.س</span></b>
       </span>
     </div> ×12
   </div>

   Every strip starts at day 1, so a column is a day of the month and
   the eye can run down it. For that the week gaps are closed here:
   they fall on different days in different months.
   ============================================================ */
.v6-yeargrid {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  font-size: var(--fs-label);
}
.v6-yg-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.v6-yg-row:last-child { border-bottom: 0; }
.v6-yg-row:is(a, button) { text-align: start; color: inherit; text-decoration: none; cursor: pointer; }
.v6-yg-row:is(a, button):hover { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.v6-yg-m {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* the name at the reading edge, the stamp
                                       at the other: the stamps form a column */
  gap: 6px;
  min-width: 84px;
  font-family: var(--font-title);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-title);
  color: var(--ink);
  white-space: nowrap;
}
.v6-yeargrid .v6-daystrip > .wk { margin-inline-start: 0; }
.v6-yg-t {
  display: flex;
  align-items: center;
  justify-content: flex-start;      /* the counts sit beside the strip they count */
  flex-wrap: wrap;
  gap: 2px 12px;
  min-width: 0;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums lining-nums;
}
.v6-yg-t > span { display: inline-flex; align-items: flex-end; gap: 5px; white-space: nowrap; }
.v6-yg-t .v6-day { --_w: 6px; --_h: 12px; --_ot: 0px; vertical-align: 0; margin-bottom: 3px; }
.v6-yg-net {
  min-width: 104px;
  margin-inline-start: auto;        /* …and the net at the row's far end */
  text-align: end;
  font-weight: var(--w-600);
  color: var(--ink);
  white-space: nowrap;
}
.v6-yg-row[data-state="none"] .v6-yg-m,
.v6-yg-row[data-state="none"] .v6-yg-t { color: var(--muted); }
.v6-yg-row[aria-current="true"] { background: var(--sel); }
.v6-yg-row[aria-current="true"]::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--accent);
}
/* the ruler over the grid: day numbers every fifth day */
.v6-yg-row.is-head { min-height: 0; padding-block: 2px 0; border-bottom: 0; }
.v6-yg-ruler > i { background: none; height: 16px; }
.v6-yg-ruler > i::before {
  content: attr(data-d);
  position: absolute;
  inset-inline: -8px;
  top: 0;
  text-align: center;
  font-size: var(--fs-micro);
  line-height: 16px;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
}
.v6-daystrip.v6-yg-ruler { height: 16px; }

/* ============================================================
   4. The stamp — «مُعتمَد»

   A locked month wears it, and NOTHING else in the app looks like
   it: stamp ink, two rings, a slight turn. It is also the only
   thing that moves by itself — it lands once, when a month is
   locked (.is-landing, 280ms), and stays where it fell.

     <span class="v6-stamp" role="img" aria-label="مُعتمَد"><b>مُعتمَد</b></span>
     <span class="v6-stamp is-mini" role="img" aria-label="مُعتمَد"></span>
     <span class="v6-stamp is-lg" role="img" aria-label="…"><b>مُعتمَد</b><i>2026-09-03</i></span>
   ============================================================ */
.v6-stamp {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4px;                          /* the outer ring is an outline: it takes no room of its own */
  padding: 0 9px 1px;
  border: 1px solid var(--stamp);
  border-radius: var(--r-sm);
  outline: 1.5px solid var(--stamp);
  outline-offset: 2px;
  color: var(--stamp);
  transform: rotate(-5deg);
  vertical-align: middle;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.v6-stamp > b {
  font-family: var(--font-title);
  font-size: var(--fs-micro);
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}
.v6-stamp > i {
  font-size: var(--fs-micro);
  line-height: 1.3;
  font-variant-numeric: tabular-nums lining-nums;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

/* large: the months screen, the lock confirmation */
.v6-stamp.is-lg {
  margin: 9px;
  padding: 5px 22px 8px;
  border-width: 1.5px;
  border-radius: 10px;
  outline-width: 3px;
  outline-offset: 4px;
  transform: rotate(-6deg);
}
.v6-stamp.is-lg > b { font-size: 24px; line-height: 1.55; }

/* mini: a tab, a row title — the ringed mark alone, a check in a disc */
.v6-stamp.is-mini {
  width: 13px;
  height: 13px;
  margin: 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--stamp);
  outline-width: 1px;
  outline-offset: 1.5px;
  transform: rotate(-8deg);
}
.v6-stamp.is-mini::after {
  content: "";
  width: 6px;
  height: 3px;
  margin-top: -2px;
  border: solid var(--on-stamp);
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(-45deg);
}

@keyframes v6-stamp-land {
  0%   { opacity: 0; transform: rotate(-17deg) scale(1.8); }
  55%  { opacity: 1; transform: rotate(-4deg) scale(.95); }
  100% { opacity: 1; transform: rotate(-6deg) scale(1); }
}
.v6-stamp.is-landing { animation: v6-stamp-land 280ms cubic-bezier(.3, .8, .4, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .v6-stamp.is-landing { animation: none; }
}

/* ============================================================
   5. The wizard's steps

   <ol class="v6-steps">
     <li class="is-done"><b>اختيار الملف</b><span>النقل 8.xls</span></li>
     <li aria-current="step"><b>الأعمدة</b><span>…</span></li>
     <li><b>الموظفون</b></li>
     <li><b>المراجعة والحفظ</b></li>
   </ol>

   A real sequence, so it is numbered — by a CSS counter, which
   gives Latin digits and never an Arabic-Indic one.
   ============================================================ */
.v6-steps {
  counter-reset: v6step;
  display: flex;
  align-items: stretch;           /* every step as tall as the tallest, so
                                     the rule under them is one straight line */
  gap: 0;
  min-width: 0;
}
.v6-steps > li {
  counter-increment: v6step;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 9px;
  align-items: start;
  padding-inline-end: 14px;
  color: var(--muted);
}
/* a step with no second line centres its name on the number */
.v6-steps > li > b:only-child { grid-row: 1 / span 2; align-self: start; margin-top: 3px; }
.v6-steps > li::before {
  content: counter(v6step);
  grid-row: 1 / span 2;
  align-self: start;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--day-rule);
  display: grid;
  place-items: center;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
  background: var(--card);
  color: var(--muted);
}
.v6-steps > li > b {
  grid-column: 2;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v6-steps > li > span {
  grid-column: 2;
  font-size: var(--fs-micro);
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* one hairline under the whole sequence; each step paints its own share */
.v6-steps > li { padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.v6-steps > li.is-done { border-bottom-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.v6-steps > li[aria-current="step"] { border-bottom-color: var(--accent); }

.v6-steps > li[aria-current="step"] { color: var(--ink); }
.v6-steps > li[aria-current="step"]::before {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.v6-steps > li[aria-current="step"] > b { font-weight: var(--w-600); }
.v6-steps > li.is-done { color: var(--ink-2); }
/* done: the number gives way to a check, drawn — no glyph to go missing */
.v6-steps > li.is-done::before {
  content: "";
  border-color: var(--accent);
  background: var(--accent-soft);
}
.v6-steps > li.is-done::after {
  content: "";
  position: absolute;
  inset-inline-start: 9px;
  top: 9px;
  width: 8px;
  height: 4.5px;
  border: solid var(--accent);
  border-width: 0 0 1.75px 1.75px;
  transform: rotate(-45deg);
}

/* ============================================================
   6. In-page tabs

   <div class="v6-tabs" role="tablist">
     <button type="button" role="tab" aria-selected="true">هذا الشهر</button>
     <button type="button" role="tab" aria-selected="false">السنة</button>
     <button type="button" role="tab" aria-selected="false">السجل <span class="v6-tabs-n"><bdi class="num">14</bdi></span></button>
   </div>
   ============================================================ */
.v6-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.v6-tabs > :is(button, a) {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: var(--w-500);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.v6-tabs > :is(button, a):hover { color: var(--ink); border-bottom-color: var(--day-rule); }
.v6-tabs > :is(button, a):focus-visible { outline-offset: -3px; }
.v6-tabs > :is([aria-selected="true"], [aria-current="page"]) {
  color: var(--ink);
  font-weight: var(--w-600);
  border-bottom-color: var(--accent);
}
.v6-tabs > :is([aria-selected="true"], [aria-current="page"]):hover { border-bottom-color: var(--accent); }
.v6-tabs-n {
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  line-height: 1.5;
}
/* inside a card's head the tabs replace the head's own rule */
.panel > .v6-tabs { padding-inline: 8px; }

/* ============================================================
   7. Forms

   <form class="v6-form">
     <div class="v6-field [is-error]">
       <label for="stName">الاسم</label>
       <input class="inp" id="stName" aria-describedby="stNameH">
       <p class="v6-hint" id="stNameH">كما يظهر في كشف الرواتب.</p>
       <p class="v6-err" role="alert">الاسم مطلوب.</p>          (when is-error)
     </div>
     <div class="v6-field-row"> .v6-field × 2–3 </div>
   </form>
   ============================================================ */
.v6-form { display: grid; gap: 14px; align-content: start; min-width: 0; }
.v6-field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.v6-field > label,
.v6-field > .v6-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  color: var(--ink-2);
}
/* «اختياري» beside a label — quieter than the label, never an asterisk */
.v6-opt { font-weight: var(--w-400); color: var(--muted); }
.v6-hint {
  font-size: var(--fs-micro);
  line-height: 1.55;
  color: var(--muted);
}
.v6-err {
  display: none;
  font-size: var(--fs-micro);
  line-height: 1.55;
  font-weight: var(--w-500);
  color: var(--crit);
}
.v6-field.is-error > .v6-err { display: block; }
.v6-field.is-error > .inp,
.v6-field.is-error > .v6-chipinput,
.inp[aria-invalid="true"] { border-color: var(--crit); }
.v6-field.is-error > .inp:focus-visible { outline-color: var(--crit); }
.v6-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px 12px;
  align-items: start;
}
/* a titled group of fields inside a form */
.v6-fieldset { display: grid; gap: 12px; min-width: 0; }
.v6-fieldset > legend,
.v6-form-h {
  width: 100%;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink);
}

/* ---------- a field that holds chips: fingerprint numbers ----------
   <div class="v6-chipinput">
     <span class="v6-chip"><bdi class="num">120</bdi><button type="button" aria-label="احذف 120"><svg><use href="#i-close"/></svg></button></span>
     <input type="text" inputmode="numeric" placeholder="أضف رقماً ثم Enter">
   </div> */
.v6-chipinput {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: var(--ctrl-h);
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  cursor: text;
  transition: border-color var(--t-fast) var(--ease);
}
.v6-chipinput:hover { border-color: var(--day-rule); }
.v6-chipinput:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.v6-chipinput > input {
  flex: 1 1 96px;
  min-width: 72px;
  height: 26px;
  padding: 0 5px;
  border: 0;
  background: none;
  font-size: var(--fs-body);
}
.v6-chipinput > input:focus-visible { outline: none; }
.v6-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding-inline: 8px 3px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--ink);
  white-space: nowrap;
}
.v6-chip > button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  color: var(--muted);
}
.v6-chip > button svg { width: 11px; height: 11px; }
.v6-chip > button:hover { background: var(--crit-soft); color: var(--crit); }
/* a number another employee already holds */
.v6-chip.is-clash { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 30%, transparent); color: var(--crit); }
/* a chip that cannot be removed (read from the device, shown for reference) */
.v6-chip.is-fixed { padding-inline: 8px; color: var(--ink-2); }

/* ---------- a choice row: one of several answers, each with a note ----------
   <label class="v6-choice">
     <input type="radio" name="rec-131" value="new">
     <span class="v6-choice-b"><b>موظف جديد</b><span>يُضاف إلى السجل برقم البصمة 131</span></span>
     <span class="v6-choice-e">…</span>                       (optional trailing)
   </label> */
.v6-choices { display: grid; gap: 6px; }
.v6-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.v6-choice:hover { border-color: var(--day-rule); }
.v6-choice > input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.v6-choice-b { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.v6-choice-b > b { font-size: var(--fs-body); font-weight: var(--w-500); line-height: var(--lh-cell); color: var(--ink); }
.v6-choice-b > span { font-size: var(--fs-micro); line-height: 1.55; color: var(--muted); }
.v6-choice-e { flex: none; align-self: center; font-size: var(--fs-label); color: var(--ink-2); }
.v6-choice:has(> input:checked) {
  border-color: var(--accent);
  background: var(--sel);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.v6-choice:has(> input:checked) .v6-choice-b > b { font-weight: var(--w-600); }
.v6-choice:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.v6-choice:has(> input:disabled) { opacity: .5; cursor: not-allowed; }

/* ============================================================
   8. A dense list — months, imports, backups, the audit log

   <ul class="v6-list">
     <li class="v6-row [is-current] [is-muted]">
       <span class="v6-row-i">…</span>                 (optional: a glyph, or a month number)
       <span class="v6-row-b">
         <b class="v6-row-t">أغسطس 2026 <span class="v6-stamp is-mini"></span></b>
         <span class="v6-row-m">144 موظفاً · 21 يوم دوام · استُورد 3 سبتمبر</span>
       </span>
       <span class="v6-row-f">…</span>                 (optional: trailing figures)
       <span class="v6-row-a">…buttons…</span>         (optional: actions)
     </li>
   </ul>
   Put it inside a .panel; the list draws only its row rules.
   ============================================================ */
/* One grid for the whole list and a subgrid per row, so the four parts are
   COLUMNS: the figures of one row stand under the figures of the row above,
   whatever each row's actions happen to be. Each part names its column, so a
   row that leaves one out does not pull the next part into its place. */
.v6-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  min-width: 0;
}
.panel > .v6-list { border-radius: inherit; overflow: hidden; }
.panel > .v6-list:not(:first-child) { border-start-start-radius: 0; border-start-end-radius: 0; }
.v6-row {
  position: relative;
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  column-gap: 12px;
  min-height: 52px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t-fast) var(--ease);
}
.v6-row-i { grid-column: 1; }
.v6-row-b { grid-column: 2; }
.v6-row-f { grid-column: 3; }
.v6-row-a { grid-column: 4; justify-content: flex-end; }
.v6-list > .v6-row:last-child { border-bottom: 0; }
.v6-row:hover { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.v6-row-i {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
}
.v6-row-i svg { width: 16px; height: 16px; }
.v6-row-b { flex: 1 1 auto; min-width: 0; display: grid; gap: 0; }
.v6-row-t {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-body);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.v6-row-t > bdi,
.v6-row-t > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v6-row-m {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v6-row-f {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding-inline-end: 8px;
  font-size: var(--fs-label);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
/* one trailing figure: the number over its word */
.v6-row-f > span { display: grid; justify-items: end; line-height: 1.35; }
.v6-row-f > span > b { font-size: var(--fs-body); font-weight: var(--w-600); color: var(--ink); }
.v6-row-f > span > i { font-size: var(--fs-micro); color: var(--muted); }
.v6-row-a { flex: none; display: flex; align-items: center; gap: 6px; }
.v6-row-a .btn { height: 28px; padding: 0 10px; font-size: var(--fs-label); border-radius: var(--r-sm); }
.v6-row-a .btn svg { width: 14px; height: 14px; }
.v6-row.is-current { background: var(--sel); }
.v6-row.is-current::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--accent);
}
.v6-row.is-muted .v6-row-t { color: var(--muted); font-weight: var(--w-400); }
.v6-row.is-muted .v6-row-i { background: none; border-style: dashed; border-color: var(--day-rule); }
/* an action that was undone stays on its row, struck through */
.v6-row.is-undone .v6-row-t > :first-child { text-decoration: line-through; color: var(--muted); }
/* a group heading between rows (a year, a day in the audit log) */
.v6-list-h {
  grid-column: 1 / -1;
  padding: 8px 16px 6px;
  background: var(--card-3);
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  color: var(--muted);
}

/* ============================================================
   9. An empty state that directs

   <div class="v6-empty">
     <h3>لا أشهر في البرنامج بعد</h3>
     <p>استورد ملف الجهاز لشهر واحد، ويُنشأ الشهر وموظفوه.</p>
     <div class="v6-empty-a">
       <button type="button" class="btn btn-solid">استورد ملف الجهاز</button>
       <button type="button" class="btn">أضف موظفين يدوياً</button>
     </div>
   </div>
   No illustration: a heading, one sentence, the next action.
   ============================================================ */
.v6-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 44px 20px 48px;
  text-align: center;
}
.v6-empty > h3 {
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.v6-empty > p {
  max-width: 52ch;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--muted);
}
.v6-empty-a {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================================
   10. The compact notice

   One line, a coloured edge, and — when there is more to say — a
   disclosure that keeps the paragraph out of the way until asked.

     <div class="v6-notice is-warn" role="status">
       <svg aria-hidden="true"><use href="#i-warn"/></svg>
       <p><b>266 يوماً</b> بلا ساعات محسوبة.</p>
       <a class="link" href="#check">افتح الفحص</a>          (optional action)
     </div>

     <details class="v6-notice is-warn">
       <summary>
         <svg aria-hidden="true"><use href="#i-warn"/></svg>
         <p><b>81 موظفاً</b> بلا سجلّ يُعتدّ به في هذا الشهر.</p>
         <span class="v6-notice-more">التفاصيل</span>
       </summary>
       <div class="v6-notice-d">…the paragraph…</div>
     </details>

   Levels: is-info · is-warn · is-crit · is-ok (none = neutral).
   ============================================================ */
.v6-notice {
  --_edge: var(--day-rule);
  --_ink: var(--muted);
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
  overflow: hidden;
}
.v6-notice::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--_edge);
}
div.v6-notice,
.v6-notice > summary {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 12px 7px 12px;
  padding-inline-start: 14px;
}
.v6-notice > summary { cursor: pointer; list-style: none; }
.v6-notice > summary::-webkit-details-marker { display: none; }
.v6-notice > summary:hover { background: var(--card-3); }
.v6-notice > summary:focus-visible { outline-offset: -2px; border-radius: var(--r); }
:is(div.v6-notice, .v6-notice > summary) > svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--_ink);
}
:is(div.v6-notice, .v6-notice > summary) > p { flex: 1 1 auto; min-width: 0; }
.v6-notice b { font-weight: var(--w-600); color: var(--ink); }
:is(div.v6-notice, .v6-notice > summary) > :is(.btn, .link) { flex: none; align-self: center; }
div.v6-notice > .btn { height: 26px; padding: 0 10px; font-size: var(--fs-label); border-radius: var(--r-sm); margin-block: -1px; }
.v6-notice-more {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: var(--w-500);
  white-space: nowrap;
}
.v6-notice-more::after {
  content: "";
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t) var(--ease);
}
.v6-notice[open] .v6-notice-more::after { transform: translateY(1px) rotate(-135deg); }
.v6-notice-d {
  padding: 8px 14px 10px;
  padding-inline-start: 39px;       /* under the sentence, not under the glyph */
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
}
.v6-notice-d > * { max-width: 96ch; }   /* the measure is the text's, not the rule's */
.v6-notice-d > * + * { margin-top: 6px; }
.v6-notice.is-info { --_edge: var(--accent);   --_ink: var(--accent); }
.v6-notice.is-warn { --_edge: var(--warn-2);   --_ink: var(--warn); }
.v6-notice.is-crit { --_edge: var(--crit-2);   --_ink: var(--crit); }
.v6-notice.is-ok   { --_edge: var(--good-2);   --_ink: var(--good); }
/* several notices in a row read as one block */
.v6-notice + .v6-notice { margin-top: 6px; }

/* ============================================================
   11. The dialog layout — head · body · foot

   For the three new hosts (#impBack, #staffBack, #sysBack), which
   reuse v5's .back > .modal. The layout class is .v6-dialog
   (.v6-kbd-free is accepted as the same thing):

     <div class="back" id="impBack">
       <div class="modal v6-dialog is-wide is-tall" role="dialog" aria-modal="true" aria-labelledby="impT">
         <header class="v6-dialog-h">
           <div><h3 id="impT">استيراد ملف الجهاز</h3><p>…one line…</p></div>
           <button type="button" class="btn btn-ghost v6-dialog-x" aria-label="إغلاق"><svg aria-hidden="true"><use href="#i-close"/></svg></button>
         </header>
         <ol class="v6-steps">…</ol>                          (the wizard only)
         <div class="v6-dialog-b">…scrolls…</div>
         <footer class="v6-dialog-f">
           <span class="v6-dialog-say">…what pressing the button will do…</span>
           <button type="button" class="btn">إلغاء</button>
           <button type="button" class="btn btn-primary">التالي</button>
         </footer>
       </div>
     </div>

   .modal.is-wide — 880px: a table or a two-column form inside.
   .modal.is-tall — a fixed height, so the dialog does not jump as
                    the wizard moves between steps of unequal length.
   ============================================================ */
.modal.is-wide { width: min(880px, 100%); }
.modal.is-xwide { width: min(1080px, 100%); }
.modal.is-tall { height: min(720px, calc(100vh - 40px)); max-height: none; }

.modal:is(.v6-dialog, .v6-kbd-free) {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  max-height: calc(100vh - 40px);
}
.v6-dialog-h {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px 12px 20px;
  padding-inline: 20px 14px;
  border-bottom: 1px solid var(--line);
}
.v6-dialog-h > div { flex: 1 1 auto; min-width: 0; }
.v6-dialog-h p {
  margin-top: 1px;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.v6-dialog-x { flex: none; width: 30px; height: 30px; padding: 0; color: var(--muted); }
.modal:is(.v6-dialog, .v6-kbd-free) > .v6-steps {
  flex: none;
  padding: 12px 20px 0;
  background: var(--card-3);
  border-bottom: 1px solid var(--line);
}
.modal:is(.v6-dialog, .v6-kbd-free) > .v6-steps > li { margin-bottom: -1px; }
.v6-dialog-b {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}
/* a table or a list that runs edge to edge inside the body */
.v6-dialog-b > .is-flush { margin-inline: -20px; }
.v6-dialog-f {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: var(--card-3);
}
/* the sentence that says what the primary button will do, at the footer's start */
.v6-dialog-say {
  flex: 1 1 auto;
  min-width: 0;
  margin-inline-end: 8px;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.v6-dialog-say b { color: var(--ink); font-weight: var(--w-600); }
/* a quiet action kept apart from the pair (رجوع, حذف) */
.v6-dialog-f > .is-start { margin-inline-end: auto; }

/* ============================================================
   12. The lock banner — under the page head, while the open
       month is locked

     <div class="v6-lockbar" id="v6LockBar">
       <div class="v6-lockbar-in">
         <span class="v6-stamp" role="img" aria-label="مُعتمَد"><b>مُعتمَد</b></span>
         <p><b>أغسطس 2026 مقفل.</b> الأرقام مجمّدة كما اعتُمدت في <bdi class="num">2026-09-03</bdi>.</p>
         <a class="btn btn-sm" href="#months">الأشهر والإقفال</a>
       </div>
     </div>

   74-v6-month.css's first form — a .note inside .v6-lockbar — keeps
   working and takes the same ground and edge.
   ============================================================ */
.v6-lockbar { padding: 10px var(--gutter) 0; }
.v6-lockbar-in,
.v6-lockbar > .note {
  max-width: var(--page-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 4px 12px;
  padding-inline-start: 10px;
  border: 1px solid color-mix(in srgb, var(--stamp) 26%, var(--line));
  border-radius: var(--r);
  background: var(--stamp-soft);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.v6-lockbar > .note { --_edge: var(--stamp); padding-inline-start: 14px; }
.v6-lockbar > .note svg { color: var(--stamp); margin-top: 0; }
.v6-lockbar-in > p { flex: 1 1 auto; min-width: 0; }
.v6-lockbar-in b { color: var(--ink); font-weight: var(--w-600); }
.v6-lockbar-in > .btn { flex: none; background: var(--card); }

/* ============================================================
   13. The first-run screen

     <div class="v6-landing">
       <div class="v6-landing-in">
         <header class="v6-landing-brand">
           <span class="mark" aria-hidden="true"><i></i></span>
           <div><b>دفتر الدوام</b><span>نظام الحضور والانصراف والرواتب</span></div>
         </header>
         <h1>ابدأ أول شهر</h1>
         <p class="v6-landing-lead">…</p>
         <div class="v6-doors">
           <button type="button" class="v6-door is-main" data-go="import">
             <span class="v6-door-i"><svg aria-hidden="true"><use href="#i-upload"/></svg></span>
             <b>استورد ملف الجهاز</b>
             <span>ملف شهر واحد من جهاز البصمة — تراجعه أولاً، ولا يُحفظ شيء قبل موافقتك.</span>
             <span class="v6-door-k">.xls · .xlsx · .csv</span>
           </button>
           <button type="button" class="v6-door" data-go="staff">…</button>
           <button type="button" class="v6-door" data-go="restore">…</button>
         </div>
         <footer class="credit">…the dedication, word for word…</footer>
       </div>
     </div>

   Three doors and nothing else. The first is the one most people
   want, so it is the wide one; it also takes a dropped file
   (.is-over while a file is held over it).
   ============================================================ */
.v6-landing {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--paper);
  padding: clamp(28px, 9vh, 96px) var(--gutter) 48px;
}
.v6-landing-in {
  width: 100%;
  max-width: 860px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.v6-landing-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.v6-landing-brand .mark {
  width: 44px;
  height: 44px;
  padding: 6px;
  border-radius: var(--r-lg);
  background: var(--spine);
}
.v6-landing-brand b {
  display: block;
  font-family: var(--font-title);
  font-size: var(--fs-lead);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
}
.v6-landing-brand span:not(.mark) { display: block; font-size: var(--fs-micro); color: var(--muted); }
.v6-landing h1 {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: var(--w-title);
  line-height: 1.45;
  color: var(--ink);
}
.v6-landing-lead {
  max-width: 60ch;
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--ink-2);
}
.v6-doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.v6-door {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  text-align: start;
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.v6-door:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 3%, var(--card)); }
.v6-door:focus-visible { outline-offset: 2px; border-radius: var(--r-lg); }
.v6-door-i {
  grid-row: 1 / span 3;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.v6-door-i svg { width: 20px; height: 20px; }
.v6-door > b {
  grid-column: 2;
  font-size: var(--fs-lead);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.v6-door > span:not(.v6-door-i) {
  grid-column: 2;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.v6-door-k {
  margin-top: 6px;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: end;
  font-size: var(--fs-micro);
}
/* the main door: the whole first line, midnight glyph, dashed when a file is over it */
.v6-door.is-main { grid-column: 1 / -1; padding: 20px; }
.v6-door.is-main .v6-door-i { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.v6-door.is-main > b { font-size: var(--fs-h2); }
.v6-door.is-over {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.v6-landing .credit { margin-top: 26px; }
@media (max-width: 700px) {
  .v6-doors { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   14. Print

   The chrome goes; the DAY language stays, because a strip may
   well be printed on an employee's sheet. 80-print.css re-declares
   the --day-* and --stamp tokens in ink values; here the cells are
   told to keep their fills and their forms — which is what tells
   absent from leave from mission on a printer with one ink.
   ============================================================ */
@media print {
  .v6-yearbar,
  .v6-steps,
  .v6-tabs,
  .v6-landing,
  .v6-empty-a,
  .v6-row-a,
  .v6-notice-more { display: none !important; }

  .v6-daystrip > :is(i, button),
  .v6-day,
  .v6-stamp,
  .v6-stamp.is-mini {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* no ground to rely on: every solid state also takes a hairline, so a
     printer told to drop backgrounds still leaves the cell's outline */
  .v6-daystrip > :is(i, button)[data-s]:not([data-s="none"]):not([data-s="out"]),
  .v6-day[data-s]:not([data-s="none"]):not([data-s="out"]) { outline: .3pt solid var(--ink); outline-offset: -.3pt; }
  .v6-daystrip > [data-s="off"], .v6-day[data-s="off"] { outline-color: var(--day-rule); }

  .v6-yg-row { break-inside: avoid; }
  .v6-notice, .v6-row { break-inside: avoid; }
  /* A closed <details> prints closed — CSS cannot open it. A screen that
     prints its notices must set `open` on them first (DESIGN.md §9). */
}

/* ── 77-v6-attend.css ─────────────────────────────── */

/* ============================================================
   77-v6-attend.css — the attendance screens in v6

   الغياب · الإضافي · المهمات · الإدارات · فحص البيانات · the punch editor.

   The v5 sheets of these screens (61, 63, 65, 66, 69, 71) are kept as they
   are; this file holds only what v6 added to them, and — for الغياب — the
   column plan that changed when the day strip took the place of the bar
   and the share meter. Everything is built from the kit (76-v6-kit.css):
   .v6-daystrip, .v6-daystrip-legend, .v6-notice, .v6-list, .v6-empty.

   What the kit did not have, and is built here:
     · .v6-notice.is-gold   — a notice about a value that departs from its
                              layer (الإجازات غير المعتمدة). Gold has that one
                              meaning; the kit's four levels are states.
     · a button ON a <details> notice's line — the kit sizes one for the
                              <div> form only.
     · .att-notes           — notices laid two abreast while there is room.
   ============================================================ */

/* ---------- notices, side by side ----------
   A notice is one line now, and one line does not need 1,300px. Two abreast
   halves what the notices take from the table; an opened one takes the
   whole row, because its paragraph is prose and wants the measure. */
.att-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 6px;
  align-items: start;
}
/* the kit spaces stacked notices with a margin; in a grid the gap does it */
.att-notes > .v6-notice + .v6-notice { margin-top: 0; }
.att-notes > .v6-notice[open] { grid-column: 1 / -1; }

.v6-notice.is-gold { --_edge: var(--gold-mark); --_ink: var(--gold-ink); }

/* The act a notice offers rides on its line — the same small button the
   kit gives the <div> form. */
.v6-notice > summary > .btn {
  height: 26px;
  padding: 0 10px;
  font-size: var(--fs-label);
  border-radius: var(--r-sm);
  margin-block: -1px;
}
.v6-notice-d .btn { vertical-align: middle; }

/* ============================================================
   الغياب
   ============================================================ */

/* ---------- the column plan ----------
   The strip is a fixed object — 31 days are 351px (224px small) — so its
   column is sized for it, strip + 20px (DESIGN.md §6.2), and the name takes
   what is left. Two plans, chosen by 73-absence.js from the room the screen
   really has (absStripSize): the full strip with air around the figures,
   and the small strip with every figure column pulled in, which is what
   lets a 1280px window show the whole sheet — name, days, the four verdict
   counts and both payroll figures — without a sideways scroll.

   Floors are the sized columns plus the least the name may have. */
.abs-t { min-width: 1055px; }                 /*  815 + 240 */
.abs-t.has-pay { min-width: 1255px; }         /* 1015 + 240 */
.abs-t.is-sm { min-width: 804px; }            /*  616 + 188 */
.abs-t.is-sm.has-pay { min-width: 972px; }    /*  798 + 174 — fits the 975px a 1280 window leaves */

.abs-t .abs-c-rk   { width: 60px; }
.abs-t .abs-c-emp  { width: auto; min-width: 240px; }
.abs-t .abs-c-days { width: 371px; }          /* 351 + 20 */
.abs-t .abs-c-n    { width: 84px; }
.abs-t .abs-c-d    { width: 72px; }
.abs-t .abs-c-d.grp { width: 84px; }          /* «غياب» opens the second pair: + the group's air */
.abs-t .abs-c-m    { width: 128px; }

.abs-t.is-sm .abs-c-rk   { width: 52px; }
.abs-t.is-sm .abs-c-emp  { min-width: 174px; }
.abs-t.is-sm .abs-c-days { width: 244px; }    /* 224 + 20 */
.abs-t.is-sm .abs-c-n    { width: 72px; }
.abs-t.is-sm .abs-c-d    { width: 62px; }
.abs-t.is-sm .abs-c-d.grp { width: 62px; }
.abs-t.is-sm .abs-c-m    { width: 120px; }
/* the small plan has no room for the group's air; the hues keep the two
   pairs apart on their own */
table.tbl.abs-t.is-sm .grp { padding-inline-start: 10px; }

/* ---------- «تحديد موظفين» ----------
   The checkbox rides in the rank cell, before the expander, so no column is
   added to the three places that write the order out (absCols). The cell
   grows by ABS_PICK_W (73-absence.js) and the floors with it. */
.abs-t.has-pick                 { min-width: 1081px; }   /* 1055 + 26 */
.abs-t.has-pick.has-pay         { min-width: 1281px; }
.abs-t.has-pick.is-sm           { min-width: 830px; }
.abs-t.has-pick.is-sm.has-pay   { min-width: 998px; }
.abs-t.has-pick .abs-c-rk       { width: 86px; }
.abs-t.has-pick.is-sm .abs-c-rk { width: 78px; }
.abs-t .abs-sel {
  width: 16px;
  height: 16px;
  margin: 0;
  margin-inline-end: 6px;
  vertical-align: middle;
  accent-color: var(--accent);
  cursor: pointer;
}
.panel-head .abs-pick[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.selbar .msn-open svg { width: 15px; height: 15px; }

/* The bulk confirm's two fields (absBulkFill), inside askConfirm's <p>. */
.abs-bulk-f {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  font-size: var(--fs-label);
  color: var(--ink-2);
}
.abs-bulk-f.check { flex-direction: row; align-items: center; color: var(--ink); }
.abs-bulk-f .inp { width: 100%; }

/* ---------- the strip's cell ----------
   Never clipped and never ellipsised mid-strip (§6.2): the column was sized
   for it. The caption under it may shorten; the picture may not. */
table.tbl.abs-t > tbody > tr > td.abs-c-days {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.abs-strip {
  display: grid;
  justify-items: start;
  gap: 1px;
  min-width: 0;
}
/* What the picture cannot say by itself: «حضر 2 من 22», «بلا بصمات هذا
   الشهر», «15 قبل المباشرة». A caption, not a badge — it explains the strip
   above it and competes with nothing. */
.abs-cap {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.abs-cap > i {
  font-style: normal;
  margin-inline: 5px;
  color: var(--day-rule);
}
.abs-cap-w { color: var(--warn); }
.abs-cap-o { color: var(--ink-2); }

/* The count stands alone now — the bar beside it went with the strip. */
.abs-t td.abs-c-n b { font-weight: var(--w-600); color: var(--ink); }

/* ---------- the legend ----------
   Between the card's head and the table: the key to the states that occur
   in the strips below, and only those. */
.abs-legend {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- the fold: days outside the person's service ----------
   A heading row opens each group — «قبل المباشرة», «بعد ترك العمل» — after
   the days somebody has to judge. */
.abs-days tr.abs-d-grp > th {
  padding: 9px 10px 6px;
  text-align: start;
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
  line-height: var(--lh-cell);
  color: var(--muted);
  background: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  white-space: normal;
}
.abs-days tr.abs-d-grp > th b { font-weight: var(--w-600); color: var(--ink-2); }
.abs-d-grp-d::before,
.abs-d-grp-n::before { content: "·"; margin-inline: 4px 6px; color: var(--day-rule); }
/* These rows are not asking for the eye the way an undecided absence does:
   the marker that 61-absence.css draws on an unset day goes quiet. */
.abs-days tr.abs-d-row.is-out:not(.is-set) td:first-child::before { background: var(--day-rule); }
.abs-days tr.abs-d-row.is-out > td:nth-child(-n + 2) { color: var(--muted); }

/* One sentence under the day table: what the service dates say of these
   days, or what would settle the guess — with the door to the person's file. */
.abs-d-svc {
  font-size: var(--fs-micro);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 110ch;
}
.abs-d-svc b { font-weight: var(--w-600); color: var(--ink); }
.abs-d-svc.is-warn b { color: var(--warn); }
.abs-d-svc .btn { margin-inline-start: 6px; vertical-align: middle; }

/* The holiday offer's dates, inside the notice's paragraph. */
.v6-notice-d .abs-hol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-inline-start: 0;
}

/* ============================================================
   The punch editor — the day, asked before there is a person
   ============================================================ */
.pxd-pickday { margin-top: 12px; }
.pxd-pickday .inp { width: 220px; max-width: 100%; }
.pxd-pickday .pxd-hint {
  display: block;
  margin-top: 5px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.pxd-pickday + .pxd-err { margin-top: 10px; }
.pxd-pickday ~ .pxd-pick { margin-top: 12px; }

/* ============================================================
   الإدارات — the quiet way out to the register of people
   ============================================================ */
.dp-manage { font-size: var(--fs-label); white-space: nowrap; }

/* ============================================================
   فحص البيانات — what was imported into the month
   ============================================================ */
.ck-imports .panel-head .link { font-size: var(--fs-label); white-space: nowrap; }
/* The engine's own reading of the month's rows, under the list of files. */
.ck-read {
  padding: 9px 16px 10px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.ck-read b { font-weight: var(--w-600); color: var(--ink); }
/* a card's own empty state is smaller than a page's */
.ck-noimp { padding-block: 26px 28px; }
.ck-fix .btn svg { width: 14px; height: 14px; }

/* ============================================================
   Print
   ============================================================ */
@media print {
  /* Paper reads every notice in full (v6OpenNotices opened them), one under
     the other, and none of them offers an act. */
  .att-notes { display: block; }
  .att-notes > .v6-notice + .v6-notice { margin-top: 4pt; }
  .v6-notice > summary > .btn,
  .v6-notice-d .abs-hol,
  .abs-d-svc .btn,
  .dp-manage { display: none !important; }

  .abs-t, .abs-t.has-pay, .abs-t.is-sm, .abs-t.is-sm.has-pay { min-width: 0; }
  .abs-legend { padding-inline: 0; }
}

/* ── 77-v6-depts.css ─────────────────────────────── */

/* ============================================================
   77. الإدارات (95-v6-depts.js) · what the two registers share
   (97-v6-lists.js) · the salary in the employee's form (93)

     1  the tabs        سجل الإدارات · حضور الشهر — links, one per route
     2  the figures     the strip of tiles over a register; each a filter
     3  the toolbar     the files line under the filters
     4  the table       the departments, a count with its meter
     5  how paid        the method, its figure, whose decision it is
     6  a department    the view: facts as a definition list, its people
     7  the form        the salary fieldset of the employee's form

   Tokens only (10-tokens.css). Gold means one thing in this program: a
   setting that departs from the layer above — «قاعدة خاصة», «خاص».
   ============================================================ */

/* 1. The tabs. Inside the register's card they replace its head; over the
   month's rollup (#scDepts) they stand alone, as a card of their own. */
.dm { display: grid; gap: 12px; min-width: 0; }
.dm-panel { min-width: 0; }
.dm-tabs.is-solo {
  padding-inline: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  margin-bottom: 12px;
}
.dm-tabs .v6-tabs-n bdi { unicode-bidi: isolate; }

/* 2. The figures. Five or four tiles in one line; a tile is a button: it
   filters the list under it, and says so with the pressed ground. */
.dm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.dm-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--card-2);
  color: var(--ink);
  text-align: start;
  font: inherit;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dm-stat:hover { border-color: var(--line); background: var(--card-3); }
.dm-stat > b { font-size: var(--fs-num-lg); font-weight: var(--w-700); line-height: var(--lh-tight); }
.dm-stat > span { font-size: var(--fs-label); color: var(--ink-2); }
.dm-stat > i {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.dm-stat[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); }
.dm-stat.is-warn > b { color: var(--warn); }
.dm-stat.is-warn > i { color: var(--warn); }
.dm-stat.is-gold > b { color: var(--gold-ink); }
.dm-stat.is-fixed > b,
.dm-stat.is-fixed > i { color: var(--fixed-ink); }
.dm-stat.is-fixed { box-shadow: inset 0 3px 0 var(--fixed); }

/* 3. The files line: quieter than the filters above it, and the same height. */
.sf-bar.dm-files { padding-block: 6px; background: var(--card-2); }
.sf-bar.dm-files .btn { background: var(--card); }
.dm-sep { width: 1px; height: 18px; background: var(--line); margin-inline: 2px; }

/* 4. The departments' table. */
.dm-tw { border-radius: 0 0 var(--r-lg) var(--r-lg); }
table.tbl.dm-tbl { min-width: 1040px; }
.dm-tbl col.c-n    { width: 132px; }
.dm-tbl col.c-arch { width: 92px; }
.dm-tbl col.c-pay  { width: 250px; }
.dm-tbl col.c-sw   { width: 132px; }
.dm-tbl col.c-act  { width: 292px; }
table.tbl.dm-tbl > tbody > tr > td { padding-block: 8px; }
table.tbl.dm-tbl td.c-act,
table.tbl.dm-tbl td.c-pay { overflow: visible; text-overflow: clip; }
.dm-tbl tr.is-arch .dm-name,
.dm-tbl tr.is-none td { color: var(--muted); }
.dm-nm { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.dm-ico {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-label);
}
.dm-ico svg { width: 15px; height: 15px; }
.dm-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  font-weight: var(--w-600);
  color: var(--ink);
  text-align: start;
  border-radius: var(--r-xs);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
.dm-name:hover { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dm-cnt { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; width: 100%; }
.dm-meter {
  flex: none;
  width: 56px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--card-3);
  overflow: hidden;
}
.dm-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--m-1); }
.dm-sws { display: inline-flex; gap: 4px; }
.dm-sw {
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  background: var(--card-2);
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent);
}
.dm-sw[data-on="1"] { background: var(--good-soft); color: var(--good); text-decoration: none; }

/* 5. How a person (or a department) is paid — one line: the method, the
   figure, and whose decision it is when it is not the general rule's. */
.v6p { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; white-space: nowrap; }
.v6p-k { font-size: var(--fs-label); color: var(--ink-2); }
.v6p-f { font-weight: var(--w-600); color: var(--ink); }
.v6p-u { margin-inline-start: 3px; font-size: var(--fs-micro); font-weight: var(--w-400); color: var(--muted); }
.v6p[data-k="none"] .v6p-k { color: var(--muted); }
/* بانتظار تعيين راتب (2026-11-25): said in the warning colour — someone has yet to decide */
.v6p[data-k="pending"] .v6p-k { color: var(--warn); font-weight: var(--w-500); }
.v6p[data-k="hourly"] .v6p-k { color: var(--m-3); }
.v6p[data-k="fixed"] .v6p-k { color: var(--fixed-ink); font-weight: var(--w-600); }

/* the employees' register, narrowed to one department */
.sf-scope {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--accent-soft);
  font-size: var(--fs-label);
  color: var(--ink-2);
}
.sf-scope > span { margin-inline-end: auto; }
.sf-first { margin-top: 6px; font-size: var(--fs-label); color: var(--warn); }

/* 6. A department, viewed. */
.modal.dm-view { width: min(900px, 100%); }
.dm-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0 0 8px;
}
.dm-facts > div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--card-2);
}
.dm-facts dt { font-size: var(--fs-micro); color: var(--muted); }
.dm-facts dd { margin: 0; font-size: var(--fs-label); color: var(--ink); }
.dm-v-note { margin: 4px 0 16px; font-size: var(--fs-label); color: var(--muted); }
.dm-v-tw { border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
table.tbl.dm-v-tbl { min-width: 720px; }
.dm-v-tbl col.c-num { width: 120px; }
.dm-v-tbl col.c-pay { width: 210px; }
.dm-v-tbl col.c-st  { width: 104px; }
.dm-v-tbl col.c-act { width: 172px; }
table.tbl.dm-v-tbl > tbody > tr > td { padding-block: 6px; }
table.tbl.dm-v-tbl td.c-act { overflow: visible; text-overflow: clip; }
.dm-v-tbl tr.is-arch .nm { color: var(--muted); }
.dm-v-empty { padding-block: 20px; }
.dm-x-added { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; padding: 0; list-style: none; }
.dm-x-added > li { padding: 2px 10px; border-radius: var(--r-pill); background: var(--good-soft); color: var(--good); font-size: var(--fs-label); }
.dm-x-tbl col.c-n { width: 72px; }
.dm-x-tbl col.c-st { width: 46%; }
.sf-xl-tbl col.c-pay { width: 120px; }

/* 7. The salary in the employee's form. */
.sf-payset {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-2);
}
.sf-payset > legend { padding-inline: 6px; }
.sf-pm { display: flex; flex-wrap: wrap; }
.sf-pm > button { flex: 1 1 auto; }
.sf-pay-off {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-label);
}
.sf-pay-off svg { flex: none; width: 16px; height: 16px; }
.sf-sws { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.sf-sw > span { font-size: var(--fs-label); color: var(--ink-2); }
.sf-sw input:disabled + i,
.sf-sw input:disabled ~ span { opacity: .5; }
.sf-sw:has(input:disabled) { cursor: default; }
.sf-pay-more { margin: 0; font-size: var(--fs-micro); color: var(--muted); }

@media print {
  .dm-tabs { display: none !important; }
}

/* ── 77-v6-staff-gone.css ─────────────────────────────── */

/* «سلة المحذوفات» — a page of its own on the rail (93-v6-staff-gone.js, 2026-12-05) */
.sfg-panel .sfg-stats { padding: 14px 16px 0; border-bottom: 0; }
.sfg-stat { font: inherit; text-align: start; cursor: pointer; }
.sfg-stat.is-key > b { color: var(--warn); }
.sfg-stat.is-on { border-color: var(--accent); background: var(--accent-soft); }

.sfg-bar { flex-wrap: wrap; gap: 8px; }
.sfg-bar .inp { width: auto; min-width: 140px; }
.sfg-bar .sfg-q { min-width: 260px; flex: 0 1 340px; }
.sfg-bar .sfg-q .inp { width: 100%; }
.sfg-bar .sp { flex: 1; }
.sfg-dates { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); color: var(--ink-2); }
.sfg-dates .inp { min-width: 0; width: 150px; }

/* what is ticked, and the two things done to all of it */
.sfg-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--accent-soft); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.sfg-selbar b { margin-inline-end: 6px; }

.sfg-scroll { overflow-x: auto; }
table.tbl.sfg-t { table-layout: auto; width: 100%; min-width: 1080px; }
table.tbl.sfg-t td, table.tbl.sfg-t th { vertical-align: top; white-space: normal; max-width: none; overflow: visible; text-overflow: clip; line-height: 1.6; }
table.tbl.sfg-t thead th { white-space: nowrap; }
table.tbl.sfg-t th.sfg-n { text-align: start; font-weight: var(--w-400); min-width: 200px; max-width: 300px; }
table.tbl.sfg-t .sfg-tick { width: 34px; text-align: center; }
table.tbl.sfg-t .sfg-tick input { width: 16px; height: 16px; cursor: pointer; }
table.tbl.sfg-t tr.is-sel > * { background: var(--accent-soft); }
table.tbl.sfg-t td:nth-child(3), table.tbl.sfg-t td:nth-child(5), table.tbl.sfg-t td:nth-child(6) { white-space: nowrap; }
table.tbl.sfg-t td:nth-child(7) { min-width: 120px; }
table.tbl.sfg-t td:nth-child(8) { min-width: 160px; max-width: 240px; }
table.tbl.sfg-t td.sfg-why { min-width: 170px; max-width: 280px; }
table.tbl.sfg-t .mute, table.tbl.sfg-t .tag { font-size: .88em; }
table.tbl.sfg-t .sfg-acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
table.tbl.sfg-t .tag.sfg-in { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
table.tbl.sfg-t .tag.sfg-back { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.sfg-foot { padding: 10px 16px 14px; margin: 0; }

#cfNote { width: 100%; resize: vertical; min-height: 52px; font: inherit; }

/* ── 77-v6-staff.css ─────────────────────────────── */

/* ============================================================
   77. سجل الموظفين (93-v6-staff.js)

   A register of people and a list of departments in one card, the
   employee's form, and the Excel import. Built from the kit
   (76-v6-kit.css) and v5's controls; what is here is only what
   those two do not already say:

     1  the screen     the toolbar under the tabs, the table's
                       columns, a row's three worded actions
     2  departments    a name that is pressed
     3  the form       the facts line, «إدارة جديدة…», the acts
                       beside the fields, the merge picker
     4  Excel          the drop target, the column mapper, the
                       preview's status cell

   No colour, radius or shadow that 10-tokens.css does not define.
   ============================================================ */

/* ============================================================
   1. The screen
   ============================================================ */
.sf { display: grid; gap: 12px; min-width: 0; }
.sf-panel { min-width: 0; }

/* The toolbar: one dense line under the tabs — 32px controls, like the
   filter row and a card's head. It wraps before it overflows. */
.sf-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.sf-bar .inp { height: var(--ctrl-h-sm); font-size: var(--fs-label); }
.sf-bar .btn { height: var(--ctrl-h-sm); padding: 0 11px; font-size: var(--fs-label); }
.sf-bar .btn svg { width: 15px; height: 15px; }
.sf-bar select.inp { width: auto; min-width: 136px; max-width: 230px; }
.sf-bar .sf-q { flex: 0 1 270px; min-width: 170px; }
.sf-sp { flex: 1 1 0; min-width: 0; }
.sf-bar-say { font-size: var(--fs-label); color: var(--muted); }
/* «تحديد» is a toggle: pressed, it wears the selection's own ground */
.sf-bar .btn[aria-pressed="true"] {
  background: var(--sel);
  border-color: var(--accent);
  color: var(--ink);
}

/* ---------- the table ----------
   Eight columns and an optional ninth for the tick. Everything but the name
   has a width; the name takes what is left, and below the floor the table
   scrolls inside its card rather than squeezing a four-part name to nothing. */
.sf-tw { border-radius: 0 0 var(--r-lg) var(--r-lg); }
/* The name takes what the others leave. With the worded buttons (up to
   560px) the fixed columns ate the whole 1080 and the name showed nothing
   (2026-11-16); as icons, the name keeps ≥ 185px even at the floor. */
table.tbl.sf-tbl { min-width: 1080px; }
/* the tick's column is added to the floor, never taken from the name */
table.tbl.sf-tbl.has-pick { min-width: 1118px; }
.sf-tbl col.c-pick { width: 38px; }
.sf-tbl col.c-dept { width: 15%; }
.sf-tbl col.c-pay  { width: 168px; }
.sf-tbl col.c-fid  { width: 112px; }
.sf-tbl col.c-num  { width: 100px; }
.sf-tbl col.c-st   { width: 118px; }
/* icon buttons, 28px each + 6px gap + the cell's padding */
.sf-tbl col.c-act  { width: 168px; }
.sf-tbl.has-fpspread col.c-act { width: 202px; }   /* + «نسخ البصمة على باقي الأجهزة» */
.sf-tbl.has-fpenroll col.c-act { width: 236px; }   /* + «سجّل بصمة من القارئ» (Windows) */
.sf-tbl.has-tune col.c-act { width: 202px; }                 /* + «خصّص» (2026-11-25) */
.sf-tbl.has-tune.has-fpspread col.c-act { width: 236px; }
.sf-tbl.has-tune.has-fpenroll col.c-act { width: 270px; }

/* A row holds 28px buttons, so its padding gives way: 8 + 28 + 8 and the
   rule is the 45px row every other register has. (Written with the child
   combinators on purpose — see DESIGN.md §5 on the shared rule's weight.) */
table.tbl.sf-tbl > tbody > tr > td { padding-block: 8px; }
table.tbl.sf-tbl :is(td, th).c-pick { padding-inline: 12px 0; text-overflow: clip; }
.sf-tbl input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  vertical-align: middle;
  cursor: pointer;
}
.sf-tbl td.c-name .nm { font-weight: var(--w-500); color: var(--ink); }
.sf-tbl tr.is-arch td.c-name .nm,
.sf-tbl tr.is-arch td.c-dept { color: var(--muted); }
table.tbl.sf-tbl td.c-act { overflow: visible; text-overflow: clip; }
.sf-acts { display: flex; justify-content: flex-end; gap: 6px; }
.sf-acts .btn.sf-ib { width: 28px; padding: 0; justify-content: center; }
.sf-acts .btn.sf-ib svg { width: 15px; height: 15px; }
.sf-acts .btn.sf-ib.is-danger:hover { color: var(--crit); border-color: var(--crit); }

/* a sortable header is a button in a header cell: the th keeps aria-sort */
.sf-th-btn {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: inherit;
  font: inherit;
  border-radius: var(--r-xs);
}
.sf-th-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; }

/* numbers, as quiet tags */
.sf-ids { display: inline-flex; align-items: center; gap: 4px; min-width: 0; vertical-align: middle; }

/* «يُعرض 12 موظفاً من 144» — under a filtered table */
.sf-count {
  padding: 8px 16px 10px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-micro);
  color: var(--muted);
}

/* ============================================================
   2. Departments
   ============================================================ */
.sf-depts .v6-row-i svg { width: 16px; height: 16px; }
/* The name opens the department's people: it reads as the title it is, and
   says it can be pressed when the pointer or the focus reaches it. */
.sf-dname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  color: inherit;
  text-align: start;
  border-radius: var(--r-xs);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
.sf-dname:hover {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ============================================================
   3. The employee's form
   ============================================================ */
.modal.sf-dlg { width: min(620px, 100%); }
/* a wizard step is the same dialog turning a page: it does not arrive again */
.modal.sf-still { animation: none; }

/* the footer's line, when it carries a refusal */
.sf-say.is-err { color: var(--crit); font-weight: var(--w-500); }

/* «إدارة جديدة…»: the name is typed under the list it was chosen from */
.sf-newdept { display: grid; gap: 4px; }
.sf-newdept > span { font-size: var(--fs-micro); line-height: 1.55; color: var(--muted); }

/* what the program knows about the person and nobody types */
.sf-facts {
  display: grid;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.sf-pay { font-size: var(--fs-label); line-height: var(--lh-body); color: var(--ink-2); }

/* The acts that are not fields — archive, merge, delete — behind one quiet
   disclosure, so the form opens on the fields and nothing dangerous is one
   stray press away. */
.sf-more {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.sf-more > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ctrl-h);
  padding: 0 12px;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  border-radius: var(--r);
}
.sf-more > summary::-webkit-details-marker { display: none; }
.sf-more > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: auto;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t) var(--ease);
}
.sf-more[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.sf-more > summary:hover { background: var(--card-3); color: var(--ink); }
.sf-more > summary:focus-visible { outline-offset: -2px; }
.sf-more-b { border-top: 1px solid var(--line-soft); }
.sf-act {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.sf-more-b > :last-child { border-bottom: 0; }
.sf-act > div { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.sf-act b { font-size: var(--fs-label); font-weight: var(--w-600); color: var(--ink); }
.sf-act span { font-size: var(--fs-micro); line-height: 1.55; color: var(--muted); }
.sf-act .btn { flex: none; }

/* the merge picker: a search over a short list, opened under its own row */
.sf-merge {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line-soft);
}
.sf-merge > label { font-size: var(--fs-label); font-weight: var(--w-500); color: var(--ink-2); }
.sf-merge-list {
  display: grid;
  gap: 1px;
  align-content: start;
  height: 190px;                   /* a fixed window: the form must not jump as the list narrows */
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.sf-merge-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-cell);
  line-height: var(--lh-cell);
  cursor: pointer;
}
.sf-merge-opt:hover { background: var(--card-2); }
.sf-merge-opt > input {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.sf-merge-opt > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--w-500);
  color: var(--ink);
}
.sf-merge-opt > span {
  flex: none;
  margin-inline-start: auto;
  font-size: var(--fs-micro);
  color: var(--muted);
  white-space: nowrap;
}
.sf-merge-opt:has(> input:checked) { background: var(--sel); }
.sf-merge-opt:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.sf-merge-none { padding: 10px 8px; font-size: var(--fs-label); color: var(--muted); }
.sf-merge.is-error > .v6-err { display: block; }
.sf-merge-a { display: flex; justify-content: flex-end; gap: 6px; }

/* ============================================================
   4. Excel
   ============================================================ */
/* The way in: a target a file can be dropped on, which is also a button. */
.sf-drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  padding: 34px 20px 30px;
  border: 1.5px dashed var(--day-rule);
  border-radius: var(--r-lg);
  background: var(--card-3);
  color: var(--ink-2);
  text-align: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.sf-drop:hover,
.sf-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.sf-drop:focus-visible { outline-offset: 2px; border-radius: var(--r-lg); }
.sf-drop-i {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.sf-drop-i svg { width: 20px; height: 20px; }
.sf-drop > b { font-size: var(--fs-lead); font-weight: var(--w-600); line-height: var(--lh-cell); color: var(--ink); }
.sf-drop > span { font-size: var(--fs-label); line-height: var(--lh-body); color: var(--muted); }
.sf-drop-k { direction: ltr; unicode-bidi: isolate; font-size: var(--fs-micro); margin-top: 4px; }
.sf-xl-say { font-size: var(--fs-label); line-height: var(--lh-body); color: var(--ink-2); }
.sf-xl-say b { color: var(--ink); font-weight: var(--w-600); }

/* which column is which — shut when the program found them by itself */
.sf-xl-map {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.sf-xl-map > summary {
  padding: 7px 12px;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--r);
}
.sf-xl-map > summary .mute { font-weight: var(--w-400); }
.sf-xl-map > summary:hover { background: var(--card-3); }
.sf-xl-map > summary:focus-visible { outline-offset: -2px; }
.sf-xl-map > .v6-field-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
}

.sf-xl-depts { align-items: flex-start; }

/* the preview: what each row will do */
.sf-xl-tw { border-radius: 0; border-block: 1px solid var(--line-soft); }
.sf-xl-tbl col.c-n    { width: 62px; }
.sf-xl-tbl col.c-fid  { width: 104px; }
.sf-xl-tbl col.c-num  { width: 110px; }
.sf-xl-tbl col.c-dept { width: 17%; }
.sf-xl-tbl col.c-hire { width: 112px; }
.sf-xl-tbl col.c-st   { width: 36%; }
table.tbl.sf-xl-tbl > tbody > tr > td,
table.tbl.sf-xl-skip > tbody > tr > td { padding-block: 8px; }
table.tbl.sf-xl-tbl > tbody > tr > td.c-st { white-space: normal; }
table.tbl.sf-xl-tbl :is(th, td):first-child,
table.tbl.sf-xl-skip :is(th, td):first-child { padding-inline-start: 20px; }
table.tbl.sf-xl-tbl :is(th, td):last-child,
table.tbl.sf-xl-skip :is(th, td):last-child { padding-inline-end: 20px; }
/* a row that adds nothing reads quieter than one that does */
.sf-xl-tbl tr:is([data-st="same"], [data-st="sample"], [data-st="noname"]) td { color: var(--muted); }
.sf-xl-note { font-size: var(--fs-micro); color: var(--warn); }
/* «قالب الرواتب»: what he is paid now, beside what the file says */
.sf-xl-tbl.is-pay col.c-dept { width: 15%; }
.sf-xl-tbl.is-pay col.c-now  { width: 22%; }
.sf-xl-tbl.is-pay col.c-pay  { width: 15%; }
.sf-xl-tbl.is-pay col.c-st   { width: 26%; }
table.tbl.sf-xl-tbl.is-pay > tbody > tr > td:nth-child(4) { color: var(--ink-2); white-space: normal; }
/* the currency the line changes, on a line of its own under the figure */
.sf-xl-cur { display: block; font-size: var(--fs-micro); color: var(--ink-2); white-space: normal; }
.sf-xl-skip col.c-n { width: 62px; }
.sf-xl-skip col.c-name { width: 38%; }
table.tbl.sf-xl-skip > tbody > tr > td:last-child { white-space: normal; }
.sf-xl .sf-count { padding: 0; border-top: 0; }
/* «استيراد المهمات» (95-v6-msnxl.js): the two dates, the nature, the days written */
.sf-xl-tbl.is-msn col.c-name { width: 22%; }
.sf-xl-tbl.is-msn col.c-day  { width: 96px; }
.sf-xl-tbl.is-msn col.c-nat  { width: 17%; }
.sf-xl-tbl.is-msn col.c-days { width: 76px; }
.sf-xl-tbl.is-msn col.c-st   { width: 30%; }
table.tbl.sf-xl-tbl.is-msn > tbody > tr > td:nth-child(2),
table.tbl.sf-xl-tbl.is-msn > tbody > tr > td:nth-child(5) { white-space: normal; }
.sf-xl-tbl tr:is([data-st="off"], [data-st="out"], [data-st="overlap"]) td { color: var(--muted); }
.msx-file { display: block; color: var(--muted); }

/* «الرقم الذاتي مكرَّر» (93-v6-staff.js sfDupHtml) — one block per number,
   one line per person holding it, the three ways out at the line's end. */
.sf-dup .v6-notice-d > * { max-width: none; }
.sf-dup-g { border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--card); }
.sf-dup-k { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
.sf-dup-k b { color: var(--crit); font-variant-numeric: tabular-nums; }
.sf-dup-p {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 6px 10px;
}
.sf-dup-p + .sf-dup-p { border-top: 1px solid var(--line-soft); }
.sf-dup-n { font-weight: var(--w-600); }
.sf-dup-a { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.sf-dup-a .btn { height: 26px; padding: 0 10px; font-size: var(--fs-label); }

/* ── 78-v6-missing.css ─────────────────────────────── */

/* ══ ملزمون بالدوام وليسوا في ملف البصمات (76-v6-missing.js) ══════
   A warning, so the orange of a diagnostic that wants the eye — and a
   panel, not a note: every name in it waits for a decision. */

.mis-panel {
  margin-bottom: 14px;
  border-color: color-mix(in srgb, var(--warn-2) 45%, var(--line));
  box-shadow: inset 0 3px 0 var(--warn-2);
  overflow: hidden;
  /* «راجعهم» scrolls here: clear of the sticky page head and filter bar */
  scroll-margin-top: 160px;
}
.mis-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: color-mix(in srgb, var(--warn-soft) 70%, var(--card));
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: pointer;
}
.mis-head:hover { background: color-mix(in srgb, var(--warn-soft) 95%, var(--card)); }
.mis-head:focus-visible { outline: 2px solid var(--warn); outline-offset: -2px; }
.mis-head > svg { width: 20px; height: 20px; flex: none; color: var(--warn); }
.mis-head h3 { margin: 0; flex: 1; min-width: 0; font-size: var(--fs-h3, 1rem); color: var(--warn); }
/* folded / unfolded: «إظهار ⌄» · «إخفاء ⌃» */
.mis-fold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink-2);
}
.mis-fold svg { width: 18px; height: 18px; transition: transform .15s ease; }
.mis-panel.is-open .mis-fold svg { transform: rotate(180deg); }
.mis-body[hidden] { display: none !important; }
.mis-intro {
  margin: 0;
  padding-block: 0 10px;
  padding-inline: 46px 16px;
  background: color-mix(in srgb, var(--warn-soft) 70%, var(--card));
  color: var(--ink-2);
  font-size: var(--fs-label);
  line-height: 1.7;
}
.mis-intro b { color: var(--ink); }

.mis-list { list-style: none; margin: 0; padding: 0; }
.mis-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--line-soft);
}
.mis-who { display: flex; flex-direction: column; min-width: 0; }
.mis-nm { font-weight: var(--w-600); color: var(--ink); text-align: start; }
.mis-dept { font-size: var(--fs-micro); color: var(--muted); }
.mis-now { font-size: var(--fs-label); color: var(--ink-2); }
.mis-now b { color: var(--crit); }
.mis-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.mis-acts .btn.is-fixed { color: var(--fixed-ink); border-color: color-mix(in srgb, var(--fixed) 45%, var(--line)); }
.mis-acts .btn.is-danger { color: var(--crit); }
.mis-more, .mis-foot {
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-label);
  color: var(--muted);
}
.mis-foot b { color: var(--ink-2); }
.mis-ov { margin-bottom: 12px; }

@media (max-width: 900px) {
  .mis-row { grid-template-columns: 1fr; }
  .mis-acts { justify-content: flex-start; }
}

@media print { .mis-panel, .mis-ov { display: none !important; } }

/* بحث وتصفية في القائمة (2026-11-25) */
.mis-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.mis-tools .mis-q { flex: 1 1 260px; min-width: 0; margin: 0; }
.mis-tools .mis-dept-f { flex: 0 1 240px; min-width: 160px; }
.mis-count { margin: 0 0 8px; font-size: var(--fs-label); color: var(--muted); }
.mis-none { margin: 6px 0 10px; font-size: var(--fs-label); color: var(--muted); }

/* ── 78-v6-person-all.css ─────────────────────────────── */

/* ============================================================
   الملف الشامل (v6) — 94-v6-person-all.js

   The overview's cards, and the three tabs of the other pages'
   records (الإجازات · السلف · طلبات الراتب). Built from the kit
   (.panel, .panel-head, .tbl, .tag, .kpis) and the loans page's
   own schedule (79-v6-loans.css .ln-lines, .ln-lock, .ln-sub);
   what is added is the grid of cards and their label-over-value
   facts. Tokens only.
   ============================================================ */

.pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  min-width: 0;
}
.pa-card { display: flex; flex-direction: column; min-width: 0; }
.pa-card > .panel-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.pa-card > .panel-head .meta { margin-inline-end: auto; }
.pa-card-b { flex: 1; }

.pa-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px 16px 14px;
}
.pa-facts > div {
  min-width: 0;
  padding: 8px 10px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.pa-facts dt { font-size: var(--fs-micro); line-height: var(--lh-cell); color: var(--muted); }
.pa-facts dd {
  margin: 2px 0 0;
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  overflow-wrap: anywhere;
}
.pa-none { margin: 0; padding: 14px 16px 16px; font-size: var(--fs-label); color: var(--muted); }
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 12px 16px 0; }

.pa-tbl { width: 100%; }
.pa-tbl td.ln-act { text-align: end; white-space: nowrap; }
.pa-tbl .ln-sub { margin-top: 2px; }
#paLeaves > .panel-head .meta,
#paPq > .panel-head .meta,
#paLoansHead > .panel-head .meta { margin-inline-end: auto; }
#paLeaves > .pa-tbl,
#paPq > .pa-tbl { margin: 12px 0 0; }

.pa-loan > .panel-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.pa-loan > .panel-head .meta { margin-inline-end: auto; }
.pa-doors { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pa-loan > .ln-lines { margin: 0 16px 16px; width: calc(100% - 32px); }

/* ── 78-v6-person.css ─────────────────────────────── */

/* ============================================================
   ملف الموظف (v6) — 94-v6-person.js

   One employee across the months: a header, three tabs, and under
   them the month, the year or the record.

   Built from the kit (76-v6-kit.css: .v6-tabs, .v6-daystrip,
   .v6-yeargrid, .v6-list, .v6-row, .v6-empty, .v6-notice), the
   summary band (62-overview.css: .kpis) and the register's own
   pay blocks (64-register.css: .emp-split, .emp-calc, table.days)
   — none of them is redefined here. What this file adds is the
   header, the column ledger beside each strip of the year grid,
   and the room those borrowed blocks need when they stand in a
   page instead of a dialog.

   Tokens only: no colour, radius or size is named here that
   10-tokens.css does not define.
   ============================================================ */

.ps,
.ps-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}
/* consecutive notices read as one group (30-shell.css does the same for the
   five month screens) */
.ps-body > .v6-notice + .v6-notice { margin-top: -6px; }
.ps-body > * { min-width: 0; }

.ps-wait {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-label);
}

/* ============================================================
   1. The header — who, and the doors

   One card: the way back and the actions on its first line, the
   name as the page's one large title, the facts of the record as a
   ruled line of label-over-value pairs, and the tabs as its foot —
   so the tabs read as belonging to the person, not to the page.
   ============================================================ */

.ps-head { display: grid; min-width: 0; }

.ps-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 16px 0;
}
.ps-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--ctrl-h-sm);
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-sm);
}
/* The sprite's chevron points to the physical right — in an Arabic page,
   back the way one came. */
.ps-back svg { width: 14px; height: 14px; flex: none; }
.ps-back:hover { color: var(--accent); }

.ps-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.ps-acts .btn { height: var(--ctrl-h-sm); padding: 0 11px; font-size: var(--fs-label); }
.ps-acts .btn svg { width: 15px; height: 15px; }
/* the two doors keep the hue their editors wear everywhere else
   (69-punches.css, 64-register.css) */
.ps-acts .px-open svg { color: var(--gold-mark); }
.ps-acts .msn-open svg { color: var(--m-3-ink); }

.ps-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 16px 0;
}
.ps-avat {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  font-size: var(--fs-h2);
}
.ps-who { min-width: 0; display: grid; gap: 1px; }
.ps-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-family: var(--font-title);
  font-size: var(--fs-h1);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
/* a status is said in the text face, beside the title and not in it */
.ps-name .badge { font-family: var(--font); }
.ps-alias {
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  color: var(--muted);
}

.ps-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
  padding: 14px 16px;
}
.ps-fact {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding-inline: 18px;
  border-inline-start: 1px solid var(--line-soft);
}
.ps-fact:first-child { padding-inline-start: 0; border-inline-start: 0; }
.ps-fact dt {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.ps-fact dd {
  font-size: var(--fs-body);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}

/* the tabs close the card: their rule is the card's own edge, so the one
   they draw moves to their top */
.ps-head > .v6-tabs {
  border-bottom: 0;
  border-top: 1px solid var(--line-soft);
}
.ps-head > .v6-tabs > button { margin-bottom: 0; }

/* ============================================================
   2. هذا الشهر
   ============================================================ */

/* Seven figures. The shared band stops at five columns; seven in one line
   need ~1230px of bench, and below that they fall to four and three. */
.ps-band.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) {
  .ps-band.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* four days, then two hour figures and the money: the net takes the two
     cells the second line has left, so the band has no hole in it */
  .ps-band.kpis .kpi:last-child { grid-column: span 2; }
}
@media (min-width: 1500px) {
  body:not(.drawer-open) .ps-band.kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  body:not(.drawer-open) .ps-band.kpis .kpi:last-child { grid-column: auto; }
}

/* The locked month's own notice: the stamp where a notice keeps its glyph,
   and the stamp's ink on its edge — the one place this page uses it. */
.v6-notice.ps-locked { --_edge: var(--stamp); align-items: center; }
.v6-notice.ps-locked > .v6-stamp { flex: none; }
.v6-notice.ps-locked > .btn { text-decoration: none; }

/* The month as days. 31 large cells are 796px: on a narrow bench the strip
   scrolls inside its card rather than pushing the page sideways. */
.ps-strip-b {
  display: grid;
  gap: 12px;
  padding: 16px 16px 14px;
  overflow-x: auto;
}
.ps-strip-b > .v6-daystrip { justify-self: start; }

/* The register's pay blocks, on a page. In the dialog «أيام الفترة» is a
   bordered card of its own inside a scrolling box; here the panel IS the
   card, so the inner border would be a box in a box — it becomes a section
   of the panel, ruled off from the arithmetic under it. Its 14px of padding
   stays: the band inside it bleeds to exactly that edge (78-v6-register.css). */
.ps-pay > .emp-split {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line-soft);
}
.ps-pay > .emp-calc { padding: 12px 14px 14px; }
.ps-pay > .panel-head .meta { flex: 1 1 320px; min-width: 0; text-align: end; }

/* The register's folded day list (regDetailHtml), hosted in a table of its
   own: one row, one cell, the register's markup inside. The fold's sunken
   ground and its two hairlines belong to a row opened INSIDE a table; on a
   card of its own they would be a box in a box. */
.ps-fold {
  width: 100%;
  border-collapse: collapse;
  /* One cell, and it must be the card's width and no wider: under the auto
     algorithm the cell grows to the day table's 840px floor and pushes the
     whole page sideways on a narrow bench. Fixed, the cell keeps the card's
     width and the day table scrolls inside .detail-in. */
  table-layout: fixed;
}
.ps-fold tr.detail > td {
  background: none;
  box-shadow: none;
  white-space: normal;
}
.ps-fold .detail-in { overflow-x: auto; padding: 12px 16px 14px; }
.ps-fold .detail-in table.days { min-width: 840px; }
.ps-fold .detail-in .detail-head h4 {
  flex: 0 1 auto;
  margin-inline-end: auto;
  font-size: var(--fs-h3);
  color: var(--ink);
}
.ps-fold .detail-in h4 bdi { font-weight: var(--w-600); }
.ps-fold .msn-open svg { color: var(--m-3-ink); }
.ps-fold .px-open svg { color: var(--gold-mark); }

/* ============================================================
   3. السنة — the grid, and the ledger beside each strip

   The kit lays a row as  name | strip | totals  and leaves the
   totals free-flowing. Here they are seven figures that must be
   read DOWN the year, so they take fixed columns — one per figure,
   named once in the head row — then the month's state and its door.
   ============================================================ */

.ps-year > .panel-head > h3 { margin-inline-end: 0; }
.ps-year > .panel-head > .meta,
.ps-log > .panel-head > .meta { margin-inline-end: auto; }

/* the kit's year stepper, at a card head's height */
.ps-year-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: var(--ctrl-h-sm);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.ps-year-step .v6-year-step { height: 100%; }

.ps-year-b {
  overflow-x: auto;
  container: psyear / inline-size;
}
.ps-year .v6-yeargrid { min-width: 1100px; padding-block: 4px; }

/* 84 name + 341 strip + this ledger (632) + gaps and padding = 1113px. */
.v6-yg-t.ps-yg-t {
  display: grid;
  grid-template-columns: repeat(4, 40px) 58px 58px 112px 84px minmax(96px, 1fr);
  align-items: center;
  column-gap: 8px;
  flex-wrap: nowrap;
}
.ps-yg-t > * { min-width: 0; }
/* figures on the trailing edge of their column */
.ps-yg-t > .ps-yg-c,
.ps-yg-t > .ps-yg-h { justify-content: flex-end; }
.ps-yg-t > .v6-yg-net { min-width: 0; margin-inline-start: 0; }
.ps-yg-t > .ps-yg-s { justify-content: flex-start; padding-inline-start: 8px; color: var(--muted); }
.ps-yg-t > .ps-yg-a { justify-content: flex-end; }
.ps-yg-a .btn { height: 26px; }

/* a month with nothing to show says so across the figure columns */
.ps-yg-t > .ps-yg-none { grid-column: 1 / 8; color: var(--muted); }

.ps-yg-t.is-head {
  align-items: end;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.ps-yg-t.is-head > .v6-yg-net { font-weight: var(--w-500); color: var(--muted); }
.ps-yg-t.is-head .v6-day { margin-bottom: 4px; }

/* the year's own line: a rule above it, the card's footer ground */
.v6-yg-row.ps-yg-total {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--card-3);
  font-weight: var(--w-600);
  color: var(--ink);
}
.ps-yg-total .ps-yg-t { color: var(--ink); }
.ps-yg-say {
  font-size: var(--fs-micro);
  font-weight: var(--w-400);
  color: var(--muted);
}
.ps-year .v6-yg-row:nth-last-child(2) { border-bottom: 0; }

/* A bench too narrow for the whole ledger: the strip drops to its small
   size, the columns tighten and the state word goes — the mini stamp and
   the «أرقام قديمة» notice above the card still say it. */
@container psyear (max-width: 1119px) {
  .ps-year .v6-yeargrid { min-width: 800px; column-gap: 12px; }
  .ps-year .v6-yeargrid .v6-daystrip { --_w: 6px; --_h: 14px; --_ot: 3px; --_g: 1px; --_r: 1.5px; }
  .v6-yg-t.ps-yg-t {
    grid-template-columns: repeat(4, 34px) 50px 50px 100px minmax(92px, 1fr);
    column-gap: 6px;
  }
  .ps-yg-t > .ps-yg-s { display: none; }
  .ps-yg-t.is-head .v6-day { display: none; }
}

/* ============================================================
   4. السجل
   ============================================================ */

.ps-log > .v6-list { border-start-start-radius: 0; border-start-end-radius: 0; }
.ps-log .v6-row { min-height: 46px; }
.ps-log .v6-row-m { white-space: normal; }
/* each kind of line wears the hue its subject wears on its own screen */
.ps-log .v6-row[data-ps-kind="mission"] .v6-row-i { color: var(--m-3-ink); }
.ps-log .v6-row[data-ps-kind="leave"] .v6-row-i { color: var(--m-4-ink); }
.ps-log .v6-row[data-ps-kind="mark"] .v6-row-i { color: var(--m-8-ink); }
.ps-log .v6-row[data-ps-kind="edit"] .v6-row-i { color: var(--gold-mark); }

/* ============================================================
   5. Print

   A person's page is not a sheet — the employee report is
   (85-report.js), and «اطبع ملف الموظف» prints that. 74-v6-month.css
   already keeps #scPerson off the paper; this is the same promise
   made by the file that owns the page.
   ============================================================ */
@media print {
  #scPerson { display: none !important; }
}

/* ── 78-v6-register.css ─────────────────────────────── */

/* ============================================================
   78. v6 — كشف الحضور والرواتب, the employee dialog, نظرة عامة,
       الإعدادات and the printed sheets

   What v6 adds to the screens 64-register.css, 62-overview.css,
   68-settings.css and 72-report.css already paint. Those files are
   v5's and are not edited; this one loads after them, so a rule here
   that repeats one of their selectors wins by order alone.

   Tokens and kit classes only. No colour is written here.

   Contents
     1  the register: the day-strip column, its key, the doors
     2  the employee dialog: the large strip and the ruled band
     3  نظرة عامة
     4  الإعدادات
     5  the export menu and the PDF dialog
     6  print
   ============================================================ */

/* ============================================================
   1. The register

   One column was added — the month, one cell a day — and four were
   dropped from the default view. The arithmetic of the floor:

     rank 60 · days 63 ×3 · hours 112 · average 92            = 453
     + money 108 ×3                                            = 777
     the strip: 31 days at 9px = 351, + the cell's 16 padding  → 369
                31 days at 6px = 224, + 16                     → 242
     the name: 250 at the floor (two lines, the chip, the door)

   The strip is drawn at its full size wherever the full size leaves
   the name its 250px, and at the kit's small size everywhere else.
   That is a fact about the ROOM the table has, so it is asked of the
   card (a container query), not of the window and not of the script:
   at 1600 with the rail open the card is 1330px — the attendance
   sheet wears the full strip, the payroll sheet the small one, and
   neither scrolls sideways; on a 1920 monitor both wear the full one.

   The small size is the kit's own `.is-sm`, reached through the same
   custom properties that class sets (76-v6-kit.css §2) — the markup
   carries no size at all, so nothing has to be redrawn when the
   window is resized. If the kit renames those properties, this block
   moves with them.
   ============================================================ */

.reg-panel { container: regpanel / inline-size; }

.reg { min-width: 891px; }              /* 435 + 242 + 214 */
.reg.has-pay { min-width: 1203px; }     /* 747 + 242 + 214 */
/* DESIGN.md §9.10: the selection column's 34px are added to the floor, not
   taken from the name. */
.reg.has-pick { min-width: 925px; }
.reg.has-pay.has-pick { min-width: 1237px; }

.reg col.c-days { width: 242px; }
.reg td.c-days .v6-daystrip {
  --_w: 6px; --_h: 14px; --_ot: 3px; --_g: 1px; --_wk: 2px; --_r: 1.5px;
}

@container regpanel (min-width: 1020px) {
  .reg:not(.has-pay):not(.has-pick) { min-width: 1018px; }
  .reg:not(.has-pay):not(.has-pick) col.c-days { width: 369px; }
  .reg:not(.has-pay):not(.has-pick) td.c-days .v6-daystrip {
    --_w: 9px; --_h: 18px; --_ot: 4px; --_g: 2px; --_wk: 3px; --_r: 2px;
  }
}
@container regpanel (min-width: 1054px) {
  .reg.has-pick:not(.has-pay) { min-width: 1052px; }
  .reg.has-pick:not(.has-pay) col.c-days { width: 369px; }
  .reg.has-pick:not(.has-pay) td.c-days .v6-daystrip {
    --_w: 9px; --_h: 18px; --_ot: 4px; --_g: 2px; --_wk: 3px; --_r: 2px;
  }
}
@container regpanel (min-width: 1332px) {
  .reg.has-pay:not(.has-pick) { min-width: 1330px; }
  .reg.has-pay:not(.has-pick) col.c-days { width: 369px; }
  .reg.has-pay:not(.has-pick) td.c-days .v6-daystrip {
    --_w: 9px; --_h: 18px; --_ot: 4px; --_g: 2px; --_wk: 3px; --_r: 2px;
  }
}
@container regpanel (min-width: 1366px) {
  .reg.has-pay.has-pick { min-width: 1364px; }
  .reg.has-pay.has-pick col.c-days { width: 369px; }
  .reg.has-pay.has-pick td.c-days .v6-daystrip {
    --_w: 9px; --_h: 18px; --_ot: 4px; --_g: 2px; --_wk: 3px; --_r: 2px;
  }
}

/* The strip is a picture: it is never ellipsised, and a period shorter than
   31 days stands at the column's start, under its heading. */
table.tbl.reg tbody td.c-days {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  line-height: 0;
}

/* ---------- the key ----------
   One quiet line between the card's head and the table: the states that are
   on this screen, in the language's own order. */
.reg-key {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  min-height: 31px;
  padding: 5px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--card-3);
}
.reg-key-l {
  flex: none;
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  color: var(--muted);
}
.reg-key .v6-daystrip-legend { color: var(--ink-2); }

/* The scrollport, again: 64-register.css sums what stands above it, and the
   key is 31px more of that. */
.reg-panel .tw {
  max-height: calc(100vh - var(--ubar-h) - var(--phead-h) - 16px - 49px - 31px - 18px);
}

/* ---------- the door to the person's file ----------
   Last on the name cell's second line, at the line's far end. Quiet — there
   is one per row — and it answers the pointer and the keyboard by taking the
   link colour: a word that is pressed, never a glyph alone. */
.reg-door {
  flex: none;
  margin-inline-start: auto;
  padding: 0 3px;
  border-radius: 3px;
  color: var(--muted);
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
tr:hover .reg-door { color: var(--accent); }
.reg-door:hover,
.reg-door:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- somebody who never punched ----------
   Said in words on the row (a .tag), and the row's measures go quiet: they
   are true zeros, and five bold zeros would shout about nothing. The strip
   and the payroll figures keep their full ink — a month of absence and what
   it cost are exactly what this row is for. */
.reg-nopunch { flex: none; }
.reg tr.is-nopunch td.c-d,
.reg tr.is-nopunch td.c-h b,
.reg tr.is-nopunch td.c-avg { color: var(--muted); }
.reg tr.is-nopunch td.c-h b { font-weight: var(--w-400); }

/* ---------- what the strip replaced ----------
   أرقام البصمة · متوسط الوصول · متوسط المغادرة · البصمات, as one line of
   labelled facts in the fold's head and the dialog's. */
.reg-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0 0 10px;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.reg-facts > span { white-space: nowrap; }
.reg-facts i { color: var(--muted); margin-inline-end: 3px; }
.reg .detail-in .reg-facts { margin-top: -2px; }

.reg-nodays {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}

/* طريقة الراتب (76-register.js regPayFilterHtml). Chosen, the box says so:
   a narrowed table must never read as the whole month. راتب ثابت wears the
   colour its rows wear. */
.reg-payf { display: inline-flex; }
.reg-payf.is-on .inp { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent); font-weight: 600; }
.reg-payf.is-fixed .inp { border-color: var(--fixed); background-color: var(--fixed-soft); color: var(--fixed-ink); }

/* ============================================================
   2. The employee dialog
   ============================================================ */

.emp-head .reg-facts { margin: 3px 0 0; }

/* The two doors out of the month, beside the source chip. */
.emp-doors {
  display: flex;
  flex: none;
  gap: 6px;
  margin-top: 1px;
}
.emp-doors .btn svg { width: 14px; height: 14px; color: var(--muted); }

/* ---------- «أيام الفترة وأثرها في الراتب» ----------
   v5: one proportional bar and five bordered tiles. v6: the days themselves
   at the large size, their key, and the five figures as ONE ruled band — the
   form every summary in the app has. The class names are the tiles'
   (76-register.js keeps them); only the paint is replaced. */
.sp-strip {
  overflow-x: auto;
  /* room for the focus ring of a pressable day and for the scrollbar */
  padding: 2px 1px 4px;
}
.emp-split .v6-daystrip-legend { margin-top: 4px; }

.sp-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 12px -14px 0;
  border-block: 1px solid var(--line-soft);
}
/* nothing after the band: it closes the card, whose own edge is the rule */
.sp-band:last-child { margin-bottom: -14px; border-bottom: 0; }

.sp-band .sp-t {
  gap: 1px;
  padding: 10px 14px 0;
  border: 0;
  border-inline-start: 1px solid var(--line-soft);
  border-radius: 0;
  background: none;
  overflow: visible;
}
.sp-band .sp-t:first-child { border-inline-start: 0; }
/* a figure is ink; a measured STATE keeps its hue (DESIGN.md §8) — so
   attendance, which is no state at all, stops borrowing one */
.sp-band .sp-t.t-att { --hue-ink: var(--ink); }
.sp-band .sp-l { font-weight: var(--w-500); }

/* The mark beside each label is the strip's own cell for that part, which
   makes the band the strip's key. 64-register.css draws `.sp-l i` as an 8px
   dot; a day is a 9×14 cell. */
.sp-band .sp-l i.v6-day {
  width: 9px;
  height: 14px;
  border-radius: 2px;
  vertical-align: 0;
}
/* «غير مدفوعة»: on the strip it is a day marked leave like any other, so its
   mark is the leave's, hollow — the same day, not paid. */
.sp-band .sp-t.t-unpaid .sp-l i.v6-day {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--day-leave);
}
.sp-band .sp-t.is-zero .sp-l i.v6-day { opacity: .45; }

/* The foot: what these days did to the pay. It closes every cell on the
   same line, whatever stands above it. */
.sp-band .sp-m {
  /* two lines — the words, then the money — so the five rules are one rule */
  min-height: 56px;
  margin: 8px -14px 0;
  padding: 7px 14px 9px;
  border-top: 1px solid var(--line-soft);
  background: none;
}

@media (max-width: 860px) {
  .sp-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-band .sp-t { border-block-start: 1px solid var(--line-soft); margin-block-start: -1px; }
}

/* ============================================================
   3. نظرة عامة

   The log's head rows: the device files the month was imported
   from (74-overview.js, ovImportRowsHtml). The same row as the
   engine's lines, with a rule under the last of them — files
   first, then what was done to their rows.
   ============================================================ */
.ov-log-row.is-file .ov-log-s { color: var(--ink); }
.ov-log-row.is-file + .ov-log-row:not(.is-file) {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

/* ============================================================
   5. The PDF dialog

   Two ways out of one prepared page, so its footer holds three
   buttons and the scope sentence; the sentence gives way first.
   ============================================================ */
#pdfBack .modal-acts { flex-wrap: wrap; }
#pdfBack .modal-acts #pdfScope { flex: 1 1 180px; min-width: 0; }

/* ============================================================
   6. Paper

   The stamp of a locked month in the two mastheads (85-report.js
   repLockStamp): at the far end of the title row. In the scoped
   report the title is centred, so the stamp is hung at the row's
   inline end, out of the flow — it must not move the title, and
   the paginator must not measure it. 80-print.css gives --stamp
   its ink value; on screen (the report is measured on screen)
   it wears the theme's.
   ============================================================ */
.rep-title { position: relative; }
.rep-title > .rep-approved {
  position: absolute;
  inset-inline-end: 3pt;
  top: 50%;
  margin: 0;
  transform: translateY(-50%) rotate(-5deg);
}
.rep-approved > b { font-size: 9pt; line-height: 1.6; }
.rep-approved > i { font-size: 7pt; }
.ph-file > .rep-approved { margin-block: 0; }
/* the same fact in words, on the pages that carry no title */
.rep-lock { color: var(--stamp); font-weight: var(--w-600); }

@media print {
  /* The floors above are the SCREEN's: they are what makes .tw scroll. Paper
     cannot scroll, so the table takes the sheet's width and the columns are
     restated in points — 273mm across, the strip at the kit's small size,
     the name with what is left (about 68mm). */
  .reg, .reg.has-pay, .reg.has-pick, .reg.has-pay.has-pick { min-width: 0 !important; }
  .reg col.c-rk { width: 24pt; }
  .reg col.c-days { width: 176pt !important; }
  .reg col.c-d { width: 36pt; }
  .reg col.c-h { width: 50pt; }
  .reg col.c-avg { width: 40pt; }
  .reg col.c-m { width: 66pt; }
  .reg td.c-days .v6-daystrip {
    --_w: 6px !important; --_h: 14px !important; --_ot: 3px !important;
    --_g: 1px !important; --_wk: 2px !important; --_r: 1.5px !important;
  }
  /* A bar and a meter are for comparing rows at a glance on a screen; on a
     signed sheet the figure is the record, and the column is the figure's. */
  .reg td.c-h .bar,
  .reg-meter .track { display: none !important; }

  /* The key prints: a sheet of coloured cells with no legend is a riddle on
     paper as much as on screen. The doors do not — nothing is pressed there. */
  .reg-key { padding: 3pt 0; background: none !important; border-bottom: .5pt solid var(--line); }
  .reg-door,
  .emp-doors { display: none !important; }
  .reg-panel .tw { max-height: none; }
  .reg-nodays { border: 0; padding: 0; }
}

/* ── 79-v6-loans.css ─────────────────────────────── */

/* ══════════════════════════════════════════════════════════════
   79-v6-loans — «السلف» (97-v6-loans.js, 2026-11-02)

   The leaves page's frame (79-v6-traits.css .lv-*): figures, a notice, a
   bar of filters, a table. A row opens its schedule under it. Existing
   tokens only (DESIGN.md §0).
   ══════════════════════════════════════════════════════════════ */

.ln-panel .ln-stats { padding: 14px 16px 0; border-bottom: 0; }
.ln-stat { cursor: default; }
.ln-stat:hover { border-color: var(--line-soft); background: var(--card-2); }
.ln-stat.is-key > b { color: var(--accent); }
.ln-panel > .v6-notice { margin: 12px 16px 0; }

.ln-bar { flex-wrap: wrap; gap: 8px; }
.ln-bar .inp { width: auto; min-width: 130px; }
.ln-bar .ln-q { min-width: 220px; flex: 0 1 260px; }
.ln-bar .ln-q .inp { width: 100%; }
.ln-bar .sp { flex: 1; }
.ln-dates { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); color: var(--ink-2); }
.ln-dates .inp { min-width: 0; }

.ln-tbl th.ln-emp { text-align: start; font-weight: var(--w-600); vertical-align: top; }
.ln-tbl .nm { font-weight: var(--w-600); }
.ln-sub { display: block; font-size: var(--fs-micro); color: var(--muted); font-weight: var(--w-400, 400); }
.ln-tbl td.ln-act { text-align: end; white-space: nowrap; }
.ln-tbl tr.ln-row.is-open > * { background: var(--sel); }
.ln-prog { min-width: 120px; }
.ln-bar-t { display: block; height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.ln-bar-t > i { display: block; height: 100%; background: var(--good-2, var(--good)); border-radius: 99px; }

.tag.ln-on { background: var(--accent-soft); color: var(--accent); }
.tag.ln-ok { background: var(--good-soft); color: var(--good); }
.tag.ln-mute { background: var(--card-2); color: var(--muted); }

/* the schedule, under its row */
.ln-tbl tr.ln-more > td { padding: 0; background: var(--card-2); }
.ln-detail { padding: 14px 16px 16px; display: grid; gap: 12px; }
.ln-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.ln-facts > div { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 8px 10px; }
.ln-facts dt { font-size: var(--fs-micro); color: var(--muted); }
.ln-facts dd { margin: 2px 0 0; font-weight: var(--w-600); }
.ln-note { margin: 0; font-size: var(--fs-label); color: var(--ink-2); }
.ln-note.is-warn { color: var(--warn); }
.ln-lines { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); }
.ln-lines td.ln-act { text-align: end; white-space: nowrap; }
.ln-lines tr.is-now > * { background: var(--accent-soft); }
.ln-lines tr.ln-st-post > *, .ln-lines tr.ln-st-waived > * { color: var(--muted); }
.ln-lock { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-micro); color: var(--stamp, var(--muted)); }
.ln-lock svg { width: 12px; height: 12px; }
.ln-doors { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-doors .btn-danger-q { color: var(--crit); }
.ln-foot { padding: 10px 16px 14px; margin: 0; }

/* the dialogs: askConfirm() holds them in a <p>, so they are spans laid out here */
.ln-f { display: grid; gap: 4px; margin: 10px 0 0; }
.ln-f-l { font-size: var(--fs-label); color: var(--ink-2); }
.ln-f-h { font-size: var(--fs-micro); color: var(--muted); }
.ln-f-v { display: block; padding: 7px 0; font-weight: var(--w-600); }
.ln-f select[size] { min-height: 150px; margin-top: 6px; }
.ln-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ln-say { display: block; margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink); font-size: var(--fs-label); }

/* ── 79-v6-months.css ─────────────────────────────── */

/* ============================================================
   الأشهر والاستيراد (v6) — 80-library.js

   The kit carries almost all of it: the list and its rows
   (.v6-list / .v6-row), the stamp, the notice, the empty state,
   the form. What is here is what the kit has no word for:

     1. the screen's stack and the bar of two doors above the list;
     2. a MONTH as a group — its row, the files it was fed from
        beneath it, and the review that opens under it;
     3. the review before a lock: a checklist whose settled lines
        are quiet;
     4. the one-line form that creates a month without a file.

   Tokens only. The stamp's colour is used by the stamp and by
   nothing else in this file.
   ============================================================ */

/* ============================================================
   1. The screen
   ============================================================ */

.mon-screen {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

/* The two ways a month begins. Not a card: it holds no data, only the
   sentence that explains the screen and the doors. */
.mon-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: var(--ctrl-h);
}
.mon-bar-say {
  flex: 1 1 320px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.mon-bar-a {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-inline-start: auto;
}

/* a dot between two facts on one line */
.mon-dot { color: var(--day-rule); }
/* the clock, quieter than the date it follows */
.mon-time { color: var(--muted); }

/* ============================================================
   2. A month — the row, its files, its review

   <li.mon-m> takes the list's four columns on (subgrid) and hands
   them to its .v6-row, so the figures of every month still stand
   under each other; what lies beneath the row spans them all. The
   rule between months is the group's, not the row's.
   ============================================================ */

.mon-list > .mon-m {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  min-width: 0;
  border-bottom: 1px solid var(--line-soft);
}
.mon-list > .mon-m:last-child { border-bottom: 0; }
.mon-m > .v6-row {
  border-bottom: 0;
  padding-block: 10px;
}

/* name and period on one side of the body, the stamp on the other */
.mon-b {
  display: flex;
  align-items: center;
  gap: 8px 18px;
}
.mon-id {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.mon-name {
  font-family: var(--font-title);
  font-size: var(--fs-lead);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
}
/* The big stamp keeps its own 9px of room; here it must not stretch the row
   more than it has to. */
.mon-b > .v6-stamp.is-lg { margin-block: 5px; }

/* «الأرقام تحتاج تحديثاً» — the ribbon's dot, with its sentence */
.mon-stale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--warn);
}
.mon-stale > i {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn-2);
}

/* The figures. Each kind is one width, so a column is a column whether or
   not a month has all three. */
.v6-row-f > .mon-fig.is-n { min-width: 62px; }
.v6-row-f > .mon-fig.is-net { min-width: 138px; }
.mon-fig > i { font-style: normal; }
.mon-fig .cur { margin-inline-start: 4px; font-size: var(--fs-micro); font-weight: var(--w-400); color: var(--muted); }

/* The verbs. «امسح» is destructive, but only once the pointer is on it — a
   red button on every row of a list whose main verb is «افتح» misreads the
   screen. */
.mon-acts { flex-wrap: wrap; max-width: 380px; }
.mon-del { color: var(--muted); }
.mon-del:hover {
  background: var(--crit-soft);
  border-color: color-mix(in srgb, var(--crit) 40%, transparent);
  color: var(--crit);
}

/* ---------- the files beneath ----------
   Starts under the month's name (row padding 16 + glyph 32 + gap 12), so the
   glyph column stays the month's own. */
.mon-imps {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0 16px 10px;
  margin-inline-start: 60px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 0;
}
p.mon-imps {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.mon-imp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  color: var(--ink-2);
}
.mon-imp > svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mon-imp-n {
  flex: 0 1 auto;
  min-width: 56px;
  max-width: 38%;
  font-weight: var(--w-500);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mon-imp-m {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--fs-micro);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mon-imp-a,
.mon-imp-u { flex: none; }
.mon-imp-u { gap: 4px; }               /* a .tag is a flex line: the space before its date is a gap */
.mon-imp-a { color: var(--ink-2); }
/* an import that was undone stays on its month, struck: the line still has
   to answer «where did these punches go» */
.mon-imp.is-undone .mon-imp-n { text-decoration: line-through; color: var(--muted); font-weight: var(--w-400); }

/* ============================================================
   3. The review before a lock

   Opens under the month's row. A card inside the card — bordered,
   not shadowed; it does not float. A line that is still open
   leads with its count; a settled line is a check and a sentence.
   ============================================================ */

.mon-review {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 2px 16px 14px;
  margin-inline-start: 60px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
}
.mon-review:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.mon-review-h {
  padding: 11px 16px 10px;
  background: var(--card-3);
  border-bottom: 1px solid var(--line-soft);
}
.mon-review-h > h4 {
  font-family: var(--font-title);
  font-size: var(--fs-h3);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.mon-review-h > p {
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}

/* One grid for the list and a subgrid per line: the counts are a column, as
   wide as the widest of them («1,918 يوماً»), and what they count starts on
   one edge. */
.mon-checks {
  display: grid;
  /* auto, not 18px, for the glyph: a subgrid's own padding is taken out of
     its edge tracks, and a fixed track would leave the glyph 2px to stand in */
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  column-gap: 10px;
}
.mon-check {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  min-height: 46px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line-soft);
}
/* the state, as a form and not only a colour: a ring that is still open, a
   check that is settled, a dash where the question does not arise */
.mon-check-i {
  grid-column: 1;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.mon-check[data-state="open"] > .mon-check-i::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--warn-2);
}
.mon-check[data-state="off"] > .mon-check-i::before {
  content: "";
  width: 9px;
  height: 2px;
  border-radius: 1px;
  background: var(--day-rule);
}
.mon-check-i > svg {
  width: 17px;
  height: 17px;
  color: var(--good-2);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mon-check-n {
  grid-column: 2;
  min-width: 58px;
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  white-space: nowrap;
}
.mon-check-t {
  grid-column: 3;
  min-width: 0;
  display: grid;
  gap: 0;
}
.mon-check-t > b {
  font-size: var(--fs-body);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.mon-check-t > span {
  font-size: var(--fs-micro);
  line-height: 1.55;
  color: var(--muted);
}
/* settled: no figure to lead with — the sentence takes the figure's column
   too, at the size of a line and not of a caption */
.mon-check[data-state="ok"] { min-height: 36px; }
.mon-check[data-state="ok"] > .mon-check-t { grid-column: 2 / 4; }
.mon-check[data-state="ok"] > .mon-check-t > span { font-size: var(--fs-label); }
.mon-check[data-state="off"] > .mon-check-t { grid-column: 2 / 4; }
.mon-check > .btn { grid-column: 4; justify-self: end; }

.mon-review-say { margin: 12px 16px; }

.mon-review-f {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--card-3);
}
.mon-review-sum {
  flex: 1 1 220px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.mon-review-sum b { font-weight: var(--w-600); color: var(--ink); }
.mon-review-sum .cur { margin-inline-start: 4px; font-weight: var(--w-400); color: var(--muted); }

/* ============================================================
   4. «أنشئ شهراً بلا ملف» — a month, a year, one button
   ============================================================ */

.mon-new {
  padding: 14px 16px 16px;
  gap: 12px;
}
.mon-new-h > h3 {
  font-size: var(--fs-h3);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.mon-new-h > p {
  max-width: 86ch;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
/* Two narrow fields and the buttons on their line, level with the boxes and
   not with the labels above them. */
.mon-new-r.v6-field-row {
  grid-template-columns: minmax(168px, 240px) minmax(120px, 160px) minmax(0, 1fr);
}
/* the error belongs to the whole line (the kit shows one only under its field) */
.mon-new > .mon-new-e { display: block; }
.mon-new-a {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  /* a label's line (12.5px × 1.5) and the field's gap, so the buttons sit on
     the inputs' line */
  padding-top: calc(var(--fs-label) * 1.5 + 5px);
}

/* ============================================================
   5. Narrow

   The page head's own width is what matters (the rail and the
   drawer take theirs first), so the list measures ITSELF. Under
   900px of card the actions drop to a line of their own and the
   figures close up.
   ============================================================ */

.mon-year { container: monyear / inline-size; }

@container monyear (max-width: 940px) {
  .mon-m > .v6-row { row-gap: 6px; }
  .mon-m > .v6-row > .mon-acts {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-content: flex-start;
    max-width: none;
  }
  .v6-row-f > .mon-fig.is-n { min-width: 52px; }
  .v6-row-f > .mon-fig.is-net { min-width: 118px; }
  .mon-imp-n { max-width: 46%; }
}
@container monyear (max-width: 640px) {
  .mon-m > .v6-row > .v6-row-f {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-content: flex-start;
    padding-inline-end: 0;
  }
  .mon-m > .v6-row > .mon-acts { grid-row: 3; }
  .mon-imps, .mon-review { margin-inline-start: 16px; }
  .mon-checks { grid-template-columns: auto auto minmax(0, 1fr); }
  .mon-check > .btn { grid-column: 2 / -1; justify-self: start; margin-top: 4px; }
  .mon-new-r.v6-field-row { grid-template-columns: 1fr 1fr; }
  .mon-new-a { grid-column: 1 / -1; padding-top: 0; }
}

/* ---------- print ----------
   There is none: 74-v6-month.css keeps #scMonths off the sheet — a list of
   what the program holds says nothing about the month being printed. */

/* ── 79-v6-payreq.css ─────────────────────────────── */

/* ══════════════════════════════════════════════════════════════
   79-v6-payreq — «طلبات تعديل الراتب» (97-v6-payreq.js, 2026-11-02)

   The loans page's frame (79-v6-loans.css): figures, a bar of filters, a
   table. The form is fieldsets in a grid. The printed request is the scan of
   the owner's form with the values laid over its boxes. Existing tokens only
   (DESIGN.md §0).
   ══════════════════════════════════════════════════════════════ */

.pq-panel .pq-stats { padding: 14px 16px 0; border-bottom: 0; }
.pq-stat { font: inherit; text-align: start; cursor: pointer; }
.pq-stat.is-key > b { color: var(--warn); }
.pq-stat.is-on { border-color: var(--accent); background: var(--accent-soft); }

.pq-bar { flex-wrap: wrap; gap: 8px; }
.pq-bar .inp { width: auto; min-width: 140px; }
.pq-bar .pq-q { min-width: 240px; flex: 0 1 300px; }
.pq-bar .pq-q .inp { width: 100%; }
.pq-bar .sp, .pq-panel .panel-head .sp, .pq-foot-bar .sp { flex: 1; }

.pq-tbl th.pq-emp { text-align: start; font-weight: var(--w-600); vertical-align: top; }
.pq-tbl .nm { font-weight: var(--w-600); }
.pq-sub { display: block; font-size: var(--fs-micro); color: var(--muted); font-weight: 400; }
.pq-tbl tr[data-pq-row] > * { border-bottom: 0; padding-bottom: 4px; }
.pq-tbl tr.pq-doors-row > td { padding-top: 0; }
.pq-doors { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
.pq-doors .btn { white-space: nowrap; }
.pq-doors .btn-danger-q { color: var(--crit); }
.pq-foot { padding: 10px 16px 14px; margin: 0; }

.tag.pq-ok { background: var(--good-soft); color: var(--good); }
.tag.pq-no { background: var(--crit-soft, var(--card-2)); color: var(--crit); }
.tag.pq-mute { background: var(--card-2); color: var(--muted); }

/* the form */
.pq-body { display: grid; gap: 16px; }
.pq-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pq-who { display: grid; gap: 6px; max-width: 560px; }
.pq-who select[size] { min-height: 150px; }
.pq-fixed { margin: 0; }
.pq-pickfirst { padding: 18px 0; }
.pq-sec { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 14px 14px; margin: 0; }
.pq-sec legend { padding: 0 6px; font-weight: var(--w-600); color: var(--ink-2); }
.pq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; align-items: end; }
.pq-f { display: grid; gap: 4px; margin: 0; }
.pq-f.is-wide { grid-column: 1 / -1; }
.pq-f-l { font-size: var(--fs-label); color: var(--ink-2); }
.pq-f .inp { width: 100%; }
.pq-reason { resize: vertical; min-height: 90px; font: inherit; }
.pq-hint { grid-column: 1 / -1; margin: 0; font-size: var(--fs-micro); color: var(--muted); }
.pq-say { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink); font-size: var(--fs-label); }
.pq-unit-row { display: flex; gap: 8px; align-items: center; }
.pq-unit-row select { flex: 1; min-width: 0; }
.pq-foot-bar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
@media (max-width: 700px) { .pq-kinds { grid-template-columns: 1fr; } }

/* A4 salary request */
.pq-print-override { margin-block-start: 12px; }
.pq-print-override summary { cursor: pointer; margin-block-end: 8px; }

.pq-sheet {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4mm;
  width: 210mm;
  min-height: 296mm;
  padding: 10mm 12mm;
  background: #fff;
  color: #151d2b;
  font-size: 10pt;
  line-height: 1.45;
}
.pq-sheet h1, .pq-sheet h2, .pq-sheet p, .pq-sheet dl, .pq-sheet dd { margin: 0; }
.pq-sheet h1 { text-align: center; font-size: 20pt; }
.pq-sheet h2, .pq-paper-compare caption { font-size: 11pt; font-weight: 700; }
.pq-paper-head {
  min-height: 23mm;
  display: grid;
  grid-template-columns: 1fr 24mm 1fr;
  gap: 5mm;
  align-items: start;
  border-bottom: 1px solid #253957;
  padding-block-end: 4mm;
}
.pq-paper-org { overflow-wrap: anywhere; font-weight: 700; }
.pq-paper-logo { width: 22mm; height: 22mm; object-fit: contain; }
.pq-paper-fields > div {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2mm;
  padding: 1mm 0;
  border-bottom: 1px solid #dae1eb;
}
.pq-paper-fields dd { min-width: 0; overflow-wrap: anywhere; }
.pq-paper-pair { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #9ba9bd; break-inside: avoid; }
.pq-paper-pair > div { min-width: 0; padding: 3mm; overflow-wrap: anywhere; }
.pq-paper-pair > div + div { border-inline-start: 1px solid #9ba9bd; }
.pq-paper-compare { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pq-paper-compare caption { text-align: start; margin-block-end: 1mm; }
.pq-paper-compare th, .pq-paper-compare td {
  text-align: center;
  border: 1px solid #9ba9bd;
  padding: 1.5mm;
  height: 9mm;
  overflow-wrap: anywhere;
}
.pq-paper-reason { border: 1px solid #9ba9bd; padding: 3mm; }
.pq-paper-reason p { min-height: 24mm; white-space: pre-wrap; overflow-wrap: anywhere; }
.pq-paper-note { font-size: 9pt; }
.pq-paper-signs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3mm;
  margin-block-start: auto;
  break-inside: avoid;
}
.pq-paper-signs > div {
  border: 1px solid #9ba9bd;
  min-height: 22mm;
  padding: 2mm;
  text-align: center;
  overflow-wrap: anywhere;
}

@media print {
  body.pdf-payreq .main, body.pdf-payreq .page, body.pdf-payreq #scReport { padding: 0 !important; margin: 0 !important; }
}

/* ── 79-v6-perms-month.css ─────────────────────────────── */

/* ============================================================
   79. الصلاحيات — the month screens and the document's doors
       (نظرة عامة · الحضور والرواتب · الغياب · الإضافي · المهمات ·
       فحص البيانات, the punch and mission dialogs, the employee
       dialog, the filter row, and every data-* door the document
       hears once — 81 pxWire, 83 msnWire, 99 wireGlobal).

   The core file is 79-v6-perms.css; read its head first. Only a
   signed-in USER ever carries a perm-no-* class, so nothing here
   reaches «مدير النظام». Hidden, not greyed.

   What depends on the DAY rather than on the box — which verdict
   segment a press would write, «علّمها كلّها …» over days already
   marked, a holiday over somebody's غياب, a source chip, the
   department's تخصيص icon, «خصّص هذا الموظف», the punch editor's
   rows — is decided where it is drawn (73-absence.js 73.0b,
   76-register.js regTuneOk, 81-punches.js 81b′). The rules below
   are the ones the boxes alone decide; each door's handler asks
   the same question again for the key that reaches it.
   ============================================================ */

/* ---------- the punch editor (الحضور والرواتب) ----------
   It opens for any of إضافة · تعديل · حذف; inside it, a new punch
   is إضافة. */
:root.perm-no-register-add.perm-no-register-edit.perm-no-register-delete [data-px-emp],
:root.perm-no-register-add #pxAddIn,
:root.perm-no-register-add #pxAddOut,
:root.perm-no-register-add #pxFill { display: none !important; }

/* ---------- the mission dialog (المهمات) ---------- */
:root.perm-no-missions-add [data-msn-emp]:not([data-msn-edit]),
:root.perm-no-missions-add [data-reg-act="selmsn"],
:root.perm-no-missions-add .msn-xl,
:root.perm-no-missions-edit [data-msn-edit],
:root.perm-no-missions-edit [data-msn-full],
:root.perm-no-missions-delete [data-msn-del],
:root.perm-no-missions-delete #msdDel { display: none !important; }

/* ---------- الغياب ----------
   A mark and a mission may be written from either section with the
   same box (main's STORE_MODS), hence the pairs. «اعتماد» writes the
   month's leave into the person's rule: تعديل in الغياب or in
   التخصيصات. */
:root.perm-no-absence-add.perm-no-missions-add [data-abs-holiday],
:root.perm-no-absence-edit.perm-no-leaves-edit.perm-no-rules-edit [data-abs-apply],
:root.perm-no-absence-edit.perm-no-leaves-edit.perm-no-rules-edit #absApplyAll { display: none !important; }

/* ---------- التخصيصات, from every month screen ----------
   «تخصيص» opens the editor; with neither إضافة nor تعديل there is
   nothing it could save. «تحديد موظفين» serves only «سجّل مهمة
   للمحدَّدين» and «خصّص المحدَّدين». */
:root.perm-no-rules-add.perm-no-rules-edit [data-tune-dept],
:root.perm-no-rules-add.perm-no-rules-edit #btnDeptTune,
:root.perm-no-rules-add.perm-no-rules-edit #empTune,
:root.perm-no-rules-add.perm-no-rules-edit [data-reg-act="selrules"],
:root.perm-no-missions-add.perm-no-rules-add.perm-no-rules-edit #btnPickMode { display: none !important; }

/* ---------- الإعدادات ----------
   «القياس» writes CFG; «اضبط ساعات الدوام» is a change there too. */
:root.perm-no-settings-edit .fld:has(> #modeSel),
:root.perm-no-settings-edit [data-ot-act="settings"] { display: none !important; }

/* ---------- prints and files ----------
   The employee's sheet is the register's paper and the person's file's;
   the clean punch file is فحص البيانات'. */
:root.perm-no-register-print.perm-no-staff-print #empReport,
:root.perm-no-check-print #btnClean { display: none !important; }

/* ---------- the document's doors (99-boot.js, 72-intake.js) ---------- */
:root.perm-no-months-add [data-v6-act="import"],
:root.perm-no-months-add [data-v6-act="template"],
:root.perm-no-months-add [data-v6-act="newmonth"],
:root.perm-no-months-add .v6-landing-tmpl,
:root.perm-no-months-view [data-v6-act="months"],
:root.perm-no-staff-view [data-v6-act="staff"],
:root.perm-no-departments-view [data-v6-act="departments"],
:root.perm-no-staff-view button[data-person],
:root.perm-no-staff-view [data-abs-person],
:root.perm-no-staff-view [data-ck-fix="staff"],
:root.perm-no-staff-edit button[data-staff-edit]:not([data-staff-edit=""]),
:root.perm-no-staff-add button[data-staff-edit=""] { display: none !important; }

/* ---------- links to a screen this person may not open ----------
   The standalone ones of the month screens: route() would turn them
   away. A link inside a sentence stays — the sentence would lose its
   end — and route() says why when it is followed. */
:root.perm-no-register-view [data-abs-reg],
:root.perm-no-register-view [data-ot-reg],
:root.perm-no-register-view [data-msn-reg],
:root.perm-no-register-view #scOverview a.ov-more[href="#register"],
:root.perm-no-departments-view #scOverview a.ov-more[href="#depts"],
:root.perm-no-check-view #scOverview a.ov-more[href="#check"],
:root.perm-no-months-view #scCheck .panel-head > a.link[href="#months"] { display: none !important; }

:root.perm-no-leaves-add #scLeaves :is([data-lv="xltpl"], [data-lv="xlin"], [data-lv="new"]),
:root.perm-no-leaves-edit #scLeaves [data-lv="why"],
:root.perm-no-leaves-delete #scLeaves :is([data-lv="del"], [data-lv="open"]),
:root.perm-no-leaves-print #scLeaves :is([data-lv="xlsx"], [data-lv="look"], [data-lv="pdf"], [data-lv="balxlsx"]) {
  display: none !important;
}

/* ── 79-v6-perms-print.css ─────────────────────────────── */

/* ============================================================
   79. الصلاحيات — «طباعة»: the export menu and the paper
       (the classes are 57-v6-perms.js's, on <html>; the rule is
       main's — file:save and print:pdf ask for the box by name).

   «طباعة» is one box per section and covers PDF and Excel alike.
   The administrator never carries a perm-* class, so nothing here
   reaches their menu or their sheet.

   Two halves:
     · the menu — the rows whose section is one box. The rows that
       depend on more than one (Excel in its CSV fallback, the
       clipboard that follows the open screen, the three PDF rows
       that follow the scope) are 90-export.js's exPermSync(), which
       sets `hidden` on every row by the same answers; these rules
       are the same answer said by the stylesheet as well.
     · the paper — 80-print.css re-declares `.screen { display:
       grid !important }` for print, after 20-base.css's `[hidden]`,
       so a screen showAllScreens(true) left hidden would PRINT. An id
       outranks that (1,2,0 against 0,1,0), so a section the person may
       not print is taken off the sheet here, whatever PDF_SEL says.
   ============================================================ */

/* ---------- the export menu ---------- */
:root.perm-no-register-print #exportMenu [data-x="csv-summary"],
:root.perm-no-register-print #exportMenu [data-x="csv-days"],
:root.perm-no-register-print #exportMenu [data-x="csv-pay"],
:root.perm-no-ot-print #exportMenu [data-x="csv-ot"],
:root.perm-no-ot-print #exportMenu [data-x="csv-ot-days"],
:root.perm-no-absence-print #exportMenu [data-x="csv-abs"],
:root.perm-no-absence-print #exportMenu [data-x="csv-abs-days"],
:root.perm-no-missions-print #exportMenu [data-x="csv-msn"],
:root.perm-no-deductions-print #exportMenu [data-x="csv-ded"],
:root.perm-no-deductions-print #exportMenu [data-x="csv-ded-days"],
:root.perm-no-check-print #exportMenu [data-x="csv-clean"],
/* The workbook is the four sections' sheets: gone only when none is theirs. */
:root.perm-no-register-print.perm-no-ot-print.perm-no-absence-print.perm-no-missions-print.perm-no-deductions-print #exportMenu [data-x="xlsx"],
/* An empty template is what a new month is made from — «إضافة» in الأشهر. */
:root.perm-no-months-add #exportMenu [data-x="tpl"] { display: none !important; }

/* ---------- the paper ---------- */
@media print {
  :root.perm-no-overview-print #scOverview,
  :root.perm-no-register-print #scRegister,
  :root.perm-no-ot-print #scOt,
  :root.perm-no-absence-print #scAbsence,
  :root.perm-no-missions-print #scMissions,
  :root.perm-no-deductions-print #scDed,
  :root.perm-no-departments-print #scDepts,
  :root.perm-no-rules-print #scRules,
  :root.perm-no-check-print #scCheck { display: none !important; }

  /* No «طباعة» anywhere: the File menu's ctrl+P gets a blank sheet, not a
     masthead over whatever screen was open. */
  :root.perm-no-print #page { display: none !important; }
}

/* ── 79-v6-perms-reg.css ─────────────────────────────── */

/* ============================================================
   79. الصلاحيات — the two registers and the person's file
       (الإدارات 95 · حضور الشهر 77 · الموظفون 93 · ملف الموظف 94,
       and the dialogs they open in #staffBack).

   The core file is 79-v6-perms.css; read its head first. Only a
   signed-in USER ever carries a perm-no-* class, so nothing here
   reaches «مدير النظام». Hidden, not greyed.

   By class, never by `hidden`: the kept frames of both screens
   (#sfBarEmp, #sfFiles, #dmBar, #dmFiles) have their `hidden` set
   back by sfSyncBar() / dmSyncBar() on every paint.

   What depends on the ROW rather than on the box alone — a
   department's rule or a person's exception (تعديل when it
   exists, إضافة when not), the fold «أرشفة، دمج، حذف», «إدارة
   جديدة…» in the employee form, its salary, the import's «أنشئ
   الإدارات», the days of the person's strip — is decided where it
   is drawn (97-v6-lists.js v6TuneOk, 93 / 94 / 95 / 77). Each
   door's function asks the same question again for whoever
   reaches it by a key.
   ============================================================ */

/* ---------- الموظفون: إضافة ----------
   «استيراد من Excel» takes a list of people (إضافة) or the salary
   sheet (تعديل), so it goes only when neither box is ticked. The
   employee template belongs with the import it feeds. */
:root.perm-no-staff-add [data-sf="new"],
:root.perm-no-staff-add [data-sf="newhere"],
:root.perm-no-staff-add [data-sf="tpl"],
:root.perm-no-staff-add [data-sfd="xltpl"],
:root.perm-no-staff-add [data-sfd="dvadd"],
:root.perm-no-staff-add.perm-no-staff-edit [data-sf="xl"] { display: none !important; }

/* a device file is a month's import — «الأشهر والاستيراد» */
:root.perm-no-months-add [data-sf="device"] { display: none !important; }

/* ---------- الموظفون: تعديل ----------
   The employee form has no read-only reading: without تعديل an
   existing person's «عدّل» goes (79-v6-perms-month.css hides every
   data-staff-edit door of the document; these are this area's). */
:root.perm-no-staff-edit #scStaff [data-staff-edit],
:root.perm-no-staff-edit #psEdit,
:root.perm-no-staff-edit [data-sfd="dvedit"],
:root.perm-no-staff-edit [data-sf="restore"],
:root.perm-no-staff-edit [data-sf="selrestore"],
:root.perm-no-staff-edit [data-sfd="restore"],
:root.perm-no-staff-edit [data-sf="paytpl"],
:root.perm-no-staff-edit [data-sfd="xlpaytpl"],
/* «عملة الراتب» and «قوالب الخصائص» write staff:setPay (93-v6-traits.js) */
:root.perm-no-staff-edit [data-sf="curset"],
:root.perm-no-staff-edit [data-sf="selcur"],
:root.perm-no-staff-edit [data-sf="traits"],
:root.perm-no-staff-edit [data-reg-act="selcur"] { display: none !important; }

/* «انقل إلى إدارة…» — تعديل of the employees OR of the departments */
:root.perm-no-staff-edit.perm-no-departments-edit [data-sf="selmove"] { display: none !important; }

/* ---------- الموظفون: حذف (archive, merge, delete) ---------- */
:root.perm-no-staff-delete [data-sf="arch"],
:root.perm-no-staff-delete [data-sf="selarch"],
:root.perm-no-staff-delete [data-sf="selpurge"],
:root.perm-no-staff-delete [data-sf="del"],
:root.perm-no-staff-delete [data-sfd="archive"],
:root.perm-no-staff-delete [data-sfd="merge"],
:root.perm-no-staff-delete [data-sfd="mergego"],
:root.perm-no-staff-delete [data-sfd="delete"] { display: none !important; }

/* «تحديد» is only the way to the three bulk acts above */
:root.perm-no-staff-edit.perm-no-staff-delete.perm-no-departments-edit #sfPick { display: none !important; }

/* ---------- الموظفون: طباعة ---------- */
:root.perm-no-staff-print [data-sf="xlsx"],
:root.perm-no-staff-print [data-sf="pdf"] { display: none !important; }

/* The files bar: its divider stands between the two halves only
   while both have a door; with no door at all the bar goes too. */
:root.perm-no-staff-print #sfFiles .dm-sep,
:root.perm-no-staff-add.perm-no-staff-edit #sfFiles .dm-sep,
:root.perm-no-staff-print.perm-no-staff-add.perm-no-staff-edit #sfFiles { display: none !important; }

/* ---------- الموظفون: عرض — the doors into the person's file ---------- */
:root.perm-no-staff-view [data-dm="staff"],
:root.perm-no-staff-view [data-sfd="dvperson"],
:root.perm-no-staff-view [data-sfd="dvstaff"],
:root.perm-no-staff-view [data-sfd="dxlstaff"] { display: none !important; }

/* Two of the departments' figures lead to «الموظفون». The figure is
   the departments' own and stays; only the way through goes. */
:root.perm-no-staff-view .dm-stat[data-dm-stat="staff"],
:root.perm-no-staff-view .dm-stat[data-dm-stat="none"] {
  pointer-events: none;
  cursor: default;
}

/* ---------- الإدارات ---------- */
:root.perm-no-departments-view [data-sf="deptview"],
:root.perm-no-departments-view #scStaff .sf-scope a[href="#departments"] { display: none !important; }

:root.perm-no-departments-add [data-dm="new"],
:root.perm-no-departments-add [data-dm="xl"],
:root.perm-no-departments-add [data-dm="tpl"],
:root.perm-no-departments-add [data-sfd="dxltpl"] { display: none !important; }

:root.perm-no-departments-edit [data-dm="edit"],
:root.perm-no-departments-edit [data-sfd="dvrename"],
:root.perm-no-departments-edit [data-sfd="dvrestore"] { display: none !important; }

:root.perm-no-departments-delete [data-dm="del"],
:root.perm-no-departments-delete [data-sfd="dvarch"] { display: none !important; }

:root.perm-no-departments-print [data-dm="xlsx"],
:root.perm-no-departments-print [data-dm="pdf"],
:root.perm-no-departments-print [data-dm="look"],
:root.perm-no-departments-print [data-sfd="dvpdf"],
:root.perm-no-departments-print [data-sfd="dvlook"] { display: none !important; }

:root.perm-no-departments-print #dmFiles .dm-sep,
:root.perm-no-departments-add #dmFiles .dm-sep,
:root.perm-no-departments-print.perm-no-departments-add #dmFiles { display: none !important; }

/* ---------- ملف الموظف ----------
   The punch and mission doors are the document's (79-v6-perms-month.css);
   the header's own ids are named here as well. «الراتب والقواعد» is
   drawn only for whoever may open it (94 psHeadHtml). */
:root.perm-no-register-add.perm-no-register-edit.perm-no-register-delete #psPxAdd,
:root.perm-no-missions-add #psMsnAdd,
:root.perm-no-staff-print.perm-no-register-print #psPrint,
:root.perm-no-register-view #scPerson [data-ps-act="explain"],
:root.perm-no-months-view #scPerson [data-ps-act="months"],
:root.perm-no-months-view #scPerson a[href="#months"],
:root.perm-no-settings-view #scPerson a[href="#settings"] { display: none !important; }

/* ── 79-v6-perms-reports.css ─────────────────────────────── */

/* ============================================================
   79. الصلاحيات — تقارير مخصصة (97-v6-rpt-4-page.js)

   The convention of 79-v6-perms.css: what a signed-in USER may not
   do is not drawn. The administrator never carries these classes,
   so nothing here can change their screens. Every door hidden here
   is also refused at its entry function (permDeny), and by main.

   A file of a report is TWO boxes — «طباعة» here and in the section
   its rows come from (rptPermTag). The first is hidden by class
   below; the second depends on the kind of the report, so the page
   draws those doors `hidden` itself (crFootPaint, crRowHtml).
   ============================================================ */

/* «إضافة»: a new saved report, or a copy of one */
:root.perm-no-reports-add [data-cr="save"],
:root.perm-no-reports-add [data-cr="saveas"] { display: none !important; }

/* «تعديل»: over a saved report, or its name */
:root.perm-no-reports-edit [data-cr="update"],
:root.perm-no-reports-edit [data-cr="rename"] { display: none !important; }

/* «حذف» */
:root.perm-no-reports-delete [data-cr="del"] { display: none !important; }

/* «طباعة»: the file — Excel, CSV or PDF. «معاينة» stays: it shows what
   the person may already see, and writes nothing. */
:root.perm-no-reports-print [data-cr="run"],
:root.perm-no-reports-print [data-cr="out"] { display: none !important; }

/* ── 79-v6-perms-sys.css ─────────────────────────────── */

/* ============================================================
   79. الصلاحيات — التخصيصات · الأشهر والاستيراد · الإعدادات
       (the doors of 78-rules, 98-v6-tune, 80-library, 92-v6-import,
       82-settings, 84-brand and 96-v6-system)

   The convention of 79-v6-perms.css: what a signed-in USER may not do
   is not drawn. The administrator never carries these classes, so
   nothing here can change their screens. Every door hidden here is
   also refused at its entry function (permDeny), and by main.

   Settings is a page to READ for a user without «تعديل»: its values
   stay on screen with their controls disabled (82-settings.js
   gsPermSync), and only the buttons that act are taken away.
   ============================================================ */

/* ---------- التخصيصات ----------
   The page is an editor: «تعديل» opens what exists, «إضافة» starts what
   does not (78-rules.js openCustomize). A user with neither has no door
   to it anywhere — the rail's ledger included. */
:root.perm-no-rules-add.perm-no-rules-edit [data-tune-dept],
:root.perm-no-rules-add.perm-no-rules-edit #btnDeptTune,
:root.perm-no-rules-add.perm-no-rules-edit [data-reg-act="selrules"] { display: none !important; }

/* A person's row in the ledger asks per row (78-rules.js empLedgerHtml):
   a month's leave alone opens as «إضافة» and is released as «تعديل», so
   its «تعديل» / «فكّ الاستثناء» are drawn or left out there, not by role. */
:root.perm-no-rules-edit [data-edit-dept],
:root.perm-no-rules-edit #drawer .dr-revert { display: none !important; }

:root.perm-no-rules-delete #drRemove { display: none !important; }

/* ---------- الأشهر والاستيراد ---------- */
/* «إضافة»: a new month, an import — on the months screen, the year
   ribbon's menu of an empty month (91-v6-month.js) and the empty states
   that offer an import (99-boot.js's data-v6-act doors). */
:root.perm-no-months-add #scMonths [data-act="new"],
:root.perm-no-months-add #scMonths [data-act="import"],
:root.perm-no-months-add [data-ya="import"],
:root.perm-no-months-add [data-ya="create"],
:root.perm-no-months-add [data-v6-act="import"],
:root.perm-no-months-add [data-v6-act="newmonth"] { display: none !important; }

/* «تعديل»: approving and locking, and lifting a lock. */
:root.perm-no-months-edit #scMonths [data-act="review"],
:root.perm-no-months-edit #scMonths [data-act="lock"],
:root.perm-no-months-edit #scMonths [data-act="unlock"] { display: none !important; }

/* «حذف»: undoing an import, clearing a month. */
:root.perm-no-months-delete #scMonths [data-act="undo"],
:root.perm-no-months-delete #scMonths [data-act="clear"] { display: none !important; }

/* ---------- الإعدادات — read, not changed ---------- */
.gs-ro { margin-bottom: 16px; }

:root.perm-no-settings-edit #gsResetRules,
:root.perm-no-settings-edit #gsClearEx,
:root.perm-no-rules-delete #gsClearEx,
:root.perm-no-settings-edit #gsLogoBtn,
:root.perm-no-settings-edit #gsLogoClear,
:root.perm-no-settings-edit #gsSigX0,
:root.perm-no-settings-edit #gsSigX1,
:root.perm-no-settings-edit #gsSigX2,
:root.perm-no-settings-edit #gsSigReset,
:root.perm-no-settings-edit #sysCal .sys-hol-add,
:root.perm-no-settings-edit #sysCal [data-sys="cal-hol-del"],
:root.perm-no-settings-edit #sysCalUndo,
:root.perm-no-settings-edit #sysCalSave,
:root.perm-no-settings-edit #sysBakNow,
:root.perm-no-settings-edit #sysBakPick,
:root.perm-no-settings-edit #sysBakDirReset { display: none !important; }

/* The row of the two pay buttons, once both are gone. */
:root.perm-no-settings-edit #scSettings .gs-acts:has(> #gsResetRules) { display: none !important; }

/* The empty import template is part of importing: «إضافة» in الأشهر. */
:root.perm-no-months-add #scSettings .panel:has(#gsTemplate) { display: none !important; }

/* ---------- الإعدادات — the administrator's alone ----------
   Whatever boxes a user has: replacing the database, carrying all of it
   away, reading a v5 backup in over it, and the audit log (main: ADMIN).
   «أظهر في المجلد» and «افتح مجلد البيانات» stay — they only show. */
:root.perm-user #scSettings .gs-acts:has(> #sysBakSaveAs),
:root.perm-user #sysBak [data-sys="bak-restore"],
:root.perm-user #sysData .sys-sub:has(#sysV5Pick),
:root.perm-user #sysAudit { display: none !important; }

/* ── 79-v6-perms.css ─────────────────────────────── */

/* ============================================================
   79. الصلاحيات — what a signed-in USER may not do is not drawn
       (57-v6-perms.js puts the classes on <html>; main refuses it
       anyway — this is courtesy, not the rule).

   :root.perm-user                 a user, not «مدير النظام»
   :root.perm-no-<mod>-<act>       that box is not ticked for them
   :root.perm-no-print             no «طباعة» box anywhere

   The administrator never carries any of these classes, so nothing
   in this file or in 79-v6-perms-*.css can change their screens.

   Hidden, not greyed: a door a person can never use is not a door
   for them (a locked MONTH greys, 74-v6-month.css, because opening
   the lock is one step away). Each screen's selectors live with
   that screen's area in 79-v6-perms-<area>.css.
   ============================================================ */

/* ---------- the shell ---------- */
:root.perm-no-print #btnExport,
:root.perm-no-print #exportMenu { display: none !important; }

/* The bookplate opens الأشهر — a user without «عرض» there keeps the label. */
#btnOpenLib:disabled { cursor: default; }

/* ---------- «لا صلاحيات» ---------- */
.perm-none {
  max-width: 560px;
  margin: 64px auto;
  padding: 32px 28px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.perm-none-i {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.perm-none h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  color: var(--ink);
}
.perm-none p {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-body);
  line-height: var(--lh-lead);
}

/* ── 79-v6-reports.css ─────────────────────────────── */

/* ============================================================
   79. تقارير مخصصة (97-v6-rpt-4-page.js) — the builder, the saved
       reports beside it, the preview under it.

   The registers' look (77-v6-staff.css's .sf-*, the kit's .v6-list
   / .v6-choice / .v6-fieldset / .v6-empty / .v6-notice) in the
   users page's two columns (79-v6-users.css). What the kit did not
   have is built here, tokens only:

     1  the columns     saved reports · the builder and the preview
     2  the steps       five numbered fieldsets, each with what it
                        holds said beside its title
     3  the kinds       a card per kind, in families
     4  the scope       the department / people picker
     5  the ticks       columns and the PDF's parts — the PDF dialog's
                        «ما يدخل في التقرير» (80-print.css .pdf-opts):
                        a chosen box is a filled control
     6  the format      three cards, and the PDF's own well under them
     7  the foot        the doors, kept in view while the steps scroll
     8  the preview     the sheet's head, its figures, its table — the
                        report's identity (72-report.css: a Royal bar
                        at the start of a heading, a ruled figure strip)
                        in the app's own ink
     9  the run         the progress line while months are read

   Nothing here hides a door for a user: 79-v6-perms-reports.css does.
   ============================================================ */

/* ---------- 1. the columns ----------
   A container query, not a media query: the rail collapses and the window
   narrows, and only the page's own width says whether the saved list still
   fits beside a builder that needs ~760px for its cards. */
.cr { container: cr / inline-size; display: grid; gap: 12px; min-width: 0; }
.cr-cols {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.cr-side {
  position: sticky;
  top: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  max-height: calc(100vh - var(--ubar-h) - var(--phead-h) - 48px);
}
.cr-side > .panel-head .btn { margin-inline-start: auto; }
#crList { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.cr-main { display: grid; gap: 12px; min-width: 0; }
@container cr (max-width: 1060px) {
  .cr-cols { grid-template-columns: minmax(0, 1fr); }
  .cr-side { position: static; max-height: none; }
  #crList { max-height: 260px; }
}

/* the saved reports: name and format, what it is, and its three doors on a
   line of their own — a narrow column has no room for them beside a name */
.cr-list { grid-template-columns: auto minmax(0, 1fr); }
.cr-row { align-items: start; padding-block: 10px; }
.cr-row .v6-row-i { margin-top: 1px; }
.cr-row .v6-row-t > .tag,
.cr-row .v6-row-t > .badge { flex: none; }
.cr-row .v6-row-m { white-space: normal; }
.cr-row .v6-row-m bdi { unicode-bidi: isolate; }
.cr-row-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.cr-row-a .btn { height: 26px; padding: 0 9px; }
.cr-row-a .btn[aria-current="true"] { background: var(--sel); border-color: var(--accent); color: var(--ink); }
.cr-row-a .cr-del { color: var(--muted); }
.cr-row-a .cr-del:hover { background: var(--crit-soft); border-color: var(--crit); color: var(--crit); }
.cr-row-why { font-size: var(--fs-micro); color: var(--muted); }
.cr-row.is-muted .v6-row-t { font-weight: var(--w-500); }
.cr-fmt-tag { direction: ltr; }
.cr-empty { padding: 26px 16px 30px; }
.cr-empty > p { font-size: var(--fs-label); }

/* ---------- 2. the steps ---------- */
.cr-ed { container: cred / inline-size; min-width: 0; }
.cr-ed-h h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-ed-h .btn { margin-inline-start: 4px; }
.cr-steps { display: grid; min-width: 0; }
.cr-step {
  padding: 14px 18px 18px;
  border-bottom: 1px solid var(--line-soft);
  gap: 12px;
}
.cr-step:last-child { border-bottom: 0; }
/* A floated legend is laid out as content inside the padding, not on the
   fieldset's top edge — the only way a legend keeps a padded step's rhythm. */
.cr-step > legend {
  float: right;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--fs-h3);
  font-weight: var(--w-600);
  line-height: var(--lh-cell);
  color: var(--ink);
}
.cr-step > legend > b { flex: none; font-weight: var(--w-600); }
.cr-n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: var(--fs-label);
  font-weight: var(--w-700);
}
/* what the step holds now — the builder read top to bottom is the report */
.cr-sum {
  min-width: 0;
  margin-inline-start: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--muted);
}
.cr-sum bdi { unicode-bidi: isolate; }

.cr-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.cr-lbl {
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
  color: var(--ink-2);
}
.cr-line > .cr-lbl { min-width: 64px; }
.cr-line .seg button { white-space: nowrap; }
.cr-fld { max-width: 320px; }
.cr-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px 24px;
  align-items: start;
}
.cr-part { display: grid; gap: 10px; align-content: start; min-width: 0; }
@container cred (max-width: 760px) {
  .cr-two { grid-template-columns: minmax(0, 1fr); }
}
.cr-range { grid-template-columns: repeat(2, minmax(140px, 190px)); }
.cr-range input[type="date"] { direction: ltr; text-align: end; }

/* ---------- 3. the kinds ---------- */
.cr-fams { display: grid; gap: 10px; min-width: 0; }
.cr-fam { display: grid; gap: 6px; min-width: 0; }
.cr-fam-h { font-size: var(--fs-micro); font-weight: var(--w-500); color: var(--muted); }
.cr-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
}
.cr-type {
  position: relative;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 8px 11px;
}
/* The radio is the card: the card's own selected state says it, and the
   input stays in the tab order for the keyboard (the kit rings the card). */
.cr-type > input {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.cr-type-i { flex: none; display: grid; place-items: center; color: var(--muted); }
.cr-type-i svg { width: 19px; height: 19px; }
.cr-type .v6-choice-b > b { font-size: var(--fs-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the one sentence that says what the report is: read whole, on as many
   lines as it takes — never cut at «…» */
.cr-type .v6-choice-b > span { white-space: normal; line-height: var(--lh-body); }
.cr-type:has(> input:checked) .cr-type-i { color: var(--accent); }
.cr-tsay { max-width: 90ch; }

/* ---------- 4. the scope ---------- */
.cr-pick {
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}
.cr-pick-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--card-3);
}
.cr-pick-q { flex: 1 1 160px; min-width: 140px; }
.cr-pick-n {
  margin-inline-start: auto;
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  color: var(--accent);
  white-space: nowrap;
}
.cr-pick-n.is-none { color: var(--muted); font-weight: var(--w-500); }
.cr-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px;
  max-height: 236px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
}
.cr-pick-i {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.cr-pick-i:hover { background: var(--card-2); }
.cr-pick-i:has(> input:checked) { background: var(--sel); }
.cr-pick-i > input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.cr-pick-b { display: grid; flex: 1 1 auto; min-width: 0; line-height: var(--lh-cell); }
.cr-pick-b > b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  color: var(--ink);
}
.cr-pick-b > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-micro);
  color: var(--muted);
}
.cr-pick-i.is-arch .cr-pick-b > b { color: var(--muted); }
.cr-pick-i > .tag { flex: none; margin-top: 1px; }
.cr-pick-none { padding: 14px 12px; font-size: var(--fs-label); color: var(--muted); }
.cr-pick-warn { color: var(--warn); }
.cr-pick > .cr-pick-warn { padding: 6px 10px 8px; border-top: 1px solid var(--line-soft); }

/* ---------- 5. the ticks ---------- */
.cr-cols-bar .btn { height: 28px; }
.cr-cols-n {
  margin-inline-start: auto;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink-2);
}
.cr-ticks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 6px;
}
.cr-tick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  font-size: var(--fs-label);
  line-height: var(--lh-cell);
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.cr-tick:hover { border-color: var(--day-rule); }
.cr-tick > span:first-of-type { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* chosen: a filled control, not a ticked box in a list (80-print.css) */
.cr-tick:has(> input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--ink);
}
.cr-tick:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.cr-tick > input:focus-visible { outline: none; }
.cr-pay { flex: none; }

/* ---------- options ---------- */
.cr-opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px; }
.cr-opts .v6-field { min-width: 200px; }
.cr-opt { font-size: var(--fs-label); color: var(--ink-2); line-height: var(--lh-cell); }
.cr-opt:has(> input:checked) { color: var(--ink); }
.cr-grid { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.cr-sort { width: auto; min-width: 150px; max-width: 240px; height: var(--ctrl-h-sm); font-size: var(--fs-label); }
.cr-merge { margin-top: 2px; }

/* ---------- 6. the format ---------- */
.cr-fmts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container cred (max-width: 620px) {
  .cr-fmts { grid-template-columns: minmax(0, 1fr); }
}
.cr-fmt .v6-choice-b > b { display: flex; align-items: baseline; gap: 6px; }
.cr-ext { font-size: var(--fs-micro); font-weight: var(--w-500); color: var(--muted); direction: ltr; }
.cr-pdf {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--card-2);
  border: 1px solid var(--line-soft);
}
.cr-pdf .cr-tick { background: var(--card); }
.cr-pdf .cr-tick:has(> input:checked) { background: var(--accent-soft); }
.cr-orient-say { font-size: var(--fs-micro); color: var(--muted); }
.cr-title { max-width: 520px; }

/* ---------- 7. the foot ---------- */
.cr-ed-f {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--card-3);
  border-end-start-radius: inherit;
  border-end-end-radius: inherit;
}
.cr-ed-f[hidden] { display: none; }
.cr-ed-f > .cr-say {
  flex: 1 1 220px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.cr-ed-f > .cr-say.is-warn { color: var(--warn); font-weight: var(--w-500); }
.cr-ed-f > .cr-say:empty { flex-basis: 0; }
/* the format the press will write, inside the page's one solid button */
.cr-run-f {
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--on-solid) 16%, transparent);
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  line-height: 1.6;
}

/* ---------- 8. the preview ---------- */
.cr-out { min-width: 0; overflow: hidden; }
.cr-out-empty { padding: 30px 20px 34px; }
.cr-sheet-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.cr-sheet-t { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
/* the report's section marker: a Royal bar the height of the words */
.cr-sheet-t > h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-title);
  font-size: var(--fs-h2);
  font-weight: var(--w-title);
  line-height: var(--lh-title);
  color: var(--ink);
}
.cr-sheet-t > h3::before {
  content: "";
  flex: none;
  width: 4px;
  height: 1.05em;
  border-radius: 1px;
  background: var(--accent);
}
.cr-sheet-t > p { padding-inline-start: 13px; font-size: var(--fs-label); color: var(--muted); }
.cr-sheet-at { flex: none; font-size: var(--fs-micro); color: var(--muted); }
.cr-out > .v6-notice { margin: 10px 16px 0; }
.cr-out > .v6-notice + .v6-notice { margin-top: 6px; }

/* the figure strip: ruled cells with a Royal edge, as on the paper */
.cr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px 16px;
}
.cr-card {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 12px 9px;
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--card-2);
}
.cr-card > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  color: var(--muted);
}
.cr-card > b {
  font-size: var(--fs-num-lg);
  font-weight: var(--w-700);
  line-height: var(--lh-tight);
  color: var(--ink);
  white-space: nowrap;
}
.cr-card > b .cur { margin-inline-start: 4px; font-size: var(--fs-label); font-weight: var(--w-500); color: var(--muted); }

/* the table: a scrollport of its own, so the header stays and the page never
   scrolls sideways however many columns are ticked */
.cr-tw {
  max-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
}
.cr-cards + .cr-tw { border-top-color: var(--line); }
table.tbl.cr-tbl > tbody > tr > td { padding-block: 9px; }
.cr-tbl col.cr-c-date   { width: 104px; }
.cr-tbl col.cr-c-day    { width: 84px; }
.cr-tbl col.cr-c-time   { width: 96px; }
.cr-tbl col.cr-c-int    { width: 80px; }
.cr-tbl col.cr-c-min    { width: 80px; }
.cr-tbl col.cr-c-dec,
.cr-tbl col.cr-c-hours  { width: 88px; }
.cr-tbl col.cr-c-hm     { width: 80px; }
.cr-tbl col.cr-c-signed { width: 84px; }
.cr-tbl col.cr-c-money  { width: 120px; }
.cr-tbl col.cr-c-pct    { width: 76px; }
/* a heading is read whole: it wraps onto a second line rather than ending
   in «…» (50-tables.css clips every heading to one) */
table.tbl.cr-tbl thead th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  vertical-align: bottom;
  overflow-wrap: break-word;
}
/* a cell of words (every punch of the day, a note) wraps too */
table.tbl.cr-tbl > tbody > tr > td.cr-wrap {
  white-space: normal;
  overflow-wrap: break-word;
  line-height: var(--lh-body);
}
/* a group's head: a row of its own across the table, as each group is a
   table of its own on the paper */
table.tbl.cr-tbl > tbody > tr.cr-g > th {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  text-align: start;
  font-size: var(--fs-label);
  font-weight: var(--w-600);
  color: var(--ink);
  box-shadow: inset -3px 0 0 var(--accent);
}
table.tbl.cr-tbl > tbody > tr.cr-g:hover > th { background: var(--card-2); }
table.tbl.cr-tbl > tbody > tr.cr-g > th > i {
  margin-inline-start: 10px;
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  color: var(--muted);
}
table.tbl.cr-tbl > tbody > tr.cr-g > th bdi { unicode-bidi: isolate; }
table.tbl.cr-tbl > tfoot > tr > td {
  position: sticky;
  bottom: 0;
  padding: 10px 10px;
  border-top: 1px solid var(--line);
  background: var(--card-3);
  font-weight: var(--w-600);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-count { border-top: 1px solid var(--line-soft); }

/* ---------- 9. the run ---------- */
.cr-run {
  position: sticky;
  top: 8px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh-2);
  font-size: var(--fs-label);
  color: var(--ink-2);
}
.cr-run[hidden] { display: none; }
.cr-run > svg { flex: none; width: 18px; height: 18px; color: var(--accent); }
.cr-run > p { flex: 1 1 auto; min-width: 0; }
.cr-run b { color: var(--ink); font-weight: var(--w-600); }
.cr-meter {
  flex: none;
  width: 160px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  overflow: hidden;
}
.cr-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--t) var(--ease); }

/* The PDF's figure strip, portrait: two across (72-report.css), so an odd
   count gives its first card the whole row rather than leaving the dark
   bottom-line card alone on the last one. */
body.pdf-person .rep-cards.cr-pcards > .rep-card:first-child:nth-last-child(2n+1) { grid-column: 1 / -1; }

/* «كل مجموعة في صفحة»: a marker for the paginator (85-report.js) to close
   a page on. It is never seen. */
.rep-break { display: none; }

/* Paper: 80-print.css shows every .screen whatever its `hidden` says, so a
   screen that is not a report takes itself off by id. */
@media print { #scCustomReports { display: none !important; } }

/* a scope ref the register no longer holds (crPickHtml): said, not hidden */
.cr-pick-i.is-lost .cr-pick-b > b,
.cr-pick-i.is-lost .cr-pick-b > span { color: var(--warn); }

/* ── 79-v6-system.css ─────────────────────────────── */

/* ============================================================
   79. النظام — the program's own panels on the settings screen
       (96-v6-system.js), and its dialogs in #sysBack.

   Everything here is layout and a handful of modifiers. The
   panels are v5's .panel, their groups are 68-settings.css's
   .gs-group / .gs-field, and the lists, notices, choices, forms
   and dialogs are the kit's (76-v6-kit.css). Tokens only.

   What the kit did not have, and is therefore built here:
     .sys-listbox   a kit list standing INSIDE a card's body
     .sys-week      seven weekday toggles that say their state
     .sys-facts     a short label → value list
     .sys-cal-foot  the «before ← after» line with its two buttons
   ============================================================ */

/* ---------- where the panels stand ----------
   82-settings.js drops this block into the main column. The backup and the
   calendar take the column's width; the four small ones pair up when there
   is room for two and stack when there is not — the same floor the payroll
   panel's groups use, so the two grids break at the same width. */
.sys-panels { display: grid; gap: 16px; min-width: 0; }
.sys-pair {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: start;
  min-width: 0;
}
.sys-panel { min-width: 0; }

/* A titled part of a panel's body: the kit's .v6-form-h over its content. */
.sys-sub { display: grid; gap: 8px; min-width: 0; }

/* The place a warning is drawn into takes no row of the body's grid while
   there is nothing to warn about. */
#sysBakWarn:empty { display: none; }

/* 68-settings.css spaces a field after a field; here a sentence of advice
   stands between two of them. */
.sys-panel .gs-twin + .gs-field { margin-top: 13px; }

/* ---------- a kit list inside a card's body ----------
   The kit's list is written to BE a card's content, edge to edge. Inside a
   body that already has padding it needs its own edge, or its row rules run
   into nothing. */
.sys-listbox {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  min-width: 0;
}
.sys-listbox.is-scroll { max-height: 272px; overflow-y: auto; }
.sys-listbox > .v6-list > .v6-row { padding-inline: 12px; }
.sys-more {
  display: flex;
  justify-content: center;
  padding: 5px 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--card-3);
}
/* «nothing here yet», at the size of a list row rather than of a screen */
.sys-none {
  padding: 12px 14px;
  border: 1px dashed var(--day-rule);
  border-radius: var(--r);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--muted);
}
.v6-dialog-b > .sys-none { border: 0; padding: 4px 0; }

/* a path: Latin inside an Arabic line, and allowed to break anywhere */
.sys-path {
  overflow-wrap: anywhere;
  font-size: var(--fs-label);
  color: var(--ink-2);
}

/* ---------- the weekday toggles ----------
   A pressed day is a HOLIDAY, and it says so in a word under its name — the
   state is never carried by the tint alone. The pressed look is the kit's
   own «chosen» (.v6-choice with its input checked). */
.sys-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.sys-week > button {
  display: grid;
  justify-items: center;
  gap: 0;
  min-width: 0;
  padding: 6px 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.sys-week > button:hover { border-color: var(--day-rule); }
.sys-week > button > b {
  font-size: var(--fs-body);
  font-weight: var(--w-500);
  line-height: var(--lh-cell);
}
.sys-week > button > span {
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}
.sys-week > button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--sel);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.sys-week > button[aria-pressed="true"] > b { font-weight: var(--w-600); }
.sys-week > button[aria-pressed="true"] > span { color: var(--accent); font-weight: var(--w-500); }

/* ---------- adding a holiday ----------
   Two dates, a name, the button — on one line while there is room. The
   complaint sits under the whole line (.sys-err), so the four stay aligned
   on their controls whether or not there is one. */
.sys-hol-add {
  display: grid;
  grid-template-columns: minmax(136px, 160px) minmax(136px, 160px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.sys-err {
  font-size: var(--fs-micro);
  line-height: 1.55;
  font-weight: var(--w-500);
  color: var(--crit);
}
.sys-err:empty { display: none; }

/* ---------- what the calendar amounts to ----------
   A consequence of the controls above it, not another control: the same
   sunken plate .gs-rates is, with the two buttons that act on it at its end. */
.sys-cal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-2);
}
.sys-cal-foot > p {
  flex: 1 1 280px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.sys-cal-foot > p b { font-weight: var(--w-600); color: var(--ink); }
.sys-cal-foot > .btn { height: var(--ctrl-h-sm); padding: 0 12px; font-size: var(--fs-label); }

/* ---------- label → value ---------- */
.sys-facts { display: grid; gap: 7px; min-width: 0; }
.sys-facts > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}
.sys-facts dt { font-size: var(--fs-label); color: var(--muted); }
.sys-facts dd { min-width: 0; font-size: var(--fs-label); line-height: var(--lh-body); color: var(--ink); }

/* the password's state, in the card's head */
#sysPassState { display: inline-flex; }

/* ---------- the dialogs ---------- */
/* The kit's dialog body is a grid that scrolls, and a kit notice is
   overflow:hidden — so when the body is taller than the dialog the notice's
   row may shrink to nothing (an overflow-hidden grid item has no automatic
   minimum). Rows sized to their content never shrink; the body scrolls. */
#sysBack .v6-dialog-b { grid-auto-rows: max-content; }
/* the log runs from the head's rule to the foot's */
#sysBack .v6-dialog-b:has(> #sysAuditList) { padding-block: 0; }
/* the result of a v5 import: a sentence per layer, and it may run to two lines */
.sys-wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.sys-done > .v6-row { align-items: start; padding-block: 9px; }
.sys-done > .v6-row.is-muted .v6-row-i { color: var(--warn); }
/* the time of a log line sits in the figures column, plain */
#sysAuditList .v6-row-f { font-size: var(--fs-label); color: var(--muted); }

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  .sys-hol-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sys-hol-add > .btn { justify-self: start; }
}
@media (max-width: 560px) {
  .sys-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sys-facts > div { grid-template-columns: minmax(0, 1fr); gap: 1px; }
}

/* ---------- print ----------
   The settings screen prints with the report because the RULES that produced
   the figures belong on paper. Where the backups are kept and whether a
   password is set do not. */
@media print {
  .sys-panels { display: none; }
}

/* ── الدخول إلى البرنامج: the recovery code shown once, and the switch ── */
.sys-code {
  display: grid;
  gap: 10px;
  max-width: 460px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}
.sys-code .btn { justify-self: start; }
.sys-req { margin-top: 10px; max-width: 640px; }

/* ── 79-v6-traits.css ─────────────────────────────── */

/* ============================================================
   79-v6-traits — plan_update.md (2026-10-31)

   «عملة الراتب» for several at once and «قوالب الخصائص» (93-v6-traits.js),
   the currency on the preview of التخصيص (98-v6-tune.js), and the currency
   filters of الموظفون and الحضور والرواتب. Only what the shared kit
   (.seg, .v6-dialog, .sf-drop, .tbl) does not already draw.
   ============================================================ */

/* ---------- the currency button on الموظفون ---------- */
.sf-cur-i {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--good-soft);
  color: var(--good);
  font-weight: var(--w-700, 700);
  font-size: 11px;
  line-height: 1;
}

/* ---------- «عملة الراتب»: one big choice per currency ---------- */
.trt-curs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.trt-cur-b {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  color: var(--ink-2);
  text-align: start;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.trt-cur-b b { font-size: 20px; line-height: 1.1; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.trt-cur-b span { font-size: var(--fs-label); color: var(--muted); }
.trt-cur-b:hover { border-color: var(--accent); }
.trt-cur-b.is-on {
  border-color: var(--good);
  background: var(--good-soft);
}
.trt-cur-b.is-on b { color: var(--good); }
.trt-seg { flex-wrap: wrap; margin-top: 6px; }

/* ---------- «قوالب الخصائص»: a card per trait ---------- */
.trt-cards {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
.trt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.trt-card > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.trt-card b { color: var(--ink); font-weight: var(--w-600); }
.trt-card span { font-size: var(--fs-label); color: var(--muted); line-height: var(--lh-body); }
.trt-card i { font-style: normal; font-size: var(--fs-micro); color: var(--ink-2); }
.trt-card .btn { flex: none; }
.trt-tbl td .is-ok { color: var(--good); font-weight: var(--w-600); }
.trt-tbl td .is-warn, .trt-tbl small.is-warn { color: var(--warn, var(--crit)); }
.trt-tbl tr[data-st="same"], .trt-tbl tr[data-st="over"] { opacity: .7; }

/* ---------- the currency on «معاينة الراتب» ---------- */
.tn-prev-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tn-cur { display: inline-flex; align-items: center; gap: 8px; }
.tn-cur-l { font-size: var(--fs-label); color: var(--muted); }
.tn-cur-seg button { min-width: 42px; font-weight: var(--w-600); }
.tn-cur-seg button[aria-pressed="true"] { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }

/* ---------- the currency filter beside «طريقة الراتب» ---------- */
.reg-curf.is-on .inp { font-weight: var(--w-600); }

/* ---------- الإجازات (97-v6-leaves.js) ---------- */
.lv-panel .lv-stats { padding: 14px 16px 0; }
.lv-stat { cursor: default; }
.lv-stat > i { font-style: normal; font-size: var(--fs-micro); color: var(--muted); }
.lv-stat.is-warn > b { color: var(--warn, var(--crit)); }
.lv-bar { flex-wrap: wrap; gap: 8px; }
.lv-bar .inp { width: auto; min-width: 150px; }
.lv-bar .sp { flex: 1; }
.lv-tbl th.lv-emp { text-align: start; font-weight: var(--w-600); vertical-align: top; }
.lv-tbl .lv-sub { display: block; font-size: var(--fs-micro); color: var(--muted); font-weight: var(--w-400, 400); }
.lv-tbl .lv-dept, .lv-tbl .lv-pay { vertical-align: top; }
.lv-tbl tr.lv-last > * { border-bottom: 1px solid var(--line); }
.lv-d i { font-style: normal; color: var(--muted); font-size: var(--fs-micro); }
.lv-why-t { background: var(--m-4-soft, var(--accent-soft)); color: var(--m-4, var(--accent)); }
.tag.lv-ok { background: var(--good-soft); color: var(--good); }
.lv-foot { padding: 10px 16px 14px; margin: 0; }
.lv-f { display: grid; gap: 4px; margin: 10px 0 0; }
.lv-f > span { font-size: var(--fs-label); color: var(--ink-2); }
.lv-f.check { display: flex; align-items: center; gap: 8px; }
.lv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lv-chip {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--fs-label);
}
.lv-chip:hover { border-color: var(--accent); color: var(--ink); }
.lv-chip.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: var(--w-600); }
/* the period across months, the two tabs, the balances (2026-11-02) */
.lv-panel > .lv-tabs { padding: 0 16px; }
.lv-quick { display: inline-flex; gap: 6px; }
.lv-period-say { padding: 0 16px 10px; margin: 0; }
.lv-neg { color: var(--crit); }
.lv-year { display: inline-flex; align-items: center; gap: 4px; }
.lv-year b { min-width: 3.2em; text-align: center; }
.lv-year .lv-next svg { transform: rotate(180deg); }
.tag.lv-own { background: var(--accent-soft); color: var(--accent); }
.lv-bal td.n, .lv-bal th.n { width: 9em; }
.lv-tbl.lv-bal th.lv-emp { vertical-align: middle; }
.lv-bal-line { display: block; min-height: 1.4em; margin-top: 6px; font-size: var(--fs-label); color: var(--ink-2); }
.lv-rules { gap: 6px; }
.lv-rules label.check { display: flex; align-items: flex-start; gap: 8px; }
.lv-rules label.check > span { display: grid; gap: 1px; }
.lv-rules label.check i { font-style: normal; font-size: var(--fs-micro); color: var(--muted); }

/* ---------- حزم التقارير (97-v6-rpt-5-bundle.js) ---------- */
.bn-head { border-top: 1px solid var(--line); margin-top: 6px; }
.bn-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 12px;
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-2);
}
.bn-pick { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); }
.bn-pick i { font-style: normal; font-size: var(--fs-micro); }
.rep-note .bn-part-t { font-size: 1.15em; }

@media print {
  .tn-cur, .sf-cur-btn { display: none !important; }
}

/* ── 79-v6-users.css ─────────────────────────────── */

/* ============================================================
   79. المستخدمون والصلاحيات (97-v6-users.js) — and the two
       places a user meets their own account: the rail's foot
       (91-v6-month.js §91e) and its «كلمة السر» dialog.

   The page is the registers' look (77-v6-staff.css's .sf-bar,
   the kit's .v6-list / .v6-form / .v6-empty) in two columns:
   the list beside the editor of the one selected. What the kit
   did not have is built here, tokens only:

     .uu-mx         the matrix — sections × boxes, grouped like
                    the rail, one checkbox per cell
     .uu-presets    the row of starting points above it
     .uu-ed-f       the editor's foot, kept in view while the
                    matrix scrolls under it

   The administrator is the only one who ever sees this page, so
   nothing here hides anything for a user (79-v6-perms*.css do).
   ============================================================ */

/* ---------- the two columns ----------
   A container query, not a media query: the rail collapses and
   the window narrows, and only the page's own width says whether
   the list and the editor still fit side by side. */
.uu { container: uu / inline-size; display: grid; gap: 12px; min-width: 0; }
#uuNote[hidden] { display: none; }
.uu-cols {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.uu-side {
  position: sticky;
  top: 12px;
  display: grid;
  min-width: 0;
  max-height: calc(100vh - var(--ubar-h) - var(--phead-h) - 48px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}
#uuList { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.uu-main { min-width: 0; }
@container uu (max-width: 880px) {
  .uu-cols { grid-template-columns: minmax(0, 1fr); }
  .uu-side { position: static; max-height: none; }
}

/* ---------- the list ---------- */
.uu-bar .uu-q { flex: 1 1 180px; min-width: 150px; }
.uu-row { cursor: pointer; }
/* The name is the row's button; its hit area is the whole row. */
.uu-pick {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.uu-pick::after { content: ""; position: absolute; inset: 0; }
.uu-pick:focus-visible { outline: none; }
.uu-row:has(> .v6-row-b .uu-pick:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.uu-row .v6-row-t > .uu-pick { flex: 0 1 auto; }
.uu-row .v6-row-t > .badge { flex: none; }
.uu-row .v6-row-m > bdi { unicode-bidi: isolate; }
.uu-row.is-admin .v6-row-i { color: var(--accent); }
.uu-row.is-off .v6-row-t > .uu-pick { color: var(--muted); }
.uu-row .v6-row-f { gap: 0; padding-inline-end: 0; }
.uu-empty { padding: 28px 16px 32px; }
.uu-empty > p { font-size: var(--fs-label); }

.uu-notes {
  display: grid;
  gap: 6px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--card-3);
  border-end-start-radius: inherit;
  border-end-end-radius: inherit;
}
.uu-notes p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--fs-micro);
  line-height: 1.55;
  color: var(--muted);
}
.uu-notes svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- the editor ---------- */
.uu-ed { min-width: 0; }
.uu-ed .panel-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uu-ed-b { display: grid; gap: 20px; min-width: 0; }
.uu-form { gap: 12px; }
.uu-sw .switch { min-height: var(--ctrl-h); font-size: var(--fs-body); color: var(--ink); }
.uu-sw .switch > span { font-weight: var(--w-500); }

.uu-perm { display: grid; gap: 10px; min-width: 0; }
.uu-perm-h {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.uu-perm-h > .v6-form-h { width: auto; margin: 0; margin-inline-end: auto; padding: 0; border: 0; }
.uu-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.uu-presets-l { font-size: var(--fs-label); color: var(--muted); }
.uu-presets .btn[aria-pressed="true"] {
  background: var(--sel);
  border-color: var(--accent);
  color: var(--ink);
}

/* ---------- the matrix ---------- */
.uu-mx-w {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.uu-mx {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--fs-cell);
}
.uu-mx col.uu-mx-sec { width: auto; }
.uu-mx col.uu-mx-c { width: 68px; }
.uu-mx col.uu-mx-all { width: 60px; }
.uu-mx th, .uu-mx td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  vertical-align: middle;
  line-height: var(--lh-cell);
}
.uu-mx thead th {
  background: var(--card-3);
  border-bottom-color: var(--line);
  font-size: var(--fs-micro);
  font-weight: var(--w-500);
  color: var(--muted);
}
.uu-mx thead th.uu-mx-sec { text-align: start; }
.uu-mx-h {
  display: grid;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
}
.uu-mx-h > span { color: var(--ink-2); font-weight: var(--w-600); }
.uu-mx tbody:last-child tr:last-child > * { border-bottom: 0; }
.uu-mx-g > th {
  padding: 5px 12px;
  background: var(--card-2);
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  color: var(--muted);
  text-align: start;
}
.uu-mx tbody th.uu-mx-sec {
  padding-inline: 12px 8px;
  text-align: start;
  font-weight: var(--w-400);
}
.uu-mx th.uu-mx-sec > b {
  display: block;
  font-weight: var(--w-500);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uu-mx th.uu-mx-sec > span {
  display: block;
  font-size: var(--fs-micro);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uu-mx tbody tr[data-uu-mod] { transition: background var(--t-fast) var(--ease); }
.uu-mx tbody tr[data-uu-mod]:hover { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
/* a section the user will not see at all reads quieter than one they will */
.uu-mx tbody tr[data-on="0"] th.uu-mx-sec > b { color: var(--ink-2); }
/* a 3px Royal bar at the reading edge (the right: the page is RTL) — the
   kit's mark of a selected row, here «this section is in» */
.uu-mx tbody tr[data-on="1"] th.uu-mx-sec { box-shadow: inset -3px 0 0 var(--accent); }
.uu-mx td.is-na { color: var(--day-rule); }
.uu-mx td.uu-mx-all { border-inline-start: 1px solid var(--line-soft); background: var(--card-3); }
.uu-mx thead th.uu-mx-all { border-inline-start: 1px solid var(--line); }
/* the whole cell is the box's target */
.uu-cell {
  display: grid;
  place-items: center;
  min-height: 28px;
  cursor: pointer;
}
.uu-mx input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.uu-mx input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.uu-sum {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  line-height: var(--lh-body);
  color: var(--ink);
}
.uu-sum.is-none { background: var(--warn-soft); color: var(--warn); }

/* the editor's foot — «احفظ المستخدم» never leaves the screen */
.uu-ed-f {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--card-3);
  border-end-start-radius: inherit;
  border-end-end-radius: inherit;
}
.uu-ed-f > .uu-del { margin-inline-end: auto; color: var(--crit); }
.uu-ed-f > .uu-del:hover { background: var(--crit-soft); border-color: var(--crit); color: var(--crit); }
.uu-say {
  flex: 1 1 200px;
  min-width: 0;
  font-size: var(--fs-label);
  font-weight: var(--w-500);
  line-height: var(--lh-body);
  color: var(--crit);
}
.uu-say:empty { flex-basis: 0; }

/* the administrator's card and the «how it works» card */
.uu-ed-b > p { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-2); }
.uu-ed-b > p b { color: var(--ink); font-weight: var(--w-600); }
.uu-facts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.uu-facts li {
  position: relative;
  padding-inline-start: 16px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.uu-facts li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: .7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.uu-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   The top bar's end: who is signed in, what their job is, and —
   for a user — the key («كلمة السر») beside «قفل».
   ============================================================ */
/* The administrator's name stands alone: the wrapper steps aside. */
.v6-user-txt { display: contents; }
.v6-user.is-user .v6-user-txt { display: grid; min-width: 0; line-height: 1.3; }
.v6-user-job { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.v6-user-job[hidden] { display: none; }
.v6-user-pw[hidden] { display: none; }
/* the warehouse's amber key */
.v6-user-lock.v6-user-pw {
  width: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--warn-2);
  display: grid;
  place-items: center;
}
.v6-user-lock.v6-user-pw svg { width: 21px; height: 21px; }
.v6-user-lock.v6-user-pw:hover { background: color-mix(in srgb, var(--warn-2) 12%, transparent); }

/* ---------- «كلمة السر» — a user's own password ---------- */
.modal.v6-pw-dlg { width: min(460px, 100%); }
.v6-pw-dlg .v6-dialog-b { gap: 12px; }
.v6-pw-dlg .v6-dialog-b > p { font-size: var(--fs-label); line-height: var(--lh-body); color: var(--muted); }

/* ---------- the sign-in, once there are users (91-v6-month.js §91d) ---------- */
.v6-lock-box > .v6-lock-sub {
  margin-top: -8px;
  font-size: var(--fs-label);
  color: var(--muted);
}
.v6-lock-box > .v6-lock-who {
  margin-top: 0;
  padding: 8px 10px;
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--ink-2);
}

/* Paper: 80-print.css shows every .screen whatever its `hidden` says, so
   each screen that is not a report is taken off by id — the users page
   (accounts and their rights never belong on a report) and «لا صلاحية». */
@media print { #scUsers, #scNoAccess { display: none !important; } }

/* ── 80-print.css ─────────────────────────────── */

/* ============================================================
   Print — the report on paper — and the two pieces of on-screen
   layout that belong to 90-export.js: the export menu's rows and
   the PDF dialog's option grid.

   There is no PDF writer in this program. The browser draws the page, so the
   Arabic comes out shaped, selectable and searchable instead of a picture of
   text — which is all any JS pdf library would have managed. That makes this
   stylesheet the report's entire typography.
   ============================================================ */

/* ============================================================
   1. The export disclosure (on screen)

   The menu is built by buildExportMenu() and lives in the page head beside
   the black تصدير button, so its rows are styled here rather than in the
   shared control vocabulary — .menu itself stays generic.

   Rows are <button><b>…</b><i>…</i></button> and nothing else, because
   60-db.js's resolveDownloads() replaces the innerHTML of #miXlsx and #miTpl
   with exactly that pair once the host answers whether it will mediate a
   download. Any extra element inside a row would survive on six rows and
   vanish on two. That is also why the group headings are SIBLINGS of the
   rows rather than wrappers around them.
   ============================================================ */
#exportMenu {
  min-width: 306px;
  max-width: 348px;
  padding: 6px 5px 7px;
}

/* The rail labels its two nav groups; this labels its four. Same register:
   weight and colour, never tracking and never caps. */
#exportMenu .ex-g {
  padding: 11px 11px 5px;
  font-size: var(--fs-micro);
  font-weight: var(--w-600);
  color: var(--muted);
}
#exportMenu .ex-g:first-child { padding-top: 4px; }

#exportMenu .ex-item {
  position: relative;
  padding: 9px 12px;
  border-radius: var(--r-sm);
}
#exportMenu .ex-item b {
  font-size: var(--fs-body);
  font-weight: var(--w-600);
  color: var(--ink);
}
#exportMenu .ex-item i {
  margin-top: 2px;
  font-size: var(--fs-micro);
  line-height: var(--lh-cell);
  color: var(--muted);
}

/* The rail marks its active row with a 3px accent bar on the inline-start
   edge; the menu marks the row under the pointer the same way, so the two
   lists speak one language. Fill AND marker, never colour alone. */
#exportMenu .ex-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  inset-block: 9px;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
#exportMenu .ex-item:hover::before,
#exportMenu .ex-item:focus-visible::before { opacity: 1; }

/* ---------- the PDF dialog's option grid ---------- */
.pdf-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.pdf-opts .check {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: var(--fs-label);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.pdf-opts .check:hover { border-color: var(--muted); }
/* A chosen section is a filled control, not a ticked box in a list — the
   dialog is asking what the report CONTAINS, and the answer should be
   readable at a glance before the print window opens. */
.pdf-opts .check:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}
/* جدول الموظفين is forced on whenever تفصيل الأيام is chosen — the day rows
   live inside that table. Disabled, but still visibly chosen. */
.pdf-opts .check:has(input:disabled) { opacity: .7; cursor: default; }

@media (max-width: 520px) {
  .pdf-opts { grid-template-columns: minmax(0, 1fr); }
}

/* The printed masthead exists only on paper. 90-export.js builds it into
   #page on the first print and leaves it there. */
.print-head { display: none; }

/* ============================================================
   2. Paper
   ============================================================ */
@media print {

  /* A4 LANDSCAPE. Thirteen Arabic columns — name, department, ids, days,
     hours, average, in, out, deduction, addition, net and two more — do not
     fit in the 190mm a portrait A4 leaves after margins. Portrait would either
     clip the money columns or shrink the names to 5pt.

     One page size for the whole report, not a named page for the register
     alone: `@page reg` + `#scRegister { page: reg }` is Chrome-only, and a
     report that silently changes shape by browser is worse than one that is
     landscape throughout. The KPI strip and both charts are laid out below
     for the wider sheet. */
  @page { size: A4 landscape; margin: 12mm; }

  /* ──────────────────────────────────────────────────────────
     THE MOST IMPORTANT RULE IN THIS FILE.

     Every colour token is re-declared here, and every one carries
     !important. The dark palette is declared under
     `:root:not([data-theme="light"])`, specificity (0,2,0); a bare `:root`
     is (0,1,0) and loses to it. Without the flags, a reader whose OS is in
     dark mode prints the dark theme's pale ink onto white paper and gets a
     blank-looking sheet — and does not find out until it is in their hand.

     The list below is the WHOLE of 10-tokens.css's dark block, token for
     token — 81 of them. A token the print block misses keeps its screen
     value on paper, which for a dark-mode user is pale ink on white; the
     eight measure hues and the six category slices are the ones that now
     reach paper through the KPI chips, the sparklines, the table bars and
     the donut, so they are re-declared like everything else.

     These are the only literal colours outside 10-tokens.css, and they are
     literal because paper is not a theme: ink is black, the sheet is white,
     and neither is derivable from a screen token. Every value is also chosen
     to survive a monochrome laser — the families separate by lightness, not
     only by hue. The ratios in the comments are computed, not estimated.
     ────────────────────────────────────────────────────────── */
  :root {
    color-scheme: light !important;

    /* ---------- surfaces ----------
       The sheet is white and stays white. Two tints are spent, and only two:
       the table header, and the sunken ground that a progress track and an
       expanded day block sit on — a white track inside a white card leaves a
       bar with no extent to read against. */
    --paper:   #ffffff !important;
    --card:    #ffffff !important;
    --card-2:  #f2f4f7 !important;
    --card-3:  #eceff4 !important;

    /* ---------- ink ---------- */
    --ink:     #000000 !important;
    --ink-2:   #1b1f26 !important;   /* 16.7 on the sheet */
    --muted:   #454c59 !important;   /*  8.9 on the sheet · 8.0 on the header */

    /* A border is a non-text indicator and still owes 3:1 — on the header
       tint as well as on white, since the register's header cells are
       bounded by it. 3.72 on the sheet, 3.23 on --card-3. */
    --line:      #7d8593 !important;
    --line-soft: #c9cfd9 !important;
    --grid:      #c9cfd9 !important;

    /* ---------- indigo: structure ---------- */
    --accent:      #1b347e !important;   /* 10.9 on the sheet */
    --accent-2:    #1b347e !important;   /* a chart stroke is one ink on paper */
    --accent-soft: #e7ebf7 !important;
    --on-accent:   #ffffff !important;
    /* A selected row is a screen state, not a fact about the month. It must
       not print as a highlighted row on a payroll sheet someone signs. */
    --sel:         #ffffff !important;

    /* ---------- the solid button ----------
       It does not print — .btn is display:none below — but the token is
       re-declared anyway: in dark mode --solid is NEAR-WHITE, and anything
       that ever borrows it would print white on white. */
    --solid:    #14181f !important;
    --on-solid: #ffffff !important;

    /* ---------- state ----------
       The -2 values are the non-text pair: a bar, a line, a fill. They clear
       3:1 against the sheet AND against --card-2, which is the track a
       progress bar actually sits in. */
    --good:      #15543a !important;
    --good-2:    #1c7a52 !important;
    --good-soft: #e4efe9 !important;
    --crit:      #7b2a22 !important;
    --crit-2:    #a2372c !important;
    --crit-soft: #f6e3e0 !important;
    /* On paper every filled indicator is dark, so the label on one goes the
       other way — white. In dark mode these two are the opposite. */
    --on-crit:   #ffffff !important;
    --on-fill:   #ffffff !important;

    /* Amber and gold are adjacent hues, and on paper they may not collapse
       into one: a diagnostic note and a customised value would then print as
       the same ink on the same tint, and DESIGN §4's promise — that every
       customised thing is findable by colour alone — would be false on the
       one artefact a clerk signs. Amber is carried toward its screen hue
       (more orange than gold) and made the darkest chromatic ink on the sheet
       — L* 17 against gold's 33, crit's 29, good's 31, accent's 24 — so the
       separation survives a monochrome laser too, and it is still not black
       (--ink-2 sits 6 L* below it). 14.3 on paper, 10.1 on --warn-soft. */
    --warn:      #4a1d04 !important;
    --warn-2:    #7a3208 !important;
    --warn-soft: #ecd5ba !important;

    /* gold still means exactly one thing on paper: customised away from the
       layer above. It darkens, so it stays legible as text at 8pt. */
    --gold-ink:  #6a4507 !important;
    --gold-mark: #8a5f0d !important;
    --gold-fill: #c9a34a !important;
    --gold-soft: #f6ecd8 !important;

    --focus: #1b347e !important;

    /* ---------- v6 · the stamp ----------
       A locked month's sheet may carry «مُعتمَد». On paper it is a dark plum
       ink — L* 22, between the accent and the ink — so it is still its own
       colour on a colour printer and a firm dark ring on a monochrome one.
       10.6 on the sheet. */
    --stamp:      #43226f !important;
    --stamp-soft: #f1ecf7 !important;
    --on-stamp:   #ffffff !important;

    /* ---------- v6 · day states ----------
       The strip prints: an employee's sheet may show his month as cells.
       Each state keeps its FORM (76-v6-kit.css) — that is what separates
       absent from leave from mission with one ink — and its hue is carried
       at paper strength. The five that alias a measure hue are written out
       anyway: a token this block misses keeps its SCREEN value on paper,
       and for a dark-mode reader that is a pale cell on a white sheet. */
    --day-ok:      #5b6473 !important;   /* 5.9 on the sheet */
    --day-ot:      #15764a !important;   /* = --m-7 on paper */
    --day-short:   #b07c00 !important;   /* 3.7 — darker than on screen: paper
                                            has no glow to carry a bright amber */
    --day-single:  #a75409 !important;   /* = --m-5 */
    --day-absent:  #a83226 !important;   /* = --m-8 */
    --day-leave:   #0a7263 !important;   /* = --m-4 */
    --day-mission: #5a3fc0 !important;   /* = --m-3 */
    --day-off:     #e6e9ee !important;
    --day-rule:    #8a93a2 !important;

    /* ---------- the measure hues ----------
       These reach paper: the KPI chip's ground and glyph, the tile's
       sparkline, the bar in the register's hours column, the drawer's impact
       strip. The hue is kept — it is the design's one own idea and a report
       in colour should still say that violet means إجمالي الساعات — but every
       value is darkened until the bare hue clears 3:1 on the sheet and on a
       progress track, and every -ink clears 4.5 on its own -soft chip.
       The -soft grounds print at L* ≈ 93: a tint, not a wash of toner. */
    --m-1: #2a4bb0 !important;  --m-1-ink: #1e3a8f !important;  --m-1-soft: #e8ecf8 !important;
    --m-2: #0b6d84 !important;  --m-2-ink: #0a5b6e !important;  --m-2-soft: #e2f0f4 !important;
    --m-3: #5a3fc0 !important;  --m-3-ink: #4a32a6 !important;  --m-3-soft: #ece7f9 !important;
    --m-4: #0a7263 !important;  --m-4-ink: #096052 !important;  --m-4-soft: #e1f0ec !important;
    --m-5: #a75409 !important;  --m-5-ink: #8c4508 !important;  --m-5-soft: #f8e9db !important;
    --m-6: #4a5468 !important;  --m-6-ink: #3e4757 !important;  --m-6-soft: #eceef2 !important;
    --m-7: #15764a !important;  --m-7-ink: #12633e !important;  --m-7-soft: #e4efe8 !important;
    --m-8: #a83226 !important;  --m-8-ink: #8f2a20 !important;  --m-8-soft: #f7e4e1 !important;

    /* ---------- the category ramp: the donut's slices ----------
       Slices TOUCH, and two adjacent departments that print as the same grey
       make the chart a lie on the one machine most of these reports come out
       of. So on paper the ramp is a lightness ladder — L* 26, 14, 35, 44, 53,
       61, 80 — with every neighbouring pair at least 8 L* apart, while each
       slice keeps its screen hue (c-2 stays the darker navy it is on screen,
       c-6 the slate, --c-rest the quiet grey). The legend names every slice
       beside its dot, so the ladder only has to separate them, not identify
       them. */
    --c-1:    #1f3a7d !important;
    --c-2:    #10233f !important;
    --c-3:    #0a5b63 !important;
    --c-4:    #6b5ab5 !important;
    --c-5:    #b07020 !important;
    --c-6:    #8b95a6 !important;
    --c-rest: #c2c8d2 !important;

    /* The rail is hidden on paper, but its tokens are re-declared anyway:
       anything that ever borrowed one would otherwise print a black band.
       --spine-3 in particular is the ACTIVE nav row's fill and is new in v3. */
    --spine:        #ffffff !important;
    --spine-2:      #f2f4f7 !important;
    --spine-3:      #eceff4 !important;
    --spine-line:   #7d8593 !important;
    --spine-ink:    #000000 !important;
    --spine-muted:  #454c59 !important;
    --spine-accent: #6a4507 !important;
    --spine-focus:  #1b347e !important;

    /* Depth is a screen illusion. On paper a shadow is a grey smear. */
    --sh-1: none !important;
    --sh-2: none !important;
    --sh-3: none !important;
    --sh-inset: none !important;

    /* Dark mode steps the heaviest weights down (light type blooms on a dark
       ground). Paper is not a dark ground, so the light-mode weights come
       back — each one a face the app ships (Cairo 400–700). */
    --w-300: 400 !important;
    --w-400: 400 !important;
    --w-500: 500 !important;
    --w-600: 600 !important;
    --w-700: 700 !important;
    --w-title: 650 !important;
  }

  /* ──────────────────────────────────────────────────────────
     The type scale, in points.

     v3's screen scale runs to 30px, which is 22pt — a KPI figure that size
     would take a third of the sheet's height. Re-declaring the TOKENS rather
     than chasing every screen's own classes means a screen this file has never
     heard of still prints at paper sizes: the scale is the one thing every
     component reads. The proportions are kept, compressed.

     The 12px Arabic floor is a SCREEN floor — it exists because ق ف ث merge
     on a 96dpi monitor. A 300dpi sheet has four times the resolution and the
     floor comes down with it; 6.8pt is the smallest thing here and it is
     reserved for column headers and sub-labels, never for a figure.
     ────────────────────────────────────────────────────────── */
  :root {
    --fs-micro:  6.8pt !important;
    --fs-label:  7.2pt !important;
    --fs-cell:   7.8pt !important;
    --fs-body:   8.4pt !important;
    --fs-lead:   9pt   !important;
    --fs-h3:     10pt  !important;
    --fs-h2:     11.5pt !important;
    --fs-h1:     13pt  !important;
    --fs-num-lg: 10.5pt !important;
    --fs-num-xl: 13pt  !important;

    /* A card on paper is bounded by its rule, not by a corner. Bars, chips
       and tags keep theirs — a pill that prints square stops reading as a
       measured length. */
    --r-lg: 0 !important;
    --r-xl: 0 !important;

    --gutter: 0 !important;
    --page-max: none !important;
  }

  /* Print the design, not the printer's guess at it. The palette above is
     already ink-on-white, so forcing exact reproduction everywhere costs
     nothing and rescues every bar, fill, table header and status square in one
     declaration instead of a list that goes stale as screens are added. */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    /* no half-finished transition may be baked into the paper */
    transition: none !important;
    animation: none !important;
  }

  /* Named anyway, and deliberately: DESIGN §8 lists these by name, and a
     future browser that narrows the universal selector's reach must still
     print a bar as a bar. These are the things whose MEANING is their fill —
     the progress bar, the measure chip, the initial square, the legend dot,
     the source chip, the table header and every chart fill. */
  .bar, .bar i, .ichip, .avat, .dot, .src, .tag, .badge, .kpi-flag,
  table.tbl thead th, table.days th,
  svg rect, svg circle, svg path, svg polygon {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: var(--paper) !important;
    color: var(--ink);
    font-size: 9pt;
    /* The text face.s descenders clip below 1.5 — the floor holds on paper too, where
       there is no scrollbar to reveal what a tight line box cut off. */
    line-height: var(--lh-body);
  }

  /* ---------- the frame comes apart ----------
     The grid exists to hold a rail that is not printed; left in place it
     would reserve 244px-worth of column for nothing. */
  .frame { display: block !important; min-height: 0 !important; }
  .main { display: block !important; background: var(--paper) !important; }
  .page { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  body.drawer-open .main { padding-inline-end: 0 !important; }

  /* With no file open the frame is hidden with the `hidden` attribute and the
     landing screen is up. `[hidden]` is (0,1,0) and so is `.frame`, and this
     stylesheet is concatenated after 20-base.css — so the rule above would
     WIN and print the empty shell on a ctrl+P from the landing screen. The
     attribute selector puts it back at (0,2,0). The same guard is not wanted
     on .screen: revealing every screen is the point of printing. */
  .frame[hidden] { display: none !important; }

  /* ---------- chrome and controls: gone ----------
     A printed button is a lie — it cannot be pressed.

     .phead takes the page title, the export disclosure, the whole filter row
     and the filter chips with it in one line, because they are one element in
     v3. What they said is reprinted by the masthead below, which is the only
     place on paper that can carry it: the sheet has no sticky top. */
  .spine,
  .ubar,
  .phead,
  .drawer,
  .drawer-scrim,
  .calc,
  .toasts,
  .toast,
  .tip,
  .intake,
  .back,
  .menu,
  .menu-wrap,
  .selbar,
  .skel,
  .btn,
  .seg,
  .switch,
  .tune-i,
  .row-x,
  .ubtn,
  .collapse,
  .theme,
  .file-chip,
  .sort-i,
  input, select, textarea,
  .sprite { display: none !important; }

  /* A link is a button: pressed on paper it does nothing, but its label is
     often half a sentence, so it loses its affordance rather than its text. */
  .link { color: var(--ink) !important; text-decoration: none !important; }

  /* The selection column is positional — printing it would shift every other
     column, and preparePrint() has already left selection mode. Belt and
     braces, because the shift is silent and only visible on paper. */
  table.tbl th.c-sel, table.tbl td.c-sel { display: none !important; }

  /* ---------- the report masthead ----------
     The rail, the utility bar and the filter row do not print. What they
     carried — which file, which period, which filters — prints here instead,
     because a payroll page with no period on it is indistinguishable from
     next month's. */
  .print-head {
    display: block !important;
    border-bottom: 1pt solid var(--line);
    padding-bottom: 6pt;
    margin-bottom: 10pt;
    break-after: avoid;
  }
  .ph-row { display: flex; align-items: baseline; gap: 10pt; }
  .ph-title {
    font-size: 14pt;
    color: var(--ink);
    font-weight: var(--w-700);
  }
  .ph-file {
    margin-inline-start: auto;
    font-size: 8.5pt;
    color: var(--muted);
  }
  .ph-meta {
    margin-top: 5pt;
    font-size: 8.5pt;
    color: var(--ink-2);
    line-height: 1.7;
  }
  /* The filters in force, as tags — the same shape the filter chips have on
     screen, so the sheet says what the screen said. */
  .ph-tags { margin-top: 5pt; display: flex; flex-wrap: wrap; gap: 5pt; }
  .ph-tag {
    padding: 1pt 5pt;
    border: .5pt solid var(--line);
    border-radius: var(--r-xs);
    font-size: 7.6pt;
    color: var(--ink-2);
  }
  /* A filtered figure must never be mistakable for a total — least of all on
     paper, where there is no filter row above it to explain the number. */
  .ph-tag.is-filtered {
    background: var(--warn-soft);
    border-color: var(--warn);
    color: var(--warn);
    font-weight: var(--w-600);
  }

  /* ---------- screens ----------
     Print reveals every screen; these are the ones that are tools rather than
     report: a saved-files list, a settings form and the column mapper say
     nothing about the month. */
  #scLibrary, #scSettings, #scSetup { display: none !important; }

  .screen { display: grid !important; gap: 10pt; max-width: none; }

  /* v2 gave each screen its own heading block; v3 hoists it into the page
     head. .screen-head is display:none in 30-shell.css and nothing here
     revives it — the masthead and each panel's own head carry the report. */

  /* Sections the dialog can switch off. All gated on `.pdf-sel` — the marker
     preparePrint() sets — so a print that never went through the dialog still
     puts the whole report on paper instead of a blank sheet. */
  /* `.kpis:not(.ot-band)`: «ملخّص الأرقام» names the نظرة عامة's band. The
     الإضافي screen draws the same component, but it is that section's own
     head — switching the overview's summary off must not decapitate a table
     the reader deliberately asked for. It rides with .pdf-ot instead — and
     الغياب's and المهمات's bands ride with their own sections the same way.

     المهمات is `pdf-msn`, 90-export.js's PDF_OPTS key "Msn" lowercased, and
     OFF by default there: most files hold no mission at all, and a report
     that printed «لا مهمات» on a sheet of its own every month would be a
     page nobody asked for. */
  body.pdf-sel:not(.pdf-kpi) .kpis:not(.ot-band):not(.abs-band):not(.msn-band):not(.ded-band),
  body.pdf-sel:not(.pdf-charts) .ov-grid,
  body.pdf-sel:not(.pdf-table) #scRegister,
  body.pdf-sel:not(.pdf-ot) #scOt,
  body.pdf-sel:not(.pdf-abs) #scAbsence,
  body.pdf-sel:not(.pdf-msn) #scMissions,
  body.pdf-sel:not(.pdf-ded) #scDed,
  body.pdf-sel:not(.pdf-depts) #scDepts,
  body.pdf-sel:not(.pdf-diag) #scCheck { display: none !important; }

  /* دمج الأسماء and التخصيصات are "what was decided about this file", so they
     ride with فحص الملف rather than asking the dialog for two more checkboxes
     nobody would read. */
  body.pdf-sel:not(.pdf-diag) #scMerge,
  body.pdf-sel:not(.pdf-diag) #scRules { display: none !important; }

  /* One forced break, and only where something already filled the page. A
     blanket rule would open the report on an empty sheet whenever the section
     above it was switched off. */
  body.pdf-kpi #scRegister, body.pdf-charts #scRegister { break-before: page; }
  body.pdf-table #scOt { break-before: page; }
  /* Its own sheet whenever anything filled the page above it, and never a
     blanket rule: a forced break under a section that was switched off
     opens the report on an empty sheet. */
  body.pdf-table #scAbsence, body.pdf-ot #scAbsence { break-before: page; }
  /* المهمات sits under الغياب on the sheet as it does in the rail, and
     takes a page of its own on the same rule. */
  body.pdf-table #scMissions, body.pdf-ot #scMissions, body.pdf-abs #scMissions { break-before: page; }
  body.pdf-table #scDepts, body.pdf-ot #scDepts, body.pdf-abs #scDepts,
  body.pdf-msn #scDepts, body.pdf-ded #scDepts { break-before: page; }
  /* الخصومات, under الإضافي as in the rail, on a page of its own the same way */
  body.pdf-table #scDed, body.pdf-ot #scDed { break-before: page; }

  /* The mission dialog and every door into it are screen things. .back and
     .btn are already gone above; these are named anyway, because a door is
     not always a .btn and the dialog must never reach paper by a later
     class. The records the doors made — the kind, the credit, the reason,
     the note — are text and print. */
  #msnBack,
  .modal.msd,
  .msn-open,
  .msn-xl { display: none !important; }

  /* ---------- panels ---------- */
  .panel {
    box-shadow: none !important;
    border: 0;
    border-radius: 0;
    background: none;
    break-inside: auto;
  }
  .panel-head {
    padding: 0 0 4pt;
    border-bottom: .75pt solid var(--line);
    margin-bottom: 5pt;
    break-after: avoid;          /* a heading alone at the foot of a sheet */
  }
  .panel-head h2, .panel-head h3 { font-size: 11pt; }
  .panel-head .meta { font-size: 8pt; }
  .panel-body { padding: 0; }

  /* ---------- the KPI strip ----------
     Four across on the landscape sheet, as on screen. The figures are the
     report's headline and they keep their tile — a bordered box is how this
     design says "this is one quantity", and on paper the border is all that
     is left of the card. */
  .kpis {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6pt !important;
  }
  .kpi {
    padding: 5pt 7pt;
    border: .75pt solid var(--line);
    border-radius: 0;
    background: var(--card);
    break-inside: avoid;
  }
  .kpi-l { font-size: 7.2pt; }
  .kpi-v { font-size: 13pt; line-height: 1.3; }
  .kpi-s { font-size: 7pt; }
  /* the filtered marker keeps its tint AND gains an edge, so it survives a
     printer that drops light fills */
  .kpi-flag { border: .5pt solid var(--warn); }

  /* the tinted measure chip, the initial square, the legend dot: small
     enough on paper that they mark without dominating */
  .ichip { width: 15pt; height: 15pt; }
  .ichip svg { width: 9pt; height: 9pt; }
  .ichip-sm { width: 12pt; height: 12pt; }
  .ichip-sm svg { width: 8pt; height: 8pt; }
  .avat { width: 15pt; height: 15pt; font-size: 7pt; }
  .dot { width: 6pt; height: 6pt; }

  /* ---------- the progress bar ----------
     Its fill is the measure's hue and it prints. The track is --card-2, a
     tint rather than white, plus a hairline: a bar that reads 90% and a bar
     that reads 20% must differ by their FILL, and with no track there is
     nothing for the short one to be short against. */
  .bar {
    height: 4.5pt;
    min-width: 30pt;
    border: .4pt solid var(--line-soft);
    background: var(--card-2) !important;
  }
  .bar i { background: var(--m, var(--accent)) !important; }
  .bar.is-good i { background: var(--good-2) !important; }
  .bar.is-crit i { background: var(--crit-2) !important; }

  /* ---------- charts ----------
     Both charts side by side: 273mm of landscape is room enough, which is the
     other half of the case for landscape. The labels are settled here because
     an SVG <text> takes fill, not color — and because `stroke` INHERITS from
     20-base.css's sprite rule, so a chart label with no `stroke:none` prints
     as an outline of itself. */
  .ov-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8pt !important;
  }
  .ov-chart { break-inside: avoid; }
  /* Not the plot's own .ov-svg: its viewBox is 0 0 100 100 with
     preserveAspectRatio="none", so `height: auto` made it a SQUARE the width
     of the chart and the daily attendance line ran down the whole sheet. It
     fills its plot cell, as on screen (62-overview.css). */
  .ov-chart svg:not(.ov-svg) { width: 100%; height: auto; }
  svg text { fill: var(--ink); stroke: none; }

  /* ---------- tables ---------- */
  .tw { overflow: visible !important; max-height: none !important; border-radius: 0; }

  table.tbl {
    width: 100%;
    font-size: 7.8pt;
    line-height: var(--lh-cell);   /* never below it: ج ح خ ع غ م and final ى clip */
    /* auto, not fixed: on screen the shares are set by the register's own
       stylesheet for a known viewport. On paper the column count changes with
       payroll on or off, and letting the engine distribute thirteen columns
       across 273mm beats thirteen guessed percentages that no longer add up. */
    table-layout: auto;
  }

  /* A long register must repeat its header on every sheet, and no row may be
     torn in half across the fold. */
  table.tbl thead { display: table-header-group; }
  table.tbl tfoot { display: table-footer-group; }
  table.tbl tr, table.days tr { break-inside: avoid; }

  table.tbl thead th {
    position: static;            /* sticky paginates into a floating band */
    background: var(--card-3) !important;
    color: var(--ink-2);
    font-size: 6.8pt;
    padding: 3.6pt 4pt;
    border-bottom: .75pt solid var(--line);
    white-space: normal;
    overflow: visible;
  }
  table.tbl tbody td {
    padding: 3pt 4pt;
    border-bottom: .5pt solid var(--line-soft);
    /* On screen a cell clips and ellipsises. A truncated employee name on a
       payroll sheet is worse than a tall row, so on paper it wraps instead. */
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  table.tbl tbody tr:hover td,
  table.tbl tbody tr.is-sel td,
  table.tbl tbody tr.is-open td { background: var(--card) !important; }

  .cell-name .nm, .cell-dept .dn {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .cell-name .sub { font-size: 6.4pt; }

  /* The source chip is the only thing on the sheet that says whose pay was
     customised, so it prints — at the second line's size, as its word. */
  .src { font-size: 6.4pt; padding: 0 3pt; }

  /* ---------- the expanded day detail ----------
     Opt-in, and it doubles the page count, so it is off unless the dialog
     asked for it. */
  tr.detail { display: none; }
  body.pdf-days tr.detail { display: table-row; }
  /* keep an employee's own first day rows on the sheet that names them */
  body.pdf-days table.tbl > tbody > tr:not(.detail) { break-after: avoid; }

  tr.detail > td { background: var(--card-2) !important; }
  .detail-in { padding: 4pt 0 7pt; }
  .detail-in h4 { font-size: 7.2pt; margin-bottom: 3pt; }
  table.days {
    font-size: 7pt;
    table-layout: auto;
    width: 100%;
    border: .5pt solid var(--line-soft);
  }
  table.days th {
    background: var(--card-3) !important;
    font-size: 6.4pt;
    padding: 2.4pt 4pt;
  }
  table.days td { padding: 2.2pt 4pt; }

  /* ---------- badges, tags, notes ---------- */
  .badge, .chip {
    border: .5pt solid currentColor;
    padding: 0 4pt;
    font-size: 6.8pt;
  }
  .tag { padding: 0 4pt; font-size: 6.8pt; }
  .note {
    border: .5pt solid var(--line);
    padding: 5pt 7pt;
    font-size: 8pt;
    break-inside: avoid;
  }
  .empty { padding: 12pt 0; }

  /* ---------- money and change ----------
     Red and green are the screen's shorthand. On a monochrome office laser the
     surplus and the deficit come out the same grey, so the sign and the ▲ ▼
     glyph carry the meaning and the colour steps back. The sign is already
     inside the bidi isolate — see 20-base.css. */
  .pos, .neg { color: var(--ink) !important; }
  .delta, .delta.is-up, .delta.is-down, .delta.is-flat { color: var(--ink-2) !important; }

  /* nothing keeps a focus ring on paper */
  :focus-visible { outline: none !important; }
}

/* ── 95-boot.css ─────────────────────────────── */

/* ============================================================
   Boot — the first painted frame, and nothing else

   99-boot.js renders no markup, so it has no surface of its own and this
   file stays deliberately small. It owns two rules, and neither can live
   anywhere else: no component can suppress a transition it does not know
   is about to fire, and no component owns the canvas.

   1. THE GROUND OF THE FIRST FRAME.

   The theme is decided before the first paint — the inline script in
   <head> reads dawam.prefs.v1 and sets data-theme on <html> — but the
   ground it decides is only painted where something paints it. A body
   background does propagate to the canvas, and would be enough if the
   whole document arrived at once; this page is well over a megabyte of
   inlined font, vendor code and markup, and while it streams there is a
   canvas and no body box. On a machine set to dark that gap is a white
   flash, which is exactly the thing the inline script exists to prevent.

   So the ground is stated on :root, from the token, where it is true from
   the very first frame and in both themes. It is the same value body
   carries in 20-base.css, deliberately: this does not introduce a second
   opinion about what the page ground is, it just makes the existing one
   arrive earlier. v3's --paper is a cool near-white and its dark value is
   near-black — an old literal left here would flash the previous palette
   on every single open, which is why no colour in this file is written
   as anything but var(--paper).

   2. THE ONE FRAME THAT DOES NOT ANIMATE.

   index.html ships the theme control with «تلقائي» marked as the chosen
   one, because the markup cannot know what was saved. syncTheme() moves
   that mark to the real choice during boot, and `.theme button`
   transitions background and colour over --t-fast — so a user who chose
   dark or light watches the mark slide onto their own setting every time
   they open the app. It reads as the page correcting a mistake it just
   made, which is exactly what it is.

   The same goes for anything else boot() settles on the way in — the
   collapsed rail, the filter row syncing to CFG.mode: it is restoring a
   state, not changing one, and restoring a state is not an event worth
   animating.

   Loading last, after 80-print.css, so the flags below cannot be outranked
   during the one frame they apply. They are gone before anything prints.
   ============================================================ */

:root { background: var(--paper); }

:root.booting *,
:root.booting *::before,
:root.booting *::after {
  /* !important because this has to beat every component rule for one frame,
     and `all: unset` would take the layout with it. The class is removed
     after the second animation frame, so nothing here outlives the boot. */
  transition: none !important;
  animation: none !important;
}

/* Deliberately not wrapped in prefers-reduced-motion: this is not a motion
   preference, it is a frame in which no motion was ever asked for. A user who
   allows animation still never asked to watch their own saved settings being
   applied. */

/* ── 96-v7-web.css ─────────────────────────────── */

/* ══════════════════════════════════════════════════════════════
   96-v7-web.css — the page on a web server (98-v7-web.js)

   A door to a folder on the program's own machine (choose the backups
   folder, open it, open the data folder) has nothing to open on a web host.
   98-v7-web.js marks it .v7-gone and sets `hidden`; this keeps it gone
   whatever display a class of the kit gives it (.btn and .gs-field are
   display: inline-flex / grid, which beats the UA's [hidden]).
   ══════════════════════════════════════════════════════════════ */

.v7-gone,
.v7-gone[hidden] { display: none !important; }

/* «نزّل» beside a listed backup is a link dressed as the ghost button it
   replaces («أظهر في المجلد») — no underline, the button's own colour. */
.v6-row-a a.btn { text-decoration: none; }

/* The folder row is gone (98-v7-web.js): the note that followed it is now
   the first thing under the legend, which already keeps its distance. */
.v7-gone + .gs-twin { margin-top: 0; }

/* ── the mirror's line (97-v7-mirror.js): a copy, and of when ── */
.v7-mirror-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; font-size: 13px; line-height: 1.5;
  background: var(--warn-bg, #fff6e0); color: var(--warn-ink, #6b4a00);
  border-bottom: 1px solid var(--warn-line, #f0d9a0);
}
.v7-mirror-bar svg { width: 16px; height: 16px; flex: none; }
@media print { .v7-mirror-bar { display: none; } }

/* v6's screens that only a desktop runs (97-v7-mirror.js): their rail doors are
   never drawn on the web — whatever the rail's own permission pass decides */
.nav-i[data-route="fleet"], .nav-i[data-route="fpdesk"] { display: none !important; }

/* ── 97-v6-devrep.css ─────────────────────────────── */

/* «حسب الجهاز» — 97-v6-devrep.js, shared by v6's and v7's «سجل البصمات» */
.dvr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px 4px; }
.dvr-say { margin: 0; flex: 1 1 320px; font-size: var(--fs-label); color: var(--ink-2); }
#dvDept { max-inline-size: min(240px, 100%); }
.dvr-sum { margin-bottom: 4px; }
.dvr-total { margin: 4px 16px 10px; font-size: var(--fs-label); }
.dvr-dev { border-top: 1px solid var(--line); }
.dvr-dev > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 16px; cursor: pointer; list-style: none;
}
.dvr-dev > summary::-webkit-details-marker { display: none; }
.dvr-dev > summary::before { content: "◂"; color: var(--muted); transition: transform .15s ease; }
.dvr-dev[open] > summary::before { transform: rotate(-90deg); }
.dvr-dev > summary:hover { background: var(--card-2); }
.dvr-t td:first-child, .dvr-t th:first-child { width: 44px; color: var(--muted); }
/* the device of a punch, on «يوم» and «الشهر كله» */
.dv-devs { color: var(--ink-2); font-size: var(--fs-label); }
table.tbl.dv-grid .dv-month-device { min-inline-size: 132px; max-inline-size: 230px; text-align: start; white-space: normal; }

.dv-cover :is(#dvKpis, #dvYm, #dvSn, #dvDept, [data-dv="export"], [data-dv="import"], #dvCarry) {
  display: none;
}

/* التأخر والانصراف المبكر (dvLateHtml / dvLateMark, 97-v6-devrep.js): two
   times in the bar; a late first or an early last punch red, bold, a dot. */
.dv-late-box { display: inline-flex; gap: 8px; align-items: center; }
.dv-late-f { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label, 13px); color: var(--muted, inherit); white-space: nowrap; }
.dv-late-f .inp.dv-late-in { width: 7.5em; height: var(--ctrl-h-sm, 32px); padding-block: 0; }
.dv-late { color: var(--crit); font-weight: 700; white-space: nowrap; }
.dv-late .muted { color: inherit; }
.dv-late > i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); margin-inline-end: 5px; vertical-align: middle; }
.dv-grid .dv-c .dv-late > i { width: 5px; height: 5px; margin-inline-end: 2px; }

/* ── 97-v6-ovx.css ─────────────────────────────── */

/* ============================================================
   97-v6-ovx.css — نظرة عامة: more measures (97-v6-ovx.js, 2026-12-01)
   Colours are the screen's own tokens, so the dark theme follows.
   ============================================================ */

/* the row of more figures: the same card as الخلاصة, its cells on one grid */
.ovx-kpis { margin-block-start: 0; }
@media (min-width: 900px) { .ovx-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 560px) and (max-width: 899px) { .ovx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── تقويم الحضور ── */
.ovx-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 14px 18px 8px;
}
.ovx-wd { font-size: var(--fs-label); color: var(--muted); text-align: center; padding-bottom: 2px; }
.ovx-c {
  display: grid;
  place-items: center;
  aspect-ratio: 1.4;
  min-height: 26px;
  border-radius: 7px;
  font-style: normal;
  background: var(--card-2);
}
.ovx-c b { font-size: 12px; font-weight: var(--w-600); color: var(--ink-2); }
.ovx-c.is-pad { background: none; }
.ovx-c.is-off { background: repeating-linear-gradient(135deg, var(--card-2) 0 4px, transparent 4px 8px); }
.ovx-c.is-off b { color: var(--muted); font-weight: 400; }
/* five steps of the accent: few present → pale and edged in the warning colour */
.ovx-c.s1 { background: color-mix(in srgb, var(--crit) 22%, var(--card-2)); }
.ovx-c.s2 { background: color-mix(in srgb, var(--accent) 22%, var(--card-2)); }
.ovx-c.s3 { background: color-mix(in srgb, var(--accent) 42%, var(--card-2)); }
.ovx-c.s4 { background: color-mix(in srgb, var(--accent) 66%, var(--card-2)); }
.ovx-c.s5 { background: var(--accent); }
.ovx-c.s4 b, .ovx-c.s5 b { color: #fff; }
.ovx-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  padding: 0 18px 12px;
  font-size: var(--fs-label);
  color: var(--muted);
}
.ovx-legend .ovx-c { width: 18px; min-height: 12px; aspect-ratio: auto; height: 12px; border-radius: 3px; }
.ovx-legend span { padding: 0 4px; }
.ovx-note { margin: 0; padding: 0 18px 14px; font-size: var(--fs-label); color: var(--muted); }

/* ── التزام الإدارات ── */
.ovx-rate .bar i { background: var(--good-2, var(--accent)); }
.ovx-rate .is-low .bar i { background: var(--crit-2, var(--crit)); }
.ovx-rate .is-low .ov-rank-v { color: var(--crit); }

/* ── رواتب الإدارات ── */
.ovx-pay { margin-block-start: 0; }
.ovx-scroll { overflow-x: auto; padding: 4px 6px 8px; }
table.tbl.ovx-pay-t { width: 100%; }
table.tbl.ovx-pay-t td { white-space: nowrap; vertical-align: baseline; }
table.tbl.ovx-pay-t td, table.tbl.ovx-pay-t th { max-width: none; overflow: visible; text-overflow: clip; }
table.tbl.ovx-pay-t tbody th, table.tbl.ovx-pay-t tfoot th { white-space: normal; min-width: 150px; max-width: 220px; vertical-align: baseline; }
table.tbl.ovx-pay-t .cur-line { display: block; }
table.tbl.ovx-pay-t .cur-line.is-more { font-size: .88em; color: var(--muted); }
table.tbl.ovx-pay-t .ovx-eq { font-weight: var(--w-600); color: var(--ink-2); }
table.tbl.ovx-pay-t tbody th { font-weight: var(--w-600); text-align: start; }
table.tbl.ovx-pay-t .ovx-cut { color: var(--crit); }
table.tbl.ovx-pay-t .ovx-add { color: var(--good); }
table.tbl.ovx-pay-t .ovx-net { font-weight: var(--w-600); color: var(--ink); }
table.tbl.ovx-pay-t tfoot th, table.tbl.ovx-pay-t tfoot td { font-weight: var(--w-600); border-top: 2px solid var(--line); }
.ovx-share { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.ovx-share .bar { flex: 1; height: 8px; }
.ovx-share span { min-width: 44px; text-align: end; color: var(--muted); }
.ovx-aside { color: var(--muted); font-size: 11px; }
table.tbl.ovx-pay-t tbody th { background: inherit; }
table.tbl.ovx-pay-t { table-layout: auto; min-width: 980px; }

/* ============================================================
   لوحة الرسوم (97-v6-ovx.js §5, 2026-12-05): بطاقة المؤشر، العدّاد،
   المخطط العمودي، المخطط الحلقي. Four equal cards on a wide screen,
   two at medium widths, one on a narrow window.
   ============================================================ */
.ov-grid.ovx-dash { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 640px) { .ov-grid.ovx-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ov-grid.ovx-dash { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ovx-card { display: flex; flex-direction: column; margin: 0; }
.ovx-card > .ovx-note { margin-top: auto; padding-top: 8px; }
.ovx-big { display: block; font-size: clamp(30px, 2.6vw, 40px); line-height: 1.05; font-weight: var(--w-600, 600); color: var(--ink); padding: 0 18px; }
.ovx-sub { margin: 4px 0 0; padding: 0 18px; font-size: var(--fs-label); color: var(--ink-2); }
.ovx-card > .ovx-big { margin-top: 12px; }

/* ── بطاقة المؤشر: the sparkline ── */
.ovx-spark { position: relative; height: 54px; margin: 14px 18px 4px; }
.ovx-spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; direction: ltr; }
.ovx-spark path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ovx-spark i { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--card); }

/* ── العدّاد ── */
.ovx-gauge { position: relative; padding: 14px 18px 0; direction: ltr; }
.ovx-gauge-s { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; overflow: visible; }
.ovx-g-band { fill: none; stroke-width: 5; }
.ovx-g-band.is-crit { stroke: var(--crit); }
.ovx-g-band.is-warn { stroke: var(--warn); }
.ovx-g-band.is-good { stroke: var(--good); }
.ovx-g-track { fill: none; stroke: var(--card-2); stroke-width: 22; }
.ovx-g-val { fill: none; stroke-width: 22; }
.ovx-g-val.is-crit { stroke: var(--crit); }
.ovx-g-val.is-warn { stroke: var(--warn); }
.ovx-g-val.is-good { stroke: var(--good); }
.ovx-g-c { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; direction: rtl; }
.ovx-g-c .ovx-big { padding: 0; }
.ovx-tone { font-size: var(--fs-label); font-weight: var(--w-600, 600); }
.ovx-tone.is-good { color: var(--good); }
.ovx-tone.is-warn { color: var(--warn-2, var(--warn)); }
.ovx-tone.is-crit { color: var(--crit); }
.ovx-g-end { position: absolute; bottom: -18px; font-size: var(--fs-label); color: var(--muted); }
.ovx-g-end.is-s { left: 18px; }
.ovx-g-end.is-e { right: 18px; }
.ovx-gauge + .ovx-sub { margin-top: 24px; text-align: center; }

/* ── المخطط العمودي ── */
.ovx-cols { container-type: inline-size; position: relative; display: flex; align-items: stretch; gap: 6px; height: 190px; margin: 14px 18px 4px; padding-top: 4px; }
.ovx-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ovx-col-v { font-size: 12px; font-weight: var(--w-600, 600); color: var(--ink-2); white-space: nowrap; }
.ovx-col-t { position: relative; flex: 1; width: 100%; max-width: 34px; border-bottom: 1px solid var(--line); }
.ovx-col-t i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; background: var(--accent); }
.ovx-col.is-low .ovx-col-t i { background: var(--crit); }
.ovx-col.is-low .ovx-col-v { color: var(--crit); }
.ovx-col-l { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ── المخطط الحلقي ── */
.ovx-donut-w { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; padding: 14px 18px 16px; }
.ovx-donut { position: relative; width: 150px; flex: none; }
.ovx-donut svg { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
.ovx-d, .ovx-d-track { fill: none; stroke-width: 15; }
.ovx-d-track { stroke: var(--card-2); }
.ovx-d-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ovx-d-c .ovx-big { padding: 0; font-size: 26px; }
.ovx-d-c span { font-size: 12px; color: var(--muted); }
.ovx-d.is-ok, .ovx-sw.is-ok { stroke: var(--good); background: var(--good); }
.ovx-d.is-leave, .ovx-sw.is-leave { stroke: var(--accent); background: var(--accent); }
.ovx-d.is-msn, .ovx-sw.is-msn { stroke: var(--m-7); background: var(--m-7); }
.ovx-d.is-abs, .ovx-sw.is-abs { stroke: var(--crit); background: var(--crit); }
.ovx-d.is-unset, .ovx-sw.is-unset { stroke: var(--warn); background: var(--warn); }
.ovx-leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1 1 150px; min-width: 0; font-size: var(--fs-label); }
.ovx-leg li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.ovx-sw { width: 10px; height: 10px; border-radius: 3px; }
.ovx-leg b { font-weight: var(--w-600, 600); color: var(--ink); }
.ovx-leg em { font-style: normal; color: var(--muted); min-width: 42px; text-align: end; }
.ovx-col-l .is-short { display: none; }
@container (max-width: 330px) { .ovx-col-l .is-full { display: none; } .ovx-col-l .is-short { display: inline; } }

/* ── 97-v7-device.css ─────────────────────────────── */

/* جهاز البصمة (97-v7-device.js) — the device's punches as they arrive. */

/* minmax(0, …): the month grid is wider than the screen and must scroll in
   .dv-scroll, not widen the page (a grid track's floor is its min-content). */
.dv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; width: 100%; }
.dv-empty { padding: 28px; text-align: center; color: var(--muted); }
.dv-empty h2 { color: var(--ink); margin: 0 0 6px; font-size: var(--fs-h3, 17px); }
.dv-err { color: var(--crit); }

.dv-dev { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.dv-dev i { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--crit); }
.dv-dev.is-on i { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.dv-dev.is-on b { color: var(--good); }
.dv-dev.is-off b { color: var(--crit); }
.dv-dev .muted, .dv .muted { color: var(--muted); font-weight: normal; }
.dv-sn { margin-inline-start: auto; font-size: var(--fs-label); }

.dv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.dv-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r, 10px); padding: 12px 16px; }
.dv-kpi span { display: block; color: var(--muted); font-size: var(--fs-label); }
.dv-kpi b { font-size: 26px; color: var(--ink); }
.dv-kpi small { display: block; color: var(--muted); font-size: 12px; }
.dv-kpi.is-good b { color: var(--good); }
.dv-kpi.is-warn b { color: var(--warn); }
.dv-kpi.is-gold b { color: var(--gold-ink); }

.dv-bar { flex-wrap: wrap; gap: 8px; }
.dv-ym, .dv-day { width: auto; }
.dv-q { flex: 0 1 280px; }
.dv-show { padding: 10px 16px 0; }
.dv-body { padding: 10px 0 0; }
.dv-none { padding: 24px 16px; color: var(--muted); text-align: center; }

.dv-scroll { overflow-x: auto; }
table.tbl.dv-t { table-layout: auto; }
table.tbl.dv-t td, table.tbl.dv-t th { white-space: nowrap; overflow: visible; text-overflow: clip; }
.dv-t tr.is-new td { background: var(--good-soft); animation: dv-arrive 1.6s ease-out; }
@keyframes dv-arrive { from { background: color-mix(in srgb, var(--good) 35%, transparent); } }
.dv-when .num:first-child { font-weight: 600; color: var(--ink); }

/* a header that sorts (dvTh) */
.dv-sort { all: unset; cursor: pointer; color: inherit; font: inherit; }
.dv-sort span { opacity: .45; }
.dv-sort.is-on { color: var(--accent); }
.dv-sort.is-on span { opacity: 1; }
.dv-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* the «مباشر» dot beside the last read */
.dv-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-inline-end: 6px; animation: dv-blink 2s infinite; }
@keyframes dv-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dv-live, .dv-t tr.is-new td { animation: none; } }

/* The month grid sizes to its contents — a time must never be ellipsised —
   and scrolls sideways inside .dv-scroll (table.tbl is fixed-layout, 50-tables.css). */
table.tbl.dv-grid { table-layout: auto; width: max-content; min-width: 100%; font-size: 12px; }
table.tbl.dv-grid th, table.tbl.dv-grid td { padding: 4px 6px; text-align: center; white-space: nowrap; overflow: visible; text-overflow: clip; }
table.tbl.dv-grid .dv-who { text-align: start; position: sticky; inset-inline-start: 0; background: var(--card); z-index: 11; min-width: 220px; }
.dv-grid .dv-dh small { display: block; color: var(--muted); font-weight: normal; }
.dv-grid .dv-c.is-in { background: var(--good-soft); color: var(--good); }
.dv-grid .dv-c small { display: block; opacity: .75; }
.dv-grid th.is-today { background: var(--accent-soft); color: var(--accent); }
.dv-grid td.is-today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }

.dv-note { display: flex; gap: 8px; color: var(--muted); font-size: var(--fs-label); margin: 0; }
.dv-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* «حذف» beside a device: it removes it, so it reads as such before its confirm. */
.dv-dev .dv-del { color: var(--crit); margin-inline-start: 8px; }
.dv-dev .dv-del:hover { border-color: var(--crit); }

/* المشرفون (2026-12-01) */
.dv-adm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; padding: 10px 12px; }
.dv-adm-head p { margin: 0; }
.dv-adm-p { margin: 6px 12px; }
.dv-adm-on { display: flex; flex-wrap: wrap; gap: 4px; }
.dv-adm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; font-size: .92em; }
.dv-adm-x { width: 20px; height: 20px; padding: 0; font: inherit; line-height: 1; color: var(--crit); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.dv-adm-x:hover:not(:disabled) { background: var(--crit-soft); }
.dv-adm-log { margin: 0 12px 8px; padding-inline-start: 18px; display: grid; gap: 4px; }

/* ── 98-wh-screens.css ─────────────────────────────── */

/* ============================================================
   The warehouse program's look, on what v6's screens are made of.

   40-controls.css, 50-tables.css and 30-shell.css carry the shared parts;
   this file is what is drawn differently once a part stands on a screen,
   and the screens the warehouse has its own design for: the sign-in
   (features/auth/login), the summary tiles (dashboard/hero_band.dart), the
   dialog (app_dialog_shell.dart). Last in the sheet, and for the screen
   only: paper keeps 80-print.css and 72-report.css.
   ============================================================ */

@media screen {

/* ---------- scrollbars: thin, round, tinted with the accent ---------- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 50%, transparent); }
.spine ::-webkit-scrollbar-thumb { background: var(--spine-3); }

/* ---------- a screen's buttons are the warehouse's pills ---------- */
.screen .btn { border-radius: var(--r-pill); }
.screen .btn:hover:not(:disabled, .btn-solid, .btn-primary, .btn-danger) {
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent);
}
.panel-head .inp { border-radius: var(--r-pill); }

/* The files bar: «تصدير Excel» in the warehouse's green, the rest in its blue. */
.dm-files .btn {
  height: var(--ctrl-h-sm);
  padding: 0 14px;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  color: var(--accent);
  font-size: var(--fs-label);
  font-weight: var(--w-700);
}
.dm-files .sf-bar-say + .btn {
  border-color: color-mix(in srgb, var(--good) 34%, transparent);
  background: color-mix(in srgb, var(--good) 8%, var(--card));
  color: var(--good);
}
.screen .dm-files .sf-bar-say + .btn:hover {
  border-color: color-mix(in srgb, var(--good) 50%, transparent);
  background: color-mix(in srgb, var(--good) 14%, var(--card));
  color: var(--good);
}

/* ---------- the summary band: separate tiles ----------
   A .kpis band keeps its one grid; each cell becomes a card, and reads as a
   warehouse tile: the tinted glyph square, the figure, its name, its note. */
.panel.kpis {
  gap: 12px;
  background: none;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.kpis .kpi {
  gap: 2px;
  margin: 0;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.kpis .kpi-h { display: contents; }
.kpis .ichip {
  order: 0;
  justify-self: start;
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  border-radius: var(--r-sm);
  background: var(--m-soft, var(--accent-soft));
  color: var(--m-ink, var(--accent));
}
.kpis .ichip svg { width: 18px; height: 18px; }
.kpis .kpi-v { order: 1; font-weight: var(--w-700); }
.kpis .kpi-l { order: 2; font-weight: var(--w-600); }
.kpis .kpi-s { order: 3; }

/* The one figure somebody signs: the warehouse's navy-to-blue hero tile. */
#scOverview .kpi-row.is-pay > .kpi:last-child {
  background: var(--grad-hero);
  border-color: transparent;
  box-shadow: var(--sh-accent);
}
#scOverview .kpi-row.is-pay > .kpi:last-child :is(.kpi-v, .kpi-l, .kpi-s, .cur) { color: #FFFFFF; }
#scOverview .kpi-row.is-pay > .kpi:last-child .kpi-s { opacity: .78; }
#scOverview .kpi-row.is-pay > .kpi:last-child .ichip {
  background: rgba(255, 255, 255, .14);
  color: #FFFFFF;
}
@media (min-width: 1280px) {
  #scOverview .kpi-row.is-pay > .kpi:last-child { grid-column: span 3; }
}

/* ---------- the register's head: one line where it fits ---------- */
@container regpanel (min-width: 1000px) {
  .reg-panel .panel-head { flex-wrap: nowrap; }
}
.reg-panel .panel-head h3 { flex: none; white-space: nowrap; }
.reg-panel .panel-head .meta {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reg-panel .panel-head .btn { flex: none; }
.reg-panel .panel-head select.inp { flex: 0 1 124px; min-width: 96px; }

/* ---------- dialogs (app_dialog_shell.dart) ----------
   A tint of the accent that fades into the body, a rule under the head, and
   the footer on the bench. */
.modal { border-radius: var(--r-lg); }
.v6-dialog-h {
  padding-block: 16px;
  padding-inline: 24px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent);
}
.v6-dialog-h h2, .v6-dialog-h h3 { font-size: 16px; font-weight: var(--w-700); }
.v6-dialog-h p { font-size: 11.5px; }
.v6-dialog-b { padding: 16px 24px 18px; }
.v6-dialog-b > .is-flush { margin-inline: -24px; }
.v6-dialog-f { padding: 12px 24px; background: var(--paper); }
.v6-dialog-x { border-radius: 50%; }

/* ---------- the sign-in (features/auth/login) ----------
   Navy in both themes, a gold glow, the application mark in its disc, and a glass card.
   Everything inside is the app's own markup, so the tokens are re-grounded
   here rather than each rule redrawn. */
.v6-lock {
  --ink: #F3F6FC;
  --ink-2: rgba(243, 246, 252, .82);
  --muted: rgba(243, 246, 252, .70);
  --card: rgba(255, 255, 255, .08);
  --card-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .14);
  --day-rule: rgba(255, 255, 255, .22);
  --accent: #C9B68C;
  --focus: #C9B68C;
  --crit: #FF9B9B;
  --warn: #E8D7AC;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(520px 420px at 82% 12%, rgba(184, 165, 123, .16), transparent 70%),
    radial-gradient(460px 380px at 12% 88%, rgba(184, 165, 123, .10), transparent 70%),
    linear-gradient(135deg, #071630 0%, var(--brand-navy) 55%, #12325C 100%);
}
.v6-lock-brand { flex-direction: column; gap: 12px; text-align: center; }
.v6-lock-brand .mark {
  width: 96px;
  height: 96px;
  padding: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #16365F, #091C36);
  border: 1.4px solid color-mix(in srgb, var(--brand-gold) 45%, transparent);
  box-shadow: 0 0 34px color-mix(in srgb, var(--brand-gold) 20%, transparent);
}
.v6-lock-brand b { font-size: 20px; font-weight: var(--w-700); }
.v6-lock-brand span:not(.mark) { font-size: var(--fs-label); }
.v6-lock-brand::after {
  content: "";
  width: 64px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
}
.v6-lock-box {
  padding: 28px 24px 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04));
  border: 1px solid color-mix(in srgb, var(--brand-gold) 24%, transparent);
  border-radius: 28px;
  box-shadow: 0 18px 36px rgba(4, 16, 31, .45);
}
.v6-lock .inp {
  height: 48px;
  border-radius: var(--r-lg);
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
}
.v6-lock .inp::placeholder { color: rgba(243, 246, 252, .5); }
.v6-lock .inp:focus-visible { border-radius: var(--r-lg); }
.v6-lock-box .btn-solid {
  min-height: 52px;
  border-radius: 14px;
  background: linear-gradient(180deg, #E8D7AC, #B8A57B 60%, #9C8A61);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-gold) 38%, transparent);
  color: var(--brand-navy);
  font-size: 15px;
}
.v6-lock-box .btn-solid:hover,
.v6-lock-box .btn-solid:disabled,
.v6-lock-box .btn-solid:disabled:hover {
  background: linear-gradient(180deg, #E8D7AC, #B8A57B 60%, #9C8A61);
  color: var(--brand-navy);
}
.v6-lock-box .btn:not(.btn-solid) { background: rgba(255, 255, 255, .06); color: var(--ink); }

/* ---------- the program's start ---------- */
.v6-door {
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.v6-door-i { border-radius: var(--r-lg); }
.v6-door.is-main .v6-door-i {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: var(--sh-accent);
}

}

/* ── 99-responsive.css ─────────────────────────────── */

/* ============================================================
   99 · لا تمرير أفقي — the page fits any window (2026-12-06)

   The program was drawn for a desktop window (≥1100px), and on the web
   (v7) it is opened on tablets and phones too. This file is the one
   place that makes it fit, LAST in the cascade so it wins without
   !important wars:

     1. the document never scrolls sideways (a clip, not a hidden: clip
        keeps position: sticky working on the top bar and the head card);
     2. under 900px the navy rail leaves the grid and becomes a drawer
        that slides in from the right over the page (☰ in the top bar,
        70-shell.js spineDrawer()), and closes on a route, a tap outside
        or Esc;
     3. the top bar, the head card and the screens' bands wrap instead
        of pushing past the edge;
     4. a TABLE still scrolls sideways inside its own box (.tbl-wrap and
        its kin) — a register of 20 columns cannot be read any other way —
        but the page around it does not move.

   tests: test/e2e/resp.js walks every screen from 1366px down to 360px.
   ============================================================ */

/* ---------- 1. the document itself ---------- */
html, body { max-width: 100%; overflow-x: clip; }
.main, .page, .screen { min-width: 0; max-width: 100%; }
img, svg, canvas, video { max-width: 100%; }
/* a chart is drawn to the width of its card, never wider */
.ovx-card, .ovx-card svg, .ov-card, .card { min-width: 0; }

/* ---------- 2. the rail becomes a drawer ---------- */
@media (max-width: 900px) {
  .frame { grid-template-columns: minmax(0, 1fr); }

  .spine {
    position: fixed;
    z-index: 200;
    top: 0;
    inset-inline-start: 0;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform var(--t) var(--ease), visibility 0s linear var(--t);
    box-shadow: 0 0 40px rgba(0, 0, 0, .35);
  }
  [dir="ltr"] .spine { transform: translateX(-105%); }
  .spine-open .spine {
    transform: none;
    visibility: visible;
    transition: transform var(--t) var(--ease), visibility 0s;
  }

  /* (the collapsed, icon-only rail does not exist here: 70-shell.js
     spineFit() keeps html.spine-min off while the window is narrow, and
     puts it back from PREFS.sidebar when the window widens) */

  /* the shade over the page while the drawer is open; a tap on it closes */
  .main::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(8, 12, 24, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t) var(--ease);
  }
  .spine-open .main::before { opacity: 1; pointer-events: auto; }
  .spine-open body { overflow: hidden; }

  /* the floating calculator follows the page, not the absent rail */
  .calc { inset-inline-start: 8px; max-width: calc(100vw - 16px); }
}

/* ---------- 3. the top bar ---------- */
@media (max-width: 900px) {
  .ubar { padding: 0 10px; gap: 4px; }
}
@media (max-width: 600px) {
  :root { --gutter: 10px; }
  .ubar { gap: 2px; }
  .ubar .ubtn { width: 34px; height: 34px; }
  /* what a phone can do without: the bar keeps ☰, back, the month, help,
     the bell and the account */
  .ubar .phead-nav .pnav-fwd,
  .ubar #btnPrefs,
  .ubar #btnSync,
  .ubar .theme { display: none; }
  .ubar-t { display: none; }
  /* the title is gone, so the month chip takes the empty side of the bar */
  .ubar .plate { margin-inline-end: auto; padding-inline: 5px 12px; }
  .ubar .plate-txt { display: flex; }
  .ubar .plate-when { display: none; }
  .v6-user-who bdi { display: none; }
}

/* ---------- 3b. the head card ---------- */
@media (max-width: 900px) {
  .phead { padding-inline: var(--gutter); }
  .phead-t h1 { white-space: normal; overflow-wrap: anywhere; }
  .phead .fld-q { flex: 1 1 200px; min-width: 0; }
  .phead-a { flex-wrap: wrap; min-width: 0; }
  .tb-row { flex-wrap: wrap; }
  .tb-row .fld:has(> select) { min-width: 0; flex: 1 1 140px; }
  .tb-row select.inp { max-width: none; }
  .period { min-width: 0; max-width: 100%; flex-wrap: wrap; height: auto; min-height: var(--ctrl-h-sm); }
  .fld-period { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 600px) {
  /* a phone: the head card does not stick — it would cover half the screen */
  .phead { position: static; padding-block: 8px 4px; }
  .phead-row { padding-inline: 10px; }
  .phead-ico { display: none; }
  .phead-t { flex-basis: 100%; }
  .phead .fld-q { flex-basis: 100%; }
  .phead-a { width: 100%; }
  .phead-a > * { flex: 1 1 auto; }
  .phead-a .btn { width: 100%; justify-content: center; }
}

/* ---------- 4. anything else that is wider than its place ---------- */
@media (max-width: 900px) {
  /* a row of buttons or stat tiles wraps rather than runs off the edge */
  .btn-row, .actions, .bar, .tool-row, .panel-head, .dm-stats, .mon-bar { flex-wrap: wrap; min-width: 0; }
  /* a dialog never wider than the window */
  dialog, .dlg, .modal, .sheet { max-width: calc(100vw - 16px); }
  /* long words (a file name, a department) break instead of pushing */
  .note, .panel p, .meta, h2, h3 { overflow-wrap: anywhere; }

  /* screens that stack their cards on a grid with no columns of their own:
     an implicit column grows to its widest card's min-content, so one long
     line pushed the whole screen past the window. One column, shrinkable. */
  #scCheck, #scMerge, .gs-main, .gs-side, .gs-body, .gs-rates { grid-template-columns: minmax(0, 1fr); }
  /* الإعدادات: a 340px floor per group is wider than a phone's card */
  .gs-groups, .gs-groups-file { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
  .gs-rate-row { grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); }

  /* الأشهر والاستيراد: the bar's buttons take the row's width and wrap */
  .mon-bar-a { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }

  /* السلف · الموظفون المحذوفون: the «from – to» pair wraps under the search */
  .ln-dates, .sfg-dates { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .ln-bar .ln-q { min-width: 0; flex: 1 1 220px; }
  .ln-bar .inp, .sfg-dates .inp { min-width: 0; max-width: 100%; }
}
