/* ==========================================================
   8OS | POLICE MOD — نظام التصميم
   لوحة الألوان مبنية على شعار 8OS: فحمي غامق + برونزي + أخضر العلم
   ========================================================== */

:root {
  --bg-0: #0c0c0c;         /* خلفية عامة غامقة جداً */
  --bg-1: #151312;         /* خلفية البطاقات */
  --bg-2: #1d1a18;         /* خلفية عناصر أعلى قليلاً */
  --bg-3: #2a2522;         /* حدود / hover */
  --line: #38302b;

  --cyan: #cc9c84;         /* البرونزي من اللوقو */
  --cyan-dim: #84543c;
  --cyan-glow: rgba(204,156,132, 0.35);

  --blurple: #5865f2;      /* لون الديسكورد الرسمي لزر تسجيل الدخول */
  --blurple-hover: #4752c4;

  --text-0: #f3ece6;
  --text-1: #bfb2a7;
  --text-2: #8a7b6f;
  --danger: #e5484d;
  --danger-dim: #3a1518;
  --success: #2f9e5e;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  --font-ar: "Tajawal", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text-0);
  font-family: var(--font-ar);
  direction: rtl;
  scroll-behavior: smooth;
}

html { background: var(--bg-0); }

/* الخلفية الفعلية تحت .bg-fx (متحركة) — البودي شفاف عشان تبان */
body {
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--cyan-glow); color: var(--text-0); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }

/* ---------------- Top Navigation ---------------- */
/* القائمة دايماً سطر واحد وبارتفاع ثابت — ما تتمدد ولا تنزل لسطر ثاني */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  background: rgba(12,12,12, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topnav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 15px;
  color: var(--text-0);
}
.topnav__brand img { width: 32px; height: 32px; border-radius: 50%; }

.topnav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto; /* لو الروابط أكثر من العرض تنسحب يمين/يسار بدال ما تنزل سطر */
  scrollbar-width: none;
}
.topnav__links::-webkit-scrollbar { display: none; }
/* توسيط بالهوامش التلقائية: لو فيه مساحة الروابط تتوسط، ولو ما فيه تبدأ من أولها بدون ما ينقص منها شي */
.topnav__links > a:first-child { margin-inline-start: auto; }
.topnav__links > a:last-child { margin-inline-end: auto; }

#account-slot { flex-shrink: 0; min-width: 130px; display: flex; justify-content: flex-end; }

.topnav__links a {
  padding: 9px 14px;
  border-radius: var(--radius-s);
  font-size: 14px;
  color: var(--text-1);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.topnav__links a:hover { background: var(--bg-2); color: var(--text-0); }
.topnav__links a.active { color: var(--cyan); background: rgba(204,156,132,0.08); }

/* ---- Discord login button ---- */
.btn-discord {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blurple);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  transition: background .15s ease, transform .1s ease;
}
.btn-discord:hover { background: var(--blurple-hover); }
.btn-discord:active { transform: scale(0.97); }
.btn-discord svg { width: 18px; height: 18px; }

/* ---- Account chip (logged-in state) ---- */
.account {
  position: relative;
}
.account__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  transition: background .15s ease, box-shadow .15s ease;
}
.account__trigger:hover,
.account__trigger[aria-expanded="true"] {
  background: rgba(204,156,132, 0.12);
  box-shadow: 0 0 0 1px var(--cyan-dim);
}
.account__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.account__name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-0);
}

.account__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.account__menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.account__menu button,
.account__menu a {
  display: block;
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  font-size: 13.5px;
  color: var(--text-1);
}
.account__menu button:hover,
.account__menu a:hover { background: var(--bg-2); color: var(--text-0); }
.account__menu .logout { color: var(--danger); }
.account__menu .logout:hover { background: var(--danger-dim); }
.account__menu hr { border: none; border-top: 1px solid var(--line); margin: 6px 2px; }

/* ---------------- Layout shell ---------------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---------------- Hero (main page) ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  align-items: start;
  padding: 28px;
  background: linear-gradient(155deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  margin-top: 24px;
}

.hero__title { font-size: 26px; font-weight: 800; margin: 0 0 10px; }
.hero__desc { color: var(--text-1); line-height: 1.9; font-size: 15px; margin: 0 0 20px; }

.hero__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-1);
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 700;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dim));
  color: #1a0f08;
  box-shadow: 0 6px 20px var(--cyan-glow);
}
.btn-primary:hover { box-shadow: 0 8px 26px var(--cyan-glow); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-0);
}
.btn-outline:hover { border-color: var(--cyan-dim); color: var(--cyan); }

.hero__logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.hero__logo-card img {
  width: 150px; height: 150px;
  filter: drop-shadow(0 10px 24px rgba(204,156,132,0.25));
}

/* ---- Rules notice banner ---- */
.notice {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--radius-m);
  background: rgba(204,156,132, 0.06);
  border: 1px solid rgba(204,156,132, 0.25);
}
.notice__text { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-0); }
.notice__text svg { flex-shrink: 0; color: var(--cyan); width: 20px; height: 20px; }
.btn-rules {
  padding: 10px 26px;
  border-radius: var(--radius-s);
  background: var(--bg-2);
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}
.btn-rules:hover { background: rgba(204,156,132,0.12); }

/* ---------------- Section cards ---------------- */
.section-title {
  font-size: 19px;
  font-weight: 800;
  margin: 40px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 4px; height: 18px;
  background: var(--cyan);
  border-radius: 4px;
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 22px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ---------------- Rules page ---------------- */
.rule-group { margin-bottom: 26px; }
.rule-group__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
  color: var(--text-1);
  line-height: 1.8;
}
.rule-item:last-child { border-bottom: none; }
.rule-item__index {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}

.rule-item__body { flex: 1; min-width: 0; }
.rules-section { margin-top: 20px; scroll-margin-top: 90px; }
.rules-section .rule-group { margin-bottom: 0; }
.rules-intro { margin: 0 0 8px; font-size: 14px; color: var(--text-0); font-weight: 600; }
.rule-cases { margin: 6px 0 0; padding-right: 22px; color: var(--text-1); }
.rule-cases li { list-style: arabic-indic; }

/* العقوبة تحت القانون */
.rule-penalty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
}
.rule-penalty__label { color: var(--text-2); font-weight: 700; }
.rule-penalty__sep { color: var(--text-2); }
.penalty-chip {
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #f5b74e;
  background: rgba(245,165,36,0.1);
  border: 1px solid rgba(245,165,36,0.3);
}
.penalty-chip.jail { color: #c9a7ff; background: rgba(155,109,255,0.1); border-color: rgba(155,109,255,0.3); }
.penalty-chip.ban { color: #ff9599; background: var(--danger-dim); border-color: rgba(229,72,77,0.4); }

/* منشن الرتبة بنفس شكل الديسكورد: لون الرتبة + خلفية شفافة من نفس اللون */
.mention {
  display: inline-block;
  padding: 0 3px;
  margin: 0 1px;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
  unicode-bidi: isolate;
  color: color-mix(in srgb, var(--c, #5865f2) 50%, #fff);
  background: color-mix(in srgb, var(--c, #5865f2) 32%, transparent);
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
}
.mention:hover { color: #fff; background: color-mix(in srgb, var(--c, #5865f2) 70%, transparent); }

/* روابط الأقسام أعلى صفحة القوانين */
.rules-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.rules-jump__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color .15s ease, color .15s ease;
}
.rules-jump__chip span { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: rgba(204,156,132,0.12); color: var(--cyan); }
.rules-jump__chip:hover { border-color: var(--cyan-dim); color: var(--cyan); }

/* ---------------- Forms (application) ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; color: var(--text-1); font-weight: 600; }
.field input,
.field select,
.field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  color: var(--text-0);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--cyan-dim); }
.field textarea { resize: vertical; min-height: 110px; }

.status-banner {
  padding: 16px 18px;
  border-radius: var(--radius-m);
  font-size: 14px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
}
.status-banner.open { background: rgba(47,158,94,0.08); border-color: var(--success); color: var(--success); }
.status-banner.closed { background: var(--danger-dim); border-color: var(--danger); color: #ff9599; }

/* ---------------- Exam ---------------- */
.exam-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.exam-progress__bar {
  flex: 1;
  height: 8px;
  border-radius: 8px;
  background: var(--bg-2);
  overflow: hidden;
}
.exam-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  transition: width .25s ease;
}
.exam-progress__label { font-size: 13px; color: var(--text-1); white-space: nowrap; }

.question-card { display: none; }
.question-card.active { display: block; }
.question-card__title { font-size: 16.5px; font-weight: 700; margin-bottom: 18px; line-height: 1.8; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  margin-bottom: 10px;
  font-size: 14.5px;
  transition: border-color .15s ease, background .15s ease;
}
.option:hover { border-color: var(--cyan-dim); }
.option input { accent-color: var(--cyan); }
.option.selected { border-color: var(--cyan); background: rgba(204,156,132,0.06); }

.exam-nav { display: flex; justify-content: space-between; margin-top: 24px; }

.exam-result {
  text-align: center;
  padding: 40px 20px;
}
.exam-result__score {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 6px;
}
.exam-result__score.pass { color: var(--success); }
.exam-result__score.fail { color: var(--danger); }

/* ---------------- Tables (report) ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--text-1); font-weight: 700; background: var(--bg-2); position: sticky; top: 0; }
tr:hover td { background: var(--bg-2); }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.pass { background: rgba(47,158,94,0.12); color: var(--success); }
.badge.fail { background: var(--danger-dim); color: #ff9599; }

/* ---------------- Admin toggle ---------------- */
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--radius-m);
  background: var(--bg-1);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.switch { position: relative; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute; inset: 0;
  background: var(--bg-3);
  border-radius: 999px;
  transition: background .2s ease;
}
.switch__track::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px; right: 3px;
  transition: transform .2s ease;
}
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track::before { transform: translateX(-20px); }

/* ---------------- Roles panel (inside main.html) ---------------- */
.roles-view { display: none; }
.roles-view.active { display: block; }

.roles-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13px;
  margin-bottom: 20px;
}
.roles-back:hover { border-color: var(--cyan-dim); color: var(--cyan); }

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.profile-head__banner {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: blur(1px);
}
.profile-head__avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 3px solid var(--bg-0);
  position: relative;
  z-index: 1;
}
.profile-head__info { position: relative; z-index: 1; }
.profile-head__name { font-size: 19px; font-weight: 800; }
.profile-head__sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.profile-head__bio { font-size: 13.5px; color: var(--text-1); margin-top: 8px; max-width: 480px; line-height: 1.7; }

.roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  min-height: 120px;
}
.role-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13px;
}
.role-chip .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------------- News ---------------- */
.news-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.news-item:last-child { border-bottom: none; }
.news-item__date { flex-shrink: 0; font-size: 12.5px; color: var(--text-2); width: 90px; }
.news-item__title { font-weight: 700; margin-bottom: 6px; }
.news-item__body { color: var(--text-1); font-size: 13.5px; line-height: 1.8; }

/* ---------------- Empty / lock states ---------------- */
.locked {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-1);
}
.locked svg { width: 48px; height: 48px; margin-bottom: 16px; color: var(--text-2); }
.locked h3 { color: var(--text-0); margin-bottom: 8px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: var(--radius-s);
  font-size: 13.5px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- الفوتر: دائماً أسفل الصفحة، ثابت وبدون حركة ---------------- */
body { display: flex; flex-direction: column; }
body > .page { flex: 1 0 auto; width: 100%; }

.footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: 40px;
  padding: 26px 24px;
  background: #080707; /* لون صلب عشان الخلفية المتحركة ما تبان من وراه */
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
}
.footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim) 30%, rgba(229,72,77,0.6) 70%, transparent);
}
.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand img { width: 38px; height: 38px; border-radius: 50%; }
.footer__brand b { display: block; color: var(--text-0); font-size: 14px; letter-spacing: .5px; }
.footer__brand span { font-size: 12px; color: var(--text-2); }
.footer__links { display: flex; gap: 4px; flex-wrap: wrap; }
.footer__links a { padding: 6px 12px; border-radius: var(--radius-s); color: var(--text-1); font-size: 13px; }
.footer__links a:hover { background: var(--bg-2); color: var(--cyan); }
.footer__copy { font-size: 12px; color: var(--text-2); }

/* ---------------- Extra buttons ---------------- */
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-pill { border-radius: 999px; padding: 9px 22px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(229,72,77,0.3); }
.btn-status {
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  color: var(--c);
}
.btn-status:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 24%, transparent); }

.status-banner.pending { background: rgba(245,165,36,0.08); border-color: #f5a524; color: #f5a524; }

.field input[readonly],
.field textarea[readonly] { color: var(--text-0); cursor: default; }
.field input[readonly]:focus,
.field textarea[readonly]:focus { border-color: var(--line); }
.field select option { background: var(--bg-2); }

/* ---------------- Report lists ---------------- */
.list-section { margin-bottom: 26px; }
.list-section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.list-section__head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.list-section__head .count {
  font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1);
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.pending { background: #f5a524; box-shadow: 0 0 8px #f5a524; }
.status-dot.accepted { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.rejected { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.list-card { padding: 0; overflow: hidden; }
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-2); }
.list-row__avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.list-empty { text-align: center; color: var(--text-2); font-size: 13.5px; padding: 22px; }

.reset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: var(--radius-m);
  background: var(--danger-dim);
  border: 1px solid rgba(229,72,77,0.4);
  margin-top: 10px;
}
.reset-bar p { margin: 6px 0 0; font-size: 13px; color: var(--text-1); }

/* ---------------- Detail view (application / suggestion) ---------------- */
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 18px;
}
.view-head .hero__title { margin: 0; }
.view-head__sub { color: var(--text-2); font-size: 13px; margin: 6px 0 0; }
.view-head .roles-back { margin: 0; flex-shrink: 0; }

.decision-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.status-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.current-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 14px; margin-bottom: 18px;
}
.current-status__by { color: var(--text-2); font-size: 12.5px; }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-1);
}
.filter-chip span { color: var(--text-2); margin-inline-start: 4px; }
.filter-chip:hover { color: var(--text-0); }
.filter-chip.active { border-color: var(--cyan-dim); color: var(--cyan); background: rgba(204,156,132,0.08); }

/* ---------------- News feed (Twitter style) ---------------- */
.news-page { max-width: 640px; }
.feed {
  margin-top: 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.composer {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.composer__body { flex: 1; min-width: 0; }
.composer textarea {
  width: 100%;
  min-height: 56px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-0);
  font-family: inherit;
  font-size: 18px;
  line-height: 1.6;
  padding: 8px 0;
}
.composer textarea::placeholder { color: var(--text-2); }
.composer__previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.composer__preview { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.composer__preview img { width: 100%; height: 100%; object-fit: cover; }
.composer__preview button {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.7); color: #fff; font-size: 12px;
}
.composer__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.composer__icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--cyan); cursor: pointer;
}
.composer__icon:hover { background: rgba(204,156,132,0.1); }
.composer__icon svg { width: 20px; height: 20px; }
.composer__count { font-size: 12px; color: var(--text-2); margin-inline-start: auto; }

.tweet {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.tweet:last-child { border-bottom: none; }
.tweet:hover { background: rgba(255,255,255,0.015); }
.tweet__avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.tweet__body { flex: 1; min-width: 0; }
.tweet__head { display: flex; align-items: center; gap: 4px; font-size: 14.5px; flex-wrap: wrap; }
.tweet__name { font-weight: 800; color: var(--text-0); }
.tweet__verified { width: 17px; height: 17px; color: var(--cyan); }
.tweet__handle, .tweet__dot, .tweet__time { color: var(--text-2); }
.tweet__handle { direction: ltr; }
.tweet__delete {
  margin-inline-start: auto;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; opacity: .5;
}
.tweet__delete:hover { opacity: 1; background: var(--danger-dim); }
.tweet__text {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tweet__text a { color: var(--cyan); }
.tweet__text a:hover { text-decoration: underline; }

.tweet__media {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.tweet__media img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.tweet__media.count-1 img { max-height: 510px; height: auto; }
.tweet__media.count-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.tweet__media.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.tweet__media.count-3 img:first-child { grid-row: span 2; }
.tweet__media.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.tweet__media img { min-height: 0; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.88);
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------------- Management (role assignment) ---------------- */
.mgmt { display: grid; grid-template-columns: 400px 1fr; gap: 18px; align-items: start; }
.mgmt__panel { display: flex; flex-direction: column; gap: 16px; }
.mgmt__step { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.mgmt__step span {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(204,156,132,0.12); color: var(--cyan); font-size: 13px;
}
.member-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.member-card img { width: 52px; height: 52px; border-radius: 50%; }
.member-card__name { font-weight: 800; }
.member-card__sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.member-card--empty { justify-content: center; color: var(--text-2); font-size: 13px; min-height: 82px; border-style: dashed; }

.mgmt__submit { justify-content: center; }
.assign-results { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.assign-results li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-s);
}
.assign-results li.ok { background: rgba(47,158,94,0.08); color: var(--success); }
.assign-results li.fail { background: var(--danger-dim); color: #ff9599; }

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(229,72,77,0.55);
  color: #ff8a8e;
}
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-dim); border-color: var(--danger); color: #fff; }

/* ==========================================================
   الحركة والخلفية المتحركة
   ========================================================== */

/* ---- طبقة الخلفية ---- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(204,156,132,0.10), transparent 55%),
    var(--bg-0);
}

/* شبكة تتحرك ببطء وتتلاشى عند الأطراف */
.bg-fx__grid {
  position: absolute;
  inset: -64px;
  background-image:
    linear-gradient(rgba(204,156,132,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204,156,132,0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
  animation: grid-drift 24s linear infinite;
}
@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(64px, 64px, 0); }
}

/* أضواء الدورية: أحمر وأزرق يتناوبون بهدوء */
.bg-fx__siren {
  position: absolute;
  top: -220px;
  width: 520px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0;
}
.bg-fx__siren--red  { right: -120px; background: rgba(229,72,77,0.55); animation: siren 6s ease-in-out infinite; }
.bg-fx__siren--blue { left: -120px;  background: rgba(31,122,69,0.55); animation: siren 6s ease-in-out infinite 3s; }
@keyframes siren {
  0%, 100% { opacity: 0; }
  20%      { opacity: .28; }
  30%      { opacity: .08; }
  40%      { opacity: .24; }
  60%      { opacity: 0; }
}

/* كرات ضوئية تسبح */
.bg-fx__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
}
.bg-fx__orb--1 { width: 420px; height: 420px; top: 20%; left: 8%;   background: rgba(204,156,132,0.35); animation: orb-1 26s ease-in-out infinite; }
.bg-fx__orb--2 { width: 360px; height: 360px; top: 55%; right: 6%;  background: rgba(132,84,60,0.40); animation: orb-2 32s ease-in-out infinite; }
.bg-fx__orb--3 { width: 280px; height: 280px; bottom: -80px; left: 40%; background: rgba(88,101,242,0.30); animation: orb-3 22s ease-in-out infinite; }
@keyframes orb-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px, 80px) scale(1.15); } }
@keyframes orb-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-140px,-60px) scale(.9); } }
@keyframes orb-3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-90px,-120px); } }

/* خط مسح ينزل من فوق لتحت */
.bg-fx__scan {
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  background: linear-gradient(180deg, transparent, rgba(204,156,132,0.05), transparent);
  animation: scan 9s linear infinite;
}
@keyframes scan {
  from { transform: translateY(-160px); }
  to   { transform: translateY(110vh); }
}

/* جزيئات صغيرة تطلع لفوق */
.bg-fx__particles span {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation-name: float-up;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes float-up {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(18px, -55vh, 0); }
  100% { transform: translate3d(-12px, -110vh, 0); opacity: 0; }
}

/* ---- الناف بار ---- */
.topnav { transition: box-shadow .25s ease, background .25s ease; }
.topnav.scrolled { box-shadow: 0 8px 30px rgba(0,0,0,0.45); background: rgba(12,12,12,0.92); }
.topnav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: nav-line 6s ease-in-out infinite;
  opacity: .7;
}
@keyframes nav-line {
  0%, 100% { background-position: -50% 0; }
  50%      { background-position: 150% 0; }
}
.topnav__brand img { transition: transform .4s ease, filter .4s ease; }
.topnav__brand:hover img { transform: rotate(-12deg) scale(1.08); filter: drop-shadow(0 0 8px var(--cyan-glow)); }

.topnav__links a { position: relative; }
.topnav__links a::after {
  content: "";
  position: absolute;
  bottom: 3px; left: 50%; right: 50%;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: left .2s ease, right .2s ease;
}
.topnav__links a:hover::after,
.topnav__links a.active::after { left: 14px; right: 14px; }

/* ---- دخول العناصر ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page > *,
.list-row,
.tweet,
.locked,
.question-card.active {
  /* backwards (مو both) عشان بعد ما تخلص الحركة ما تمنع تأثيرات الهوفر والميلان */
  animation: fade-up .5s cubic-bezier(.2,.7,.2,1) backwards;
}
.page > *:nth-child(2) { animation-delay: .06s; }
.page > *:nth-child(3) { animation-delay: .12s; }
.page > *:nth-child(4) { animation-delay: .18s; }
.page > *:nth-child(5) { animation-delay: .24s; }
.page > *:nth-child(n+6) { animation-delay: .3s; }
.list-row:nth-child(2), .tweet:nth-child(2) { animation-delay: .04s; }
.list-row:nth-child(3), .tweet:nth-child(3) { animation-delay: .08s; }
.list-row:nth-child(4), .tweet:nth-child(4) { animation-delay: .12s; }
.list-row:nth-child(5), .tweet:nth-child(5) { animation-delay: .16s; }
.list-row:nth-child(n+6), .tweet:nth-child(n+6) { animation-delay: .2s; }

/* ---- الهيرو ---- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(204,156,132,0.07) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: sheen 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%, 100% { background-position: 120% 0; }
  50%      { background-position: -20% 0; }
}
.hero > * { position: relative; }

.hero__title {
  background: linear-gradient(90deg, var(--text-0) 0%, var(--text-0) 40%, var(--cyan) 50%, var(--text-0) 60%, var(--text-0) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shine 6s ease-in-out infinite;
}
@keyframes title-shine {
  0%, 100% { background-position: 100% 0; }
  50%      { background-position: 0% 0; }
}

/* الشعار مع حلقتين يلفون حوله */
.hero__logo-card { position: relative; min-height: 260px; justify-content: center; }
.hero__logo-card::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  border: 1px dashed rgba(204,156,132,0.35);
  animation: spin 22s linear infinite;
}
.hero__logo-card::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 240px; height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--cyan);
  border-bottom-color: rgba(229,72,77,0.6);
  animation: spin 9s linear infinite reverse;
  opacity: .5;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__logo-card img { position: relative; z-index: 1; animation: logo-float 5s ease-in-out infinite; }
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.pill .dot { animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,158,94,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(47,158,94,0); }
}

/* ---- الأزرار ---- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  left: -60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn-primary:hover:not(:disabled)::after { left: 120%; }
.btn-primary:hover:not(:disabled), .btn-outline:hover:not(:disabled) { transform: translateY(-1px); }

/* ---- البطاقات ---- */
.card {
  background: linear-gradient(160deg, rgba(29,26,24,0.85), rgba(21,19,18,0.85));
  backdrop-filter: blur(6px);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
a.card:hover {
  border-color: var(--cyan-dim);
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.4), 0 0 0 1px rgba(204,156,132,0.15);
}
.list-card, .feed, .admin-bar, .profile-head, .roles-grid { backdrop-filter: blur(6px); }
.list-card { background: rgba(21,19,18,0.85); }
.feed { background: rgba(21,19,18,0.85); }

.notice { position: relative; overflow: hidden; }
.notice::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: notice-blink 2.4s ease-in-out infinite;
}
@keyframes notice-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.toast { box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: var(--cyan-dim); }

/* ==========================================================
   المستوى الأسطوري 🚨
   ========================================================== */

/* ---- شاشة الدخول ---- */
.intro-lock, .intro-lock body { overflow: hidden; }
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #1a1512, #050505 70%);
  transition: opacity .6s ease, visibility .6s ease;
}
.intro.done { opacity: 0; visibility: hidden; }
.intro.done .intro__core { transform: scale(1.35); }
.intro__lights span {
  position: absolute;
  top: -30%;
  width: 60vw; height: 60vh;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0;
}
.intro__lights .r { right: -10vw; background: #e5484d; animation: intro-flash .7s steps(1) infinite; }
.intro__lights .b { left: -10vw;  background: #1f7a45; animation: intro-flash .7s steps(1) infinite .35s; }
@keyframes intro-flash { 0% { opacity: .35; } 50% { opacity: 0; } }
.intro__core {
  position: relative;
  width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .6s ease;
}
.intro__core img { width: 112px; height: 112px; animation: intro-pop .8s cubic-bezier(.2,1.4,.4,1) both; }
.intro__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--cyan);
  border-left-color: rgba(229,72,77,0.85);
  box-shadow: 0 0 30px rgba(204,156,132,0.2);
  animation: spin .9s linear infinite;
}
@keyframes intro-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.intro__title {
  direction: ltr;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 4px;
  animation: intro-text 1s ease both .2s;
}
.intro__title span { color: var(--cyan); }
@keyframes intro-text {
  from { opacity: 0; letter-spacing: 16px; filter: blur(6px); }
  to   { opacity: 1; letter-spacing: 4px;  filter: blur(0); }
}
.intro__bar { width: 220px; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.intro__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #e5484d, var(--cyan), #1f7a45);
  transform-origin: right;
  animation: intro-bar 1.2s ease-out both;
}
@keyframes intro-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- ضوء الماوس ---- */
.cursor-glow {
  position: fixed;
  top: -300px; left: -300px;
  width: 600px; height: 600px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(204,156,132,0.08), transparent 60%);
  opacity: 0;
  transition: opacity .4s ease;
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* ---- بقعة ضوء داخل البطاقات ---- */
.card, .list-row, .tweet, .admin-bar, .ql-card { position: relative; }
.card::after,
.list-row::after,
.tweet::after,
.admin-bar::after,
.ql-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, -500px) var(--my, -500px), var(--spot, rgba(204,156,132,0.09)), transparent 45%);
  opacity: 0;
  transition: opacity .3s ease;
}
.card:hover::after,
.list-row:hover::after,
.tweet:hover::after,
.admin-bar:hover::after,
.ql-card:hover::after { opacity: 1; }

/* ---- التموّج عند الضغط ---- */
.btn, .btn-discord, .btn-rules, .filter-chip { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  pointer-events: none;
  animation: ripple .65s ease-out forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---- الميلان ثلاثي الأبعاد ---- */
[data-tilt] { transition: transform .35s cubic-bezier(.2,.8,.2,1); will-change: transform; }
[data-tilt].tilting { transition: transform .08s linear; }

/* ---- الظهور عند النزول ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---- الهيرو ---- */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 60%, var(--cyan) 75%, rgba(229,72,77,0.9) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-spin 6s linear infinite;
}
@keyframes border-spin { to { --angle: 360deg; } }
.hero { padding: 36px; box-shadow: 0 30px 80px rgba(0,0,0,0.35); }
.hero .hero__title { font-size: 42px; line-height: 1.2; letter-spacing: .5px; }

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  margin-bottom: 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(204,156,132,0.08);
  border: 1px solid rgba(204,156,132,0.3);
}
.hero__kicker-dot { width: 8px; height: 8px; border-radius: 50%; animation: siren-dot 1s steps(1) infinite; }
@keyframes siren-dot {
  0%  { background: #ff4d55; box-shadow: 0 0 10px #ff4d55; }
  50% { background: #2f9e5e; box-shadow: 0 0 10px #2f9e5e; }
}

/* عناوين الصفحات: خط ملوّن تحت الوصف */
.hero__title + .hero__desc::after {
  content: "";
  display: block;
  width: 90px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), rgba(229,72,77,0.85));
  box-shadow: 0 0 12px var(--cyan-glow);
}
.page > h1.hero__title, #report-heading > h1, #sr-heading > h1 { font-size: 32px; }

/* ---- شريط الأخبار العاجلة ---- */
.ticker {
  display: flex;
  align-items: stretch;
  margin-top: 20px;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid rgba(229,72,77,0.35);
  background: rgba(21,19,18,0.85);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 30px rgba(229,72,77,0.08);
}
.ticker[hidden] { display: none; }
.ticker__label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #e5484d, #9e2327);
  position: relative;
  z-index: 1;
}
.ticker__dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse-white 1s ease-in-out infinite; }
@keyframes pulse-white {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}
.ticker__track {
  flex: 1;
  overflow: hidden;
  padding: 13px 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker__inner { display: flex; width: max-content; animation: ticker 30s linear infinite; }
.ticker:hover .ticker__inner { animation-play-state: paused; }
.ticker__item { position: relative; padding: 0 30px; font-size: 14px; white-space: nowrap; color: var(--text-0); }
.ticker__item::after {
  content: "◆";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--danger);
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---- الإحصائيات ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.stat {
  position: relative;
  overflow: hidden;
  padding: 20px 16px;
  text-align: center;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, rgba(29,26,24,0.85), rgba(21,19,18,0.85));
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
.stat__icon { font-size: 20px; }
.stat__num {
  direction: ltr;
  margin: 6px 0 2px;
  font-size: 30px;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--cyan-glow);
}
.stat__label { font-size: 12.5px; color: var(--text-1); }
.stat__num small { font-size: 16px; font-weight: 700; color: var(--text-2); text-shadow: none; }

/* حالة سيرفر الفايف ام بالهيرو */
.pill.offline { color: #ff9599; border-color: rgba(229,72,77,0.4); }
.pill.offline .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: none; }

/* ---- الروابط السريعة ---- */
.ql-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ql-card {
  --spot: color-mix(in srgb, var(--c) 14%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, rgba(29,26,24,0.9), rgba(21,19,18,0.9));
  border: 1px solid var(--line);
  transition: border-color .25s ease, box-shadow .25s ease, opacity .7s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}
.ql-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
}
.ql-card:hover {
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45), 0 0 34px color-mix(in srgb, var(--c) 18%, transparent);
}
.ql-card__icon {
  width: 52px; height: 52px;
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .3s cubic-bezier(.3,1.5,.5,1);
}
.ql-card:hover .ql-card__icon { transform: scale(1.12) rotate(-8deg); }
.ql-card strong { font-size: 15.5px; }
.ql-card p { flex: 1; margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-1); }
.ql-card__go { margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--c); transition: transform .25s ease; }
.ql-card:hover .ql-card__go { transform: translateX(-6px); }

/* ---- لمسات عامة ---- */
.topnav__brand span {
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.account__avatar { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 3px var(--cyan-dim); }
.section-title::before { box-shadow: 0 0 12px var(--cyan); }
.field input:focus, .field select:focus, .field textarea:focus, .mgmt__search input:focus {
  box-shadow: 0 0 0 3px rgba(204,156,132,0.14);
}
.locked svg { animation: logo-float 3.5s ease-in-out infinite; }
.exam-progress__fill { position: relative; overflow: hidden; box-shadow: 0 0 12px var(--cyan-glow); }
.exam-progress__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.rule-item { transition: background .2s ease, padding .2s ease; border-radius: var(--radius-s); }
.rule-item:hover { background: rgba(204,156,132,0.04); padding-right: 10px; }

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan-dim), #3c2a1e);
  border: 2px solid var(--bg-0);
}

/* ==========================================================
   قائمة الرتب بشكل الديسكورد
   ========================================================== */
.dpick {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: #111214;
  border: 1px solid #1e1f22;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  overflow: hidden;
}
.dpick__search { padding: 10px; }
.dpick__search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  background: #1e1f22;
  border: 2px solid #1e1f22;
  color: #dbdee1;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
.dpick__search input::placeholder { color: #80848e; }
.dpick__search input:focus { border-color: #5865f2; }
.dpick__list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0 6px 8px;
  scrollbar-width: thin;
  scrollbar-color: #1a1b1e transparent;
}
.dpick__list::-webkit-scrollbar { width: 8px; }
.dpick__list::-webkit-scrollbar-thumb { background: #2b2d31; border: none; border-radius: 8px; }
.dpick__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 4px;
  color: #b5bac1;
  font-size: 14px;
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
}
.dpick__row:hover { background: rgba(78,80,88,0.3); color: #dbdee1; }
.dpick__dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dpick__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpick__badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: #b5bac1;
}
.dpick__badge.has { background: rgba(47,158,94,0.12); color: var(--success); }
.dpick__badge.warn { background: rgba(245,165,36,0.12); color: #f5b74e; }
.dpick__check {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.dpick__row.selected { background: rgba(88,101,242,0.16); color: #fff; }
.dpick__row.removing.selected { background: rgba(237,66,69,0.14); }
.dpick__row.removing.selected .dpick__check { background: #ed4245; }
.dpick__row.disabled { cursor: default; opacity: .55; }
.dpick__row.disabled:hover { background: transparent; }
.dpick__empty { padding: 22px 10px; text-align: center; color: #80848e; font-size: 13px; }

/* الرتبة اللي ما يقدر عليها: خط أحمر من اليمين لليسار + مؤشر 🚫 */
.dpick__row.denied,
.dpick__row.denied *,
.perm-quick__chip.denied {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28'><text x='2' y='22' font-size='22'>🚫</text></svg>") 14 14, not-allowed;
}
.dpick__row.denied { color: #6d6f78; }
.dpick__row.denied:hover { background: rgba(237,66,69,0.06); }
.dpick__row.denied .dpick__dot { opacity: .45; }
.dpick__row.denied::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px; top: 50%;
  height: 2px;
  border-radius: 2px;
  background: #ed4245;
  box-shadow: 0 0 6px rgba(237,66,69,0.5);
  transform-origin: right;
  pointer-events: none;
}
.dpick__row.denied:hover::after { animation: strike .25s ease; }
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ألوان حالة الصلاحية بصفحة الصلاحيات */
.dpick__row.mode-give { box-shadow: inset -3px 0 0 var(--success); }
.dpick__row.mode-both { box-shadow: inset -3px 0 0 var(--cyan); }

/* الرتب المختارة (فوق القائمة) */
.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.picked:empty { display: none; }
.picked__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 4px;
  background: #232428;
  border: 1px solid rgba(88,101,242,0.6);
  color: #dbdee1;
  font-size: 12.5px;
  animation: fade-up .2s ease backwards;
}
.picked__chip.remove { border-color: rgba(237,66,69,0.6); }
.picked__chip button {
  width: 18px; height: 18px;
  border-radius: 50%;
  color: #b5bac1;
  font-size: 14px;
  line-height: 1;
}
.picked__chip button:hover { background: #ed4245; color: #fff; }

/* ==========================================================
   البحث عن عضو (كل أعضاء السيرفر)
   ========================================================== */
.mpick { display: flex; flex-direction: column; gap: 8px; }
.mpick__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  background: #1e1f22;
  border: 2px solid #1e1f22;
  transition: border-color .15s ease;
}
.mpick__search:focus-within { border-color: #5865f2; }
.mpick__search svg { width: 16px; height: 16px; color: #80848e; flex-shrink: 0; }
.mpick__search input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: #dbdee1;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.mpick__meta { font-size: 12px; color: var(--text-2); padding: 0 2px; }
.mpick__meta:empty { display: none; }
.mpick__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px;
  border-radius: 8px;
  background: #111214;
  border: 1px solid #1e1f22;
}
.mpick__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  text-align: right;
  color: #dbdee1;
  transition: background .1s ease;
}
.mpick__row:hover { background: rgba(78,80,88,0.3); }
.mpick__row.selected { background: rgba(88,101,242,0.2); box-shadow: inset -3px 0 0 #5865f2; }
.mpick__row img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.mpick__names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mpick__names b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpick__names small { font-size: 11.5px; color: #949ba4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.mpick__role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 40%;
  padding: 2px 8px;
  border-radius: 4px;
  background: #232428;
  font-size: 11.5px;
  color: #b5bac1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.mpick__role i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mpick__more {
  margin: 4px;
  padding: 8px;
  border-radius: 6px;
  background: #1e1f22;
  color: #b5bac1;
  font-size: 13px;
  font-weight: 700;
}
.mpick__more:hover { background: #2b2d31; color: #fff; }

/* بحث تقرير التقديمات */
.report-search { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.report-search .perm-search { flex: 1; }
.report-search__count { font-size: 13px; color: var(--text-2); white-space: nowrap; }

/* ---- صفحة الإدارة ---- */
.mgmt__side { display: flex; flex-direction: column; gap: 18px; }
.mgmt-level {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: rgba(21,19,18,0.8);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.mgmt-level__label { font-size: 13px; color: var(--text-2); }
.mgmt-level__chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #f5c84c;
  background: rgba(245,200,76,0.1);
  border: 1px solid rgba(245,200,76,0.35);
}
.mgmt-level__perm { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.mgmt-level__perm.give { color: var(--success); background: rgba(47,158,94,0.1); }
.mgmt-level__perm.remove { color: #ff9599; background: var(--danger-dim); }
.mgmt-level__perm.give { margin-inline-start: auto; }

.mgmt__step-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.seg {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.seg button {
  position: relative;
  z-index: 1;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-1);
  transition: color .25s ease;
}
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg__glider {
  position: absolute;
  top: 4px; bottom: 4px; right: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dim));
  box-shadow: 0 4px 16px var(--cyan-glow);
  transition: transform .35s cubic-bezier(.3,1.4,.5,1), background .3s ease, box-shadow .3s ease;
}
.seg[data-mode="remove"] .seg__glider {
  transform: translateX(-100%);
  background: linear-gradient(135deg, #ff6b6f, var(--danger));
  box-shadow: 0 4px 16px rgba(229,72,77,0.4);
}
.seg[data-mode="give"] button[data-mode="give"] { color: #1a0f08; }
.seg[data-mode="remove"] button[data-mode="remove"] { color: #fff; }

.member-card:not(.member-card--empty) { flex-direction: column; align-items: stretch; gap: 12px; }
.member-card__top { display: flex; align-items: center; gap: 12px; }
.member-card__top img { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--cyan-dim), 0 0 20px var(--cyan-glow); }
.member-card__roles { display: flex; flex-wrap: wrap; gap: 6px; }
.member-card__roles .role-chip { font-size: 12px; padding: 5px 10px 5px 7px; }
.member-card--loading { animation: notice-blink 1s ease-in-out infinite; }


.mgmt-log { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.mgmt-log__item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-s);
  background: var(--bg-2);
  border-right: 3px solid var(--success);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-1);
}
.mgmt-log__item.remove { border-right-color: var(--danger); }
.mgmt-log__item img { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.mgmt-log__item b { color: var(--text-0); }
.mgmt-log__item time { font-size: 11px; color: var(--text-2); }
.mgmt-log__roles { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.mgmt-log__roles span { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: rgba(47,158,94,0.1); color: var(--success); }
.mgmt-log__item.remove .mgmt-log__roles span { background: var(--danger-dim); color: #ff9599; }

/* ---- صفحة صلاحيات الإدارة ---- */
.perm-source {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  font-size: 13.5px;
  backdrop-filter: blur(6px);
}
.perm-source.config { background: rgba(245,165,36,0.08); border: 1px solid rgba(245,165,36,0.4); color: #f5c06a; }
.perm-source.site { background: rgba(47,158,94,0.07); border: 1px solid rgba(47,158,94,0.35); color: var(--success); }

.perm-section { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }

.perm-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 0 14px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  border: 1px solid var(--line);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.perm-search:focus-within { border-color: var(--cyan-dim); box-shadow: 0 0 0 3px rgba(204,156,132,0.14); }
.perm-search svg { width: 18px; height: 18px; color: var(--text-2); flex-shrink: 0; }
.perm-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-0);
  font-family: inherit;
  font-size: 14px;
}

.perm-quick .dot, .perm-selected .dot, .perm-card .dot, .picked__chip .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.perm-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.perm-quick__label { font-size: 12.5px; color: var(--text-2); }
.perm-quick__chip { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.perm-quick__chip:hover:not(:disabled) { border-color: var(--cyan-dim); }
.perm-quick__chip.active { border-color: var(--cyan); background: rgba(204,156,132,0.12); color: var(--cyan); }
.perm-quick__chip.denied { opacity: .5; }

.perm-editor__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.perm-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 10%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 15%, transparent);
}
.perm-mini { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.perm-mini.give { color: var(--success); background: rgba(47,158,94,0.1); }
.perm-mini.both { color: var(--cyan); background: rgba(204,156,132,0.1); }

.perm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.perm-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.perm-legend span { display: flex; align-items: center; gap: 6px; }
.perm-legend i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--line); position: relative; }
.perm-legend i.give { border-color: var(--success); background: rgba(47,158,94,0.25); }
.perm-legend i.both { border-color: var(--cyan); background: rgba(204,156,132,0.25); }
.perm-legend i.denied::after {
  content: "";
  position: absolute;
  left: -3px; right: -3px; top: 50%;
  height: 2px;
  background: #ed4245;
}

/* أزرار الحالة داخل صف الرتبة (صفحة الصلاحيات) */
.perm-seg {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-0);
  border: 1px solid var(--line);
}
.perm-seg button {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-2);
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.perm-seg button:hover:not(:disabled) { color: var(--text-0); }
.perm-seg[data-mode="none"] button[data-set="none"] { background: var(--bg-3); color: var(--text-0); }
.perm-seg[data-mode="give"] button[data-set="give"] { background: linear-gradient(135deg, #3fb06b, #1d6f3f); color: #1a0f08; box-shadow: 0 2px 10px rgba(47,158,94,0.35); }
.perm-seg[data-mode="both"] button[data-set="both"] { background: linear-gradient(135deg, var(--cyan), var(--cyan-dim)); color: #1a0f08; box-shadow: 0 2px 10px var(--cyan-glow); }

.perm-savebar {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: rgba(21,19,18,0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.perm-savebar__msg { flex: 1; font-size: 13px; color: var(--text-2); }
.perm-savebar.dirty { border-color: rgba(245,165,36,0.55); box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 24px rgba(245,165,36,0.12); }
.perm-savebar.dirty .perm-savebar__msg { color: #f5c06a; font-weight: 700; }

.perm-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.perm-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, rgba(29,26,24,0.9), rgba(21,19,18,0.9));
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.perm-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
}
.perm-card:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: 0 14px 34px rgba(0,0,0,0.4); }
.perm-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.perm-card__head b { flex: 1; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-card__count { font-size: 12px; color: var(--text-2); }
.perm-card__lock { font-size: 12px; color: var(--text-2); }
.perm-card__list { padding: 6px 8px 10px; }
.perm-card__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-s);
  font-size: 13px;
}
.perm-card__list li:hover { background: rgba(255,255,255,0.03); }
.perm-card__role { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-badge { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.perm-badge.give { color: var(--success); background: rgba(47,158,94,0.1); border: 1px solid rgba(47,158,94,0.35); }
.perm-badge.both { color: var(--cyan); background: rgba(204,156,132,0.1); border: 1px solid rgba(204,156,132,0.35); }

/* ==========================================================
   صفحة إدارة المحتوى
   ========================================================== */
.ce-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: var(--radius-m);
  background: rgba(21,19,18,0.8);
  border: 1px solid var(--line);
}
.ce-tab {
  flex: 1;
  min-width: 140px;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  transition: background .15s ease, color .15s ease;
}
.ce-tab:hover { background: var(--bg-2); color: var(--text-0); }
.ce-tab.active { background: linear-gradient(135deg, var(--cyan), var(--cyan-dim)); color: #1a0f08; box-shadow: 0 4px 16px var(--cyan-glow); }
.ce-dot { color: #f5a524; font-size: 12px; }
.ce-tab.active .ce-dot { color: #7a4b00; }

.ce-savebar { margin-top: 18px; }
.ce-meta { font-size: 12px; color: var(--text-2); }

.ce-toolbar { position: sticky; top: 70px; z-index: 6; margin-bottom: 16px; padding: 14px 16px; }
.ce-toolbar__help { font-size: 13px; color: var(--text-1); line-height: 1.9; }
.ce-toolbar__help code, .ce-vars code {
  direction: ltr;
  unicode-bidi: isolate;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--cyan);
  font-size: 12px;
}
.ce-toolbar__help kbd { padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 11.5px; }
.ce-toolbar__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ce-mention-btn { background: rgba(88,101,242,0.2); color: #c9cdfb; border: 1px solid rgba(88,101,242,0.5); }
.ce-mention-btn:hover { background: rgba(88,101,242,0.35); }
.ce-token { background: var(--bg-2); border: 1px solid var(--line); padding: 4px 8px; }
.ce-token .penalty-chip { pointer-events: none; }
.ce-mention-pop { margin-top: 10px; max-width: 420px; }
.ce-mention-pop[hidden] { display: none; }

.ce-section { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.ce-section__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ce-icon-input { width: 54px; text-align: center; font-size: 18px; }
.ce-title-input { flex: 1; min-width: 200px; font-size: 16px; font-weight: 800; }
.ce-count { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.ce-actions { display: flex; gap: 4px; }
.ce-actions--col { flex-direction: column; }
.ce-icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-1);
  font-size: 11px;
}
.ce-icon-btn:hover:not(:disabled) { border-color: var(--cyan-dim); color: var(--cyan); }
.ce-icon-btn.danger:hover:not(:disabled) { border-color: var(--danger); color: #ff8a8e; background: var(--danger-dim); }
.ce-icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* كل الخانات بصفحة المحتوى */
#ce-root input[type=text],
#ce-root input[type=number],
#ce-root textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  resize: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#ce-root input:focus, #ce-root textarea:focus { border-color: var(--cyan-dim); box-shadow: 0 0 0 3px rgba(204,156,132,0.14); }
/* (input. عشان تغلب قاعدة input[type=text] اللي فوق) */
#ce-root input.ce-title-input { width: auto; flex: 1; min-width: 200px; }
#ce-root input.ce-icon-input { width: 56px; flex: 0 0 56px; text-align: center; font-size: 18px; padding: 8px 4px; }
.ce-intro { font-weight: 600; }

.ce-rules { display: flex; flex-direction: column; gap: 8px; }
.ce-rule {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: var(--radius-m);
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line);
}
.ce-rule__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#ce-root .ce-penalty-input { font-size: 13px; padding: 7px 12px; }
.ce-preview {
  padding: 8px 12px;
  border-radius: var(--radius-s);
  border-right: 3px solid var(--cyan-dim);
  background: rgba(204,156,132,0.04);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-1);
}
.ce-preview .rule-penalty { margin-top: 4px; }
.ce-preview__empty { color: var(--text-2); font-size: 12px; }
.ce-add-big { width: 100%; justify-content: center; padding: 14px; border-style: dashed; }

.ce-exam-settings { margin-bottom: 16px; }
.ce-question { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.ce-question__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ce-options { display: flex; flex-direction: column; gap: 6px; }
.ce-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
}
.ce-option input[type=radio] { width: 18px; height: 18px; accent-color: var(--success); flex-shrink: 0; cursor: pointer; }
.ce-option.correct { border-color: rgba(47,158,94,0.45); background: rgba(47,158,94,0.06); }
.ce-correct-tag { font-size: 11.5px; font-weight: 800; color: var(--success); white-space: nowrap; }

.ce-label { font-size: 12.5px; color: var(--text-2); margin: 8px 0 6px; font-weight: 700; }
.ce-site-preview { margin-top: 0; }

.ce-messages { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.ce-message { display: flex; flex-direction: column; }
.ce-vars { font-size: 12px; color: var(--text-2); }
.ce-color input[type=color] {
  width: 64px; height: 36px;
  padding: 2px;
  border-radius: var(--radius-s);
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
}
/* معاينة رسالة الديسكورد */
.ce-embed {
  padding: 10px 14px;
  border-radius: 4px;
  background: #2b2d31;
  border-right: 4px solid var(--c, #99aab5);
  color: #dbdee1;
  font-size: 13.5px;
  line-height: 1.6;
}
.ce-embed__title { font-weight: 800; margin-bottom: 4px; color: #fff; }

/* احترام إعداد تقليل الحركة بالجهاز */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .bg-fx__particles, .bg-fx__scan, .cursor-glow { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .bg-fx__siren { width: 300px; height: 260px; }
  .bg-fx__orb { filter: blur(50px); }
  .hero { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  /* بالجوال: سطر للشعار والحساب + سطر ثابت للروابط (ينسحب بالعرض) — الارتفاع ما يتغير */
  .topnav { flex-wrap: wrap; height: auto; padding: 8px 14px 0; row-gap: 2px; }
  .topnav__brand { order: 1; }
  #account-slot { order: 2; min-width: 0; }
  .topnav__links { order: 3; flex: 0 0 100%; height: 46px; justify-content: flex-start; }
  .account__name { max-width: 110px; }
  .mgmt { grid-template-columns: 1fr; }
  .list-row { flex-wrap: wrap; }
  .stats, .ql-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 24px; }
  .hero .hero__title { font-size: 32px; }
}
@media (max-width: 520px) {
  .ql-grid { grid-template-columns: 1fr; }
  .perm-overview { grid-template-columns: 1fr; }
  .stat__num { font-size: 24px; }
  /* الجوال الصغير: الشعار بدون النص + اسم الحساب أقصر عشان يبقون بنفس السطر */
  .topnav__brand span { display: none; }
  .account__name { max-width: 90px; }
  .ticker__label { padding: 0 12px; }
  .mgmt-level__perm.give { margin-inline-start: 0; }
}

/* ---------------- صفحة "فعل نفسك" ---------------- */
.field-hint { font-size: 12.5px; color: var(--text-2); margin-top: -4px; }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 16px; }
.activation-code {
  display: inline-block;
  margin: 14px 0 10px;
  padding: 10px 28px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--cyan);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  direction: rtl;
}

/* قطاعات "فعل نفسك": بطاقات جنب بعض وتحتها الأكواد */
.sector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.sector-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px 14px; text-align: center; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-m);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.sector-card:hover { border-color: var(--cyan-dim); transform: translateY(-2px); }
.sector-card input { position: absolute; opacity: 0; pointer-events: none; }
.sector-card:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-glow); }
.sector-card:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sector-card__icon { font-size: 28px; line-height: 1; }
.sector-card__name { font-weight: 800; color: var(--text-0); font-size: 15px; }
.sector-card__codes {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--cyan); font-weight: 700;
}
.sector-card__codes small { color: var(--text-2); font-weight: 500; }
.sector-card__next { font-size: 12px; color: var(--text-1); }
.sector-card__next b { color: var(--text-0); }
.sector-card.is-full { opacity: .45; cursor: not-allowed; }
.sector-card.is-full:hover { transform: none; border-color: var(--line); }


/* ===== واجهة واحدة: انتقالات + 3D ===== */
#stage{flex:1 0 auto;width:100%;position:relative;perspective:1400px;perspective-origin:50% 25%;overflow-x:clip}
.view{transform-style:preserve-3d}.view[hidden]{display:none}
.v-out{position:absolute;top:0;left:0;right:0;pointer-events:none;animation:vOut .62s cubic-bezier(.6,0,.2,1) forwards}
.v-in{animation:vIn .7s cubic-bezier(.2,.8,.2,1) both}
@keyframes vOut{to{opacity:0;filter:blur(6px);transform:translateZ(-420px) rotateY(calc(var(--d)*-38deg)) translateX(calc(var(--d)*-16%))}}
@keyframes vIn{from{opacity:0;filter:blur(6px);transform:translateZ(-420px) rotateY(calc(var(--d)*38deg)) translateX(calc(var(--d)*16%))}}
#fx-sweep{position:fixed;inset:0;z-index:9000;pointer-events:none;transform:translateX(-120%);
  background:linear-gradient(100deg,transparent 30%,rgba(229,72,77,.32) 45%,rgba(88,101,242,.32) 55%,transparent 70%)}
#fx-sweep.go{animation:fxSweep .7s ease}
@keyframes fxSweep{to{transform:translateX(120%)}}
#fx3d{position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.55}
.hero__logo-card{transform-style:preserve-3d;animation:logo3d 9s ease-in-out infinite}
.hero__logo-card img{transform:translateZ(60px);filter:drop-shadow(0 30px 40px rgba(0,0,0,.5))}
@keyframes logo3d{0%,100%{transform:perspective(900px) rotateY(-14deg) rotateX(4deg)}50%{transform:perspective(900px) rotateY(14deg) rotateX(-4deg)}}
@media (prefers-reduced-motion:reduce){.hero__logo-card{animation:none}.v-in,.v-out{animation:none}}

/* ---------------- المتجر ---------------- */
.store-cart {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; padding: 7px 16px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-1); font-size: 13.5px; font-weight: 700;
}
.store-cart b { color: var(--cyan); }

.store-admin { margin-top: 20px; }
.store-admin__title { margin: 0 0 14px; font-size: 16px; font-weight: 800; }
.store-admin__row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.store-admin__bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.store-admin__bar .btn { margin-inline-start: auto; }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.product {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 12px 14px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: 22px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.product:hover { border-color: var(--cyan-dim); box-shadow: 0 10px 30px rgba(204,156,132,0.12); transform: translateY(-2px); }

.product__media { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--bg-0); }
.product__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product__badge {
  position: absolute; top: 10px; inset-inline-end: 10px;
  padding: 5px 14px; border-radius: 12px;
  background: rgba(12,12,12,0.78); border: 1px solid var(--cyan-dim);
  color: var(--cyan); font-size: 12.5px; font-weight: 800;
  backdrop-filter: blur(4px);
}
.product__delete {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(12,12,12,0.78); font-size: 13px; opacity: .85;
}
.product__delete:hover { background: var(--danger-dim); opacity: 1; }

.product__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(12,12,12,0.7); color: var(--text-0);
  font-size: 20px; line-height: 1; opacity: .85;
}
.product__arrow:hover { background: rgba(12,12,12,0.9); color: var(--cyan); opacity: 1; }
.product__arrow--prev { left: 8px; }
.product__arrow--next { right: 8px; }
.product__dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.product__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(243,236,230,0.4); }
.product__dots i.on { background: var(--cyan); }

.product__name {
  margin: 0; padding: 0 4px;
  font-size: 16px; font-weight: 800; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product__price { display: flex; align-items: baseline; gap: 6px; padding: 0 4px; }
.product__price b { font-size: 24px; font-weight: 800; color: var(--text-0); }
.product__price span { font-size: 13px; color: var(--text-1); font-weight: 700; }

.product__add {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px;
  background: rgba(204,156,132,0.10);
  border: 1px solid var(--cyan-dim);
  border-radius: 16px;
  color: var(--text-0); font-size: 15px; font-weight: 800;
  transition: background .15s ease, transform .1s ease;
}
.product__add svg { width: 20px; height: 20px; }
.product__add:hover { background: rgba(204,156,132,0.2); }
.product__add:active { transform: scale(0.97); }

@media (max-width: 640px) {
  .store-admin__row { grid-template-columns: 1fr; }
  .store-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product { padding: 8px 8px 12px; border-radius: 18px; }
  .product__name { font-size: 14px; }
  .product__price b { font-size: 20px; }
  .product__add { padding: 11px 10px; font-size: 13.5px; }
}
