/* ─────────────────────────────────────────────────────────────────────
   HOMEi Workforce — visual identity layer ("HOMEi Workday")
   Presentation only. RTL-safe: logical properties exclusively.
   Registered as a Filament asset — republish via `php artisan filament:assets`.
   ──────────────────────────────────────────────────────────────────── */

:root {
    /* Ratified design tokens (design_handoff_hr_simplification, 14-8-2026).
       Cards 14px · buttons/fields 10-12px · chips 999px · border #e6eaf2. */
    --wf-radius: 14px;
    --wf-radius-sm: 10px;
    /* Shared roles read from the token layer (tokens.css, HO-3104) where
       the value is the token's own. The slate-toned inks stay local —
       moving the whole module from slate to neutral grey is a design call,
       not a relink. --wf-faint (slate-400, 3.0:1) was painted as TEXT
       seventeen times; de-emphasis is --ho-ink-muted. */
    --wf-border: var(--ho-line);
    --wf-border-soft: #eef1f7;
    --wf-surface: var(--ho-surface);
    --wf-surface-soft: var(--ho-surface-inset);
    --wf-ink: #1e293b;
    --wf-muted: #64748b;
    --wf-faint: var(--ho-ink-muted);
    --wf-danger: var(--ho-danger-ink);
    --wf-danger-bar: var(--ho-danger-line);
    --wf-danger-soft: #fee2e2;
    --wf-warn: var(--ho-warning-ink);
    --wf-warn-strong: #f59e0b;
    --wf-warn-soft: #fef3c7;
    --wf-ok: #166534;
    --wf-ok-bar: var(--ho-success-line);
    --wf-ok-soft: #dcfce7;
    --wf-info: var(--ho-info-line);
    --wf-info-strong: var(--ho-info-ink);
    --wf-info-soft: var(--ho-info-soft);
    --wf-ai: #7c3aed;
    --wf-ai-soft: #f3e8ff;
}

.dark {
    --wf-border-soft: rgb(255 255 255 / 0.06);
    --wf-ink: rgb(244 244 245);
    --wf-muted: rgb(161 161 170);
    --wf-danger-soft: rgb(127 29 29 / 0.25);
    --wf-warn-strong: rgb(245 158 11);
    --wf-warn-soft: rgb(120 53 15 / 0.25);
    --wf-ok: rgb(74 222 128);
    --wf-ok-soft: rgb(20 83 45 / 0.30);
    --wf-ai: rgb(196 181 253);
    --wf-ai-soft: rgb(76 29 149 / 0.30);
}

/* ── Typography helpers ─────────────────────────────────────────────── */
.wf-eyebrow {
    font-size: var(--ho-text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wf-muted);
}
.wf-num { font-variant-numeric: tabular-nums; }
.wf-muted { color: var(--wf-muted); }
.wf-faint { color: var(--wf-faint); }

/* ── Greeting header (Inbox) ────────────────────────────────────────── */
.wf-greeting { display: flex; flex-direction: column; gap: 2px; margin-block-end: 4px; }
.wf-greeting-title { font-size: 22px; font-weight: 700; color: var(--wf-ink); letter-spacing: -0.01em; }
.wf-greeting-sub { font-size: 13px; color: var(--wf-muted); }

/* ── Section card ───────────────────────────────────────────────────── */
.wf-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 14px 16px;
}
.wf-card + .wf-card { margin-block-start: 12px; }
.wf-card-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-block-end: 10px;
}
.wf-count {
    font-size: var(--ho-text-xs);
    color: var(--wf-muted);
    background: var(--wf-surface-soft);
    border: 1px solid var(--wf-border-soft);
    border-radius: 999px;
    padding: 0 8px;
    font-variant-numeric: tabular-nums;
}

/* ── Work rows (Inbox / queues) ─────────────────────────────────────── */
.wf-rows { display: flex; flex-direction: column; gap: 8px; }
.wf-row {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border-soft);
    border-radius: var(--wf-radius-sm);
    padding: 10px 14px;
    padding-inline-start: 18px;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.wf-row:hover { border-color: var(--wf-border); background: var(--wf-surface-soft); }
.wf-row::before {
    content: "";
    position: absolute;
    inset-block: 8px;
    inset-inline-start: 7px;
    width: 3px;
    border-radius: 2px;
    background: var(--wf-border);
}
.wf-row.is-danger::before { background: var(--wf-danger); }
.wf-row.is-warn::before { background: var(--wf-warn-strong); }
.wf-row.is-ok::before { background: var(--wf-ok); }
.wf-row.is-info::before { background: var(--wf-info); }
.wf-row-main { flex: 1 1 220px; min-width: 0; }
.wf-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--wf-ink);
    text-decoration: none;
    display: inline-block;
    line-height: 1.35;
}
a.wf-row-title:hover { text-decoration: underline; }
.wf-row-meta {
    font-size: 12px;
    color: var(--wf-muted);
    margin-block-start: 1px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    align-items: baseline;
}
.wf-row-note-danger { color: var(--wf-danger); font-weight: 500; }
.wf-row-note-warn { color: var(--wf-warn); font-weight: 500; }
.wf-row-side { display: flex; align-items: center; gap: 8px; }

/* ── Pills / chips ──────────────────────────────────────────────────── */
.wf-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--ho-text-xs);
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
}
.wf-pill-danger { color: var(--wf-danger); background: var(--wf-danger-soft); }
.wf-pill-warn { color: var(--wf-warn); background: var(--wf-warn-soft); }
.wf-pill-ok { color: var(--wf-ok); background: var(--wf-ok-soft); }
.wf-pill-info { color: var(--wf-info); background: var(--wf-info-soft); }
.wf-pill-quiet { color: var(--wf-muted); background: var(--wf-surface-soft); border-color: var(--wf-border-soft); }

/* ── Avatars (deterministic hue set inline via --h) ─────────────────── */
.wf-avatar {
    --h: 215;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: hsl(var(--h) 45% 32%);
    background: hsl(var(--h) 65% 92%);
    border: 1px solid hsl(var(--h) 45% 84%);
}
.dark .wf-avatar {
    color: hsl(var(--h) 70% 80%);
    background: hsl(var(--h) 45% 22% / 0.6);
    border-color: hsl(var(--h) 40% 34%);
}
.wf-avatar-lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }

/* ── Identity cell (Employees list) ─────────────────────────────────── */
.wf-identity { display: flex; align-items: center; gap: 10px; min-width: 0; padding-block: 2px; }
.wf-identity-name { font-size: 14px; font-weight: 600; color: var(--wf-ink); line-height: 1.3; }
.wf-identity-sub { font-size: 12px; color: var(--wf-muted); line-height: 1.3; }

/* ── Profile hero ───────────────────────────────────────────────────── */
.wf-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.wf-hero-id { display: flex; align-items: center; gap: 14px; flex: 1 1 260px; min-width: 0; }
.wf-hero-name { font-size: 20px; font-weight: 700; color: var(--wf-ink); letter-spacing: -0.01em; line-height: 1.2; }
.wf-hero-role { font-size: 13px; color: var(--wf-muted); margin-block-start: 2px; display: flex; flex-wrap: wrap; gap: 2px 8px; }
/* Task brief inside the hero — the full text, its own line breaks kept, and
   long unbroken tokens wrapped instead of widening the card. */
.wf-hero-desc { margin-block-start: 8px; min-width: 0; }
.wf-hero-desc-body {
    margin: 2px 0 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--wf-ink);
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.wf-hero-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px 22px;
    flex: 2 1 420px;
    border-inline-start: 1px solid var(--wf-border-soft);
    padding-inline-start: 18px;
}
@media (max-width: 720px) {
    .wf-hero-facts { border-inline-start: none; padding-inline-start: 0; }
}
.wf-fact-label { font-size: var(--ho-text-xs); color: var(--wf-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.wf-fact-value { font-size: 13.5px; font-weight: 600; color: var(--wf-ink); margin-block-start: 1px; display: flex; align-items: center; gap: 6px; }
.wf-fact-value a { color: inherit; text-decoration: none; }
.wf-fact-value a:hover { text-decoration: underline; }
.wf-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--wf-warn);
    background: var(--wf-warn-soft);
    border: 1px solid color-mix(in srgb, var(--wf-warn-strong) 25%, transparent);
    border-radius: var(--wf-radius-sm);
    padding: 8px 12px;
}

/* ── Skills rows ────────────────────────────────────────────────────── */
.wf-skills { display: flex; flex-direction: column; }
.wf-skill {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-block: 9px;
    border-block-end: 1px solid var(--wf-border-soft);
}
.wf-skill:last-child { border-block-end: none; }
.wf-skill-name { flex: 1 1 160px; font-size: 13.5px; font-weight: 600; color: var(--wf-ink); }
.wf-dots { display: inline-flex; gap: 3px; }
.wf-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--wf-border); }
.wf-dot.on { background: var(--wf-info); }
.wf-skill-meta { font-size: var(--ho-text-xs); color: var(--wf-muted); font-variant-numeric: tabular-nums; }

/* ── Timeline ───────────────────────────────────────────────────────── */
.wf-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.wf-timeline::before {
    content: "";
    position: absolute;
    inset-block: 10px;
    inset-inline-start: 15px;
    width: 2px;
    background: var(--wf-border-soft);
}
.wf-event { position: relative; display: flex; gap: 14px; padding-block: 10px; }
.wf-event-icon {
    position: relative;
    z-index: 1;
    flex: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    color: var(--wf-muted);
}
.wf-event-icon svg { width: 15px; height: 15px; }
.wf-event.is-ok .wf-event-icon { color: var(--wf-ok); background: var(--wf-ok-soft); border-color: transparent; }
.wf-event.is-danger .wf-event-icon { color: var(--wf-danger); background: var(--wf-danger-soft); border-color: transparent; }
.wf-event.is-info .wf-event-icon { color: var(--wf-info); background: var(--wf-info-soft); border-color: transparent; }
.wf-event-body { flex: 1; min-width: 0; padding-block-start: 4px; }
.wf-event-title { font-size: 13.5px; font-weight: 600; color: var(--wf-ink); }
.wf-event-meta { font-size: var(--ho-text-xs); color: var(--wf-faint); font-variant-numeric: tabular-nums; }
.wf-event-note { font-size: 12.5px; color: var(--wf-muted); margin-block-start: 2px; }

/* ── Org tree ───────────────────────────────────────────────────────── */
.wf-tree, .wf-tree ul { list-style: none; margin: 0; padding: 0; }
.wf-tree ul { padding-inline-start: 34px; position: relative; }
.wf-tree ul::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 16px;
    width: 2px;
    background: var(--wf-border-soft);
}
.wf-node { padding-block: 4px; position: relative; }
.wf-tree ul .wf-node::before {
    content: "";
    position: absolute;
    inset-inline-start: -18px;
    inset-block-start: 26px;
    width: 16px;
    height: 2px;
    background: var(--wf-border-soft);
}
.wf-node-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    padding: 7px 14px 7px 8px;
    padding-inline-end: 14px;
    padding-inline-start: 8px;
    text-decoration: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.wf-node-card:hover { border-color: var(--wf-info); box-shadow: 0 1px 6px rgb(0 0 0 / 0.06); }
.wf-node-name { font-size: 13.5px; font-weight: 600; color: var(--wf-ink); line-height: 1.25; }
.wf-node-sub { font-size: var(--ho-text-xs); color: var(--wf-muted); line-height: 1.25; }

/* ── Task board ─────────────────────────────────────────────────────── */
.wf-board { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 12px; min-width: 940px; }
.wf-col-head { display: flex; align-items: center; gap: 7px; margin-block-end: 10px; }
.wf-col-head svg { width: 15px; height: 15px; color: var(--wf-muted); }
.wf-tcard {
    position: relative;
    display: block;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border-soft);
    border-radius: 10px;
    padding: 10px 12px;
    padding-inline-start: 16px;
    margin-block-end: 8px;
    text-decoration: none;
    transition: border-color 0.12s ease, transform 0.12s ease;
}
.wf-tcard:hover { border-color: var(--wf-info); transform: translateY(-1px); }
.wf-tcard::before {
    content: "";
    position: absolute;
    inset-block: 9px;
    inset-inline-start: 6px;
    width: 3px;
    border-radius: 2px;
    background: var(--wf-border);
}
.wf-tcard.is-danger::before { background: var(--wf-danger); }
.wf-tcard.is-warn::before { background: var(--wf-warn-strong); }
.wf-tcard.is-ok::before { background: var(--wf-ok); }
.wf-tcard.is-info::before { background: var(--wf-info); }
.wf-tcard-code { font-size: var(--ho-text-xs); color: var(--wf-faint); font-variant-numeric: tabular-nums; }
.wf-tcard-title { font-size: 13px; font-weight: 600; color: var(--wf-ink); line-height: 1.35; margin-block: 1px 3px; }
.wf-tcard-meta { font-size: var(--ho-text-xs); color: var(--wf-muted); }
.wf-col-empty {
    border: 1px dashed var(--wf-border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--wf-faint);
}

/* ── Empty / celebration states ─────────────────────────────────────── */
.wf-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 34px; text-align: center; }
.wf-empty svg { width: 36px; height: 36px; color: var(--wf-ok); }
.wf-empty-title { font-size: 15px; font-weight: 700; color: var(--wf-ink); }
.wf-empty-sub { font-size: 12.5px; color: var(--wf-muted); }

/* ── Reserved placeholders footer ───────────────────────────────────── */
.wf-reserved {
    border: 1px dashed var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wf-reserved p { font-size: var(--ho-text-xs); color: var(--wf-faint); margin: 0; }

/* ── Request wizard type grid (Filament v4 radio markup) ───────────── */
.wf-typegrid .fi-fo-radio {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.wf-typegrid .fi-fo-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    padding: 11px 13px;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.wf-typegrid .fi-fo-radio-label:hover { border-color: var(--wf-info); }
.wf-typegrid .fi-fo-radio-label:has(input:checked) {
    border-color: var(--wf-info);
    background: var(--wf-info-soft);
}
.wf-confirm { display: flex; flex-direction: column; gap: 8px; }
.wf-confirm-line { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.wf-confirm-line .wf-fact-label { min-width: 120px; }

/* ── Table row status stripes (Filament tables) ─────────────────────── */
.fi-ta-row.wf-stripe-danger { box-shadow: inset 3px 0 0 0 var(--wf-danger); }
.fi-ta-row.wf-stripe-warn { box-shadow: inset 3px 0 0 0 var(--wf-warn-strong); }
[dir="rtl"] .fi-ta-row.wf-stripe-danger { box-shadow: inset -3px 0 0 0 var(--wf-danger); }
[dir="rtl"] .fi-ta-row.wf-stripe-warn { box-shadow: inset -3px 0 0 0 var(--wf-warn-strong); }

/* ── Configuration cards ────────────────────────────────────────────── */
.wf-config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.wf-config-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 14px 16px;
    text-decoration: none;
    transition: border-color 0.12s ease;
}
.wf-config-card:hover { border-color: var(--wf-info); }
.wf-config-card svg { width: 20px; height: 20px; color: var(--wf-muted); flex: none; }
.wf-config-title { font-size: 13.5px; font-weight: 600; color: var(--wf-ink); }
.wf-config-sub { font-size: 12px; color: var(--wf-muted); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .wf-row { padding-inline-end: 10px; }
    .wf-row-side { width: 100%; justify-content: flex-end; }
    .wf-hero-facts { grid-template-columns: repeat(2, 1fr); }
}

/* ── Approval stepper (Request details) ─────────────────────────────── */
.wf-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 26px; width: 100%; }
.wf-step { position: relative; display: flex; gap: 9px; align-items: flex-start; min-width: 150px; flex: 1 1 150px; }
.wf-step:not(:last-child)::after {
    content: ""; position: absolute; inset-inline-end: -20px; inset-block-start: 12px;
    width: 14px; height: 2px; background: var(--wf-border);
}
.wf-step-dot {
    flex: none; width: 26px; height: 26px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--wf-surface-soft); color: var(--wf-muted); border: 1px solid var(--wf-border);
}
.wf-step.is-done .wf-step-dot { background: var(--wf-ok-soft); color: var(--wf-ok); border-color: transparent; }
.wf-step.is-rejected .wf-step-dot { background: var(--wf-danger-soft); color: var(--wf-danger); border-color: transparent; }
.wf-step.is-current .wf-step-dot { background: var(--wf-info); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px var(--wf-info-soft); }
.wf-step-body { display: flex; flex-direction: column; min-width: 0; }
.wf-step-label { font-size: 12.5px; font-weight: 600; color: var(--wf-muted); }
.wf-step.is-current .wf-step-label { color: var(--wf-ink); font-size: 13px; }
.wf-step-meta { font-size: var(--ho-text-xs); color: var(--wf-faint); }

/* ── HR strip (Inbox balances) ──────────────────────────────────────── */
.wf-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.wf-strip-chip {
    display: flex; align-items: center; gap: 9px;
    border: 1px solid var(--wf-border); border-radius: 10px;
    padding: 9px 14px; text-decoration: none; background: var(--wf-surface);
    transition: border-color 0.12s ease;
}
a.wf-strip-chip:hover { border-color: var(--wf-info); }
.wf-strip-chip svg { width: 17px; height: 17px; color: var(--wf-muted); flex: none; }
.wf-strip-label { font-size: var(--ho-text-xs); color: var(--wf-faint); display: block; }
.wf-strip-value { font-size: 13px; font-weight: 700; color: var(--wf-ink); font-variant-numeric: tabular-nums; }

/* ═══ Dashboard consolidation (docs/59) — hero + KPI cards, Commission-family
   visual language. Logical properties throughout for intentional RTL. ═══ */

.wf-hero-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(118deg, #4f46e5 0%, #4338ca 40%, #3730a3 80%, #1e1b4b 100%);
    color: #fff;
    border-radius: 16px;
    padding: 26px 30px;
    min-height: 110px;
    text-decoration: none;
    box-shadow: 0 12px 34px rgb(67 56 202 / 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.wf-hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(700px 340px at 85% -20%, rgb(255 255 255 / 0.2), transparent 60%);
    pointer-events: none;
}
a.wf-hero-card:hover { transform: translateY(-2px); filter: brightness(1.06); }
.wf-hero-card.is-clear {
    background: linear-gradient(118deg, #059669 0%, #047857 55%, #064e3b 100%);
    box-shadow: 0 12px 30px rgb(5 150 105 / 0.25);
}
.wf-hero-ic {
    width: 54px; height: 54px; border-radius: 14px;
    background: rgb(255 255 255 / 0.17);
    display: grid; place-items: center; flex: none;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
}
.wf-hero-ic svg { width: 28px; height: 28px; color: #fff; }
.wf-hero-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wf-hero-k { font-size: var(--ho-text-xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.wf-hero-v { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.wf-hero-sub { font-size: 12.5px; opacity: 0.85; }
.wf-hero-big {
    margin-inline-start: auto;
    font-size: 58px; font-weight: 900; line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 3px 14px rgb(0 0 0 / 0.22);
}
.wf-hero-go {
    background: rgb(255 255 255 / 0.2);
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 11px; padding: 11px 18px;
    font-weight: 800; font-size: 14px; white-space: nowrap;
    transition: background 0.15s ease;
}
a.wf-hero-card:hover .wf-hero-go { background: rgb(255 255 255 / 0.3); }
.wf-hero-arrow { display: inline-block; }
[dir="rtl"] .wf-hero-arrow { transform: scaleX(-1); }

.wf-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 768px) { .wf-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .wf-kpis { grid-template-columns: repeat(4, 1fr); } }

.wf-kpi {
    position: relative;
    display: flex; flex-direction: column; gap: 3px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: 13px;
    padding: 14px 16px;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.wf-kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(15 23 42 / 0.08); border-color: var(--wf-info); }
a.wf-kpi:focus-visible { outline: 2px solid var(--wf-info); outline-offset: 2px; }
a.wf-kpi::after {
    content: "↗";
    position: absolute;
    bottom: 12px; inset-inline-end: 14px;
    font-size: 13px; font-weight: 700; color: var(--wf-info);
    opacity: 0;
    transform: translate(-3px, 3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
[dir="rtl"] a.wf-kpi::after { content: "↖"; }
a.wf-kpi:hover::after { opacity: 1; transform: translate(0, 0); }
.wf-kpi-ic {
    position: absolute; top: 13px; inset-inline-end: 13px;
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
}
.wf-kpi-ic svg { width: 19px; height: 19px; }
.wf-kpi-vl { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--wf-ink); font-variant-numeric: tabular-nums; padding-inline-end: 44px; }
.wf-kpi-lb { font-size: 12.5px; font-weight: 700; color: var(--wf-ink); }
.wf-kpi-dt { font-size: var(--ho-text-xs); color: var(--wf-faint); }

.wf-tone-red .wf-kpi-ic  { background: var(--wf-danger-soft); color: var(--wf-danger); }
.wf-tone-orn .wf-kpi-ic  { background: var(--wf-warn-soft); color: var(--wf-warn); }
.wf-tone-grn .wf-kpi-ic  { background: var(--wf-ok-soft); color: var(--wf-ok); }
.wf-tone-blu .wf-kpi-ic  { background: var(--wf-info-soft); color: var(--wf-info); }
.wf-tone-dgn .wf-kpi-ic  { background: rgb(237 233 254); color: rgb(124 58 237); }
.wf-tone-gray .wf-kpi-ic { background: rgb(241 245 249); color: var(--wf-muted); }
.dark .wf-tone-dgn .wf-kpi-ic { background: rgb(76 29 149 / 0.35); color: rgb(196 181 253); }
.dark .wf-tone-gray .wf-kpi-ic { background: rgb(51 65 85 / 0.5); }

.wf-kpis-profile { margin-block-end: 4px; }
.wf-kpis-profile .wf-kpi-vl { font-size: 24px; }

/* Anchored sections get breathing room when jumped to. */
#wf-compliance, #wf-lifecycle { scroll-margin-top: 90px; }

/* Motion discipline: respect the user, always. */
@media (prefers-reduced-motion: reduce) {
    .wf-hero-card, .wf-kpi, .wf-hero-go, a.wf-kpi::after { transition: none; }
    a.wf-hero-card:hover, a.wf-kpi:hover { transform: none; }
}

/* ═══ Final consistency pass: period chip, live tags, SLA aggregate. ═══ */
.wf-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wf-month-chip {
    position: relative;
    display: flex; align-items: center; gap: 9px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: 11px;
    padding: 7px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wf-month-chip:hover { border-color: var(--wf-info); }
.wf-month-chip:focus-within { outline: 2px solid var(--wf-info); outline-offset: 1px; }
.wf-month-chip > svg { width: 17px; height: 17px; color: var(--wf-muted); flex: none; }
.wf-month-select {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.wf-kpi-legend {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--ho-text-xs); color: var(--wf-faint);
    margin-block-end: -4px;
}
.wf-live-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--ho-text-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--wf-ok); background: var(--wf-ok-soft);
    border-radius: 5px; padding: 1px 6px;
    vertical-align: middle;
}
/* The live dot is a dot, not a 7px glyph: drawn, so the type floor stays whole. */
.wf-live-tag::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
#wf-sla { scroll-margin-top: 90px; }

/* Quiet KPI group captions (pre-pilot quick win). */
.wf-kpi-group {
    grid-column: 1 / -1;
    font-size: var(--ho-text-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--wf-faint);
    margin-block-start: 2px;
}

/* ═══ Final acceptance pass (docs/62): request details, density, nav. ═══ */
.wf-facts-wide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px 22px;
    width: 100%;
    background: var(--wf-surface-soft);
    border: 1px solid var(--wf-border-soft);
    border-radius: 12px;
    padding: 14px 16px;
}
.wf-facts-wide .wf-fact-value { font-size: 14.5px; font-weight: 700; }
.wf-steps-wide { width: 100%; }
.wf-step-actions { display: inline-flex; gap: 8px; margin-block-start: 8px; flex-wrap: wrap; }
.wf-citation {
    display: flex; align-items: center; gap: 7px;
    width: 100%;
    font-size: 12px; color: var(--wf-muted);
    border-top: 1px dashed var(--wf-border);
    padding-block-start: 10px;
}

.wf-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-preview-warn {
    width: 100%;
    margin-block-start: 6px;
    font-size: 12px; font-weight: 600;
    color: var(--wf-warn);
    background: var(--wf-warn-soft);
    border-radius: 8px; padding: 7px 10px;
}
/* Dashboard density (docs/62 §4): quiet "more metrics" expander. */
.wf-kpi-more { grid-column: 1 / -1; }
.wf-kpi-more summary {
    cursor: pointer; list-style: none;
    font-size: 12px; font-weight: 700; color: var(--wf-muted);
    padding: 6px 2px;
}
.wf-kpi-more summary:hover { color: var(--wf-info); }
.wf-kpi-more .wf-kpis { margin-block-start: 10px; }
.wf-view-all { font-size: 12px; font-weight: 700; color: var(--wf-info); text-decoration: none; }
/* Board polish (docs/62 §8): readable columns, calm scroll, RTL logical. */
.wf-board { grid-auto-columns: minmax(240px, 1fr); gap: 14px; }
.wf-tcard { border-radius: 11px; }
.wf-tcard-title { font-size: 13.5px; line-height: 1.35; }
@media (max-width: 640px) {
    .wf-board { grid-auto-flow: row; grid-auto-columns: unset; grid-template-columns: 1fr; }
}

/* ═══ Compact dashboard (docs/63 §6): tight header, hero, 2-col, minis. ═══ */
.wf-topline-tight { margin-block-end: -2px; }
.wf-hero-compact { padding: 18px 24px; min-height: 84px; }
.wf-hero-compact .wf-hero-big { font-size: 44px; }
.wf-hero-compact .wf-hero-v { font-size: 17px; }
.wf-hero-compact .wf-hero-ic { width: 44px; height: 44px; border-radius: 12px; }
.wf-hero-compact .wf-hero-ic svg { width: 22px; height: 22px; }
.wf-two-col { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 1024px) { .wf-two-col { grid-template-columns: 5fr 3fr; } }
.wf-side-col { display: flex; flex-direction: column; gap: 12px; }
.wf-side-col .wf-card { margin: 0; }
.wf-card-quiet { background: var(--wf-surface-soft); }
.wf-rows-tight .wf-row { padding-block: 7px; }
.wf-footnote { font-size: var(--ho-text-xs); color: var(--wf-faint); margin: 8px 0 0; }
.wf-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wf-mini {
    position: relative;
    display: flex; flex-direction: column; gap: 2px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    padding: 11px 13px;
    text-decoration: none;
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
a.wf-mini:hover { transform: translateY(-1px); border-color: var(--wf-info); box-shadow: 0 5px 14px rgb(15 23 42 / 0.06); }
a.wf-mini:focus-visible { outline: 2px solid var(--wf-info); outline-offset: 2px; }
.wf-mini .wf-kpi-ic { width: 28px; height: 28px; border-radius: 8px; top: 11px; }
.wf-mini .wf-kpi-ic svg { width: 15px; height: 15px; }
.wf-mini-vl { font-size: 17px; font-weight: 800; color: var(--wf-ink); padding-inline-end: 34px; }
.wf-mini-lb { font-size: var(--ho-text-xs); font-weight: 600; color: var(--wf-muted); }
@media (prefers-reduced-motion: reduce) { .wf-mini { transition: none; } a.wf-mini:hover { transform: none; } }

/* ═══ Final UI alignment (docs/64): eyebrow icons + tasteful card energy. ═══ */
.wf-eyebrow-ic { width: 14px; height: 14px; margin-inline-end: 5px; vertical-align: -2px; display: inline-block; color: var(--wf-muted); }
/* Priority cards: a soft tone wash — colorful but calm, platform-style. */
.wf-tone-red.wf-kpi  { background: var(--wf-danger-soft); border-color: transparent; }
.wf-tone-orn.wf-kpi  { background: var(--wf-warn-soft); border-color: transparent; }
.wf-tone-grn.wf-kpi  { background: var(--wf-ok-soft); border-color: transparent; }
.wf-tone-blu.wf-kpi  { background: var(--wf-info-soft); border-color: transparent; }
.wf-tone-dgn.wf-kpi  { background: rgb(237 233 254 / 0.6); border-color: transparent; }
.dark .wf-tone-dgn.wf-kpi { background: rgb(76 29 149 / 0.2); }
.wf-kpi .wf-kpi-ic { background: var(--wf-surface); box-shadow: 0 1px 3px rgb(15 23 42 / 0.08); }
a.wf-kpi:hover { border-color: transparent; box-shadow: 0 8px 22px rgb(15 23 42 / 0.12); }
/* Minis stay quiet white — hierarchy: hero > priority > lists > minis. */
/* docs/64 correction: in-pill / stepper-dot heroicons (no emoji glyphs). */
.wf-pill-ic { width: 12px; height: 12px; margin-inline-end: 4px; display: inline-block; vertical-align: -2px; }
.wf-dot-ic { width: 13px; height: 13px; display: inline-block; }

/* ═══ Smart Manager Summary (docs/65 §1): compact, beside the hero. ═══ */
.wf-top2 { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
@media (min-width: 1024px) { .wf-top2 { grid-template-columns: 2fr 1fr; } }
.wf-top2-hero { min-width: 0; display: flex; flex-direction: column; }
.wf-top2-hero .wf-hero-card { flex: 1; }
.wf-summary-card {
    display: flex; flex-direction: column; gap: 8px;
    background: linear-gradient(150deg, rgb(237 233 254 / 0.75), var(--wf-surface) 70%);
    border: 1px solid var(--wf-border);
    border-radius: 16px;
    padding: 14px 16px;
    min-width: 0;
}
.dark .wf-summary-card { background: linear-gradient(150deg, rgb(76 29 149 / 0.25), var(--wf-surface) 70%); }
.wf-summary-card.is-loading { opacity: 0.55; }
.wf-summary-head { display: flex; align-items: center; justify-content: space-between; }
.wf-summary-refresh {
    display: grid; place-items: center;
    width: 26px; height: 26px; border-radius: 8px;
    color: var(--wf-muted); background: transparent; border: none; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.wf-summary-refresh:hover { background: var(--wf-surface-soft); color: var(--wf-info); }
.wf-summary-refresh svg { width: 15px; height: 15px; }
.wf-summary-headline { font-size: 14px; font-weight: 800; color: var(--wf-ink); line-height: 1.45; }
.wf-summary-headline.is-clear { color: var(--wf-ok); }
.wf-summary-points { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 3px; }
.wf-summary-points li { font-size: 12.5px; color: var(--wf-muted); }
.wf-summary-cta {
    align-self: flex-start;
    font-size: 12.5px; font-weight: 800; color: rgb(124 58 237);
    text-decoration: none;
}
.wf-summary-cta:hover { text-decoration: underline; }
.wf-summary-meta { margin-block-start: auto; font-size: var(--ho-text-xs); color: var(--wf-faint); }
@media (prefers-reduced-motion: reduce) { .wf-summary-refresh { transition: none; } }

/* ═══ docs/65: setup CTAs, import cards, dashboard shortcut. ═══ */
.wf-setup-ctas { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) { .wf-setup-ctas { grid-template-columns: 1fr 1fr; } }
.wf-setup-cta {
    display: flex; align-items: center; gap: 12px; text-align: start;
    background: var(--wf-surface); border: 1px solid var(--wf-border);
    border-radius: 14px; padding: 16px 18px; cursor: pointer;
    text-decoration: none; color: var(--wf-ink);
    transition: transform 0.12s ease, box-shadow 0.18s ease;
}
.wf-setup-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(15 23 42 / 0.1); }
.wf-setup-cta.is-primary { background: var(--wf-info-soft); border-color: transparent; }
.wf-setup-cta-title { display: block; font-size: 15px; font-weight: 800; }
.wf-import-card span { display: block; }
.wf-import-actions { display: flex; gap: 6px; margin-block-start: 8px; }
.wf-import-btn {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--ho-text-xs); font-weight: 700; color: var(--wf-muted);
    background: var(--wf-surface-soft); border: 1px solid var(--wf-border);
    border-radius: 7px; padding: 4px 8px; cursor: pointer;
}
.wf-import-btn:hover { color: var(--wf-info); border-color: var(--wf-info); }
.wf-import-btn.is-primary { color: var(--wf-info); background: var(--wf-info-soft); border-color: transparent; }
.wf-import-btn svg { width: 12px; height: 12px; }
.wf-mini-wide { grid-column: span 2; }
@media (prefers-reduced-motion: reduce) { .wf-setup-cta { transition: none; } .wf-setup-cta:hover { transform: none; } }
.wf-sprint-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-block-end: 4px; }

/* ── Local full-review mode (docs/67) — banner + view chips ─────────── */
.wf-review-banner {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
    color: var(--wf-info); background: var(--wf-info-soft);
    border: 1px dashed color-mix(in srgb, var(--wf-info) 45%, transparent);
    margin-block-end: 8px;
}
.wf-review-banner svg { width: 15px; height: 15px; flex: none; }
.wf-review-views { display: flex; gap: 6px; flex-wrap: wrap; margin-block-end: 10px; }
.wf-review-chip {
    font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--wf-border); background: transparent; cursor: pointer;
    color: var(--wf-muted); transition: color .12s ease, border-color .12s ease;
}
.wf-review-chip:hover { color: var(--wf-info); border-color: var(--wf-info); }
.wf-review-chip.is-active { color: var(--wf-info); background: var(--wf-info-soft); border-color: transparent; }

/* Review Guide */
.wf-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.wf-guide-card { border: 1px solid var(--wf-border); border-radius: 12px; padding: 14px 16px; }
.wf-guide-card h3 { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.wf-guide-card h3 svg { width: 15px; height: 15px; color: var(--wf-info); }
.wf-guide-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wf-guide-card a { font-size: 12.5px; color: inherit; text-decoration: none; display: flex; gap: 6px; align-items: baseline; }
.wf-guide-card a:hover { color: var(--wf-info); }
.wf-guide-card a::before { content: '→'; color: var(--wf-info); flex: none; }
[dir='rtl'] .wf-guide-card a::before { content: '←'; }
.wf-guide-note { font-size: 12px; color: var(--wf-muted); margin-block-start: 6px; }

/* ============================================================
   HR UX Slice 1 — Employees cards view, Deleted screen, mobile
   ============================================================ */

/* Employee card (cards view + mobile). Fills a Filament content-grid cell. */
.wf-emp-card {
    display: flex; flex-direction: column; gap: 10px; height: 100%;
    padding: 2px 2px 0;
}
.wf-emp-card-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wf-emp-card-name { font-size: 14.5px; font-weight: 700; color: var(--wf-ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-emp-card-sub { font-size: 12.5px; color: var(--wf-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-emp-card-code { font-size: var(--ho-text-xs); color: var(--wf-faint); font-variant-numeric: tabular-nums; }
.wf-emp-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wf-emp-card-facts { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--wf-muted); }
.wf-emp-card-facts b { color: var(--wf-ink); font-weight: 600; }

/* Deleted-employees governance strip */
.wf-deleted-strip {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--wf-muted);
    border: 1px dashed var(--wf-border); border-radius: var(--wf-radius-sm);
    padding: 8px 12px; margin-block-end: 4px;
}
.wf-deleted-strip svg { width: 15px; height: 15px; flex: none; color: var(--wf-warn-strong); }

/* Shared empty state */
.wf-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center; }
.wf-empty svg { width: 26px; height: 26px; color: var(--wf-faint); }
.wf-empty-title { font-size: 14px; font-weight: 700; color: var(--wf-ink); }
.wf-empty-body { font-size: 12.5px; color: var(--wf-muted); max-width: 46ch; }

/* Mobile: Employee 360 header stacks; tab bars scroll instead of wrapping off-screen */
@media (max-width: 767px) {
    /* nowrap: in a WRAPPING column every item is stretched to the widest
       item's width, so one wide child (the expense sheet's table) drags
       the whole header past the screen edge and gets clipped. */
    .wf-hero { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; }
    .wf-hero > * { min-width: 0; }
    /* The desktop flex-basis (260px/420px) becomes HEIGHT in a column — reset
       it. !important because three heroes (request/review/task) set their
       basis inline, which otherwise wins and leaves a 300px blank block. */
    .wf-hero-id, .wf-hero-facts { flex: 0 0 auto !important; }
    .wf-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-content: start; }
    .fi-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
    .fi-tabs::-webkit-scrollbar { display: none; }
    .fi-tabs .fi-tabs-item { white-space: nowrap; flex: none; }
}

/* Mobile: page header actions wrap instead of clipping off-canvas */
@media (max-width: 767px) {
    .fi-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .fi-header-actions, .fi-ac { flex-wrap: wrap; row-gap: 8px; }
}

/* Wave 1 — dashboard pulse row (people / attendance today / payroll) */
.wf-pulse { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.wf-pulse-card {
    display: flex; flex-direction: column; gap: 8px; min-width: 0;
    border: 1px solid var(--wf-border); border-radius: var(--wf-radius);
    background: var(--wf-surface); padding: 12px 14px;
    color: inherit; text-decoration: none;
    transition: border-color .12s ease;
}
.wf-pulse-card:hover { border-color: var(--wf-info); }
.wf-pulse-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wf-pulse-kpi { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12.5px; color: var(--wf-muted); }
.wf-pulse-kpi b { font-size: 17px; font-weight: 700; color: var(--wf-ink); }
.wf-pulse-kpi.is-quiet b { color: var(--wf-muted); }

/* ─────────────────────────────────────────────────────────────────────
   HR master redesign — consolidation hubs (Reports / My Space / Settings)
   Logical properties only; the grid collapses to one column on mobile.
   ──────────────────────────────────────────────────────────────────── */
.hr-hub-section + .hr-hub-section { margin-block-start: 22px; }
.hr-hub-section__title {
    font-size: 13px; font-weight: 700; color: var(--wf-muted);
    margin-block-end: 10px; letter-spacing: .01em;
}
.hr-hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.hr-hub-card {
    display: flex; align-items: flex-start; gap: 12px; min-width: 0;
    border: 1px solid var(--wf-border); border-radius: 14px;
    background: var(--wf-surface); padding: 16px 18px;
    color: inherit; text-decoration: none;
    transition: border-color .12s ease;
}
.hr-hub-card:hover { border-color: var(--wf-info); }
.hr-hub-card__icon {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    inline-size: 38px; block-size: 38px; border-radius: 10px;
    background: var(--wf-info-soft); color: var(--wf-info);
}
.hr-hub-card__icon-svg { inline-size: 20px; block-size: 20px; }
.hr-hub-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.hr-hub-card__title { font-size: 14px; font-weight: 700; color: var(--wf-ink); }
.hr-hub-card__desc { font-size: 12.5px; line-height: 1.5; color: var(--wf-muted); }
.hr-hub-card__cta {
    flex: 0 0 auto; align-self: center; white-space: nowrap;
    font-size: 12.5px; font-weight: 600; color: var(--wf-info);
}

@media (max-width: 767px) {
    .hr-hub-grid { grid-template-columns: 1fr; }
    /* 44px minimum touch target on the whole card. */
    .hr-hub-card { padding: 14px 16px; min-block-size: 44px; }
    .hr-hub-card__cta { align-self: flex-start; }
}

/* ─────────────────────────────────────────────────────────────────────
   HR master redesign — Action Center ("يحتاج تدخل الآن")
   Severity is carried by a coloured dot + the inline-start rail, never by
   colour alone on the text (contrast + colour-blind safety).
   ──────────────────────────────────────────────────────────────────── */
.hr-ac {
    border: 1px solid var(--wf-border); border-radius: 14px;
    background: var(--wf-surface); padding: 14px 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.hr-ac__head { display: flex; flex-direction: column; gap: 2px; }
.hr-ac__sub { font-size: 12px; color: var(--wf-faint); }
.hr-ac__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hr-ac__item {
    display: flex; align-items: flex-start; gap: 10px; min-width: 0;
    border: 1px solid var(--wf-border-soft); border-radius: 12px;
    border-inline-start-width: 3px; padding: 10px 12px;
    background: var(--wf-surface-soft);
}
.hr-ac__item--blocker { border-inline-start-color: var(--wf-danger); }
.hr-ac__item--warning { border-inline-start-color: var(--wf-warn-strong); }
.hr-ac__item--info    { border-inline-start-color: var(--wf-info); }
.hr-ac__dot { flex: 0 0 auto; inline-size: 8px; block-size: 8px; border-radius: 999px; margin-block-start: 6px; }
.hr-ac__item--blocker .hr-ac__dot { background: var(--wf-danger); }
.hr-ac__item--warning .hr-ac__dot { background: var(--wf-warn-strong); }
.hr-ac__item--info    .hr-ac__dot { background: var(--wf-info); }
.hr-ac__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.hr-ac__title { font-size: 13.5px; font-weight: 600; color: var(--wf-ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.hr-ac__count { font-size: 12px; font-weight: 500; color: var(--wf-muted); }
.hr-ac__desc { font-size: 12.5px; line-height: 1.5; color: var(--wf-muted); }
.hr-ac__cta {
    flex: 0 0 auto; align-self: center; white-space: nowrap;
    font-size: 12.5px; font-weight: 600; color: var(--wf-info); text-decoration: none;
}
.hr-ac__cta:hover { text-decoration: underline; }
.hr-ac--clear .hr-ac__clear-title { font-size: 13.5px; font-weight: 600; color: var(--wf-ok); }

@media (max-width: 767px) {
    .hr-ac__item { flex-wrap: wrap; }
    /* The CTA becomes a full-width 44px row rather than a cramped inline link. */
    .hr-ac__cta {
        inline-size: 100%; align-self: stretch; min-block-size: 44px;
        display: flex; align-items: center; justify-content: center;
        border: 1px solid var(--wf-border); border-radius: 10px; background: var(--wf-surface);
    }
}

/* Attendance — today's shape above the log. */
.wf-att-today { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 4px; }
.wf-att-today__pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ═════════════════════════════════════════════════════════════════════
   UNIFIED DASHBOARD (14-8-2026 visual redesign) — the one HR + Payroll
   dashboard's own components. Cards carry a border and no shadow, per the
   ratified handoff; everything RTL-safe via logical properties.
   ════════════════════════════════════════════════════════════════════ */

/* ② four summary cards */
.hr-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}
.hr-kpi {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 16px 18px;
    text-decoration: none;
    transition: border-color .15s ease;
}
.hr-kpi:hover { border-color: #bfd3f8; }
.hr-kpi-value { font-size: 26px; font-weight: 700; color: var(--wf-ink); line-height: 1.1; }
.hr-kpi-value small { font-size: 13px; font-weight: 600; color: var(--wf-muted); }
.hr-kpi-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.hr-kpi-link { font-size: 12.5px; font-weight: 600; color: var(--wf-info); margin-block-start: auto; }
.hr-kpi-link:hover { color: var(--wf-info-strong); }

/* HR setup hotfix — the readiness CTA is a real control, so it must READ as
   one: a button, focusable, with a pointer and a visible focus ring. It used
   to be an inert <span> that merely looked clickable. */
.hr-kpi-cta {
    cursor: pointer;
    border: 0;
    font: inherit;
    font-size: var(--ho-text-xs);
    font-weight: 600;
    line-height: inherit;
    transition: filter 120ms ease;
}
.hr-kpi-cta:hover { filter: brightness(0.94); }
.hr-kpi-cta:focus-visible { outline: 2px solid var(--wf-danger); outline-offset: 2px; }
.hr-kpi-cta[disabled] { opacity: 0.6; cursor: progress; }

/* Employees missing a compensation profile — the roster behind the count.
   Scrolls inside itself so a long list never stretches the modal, and
   collapses to stacked rows on a phone. */
.hr-missing { display: flex; flex-direction: column; gap: 10px; }
.hr-missing-intro { font-size: 12.5px; color: var(--wf-muted); }
.hr-missing-scroll { max-height: 340px; overflow: auto; overflow-x: auto; }
.hr-missing-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hr-missing-table th,
.hr-missing-table td {
    padding: 7px 10px;
    text-align: start;
    border-block-end: 1px solid var(--wf-border-soft);
    vertical-align: top;
}
.hr-missing-table th {
    font-size: var(--ho-text-xs);
    font-weight: 600;
    color: var(--wf-muted);
    white-space: nowrap;
    position: sticky;
    inset-block-start: 0;
    background: var(--wf-surface);
    z-index: 1;
}
.hr-missing-name { font-weight: 600; }
.hr-missing-code { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hr-missing-empty { padding: 14px; text-align: center; color: var(--wf-muted); font-size: 12.5px; }

@media (max-width: 640px) {
    .hr-missing-table,
    .hr-missing-table tbody,
    .hr-missing-table tr,
    .hr-missing-table td { display: block; width: 100%; }
    .hr-missing-table thead { display: none; }
    .hr-missing-table tr {
        border-block-end: 1px solid var(--wf-border-soft);
        padding-block: 8px;
    }
    .hr-missing-table td { border: 0; padding: 2px 0; }
    .hr-missing-table td[data-label]::before {
        content: attr(data-label) ": ";
        font-size: var(--ho-text-xs);
        font-weight: 600;
        color: var(--wf-muted);
    }
}

/* ④ payroll operations — run card + readiness card */
.hr-payops {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}
.hr-run-card, .hr-ready-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 12px;
}
.hr-run-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hr-run-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.hr-run-fact { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.hr-run-k { font-size: var(--ho-text-xs); font-weight: 600; color: var(--wf-muted); }
.hr-run-v { font-size: 16px; font-weight: 700; color: var(--wf-ink); overflow-wrap: anywhere; }
.hr-run-blockers {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--wf-danger);
    background: var(--wf-danger-soft);
    border-radius: var(--wf-radius-sm);
    padding: 6px 10px;
}
.hr-run-blockers .hr-ac__dot { background: var(--wf-danger-bar); }
.hr-btn-outline {
    align-self: flex-start;
    font-size: 13px; font-weight: 600; color: var(--wf-info);
    border: 1px solid var(--wf-info);
    border-radius: var(--wf-radius-sm);
    padding: 7px 14px;
    text-decoration: none;
    transition: background-color .15s ease;
}
.hr-btn-outline:hover { background: var(--wf-info-soft); }
.hr-ready-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.hr-ready-row {
    display: flex; align-items: center; gap: 10px;
    padding-block: 9px;
    border-block-end: 1px solid var(--wf-border-soft);
}
.hr-ready-row:last-child { border-block-end: 0; }
.hr-ready-label { font-size: 13px; font-weight: 600; color: var(--wf-ink); }
.hr-ready-count {
    margin-inline-start: auto;
    font-size: 14px; font-weight: 700; color: var(--wf-muted);
    background: var(--wf-surface-soft);
    border-radius: 999px; padding: 1px 10px;
}
.hr-ready-row.is-hot .hr-ready-count { color: var(--wf-danger); background: var(--wf-danger-soft); }
.hr-ready-link { font-size: 12px; font-weight: 600; color: var(--wf-info); text-decoration: none; white-space: nowrap; }
.hr-ready-link:hover { color: var(--wf-info-strong); }

/* ⑥ department performance + smart summary */
.hr-insight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    align-items: start;
}
.hr-dept-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 10px;
}
.hr-dept-rows { display: flex; flex-direction: column; }
.hr-dept-row {
    display: grid;
    grid-template-columns: minmax(72px, 0.6fr) 1fr 44px auto;
    align-items: center; gap: 10px;
    padding-block: 9px;
    border-block-end: 1px solid var(--wf-border-soft);
    text-decoration: none;
}
.hr-dept-row:last-child { border-block-end: 0; }
.hr-dept-row:hover .hr-dept-name { color: var(--wf-info); }
.hr-dept-name { font-size: 13px; font-weight: 600; color: var(--wf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-dept-bar { block-size: 7px; border-radius: 999px; background: var(--wf-border-soft); overflow: hidden; }
.hr-dept-fill { display: block; block-size: 100%; border-radius: 999px; }
.hr-dept-fill.is-ok { background: var(--wf-ok-bar); }
.hr-dept-fill.is-warn { background: var(--wf-warn-strong); }
.hr-dept-fill.is-danger { background: var(--wf-danger-bar); }
.hr-dept-pct { font-size: 12.5px; font-weight: 700; color: var(--wf-muted); text-align: end; }
.hr-summary-card { border-color: var(--wf-ai-soft); }
.hr-summary-card .wf-eyebrow { color: var(--wf-ai); }

/* ⑦ recent requests — a deliberately simple table */
.hr-table-wrap { overflow-x: auto; }
.hr-table { inline-size: 100%; border-collapse: collapse; font-size: 13px; }
.hr-table th {
    text-align: start; font-size: var(--ho-text-xs); font-weight: 600;
    color: var(--wf-muted); padding: 6px 10px;
    border-block-end: 1px solid var(--wf-border);
    white-space: nowrap;
}
.hr-table td { padding: 9px 10px; border-block-end: 1px solid var(--wf-border-soft); color: var(--wf-ink); }
.hr-table tr:last-child td { border-block-end: 0; }
.hr-row-link { font-size: 12.5px; font-weight: 600; color: var(--wf-info); text-decoration: none; white-space: nowrap; }
.hr-row-link:hover { color: var(--wf-info-strong); }

/* ⑧ quiet follow-ups grid */
.hr-followups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.hr-followups:empty { display: none; }
.wf-empty-sub { font-size: 12.5px; color: var(--wf-muted); }

/* ═════════════════════════════════════════════════════════════════════
   SIDEBAR ACCORDION CONTRACT (15-8-2026)

   Root cause of the "strange timeline" look: Filament v4 renders a 24px
   `fi-sidebar-item-grouped-border` column (dots + vertical connectors)
   inside EVERY grouped item — top-level, closed, plain items alike. That
   decoration is what read as ghost children under closed parents. It is
   removed wholesale; hierarchy is expressed the honest way instead: an
   indented child list with ONE connector line that exists only while a
   parent is open (Filament only puts `fi-sidebar-sub-group-items` in the
   DOM for the active parent chain, so closed parents are naturally a
   single row with zero reserved space).

   Logical properties only — the same rules carry RTL and LTR.
   ──────────────────────────────────────────────────────────────────── */

/* the default timeline decoration: gone, everywhere in the sidebar */
.fi-sidebar-nav .fi-sidebar-item-grouped-border { display: none; }

/* base rows */
.fi-sidebar-item-btn { border-radius: var(--wf-radius-sm); }
.fi-sidebar-item-btn:hover { background: #f1f5f9; }
.dark .fi-sidebar-item-btn:hover { background: rgb(255 255 255 / 0.05); }

/* the ACTIVE DESTINATION — parent page or child page alike — owns the
   one strong highlight */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar-item.fi-active > a {
    background: var(--wf-info-soft);
}
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > a .fi-sidebar-item-label { color: var(--wf-info); font-weight: 600; }

/* OPEN parent (a child of it is the active page): emphasis, never the
   active fill — the strong state stays unique to the current page */
.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn { background: transparent; }
.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn .fi-sidebar-item-label {
    color: var(--wf-ink);
    font-weight: 600;
}
/* chevron reflecting the open state, direction-neutral glyph, pinned at
   the row end after label/badge */
.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn::after {
    content: "▾";
    margin-inline-start: auto;
    color: var(--wf-faint);
    font-size: var(--ho-text-xs);
    line-height: 1;
}

/* CHILD LIST — the whole hierarchy story: indent + one connector line
   that starts after the parent and ends at the last child, on the
   nesting side in both directions */
.fi-sidebar-sub-group-items {
    margin-inline-start: 22px;
    padding-inline-start: 10px;
    border-inline-start: 1px solid var(--wf-border);
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-block: 2px 4px;
}
.fi-sidebar-sub-group-items .fi-sidebar-item-btn { padding-block: 6px; min-block-size: 0; }
.fi-sidebar-sub-group-items .fi-sidebar-item-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--wf-muted);
    overflow-wrap: anywhere;   /* long labels wrap, never escape the rail */
}
.fi-sidebar-sub-group-items .fi-sidebar-item:hover .fi-sidebar-item-label { color: var(--wf-ink); }
/* active child inside the list keeps the strong state (specificity guard) */
.fi-sidebar-sub-group-items .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-sub-group-items .fi-sidebar-item.fi-active > a .fi-sidebar-item-label {
    color: var(--wf-info);
    font-weight: 600;
}

/* badges: stable alignment at the row end, never moving the label,
   never changing row height */
.fi-sidebar-item-badge-ctn { margin-inline-start: auto; flex-shrink: 0; }
.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn .fi-sidebar-item-badge-ctn { margin-inline-start: auto; }
.fi-sidebar-item-btn .fi-badge { line-height: 1.1; }

/* mobile: the dashboard grids collapse to one column below 900px */
@media (max-width: 900px) {
    .hr-payops, .hr-insight { grid-template-columns: 1fr; }
}

/* Table empty states: an honest message does not need half a viewport.
   (Panel-wide, deliberately conservative — same look, less dead space.) */
.fi-ta-empty-state { padding-block: 2.25rem; }
.fi-ta-empty-state-icon-ctn { margin-block-end: 0.5rem; }
/* Requests wave — request card (reuses the employee-card scaffolding) */
.wf-req-card {
    display: flex; flex-direction: column; gap: 10px; height: 100%;
    padding: 2px 2px 0;
}
.wf-req-card.is-needs-me { position: relative; }
.wf-req-card.is-needs-me::before {
    content: ""; position: absolute; inset-block: 2px; inset-inline-start: -10px;
    width: 3px; border-radius: 2px; background: var(--wf-warn-strong);
}

/* TASK-CREATE-1 moved to tasks.css (TASK-CREATE-DS-1): the Create Task page
   wears the house design system now, beside the «المهام» screen it opens from. */

/* Task comments: an inline composer on the read-only task detail page. */
.wf-task-comments { padding: 1.25rem; min-width: 0; }
.wf-task-comments__form { display: grid; gap: .75rem; margin-top: 1rem; }
.wf-task-comments__input {
    display: block; width: 100%; max-width: 100%; min-height: 7rem;
    box-sizing: border-box; resize: vertical; padding: .75rem;
    border: 1px solid #d1d5db; border-radius: .75rem;
    background: #fff; color: #111827; font-size: 16px;
}
.wf-task-comments__input:focus { outline: 2px solid #2563eb; outline-offset: 2px; }
.wf-task-comments__send { min-height: 44px; justify-self: start; }
.dark .wf-task-comments__input { background: #111827; color: #fff; border-color: #4b5563; }
@media (max-width: 640px) {
    .wf-task-comments { padding: 1rem; }
    .wf-task-comments__send { width: 100%; }
}

.wf-task-comment-body { white-space: normal; overflow-wrap: anywhere; min-width: 0; }

/* ── MY-FILE-1 «ملفي» › «بياناتي»: less scrolling ────────────────────────
   The sections sit in two columns (EmployeeResource::myDataTab); the day,
   request and task lists flow in a grid of one-line rows, so ten days of
   attendance or six tasks take a few lines instead of a screen. */
.wf-my-data :is(.wf-rows-grid, [data-my-data-section="attendance"] .wf-rows, [data-my-data-section="leave-requests"] .wf-rows) {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px;
}
.wf-my-data .wf-row { padding-block: 6px; gap: 4px 10px; }
.wf-my-data .wf-row::before { inset-block: 6px; }
.wf-my-data .wf-row-title { font-size: 13px; }
.wf-my-data .wf-row-meta { margin-block-start: 0; }
.wf-my-data :is(.wf-rows-grid, [data-my-data-section="attendance"] .wf-rows, [data-my-data-section="leave-requests"] .wf-rows) .wf-row { flex-wrap: nowrap; }
.wf-my-data :is(.wf-rows-grid, [data-my-data-section="attendance"] .wf-rows, [data-my-data-section="leave-requests"] .wf-rows) .wf-row-main {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; flex: 1 1 0;
}
.wf-my-data :is(.wf-rows-grid, [data-my-data-section="attendance"] .wf-rows, [data-my-data-section="leave-requests"] .wf-rows) .wf-row-side { flex: none; width: auto; }
.wf-my-data .wf-fact-value { flex-wrap: wrap; min-width: 0; }
.wf-my-data .wf-fact-value .wf-pill { white-space: normal; }
.wf-my-data .wf-strip { gap: 6px; }
.wf-my-data .wf-strip-chip { padding: 6px 10px; }
.wf-my-data .wf-skill { padding-block: 6px; }
.wf-my-data .wf-hero-facts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; }
.wf-my-data [data-my-data-section="tasks"].wf-kpis.wf-kpis-profile { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block-end: 10px !important; }
.wf-my-data .wf-kpis-profile .wf-kpi { padding: 8px 12px; flex-direction: row; align-items: baseline; gap: 8px; }
.wf-my-data .wf-kpis-profile .wf-kpi-vl { font-size: 20px; padding-inline-end: 0; }
.wf-my-data .wf-kpis-profile .wf-kpi-lb { font-size: 12px; }
.wf-my-data .wf-kpis-profile .wf-kpi-ic { display: none; }
.wf-my-data .wf-empty { padding-block: 10px !important; }
@media (max-width: 640px) {
    /* MY-FILE-3 phone: a section's button goes under its title (the title
       broke over three lines beside it); label and value share one line;
       the task counters sit three to a row. */
    .wf-my-data .fi-section-header { flex-wrap: wrap; row-gap: 8px; }
    .wf-my-data .fi-section-header-text-ctn { flex: 1 1 0; min-width: 0; }
    .wf-my-data .fi-section-header-after-ctn { flex-basis: 100%; }
    .wf-my-data .fi-section-header-after-ctn .fi-sc { justify-content: flex-start; }
    .wf-my-data .wf-row { flex-wrap: nowrap; }
    .wf-my-data .wf-row-main { min-width: 0; }
    .wf-my-data .wf-row-side { width: auto; flex: none; }
    .wf-my-data [data-my-data-section="tasks"].wf-kpis.wf-kpis-profile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wf-my-data [data-my-data-section="tasks"] .wf-kpi { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }
    .wf-my-data .wf-hero-facts { grid-template-columns: repeat(2, 1fr); }
}

/* MY-FILE-2: the leave balance never squeezes its second column (a long
   notice in the first one used to take its width), and stacks when the
   section is narrow. */
.wf-my-data .wf-leave-balance { container-type: inline-size; }
.wf-my-data .wf-leave-balance .wf-two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wf-my-data .wf-leave-balance .wf-pill { white-space: normal; }
@container (max-width: 560px) {
    .wf-my-data .wf-leave-balance .wf-two-col { grid-template-columns: minmax(0, 1fr); }
}

/* MY-FILE-2: the job description folds to its title and first lines. */
.wf-jd-fold:not(.is-open):not(.is-short) .wf-jd-fold-body {
    max-height: 230px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 65%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent);
}
.wf-jd-fold-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-block-start: 8px; padding: 6px 12px;
    font-size: 13px; font-weight: 600; color: var(--wf-info);
    background: var(--wf-info-soft); border: 1px solid transparent; border-radius: 999px;
    cursor: pointer;
}
.wf-jd-fold-btn:hover { border-color: var(--wf-info); }
.wf-jd-fold-btn:focus-visible { outline: 2px solid var(--wf-info); outline-offset: 2px; }
.wf-jd-fold-ic { width: 16px; height: 16px; transition: transform 0.15s ease; }
.wf-jd-fold.is-open .wf-jd-fold-ic { transform: rotate(180deg); }
