/* Muster — نظام التصميم
   هادي، واضح، بأهداف لمس كبيرة. الألوان: هوية خضراء-مزرقّة عميقة + ألوان حالة ثابتة المعنى:
   أخضر = بالدوام/تمام · كهرماني = استراحة/انتباه · أحمر = مشكلة · أزرق = إجازة/معلومة · رمادي = خارج/عطلة */
:root {
  --bg: #f4f6f7; --surface: #ffffff; --surface-2: #f0f3f4; --surface-3: #e8edee;
  --text: #0f1b1d; --text-2: #4f6164; --text-3: #8696a0; --line: #e2e8ea; --line-2: #d3dcdf;
  --brand: #0e5b60; --brand-2: #138088; --brand-3: #1aa3a3; --brand-soft: #e3f1f1; --brand-ink: #083b3e; --on-brand: #ffffff;
  --green: #15803d; --green-soft: #e5f4ea; --amber: #b45309; --amber-soft: #fdf1df; --red: #b42318; --red-soft: #fdeceb;
  --blue: #1d4ed8; --blue-soft: #e8effd; --slate: #475569; --slate-soft: #eef1f5; --ink: #1f2937;
  --r-s: 10px; --r: 16px; --r-l: 22px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --sh-2: 0 6px 20px rgba(16, 24, 40, .07), 0 2px 6px rgba(16, 24, 40, .04);
  --sh-3: 0 18px 48px rgba(16, 24, 40, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: system-ui, -apple-system, "SF Arabic", "Segoe UI", "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1112; --surface: #111a1c; --surface-2: #172224; --surface-3: #1e2b2d;
    --text: #e8eff0; --text-2: #a3b4b7; --text-3: #6f8386; --line: #223033; --line-2: #2c3c3f;
    --brand: #2aa6a6; --brand-2: #37bcbc; --brand-3: #5fd4cf; --brand-soft: #12302f; --brand-ink: #062a2b; --on-brand: #04201f;
    --green: #4ade80; --green-soft: #0f2a1a; --amber: #fbbf24; --amber-soft: #2d230f; --red: #f87171; --red-soft: #321719;
    --blue: #7aa2ff; --blue-soft: #151f38; --slate: #94a3b8; --slate-soft: #1a2328; --ink: #e5e7eb;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 6px 20px rgba(0, 0, 0, .35); --sh-3: 0 18px 48px rgba(0, 0, 0, .55);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 16px; line-height: 1.55; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
svg.i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 13.5px; } .xs { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.nowrap { flex-wrap: nowrap; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hide { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── تحميل ── */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── الأزرار ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 15px; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.success { background: var(--green-soft); color: var(--green); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.xs { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 9px; gap: 5px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.btn.icon.sm { width: 34px; min-height: 34px; }

/* ── الحبوب والشارات ── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 650;
  background: var(--slate-soft); color: var(--slate); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.pill.green { background: var(--green-soft); color: var(--green); } .pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); } .pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--red); background: var(--red-soft); padding: 2px 8px; border-radius: 8px; }
.tag.amber { color: var(--amber); background: var(--amber-soft); }

/* ── البطاقات ── */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 16px; border: 1px solid var(--line); }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { margin: 0; font-size: 16.5px; font-weight: 750; }
.card-h .sub { font-size: 13px; color: var(--text-2); }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-3); letter-spacing: .2px; margin: 18px 4px 8px; }

/* ── التنبيهات ── */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; box-shadow: var(--sh-1); }
.alert .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.alert b { display: block; font-size: 15px; }
.alert .t { font-size: 14px; color: var(--text-2); }
.alert.amber .ic { background: var(--amber-soft); color: var(--amber); }
.alert.red .ic { background: var(--red-soft); color: var(--red); }
.alert.blue .ic { background: var(--blue-soft); color: var(--blue); }
.alert.brand .ic { background: var(--brand-soft); color: var(--brand); }
.steps { margin: 8px 0 0; padding: 0 18px 0 0; font-size: 14px; color: var(--text-2); }
.steps li { margin: 5px 0; }

/* ── النماذج ── */
.field { margin: 12px 0; }
.field > label { display: block; font-size: 13.5px; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px;
  transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.field .hint { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.input-wrap { position: relative; }
.input-wrap .btn.icon { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); background: transparent; color: var(--text-3); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14.5px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(-18px); }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 8px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── المقطع (segmented) ── */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 650; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.month-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-switch b { font-size: 16px; }

/* ── الإحصائيات ── */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r); padding: 12px; }
.stat .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--text-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--sh-1); }
.kpi .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.kpi .v { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--text-2); }
.kpi.green .ic { background: var(--green-soft); color: var(--green); } .kpi.amber .ic { background: var(--amber-soft); color: var(--amber); }
.kpi.slate .ic { background: var(--slate-soft); color: var(--slate); } .kpi.red .ic { background: var(--red-soft); color: var(--red); }
.kpi.brand .ic { background: var(--brand-soft); color: var(--brand); }

/* ── القوائم ── */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.li .t { font-weight: 650; }
.li .s { font-size: 13px; color: var(--text-2); }
.li.click { cursor: pointer; border-radius: 12px; }
.li.click:hover { background: var(--surface-2); }
.empty { text-align: center; padding: 26px 10px; color: var(--text-2); }
.empty .ic { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }

/* ── الصورة الرمزية ── */
.avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; flex: none; }

/* ── الجداول ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: right; white-space: nowrap; }
th { background: var(--surface-2); color: var(--text-2); font-weight: 650; font-size: 12.5px; position: sticky; top: 0; }
tbody tr { border-top: 1px solid var(--line); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
tfoot td { border-top: 2px solid var(--line-2); font-weight: 800; background: var(--surface-2); }

/* ── الأوراق (modal / bottom sheet) ── */
.overlay { position: fixed; inset: 0; background: rgba(8, 15, 17, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .18s; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--sh-3); animation: up .26s var(--ease); }
.sheet .handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 10px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sheet-h h2 { margin: 0; font-size: 18px; font-weight: 800; }
.sheet .intro { font-size: 14px; color: var(--text-2); margin: 4px 0 8px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; }
@media (min-width: 720px) { .overlay { align-items: center; } .sheet { border-radius: var(--r-xl); padding-top: 18px; } .sheet .handle { display: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ── الإشعار ── */
#toast { position: fixed; left: 50%; bottom: calc(156px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #101a1c; color: #fff;
  padding: 11px 16px; border-radius: 14px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
  z-index: 60; max-width: min(92vw, 420px); display: flex; gap: 8px; align-items: center; box-shadow: var(--sh-3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast svg { color: #6ee7b7; }

/* ═════════ الدخول ═════════ */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; background:
  radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
  radial-gradient(900px 400px at 0% 110%, color-mix(in srgb, var(--brand-3) 14%, transparent), transparent 60%), var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.brand-head { text-align: center; margin-bottom: 22px; }
.brand-head .logo { width: 64px; height: 64px; margin: 0 auto 12px; filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--brand) 35%, transparent)); }
.brand-head h1 { margin: 0; font-size: 30px; font-weight: 850; letter-spacing: .5px; direction: ltr; }
.brand-head p { margin: 2px 0 0; color: var(--text-2); }
.auth .card { padding: 20px; border-radius: var(--r-xl); box-shadow: var(--sh-2); }
.install-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.install-step .n { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; flex: none; }
.install-step .ki { display: inline-flex; vertical-align: middle; background: var(--surface-2); border-radius: 7px; padding: 2px 5px; margin: 0 2px; color: var(--blue); }

/* ═════════ الموظف ═════════ */
.emp { max-width: 560px; margin: 0 auto; padding: 0 16px calc(100px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 2px 12px; }
.topbar .hello { font-size: 13.5px; color: var(--text-2); }
.topbar .name { font-size: 19px; font-weight: 800; }
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 18px 18px 16px; color: #fff;
  background: linear-gradient(135deg, var(--brand-ink) 0%, var(--brand) 55%, var(--brand-2) 100%); box-shadow: 0 14px 32px color-mix(in srgb, var(--brand) 30%, transparent); }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; left: -80px; top: -120px; background: rgba(255, 255, 255, .07); }
.hero .clock { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: .5px; direction: ltr; text-align: right; }
.hero .date { opacity: .8; font-size: 14px; margin-top: 4px; }
.hero .status { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 700; font-size: 14.5px; }
.hero .status .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.hero .status.in .dot { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); animation: pulse 2s infinite; }
.hero .status.break .dot { background: #fbbf24; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
@media (prefers-color-scheme: dark) {
  /* بالوضع الليلي الهوية فاتحة؛ البطاقة الرئيسية تبقى غامقة حتى النص الأبيض يبقى واضح */
  .hero { background: linear-gradient(135deg, #062a2b 0%, #0b4a4e 55%, #11706f 100%); box-shadow: 0 14px 32px rgba(0, 0, 0, .45); }
}
.hero .meta { display: flex; gap: 18px; margin-top: 12px; font-size: 13.5px; opacity: .92; }
.hero .meta b { display: block; font-size: 17px; opacity: 1; }
.hero-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: relative; z-index: 1; }
.ring { width: 104px; height: 104px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.15; }
.ring .c b { font-size: 18px; font-weight: 800; display: block; }
.ring .c span { font-size: 11.5px; opacity: .8; }

.pad { margin-top: 14px; background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--sh-1); padding: 22px 18px 18px; text-align: center; }
.punch { --c: var(--green); position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0; margin: 4px auto 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 82%, #fff), var(--c)); color: #fff;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--c) 38%, transparent), inset 0 -6px 14px rgba(0, 0, 0, .12); transition: transform .15s var(--ease); }
.punch::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--c) 25%, transparent); }
.punch:active { transform: scale(.95); }
.punch .in { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 19px; }
.punch svg.i { width: 34px; height: 34px; }
.punch.k-in { --c: #16a34a; } .punch.k-break_start { --c: #d97706; } .punch.k-break_end { --c: var(--brand-2); } .punch.k-out { --c: #334155; }
.punch:disabled { opacity: .7; }
.pad .second { margin-top: 18px; }
.pad .hint { margin-top: 14px; font-size: 13.5px; color: var(--text-2); }
.locline { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }

.timeline { position: relative; padding-right: 6px; }
.tl { display: flex; align-items: center; gap: 12px; padding: 8px 0; position: relative; }
.tl:not(:last-child)::after { content: ""; position: absolute; right: 17px; top: 46px; bottom: -6px; width: 2px; background: var(--line); }
.tl .dot { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tl .dot.k-in { background: var(--green-soft); color: var(--green); } .tl .dot.k-break_start { background: var(--amber-soft); color: var(--amber); }
.tl .dot.k-break_end { background: var(--brand-soft); color: var(--brand); } .tl .dot.k-out { background: var(--slate-soft); color: var(--slate); }
.tl .when { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--line); }
.tabbar .in { display: flex; width: 100%; max-width: 560px; }
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 12px; font-weight: 650; color: var(--text-3); }
.tabbar button .ib { width: 52px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background .2s; }
.tabbar button.on { color: var(--brand); }
.tabbar button.on .ib { background: var(--brand-soft); }

/* التقويم */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .h { text-align: center; font-size: 12px; color: var(--text-3); font-weight: 700; padding-bottom: 2px; }
.cal .d { aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 14px; font-weight: 700; border: 1px solid transparent; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal .d.empty-cell { background: transparent; cursor: default; }
.cal .d .s { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.cal .d.today { border-color: var(--brand); }
.cal .d.st-present .s, .cal .d.st-in_progress .s { background: var(--green); }
.cal .d.st-absent .s, .cal .d.st-open .s { background: var(--red); }
.cal .d.st-leave .s { background: var(--blue); } .cal .d.st-not_yet .s { background: var(--amber); }
.cal .d.st-off_worked .s { background: var(--brand); }
.cal .d.st-off, .cal .d.st-upcoming, .cal .d.st-not_employed, .cal .d.st-no_terms { color: var(--text-3); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* الراتب */
.payslip .net { text-align: center; padding: 8px 0 14px; }
.payslip .net .l { color: var(--text-2); font-size: 14px; }
.payslip .net .v { font-size: 34px; font-weight: 850; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.payslip .net .v small { font-size: 15px; font-weight: 700; color: var(--text-2); margin-inline-start: 4px; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line-2); font-size: 15px; }
.line .a { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.minus .a { color: var(--red); } .line.plus .a { color: var(--green); }
.line.void { opacity: .5; text-decoration: line-through; }
.line .why { font-size: 13px; color: var(--text-2); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bar.green > i { background: var(--green); } .bar.amber > i { background: #d97706; }

.fab { position: fixed; left: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 15; box-shadow: var(--sh-3); border-radius: 16px; min-height: 52px; padding: 0 18px; }

/* ═════════ المدير ═════════ */
.shell { min-height: 100dvh; }
.side { display: none; }
.mtop { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.mtop .bar1 { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 6px; }
.mtabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; }
.mtabs::-webkit-scrollbar { display: none; }
.mtabs button { border: 0; background: var(--surface-2); border-radius: 999px; padding: 8px 14px; white-space: nowrap; font-weight: 650; font-size: 14px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.mtabs button.on { background: var(--brand); color: var(--on-brand); }
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark svg.logo { width: 32px; height: 32px; }
.wordmark b { font-size: 19px; font-weight: 850; direction: ltr; letter-spacing: .3px; }
.wordmark span { font-size: 12px; color: var(--text-3); display: block; line-height: 1; }
.main { padding: 16px 14px 60px; max-width: 1240px; margin: 0 auto; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-h h1 { margin: 0; font-size: 24px; font-weight: 850; }
.page-h p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar select, .toolbar input { min-height: 40px; padding: 6px 10px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14.5px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 650; color: var(--text-2); }
.chips button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person { position: relative; overflow: hidden; }
.person::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.person.st-in::before { background: var(--green); } .person.st-break::before { background: #d97706; }
.person .top { display: flex; gap: 12px; align-items: center; }
.person .nm { font-weight: 750; font-size: 15.5px; }
.person .since { font-size: 13px; color: var(--text-2); }
.person .mid { margin: 12px 0 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.person .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.review-grid { display: grid; gap: 12px; }
.item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ua { font-size: 12px; color: var(--text-3); direction: ltr; text-align: right; word-break: break-all; }
.settings-nav { margin-bottom: 14px; overflow-x: auto; max-width: 100%; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .mtop { display: none; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 18px 14px; background: var(--surface); border-inline-end: 1px solid var(--line); }
  .side .wordmark { padding: 4px 8px 20px; }
  .side nav { display: flex; flex-direction: column; gap: 4px; }
  .side nav button { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 11px 12px; border-radius: 12px; font-size: 15px; font-weight: 650; color: var(--text-2); text-align: right; }
  .side nav button:hover { background: var(--surface-2); }
  .side nav button.on { background: var(--brand-soft); color: var(--brand); }
  .side nav button .badge { margin-inline-start: auto; }
  .side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
  .main { padding: 26px 30px 60px; }
  .review-grid { grid-template-columns: 1fr 1fr; }
  .review-grid .wide { grid-column: 1 / -1; }
}
