/* =========================================================
   جمعية ركاز — استبيان قياس الاحتياجات
   الهوية: كحلي #00325B · ذهبي #C49E6F
   ========================================================= */
:root {
  --navy: #00325b;
  --navy-700: #0a4374;
  --navy-900: #001d36;
  --gold: #c49e6f;
  --gold-600: #b0895a;
  --gold-100: #f4ebdd;
  --gold-50: #faf5ec;
  --ink: #17293a;
  --muted: #5c6b78;
  --line: #e3e8ee;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #1f9d68;
  --warn: #d98a0b;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 50, 91, 0.06), 0 8px 24px rgba(0, 50, 91, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 50, 91, 0.08);
  --font: "Segoe UI", "Tahoma", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
/* أيقونات آبل للإيموجي */
img.ae { height: 1em; width: 1em; vertical-align: -0.14em; display: inline-block; margin: 0 .03em; object-fit: contain; }
.scale3 .face img.ae { vertical-align: middle; }
.track-card .ic img.ae, .hero img.ae { vertical-align: middle; }
button { font-family: inherit; }
[hidden] { display: none !important; }
/* حقل فخّ العناكب — مخفي عن المستخدم، تملؤه البوتات فقط */
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- الترويسة ---------- */
.site-header {
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 46px; width: auto; }
.brand .txt { line-height: 1.25; }
.brand .txt b { color: var(--navy); font-size: 15px; display: block; }
.brand .txt span { color: var(--muted); font-size: 12px; }
.header-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.header-link:hover { color: var(--navy); border-color: var(--gold); }

/* ---------- الحاوية ---------- */
.container { max-width: 940px; margin: 0 auto; padding: 22px 18px 80px; }
.view { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- البطاقة الافتتاحية ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(196, 158, 111, .35), transparent 70%);
}
.hero img.logo { height: 92px; margin-bottom: 14px; filter: brightness(0) invert(1); opacity: .96; }
.hero h1 { margin: 6px 0 8px; font-size: clamp(21px, 3.4vw, 30px); font-weight: 800; }
.hero p.sub { margin: 0 auto; max-width: 620px; color: #cdd9e6; font-size: 15px; }
.hero .hero-authority { margin-top: 12px; font-size: 12.5px; color: #b7c6d8; max-width: 680px; }
.hero .hero-prepared {
  margin-top: 8px; font-size: 12.5px; color: var(--gold);
  display: inline-block; padding-top: 8px; border-top: 1px solid rgba(196,158,111,.35);
}
.hero .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.hero .chip {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(196,158,111,.4);
  color: #f4ebdd;
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px;
}

/* ---------- معلومات منهجية ---------- */
.method {
  background: var(--gold-50);
  border: 1px solid var(--gold-100);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.method .m { }
.method .m b { color: var(--navy); display: block; margin-bottom: 3px; font-size: 14px; }
.method .m span { color: var(--muted); font-size: 13.5px; }
.privacy-note {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px dashed var(--gold); border-radius: 12px;
  padding: 10px 14px; color: var(--navy-700); font-size: 13.5px; font-weight: 600;
}

/* ---------- اختيار الفئة ---------- */
.section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 14px;
  font-size: 18px; font-weight: 800; color: var(--navy);
}
.section-title::before { content: ""; width: 6px; height: 22px; background: var(--gold); border-radius: 3px; }

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.track-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  text-align: right;
  transition: .18s ease;
  display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.track-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow); }
.track-card .ic {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  background: var(--gold-50); border: 1px solid var(--gold-100);
  border-radius: 14px; font-size: 26px;
}
.track-card .meta b { display: block; color: var(--navy); font-size: 16px; }
.track-card .meta span { color: var(--muted); font-size: 13px; }
.track-card .num {
  position: absolute; inset: 12px 12px auto auto;
  color: var(--gold-600); font-weight: 800; font-size: 13px; opacity: .6;
}

/* ---------- شريط التقدم ---------- */
.progress-head { margin-bottom: 18px; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.crumb a { color: var(--navy-700); text-decoration: none; cursor: pointer; }
.crumb a:hover { color: var(--gold-600); }
.pbar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-600)); border-radius: 999px; transition: width .3s ease; }
.pstep { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- البطاقات ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card > h2 {
  margin: 0 0 4px; font-size: 18px; color: var(--navy); font-weight: 800;
}
.card > .lead { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.card .qtitle { font-weight: 700; color: var(--ink); margin: 0 0 12px; font-size: 15.5px; }
.card .qtitle small { color: var(--muted); font-weight: 500; }
.q + .q { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- الحقول ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); font-size: 14.5px; }
.field .req { color: var(--danger); }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,158,111,.18);
}
textarea { min-height: 92px; resize: vertical; }

/* اختيارات (radio/checkbox chips) */
.opts { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 14px; cursor: pointer; background: #fff;
  font-size: 14px; transition: .12s; user-select: none;
}
.opt:hover { border-color: var(--gold); background: var(--gold-50); }
.opt input { accent-color: var(--navy); width: 17px; height: 17px; }
.opt.checked { border-color: var(--navy); background: var(--gold-50); font-weight: 600; }
.opts.stack { flex-direction: column; align-items: stretch; }
.opts.stack .opt { width: 100%; }

/* ---------- مصفوفة الأهمية مقابل التوفر ---------- */
.matrix-hint {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-50); border: 1px solid var(--gold-100);
  color: var(--navy-700); font-size: 12.5px; font-weight: 600;
  border-radius: 999px; padding: 5px 13px; margin-bottom: 14px;
}
.mrow { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #fff; }
.mrow.done { border-color: #cfe6d9; background: #fbfefc; }
.mrow .dom { font-weight: 700; color: var(--navy); margin-bottom: 12px; font-size: 15px; }
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dim .dlabel { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dim .dlabel .dot { width: 9px; height: 9px; border-radius: 50%; }
.dim.imp .dot { background: var(--navy); }
.dim.avl .dot { background: var(--gold); }
.scale5 { display: flex; gap: 6px; }
.scale5 label {
  flex: 1; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 0; font-weight: 700; color: var(--muted);
  transition: .12s; font-size: 15px; background: #fff;
  position: relative;
}
.scale5 label:hover { border-color: var(--gold); }
.scale5 input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.dim.imp .scale5 input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.dim.avl .scale5 input:checked + span { background: var(--gold-600); color: #fff; border-color: var(--gold-600); }
.scale5 span {
  display: block; border-radius: 8px; padding: 8px 0; margin: -9px 0;
  transition: .12s;
}
.scale-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* مقياس ثلاثي بالوجوه */
.scale3 { display: flex; gap: 8px; }
.scale3 label {
  flex: 1; cursor: pointer; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px;
  transition: .12s; background: #fff;
}
.scale3 label:hover { border-color: var(--gold); background: var(--gold-50); }
.scale3 .face { font-size: 30px; line-height: 1; display: block; }
.scale3 .t { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.scale3 input { position: absolute; opacity: 0; }
.scale3 label.sel { border-color: var(--navy); background: var(--gold-50); box-shadow: inset 0 0 0 2px var(--navy); }
.scale3 label.sel .t { color: var(--navy); }
.s3item { margin-bottom: 14px; }
.s3item .lbl { font-weight: 600; margin-bottom: 8px; font-size: 14.5px; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; cursor: pointer;
  padding: 12px 22px; font-size: 15px; font-weight: 700;
  transition: .15s; text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-600); }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #f0c9c4; }
.btn-danger:hover { background: #fdf3f2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.nav-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 6px; }

/* ---------- شاشة الشكر ---------- */
.thanks { text-align: center; padding: 44px 24px; }
.thanks .check {
  width: 84px; height: 84px; margin: 0 auto 18px;
  border-radius: 50%; background: var(--gold-50); border: 2px solid var(--gold);
  display: grid; place-items: center; font-size: 44px; color: var(--ok);
}
.thanks h2 { color: var(--navy); font-size: 22px; margin: 0 0 8px; }
.thanks p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }
.thanks .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- تنبيهات ---------- */
.toast {
  position: fixed; inset: auto 0 22px 0; margin: 0 auto; width: max-content; max-width: 90%;
  background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 100; font-weight: 600; font-size: 14px;
  animation: fade .25s ease;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
.inline-warn { color: var(--warn); font-size: 13px; margin-top: 8px; font-weight: 600; display: none; }
.inline-warn.show { display: block; }

/* ---------- التذييل ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 30px;
  color: var(--muted); font-size: 12.5px; text-align: center;
  padding: 20px; line-height: 1.9;
}
.site-footer b { color: var(--navy-700); }

/* =========================================================
   لوحة التحكم
   ========================================================= */
.admin-gate { max-width: 420px; margin: 40px auto; }
.admin-gate .card { text-align: center; }
.admin-gate .lock { font-size: 40px; margin-bottom: 8px; }

.admin-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin-bottom: 16px;
}
.admin-toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 9px 16px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13.5px; }
.seg button.active { background: var(--navy); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat.gold { border-color: var(--gold-100); background: var(--gold-50); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.panel h3 { margin: 0 0 14px; color: var(--navy); font-size: 16px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.panel h3 .tag { font-size: 12px; color: var(--muted); font-weight: 500; }

/* جدول */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 700; font-size: 12.5px; background: var(--bg); position: sticky; top: 0; }
.tbl tr:hover td { background: var(--gold-50); }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 700; }

/* أشرطة الفجوة */
.gap-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gap-row:last-child { border-bottom: none; }
.gap-row .dname { font-weight: 600; font-size: 14px; }
.gap-bars { grid-column: 1 / -1; }
.bar-line { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.bar-line .cap { width: 52px; font-size: 11.5px; color: var(--muted); flex: none; }
.bar-track { flex: 1; height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 7px; }
.bar-imp > i { background: var(--navy); }
.bar-avl > i { background: var(--gold); }
.bar-line .val { width: 34px; text-align: left; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.p1 { background: #fdecea; color: var(--danger); }         /* أولوية قصوى */
.pill.p2 { background: #fff4e2; color: var(--warn); }           /* أولوية متوسطة */
.pill.p3 { background: #eaf6ef; color: var(--ok); }             /* نقطة قوة */
.pill.p4 { background: #eef1f5; color: var(--muted); }          /* منخفضة */

/* توزيع بسيط */
.dist .drow { display: grid; grid-template-columns: 120px 1fr 46px; gap: 10px; align-items: center; margin: 7px 0; }
.dist .dl { font-size: 13.5px; }
.dist .dt { height: 20px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.dist .dt > i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-700)); border-radius: 6px; }
.dist .dv { text-align: left; font-weight: 700; font-size: 13px; }

.text-list { display: flex; flex-direction: column; gap: 8px; }
.text-item { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.text-item .who { color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }

.matrix2x2 { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px; margin-top: 8px; font-size: 12.5px; }
.matrix2x2 .cell { border-radius: 10px; padding: 12px; min-height: 76px; }
.matrix2x2 .hd { background: transparent; color: var(--muted); font-weight: 700; display: grid; place-items: center; text-align: center; }
.matrix2x2 .c1 { background: #fdecea; }
.matrix2x2 .c2 { background: #eaf6ef; }
.matrix2x2 .c3 { background: #eef1f5; }
.matrix2x2 .c4 { background: #fff4e2; }
.matrix2x2 .cell b { display: block; color: var(--navy); margin-bottom: 4px; }
.matrix2x2 .cell .dom { display: block; color: var(--ink); font-size: 12px; margin: 2px 0; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .ic { font-size: 40px; opacity: .5; }

.src-note { font-size: 12.5px; color: var(--muted); background: var(--gold-50); border: 1px solid var(--gold-100); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }

/* =========================================================
   معالج الاستبيان (خطوة بخطوة) + أنيميشن
   ========================================================= */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted-note { font-weight: 500; color: var(--muted); font-size: 13px; }

.wiz-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff; border-radius: var(--radius); padding: 18px 22px;
  display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
  margin-bottom: 14px; position: relative; overflow: hidden;
}
.wiz-hero::after {
  content: ""; position: absolute; inset: auto -40px -60px auto;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(196,158,111,.3), transparent 70%);
}
.wiz-ic {
  width: 58px; height: 58px; flex: none; border-radius: 16px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(196,158,111,.4);
  display: grid; place-items: center; font-size: 30px; z-index: 1;
}
.wiz-hd h1 { margin: 0; font-size: 20px; font-weight: 800; }
.wiz-hd p { margin: 2px 0 0; color: #cdd9e6; font-size: 13.5px; }

.wiz-progress { margin-bottom: 16px; }
.wiz-progress .pbar { height: 10px; }
.pmeta { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pmeta span:last-child { color: var(--gold-600); }

.wiz-nav {
  display: flex; gap: 12px; justify-content: space-between;
  position: sticky; bottom: 0; z-index: 10;
  padding: 12px 0; margin-top: 6px;
  background: linear-gradient(180deg, transparent, var(--bg) 34%);
}
.wiz-nav .btn { flex: 1; max-width: 260px; }
#prevBtn { flex: 0 0 auto; min-width: 96px; }

/* أنيميشن انتقال الخطوات */
.slide-fwd { animation: slideFwd .32s cubic-bezier(.22,.61,.36,1); }
.slide-back { animation: slideBack .32s cubic-bezier(.22,.61,.36,1); }
@keyframes slideFwd { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.shake { animation: shake .4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* دخول بطاقات الفئات بالتتابع */
.tracks-grid .track-card { animation: cardUp .45s ease backwards; }
.tracks-grid .track-card:nth-child(1){animation-delay:.03s}
.tracks-grid .track-card:nth-child(2){animation-delay:.08s}
.tracks-grid .track-card:nth-child(3){animation-delay:.13s}
.tracks-grid .track-card:nth-child(4){animation-delay:.18s}
.tracks-grid .track-card:nth-child(5){animation-delay:.23s}
.tracks-grid .track-card:nth-child(6){animation-delay:.28s}
@keyframes cardUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.btn-sm { padding: 8px 15px; font-size: 13.5px; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  .slide-fwd, .slide-back, .shake, .fade-in, .tracks-grid .track-card, .view { animation: none !important; }
}

/* =========================================================
   تحسينات لوحة التحكم
   ========================================================= */
.gate-badge {
  display: inline-block; background: var(--gold-50); color: var(--gold-600);
  border: 1px solid var(--gold-100); border-radius: 999px;
  padding: 5px 16px; font-size: 12.5px; font-weight: 700; margin-bottom: 12px;
}
.admin-gate h2 { color: var(--navy); margin: 0 0 4px; font-size: 20px; }
.admin-gate .lead { text-align: center; }
.gate-back { text-align: center; margin: 14px 0 0; }
.gate-back a { color: var(--muted); font-size: 13px; text-decoration: none; }
.gate-back a:hover { color: var(--gold-600); }

.loading { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 15px; }
.spinner {
  display: inline-block; width: 16px; height: 16px; vertical-align: -3px;
  border: 2px solid var(--line); border-top-color: var(--navy);
  border-radius: 50%; animation: spin .7s linear infinite; margin-inline-end: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-sm { }
.warnnote { color: var(--warn); border-color: #f3d9a6; background: #fff8ec; margin-bottom: 14px; }

/* التبويبات */
.tabbar {
  display: flex; gap: 6px; overflow-x: auto; padding: 5px; margin-bottom: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  scrollbar-width: thin;
}
.tab {
  border: none; background: transparent; white-space: nowrap; cursor: pointer;
  padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px;
  color: var(--muted); transition: .15s; flex: none;
}
.tab:hover { color: var(--navy); background: var(--gold-50); }
.tab.active { background: var(--navy); color: #fff; }

.sub-h { font-weight: 800; color: var(--navy); font-size: 14.5px; margin: 4px 0 12px; }
.gap-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.gapv { color: var(--muted); font-size: 12px; font-weight: 700; }
.q-block { margin-top: 16px; }
.q-block:first-child { margin-top: 0; }
.q-h { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; color: var(--ink); }
.dom.muted, .empty { color: var(--muted); }
.empty { text-align: center; padding: 36px 20px; }

/* ---------- استجابة الجوال ---------- */
@media (max-width: 720px) {
  .method { grid-template-columns: 1fr; }
  .dims { grid-template-columns: 1fr; }
  .brand .txt { display: none; }
  .hero { padding: 26px 18px; }
  .card { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .overflow-x { overflow-x: auto; }
  .matrix2x2 { font-size: 11px; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar .actions { justify-content: space-between; }
  .wiz-nav .btn { max-width: none; }
}

/* =========================================================
   لوحة التحكم — مؤشرات العينة، الترتيب، المشاركة، السجل، التقرير
   ========================================================= */
.btn-xs { padding: 5px 11px; font-size: 12px; border-radius: 8px; font-weight: 700; }

/* مؤشرات حجم العينة */
.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.gauge { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gauge-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gauge-name { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.gauge-badge { font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.gauge-badge.ok { color: var(--ok); border-color: #cfe9dc; background: #eef8f2; }
.gauge-bar { height: 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.gauge-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-600)); border-radius: 999px; transition: width .4s ease; }
.gauge-bar > i.ok { background: linear-gradient(90deg, #37b57e, var(--ok)); }

/* ترتيب الاحتياجات */
.rank-row { display: grid; grid-template-columns: 30px 1fr 120px 44px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-n { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.rank-dom { font-weight: 700; font-size: 14px; }
.rank-track { color: var(--muted); font-size: 12px; }
.rank-bar { height: 12px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.rank-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold-600)); border-radius: 7px; }
.rank-val { text-align: left; font-weight: 800; font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }

/* المشاركة و QR */
.share-main { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-box { flex: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.qr { display: block; width: 180px; height: 180px; image-rendering: pixelated; }
.qr-fallback { width: 180px; height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.share-actions { flex: 1; min-width: 240px; }
.share-url { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; word-break: break-all; margin-bottom: 10px; direction: ltr; text-align: left; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.link-name { font-weight: 700; font-size: 14px; color: var(--navy); }
.link-url { font-size: 12px; color: var(--muted); word-break: break-all; direction: ltr; text-align: left; }
.link-btns { display: flex; gap: 6px; }

/* التقرير المطبوع */
#print-report { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-report, #print-report * { visibility: visible !important; }
  #print-report { display: block; position: absolute; inset: 0; margin: 0; padding: 4mm; color: #000; direction: rtl; background: #fff; }
  @page { margin: 12mm; }
}
#print-report h1 { font-size: 20px; margin: 0 0 3px; color: #00325b; }
#print-report h2 { font-size: 15px; margin: 16px 0 6px; border-bottom: 2px solid #c49e6f; padding-bottom: 3px; color: #00325b; }
#print-report h3 { font-size: 13px; margin: 12px 0 4px; color: #12507e; }
#print-report p { margin: 2px 0; font-size: 12px; }
.rep-meta { color: #555; }
.rep-summary { display: flex; gap: 20px; font-size: 12px; margin: 10px 0; flex-wrap: wrap; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; padding: 8px 0; }
.rep-tbl { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 8px; }
.rep-tbl th, .rep-tbl td { border: 1px solid #ccc; padding: 4px 7px; text-align: right; }
.rep-tbl th { background: #f0f2f5; }
.rep-note { font-size: 11px; background: #f7f2e9; border: 1px solid #e5d5b8; padding: 9px 11px; margin-top: 12px; border-radius: 6px; }
.rep-footer { font-size: 11px; color: #555; margin-top: 12px; text-align: center; }

@media (max-width: 720px) {
  .share-main { flex-direction: column; align-items: stretch; }
  .qr-box { align-self: center; }
  .link-row { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 26px 1fr 60px; }
  .rank-bar { display: none; }
}
