[hidden] { display: none !important; }
/* ============ نظام الحضور السحابي - التصميم ============ */
:root {
  --bg: #f4f6f8; --card: #ffffff; --card-2: #f8fafb; --text: #1f2a37; --muted: #6b7785; --line: #e4e8ed;
  --primary: #2f6f6a; --primary-2: #275d59; --primary-soft: #e2efed; --on-primary: #fff;
  --ok: #3b8a66; --ok-soft: #e4f3eb; --warn: #b07418; --warn-soft: #fcf2df; --bad: #c0504a; --bad-soft: #fbe8e7;
  --info: #4a6fa5; --info-soft: #e7edf7; --violet: #7a6cc4; --violet-soft: #eeebf8;
  --k-morning: #f0c36e; --k-evening: #8ea7e6; --k-night: #6f72b0; --k-off: #d5dae1;
  --side: #17262c; --side-text: #b9c6cc; --side-active: #2f6f6a;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --ease: cubic-bezier(.2,.7,.2,1);
}
[data-theme="dark"] {
  --bg: #0f1418; --card: #171e24; --card-2: #1c242b; --text: #e2e8ed; --muted: #93a0ac; --line: #26313a;
  --primary: #5aa9a0; --primary-2: #6cbab1; --primary-soft: #1d3331; --on-primary: #0f1418;
  --ok: #5bbd8e; --ok-soft: #173126; --warn: #e0a64a; --warn-soft: #33281a; --bad: #e07a73; --bad-soft: #3a1f1e;
  --info: #7fa3dc; --info-soft: #1b2638; --violet: #a597e8; --violet-soft: #26213b;
  --k-off: #39424c; --side: #0b1013; --side-text: #9aa8b2; --side-active: #2b5f5a;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.6; transition: background .25s var(--ease), color .25s var(--ease); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 21px; margin: 0 0 2px; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted, small { color: var(--muted); }
.ic { vertical-align: -3px; flex-shrink: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ===== التخطيط ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: var(--side); color: var(--side-text); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; }
.brand { color: #fff; font-weight: 700; font-size: 15.5px; padding: 4px 10px 16px; display: flex; gap: 10px; align-items: center; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #3b8a80, #2f6f6a); display: grid; place-items: center; color: #fff; }
.sidebar nav a { display: flex; gap: 10px; align-items: center; color: var(--side-text); padding: 8px 12px; border-radius: 9px; margin-bottom: 1px; font-size: 14px; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--side-active); color: #fff; }
.sidebar nav a .badge { margin-inline-start: auto; }
.sidebar .section { font-size: 11.5px; letter-spacing: .3px; color: #6f8189; padding: 14px 12px 4px; }
.side-sub { margin: 14px 4px 0; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: 12.5px; }
.side-sub .cd { font-size: 14px; color: #fff; font-weight: 600; direction: ltr; text-align: right; margin-top: 2px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-weight: 700; display: flex; gap: 10px; align-items: center; }
.content { padding: 22px; width: 100%; max-width: 1400px; animation: fadeUp .35s var(--ease); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-grid; place-items: center; cursor: pointer; position: relative; transition: background .15s; }
.icon-btn:hover { background: var(--card-2); text-decoration: none; }
.icon-btn .dot-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; }
.menu-btn { display: none; }

/* ===== البطاقات ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); transition: transform .2s var(--ease); }
.stat:hover { transform: translateY(-2px); }
.stat .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; }
.t-ok .si { background: var(--ok-soft); color: var(--ok); } .t-ok .n { color: var(--ok); }
.t-warn .si { background: var(--warn-soft); color: var(--warn); } .t-warn .n { color: var(--warn); }
.t-bad .si { background: var(--bad-soft); color: var(--bad); } .t-bad .n { color: var(--bad); }
.t-info .si { background: var(--info-soft); color: var(--info); } .t-info .n { color: var(--info); }
.t-violet .si { background: var(--violet-soft); color: var(--violet); } .t-violet .n { color: var(--violet); }
.t-pri .si { background: var(--primary-soft); color: var(--primary); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ===== الجداول ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
th { background: var(--card-2); font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--card-2); }
.table-wrap { overflow: auto; border-radius: 10px; }
.table-wrap.tall { max-height: 560px; }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ===== الشارات ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); } .b-info { background: var(--info-soft); color: var(--info); }
.b-mute { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); } .b-violet { background: var(--violet-soft); color: var(--violet); }
.s-present { background: var(--ok-soft); color: var(--ok); } .s-late, .s-early { background: var(--warn-soft); color: var(--warn); }
.s-absent { background: var(--bad-soft); color: var(--bad); } .s-half, .s-missing { background: #fdebdc; color: #b4602a; }
[data-theme="dark"] .s-half, [data-theme="dark"] .s-missing { background: #3a281a; color: #e79a63; }
.s-off, .s-future, .s-pending { background: var(--card-2); color: var(--muted); } .s-working { background: var(--primary-soft); color: var(--primary); } .s-leave { background: var(--info-soft); color: var(--info); } .s-holiday_work { background: var(--violet-soft); color: var(--violet); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }
.dot.on { background: #34c17b; box-shadow: 0 0 0 3px rgba(52,193,123,.18); animation: pulse 2s infinite; } .dot.off { background: #9aa5b1; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-inline-end: 5px; }

/* ===== النماذج ===== */
form.inline { display: inline; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: var(--card); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=color] { padding: 2px; height: 38px; width: 56px; }
.field { margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; margin: 0; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 120px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 15px; border-radius: 9px; border: 1px solid transparent; background: var(--primary); color: var(--on-primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--primary-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.light { background: var(--card); color: var(--text); border-color: var(--line); font-weight: 500; }
.btn.light:hover { background: var(--card-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 5px 13px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; font-size: 13.5px; }
.seg a.active, .seg button.active { background: var(--card); box-shadow: var(--shadow); color: var(--primary); font-weight: 600; text-decoration: none; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--k-off); border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(-16px); }
.opt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt-row:last-child { border-bottom: 0; }
.opt-row .desc { flex: 1; }
.opt-row .desc b { display: block; font-size: 14px; }
.opt-row .desc small { font-size: 12.5px; }
.opt-row .ctl { display: flex; gap: 8px; align-items: center; }
.opt-row .ctl select, .opt-row .ctl input[type=number] { width: auto; min-width: 90px; }

/* ===== التنبيهات ===== */
.alert { padding: 11px 15px; border-radius: 11px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; animation: fadeUp .3s var(--ease); }
.alert.success { background: var(--ok-soft); color: var(--ok); } .alert.error { background: var(--bad-soft); color: var(--bad); } .alert.info { background: var(--info-soft); color: var(--info); }
.sub-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 22px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.sub-banner.expired { background: var(--bad-soft); color: var(--bad); }
.countdown { display: inline-flex; gap: 5px; direction: ltr; }
.countdown span { background: var(--card); border-radius: 7px; padding: 1px 7px; min-width: 42px; text-align: center; border: 1px solid var(--line); }
.countdown b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; } .countdown i { display: block; font-style: normal; font-size: 10px; opacity: .8; }
.impersonate { background: var(--info); color: #fff; padding: 7px 22px; display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.impersonate .btn { background: #fff; color: var(--info); }
.smart-alert { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.smart-alert:last-child { border-bottom: 0; }
.smart-alert .ic { margin-top: 2px; }
.smart-alert.bad .ic { color: var(--bad); } .smart-alert.warn .ic { color: var(--warn); }

/* ===== الإشعار المنبثق ===== */
#toasts { position: fixed; bottom: 18px; left: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 340px; }
.toast { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; gap: 11px; align-items: center; animation: toastIn .45s var(--ease); font-size: 13.5px; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
.toast .face { width: 38px; height: 38px; flex-shrink: 0; }
.toast b { display: block; font-size: 14px; }

/* ===== شريط البصمات ===== */
.ticker { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-behavior: smooth; }
.ticker .pc { flex: 0 0 auto; min-width: 170px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; gap: 9px; align-items: center; animation: slideIn .5s var(--ease); }
.ticker .pc b { display: block; font-size: 13.5px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.ticker .pc small { font-size: 12px; }
.kind-in { color: var(--ok); } .kind-out { color: var(--info); }

/* ===== الرسوم ===== */
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.bars { display: flex; gap: 10px; align-items: flex-end; height: 170px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 4px 4px; overflow: hidden; background: var(--card-2); height: 100%; }
.bars .stack i { display: block; transition: height .6s var(--ease); }
.bars .lbl { font-size: 11.5px; color: var(--muted); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat .hd { font-size: 11px; color: var(--muted); text-align: center; }
.heat .hc { aspect-ratio: 1; border-radius: 7px; display: grid; place-items: center; font-size: 11px; color: var(--text); background: var(--card-2); position: relative; }
.heat .hc.e { background: transparent; }
.toplist li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.toplist { list-style: none; padding: 0; margin: 0; }
.toplist li:last-child { border-bottom: 0; }
.meter { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--warn); border-radius: 6px; }
.drag-handle { cursor: grab; color: var(--muted); opacity: .5; }
.dash-card.dragging { opacity: .5; }
.dash-card.over { outline: 2px dashed var(--primary); }

/* ===== محرر الدوام الصوري ===== */
.legend-bar { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.tl { user-select: none; }
.tl-row { display: grid; grid-template-columns: 74px 1fr 34px; gap: 8px; align-items: center; margin-bottom: 6px; }
.tl-day { font-size: 13px; font-weight: 600; }
.tl-track { position: relative; height: 34px; background: repeating-linear-gradient(to left, var(--card-2) 0, var(--card-2) calc(100%/24 - 1px), var(--line) calc(100%/24 - 1px), var(--line) calc(100%/24)); border-radius: 9px; border: 1px solid var(--line); cursor: copy; overflow: hidden; }
.tl-track.off { background: repeating-linear-gradient(-45deg, var(--card-2), var(--card-2) 6px, var(--k-off) 6px, var(--k-off) 7px); cursor: default; }
.tl-block { position: absolute; top: 3px; bottom: 3px; border-radius: 7px; cursor: grab; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: #1f2a37; box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: box-shadow .15s; overflow: hidden; white-space: nowrap; }
.tl-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.tl-block.k-morning { background: var(--k-morning); } .tl-block.k-evening { background: var(--k-evening); } .tl-block.k-night { background: var(--k-night); color: #fff; }
.tl-block .h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.tl-block .h.l { left: 0; } .tl-block .h.r { right: 0; }
.tl-block .x { position: absolute; top: 1px; left: 3px; font-size: 11px; opacity: 0; cursor: pointer; }
.tl-block:hover .x { opacity: .7; }
.tl-hours { display: grid; grid-template-columns: 74px 1fr 34px; gap: 8px; font-size: 10.5px; color: var(--muted); }
.tl-hours div:nth-child(2) { display: flex; justify-content: space-between; }
.tl-toggle { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.tl-toggle.is-off { background: var(--k-off); color: var(--text); }
.text-editor .tday { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.text-editor .tper { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.text-editor input[type=time] { width: 110px; }
.cycle { display: flex; gap: 6px; flex-wrap: wrap; }
.cycle .cd { min-width: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; font-size: 12px; background: var(--card-2); }
.cycle .cd select { margin-top: 4px; font-size: 12px; padding: 4px; }

/* ===== النوافذ ===== */
dialog { border: 0; border-radius: 16px; padding: 0; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(520px, 94vw); }
dialog::backdrop { background: rgba(10,15,20,.45); backdrop-filter: blur(2px); }
dialog .dh { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .db { padding: 18px; max-height: 70vh; overflow: auto; }
dialog .df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }

/* ===== صفحات الدخول ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, #2f6f6a 0, transparent 50%), radial-gradient(circle at 80% 80%, #3c5f8a 0, transparent 50%), #142127; padding: 20px; }
.login-card { background: var(--card); border-radius: 20px; padding: 32px; width: 100%; max-width: 390px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: fadeUp .5s var(--ease); }
.code { font-family: Consolas, monospace; direction: ltr; text-align: left; background: #0f1a1f; color: #d5e2e6; padding: 12px 14px; border-radius: 10px; font-size: 13px; white-space: pre-wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; text-decoration: none; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .ic { opacity: .4; display: block; margin: 0 auto 8px; }
details summary { cursor: pointer; color: var(--primary); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); font-size: 13px; cursor: pointer; }
.chip input { margin: 0; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }

/* ===== الشاشة الكبيرة ===== */
body.bigscreen { font-size: 18px; }
.big-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; padding: 24px; min-height: 100vh; }
.big-grid .stat .n { font-size: 46px; }
.big-clock { font-size: 64px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: center; letter-spacing: 2px; }

/* ===== الحركات ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(52,193,123,.18); } 50% { box-shadow: 0 0 0 6px rgba(52,193,123,.05); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-8deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }
.face .hand { transform-origin: 70% 80%; animation: wave .9s ease-in-out 2; }
.face .body { animation: hop .8s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== الجوال ===== */
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  html, body { overflow-x: clip; }
  .sidebar { position: fixed; top: 0; right: 0; z-index: 50; transform: translateX(105%); transition: transform .25s var(--ease); }
  .sidebar.open { transform: none; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
  .main { width: 100%; }
  .menu-btn { display: inline-grid; }
  .content { padding: 14px; }
  .big-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .g5, .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px; gap: 10px; } .stat .n { font-size: 21px; } .stat .si { width: 36px; height: 36px; }
  .topbar { padding: 8px 12px; } .card { padding: 14px; }
  input, select, textarea { font-size: 16px; }
  .tl-row, .tl-hours { grid-template-columns: 52px 1fr 30px; }
}
@supports (padding-top: env(safe-area-inset-top)) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } }
@media print { .sidebar, .topbar, .sub-banner, .no-print, #toasts, .impersonate { display: none !important; } .card { box-shadow: none; border: 0; } body { background: #fff; } }
@media (max-width: 600px) { .g3[data-sortable] { grid-template-columns: 1fr; } .ticker .pc { min-width: 150px; } }

/* ===== مركز التقارير ===== */
.rc { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.rc-list { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; padding: 12px; }
.rc-group { margin-bottom: 12px; }
.rc-gh { padding: 4px 6px 6px; }
.rc-gh b { display: block; font-size: 13.5px; color: var(--primary); }
.rc-gh small { font-size: 11.5px; line-height: 1.4; display: block; }
.rc-item { display: flex; gap: 10px; width: 100%; text-align: right; background: none; border: 1px solid transparent; border-radius: 10px; padding: 8px 9px; cursor: pointer; color: var(--text); font: inherit; align-items: flex-start; transition: background .15s; }
.rc-item:hover { background: var(--card-2); }
.rc-item.active { background: var(--primary-soft); border-color: var(--primary); }
.rc-item .ic { margin-top: 3px; color: var(--primary); }
.rc-item b { display: block; font-size: 13.5px; font-weight: 600; }
.rc-item small { display: block; font-size: 11.5px; line-height: 1.45; }
.rc-main { min-width: 0; }
.rc-filters { padding: 14px; }
.rc-toolbar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.rc-preview { position: relative; }
.rc-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 10px; background: color-mix(in srgb, var(--card) 75%, transparent); z-index: 2; font-weight: 600; color: var(--primary); }
.spinner { width: 20px; height: 20px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.col-list { list-style: none; margin: 0; padding: 0; }
.col-list li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 5px; background: var(--card-2); cursor: grab; }
.col-list li.dragging { opacity: .4; }
.col-list li .drag-handle { opacity: .6; letter-spacing: -2px; }
/* ===== القوالب ===== */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tpl { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.tpl.is-default { outline: 2px solid var(--primary); }
.tpl .mini { height: 150px; padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.tpl .mini .t { height: 10px; width: 55%; border-radius: 3px; }
.tpl .mini .s { height: 6px; width: 35%; border-radius: 3px; opacity: .5; }
.tpl .mini .h { height: 14px; margin-top: 8px; }
.tpl .mini .r { height: 10px; }
.tpl .body { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: auto; }
.asset { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.asset img { max-height: 70px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 8px; background: repeating-conic-gradient(#f2f2f2 0 25%, #fff 0 50%) 0 0/14px 14px; border-radius: 6px; }
.asset .ph { height: 70px; display: grid; place-items: center; color: var(--muted); }
.tf { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.tf .card { margin-bottom: 12px; }
.tf-preview { position: sticky; top: 70px; }
.colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.colors label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 13px; }
@media (max-width: 1100px) { .rc, .tf { grid-template-columns: 1fr; } .rc-list, .tf-preview { position: static; max-height: none; } }

/* ===== البصمة من الجوال ===== */
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card span { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.mode-card span .ic { color: var(--muted); }
.mode-card input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.mode-card input:checked + span .ic { color: var(--primary); }
.mode-card small { font-size: 12.5px; }
.geo-map { height: 280px; border-radius: 12px; border: 1px solid var(--line); margin: 10px 0; z-index: 0; }
.selfie { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; cursor: zoom-in; border: 1px solid var(--line); background: var(--card-2); }
.selfie-lg { max-width: min(92vw, 420px); border-radius: 14px; }
.qr-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-box img { width: 190px; height: 190px; background: #fff; border-radius: 12px; padding: 8px; }
.link-field { display: flex; gap: 6px; }
.link-field input { direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 12.5px; }
.vm { display: inline-flex; gap: 4px; align-items: center; padding: 2px 9px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.warn a { color: inherit; font-weight: 600; text-decoration: underline; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-box { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.14); padding: 6px; }
details.menu .menu-box form { margin: 0; }
details.menu .menu-box button, details.menu .menu-box a { display: block; width: 100%; text-align: start; background: none; border: 0; font: inherit; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
details.menu .menu-box button:hover, details.menu .menu-box a:hover { background: var(--card-2); text-decoration: none; }
.lock-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lock-banner > span { flex: 1; min-width: 240px; }
.lock-banner form { margin: 0; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
tfoot td { border-top: 2px solid var(--line); background: var(--card-2); }
.loan-bar { height: 7px; border-radius: 9px; background: var(--card-2); overflow: hidden; min-width: 90px; border: 1px solid var(--line); }
.loan-bar i { display: block; height: 100%; background: var(--ok); }
.month-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.month-chips button, .month-chips span { font: inherit; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.month-chips .paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; cursor: default; }
.month-chips .skip { text-decoration: line-through; color: var(--muted); }
.month-chips .now { border-color: var(--primary); font-weight: 700; }
