/* ═══════════════════════════════════════════════════════════════
   daddym7sn — نظام التصميم

   ملف واحد بدل أربعة. قبل كان عندنا style.css وpublic.css وadmin.css
   وmotion.css، وكل واحد معرّف ألوانه بـ:root — آخر ملف ينحمّل يغلب،
   فالأزرار تطلع بنفسجي بصفحة وأخضر بصفحة.

   الترتيب:
     ١) المتغيرات (داكن افتراضي + فاتح لو جهاز الزائر فاتح)
     ٢) الأساسيات · ٣) التخطيط · ٤) الشريط والتذييل
     ٥) المكوّنات (أزرار، حقول، بطاقات، جداول…)
     ٦) الصفحات العامة · ٧) اللوحة · ٨) الإدارة · ٩) التقرير
     ١٠) الحركة
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════ ١) المتغيرات ═══════════ */

:root {
  color-scheme: dark;

  --font: "Segoe UI Variable Text", "Segoe UI", "SF Arabic", "Geeza Pro", "Noto Sans Arabic",
    "Noto Kufi Arabic", Tahoma, system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;

  /* الطبقات: كل وحدة أفتح من اللي تحتها بدرجة — بدون ظلال ثقيلة */
  --bg: #0b0d10;
  --bg-elev: #0f1216;
  --surface: #13171c;
  --surface-2: #191e25;
  --surface-3: #222831;
  --line: #242b34;
  --line-soft: #1a1f26;

  --text: #e9ecef;
  --text-2: #b6bcc5;
  --muted: #858d98;

  /* لون واحد للهوية — زمردي هادي، بلا توهج */
  --accent: #4cc99b;
  --accent-btn: #1c8461;
  --accent-btn-hover: #21946d;
  --accent-wash: rgba(76, 201, 155, .1);
  --accent-line: rgba(76, 201, 155, .32);
  --on-accent: #ffffff;

  --warn: #e3a945;
  --warn-wash: rgba(227, 169, 69, .1);
  --danger: #ef6a62;
  --danger-wash: rgba(239, 106, 98, .1);
  --danger-line: rgba(239, 106, 98, .32);
  --gold: #d6b45c;
  --gold-wash: rgba(214, 180, 92, .1);
  --info: #79a8ff;
  --info-wash: rgba(121, 168, 255, .1);
  --discord: #5865f2;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .65);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);

  --wrap: 1120px;
  --nav-h: 64px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: .15s;
  --mid: .25s;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f6f8;
    --bg-elev: #eff1f4;
    --surface: #ffffff;
    --surface-2: #f2f4f7;
    --surface-3: #e7eaef;
    --line: #e1e5ea;
    --line-soft: #eceef2;
    --text: #0f1318;
    --text-2: #3a424d;
    --muted: #6a737f;
    --accent: #13795a;
    --accent-btn: #157a58;
    --accent-btn-hover: #116849;
    --accent-wash: rgba(21, 122, 88, .08);
    --accent-line: rgba(21, 122, 88, .3);
    --warn: #a86b00;
    --warn-wash: rgba(196, 128, 0, .09);
    --danger: #c9372c;
    --danger-wash: rgba(201, 55, 44, .07);
    --danger-line: rgba(201, 55, 44, .3);
    --gold: #946c00;
    --gold-wash: rgba(184, 138, 20, .1);
    --info: #2f64d6;
    --info-wash: rgba(47, 100, 214, .08);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 10px 30px -12px rgba(16, 24, 40, .18);
    --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, .25);
  }
}

/* ═══════════ ٢) الأساسيات ═══════════ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.75 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: -.005em; }
p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; }

::selection { background: var(--accent-line); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

code, kbd {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  line-height: 1.6;
}
kbd { border-bottom-width: 2px; }

.muted { color: var(--muted); }
.dim { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* خانة مخفية عن الإنسان — فخ للبوتات بفورم الطلب */
.hp-field { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* رابط «انتقل للمحتوى» يبين لما توصله بالكيبورد بس */
a.sr-only:focus {
  position: fixed; top: 10px; inset-inline-start: 10px; z-index: 100;
  width: auto; height: auto; margin: 0; clip: auto; overflow: visible;
  padding: 8px 14px; border-radius: 8px; background: var(--accent-btn); color: var(--on-accent);
}

/* مسافات صغيرة — بدل style="" بالقوالب (اللي تحتاج unsafe-inline بالـCSP) */
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mb-3 { margin-bottom: 16px; }
.h2 { font-size: 1.6rem; }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
/* الأسهم تتقلّب بالعربي — «للأمام» يعني لليسار */
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ═══════════ ٣) التخطيط ═══════════ */

.wrap, .page, .section, .order, .report {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

main { flex: 1; }

.page { padding-block: 32px 64px; }
.page-wide { max-width: 1240px; }
.wrap { padding-block: 32px 64px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-head h1 { font-size: 1.65rem; }
.page-head p { margin-top: 6px; color: var(--muted); }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.center-page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.section { padding-block: 72px 8px; }
.section-head { margin-bottom: 28px; max-width: 640px; }
.section-head h2 { font-size: 1.6rem; }
.section-head p { margin-top: 8px; color: var(--muted); }
.section-narrow { max-width: 760px; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: .9rem; margin-bottom: 18px;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.stack { display: grid; gap: 16px; }

/* ═══════════ ٤) الشريط والتذييل ═══════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: 1240px;
  margin-inline: auto;
  height: var(--nav-h);
  padding-inline: 20px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .01em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.brand-mark .icon { width: 17px; height: 17px; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  color: var(--text-2);
  font-size: .93rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  transition: color var(--fast), background var(--fast);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }

.nav-end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--line);
}
.nav-user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.nav-user-name { font-size: .88rem; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-role { font-size: .74rem; color: var(--muted); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.avatar-lg { width: 72px; height: 72px; }

@media (max-width: 860px) {
  .topbar-inner { height: auto; min-height: var(--nav-h); flex-wrap: wrap; gap: 0 12px; padding-block: 10px 0; }
  .nav-links {
    order: 3;
    width: calc(100% + 40px);
    margin-inline: -20px;
    padding: 6px 14px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--line-soft);
    margin-top: 10px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  .nav-user-meta { display: none; }
  .nav-user { padding-inline-start: 0; border: 0; }
}

.footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 48px;
}
.footer-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .86rem;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ═══════════ ٥) المكوّنات ═══════════ */

/* ── الأزرار ── */
.btn {
  --btn-bg: var(--accent-btn);
  --btn-bg-hover: var(--accent-btn-hover);
  --btn-fg: var(--on-accent);
  --btn-border: transparent;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 .92rem/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.btn:hover { background: var(--btn-bg-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  --btn-bg: var(--surface-2);
  --btn-bg-hover: var(--surface-3);
  --btn-fg: var(--text);
  --btn-border: var(--line);
}
.btn-quiet {
  --btn-bg: transparent;
  --btn-bg-hover: var(--surface-2);
  --btn-fg: var(--text-2);
}
.btn-danger {
  --btn-bg: var(--danger-wash);
  --btn-bg-hover: color-mix(in srgb, var(--danger) 18%, transparent);
  --btn-fg: var(--danger);
  --btn-border: var(--danger-line);
}
.btn-discord { --btn-bg: var(--discord); --btn-bg-hover: #4752c4; --btn-fg: #fff; }

.btn-sm { height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 9px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }

/* حالة «يحفظ…» — الزر يتعطّل ويظهر فيه مؤشر، فما ينضغط مرتين */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--btn-fg);
  border-inline-end-color: transparent;
  animation: spin .7s linear infinite;
}

/* ── الحقول ── */
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: 400 .93rem/1.4 var(--font);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--surface-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); background: var(--surface); }
.input:disabled { opacity: .6; }
select.input {
  appearance: none;
  padding-inline-end: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858d98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: left 12px center;
}
select.input[multiple] { height: auto; padding: 6px; background-image: none; }
select.input[multiple] option { padding: 5px 8px; border-radius: 6px; }
.input-area { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.input-sm { max-width: 300px; }
.input-xs { width: 96px; max-width: 100%; }

.field { padding-block: 18px; border-bottom: 1px solid var(--line-soft); }
.field:first-of-type { padding-top: 4px; }
.field:last-of-type { border-bottom: 0; }
.field-label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 4px; }
.field-help { color: var(--muted); font-size: .86rem; margin-bottom: 10px; line-height: 1.7; }
.field-range { display: block; color: var(--muted); font-size: .8rem; margin-top: 8px; line-height: 1.7; }
.field-range strong { color: var(--text-2); }

/* ── المفتاح ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text strong { font-weight: 600; font-size: .93rem; }
.toggle-text small { color: var(--muted); font-size: .85rem; line-height: 1.6; }

.switch { position: relative; flex-shrink: 0; display: inline-flex; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  display: block;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: background var(--mid) var(--ease), border-color var(--mid);
}
/* ⚠️ القديم كان inset-inline-end مع translateX سالب — بالعربي يطلع
   المقبض **برّه** المسار. الحين يبدأ من البداية ويمشي للنهاية. */
.switch-thumb {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform var(--mid) var(--ease);
}
.switch input:checked + .switch-track { background: var(--accent-btn); border-color: transparent; }
[dir="rtl"] .switch input:checked + .switch-track .switch-thumb { transform: translateX(-18px); }
[dir="ltr"] .switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── الاختيارات المتعددة ── */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks-scroll { max-height: 236px; overflow-y: auto; padding: 2px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .88rem;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}
.check:hover { border-color: var(--surface-3); }
.check input { accent-color: var(--accent-btn); width: 15px; height: 15px; margin: 0; }
.check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-wash); }

/* ── البطاقات ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head .card-title { margin: 0; }
.card-title { display: flex; align-items: center; gap: 9px; font-size: 1.02rem; font-weight: 650; margin-bottom: 16px; }
.card-title .icon { color: var(--muted); }
.card-title small { font-weight: 400; }
.card-sub { color: var(--muted); font-size: .9rem; margin: -10px 0 18px; line-height: 1.75; }

/* ── التنبيهات ── */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.75;
}
.alert > .icon { margin-top: 3px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body p { margin-top: 4px; }
.alert-body ul { margin: 6px 0 0; padding-inline-start: 20px; }
.alert-ok { border-inline-start-color: var(--accent); background: var(--accent-wash); }
.alert-ok > .icon { color: var(--accent); }
.alert-warn { border-inline-start-color: var(--warn); background: var(--warn-wash); }
.alert-warn > .icon { color: var(--warn); }
.alert-err { border-inline-start-color: var(--danger); background: var(--danger-wash); }
.alert-err > .icon { color: var(--danger); }

/* ── شارات الحالة ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-admin { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.badge-on { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.badge-off { background: var(--surface-2); color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--accent-wash); color: var(--accent); }
.pill-orange { background: var(--warn-wash); color: var(--warn); }
.pill-red { background: var(--danger-wash); color: var(--danger); }
.pill-gold { background: var(--gold-wash); color: var(--gold); }
.pill-blue { background: var(--info-wash); color: var(--info); }

.dot-sep { color: var(--line); margin-inline: 6px; }

/* ── الحالة (شغّال / مطفي) ── */
.bot-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.bot-dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.bot-dot.off { background: var(--muted); opacity: .6; }

/* ── الجداول ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th, .table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table thead th { color: var(--muted); font-weight: 600; font-size: .78rem; background: var(--bg-elev); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table code { font-size: .82rem; }

/* ── التبويبات ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: .92rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count {
  font-size: .74rem;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ── قيم وصفية ── */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-tight { gap: 6px 18px; font-size: .9rem; }

/* ── الأرقام ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.stat-num { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-lbl { font-size: .8rem; color: var(--muted); }

/* ── الحالات الفاضية ── */
.empty { text-align: center; padding: 40px 16px; }
.empty-mark {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.empty-mark .icon { width: 22px; height: 22px; }
.empty p + p { margin-top: 4px; }
.empty .btn { margin-top: 18px; }
.empty-note {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* ── الصفحات ── */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pager-links { display: flex; gap: 6px; }

/* ── البحث بالقوائم ── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { flex: 1; min-width: 200px; max-width: 360px; }

.inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 20px; margin-top: 4px; border-top: 1px solid var(--line-soft); }

.code-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.code-list code { font-size: .92rem; padding: 4px 10px; user-select: all; }

.copy-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.copy-box code {
  flex: 1;
  background: none;
  border: 0;
  padding: 0;
  font-size: 1.15rem;
  letter-spacing: .08em;
  text-align: center;
  user-select: all;
  word-break: break-all;
}

/* ═══════════ ٦) الصفحات العامة ═══════════ */

.hero {
  position: relative;
  isolation: isolate;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 96px 20px 40px;
}
.hero::before {
  /* لمسة لون خفيفة ورا العنوان — مو توهج، بس تكسر سواد الصفحة */
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: min(560px, 80%);
  height: 360px;
  background: radial-gradient(closest-side, var(--accent-wash), transparent);
  pointer-events: none;
  z-index: -1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: .82rem;
  margin-bottom: 22px;
}
.hero-eyebrow b {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 600;
}
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.3rem); line-height: 1.18; max-width: 760px; letter-spacing: -.015em; }
.hero h1 .mark { color: var(--accent); }
.hero p { margin-top: 18px; color: var(--text-2); font-size: 1.08rem; max-width: 600px; line-height: 1.85; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
  overflow: hidden;
}
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px; background: var(--surface); }
.fact .icon { color: var(--accent); margin-top: 3px; }
.fact strong { display: block; font-size: .95rem; }
.fact span { color: var(--muted); font-size: .86rem; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color var(--mid), transform var(--mid) var(--ease), box-shadow var(--mid);
}
.pcard:hover { border-color: var(--surface-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.pcard.is-popular { border-color: var(--accent-line); }
.pcard-badge {
  margin-inline-start: auto;
  align-self: flex-start;
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 650;
}
.pcard-top { display: flex; align-items: center; gap: 12px; }
.pcard-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 1.35rem;
  line-height: 1;
}
.pcard-title { font-size: 1.02rem; font-weight: 650; }
.pcard-blurb {
  color: var(--muted);
  font-size: .89rem;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.75em * 3);
}
.pcard-price { display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.pcard-amount { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; direction: ltr; unicode-bidi: isolate; }
.pcard-unit { color: var(--muted); font-size: .84rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.step-num {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 14px;
}
.step h3 { font-size: 1rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .9rem; line-height: 1.75; }
.step a { overflow-wrap: anywhere; }
.step .step-num .icon { width: 17px; height: 17px; }
.step-cta { margin-top: 14px; }
.order-card .pcard-top { margin-bottom: 6px; }
.order-head .pill + h1 { margin-top: 12px; }
.order-msg + .btn-block { margin-top: 14px; }
.auth-card .btn-block + .btn-block { margin-top: 10px; }

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-wash), transparent 70%), var(--surface);
  border: 1px solid var(--accent-line);
}
.cta-band h3 { font-size: 1.2rem; }
.cta-band p { color: var(--muted); margin-top: 4px; }

/* ── الطلب ── */
.order { max-width: 560px; padding-block: 48px 64px; }
.order-head { margin-bottom: 20px; }
.order-head h1 { font-size: 1.5rem; }
.order-head p { margin-top: 4px; color: var(--muted); }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.order-row .label { color: var(--muted); font-size: .9rem; }
.order-row .value { font-weight: 600; text-align: end; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; margin-top: 4px; }
.order-total .label { font-weight: 600; }
.order-total .amount { font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.order-note { color: var(--muted); font-size: .86rem; text-align: center; margin-top: 14px; line-height: 1.75; }
.order-card .btn-block { margin-top: 18px; }
.order-card .btn-block + .btn-block { margin-top: 10px; }
.order-steps { margin: 0; padding-inline-start: 20px; color: var(--text-2); line-height: 2; }
.order-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.order-section-title { font-weight: 600; margin-bottom: 10px; }
.order-msg { line-height: 1.85; color: var(--text-2); }
.in-stock { color: var(--accent); }
.no-stock { color: var(--danger); }

/* ── الدخول والأخطاء ── */
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-mark {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.auth-mark .icon { width: 26px; height: 26px; }
.auth-mark.is-err { background: var(--danger-wash); border-color: var(--danger-line); color: var(--danger); }
.auth-card h1 { font-size: 1.4rem; }
.auth-card > p { margin-top: 8px; color: var(--muted); line-height: 1.8; }
.auth-card .btn-block { margin-top: 24px; }
.auth-code { font-size: 2.6rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--text); }
.auth-ref { margin-top: 14px; font-size: .8rem; color: var(--muted); }
.auth-notes {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  text-align: start;
  display: grid;
  gap: 10px;
}
.auth-notes p { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .87rem; line-height: 1.7; }
.auth-notes .icon { color: var(--accent); margin-top: 3px; }

/* ═══════════ ٧) اللوحة ═══════════ */

/* ── بطاقة الحساب ── */
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-main { flex: 1; min-width: 220px; }
.profile-name { font-size: 1.15rem; font-weight: 700; }
.profile-handle { color: var(--muted); font-size: .9rem; direction: ltr; unicode-bidi: isolate; }
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.profile-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.profile-stats div { display: flex; flex-direction: column; }
.profile-stats b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.profile-stats span { color: var(--muted); font-size: .8rem; }

/* ── شبكة البوتات ── */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.bot-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color var(--mid), transform var(--mid) var(--ease), box-shadow var(--mid);
}
.bot-card:hover { text-decoration: none; border-color: var(--surface-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.bot-card:focus-visible { outline-offset: 3px; border-radius: var(--radius-lg); }
.bot-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bot-emoji {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.bot-emoji .bot-dot { position: absolute; bottom: -2px; inset-inline-end: -2px; border: 2px solid var(--surface); width: 11px; height: 11px; box-shadow: none; }
.bot-title { min-width: 0; flex: 1; }
.bot-name { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-sub { display: block; color: var(--muted); font-size: .8rem; }
.bot-meta { display: grid; gap: 8px; margin: 0; }
.bot-meta > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .87rem; }
.bot-meta dt { color: var(--muted); }
.bot-meta dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-card-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
}
.bot-card-go.is-off { color: var(--muted); font-weight: 500; }

/* ── رأس صفحة البوت ── */
.bot-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.guild-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.guild-icon-empty { display: grid; place-items: center; color: var(--muted); }
.bot-head-text { flex: 1; min-width: 200px; }
.bot-head h1 { font-size: 1.45rem; }
.bot-head p { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.bot-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── تخطيط الإعدادات ── */
.settings-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.settings-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background var(--fast), color var(--fast);
}
.settings-nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.settings-nav-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset -3px 0 0 var(--accent); }
[dir="ltr"] .settings-nav-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.settings-nav-icon { font-size: 1.05rem; line-height: 1.6; width: 22px; text-align: center; flex-shrink: 0; }
.settings-nav-text { display: flex; flex-direction: column; min-width: 0; }
.settings-nav-text strong { font-size: .9rem; font-weight: 600; }
.settings-nav-text small { color: var(--muted); font-size: .78rem; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-nav-sep { height: 1px; background: var(--line-soft); margin: 6px 8px; }
.settings-body { min-width: 0; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-item { flex-shrink: 0; align-items: center; }
  .settings-nav-item.active,
  [dir="ltr"] .settings-nav-item.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .settings-nav-text small { display: none; }
  .settings-nav-sep { width: 1px; height: auto; margin: 6px 4px; }
}

/* ── رفع الصور ── */
.imgfield { display: flex; flex-direction: column; gap: 10px; }
.imgfield-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
  min-height: 130px;
  display: grid;
  place-items: center;
}
.imgfield-preview img { display: block; max-width: 100%; height: auto; }
.imgfield-preview.is-empty { border-style: dashed; }
.imgfield-hint { color: var(--muted); font-size: .88rem; padding: 32px 12px; }
.imgfield-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.imgfield-bar label.btn { cursor: pointer; }
.imgfield-status { font-size: .84rem; color: var(--muted); }
.imgfield-status.is-good { color: var(--accent); }
.imgfield-status.is-bad { color: var(--danger); }
.imgfield-status.is-busy { opacity: .75; }

/* ── محدّد الدائرة ── */
.circlefield { display: flex; flex-direction: column; gap: 10px; }
.circlefield-stage { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; line-height: 0; touch-action: none; }
.circlefield-img { display: block; width: 100%; height: auto; }
.circlefield-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.circlefield-ring { position: absolute; border: 2px solid var(--accent); border-radius: 50%; cursor: grab; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); }
.circlefield-ring:active { cursor: grabbing; }
.circlefield-cross {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .8;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 2px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat;
}
.circlefield-grip {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  transition: transform var(--fast) var(--ease);
}
.circlefield-grip::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.circlefield-grip:hover { transform: scale(1.25); }
.circlefield-grip[data-side="e"] { inset-inline-end: -9px; top: 50%; margin-top: -9px; cursor: ew-resize; }
.circlefield-grip[data-side="w"] { inset-inline-start: -9px; top: 50%; margin-top: -9px; cursor: ew-resize; }
.circlefield-grip[data-side="n"] { top: -9px; inset-inline-start: 50%; margin-inline-start: -9px; cursor: ns-resize; }
.circlefield-grip[data-side="s"] { bottom: -9px; inset-inline-start: 50%; margin-inline-start: -9px; cursor: ns-resize; }
.circlefield-nums { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.circlefield-nums label { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); flex: 1; min-width: 150px; }
.circlefield-nums label span { white-space: nowrap; }
.circlefield-nums label em { font-style: normal; opacity: .6; }
.circlefield-nums .input-xs { width: auto; flex: 1; }
.circlefield-readout { font-variant-numeric: tabular-nums; transition: color var(--fast); }
.circlefield-readout.is-warn { color: var(--danger); }
.circlefield-none { color: var(--muted); font-size: .9rem; margin: 0; }

/* ── الحفظ ── */
.is-saving { position: relative; pointer-events: none; }
.is-saving::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent-wash), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

/* ── منطقة الخطر ── */
.danger-card { border-color: var(--danger-line); }
.danger-card .card-title .icon { color: var(--danger); }
.danger-note {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-wash);
  color: var(--danger);
  font-size: .86rem;
}
.prose p { color: var(--text-2); line-height: 1.9; }
.prose p + p { margin-top: 10px; }

/* ── صفحة «البوت مو متاح» ── */
.card-state { max-width: 640px; margin-inline: auto; text-align: center; padding: 40px 28px; }
.state-mark {
  width: 60px; height: 60px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 1.6rem;
}
.card-state h1 { font-size: 1.3rem; }
.state-text { margin-top: 10px; line-height: 1.85; }
.state-steps { text-align: start; margin: 22px auto 0; max-width: 460px; padding-inline-start: 22px; color: var(--text-2); line-height: 2; }
.state-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ── محرر الأوامر ── */
.cmd-head-save { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmd-search { position: relative; }
.cmd-search .icon { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cmd-search .input { padding-inline-start: 38px; }
.cmd-group .card-title { text-transform: capitalize; }
.cmd-row summary { gap: 12px; }
.cmd-row code { font-size: .88rem; }
.cmd-desc { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 18px; }
.cmd-row-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.cmd-row-note { font-size: .85rem; color: var(--muted); flex: 1; }
.cmd-row-note.is-good { color: var(--accent); }
.cmd-row-note.is-bad { color: var(--warn); }
.cmd-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 18px;
  margin-inline: auto;
  width: min(880px, calc(100% - 32px));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 18px;
  padding-inline-start: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--mid);
}
.cmd-bar #cmd-status { flex: 1; min-width: 0; font-size: .9rem; color: var(--text-2); }
.cmd-bar.is-dirty { border-color: var(--accent-line); }
body:has(.cmd-bar) { padding-bottom: 96px; }
.is-gone { display: none !important; }

/* ═══════════ ٨) الإدارة ═══════════ */

.admin-list { display: grid; gap: 8px; }
.admin-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--fast);
}
.admin-row[open] { border-color: var(--surface-3); }
.admin-row > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.admin-row > summary::-webkit-details-marker { display: none; }
.admin-row > summary::after {
  content: "";
  width: 8px; height: 8px;
  margin-inline-start: 6px;
  border-inline-end: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
  transition: transform var(--fast);
  flex-shrink: 0;
}
.admin-row[open] > summary::after { transform: rotate(-135deg); }
.admin-row > summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.admin-row .bot-emoji { width: 32px; height: 32px; font-size: 1rem; border-radius: 9px; }
.admin-row-id { font-size: .82rem; font-variant-numeric: tabular-nums; }
.admin-row-state { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.admin-row-body { padding: 4px 16px 16px; border-top: 1px solid var(--line-soft); }
.admin-row-body .kv { margin-top: 14px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.admin-row-static { padding: 12px 14px; }
.admin-person { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-person-meta { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.admin-person-meta strong { display: flex; align-items: center; gap: 8px; }
.admin-person-tail { display: flex; align-items: center; gap: 10px; }
.admin-added { font-size: .82rem; }

.gen-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end; }
.gen-form-wide { grid-column: span 2; }
@media (max-width: 560px) { .gen-form-wide { grid-column: auto; } }

/* ═══════════ ٩) تقرير التخريب ═══════════ */

.report { max-width: 920px; padding-block: 40px 64px; }
.rep-head { padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.rep-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--danger-wash);
  color: var(--danger);
  font-size: .78rem;
  font-weight: 650;
  margin-bottom: 12px;
}
.rep-eyebrow.is-ok { background: var(--accent-wash); color: var(--accent); }
.rep-head h2 { font-size: 1.8rem; }
.rep-window { color: var(--muted); margin-top: 6px; font-family: var(--mono); font-size: .88rem; }
.rep-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.rep-fig { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.rep-fig .n { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rep-fig .k { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.rep-fig.bad { border-color: var(--danger-line); }
.rep-fig.bad .n { color: var(--danger); }
.rep-h { font-size: .95rem; font-weight: 650; margin: 34px 0 12px; }
.rep-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rep-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 440px; }
.rep-table th, .rep-table td { text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.rep-table thead th { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--bg-elev); }
.rep-table tbody tr:last-child td { border-bottom: 0; }
.rep-table .bad, .bad { color: var(--danger); }
.rep-box {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin: 16px 0;
  line-height: 1.85;
}
.rep-box.bad { border-inline-start-color: var(--danger); color: var(--text); }
.rep-box.warn { border-inline-start-color: var(--warn); }
.rep-box.ok { border-inline-start-color: var(--accent); }
.rep-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin: 12px 0;
  font-size: .88rem;
  line-height: 1.9;
  word-break: break-word;
  color: var(--text-2);
}
.rep-list-h { font-weight: 650; margin-bottom: 6px; color: var(--text); }
.rep-more { margin-top: 8px; }
.rep-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); line-height: 1.9; }

/* ═══════════ ١٠) الحركة ═══════════ */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fade-up { animation: fadeUp .35s var(--ease) both; }
/* ⚠️ دخول الصفحة بالشفافية بس — مو transform. كروم يعامل العنصر اللي
   عليه أنيميشن transform (حتى بعد ما يخلص) كحاوية لأي عنصر fixed داخله،
   فشريط الحفظ بصفحة الأوامر كان يلزق بالحاوية مو بأسفل الشاشة ويغطي
   آخر أمر. الشفافية ما تسوي هالشي. */
main > * { animation: fadeIn .3s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .03s; }
main > *:nth-child(3) { animation-delay: .06s; }
main > *:nth-child(4) { animation-delay: .09s; }

/* اللي مطفي الحركات بجهازه (دوخة، حساسية، ذوق) نطفيها له */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 560px) {
  .page, .wrap { padding-block: 24px 48px; }
  .card { padding: 18px; }
  .hero { padding-top: 64px; }
  .section { padding-top: 56px; }
  .page-head h1 { font-size: 1.4rem; }
  .cmd-bar { flex-direction: column; align-items: stretch; }
}

@media print {
  .topbar, .footer, .btn, .cmd-bar { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ═══════════ ٩) لمسات الهوية (D10 · D11) ═══════════
   كلها من متغيرات الثيم (--font-display · --spark · --blush · --brand-soft)
   مع بديل، فبدون ثيم الصفحة نفس قبل بالضبط.
   ميزانية الزخرفة: حلقة وحدة بالهيرو، خط تحت الكلمة المميّزة، ونقطة
   بالشعار. بلا توهج ولا حركة مستمرة.
   ⚠️ --spark زخرفة بس — أبداً ما يلوّن حالة (نجاح/خطأ). */

h1, h2, h3, h4, .brand-text { font-family: var(--font-display, var(--font)); }

.hero::before { background: radial-gradient(closest-side, var(--blush, var(--accent-wash)), transparent); opacity: .6; }
.hero::after {
  /* حلقة رفيعة ورا العنوان — نفس شكل الشعار */
  content: "";
  position: absolute;
  inset-block-start: 64px;
  inset-inline-end: 6%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid var(--brand-soft, var(--accent-line));
  pointer-events: none;
  z-index: -1;
}
.hero h1 .mark {
  padding-inline: .08em;
  background: linear-gradient(transparent 64%, color-mix(in srgb, var(--spark, var(--accent)) 30%, transparent) 0);
}

.brand-mark { position: relative; }
.brand-mark::after {
  content: "";
  position: absolute;
  inset-block-start: -3px;
  inset-inline-end: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spark, transparent);
  box-shadow: 0 0 0 2px var(--bg);
}

/* صورة الهيرو: بالجوال دائرة على الوجه فوق العنوان، وبالعريض بطاقة جنبه */
.hero-art {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 18px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 66% 22%;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand-soft, var(--accent-line));
}
@media (min-width: 960px) {
  .hero-art {
    position: absolute;
    inset-block-start: 88px;
    inset-inline-end: 20px;
    width: min(320px, 30vw);
    height: auto;
    margin: 0;
    border-radius: 24px;
    object-position: 50% 50%;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    z-index: -1;
  }
  .hero:has(.hero-art)::after { display: none; }
  .hero:has(.hero-art) h1,
  .hero:has(.hero-art) > p { max-width: 58%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ═══════════ ١٠) الماسكوت ═══════════
   دائرة على الوجه (object-position) — نفس الصورة بكل الأحجام. */

.mascot {
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: 66% 22%;
  background: var(--brand-soft, var(--surface-2));
}
.mascot-xs { width: 22px; height: 22px; }
.mascot-nav { width: 32px; height: 32px; }
.mascot-md, .mascot-lg { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-soft, var(--accent-line)); }
.mascot-md { width: 88px; height: 88px; }
.mascot-lg { width: 112px; height: 112px; }

.brand-mark.has-mascot,
.auth-mark.has-mascot,
.empty-mark.has-mascot,
.state-mark.has-mascot { width: auto; height: auto; background: none; border: 0; border-radius: 0; }
.auth-mark.has-mascot, .empty-mark.has-mascot { display: flex; justify-content: center; }
.state-mark.has-mascot { position: relative; width: max-content; }
.state-badge { position: absolute; inset-block-end: -2px; inset-inline-end: -8px; font-size: 1.35rem; line-height: 1; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }

/* ═══════════ ١١) الخلفية المتحركة ═══════════
   ورا كل الصفحات. الستار بلون الخلفية (opacity مو color-mix: يشتغل بكل
   المتصفحات، وبدونه النص يطيح على الصورة). الصورة صغيرة (٤٩٨×٢٠٨)، فنغبّشها
   شوي عن قصد بدل ما تطلع مكبّرة ومكسّرة. */

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.site-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px);
  transform: scale(1.04);
}
.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: var(--bg-scrim, .8);
}

/* ═══════════ ١٢) سطوح شفافة فوق الخلفية ═══════════
   طلب المالك: صورة Reze تبيّن ورا البطاقات ولوحة البوت والقائمة الجانبية.
   بس لما فيه خلفية (body.has-site-bg) — بدونها كل شي زي أول.
   ⚠️ النص لازم يظل مقروء: الستار تحت + نسبة اللون فوق محسوبة لين أغمق/أفتح
   بكسل بالصورة ما ينزّل التباين تحت ٤٫٥:١. الفاتح يبي سطح أثقل من الداكن.
   البطاقات الكثيرة (شبكة البوتات) بدون تغبيش — تغبيش فوق فيديو بكل بطاقة
   يثقّل الجوالات. */

.has-site-bg {
  --bg-scrim: .6;
  --glass: 84%;
  --glass-soft: 70%;
  --glass-btn: 90%;
}
@media (prefers-color-scheme: dark) {
  .has-site-bg { --bg-scrim: .55; --glass: 74%; --glass-soft: 60%; }
}
/* اللي طالب شفافية أقل بجهازه ياخذ سطوح كاملة */
@media (prefers-reduced-transparency: reduce) {
  .has-site-bg { --bg-scrim: .8; --glass: 100%; --glass-soft: 100%; --glass-btn: 100%; }
}

.has-site-bg .card,
.has-site-bg .settings-nav,
.has-site-bg .auth-card,
.has-site-bg .order-card,
.has-site-bg .rep-scroll {
  background: color-mix(in srgb, var(--surface) var(--glass), transparent);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
.has-site-bg .bot-card,
.has-site-bg .pcard,
.has-site-bg .step,
.has-site-bg .fact,
.has-site-bg .admin-row,
.has-site-bg .rep-fig {
  background: color-mix(in srgb, var(--surface) var(--glass), transparent);
}
.has-site-bg .input,
.has-site-bg .check,
.has-site-bg .bot-emoji,
.has-site-bg .guild-icon,
.has-site-bg .settings-nav-item:hover,
.has-site-bg .settings-nav-item.active {
  background-color: color-mix(in srgb, var(--surface-2) var(--glass-soft), transparent);
}
.has-site-bg .input:focus { background-color: var(--surface); }
.has-site-bg .btn { --btn-bg: color-mix(in srgb, var(--accent-btn) var(--glass-btn), transparent); }
.has-site-bg .btn-ghost {
  --btn-bg: color-mix(in srgb, var(--surface-2) var(--glass-soft), transparent);
  --btn-bg-hover: color-mix(in srgb, var(--surface-3) var(--glass), transparent);
}
.has-site-bg .btn-quiet { --btn-bg: transparent; }
.has-site-bg .btn-danger { --btn-bg: var(--danger-wash); }
.has-site-bg .btn-discord { --btn-bg: var(--discord); }
