/* ============================================================
   بصمة فينيكس — نظام التصميم
   ورق دافئ · كحلي فينيكس · ذهبي — ألوان الشعار هي الهوية، وخطوط البصمة هي الفكرة
   ============================================================ */
:root {
  --paper: #f3eee5;
  --paper-2: #ebe3d5;
  --card: #fbf8f2;
  --card-2: #f6f1e8;
  --ink: #161b2b;
  --ink-2: #434a5e;
  --ink-3: #7c8193;
  --hair: rgba(22, 27, 43, .08);
  --hair-2: rgba(22, 27, 43, .16);
  --brand: #354679;
  --brand-2: #4b5f9e;
  --brand-soft: rgba(53, 70, 121, .09);
  --phoenix-green: #548879;
  --brass: #b8892f;
  --brass-2: #d8b06a;
  --ok: #2f6f5e;
  --ok-soft: rgba(47, 111, 94, .12);
  --warn: #a87619;
  --warn-soft: rgba(168, 118, 25, .14);
  --bad: #b3261e;
  --bad-soft: rgba(179, 38, 30, .1);
  --info: #3d5a80;
  --info-soft: rgba(61, 90, 128, .12);
  --rail: #121a30;
  --rail-ink: #efe6d8;
  --rail-ink-2: rgba(239, 230, 216, .55);
  --shadow-sm: 0 1px 2px rgba(18, 26, 52, .06), 0 6px 16px -10px rgba(18, 26, 52, .18);
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 2px 6px rgba(18, 26, 52, .05), 0 24px 48px -28px rgba(18, 26, 52, .35);
  --shadow-lg: 0 40px 80px -30px rgba(12, 18, 40, .45);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --f-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --rail-w: 252px;
  --gutter: clamp(16px, 3vw, 36px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
  :root:not([data-theme="light"]) {
    --paper: #0b0f1c; --paper-2: #10162a; --card: #141b31; --card-2: #19213a;
    --ink: #eef0f6; --ink-2: #bfc5d6; --ink-3: #868ea6;
    --hair: rgba(238, 240, 246, .07); --hair-2: rgba(238, 240, 246, .14);
    --brand: #8ea2e6; --brand-2: #a9b8ef; --brand-soft: rgba(142, 162, 230, .14);
    --brass: #d6ad5e; --brass-2: #e9c987;
    --ok: #5fb39a; --ok-soft: rgba(95, 179, 154, .14);
    --warn: #e0a83c; --warn-soft: rgba(224, 168, 60, .14);
    --bad: #f0675d; --bad-soft: rgba(240, 103, 93, .13);
    --info: #8fb0dc; --info-soft: rgba(143, 176, 220, .13);
    --rail: #070a14;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 48px -28px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b0f1c; --paper-2: #10162a; --card: #141b31; --card-2: #19213a;
  --ink: #eef0f6; --ink-2: #bfc5d6; --ink-3: #868ea6;
  --hair: rgba(238, 240, 246, .07); --hair-2: rgba(238, 240, 246, .14);
  --brand: #8ea2e6; --brand-2: #a9b8ef; --brand-soft: rgba(142, 162, 230, .14);
  --brass: #d6ad5e; --brass-2: #e9c987;
  --ok: #5fb39a; --ok-soft: rgba(95, 179, 154, .14);
  --warn: #e0a83c; --warn-soft: rgba(224, 168, 60, .14);
  --bad: #f0675d; --bad-soft: rgba(240, 103, 93, .13);
  --info: #8fb0dc; --info-soft: rgba(143, 176, 220, .13);
  --rail: #070a14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 48px -28px rgba(0, 0, 0, .8);
}

/* ---------------------------------------------------------- أساسيات */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
  overflow-x: hidden;
}
body::before { /* حبيبات الورق */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: .5;
  background-image: radial-gradient(rgba(120, 90, 60, .05) 1px, transparent 1px);
  background-size: 3px 3px;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.num, .tnum { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 56px; height: 56px; border-radius: 16px; animation: breathe 1.6s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .6; } }

/* ---------------------------------------------------------- الهيكل */
.shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100dvh;
}
.rail {
  position: sticky; top: 0;
  height: 100dvh;
  background: var(--rail);
  color: var(--rail-ink);
  display: flex; flex-direction: column;
  padding: 22px 16px 18px;
  overflow: hidden;
  isolation: isolate;
}
.rail::after { /* خطوط بصمة باهتة */
  content: "";
  position: absolute; inset: auto -120px -160px auto;
  width: 420px; height: 420px;
  background: repeating-radial-gradient(ellipse at 40% 45%, transparent 0 9px, rgba(216, 176, 106, .07) 9px 10px);
  border-radius: 50%;
  z-index: -1;
  transform: rotate(-18deg);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.brand b { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand small { color: var(--rail-ink-2); font-size: .72rem; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--rail-ink-2);
  text-decoration: none;
  font-weight: 500;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { color: var(--rail-ink); background: rgba(255, 255, 255, .04); }
.nav a[aria-current="page"] { color: var(--rail-ink); background: rgba(255, 255, 255, .07); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; inset-inline-start: -16px; top: 10px; bottom: 10px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--brass-2);
}
.nav .count {
  margin-inline-start: auto;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--brand-2); color: #fff;
  font-size: .72rem; font-weight: 700; display: grid; place-items: center;
}
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.sync-pill {
  display: flex; align-items: center; gap: 10px;
  font-size: .76rem; color: var(--rail-ink-2);
  padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04);
}
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: #6ac2a4; box-shadow: 0 0 0 4px rgba(106, 194, 164, .15); flex: none; }
.sync-pill.stale i { background: var(--brass-2); box-shadow: 0 0 0 4px rgba(216, 176, 106, .15); }
button.sync-pill { border: 0; font: inherit; font-size: .76rem; text-align: start; cursor: pointer; width: 100%; transition: background .2s; }
button.sync-pill:hover { background: rgba(255, 255, 255, .09); }
button.sync-pill span { flex: 1; }
button.sync-pill svg { width: 15px; height: 15px; opacity: .55; }
.waiting svg { animation: spin 1s linear infinite; }
button.sync-pill.waiting i { animation: live-ping 1.2s var(--ease) infinite; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.me-chip .av { width: 36px; height: 36px; font-size: .9rem; }
.me-chip b { display: block; font-size: .86rem; line-height: 1.2; }
.me-chip small { color: var(--rail-ink-2); font-size: .72rem; }
.me-chip .icon-btn { margin-inline-start: auto; color: var(--rail-ink-2); }
.me-chip .icon-btn:hover { color: var(--rail-ink); background: rgba(255, 255, 255, .08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--hair);
}
.topbar h1 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  letter-spacing: -.015em;
  line-height: 1.2;
}
.topbar .sub { color: var(--ink-3); font-size: .82rem; }
.topbar .tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.content { padding: 26px var(--gutter) 120px; display: grid; gap: 22px; align-content: start; }

/* ---------------------------------------------------------- الحركة بين الصفحات */
.view { animation: view-in .55s var(--ease) both; transform-origin: 50% 0; }
@keyframes view-in {
  from { opacity: 0; transform: perspective(1200px) translateY(14px) rotateX(4deg); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
.stagger > * { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
::view-transition-old(root) { animation: .22s var(--ease) both vt-out; }
::view-transition-new(root) { animation: .45s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: scale(1.012); } }
/* ما تحت الشاشة يظهر حين تصله بالتمرير */
.reveal { opacity: 0; transform: translateY(26px) scale(.985); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .75s var(--ease-spring); }

/* ---------------------------------------------------------- مكونات */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.card-h .tools { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }

.tilt { transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .5s var(--ease); will-change: transform; }
.tilt.is-tilting { transition: transform .08s linear; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); }
.tilt .glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .22), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.tilt.is-tilting .glare { opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 13px;
  border: 1px solid var(--hair-2);
  background: var(--card);
  color: var(--ink);
  font-weight: 600; font-size: .9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
  text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
/* موجة الضغط تحت الإصبع */
.btn, .seg button, .sheet-item { position: relative; overflow: hidden; isolation: isolate; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  background: currentColor; opacity: .16; transform: scale(0);
  animation: ripple-out .6s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes ripple-out { to { transform: scale(1); opacity: 0; } }
.btn.primary {
  background: var(--ink); color: var(--paper); border-color: transparent;
  box-shadow: 0 10px 24px -12px rgba(27, 21, 19, .6);
}
.btn.primary:hover { background: var(--brand); }
.btn.brand { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 12px 26px -14px var(--brand); }
.btn.brand:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hair); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--paper) transparent var(--paper) transparent;
  animation: spin .8s linear infinite;
}
.btn:not(.primary):not(.brand).loading::after { border-color: var(--ink) transparent var(--ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--hair); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

.seg {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--paper-2); border-radius: 14px; border: 1px solid var(--hair);
  position: relative;
}
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 10px;
  font-size: .84rem; font-weight: 600; color: var(--ink-3); cursor: pointer;
  transition: color .2s, background .25s var(--ease), box-shadow .25s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
/* المؤشر المنزلق: يأخذ مكان خلفية الزر المختار حين يعمل */
.seg-pill {
  position: absolute; top: 0; left: 0; border-radius: 10px; background: var(--card); box-shadow: var(--shadow-sm);
  pointer-events: none; opacity: 0;
  transition: transform .42s var(--ease-spring), width .42s var(--ease-spring), height .3s var(--ease), opacity .2s;
}
.seg button { position: relative; z-index: 1; }
.seg.pill-on button[aria-pressed="true"] { background: transparent; box-shadow: none; }

.month-step { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--hair-2); border-radius: 14px; padding: 3px; }
.month-step span { min-width: 120px; text-align: center; font-family: var(--f-display); font-weight: 500; font-size: .92rem; }
.month-step .icon-btn { width: 34px; height: 34px; border-radius: 10px; }

.field { display: grid; gap: 6px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--hair-2);
  background: var(--card);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brass); box-shadow: 0 0 0 4px rgba(184, 137, 47, .16); }
.input.num { text-align: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
  background: var(--hair); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

.av {
  width: 44px; height: 44px; flex: none;
  border-radius: 14px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-2), #1d2a52);
  color: #fff; font-family: var(--f-display); font-weight: 600;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 84px; height: 84px; border-radius: 24px; font-size: 1.8rem; }

/* ---------------------------------------------------------- بطاقات الأرقام */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px 20px; overflow: hidden; }
.kpi::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 18px; bottom: 18px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tone, var(--brand));
}
.kpi .k-top { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .8rem; font-weight: 600; }
.kpi .k-top svg { width: 18px; height: 18px; color: var(--tone, var(--brand)); }
.kpi .k-val {
  margin-top: 10px;
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  letter-spacing: -.02em; line-height: 1.1;
}
.kpi .k-val small { font-size: .5em; font-weight: 500; color: var(--ink-3); margin-inline-start: 4px; }
.kpi .k-sub { margin-top: 6px; font-size: .78rem; color: var(--ink-3); }
.kpi.hero { background: var(--ink); color: var(--paper); border-color: transparent; }
.kpi.hero .k-top, .kpi.hero .k-sub, .kpi.hero .k-val small { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.kpi.hero::after {
  content: ""; position: absolute; width: 260px; height: 260px; inset: auto auto -130px -90px;
  background: repeating-radial-gradient(circle, transparent 0 8px, rgba(216, 176, 106, .14) 8px 9px);
  border-radius: 50%;
}

/* ---------------------------------------------------------- لوحة اليوم */
.day-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.ring-card { display: flex; align-items: center; gap: 22px; overflow: hidden; }
.ring { width: 150px; height: 150px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring .ring-track { stroke: var(--hair); }
.ring .seg-arc { transition: stroke-dasharray 1.2s var(--ease), stroke-dashoffset 1.2s var(--ease); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center b { font-family: var(--f-display); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.ring .center small { display: block; color: var(--ink-3); font-size: .74rem; margin-top: 4px; }
.legend { display: grid; gap: 8px; flex: 1; }
.legend button {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; padding: 6px 8px; border-radius: 10px; cursor: pointer; text-align: start;
}
.legend button:hover, .legend button[aria-pressed="true"] { background: var(--hair); }
.legend i { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.legend span { flex: 1; font-size: .86rem; color: var(--ink-2); }
.legend b { font-family: var(--f-display); font-weight: 600; }

.board { display: grid; gap: 8px; }
.board-axis, .board-row { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 150px; gap: 16px; align-items: center; }
.board-axis { padding: 0 14px; color: var(--ink-3); font-size: .7rem; }
.board-axis .ticks { position: relative; height: 16px; }
.board-axis .ticks span { position: absolute; transform: translateX(50%); }
.board-row {
  padding: 10px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--hair);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  cursor: pointer;
  text-decoration: none; color: inherit;
}
.board-row:hover { transform: translateX(-4px); border-color: var(--hair-2); box-shadow: var(--shadow-sm); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { display: block; font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--ink-3); font-size: .74rem; }
.track {
  position: relative; height: 14px;
  border-radius: 7px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 12 - 1px), var(--hair) calc(100% / 12 - 1px) calc(100% / 12)),
    var(--paper-2);
}
.track .late-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--brass); border-radius: 1px; opacity: .7; }
.track .now-line { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--brand); border-radius: 1px; }
.track .now-line::after { content: ""; position: absolute; top: -4px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.track .now-line::before {
  content: ""; position: absolute; top: -4px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); animation: now-pulse 2.2s var(--ease) infinite;
}
@keyframes now-pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(3.2); opacity: 0; } }
.track .bar {
  position: absolute; top: 2px; bottom: 2px; border-radius: 5px;
  background: var(--ok);
  transform-origin: right center;
  animation: grow .9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 30ms + .1s);
}
.track .bar.late { background: var(--warn); }
/* ألوان الخط الزمني */
.track .bar.work { background: var(--ok); }
.track .bar.work.live { background: repeating-linear-gradient(-45deg, var(--ok) 0 6px, color-mix(in srgb, var(--ok) 70%, #fff) 6px 12px); background-size: 17px 17px; }
.track .bar.delay { background: var(--bad); z-index: 1; }
.track .bar.done { background: color-mix(in srgb, var(--ink-3) 30%, transparent); }
.track .bar[class*="out-"] { z-index: 2; top: 0; bottom: 0; box-shadow: 0 0 0 1.5px var(--paper); }
.track .bar.out-mission { background: var(--info); }
.track .bar.out-mission_pending { background: repeating-linear-gradient(-45deg, var(--info) 0 4px, color-mix(in srgb, var(--info) 45%, #fff) 4px 8px); }
.track .bar.out-personal { background: #e0802a; }
.track .bar.out-unset { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 4px, color-mix(in srgb, var(--ink-3) 40%, #fff) 4px 8px); }
.track .bar.open { opacity: .85; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 12px; font-size: .74rem; color: var(--ink-3); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { width: 18px; height: 8px; border-radius: 3px; display: inline-block; }
.tl-legend .seg-work { background: var(--ok); }
.tl-legend .seg-delay { background: var(--bad); }
.tl-legend .seg-mission { background: var(--info); }
.tl-legend .seg-personal { background: #e0802a; }
.tl-legend .seg-unset { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 3px, color-mix(in srgb, var(--ink-3) 40%, #fff) 3px 6px); }
.tl-legend .seg-done { background: color-mix(in srgb, var(--ink-3) 30%, transparent); }
.track .bar.live { background: repeating-linear-gradient(-45deg, var(--ok) 0 6px, color-mix(in srgb, var(--ok) 70%, #fff) 6px 12px); background-size: 17px 17px; animation: grow .9s var(--ease) both, march 1.2s linear infinite; }
.track .bar.live.late { background: repeating-linear-gradient(-45deg, var(--warn) 0 6px, color-mix(in srgb, var(--warn) 70%, #fff) 6px 12px); }
.track .bar.field { background: var(--info); }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes march { to { background-position: 17px 0; } }
.state { display: grid; gap: 2px; justify-items: start; }
.state small { color: var(--ink-3); font-size: .74rem; }

/* ---------------------------------------------------------- الجداول */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--hair); }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
.t th {
  position: sticky; top: 0;
  text-align: start; font-weight: 600; font-size: .74rem; color: var(--ink-3);
  background: var(--card-2); padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--hair);
}
.t td { padding: 12px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
/* الأرقام والتواريخ اتجاهها LTR فكانت تلتصق بيسار خليتها وتبدو تحت العمود المجاور — تُحاذى مع عنوانها */
.t td.num { text-align: right; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: var(--brand-soft); }
.t tr:last-child td { border-bottom: 0; }
.t .money { font-variant-numeric: tabular-nums; }
.t .neg { color: var(--bad); }
.t .pos { color: var(--ok); }
.t tfoot td { font-weight: 700; background: var(--card-2); border-top: 1px solid var(--hair-2); }
.t .salary-input { width: 110px; height: 36px; text-align: center; border-radius: 10px; }
.t .clickable { cursor: pointer; }

/* ---------------------------------------------------------- الموظفون */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.person { display: grid; gap: 14px; text-decoration: none; color: inherit; cursor: pointer; }
.person .who b { font-size: 1rem; }
.person .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person .stats div { background: var(--paper-2); border-radius: 12px; padding: 8px 10px; }
.person .stats b { display: block; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; }
.person .stats small { color: var(--ink-3); font-size: .7rem; }
.meter { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brass), var(--brand)); transform-origin: right; animation: grow-r 1.1s var(--ease) both; }
@keyframes grow-r { from { transform: scaleX(0); } }

/* ---------------------------------------------------------- ملف الموظف */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head h2 { margin: 0; font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: .68rem; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.cal .d {
  aspect-ratio: 1 / 1.05; border-radius: 12px; padding: 6px;
  background: var(--paper-2); display: flex; flex-direction: column; justify-content: space-between;
  font-size: .7rem; position: relative; transition: transform .25s var(--ease-spring);
}
.cal .d:hover { transform: translateY(-3px) scale(1.04); z-index: 1; }
/* الأيام تتتابع في الظهور، ويوم قابل للضغط يُفتح بتفاصيله */
.cal .d:not(.empty) { animation: cell-in .5s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 14ms + 80ms); }
.cal.still .d { animation: none; }
@keyframes cell-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.cal .d.tap { cursor: pointer; }
.cal .d.tap:active { transform: scale(.94); transition-duration: .1s; }
.cal .d.tap:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cal .d.today::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 2px var(--brass); animation: today-glow 2.4s var(--ease) infinite;
}
@keyframes today-glow { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brass) 25%, transparent); } }
/* شريط اليوم في نافذة التفاصيل */
.day-bar { position: relative; height: 14px; border-radius: 7px; background: var(--paper-2); margin-bottom: 18px; }
.day-bar .fill {
  position: absolute; top: 0; bottom: 0; border-radius: 7px; background: linear-gradient(270deg, var(--ok), color-mix(in srgb, var(--ok) 65%, var(--brass)));
  transform-origin: right; animation: grow .9s var(--ease) .15s both;
}
.day-bar .fill.open { background: repeating-linear-gradient(-45deg, var(--warn) 0 6px, color-mix(in srgb, var(--warn) 60%, #fff) 6px 12px); }
.day-bar .void { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-right: -1px; background: var(--ink-3); opacity: .6; }
.day-bar .void::after { content: "✕"; position: absolute; top: -14px; right: -4px; font-size: .6rem; color: var(--ink-3); }
.day-bar-axis { position: absolute; inset-inline: 0; top: 18px; display: flex; justify-content: space-between; font-size: .64rem; color: var(--ink-3); }
.cal .d b { font-family: var(--f-display); font-weight: 600; font-size: .9rem; }
.cal .d.ok { background: var(--ok-soft); color: var(--ok); }
.cal .d.late { background: var(--warn-soft); color: var(--warn); }
.cal .d.absent { background: var(--bad-soft); color: var(--bad); }
.cal .d.field { background: var(--info-soft); color: var(--info); }
.cal .d.off { background: transparent; border: 1px dashed var(--hair-2); color: var(--ink-3); }
.cal .d.future { opacity: .45; }
.voided { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .6; font-size: .58rem; }
.cal .d .voided { display: block; line-height: 1; }
.cal .d.today { box-shadow: 0 0 0 2px var(--brass); }
.cal .d.empty { visibility: hidden; }
.lines { display: grid; gap: 0; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--hair-2); font-size: .9rem; }
.lines > div:last-child { border-bottom: 0; }
.lines .total { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 6px; padding-top: 12px; }

/* ---------------------------------------------------------- الميداني */
.req { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.req + .req { margin-top: 10px; }
.req .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: .8rem; margin-top: 4px; }
.req .actions { display: flex; gap: 8px; }
.map-dot { display: inline-flex; align-items: center; gap: 4px; }

.start-card { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 34px 22px; overflow: hidden; }
.start-btn {
  width: 168px; height: 168px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, var(--brand-2), var(--brand) 55%, #1a2447);
  color: #fff; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600;
  box-shadow: 0 30px 60px -20px var(--brand), inset 0 -10px 30px rgba(0, 0, 0, .25), inset 0 6px 20px rgba(255, 255, 255, .2);
  position: relative;
  transition: transform .3s var(--ease-spring);
}
.start-btn:active { transform: scale(.94); }
.start-btn::before, .start-btn::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1px solid var(--brand); opacity: .4; animation: ripple 2.6s var(--ease) infinite;
}
.start-btn::after { animation-delay: 1.3s; }
@keyframes ripple { from { transform: scale(.9); opacity: .5; } to { transform: scale(1.35); opacity: 0; } }
.start-btn.done { background: radial-gradient(circle at 35% 30%, #6fc4aa, var(--ok) 55%, #163a30); box-shadow: 0 30px 60px -20px var(--ok); }
.start-btn.done::before, .start-btn.done::after { border-color: var(--ok); }

/* ---------------------------------------------------------- الدخول */
.login {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
  background: var(--rail);
}
.login-art { position: relative; overflow: hidden; }
.login-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.login-art .caption {
  position: absolute; inset-inline-start: clamp(24px, 5vw, 64px); bottom: clamp(24px, 6vh, 64px);
  color: var(--rail-ink); max-width: 520px; pointer-events: none;
}
.login-art .caption h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; }
.login-art .caption h2 em { font-style: normal; color: var(--brass-2); }
.login-art .caption p { margin: 14px 0 0; color: var(--rail-ink-2); font-size: 1rem; max-width: 420px; }
.login-panel {
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 34px 0 0 34px;
  position: relative;
  box-shadow: -30px 0 80px rgba(0, 0, 0, .35);
}
[dir="rtl"] .login-panel { border-radius: 0 34px 34px 0; box-shadow: 30px 0 80px rgba(0, 0, 0, .35); }
.login-panel .brand { color: var(--ink); padding: 0 0 36px; }
.login-panel .brand small { color: var(--ink-3); }
.login-panel h1 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 700; font-size: 1.7rem; letter-spacing: -.02em; }
.login-panel form { display: grid; gap: 16px; margin-top: 26px; }
.login-panel .err { color: var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: 12px; font-size: .86rem; }
.login-panel .foot { margin-top: 30px; color: var(--ink-3); font-size: .76rem; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; inset-inline-end: 4px; top: 4px; }

/* ---------------------------------------------------------- نوافذ وإشعارات */
dialog.modal {
  border: 0; padding: 0; border-radius: 26px;
  width: min(560px, calc(100vw - 24px));
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(15, 8, 6, .45); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: pop .4s var(--ease-spring) both; }
@keyframes pop { from { opacity: 0; transform: perspective(900px) translateY(20px) rotateX(8deg) scale(.96); } }
.modal-b { padding: 24px; display: grid; gap: 16px; }
.modal-b h3 { margin: 0; font-family: var(--f-display); font-size: 1.2rem; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--hair); }

#toasts { position: fixed; z-index: 100; inset-inline-start: 50%; transform: translateX(50%); bottom: 24px; display: grid; gap: 8px; pointer-events: none; }
[dir="ltr"] #toasts { transform: translateX(-50%); }
.toast {
  pointer-events: auto;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 14px; font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toast-in .45s var(--ease-spring) both;
}
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { animation: toast-out .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.95); } }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); display: grid; justify-items: center; gap: 10px; }
.empty .rings { width: 90px; height: 90px; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 7px, var(--hair-2) 7px 8px); }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--paper-2) 0%, var(--card) 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; font-size: .86rem; background: var(--warn-soft); color: var(--ink); }
.notice svg { width: 20px; height: 20px; color: var(--warn); flex: none; margin-top: 2px; }
.notice.info { background: var(--info-soft); }
.notice.info svg { color: var(--info); }
.notice.ok { background: var(--ok-soft); }
.notice.ok svg { color: var(--ok); }

/* ---------------------------------------------------------- الجوال */
.tabbar { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
  .topbar .mobile-brand { display: flex; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; z-index: 40; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--rail) 92%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-radius: 24px; padding: 6px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .5);
  }
  .tabbar a, .tabbar button {
    display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 18px; min-width: 0;
    color: var(--rail-ink-2); text-decoration: none; font: inherit; font-size: .66rem; font-weight: 600; position: relative;
    background: none; border: 0; cursor: pointer; transition: color .2s, background .25s var(--ease), transform .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a:active, .tabbar button:active { transform: scale(.92); }
  .tabbar a svg, .tabbar button svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--rail-ink); background: rgba(255, 255, 255, .08); }
  .tabbar [aria-current="page"] svg { color: var(--brass-2); }
  .tabbar .count { position: absolute; top: 4px; inset-inline-end: calc(50% - 22px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--brand-2); color: #fff; font-size: .6rem; display: grid; place-items: center; padding: 0 4px; }
  .day-hero, .profile { grid-template-columns: minmax(0, 1fr); }
  .board-axis { display: none; }
  .board-row { grid-template-columns: minmax(0, 1fr) auto; }
  .board-row .track { grid-column: 1 / -1; grid-row: 2; }
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38vh auto; }
  .login-art .caption h2 { font-size: 1.9rem; }
  .login-art .caption p { display: none; }
  .login-panel, [dir="rtl"] .login-panel { border-radius: 30px 30px 0 0; margin-top: -30px; box-shadow: 0 -20px 60px rgba(0, 0, 0, .4); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .req { grid-template-columns: auto minmax(0, 1fr); }
  .req .actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 14px 16px; }
  .ring-card { flex-direction: column; align-items: stretch; }
  .ring { margin: 0 auto; }
  .topbar { gap: 10px 12px; padding-bottom: 12px; }
  .topbar .tools { width: 100%; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .topbar .tools::-webkit-scrollbar { display: none; }
  .topbar .tools > * { flex: none; }
  .topbar .sub { font-size: .76rem; }
  .mobile-brand .btn .lbl { display: none; }
  .mobile-brand .btn { padding-inline: 10px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  .content { padding-top: 18px; gap: 16px; }
  .view { gap: 16px; }
  .card { padding: 16px; border-radius: 18px; }
  .month-step span { min-width: 96px; }
}
.mobile-brand { display: none; align-items: center; gap: 10px; }
.mobile-brand img { width: 32px; height: 32px; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .rail, .tabbar, .topbar .tools, .btn, #toasts { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  body::before { display: none; }
}

.lines .neg { color: var(--bad); }
.lines .pos { color: var(--ok); }
.who small { display: block; }
.req .meta span { display: inline-flex; align-items: center; gap: 4px; }
.login-art::after { content: ""; position: absolute; inset: 45% 0 0 0; background: linear-gradient(to top, rgba(10, 14, 28, .92), transparent); pointer-events: none; }
.login-art .caption { z-index: 1; }
.me-chip { flex-wrap: wrap; }
.me-chip > div:nth-child(2) { flex: 1; min-width: 0; }
.me-chip > div:nth-child(2) b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip .chip-actions { width: 100%; display: flex; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 6px; }
.me-chip .chip-actions .icon-btn { margin: 0; width: 34px; height: 34px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1240px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis.k3 .k-sub { display: none; } }
.view { display: grid; gap: 22px; align-content: start; min-width: 0; }
.content > *, .view > * { min-width: 0; }

/* ---------- بطاقة «حسابك اليوم» ---------- */
/* ألوان ثابتة للبطاقة الداكنة في الوضعين؛ في الوضع الليلي تأخذ لمسة عنابية بدل أن تذوب في الخلفية */
.today-card { --tc-fg: #f3eee5; display: grid; gap: 10px; background: linear-gradient(140deg, #1b2648, #121a30 65%); color: var(--tc-fg); border-color: transparent; overflow: hidden; }
.today-card::after {
  content: ""; position: absolute; width: 300px; height: 300px; inset: -150px -120px auto auto;
  background: repeating-radial-gradient(circle, transparent 0 9px, rgba(216, 176, 106, .12) 9px 10px); border-radius: 50%; pointer-events: none;
}
.today-card .eyebrow, .today-card .muted { color: color-mix(in srgb, var(--tc-fg) 62%, transparent); }
.today-head { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.25rem, 3.2vw, 1.6rem); line-height: 1.3; }
.today-head.warn { color: var(--brass-2); }
.today-head.bad { color: #ff9c92; }
.today-head.info, .today-head.ok { color: var(--tc-fg); }
.big-money { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.big-money b { font-family: var(--f-display); font-size: 1.6rem; color: #ff9c92; }
.stay { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 1rem; }
.stay b { font-family: var(--f-display); font-size: 1.35rem; color: var(--brass-2); }
.today-card .meter { background: rgba(255, 255, 255, .1); }
.today-card .btn:not(.brand):not(.primary) { background: rgba(255, 255, 255, .08); color: var(--tc-fg); border-color: rgba(255, 255, 255, .14); }
.today-card .btn.primary { background: var(--tc-fg); color: #121a30; }
:root[data-theme="dark"] .today-card { background: linear-gradient(140deg, #22305c, #141b31 60%); border-color: rgba(241, 233, 221, .08); }
.req .kind { font-weight: 700; }

/* ---------- ورقة حسابات الموظفين للطباعة ---------- */
.print-sheet { display: none; }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
@media print {
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing .print-sheet { display: block; color: #000; }
  body.printing::before { display: none; }
  .print-sheet h1 { font-family: var(--f-display); font-size: 20px; margin: 0 0 4px; }
  .print-sheet > p { font-size: 12px; margin: 0 0 14px; }
  .slips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .slip { border: 1.5px dashed #555; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.9; break-inside: avoid; }
  .slip b { font-size: 15px; display: block; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .today-card { background: linear-gradient(140deg, #22305c, #141b31 60%); border-color: rgba(241, 233, 221, .08); }
  :root:not([data-theme="light"]) .pt.black { box-shadow: inset 0 0 0 2px #0a0807, 0 0 0 1.5px rgba(241, 233, 221, .3); }
}
:root[data-theme="dark"] .pt.black { box-shadow: inset 0 0 0 2px #0a0807, 0 0 0 1.5px rgba(241, 233, 221, .3); }
.rail-foot .btn { color: var(--rail-ink); justify-content: flex-start; }
.rail-foot .btn:hover { background: rgba(255,255,255,.06); }

/* ---------------------------------------------------------- نقاطي */
.points { display: grid; gap: 12px; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--ink-3); }
.pt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pt-legend .pt { width: 12px; height: 12px; }
.pt-arena { position: relative; display: grid; gap: 14px; padding: 16px 14px; border-radius: var(--radius-sm);
  background: var(--card-2); border: 1px solid var(--hair); overflow: visible; }
.pt-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px; min-height: 26px; }
.pt-label { font-size: .76rem; color: var(--ink-3); }
.pt-dots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pt-empty { font-size: .78rem; color: var(--ink-3); }
.pt { --f: 1; --c: var(--ink); position: relative; display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--c) calc(var(--f) * 360deg), transparent 0);
  box-shadow: inset 0 0 0 2px var(--c); transition: background .25s; will-change: transform; }
.pt.red { --c: var(--bad); }
.pt.green { --c: #2e9d6f; }
.pt.black { --c: #1b1513; box-shadow: inset 0 0 0 2px #1b1513, 0 0 0 1px var(--hair-2); }
.pt.green.attacking { z-index: 2; box-shadow: inset 0 0 0 2px var(--c), 0 0 14px 2px rgba(46, 157, 111, .55); }
.pt-dots .pt.green { animation: pt-breathe 2.6s ease-in-out infinite; }
.pt-dots .pt.green.attacking { animation: none; }
@keyframes pt-breathe { 50% { transform: translateY(-2px); } }
.spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 3; background: #2e9d6f; }
.spark.r { background: var(--bad); }
.pt-status { font-size: .86rem; font-weight: 600; transition: opacity .4s; }
.pt-status.ok { color: var(--ok); }
.pt-status.bad { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .pt-dots .pt.green { animation: none; } }

/* ---------------------------------------------------------- «المزيد» على الجوال */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(10, 6, 5, .45); backdrop-filter: blur(3px); animation: fade-in .25s both; }
.sheet-panel {
  position: absolute; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; gap: 2px; padding: 8px 8px 10px; border-radius: 26px;
  background: var(--rail); color: var(--rail-ink); box-shadow: 0 30px 60px -10px rgba(0, 0, 0, .6);
  animation: sheet-up .38s var(--ease-spring) both;
}
.sheet.out .sheet-panel { animation: sheet-down .24s ease-in both; }
.sheet.out .sheet-scrim { animation: fade-in .24s reverse both; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); margin: 2px auto 8px; }
.sheet-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 0; background: none;
  color: inherit; font: inherit; font-size: .95rem; font-weight: 600; text-align: start; cursor: pointer;
}
.sheet-item svg { width: 22px; height: 22px; color: var(--brass-2); }
.sheet-item:active { background: rgba(255, 255, 255, .08); }
.sheet-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 6px 10px; }
@keyframes sheet-up { from { transform: translateY(110%); } }
@keyframes sheet-down { to { transform: translateY(110%); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------------------------------------------------------- كشف الرواتب كبطاقات على الجوال */
@media (max-width: 720px) {
  .table-wrap:has(.pay-table) { border: 0; overflow: visible; }
  .pay-table, .pay-table tbody, .pay-table tfoot { display: block; }
  .pay-table thead { display: none; }
  .pay-table tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px;
    padding: 14px; margin-bottom: 10px; border: 1px solid var(--hair); border-radius: 18px; background: var(--card);
  }
  .pay-table tbody td { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0; border: 0; font-size: .84rem; }
  .pay-table tbody td::before { content: attr(data-label); color: var(--ink-3); font-size: .74rem; font-weight: 500; }
  .pay-table tbody td:first-child { grid-column: 1 / -1; padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px dashed var(--hair-2); }
  .pay-table tbody td:first-child::before, .pay-table tbody td:nth-child(2)::before { display: none; }
  .pay-table tbody td:nth-child(2) { grid-column: 1 / -1; order: 1; }
  .pay-table tbody td:nth-child(2):has(input)::before { display: block; content: "الراتب الأساسي"; }
  .pay-table tbody td:last-child { grid-column: 1 / -1; order: 2; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--hair); font-size: 1rem; }
  .pay-table tbody td:last-child::before { content: "الصافي"; font-size: .84rem; color: var(--ink-2); font-weight: 700; }
  .pay-table .salary-input { width: 130px; }
  .pay-table tfoot tr { display: flex; justify-content: space-between; padding: 14px; border-radius: 18px; background: var(--ink); color: var(--paper); }
  .pay-table tfoot td { display: none; padding: 0; border: 0; }
  .pay-table tfoot td:first-child, .pay-table tfoot td:last-child { display: block; font-weight: 700; }
}

/* لمسات عامة: تركيز واضح للوحة المفاتيح، وضغطة محسوسة على الأزرار */
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
@media (hover: none) { .btn:hover { transform: none; } }
/* الزخارف الدائرية خارج البطاقات لا يجب أن توسّع الصفحة أفقياً على الجوال (clip لا يكسر الشريط اللاصق) */
html, body { overflow-x: clip; }
@media (max-width: 560px) {
  /* العنوان والأيقونات في سطر واحد، والوصف يُختصر بدل أن يدفع الأيقونات لسطر جديد */
  .topbar > div:nth-child(2) { flex: 1 1 0; min-width: 0; }
  .topbar h1, .topbar .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .mobile-brand + div + .mobile-brand { gap: 2px; }
}

/* اسحب للتحديث */
.ptr { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 70; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--ink-3); box-shadow: var(--shadow-sm);
  opacity: 0; transform: translate(-50%, 0); pointer-events: none; transition: opacity .2s, color .2s; }
.ptr svg { width: 20px; height: 20px; }
.ptr.ready { color: var(--brand); }
.ptr.spin svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- الرسوم البيانية (ألوان مفحوصة لعمى الألوان) */
:root { --c-one: #4b5f9e; --c-red: #b3261e; --c-green: #2e9d6f; }
:root[data-theme="dark"] { --c-one: #7d90d4; --c-red: #c8392f; --c-green: #33a171; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-one: #7d90d4; --c-red: #c8392f; --c-green: #33a171; } }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.chart { position: relative; margin: 0; display: grid; gap: 8px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-plot { min-height: 200px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .base { stroke: var(--hair-2); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--ink); font-size: 11.5px; font-weight: 700; font-family: var(--f-body); }
.chart .hit { fill: transparent; }
.chart .col { outline: none; cursor: default; }
.chart .col.on .hit, .chart .col:focus-visible .hit { fill: var(--hair); }
.chart .mark { transform-origin: 50% 100%; transform-box: fill-box; animation: col-grow .7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes col-grow { from { transform: scaleY(0); } }
.chart-tip { position: absolute; z-index: 5; width: 160px; padding: 10px 12px; border-radius: 12px; pointer-events: none;
  background: var(--card); border: 1px solid var(--hair-2); box-shadow: var(--shadow-sm); font-size: .78rem; display: grid; gap: 4px;
  transform: translateY(-100%); }
.chart-tip b { font-size: .8rem; }
.chart-tip .row-t { display: flex; align-items: center; gap: 8px; }
.chart-tip .row-t i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.chart-tip .row-t span { color: var(--ink-3); }
.delta { font-weight: 600; }
.delta.good { color: var(--ok); }
.delta.bad { color: var(--bad); }
.refetch .chart-grid, .refetch .kpis { opacity: .55; transition: opacity .2s; }
th .sort { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------- لوحة الشرف */
.honor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.honor-col { padding: 14px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--hair); display: grid; gap: 10px; align-content: start; }
.honor-h { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.honor-h svg { width: 20px; height: 20px; color: var(--brass); }
.honor-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.honor-list li { display: flex; align-items: center; gap: 10px; animation: rise .55s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
.honor-list li .av { width: 34px; height: 34px; font-size: .85rem; }
.honor-list b { display: block; font-size: .86rem; }
.honor-list small { color: var(--ink-3); font-size: .74rem; }
.honor-empty { font-size: .82rem; }
.medal { position: relative; overflow: hidden; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: .72rem; font-weight: 800; color: #3b2a12; }
.medal.m1 { background: linear-gradient(135deg, #f6d27a, #c99a2e); box-shadow: 0 0 0 2px rgba(201, 154, 46, .25); }
.medal.m2 { background: linear-gradient(135deg, #e6e3de, #a9a39a); }
.medal.m3 { background: linear-gradient(135deg, #e8b48a, #a8683b); color: #3a1f0d; }
.medal.m1::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 3.2s 1s ease-in-out infinite; }
@keyframes shine { 30%, 100% { transform: translateX(120%); } }

/* ---------------------------------------------------------- سلسلة الالتزام */
.streak { display: grid; gap: 12px; overflow: hidden; }
.streak-main { display: flex; align-items: center; gap: 16px; }
.flame { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 50% 70%, rgba(232, 140, 40, .28), rgba(232, 140, 40, .06) 70%); }
.flame svg { width: 38px; height: 38px; color: #e08a2c; fill: rgba(240, 160, 60, .35); transform-origin: 50% 90%; animation: flicker 1.8s ease-in-out infinite; }
.streak[data-level="0"] .flame { filter: grayscale(1); opacity: .55; }
.streak[data-level="0"] .flame svg { animation: none; }
.streak[data-level="2"] .flame svg { color: #e5672a; fill: rgba(240, 120, 50, .45); }
.streak[data-level="3"] .flame { box-shadow: 0 0 24px rgba(240, 120, 50, .35); }
.streak[data-level="3"] .flame svg { color: #d9452b; fill: rgba(235, 90, 50, .55); }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 30% { transform: scale(1.06, .97) rotate(2deg); } 60% { transform: scale(.97, 1.05) rotate(-1deg); } }
.streak-n { display: flex; align-items: baseline; gap: 8px; margin: 2px 0; }
.streak-n b { font-family: var(--f-display); font-size: 2.4rem; line-height: 1; }
.streak-n span { font-size: .86rem; color: var(--ink-2); }
.streak-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--hair-2); font-size: .82rem; }
.badge-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: color-mix(in srgb, var(--brass) 16%, transparent); color: var(--ink); animation: pop-in .45s var(--ease-spring) both; animation-delay: calc(var(--i) * 80ms + 200ms); }
.badge-chip svg { width: 14px; height: 14px; color: var(--brass); }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flame svg, .medal.m1::after { animation: none; } }
.chart-tip[hidden], .chart-plot[hidden], .chart-table[hidden] { display: none; }
/* داخل SVG نحسب المواقع يدوياً؛ اتجاه rtl يقلب text-anchor فيغطي الأعمدة */
.chart svg { direction: ltr; }
.chart-tip { width: 190px; }
.chart-tip .row-t span { white-space: nowrap; }
@media (max-width: 560px) { .delta-ctx { display: none; } }

/* شعار Phoenix الكامل على لوحة الدخول */
.login-logo { position: absolute; z-index: 1; top: clamp(24px, 5vh, 48px); inset-inline-start: clamp(24px, 4vw, 56px); width: clamp(110px, 12vw, 160px); height: auto; opacity: .92; }
@media (max-width: 960px) { .login-logo { width: 92px; top: calc(16px + env(safe-area-inset-top)); } }

/* ---------------------------------------------------------- مسح كود الحضور */
.scan-stage { display: grid; justify-items: center; gap: 16px; padding-top: 8px; }
.scan-frame { position: relative; width: min(82vw, 380px); aspect-ratio: 1; border-radius: 28px; overflow: hidden; background: #0b1022; box-shadow: var(--shadow); }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame i { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; opacity: .9; }
.scan-frame .c1 { top: 18px; right: 18px; border-width: 4px 4px 0 0; border-radius: 0 14px 0 0; }
.scan-frame .c2 { top: 18px; left: 18px; border-width: 4px 0 0 4px; border-radius: 14px 0 0 0; }
.scan-frame .c3 { bottom: 18px; right: 18px; border-width: 0 4px 4px 0; border-radius: 0 0 14px 0; }
.scan-frame .c4 { bottom: 18px; left: 18px; border-width: 0 0 4px 4px; border-radius: 0 0 0 14px; }
.scan-line { position: absolute; inset-inline: 12%; height: 2px; top: 15%; background: linear-gradient(90deg, transparent, var(--brass-2), transparent);
  box-shadow: 0 0 12px var(--brass-2); animation: scan-move 2.2s ease-in-out infinite alternate; }
@keyframes scan-move { to { top: 85%; } }
.scan-msg { text-align: center; margin: 0; }
.scan-wait { display: grid; justify-items: center; gap: 14px; padding: 40px 0; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--hair-2); border-top-color: var(--brand); animation: ptr-spin .8s linear infinite; }
.scan-result { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 16px; max-width: 420px; }
.scan-result h2 { font-family: var(--f-display); margin: 10px 0 0; font-size: 1.5rem; }
.scan-result p { color: var(--ink-2); margin: 0 0 14px; }
.scan-badge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: #fff; animation: pop-in .5s var(--ease-spring) both; }
.scan-badge svg { width: 48px; height: 48px; stroke-width: 2.6; }
.scan-result.ok .scan-badge { background: var(--c-green); box-shadow: 0 0 0 10px color-mix(in srgb, var(--c-green) 18%, transparent), 0 20px 40px -14px var(--c-green); }
.scan-result.bad .scan-badge { background: var(--bad); box-shadow: 0 0 0 10px var(--bad-soft); }
.scan-result.ok .scan-badge svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; } }

/* ---------------------------------------------------------- مؤشر الثقة */
.trust { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; cursor: help; }
.trust i { --p: 100; width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(currentColor calc(var(--p) * 3.6deg), var(--hair-2) 0); }
.trust.high { color: var(--ok); background: var(--ok-soft); }
.trust.mid { color: var(--warn); background: var(--warn-soft); }
.trust.low { color: var(--bad); background: var(--bad-soft); }
.trust-why { margin: 6px 0 0; padding-inline-start: 18px; font-size: .8rem; color: var(--ink-2); display: grid; gap: 2px; }
.trust-why li::marker { color: var(--warn); }
.btn[hidden] { display: none; }

/* ---------------------------------------------------------- التحقق بخطوتين */
.otp { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem; letter-spacing: .35em; text-align: center; font-weight: 700; }
.otp-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); margin-bottom: 4px; }
.otp-head svg { width: 28px; height: 28px; color: var(--brand); flex: none; }
.enroll-steps ol { margin: 0 0 14px; padding-inline-start: 20px; display: grid; gap: 8px; line-height: 1.7; }
.enroll-qr { list-style: none; justify-self: center; width: 200px; padding: 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); margin: 4px 0; }
.enroll-qr svg { width: 100%; height: auto; display: block; }
.enroll-steps .row .otp { flex: 1; }
.secret { padding: 2px 8px; border-radius: 8px; background: var(--paper-2); font-size: .85rem; user-select: all; }
.enroll-done { display: grid; gap: 14px; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recovery code { padding: 10px; border-radius: 10px; background: var(--paper-2); text-align: center; font-size: 1rem; font-weight: 700; letter-spacing: .08em; user-select: all; }
.sec-h { margin: 0 0 10px; font-size: .95rem; }
.badge svg { width: 12px; height: 12px; }

/* ---------------------------------------------------------- محاكي السياسة */
.sim { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.sim-controls { display: grid; gap: 14px; position: sticky; top: 96px; }
.sim-results { display: grid; gap: 18px; transition: opacity .2s; }
.sim-results.refetch { opacity: .55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--hair-2); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--brand); }
.range b { min-width: 74px; text-align: center; font-size: .86rem; }
.sim-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.sim-tile { display: grid; gap: 8px; padding: 16px 18px; }
.sim-tile .k-top { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.sim-vals { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sim-vals .now { color: var(--ink-3); font-size: .95rem; text-decoration: line-through; text-decoration-color: var(--hair-2); }
.sim-vals .arrow { color: var(--ink-3); }
.sim-vals b { font-family: var(--f-display); font-size: 1.5rem; }
.sim-delta { font-size: .8rem; font-weight: 700; color: var(--brand); }
.sim-delta.same { color: var(--ink-3); font-weight: 500; }
.sim-hint { grid-column: 1 / -1; }
.div-bars { display: grid; gap: 6px; }
.div-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 92px; align-items: center; gap: 10px; font-size: .84rem; }
.div-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.div-track { position: relative; height: 16px; }
.div-mid { position: absolute; inset-block: -3px; inset-inline-start: 50%; width: 1px; background: var(--hair-2); }
.div-bar { position: absolute; top: 2px; height: 12px; border-radius: 4px; animation: col-grow-x .5s var(--ease) both; }
.div-bar.gain { inset-inline-end: 50%; background: var(--c-green); border-radius: 4px 0 0 4px; transform-origin: right; }
.div-bar.loss { inset-inline-start: 50%; background: var(--c-red); border-radius: 0 4px 4px 0; transform-origin: left; }
[dir="rtl"] .div-bar.gain { border-radius: 4px 0 0 4px; }
@keyframes col-grow-x { from { transform: scaleX(0); } }
.div-val { text-align: end; color: var(--ink-2); }
.legend-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--ink-2); }
.legend-dot::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.gain::before { background: var(--c-green); }
.legend-dot.loss::before { background: var(--c-red); }
@media (max-width: 960px) { .sim { grid-template-columns: minmax(0, 1fr); } .sim-controls { position: static; } }
@media (max-width: 560px) { .div-row { grid-template-columns: 84px 1fr 76px; } }
.brand b { white-space: nowrap; font-size: 1.12rem; letter-spacing: -.01em; }
.brand small { white-space: nowrap; }

/* ---------------------------------------------------------- احتفال لوحة الشرف */
.celebrate { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brass) 22%, var(--card)), var(--card) 70%); border-color: color-mix(in srgb, var(--brass) 40%, transparent); }
.celebrate h2 { margin: 2px 0 8px; font-family: var(--f-display); font-size: 1.15rem; }
.celebrate-medal { font-size: 2.6rem; line-height: 1; animation: pop-in .6s var(--ease-spring) both; }
.celebrate-places { display: flex; flex-wrap: wrap; gap: 6px; }
.confetti { position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; z-index: 2; }
.brief-preview { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--hair); }
.brief-preview p { margin: 0; line-height: 1.7; }
.approvals { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.approval-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.approval-ico svg { width: 20px; height: 20px; }
.toast.warn { background: var(--warn); color: #fff; }
.sessions { display: grid; gap: 4px; }
.session { padding: 8px 0; border-bottom: 1px dashed var(--hair-2); flex-wrap: nowrap; }
.session svg { flex: none; color: var(--ink-3); }
.pulse-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--brand) 35%, transparent); background: var(--brand-soft); }
.pulse-banner > div:nth-child(2) { flex: 1; min-width: 180px; }
.pulse-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 var(--brand); animation: pulse-ring 1.6s infinite; flex: none; }
@keyframes pulse-ring { 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }

/* الطلعات والمهام */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; max-height: 210px;
  overflow: auto; padding: 10px 12px; border: 1px solid var(--hair-2); border-radius: 12px; }
.task-item { padding: 12px 0; border-top: 1px dashed var(--hair-2); }
.task-item:first-of-type { border-top: 0; }
.req .actions .icon-btn { width: 34px; height: 34px; }
.msg-card { border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.msg { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2, rgba(53, 70, 121, .06)); }
.msg + .msg { margin-top: 8px; }
.msg.praise { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.msg.notice { background: color-mix(in srgb, var(--warn) 14%, transparent); }

/* ---------------------------------------------------------- الجولة التعريفية */
.tour { position: fixed; inset: 0; z-index: 95; opacity: 0; transition: opacity .3s var(--ease); }
.tour.on { opacity: 1; }
.tour-shield { position: absolute; inset: 0; }
.tour-spot {
  position: fixed; left: 0; top: 0; width: 0; height: 0; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(9, 13, 28, .62), 0 0 0 2px var(--brass-2), 0 0 32px 4px rgba(216, 176, 106, .45);
  transition: transform .5s var(--ease), width .5s var(--ease), height .5s var(--ease), border-radius .5s var(--ease);
}
.tour-spot::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--brass-2);
  animation: tour-ring 2.2s var(--ease) infinite;
}
.tour-spot.off { box-shadow: 0 0 0 9999px rgba(9, 13, 28, .66); }
.tour-spot.off::after { display: none; }
@keyframes tour-ring { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.06); } }

.tour-card {
  position: fixed; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--hair-2); border-radius: 24px;
  padding: 20px 22px 18px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  display: grid; gap: 10px; outline: none;
  transition: left .45s var(--ease), top .45s var(--ease), opacity .2s;
}
.tour-card.wait { opacity: .55; }
.tour-card.swap > * { animation: tour-in .42s var(--ease) both; }
.tour-card.swap > *:nth-child(2) { animation-delay: .03s; }
.tour-card.swap > *:nth-child(3) { animation-delay: .06s; }
.tour-card.swap > *:nth-child(n+4) { animation-delay: .09s; }
@keyframes tour-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tour-card[data-at="center"] { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-card[data-at="bottom"], .tour-card[data-at="top"] { inset-inline: 12px; width: auto; left: auto; top: auto; }
.tour-card[data-at="bottom"] { bottom: calc(12px + env(safe-area-inset-bottom)); }
.tour-card[data-at="top"] { top: calc(12px + env(safe-area-inset-top)); }
.tour-card h3 { margin: 0; font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; }
.tour-card p { margin: 0; color: var(--ink-2); line-height: 1.7; font-size: .93rem; }
.tour-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.tour-x:hover { background: var(--hair); color: var(--ink); }
.tour-head { display: flex; align-items: center; gap: 10px; padding-inline-end: 36px; }
.tour-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--brass); background: linear-gradient(140deg, rgba(216, 176, 106, .22), rgba(216, 176, 106, .06)); border: 1px solid rgba(216, 176, 106, .35); }
.tour-count { font-size: .76rem; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.tour-list { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 8px; }
.tour-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding: 10px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--hair); font-size: .88rem; }
.tour-list b { color: var(--ink); white-space: nowrap; }
.tour-list span { color: var(--ink-2); line-height: 1.6; }
.tour-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.tour-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--ink-2); padding: 5px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--hair); }
.tour-legend i { width: 12px; height: 12px; border-radius: 4px; }
.tour-legend .ok i { background: var(--ok); } .tour-legend .warn i { background: var(--warn); }
.tour-legend .bad i { background: var(--bad); } .tour-legend .off i { background: transparent; border: 1.5px dashed var(--ink-3); }
.tour-tip { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--brand-soft); color: var(--ink-2); font-size: .86rem; line-height: 1.65; }
.tour-tip svg { flex: none; margin-top: 3px; color: var(--brand); }
.tour-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tour-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: var(--hair-2); cursor: pointer; transition: width .35s var(--ease), background .25s; }
.tour-dot[aria-current="step"] { width: 24px; background: var(--brass); }
.tour-dot:hover { background: var(--ink-3); }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tour-foot .btn.brand { margin-inline-start: auto; }
.tour-foot .btn[disabled] { visibility: hidden; }
.tour-keys { font-size: .72rem; color: var(--ink-3); }
@media (pointer: coarse), (max-width: 640px) { .tour-keys { display: none; } }

.tour-card.hero { width: min(460px, calc(100vw - 24px)); text-align: center; justify-items: center; padding: 30px 28px 22px; gap: 12px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(216, 176, 106, .16), transparent 60%), var(--card); }
.tour-card.hero h2 { margin: 4px 0 0; font-family: var(--f-display); font-size: 1.55rem; font-weight: 800; }
.tour-card.hero .tour-foot { width: 100%; margin-top: 10px; }
.tour-card.hero .tour-list { width: 100%; text-align: start; }
.tour-mark { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; position: relative;
  background: linear-gradient(150deg, var(--rail), #24335f); color: var(--brass-2); box-shadow: 0 18px 40px -16px rgba(18, 26, 48, .6); }
.tour-mark img { width: 52px; height: 52px; border-radius: 14px; }
.tour-mark::before { content: ""; position: absolute; inset: -8px; border-radius: 30px; border: 1px solid rgba(216, 176, 106, .45); animation: tour-ring 2.6s var(--ease) infinite; }
.tour-card.done .tour-mark { background: linear-gradient(150deg, #2f6f5e, #1f4d41); color: #fff; animation: tour-pop .6s var(--ease-spring) both; }
@keyframes tour-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tour-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tour-chips span { font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--hair-2); color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .tour-spot::after, .tour-mark::before { animation: none; } }

/* ---------------------------------------------------------- محادثة الطلب ومرفقاته */
.thread { display: grid; gap: 6px; margin-top: 8px; }
.thread-msg { padding: 8px 12px; border-radius: 12px; font-size: .86rem; line-height: 1.6; max-width: 640px; }
.thread-msg.admin { background: var(--warn-soft); border-inline-start: 3px solid var(--warn); }
.thread-msg.employee { background: var(--brand-soft); border-inline-start: 3px solid var(--brand); }
.thread-meta { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.attach-row { gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--card-2); border: 1px solid var(--hair-2); color: var(--brand); text-decoration: none; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attach-chip:hover { border-color: var(--brand); }

/* ---------------------------------------------------------- الدوام الحيّ في بطاقة اليوم */
.live-shift { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .86rem; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.live-shift b { font-size: 1.05rem; }
.live-shift .spacer { flex: 1; }
.live-shift > span.num { color: color-mix(in srgb, var(--tc-fg, var(--ink)) 70%, transparent); font-size: .8rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: live-ping 1.8s var(--ease) infinite; }
.live-shift.done .live-dot { background: var(--brass-2, #d6b46a); animation: none; }
@keyframes live-ping { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.live-track { flex-basis: 100%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.live-track i {
  display: block; height: 100%; border-radius: inherit; margin-inline-start: 0;
  background: linear-gradient(270deg, #4ade80, var(--brass-2, #d6b46a)); transition: width 1.2s var(--ease);
  background-size: 200% 100%; animation: live-flow 3s linear infinite;
}
@keyframes live-flow { to { background-position: -200% 0; } }

/* ---------------------------------------------------------- جاهزية الشهر */
.readiness.blocked { border-color: color-mix(in srgb, var(--bad) 35%, var(--hair)); }
.readiness.ready { border-color: color-mix(in srgb, var(--ok) 35%, var(--hair)); }
.readiness h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.ready-list { display: grid; gap: 6px; }
.ready-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); font-size: .88rem; }
.ready-item > div { flex: 1; min-width: 0; }
.ready-item.done { background: transparent; padding-block: 4px; color: var(--ink-3); }
.ready-item.done b { font-weight: 500; }
.ready-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ready-item.block .ready-ico { background: var(--bad-soft); color: var(--bad); }
.ready-item.warn .ready-ico { background: var(--warn-soft); color: var(--warn); }
.ready-item.done .ready-ico { background: var(--ok-soft); color: var(--ok); }
.ready-n { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; }
.ready-item.block .ready-n { color: var(--bad); }
.ready-item.warn .ready-n { color: var(--warn); }
.ready-names { font-size: .76rem; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------- تعديل اليوم (الإدارة) */
dialog.modal:has(.dayedit) { width: min(640px, calc(100vw - 24px)); }
.dayedit { display: grid; gap: 16px; }
.de-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.de-summary > div { background: var(--paper-2); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.de-summary small { color: var(--ink-3); font-size: .74rem; }
.de-summary b { font-family: var(--f-display); font-size: 1.25rem; }
.de-summary .voided { font-size: .74rem; }
.de-sec h4 { margin: 0 0 8px; font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.de-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.de-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--paper-2); font-size: .78rem; color: var(--ink-2); }
.de-chip.manual { background: var(--info-soft); color: var(--info); }
.de-items { display: grid; gap: 6px; }
.de-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--hair); font-size: .84rem; }
.de-item .spacer { flex: 1; }
.de-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.de-tool {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--hair-2); background: var(--card); color: var(--ink); font: inherit; font-size: .84rem; font-weight: 600; text-align: start;
  transition: border-color .2s, background .2s, transform .15s var(--ease-spring);
}
.de-tool svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.de-tool:hover { border-color: var(--ink-3); }
.de-tool:active { transform: scale(.97); }
.de-tool.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
.de-form:empty { display: none; }
.de-form { margin-top: 10px; padding: 14px; border-radius: 16px; background: var(--paper-2); animation: rise .35s var(--ease) both; }
.de-fields { display: grid; gap: 10px; }
.de-fields .muted { font-size: .78rem; }

/* ---------------------------------------------------------- جداول الدوام */
.sched-list { display: grid; gap: 8px; }
.sched-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hair); flex-wrap: wrap; }
.sched-item > div:nth-child(2) { flex: 1; min-width: 160px; }
.sched-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.sched-times { font-family: var(--f-display); font-weight: 600; }
.sched-times small { font-weight: 400; color: var(--ink-3); }

/* ---------------------------------------------------------- الإجازات والفعاليات في التقويم */
:root { --leave: #7c5cc4; --leave-soft: color-mix(in srgb, #8b6ad6 16%, var(--card)); --event: #d9822b; }
.cal .d.leave { background: var(--leave-soft); color: var(--leave); }
.cal .d.leave.pending { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--leave) 55%, transparent); color: var(--leave); }
.cal .d .d-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
/* نص عربي (إجازة بسببها، اسم عطلة، فعالية): سطران قصيران بدل قصّ من الجهة الخطأ */
.cal .d .d-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; overflow-wrap: anywhere; }
.cal .d.ev { box-shadow: inset 0 3px 0 var(--event); }
.cal .d .ev-mark { position: absolute; top: 6px; left: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--event);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--event) 22%, transparent); }
.badge.leave-badge { background: var(--leave-soft); color: var(--leave); }
.badge.ev-badge { background: color-mix(in srgb, var(--event) 15%, var(--card)); color: var(--event); }
.ev-card { border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--event) 10%, var(--card));
  border-inline-start: 3px solid var(--event); display: grid; gap: 4px; }
.ev-card .num { font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 200px; overflow: auto;
  padding: 10px; border-radius: 12px; background: var(--paper-2); }

/* ---------------------------------------------------------- تبويبات صفحة الموظف */
.me-tabs {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 5px;
  border-radius: 18px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
}
.me-tabs button {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 4px; border: 0; border-radius: 14px; background: none;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background .25s, color .2s;
}
.me-tabs button svg { width: 21px; height: 21px; }
.me-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5); }
.me-tabs .me-dot { position: absolute; top: 4px; inset-inline-end: 14%; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--bad); color: #fff; font-size: .66rem; font-style: normal; display: grid; place-items: center; }
.me-pane { display: grid; gap: 16px; max-width: 760px; width: 100%; margin-inline: auto; animation: rise .35s var(--ease) both; }
.me-tabs { max-width: 760px; width: 100%; margin-inline: auto; }
.me-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.me-quick .btn { height: 48px; }

/* ---------------------------------------------------------- أنماط متكررة (لوحة اليوم) */
.pattern-list { display: grid; gap: 6px; }
.pattern-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink);
  background: var(--paper-2); font-size: .88rem; transition: background .2s, transform .15s var(--ease-spring); }
.pattern-item:hover { transform: translateX(-3px); }
.pattern-item.late svg { color: var(--warn); }
.pattern-item.no_out svg { color: var(--ink-3); }
.pattern-item.absent svg { color: var(--bad); }
.pattern-more { justify-self: center; margin-top: 2px; }
.pattern-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .pattern-item { padding: 8px 10px; font-size: .82rem; } .pattern-item span { white-space: nowrap; } }

/* مربعات لوحة اليوم: تفتح قائمة الأسماء */
.kpi-link { cursor: pointer; }
.kpi-link:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.kpi-people { display: grid; gap: 6px; max-height: min(60vh, 520px); overflow: auto; margin-top: 8px; min-width: min(420px, 80vw); }
.kpi-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--paper-2);
  color: var(--ink); text-decoration: none; }
.kpi-person > div { flex: 1; min-width: 0; display: grid; }
.kpi-person small { color: var(--ink-3); font-size: .78rem; }
.kpi-person .kpi-val { font-size: .9rem; white-space: nowrap; }
.welcome-msg { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: .9rem; line-height: 1.7; padding: 14px 16px;
  border-radius: 14px; background: var(--paper-2); border: 1px solid var(--hair); user-select: all; }

/* ---------- كرت النقاط: الأرقام الأصلية ---------- */
.pt-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.pt-totals > div { background: var(--paper-2); border-radius: 12px; padding: 8px 10px; display: grid; gap: 2px; }
.pt-totals small { font-size: .72rem; color: var(--ink-3); }
.pt-totals b { font-family: var(--f-display); font-size: 1.25rem; }
.pt-totals .red b, .pt-days .red { color: var(--bad); }
.pt-totals .green b, .pt-days .green { color: var(--ok); }
.pt-ledger { margin-bottom: 12px; font-size: .85rem; }
.pt-ledger summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 4px 0; }
.pt-days { display: grid; gap: 2px; margin-top: 6px; }
.pt-days > div { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--hair-2); }
.pt-days > div > span { flex: 1; }
.kpi-person .av { width: 34px; height: 34px; font-size: .85rem; flex: none; }
.empty-salary { display: flex; gap: 12px; align-items: flex-start; }
.empty-salary .muted { margin-top: 4px; line-height: 1.7; }

.time24 { display: inline-flex; align-items: center; gap: 6px; direction: ltr; width: 100%; }
.time24 select.input { flex: 1; min-width: 0; text-align: center; text-align-last: center; padding-inline: 8px; }
.time24 b { color: var(--ink-3); }

/* «من اعتمد؟»: بطاقة لكل مستخدم */
.actor-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.actor-card { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair);
  background: var(--paper-2); color: var(--ink); cursor: pointer; font: inherit; }
.actor-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.actor-card .num { font-size: .86rem; color: var(--ink-2); }
.actor-card small.warn { color: var(--warn); font-weight: 600; }
.actor-card small.ok { color: var(--ok); }
