/* ═══════════════════════════════════════════════════════════════════════════
   Omar RADIUS — واجهة الويب v2 · تخطيط SAMM · وضعان · RTL/LTR
   الألوان من المواصفة §١ (ويب لا هاتف): سماوي · بنفسجي · أخضر · ذهبي · أحمر · وردي
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --sb: 252px; --sb-min: 76px; --topbar: 62px; --radius: 16px; --radius-sm: 12px; --radius-xs: 9px;
  --bg0: #0b1020; --bg1: #111a33;
  --surface: rgba(20, 28, 52, .80); --surface-solid: #141c34; --surface-2: rgba(255, 255, 255, .035); --surface-3: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .08); --border-2: rgba(255, 255, 255, .15);
  --text: #e8ecf5; --muted: #9aa6c3; --faint: #6b7797;
  --cyan: #22d3ee; --violet: #8b5cf6; --green: #22c55e; --gold: #f59e0b; --red: #ef4444; --pink: #ec4899; --gray: #64748b; --blue: #3b82f6;
  --chart-surface: #141c34; --tip-bg: rgba(12, 17, 36, .97);
  --shadow: 0 12px 34px rgba(0, 0, 0, .38); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);
  --input-bg: rgba(255, 255, 255, .05); --hover: rgba(255, 255, 255, .05); --skel: rgba(255, 255, 255, .06);
  --glow: 0 0 22px rgba(34, 211, 238, .22);
  --focus: 0 0 0 3px color-mix(in srgb, var(--cyan) 28%, transparent);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg0: #f4f6fb; --bg1: #eaeef7;
  --surface: rgba(255, 255, 255, .92); --surface-solid: #ffffff; --surface-2: #f4f6fb; --surface-3: #e9edf6;
  --border: rgba(15, 23, 42, .08); --border-2: rgba(15, 23, 42, .16);
  --text: #0f172a; --muted: #64748b; --faint: #94a3b8;
  --cyan: #0891b2; --violet: #7c3aed; --green: #16a34a; --gold: #d97706; --red: #dc2626; --pink: #db2777; --gray: #64748b; --blue: #2563eb;
  --chart-surface: #ffffff; --tip-bg: rgba(255, 255, 255, .98);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08); --shadow-sm: 0 3px 12px rgba(15, 23, 42, .06);
  --input-bg: #f8fafc; --hover: rgba(15, 23, 42, .04); --skel: rgba(15, 23, 42, .07);
  --glow: 0 0 22px rgba(8, 145, 178, .16);
  color-scheme: light;
}

/* ── الأساس ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* ⚠️ لا `height:100%` مع `overflow-x` على html: يصير عنصر html هو المتمرِّر (٧٢٠px) لا نافذة العرض،
   فتُلتقط الشاشة فارغةً بعد التمرير وتضطرب `100vh` والثابتات على الهاتف (مقيس 2026-09-19). */
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg0);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", Roboto, sans-serif;
  font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
/* ⚠️ الخلفية المتدرّجة على عنصرٍ ثابت خلف كل شيء لا على body بـ`background-attachment: fixed`:
   الأخيرة تُبطل تركيب التمرير في كروم فتُعاد كتابة البقع كلّها عند كل إطار — مقيس 2026-09-19:
   التقاط الشاشة كان يتجمّد ثواني عند التمرير على صفحةٍ بطول ٤٦٠٠px. هنا تُرسم مرّةً كطبقةٍ واحدة. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 600px at 100% -10%, color-mix(in srgb, var(--cyan) 16%, transparent), transparent 60%),
              radial-gradient(800px 600px at -10% 110%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 60%),
              linear-gradient(160deg, var(--bg0), var(--bg1));
  will-change: transform;
}
html[data-theme="light"] body::before {
  background: radial-gradient(900px 600px at 100% -10%, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 60%),
              radial-gradient(800px 600px at -10% 110%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 60%),
              linear-gradient(160deg, var(--bg0), var(--bg1));
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14.5px; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace; direction: ltr; unicode-bidi: isolate; font-size: .93em; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-s { margin-top: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--cyan) 35%, transparent); }
*:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

/* ── الحركات ────────────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeUp .35s cubic-bezier(.2, .7, .2, 1) both; }
.fade-in-slow { animation: fadeIn .5s ease both; }
.stagger > * { animation: fadeUp .4s cubic-bezier(.2, .7, .2, 1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; } .stagger > *:nth-child(2) { animation-delay: .06s; } .stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; } .stagger > *:nth-child(5) { animation-delay: .18s; } .stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; } .stagger > *:nth-child(8) { animation-delay: .30s; }
.refreshing { opacity: .6; transition: opacity .2s; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ── الهيكل ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--sb); z-index: 40;
  display: flex; flex-direction: column; gap: 6px; padding: 14px 12px;
  background: color-mix(in srgb, var(--bg0) 88%, var(--surface));
  border-inline-end: 1px solid var(--border); transition: width .22s ease, transform .28s ease;
}
html[data-sb="min"] .sidebar { width: var(--sb-min); padding-inline: 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; min-height: 52px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 45%, transparent); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; letter-spacing: .2px; font-size: 15.5px; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
html[data-sb="min"] .brand-txt, html[data-sb="min"] .nav-lbl, html[data-sb="min"] .nav-group, html[data-sb="min"] .nav-badge, html[data-sb="min"] .sb-user .who, html[data-sb="min"] .sb-foot .ver { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav-group { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; padding: 12px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.active { color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 85%, #000), color-mix(in srgb, var(--violet) 90%, #000)); box-shadow: 0 8px 22px color-mix(in srgb, var(--violet) 40%, transparent); }
html[data-theme="light"] .nav a.active { background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.nav a svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav a.sub { padding-inline-start: 26px; font-size: 13.5px; font-weight: 500; }
.nav a.sub::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; margin-inline-end: 4px; }
html[data-sb="min"] .nav a { justify-content: center; padding: 10px; }
html[data-sb="min"] .nav a.sub { padding-inline-start: 10px; }
html[data-sb="min"] .nav a.sub::before { display: none; }
.nav-badge { margin-inline-start: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-weight: 700; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--gold), var(--pink)); }
.sb-user .who { min-width: 0; }
.sb-user .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user .who span { font-size: 11.5px; color: var(--muted); }
.sb-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 0; color: var(--faint); font-size: 11.5px; }
.sb-toggle { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.sb-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
html[data-sb="min"] .sb-toggle svg { transform: rotate(180deg); }
html[dir="rtl"] .sb-toggle svg { transform: rotate(180deg); }
html[dir="rtl"][data-sb="min"] .sb-toggle svg { transform: none; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); margin-inline-start: var(--sb);
  display: flex; align-items: center; gap: 8px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg0) 72%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); transition: margin .22s ease;
}
.content { margin-inline-start: var(--sb); padding: 22px 24px 70px; max-width: 1640px; transition: margin .22s ease; }
html[data-sb="min"] .topbar, html[data-sb="min"] .content { margin-inline-start: var(--sb-min); }
.page-title h1 { font-size: 19px; }
.page-title .sub { font-size: 12.5px; color: var(--muted); }
.tb-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.ghost { border-color: var(--border); background: var(--surface-2); }
.search-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; min-width: 220px; font-size: 13px; }
.search-btn:hover { border-color: var(--border-2); color: var(--text); }
.search-btn kbd { margin-inline-start: auto; font: 600 11px ui-monospace, monospace; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--faint); }
.tb-user { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 12px; cursor: pointer; }
.tb-user:hover { background: var(--hover); }
.tb-user .avatar { width: 30px; height: 30px; font-size: 12px; }
.tb-user .who b { display: block; font-size: 13px; line-height: 1.1; }
.tb-user .who span { font-size: 11px; color: var(--muted); }
.hamburger { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; background: linear-gradient(135deg, var(--text), color-mix(in srgb, var(--text) 60%, var(--cyan))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── البطاقات ───────────────────────────────────────────────────────────── */
/* بلا backdrop-filter على البطاقات ولا على الشريط الجانبي (٢١ عنصراً يُعاد تركيبها مع كل تمرير — انظر
   تعليق الخلفية أعلاه): الزجاج من الشفافية الجزئية والحدّ والظلّ؛ الضبابية تبقى للشريط العلوي والحوارات. */
.card { background: color-mix(in srgb, var(--bg1) 70%, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-head h2 { font-size: 15.5px; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 14px 20px 18px; }
.card.flat { box-shadow: none; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 4px; min-height: 132px; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; text-decoration: none !important; color: var(--text); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.kpi::before { content: ""; position: absolute; inset: -40% auto auto -20%; width: 160px; height: 160px; border-radius: 50%; filter: blur(40px); opacity: .28; background: var(--c); pointer-events: none; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .k-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); flex: 0 0 auto; }
.kpi .k-ico svg { width: 17px; height: 17px; }
.kpi .k-val { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.3px; }
.kpi .k-sub { font-size: 12px; color: var(--muted); min-height: 16px; }
.kpi .spark { margin-top: auto; opacity: .95; }
.kpi.c-cyan { --c: var(--cyan); } .kpi.c-violet { --c: var(--violet); } .kpi.c-green { --c: var(--green); } .kpi.c-gold { --c: var(--gold); } .kpi.c-red { --c: var(--red); } .kpi.c-pink { --c: var(--pink); } .kpi.c-blue { --c: var(--blue); } .kpi.c-gray { --c: var(--gray); }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* ── الأزرار ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 11px; border: 1px solid transparent; font-weight: 700; font-size: 13.5px; cursor: pointer; background: var(--surface-3); color: var(--text); transition: transform .12s, filter .12s, background .15s, box-shadow .15s; white-space: nowrap; line-height: 1.2; }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 40%, transparent), 0 0 20px color-mix(in srgb, var(--cyan) 22%, transparent); }
.btn-green { color: #fff; background: linear-gradient(135deg, var(--green), var(--cyan)); box-shadow: 0 6px 18px color-mix(in srgb, var(--green) 40%, transparent); }
.btn-gold { color: #fff; background: linear-gradient(135deg, var(--gold), #f97316); box-shadow: 0 6px 18px color-mix(in srgb, var(--gold) 40%, transparent); }
.btn-danger { color: #fff; background: linear-gradient(135deg, var(--red), var(--pink)); box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 35%, transparent); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--hover); border-color: var(--border-2); }
.btn-outline { background: transparent; border-color: var(--border-2); }
.btn-link { background: none; color: var(--cyan); padding: 4px 6px; font-weight: 600; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-xs { padding: 4px 8px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.seg button.active { color: #fff; background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 4px 12px color-mix(in srgb, var(--violet) 35%, transparent); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); width: max-content; max-width: 100%; overflow: auto; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.active { color: #fff; background: linear-gradient(135deg, var(--gold), #f97316); box-shadow: 0 6px 16px color-mix(in srgb, var(--gold) 35%, transparent); }
.tabs .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); }

/* رقائق التصفية */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 4px 14px color-mix(in srgb, var(--violet) 35%, transparent); }
.chip .cnt { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.active .cnt { background: rgba(255, 255, 255, .2); color: #fff; }
.chip i.dot { margin: 0; }

/* ── المدخلات ───────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field > label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--faint); }
input, select, textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 38px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--cyan) 70%, transparent); box-shadow: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--cyan); margin: 0; }
input[type="date"] { direction: ltr; }
select option { background: var(--surface-solid); color: var(--text); }
textarea { min-height: 72px; resize: vertical; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; top: 50%; inset-inline-start: 11px; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.input-icon input { padding-inline-start: 34px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--text); font-weight: 500; }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); cursor: pointer; flex: 0 0 auto; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch.on { background: linear-gradient(135deg, var(--cyan), var(--violet)); border-color: transparent; }
html[dir="ltr"] .switch.on::after { transform: translateX(18px); }
html[dir="rtl"] .switch.on::after { transform: translateX(-18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .lbl { font-size: 13.5px; font-weight: 500; }
.switch-row .lbl small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.form-sec { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin: 8px 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--border); grid-column: 1 / -1; }
.err-box { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--red) 14%, transparent); border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); color: var(--text); font-size: 13px; }
.info-box { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--cyan) 10%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 35%, transparent); font-size: 13px; }
.warn-box { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: 13px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; cursor: pointer; }
.quick button:hover { color: var(--text); border-color: var(--border-2); }

/* ── الجداول ────────────────────────────────────────────────────────────── */
.table-wrap { overflow: auto; border-radius: var(--radius); scrollbar-width: thin; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: start; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 11px 12px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-solid) 85%, transparent); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .arrow { opacity: .35; font-size: 10px; margin-inline-start: 4px; }
.tbl th.sorted .arrow { opacity: 1; color: var(--cyan); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.sel { background: color-mix(in srgb, var(--cyan) 9%, transparent); }
.tbl tr.click { cursor: pointer; }
.tbl td.chk, .tbl th.chk { width: 34px; padding-inline-end: 0; }
.tbl td.act, .tbl th.act { width: 44px; text-align: end; }
.tbl .primary { font-weight: 700; }
.tbl .sub { font-size: 12px; color: var(--muted); display: block; }
.tbl tfoot td { font-weight: 700; color: var(--muted); font-size: 12.5px; border-bottom: 0; background: var(--surface-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gray); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gray) 20%, transparent); vertical-align: middle; flex: 0 0 auto; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); animation: pulse 2s infinite; }
.dot.cyan { background: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 22%, transparent); }
.dot.gold { background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.dot.pink { background: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 22%, transparent); }
.dot.violet { background: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 22%, transparent); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; --b: var(--gray); color: var(--b); background: color-mix(in srgb, var(--b) 14%, transparent); border: 1px solid color-mix(in srgb, var(--b) 30%, transparent); }
.badge svg { width: 12px; height: 12px; }
.b-cyan { --b: var(--cyan); } .b-green { --b: var(--green); } .b-gold { --b: var(--gold); } .b-red { --b: var(--red); } .b-pink { --b: var(--pink); } .b-violet { --b: var(--violet); } .b-gray { --b: var(--gray); } .b-blue { --b: var(--blue); }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; --c: var(--cyan); }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--c); transition: width .6s cubic-bezier(.2, .7, .2, 1); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 45%, transparent); }
.bar.c-gold { --c: var(--gold); } .bar.c-red { --c: var(--red); } .bar.c-green { --c: var(--green); } .bar.c-violet { --c: var(--violet); } .bar.c-gray { --c: var(--gray); } .bar.c-pink { --c: var(--pink); }
.bar.thin { height: 4px; }
.cell-bar { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.cell-bar .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 6px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 0 0; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.pager .pg-info { padding: 0 8px; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--violet) 14%, var(--surface-solid)); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); margin-bottom: 12px; animation: fadeUp .2s ease both; }
.bulkbar b { margin-inline-end: 6px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .field { min-width: 150px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar select { min-height: 36px; padding: 7px 10px; }

/* ── القوائم المنسدلة ───────────────────────────────────────────────────── */
.menu { position: fixed; z-index: 80; min-width: 210px; padding: 6px; border-radius: 13px; background: var(--surface-solid); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: fadeUp .14s ease both; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; padding: 8px 10px; border: 0; background: transparent; border-radius: 9px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.menu button.danger { color: var(--red); } .menu button.danger svg { color: var(--red); }
.menu button:disabled { opacity: .45; cursor: default; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }

/* ── الحوارات والدرج ────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4, 8, 24, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 34px 14px; overflow: auto; animation: fadeIn .18s ease both; }
html[data-theme="light"] .overlay { background: rgba(15, 23, 42, .35); }
.dialog { width: min(680px, 100%); background: var(--surface-solid); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow), 0 0 40px color-mix(in srgb, var(--violet) 18%, transparent); animation: fadeUp .22s cubic-bezier(.2, .7, .2, 1) both; }
.dialog.wide { width: min(960px, 100%); }
.dialog.narrow { width: min(460px, 100%); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.dlg-head h2 { font-size: 17px; }
.dlg-body { padding: 14px 20px 6px; display: flex; flex-direction: column; gap: 12px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
.dlg-foot .start { margin-inline-end: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.drawer-bg { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 24, .45); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 55; width: min(540px, 100%); background: var(--surface-solid); border-inline-start: 1px solid var(--border-2); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
html[dir="rtl"] .drawer { transform: translateX(-100%); }
html[dir="ltr"] .drawer { transform: translateX(100%); }
.drawer.open { transform: none !important; }
.dr-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.dr-head .ttl { min-width: 0; flex: 1; }
.dr-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.dr-body { flex: 1; overflow: auto; padding: 14px 20px 30px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; }
.dr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dr-sec h3 { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.kv .k { font-size: 11.5px; color: var(--muted); }
.kv .v { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.limit { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.limit .lt { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.limit .lt b { font-size: 13px; }
.limit .lt span { color: var(--muted); }

/* ── التوست ──────────────────────────────────────────────────────────────── */
.toasts { position: fixed; top: 14px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 28px)); pointer-events: none; }
html[dir="rtl"] .toasts { transform: translateX(50%); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 13px; background: var(--surface-solid); border: 1px solid color-mix(in srgb, var(--c, var(--cyan)) 50%, transparent); box-shadow: var(--shadow), 0 0 22px color-mix(in srgb, var(--c, var(--cyan)) 22%, transparent); font-size: 13.5px; font-weight: 600; animation: toastIn .22s ease both; }
.toast svg { width: 18px; height: 18px; color: var(--c, var(--cyan)); flex: 0 0 auto; }
.toast.ok { --c: var(--green); } .toast.bad { --c: var(--red); } .toast.warn { --c: var(--gold); } .toast.info { --c: var(--cyan); }

/* ── الهيكل العظمي والحالات الفارغة ────────────────────────────────────── */
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--skel) 25%, color-mix(in srgb, var(--skel) 40%, transparent) 50%, var(--skel) 75%); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; }
.skel.t { height: 14px; width: 60%; } .skel.v { height: 30px; width: 40%; } .skel.line { height: 12px; width: 100%; } .skel.block { height: 200px; width: 100%; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 42px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--cyan) 12%, transparent); color: var(--cyan); margin-bottom: 4px; }
.empty .ico svg { width: 28px; height: 28px; }
.empty b { color: var(--text); font-size: 15px; }
.empty p { font-size: 13px; max-width: 360px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; background: color-mix(in srgb, var(--gold) 12%, var(--surface-solid)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--gold) 15%, transparent); }
.banner.red { background: color-mix(in srgb, var(--red) 12%, var(--surface-solid)); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.banner.violet { background: color-mix(in srgb, var(--violet) 14%, var(--surface-solid)); border-color: color-mix(in srgb, var(--violet) 45%, transparent); }
.banner svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--gold); }
.banner.red svg { color: var(--red); } .banner.violet svg { color: var(--violet); }
.banner b { display: block; font-size: 13.5px; } .banner span { font-size: 12.5px; color: var(--muted); }

/* ── المخطّطات ──────────────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart-wrap { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-svg .axis.strong { fill: var(--text); font-weight: 700; font-size: 11.5px; }
.chart-svg .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: none; opacity: .6; }
.chart-svg .col { transition: opacity .15s; } .chart-svg .col.dim { opacity: .4; }
.chart-svg .seg { transition: opacity .15s; cursor: pointer; } .chart-svg .seg.dim { opacity: .35; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px; border-radius: 11px; background: var(--tip-bg); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 12.5px; }
.ct-title { color: var(--muted); font-size: 11.5px; margin-bottom: 5px; font-weight: 600; }
.ct-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.ct-key { width: 12px; height: 3px; border-radius: 2px; flex: 0 0 auto; } .ct-key.rect { width: 10px; height: 10px; border-radius: 3px; }
.ct-val { font-variant-numeric: tabular-nums; } .ct-name { color: var(--muted); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 0 0 8px; font-size: 12px; color: var(--muted); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-key { width: 14px; height: 3px; border-radius: 2px; display: inline-block; } .lg-key.rect { width: 10px; height: 10px; border-radius: 3px; }
.chart-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-svg { position: relative; flex: 0 0 auto; }
.donut-val { fill: var(--text); font-size: 26px; font-weight: 800; font-family: inherit; }
.donut-lbl { fill: var(--muted); font-size: 11px; font-family: inherit; }
.donut-legend { flex: 1 1 140px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dl-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 6px; border-radius: 8px; transition: background .12s; }
.dl-item.hover { background: var(--hover); }
.dl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { font-variant-numeric: tabular-nums; } .dl-pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: end; }
.spark { width: 100%; }
.spark-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.top-list { display: flex; flex-direction: column; gap: 8px; }
.top-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.top-item .rk { color: var(--faint); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.top-item .nm { min-width: 0; }
.top-item .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.top-item .nm .bar { margin-top: 4px; }
.top-item .vl { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.event-list { display: flex; flex-direction: column; }
.event { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.event:last-child { border-bottom: 0; }
.event .ev-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.event .ev-ico svg { width: 14px; height: 14px; }
.event .ev-txt { flex: 1; min-width: 0; }
.event .ev-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.event.reject { --c: var(--red); } .event.new_user { --c: var(--green); } .event.payment { --c: var(--gold); } .event.nas_silent { --c: var(--gray); } .event.other { --c: var(--cyan); }
.nas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.nas-card { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.nas-card .nm { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.nas-card .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.profile-card { position: relative; overflow: hidden; padding: 16px 18px; cursor: pointer; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; gap: 10px; }
.profile-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.profile-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c, var(--cyan)); }
.profile-card::after { content: ""; position: absolute; inset: auto -30% -50% auto; width: 180px; height: 180px; border-radius: 50%; filter: blur(46px); opacity: .22; background: var(--c, var(--cyan)); pointer-events: none; }
.profile-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-card .pc-name { font-weight: 800; font-size: 16px; }
.profile-card .pc-rate { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.profile-card .pc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }
.profile-card .pc-meta b { color: var(--text); font-weight: 600; }
.profile-card .pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: 12.5px; color: var(--muted); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.price-card { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); position: relative; overflow: hidden; }
.price-card.hot { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 15%, transparent); }
.price-card .pt { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.price-card .pr { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.price-card .pr:last-child { border-bottom: 0; }
.price-card .pr b { font-variant-numeric: tabular-nums; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); }
.code { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid var(--border); direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; overflow: auto; max-height: 300px; }
html[data-theme="light"] .code { background: #0f172a; color: #e2e8f0; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.perm { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; cursor: pointer; }
.perm.on { border-color: color-mix(in srgb, var(--cyan) 45%, transparent); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.perm .switch { width: 34px; height: 20px; } .perm .switch::after { width: 14px; height: 14px; }
html[dir="ltr"] .perm .switch.on::after { transform: translateX(14px); } html[dir="rtl"] .perm .switch.on::after { transform: translateX(-14px); }
.assign { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assign .list { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px; background: var(--surface-2); scrollbar-width: thin; }
.assign .item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.assign .item:hover { background: var(--hover); }
.assign .item .sub { color: var(--muted); font-size: 11.5px; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.stat .l { font-size: 12px; color: var(--muted); } .stat .v { font-size: 20px; font-weight: 800; margin-top: 2px; }
.meter { height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--cyan) 18%, transparent); overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 8px; }

/* ── الدخول ─────────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; pointer-events: none; }
.login .b1 { width: 520px; height: 520px; background: var(--cyan); top: -160px; inset-inline-start: -140px; }
.login .b2 { width: 520px; height: 520px; background: var(--violet); bottom: -200px; inset-inline-end: -160px; }
.login .b3 { width: 320px; height: 320px; background: var(--pink); top: 45%; inset-inline-start: 50%; opacity: .25; }
html[data-theme="light"] .login .blob { opacity: .25; }
.login-card { position: relative; width: min(440px, 100%); padding: 28px 28px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 0 48px color-mix(in srgb, var(--violet) 22%, transparent); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); animation: fadeUp .4s ease both; }
.login-card .brand { padding: 0 0 14px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .lead { color: var(--muted); font-size: 13px; margin-bottom: 14px; min-height: 40px; }
.login-card .tabs { width: 100%; margin-bottom: 16px; }
.login-card .tabs button { flex: 1; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--faint); font-size: 12px; }
.login-card .note { margin-top: 12px; color: var(--faint); font-size: 11.5px; text-align: center; }

/* ── لوحة الأوامر ⌘K ───────────────────────────────────────────────────── */
.cmdk { width: min(620px, 100%); background: var(--surface-solid); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow), 0 0 40px color-mix(in srgb, var(--cyan) 18%, transparent); overflow: hidden; animation: fadeUp .18s ease both; }
.cmdk .in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cmdk .in svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk .in input { border: 0; background: transparent; padding: 4px 0; font-size: 15px; box-shadow: none; }
.cmdk .in kbd { font: 600 11px ui-monospace, monospace; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--faint); }
.cmdk .res { max-height: 380px; overflow: auto; padding: 6px; scrollbar-width: thin; }
.cmdk .grp { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px 4px; }
.cmdk .it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.cmdk .it:hover, .cmdk .it.active { background: var(--hover); }
.cmdk .it svg { width: 16px; height: 16px; color: var(--muted); }
.cmdk .it .sub { color: var(--muted); font-size: 12px; margin-inline-start: auto; }
.cmdk .empty { padding: 26px; }

/* ── شاشة الهاتف والألواح ──────────────────────────────────────────────── */
.sb-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(4, 8, 24, .5); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
@media (max-width: 1279px) {
  .span-8, .span-7, .span-6, .span-5, .span-4, .span-3 { grid-column: span 12; }
  .span-6.keep, .span-4.keep, .span-3.keep { grid-column: span 6; }
  :root { --sb: 232px; }
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(var(--sb-hide)); box-shadow: none; }
  html[dir="rtl"] { --sb-hide: 100%; } html[dir="ltr"] { --sb-hide: -100%; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .topbar, .content, html[data-sb="min"] .topbar, html[data-sb="min"] .content { margin-inline-start: 0; }
  .hamburger { display: grid; }
  .sb-toggle { display: none; }
  .search-btn { min-width: 0; }
  .search-btn .txt, .search-btn kbd { display: none; }
  .search-btn { width: 38px; padding: 0; justify-content: center; }
  .content { padding: 16px 16px 60px; }
  .assign { grid-template-columns: 1fr; }
}
@media (max-width: 719px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 118px; padding: 12px 12px 10px; } .kpi .k-val { font-size: 22px; }
  .span-6.keep, .span-4.keep, .span-3.keep { grid-column: span 12; }
  .form-grid, .grid-2, .grid-3, .perm-grid, .kv { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .dialog { border-radius: 16px; }
  .overlay { padding: 12px 8px; }
  .tb-user .who { display: none; }
  .page-head h1 { font-size: 20px; }
  .content { padding: 14px 12px 60px; }
  .card-head, .card-body, .card-pad { padding-inline: 14px; }
  .hide-sm { display: none !important; }
  .toolbar .field { min-width: 0; flex: 1 1 45%; }
  .chart-donut { flex-direction: column; align-items: stretch; }
  .donut-svg { margin: 0 auto; }
  .tabs button { padding: 7px 12px; font-size: 13px; }
}
@media (max-width: 1100px) { .hide-md { display: none !important; } }
@media print { .sidebar, .topbar, .toasts { display: none !important; } .content { margin: 0 !important; } }

/* ── إضافات: مجموعات الشريط الجانبي · الساعة · الجرس · شارة الباقة · بطاقات المشتركين ── */
.sb-search { min-width: 0; width: 100%; margin-bottom: 6px; }
html[data-sb="min"] .sb-search { width: 40px; padding: 0; justify-content: center; }
html[data-sb="min"] .sb-search .txt, html[data-sb="min"] .sb-search kbd { display: none; }
.nav-g { display: flex; flex-direction: column; }
.nav-group { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: start; }
.nav-group .chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
html[dir="rtl"] .nav-group .chev { transform: rotate(180deg); }
.nav-g.col .nav-group .chev { transform: rotate(90deg); }
.nav-g .nav-items { display: flex; flex-direction: column; gap: 2px; overflow: hidden; max-height: 600px; transition: max-height .25s ease, opacity .2s; }
.nav-g.col .nav-items { max-height: 0; opacity: 0; }
html[data-sb="min"] .nav-g.col .nav-items { max-height: 600px; opacity: 1; }
.clock { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12.5px; direction: ltr; }
.clock .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; color: var(--faint); }
.clock b { color: var(--text); font-variant-numeric: tabular-nums; }
.bell-cnt { position: absolute; top: 4px; inset-inline-end: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--surface-solid); }
.pt-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--cyan); background: color-mix(in srgb, var(--cyan) 14%, transparent); flex: 0 0 auto; }
.pt-ico svg { width: 18px; height: 18px; }
.pt-ico:empty { display: none; }
.pbadge { display: inline-flex; flex-direction: column; gap: 1px; padding: 3px 9px; border-radius: 9px; --c: var(--blue); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); font-size: 12px; line-height: 1.25; max-width: 170px; }
.pbadge b { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbadge .mono { color: var(--muted); font-size: 11px; }
.st-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; text-align: center; }
.st-cell .small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.red { color: var(--red) !important; }
.ico-inline { width: 13px; height: 13px; vertical-align: -2px; color: var(--gold); }
.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ucard { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.ucard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; border-radius: 8px; }
.mini-row:hover { background: var(--hover); }
.mini-row:last-child { border-bottom: 0; }
.click { cursor: pointer; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface-solid); }
.secret-cell { display: inline-flex; align-items: center; gap: 6px; }
.tbl td.act .icon-btn { width: 32px; height: 32px; }
.empty.small { padding: 22px 12px; font-size: 12.5px; }
.tabs .count:empty { display: none; }
html[data-sb="min"] .sb-user { justify-content: center; padding: 8px; }
html[data-sb="min"] .sb-foot { justify-content: center; }
@media (max-width: 1023px) { .clock { display: none; } }

/* ── حجم افتراضي لكل أيقونة مضمَّنة (svg بلا width) — المخطّطات تحمل width فلا تتأثّر ── */
svg:not([width]) { width: 1.1em; height: 1.1em; vertical-align: -.2em; flex: 0 0 auto; }
.tabs button svg, .chip svg { width: 15px; height: 15px; }
.tbl td svg, .top-item svg, .stat svg { width: 12px; height: 12px; vertical-align: -1px; }
.info-box svg, .warn-box svg, .err-box svg { width: 16px; height: 16px; vertical-align: -3px; }
.top-item .vl, .tbl td.traffic, .traffic { direction: ltr; unicode-bidi: isolate; }
html.noanim *, html.noanim *::before, html.noanim *::after { animation: none !important; transition: none !important; }
/* ── الهاتف: لا تمدُّد أفقي من الشريط المخفي، وشريطٌ علوي مختصر ── */
/* `clip` لا ينشئ حاوية تمرير بخلاف `hidden` (انظر التعليق على html أعلاه). */
html, body { overflow-x: clip; }
@media (max-width: 1023px) {
  .sidebar:not(.open) { visibility: hidden; }
  .sidebar { transition: transform .28s ease, visibility 0s linear .28s; }
  .sidebar.open { transition: transform .28s ease, visibility 0s; }
}
@media (max-width: 719px) {
  #tb-lang, #tb-theme { display: none; }
  .topbar { padding: 0 12px; gap: 4px; }
  .page-title h1 { font-size: 16px; }
  .icon-btn { width: 36px; height: 36px; }
}
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1279px) { .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
@media (max-width: 719px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ═══ مرحلة ٢ (§١٣.٣): الدرج (أكورديون الميزات) · شارات الأعلام · الكروت والكوبونات · الطباعة · الإعدادات · السجلّ ═══ */
/* الأكورديون داخل الدرج: بطاقة خفيفة بلا backdrop-filter (قاعدة الأداء) */
.acc { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.acc-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: start; font-size: 13.5px; }
.acc-h:hover { background: var(--hover); }
.acc-h > svg:first-child { width: 17px; height: 17px; color: var(--cyan); flex: 0 0 auto; }
.acc-h b { flex: 0 0 auto; }
.acc-h .acc-sum { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.acc-h .chev { width: 14px; height: 14px; color: var(--faint); transition: transform .2s; flex: 0 0 auto; }
html[dir="rtl"] .acc-h .chev { transform: rotate(180deg); }
.acc.open .acc-h .chev { transform: rotate(90deg); }
.acc-b { display: none; padding: 2px 12px 12px; border-top: 1px solid var(--border); }
.acc.open .acc-b { display: block; animation: fadeIn .18s ease both; }
.acc .switch-row { padding: 7px 0; }
.acc .tabs { width: 100%; } .acc .tabs button { flex: 1; justify-content: center; }
.acc .quick button.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--cyan), var(--violet)); }
/* شارات الأعلام على الصفوف */
.fbadges { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; vertical-align: middle; }
.dr-head h2 .fbadges { margin: 0; }
.fbadge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .2px; --b: var(--gray); color: var(--b); background: color-mix(in srgb, var(--b) 14%, transparent); border: 1px solid color-mix(in srgb, var(--b) 35%, transparent); white-space: nowrap; }
.fbadge svg { width: 11px; height: 11px; }
.fbadge.f-vip { --b: var(--gold); } .fbadge.f-boost { --b: var(--violet); } .fbadge.f-temp { --b: var(--cyan); } .fbadge.f-prepaid { --b: var(--blue); } .fbadge.f-line { --b: var(--green); } .fbadge.f-v6 { --b: var(--pink); }
/* أزواج توجيه التطبيقات */
.routes { display: flex; gap: 6px; flex-wrap: wrap; min-height: 28px; padding: 4px 0; }
.rchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); font-size: 12.5px; }
.rchip b { font-weight: 600; } .rchip .mono { font-size: 11px; padding: 0 5px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.rchip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.rchip button:hover { background: var(--hover); color: var(--red); } .rchip button svg { width: 12px; height: 12px; }
/* السمات المخصَّصة */
.attrs { display: flex; flex-direction: column; gap: 4px; }
.attr { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: var(--surface-3); font-size: 12.5px; }
.attr .badge { font-size: 10.5px; padding: 1px 7px; }
.attr-add { display: grid; grid-template-columns: auto 1.4fr auto 1fr auto; gap: 6px; align-items: center; }
.attr-add select, .attr-add input { min-height: 34px; padding: 6px 9px; font-size: 12.5px; }
@media (max-width: 719px) { .attr-add { grid-template-columns: 1fr 1fr; } .attr-add input, .attr-add .btn { grid-column: 1 / -1; } }
/* الطباعة داخل iframe */
.print-wrap { position: relative; height: min(62vh, 640px); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.print-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.print-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface-solid); color: var(--muted); font-size: 13px; }
/* إعدادات RADIUS */
.rs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.rs-sec { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rs-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rs-sec h3 svg { width: 16px; height: 16px; color: var(--cyan); }
.rs-sec .switch-row { padding: 7px 0; }
.rs-sec textarea { font-size: 13px; min-height: 64px; }
.tpl-vars button { font-family: ui-monospace, Consolas, monospace; font-size: 11px; padding: 2px 7px; direction: ltr; }
.tpl-preview { padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--green) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--green) 40%, transparent); font-size: 13px; white-space: pre-wrap; }
.portal-link { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--surface-3); border: 1px dashed var(--border-2); min-height: 40px; }
.portal-link a.mono { font-size: 12.5px; }
/* حدث طلب التجديد */
.event.renew_request { --c: var(--violet); }
/* الكوبونات في الدفعات */
.tbl td .cell-bar { min-width: 140px; }
