/* ============ Hasan Net — global styles ============ */

:root {
  --gold: #f5c41b;
  --gold-dark: #c99e08;
  --green: #00e676;
  --navy: #1d2a4d;
  --navy-deep: #131c38;
  --navy-card: #1a2547;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --pill: rgba(255, 255, 255, 0.08);
  --pill-border: rgba(255, 255, 255, 0.14);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --announce-bg: #1d2a4d;
  --announce-text: #ffffff;
  --card-shadow: 0 4px 20px -8px rgba(20, 20, 20, 0.23);
  /* عرض عمود المحتوى — مصدر واحد للحقيقة: الترويسة والمحتوى والتذييل تتحاذى عليه جميعاً */
  --content-max: 769px;
  /* ألوان التنبيهات (نجاح/خطأ) — معرّفة لكل وضع حتى تُقرأ في الداكن والفاتح */
  --ok-bg: rgba(0, 230, 118, 0.14);
  --ok-border: rgba(0, 230, 118, 0.4);
  --ok-text: #7bffbc;
  --err-bg: rgba(255, 82, 82, 0.14);
  --err-border: rgba(255, 82, 82, 0.4);
  --err-text: #ff9d9d;
  --info-bg: rgba(245, 196, 27, 0.12);
  --info-border: rgba(245, 196, 27, 0.45);
  --info-text: var(--gold);
}

[data-theme="light"] {
  --navy: #ffffff;
  --navy-deep: #f0f3f8;
  --text: rgba(0, 0, 0, 0.87);
  --muted: rgba(0, 0, 0, 0.6);
  --pill: rgba(0, 0, 0, 0.06);
  --pill-border: rgba(0, 0, 0, 0.14);
  --shadow: 0 4px 14px rgba(28, 35, 64, 0.15);
  --announce-bg: #edf6ff;
  --announce-text: rgba(0, 0, 0, 0.87);
  /* نصوص التنبيهات في الوضع الفاتح تحتاج درجات داكنة لتبقى مقروءة على خلفية بيضاء */
  --ok-bg: rgba(0, 160, 80, 0.10);
  --ok-border: rgba(0, 160, 80, 0.45);
  --ok-text: #0a7a42;
  --err-bg: rgba(200, 30, 30, 0.08);
  --err-border: rgba(200, 30, 30, 0.40);
  --err-text: #b3261e;
  --info-bg: rgba(201, 158, 8, 0.10);
  --info-border: rgba(201, 158, 8, 0.45);
  --info-text: #8a6d05;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--text);
  font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  top: -48px;
  right: 8px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--gold);
  color: #1c1c1c;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--gold);
  color: #1c1c1c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.topbar-inner {
  /* نفس عرض عمود المحتوى: الشعار يتحاذى رأسياً مع البانر والبطاقات أسفله
     (الشريط الذهبي نفسه يبقى بعرض الشاشة الكامل) */
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* الشعار في أقصى اليسار والأيقونات في أقصى اليمين كما في التصميم المرجعي */
  flex-direction: row-reverse;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.025rem;
  letter-spacing: 1.25px;
  color: #fff;
  direction: ltr; /* الشعار لاتيني: النجمة قبل الاسم */
}

.brand-star {
  width: 26px;
  height: 26px;
  color: #1c1c1c;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #1c1c1c;
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover, .icon-btn:focus-visible { background: rgba(0, 0, 0, 0.1); }
.icon-btn svg { width: 24px; height: 24px; }

.lang-chip { font-size: 1.2rem; line-height: 1; }

/* زر الرجوع يظهر في صفحات الأقسام فقط — في أقصى يسار الشريط مثل الموقع المرجعي
   (topbar-inner معكوس الاتجاه، لذا ترتيب العناصر في HTML يطابق الترتيب البصري من اليسار) */
.back-btn svg { transform: scaleX(-1); }
.topbar-inner:has(.back-btn) .topbar-actions { margin-inline-end: auto; }

/* ---------- Drawer ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s;
}
.drawer-overlay.open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: 300px;
  max-width: 85vw;
  height: 100dvh;
  padding: 20px;
  overflow-y: auto;
  background: var(--navy-deep);
  color: var(--text);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.28s ease;
}
.drawer.open { transform: translateX(0); }

.drawer-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.drawer-close:hover { background: var(--pill); }

.drawer-login h3 { margin: 8px 0 4px; font-size: 1.15rem; }
.drawer-login p { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; }

.btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn-gold { background: var(--gold); color: #1c1c1c; }
.btn-green { background: var(--green); color: #05341c; }

/* زر محايد: ‎.btn‎ وحده كان بلا خلفية إطلاقاً فيظهر كنص شبح — يحتاج مظهراً ثانوياً واضحاً */
.btn:not(.btn-gold):not(.btn-green):not(.btn-danger) {
  background: var(--pill);
  color: var(--text);
  border: 1px solid var(--pill-border);
}

/* زر صغير داخل صف أزرار (لا يملأ العرض) */
.btn-small {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* إجراء خطير (إيقاف 2FA، حذف) — أحمر واضح في الوضعين */
.btn-danger {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid var(--err-border);
}

/* ---------- التنبيهات (نجاح / خطأ / معلومة) ----------
   كانت معرّفة في admin.css فقط، فكانت كل رسائل التحقق في الواجهة تظهر كنص عادٍ بلا إطار. */

.alert {
  margin: 0 0 12px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: right;
  border: 1px solid transparent;
}
.alert-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-text);
}
.alert-error {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-text);
}
/* رسالة إخبارية محايدة — ليست خطأ (مثل: هذه التذكرة مغلقة) */
.alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-text);
}

/* ---------- صفوف الحقول والأزرار ----------
   كانت معرّفة في admin.css فقط، فكانت الحقول والأزرار تتكدّس عمودياً في الواجهة. */

.field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.field-row .field { flex: 1; min-width: 140px; }

.review-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.review-buttons .btn { width: auto; margin-bottom: 0; }

.drawer-sep {
  border: 0;
  border-top: 1px solid var(--pill-border);
  margin: 16px 0;
}

.drawer-nav { display: flex; flex-direction: column; gap: 4px; }

.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-weight: 500;
  transition: background 0.2s;
}
.drawer-nav a:hover { background: var(--pill); }
.drawer-nav svg { width: 22px; height: 22px; color: var(--gold); }

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--pill-border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.mode-thumb {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.mode-toggle input:checked + .mode-track { background: var(--gold); }
.mode-toggle input:checked + .mode-track .mode-thumb { transform: translateX(-18px); }
.mode-toggle input:focus-visible + .mode-track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--content-max); /* عمود محتوى بعرض 737px مثل التصميم المرجعي */
  margin: 0 auto;
  padding: 20px 16px 40px;
  flex: 1;
}

/* ---------- Hero banner ---------- */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 230px;
  border-radius: 4px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 55% 15%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 55%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 30%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 45%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 65% 85%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 120%, #274a8f 0%, transparent 60%),
    linear-gradient(160deg, #0a1230 0%, #101c46 55%, #0a1230 100%);
  box-shadow: var(--card-shadow);
}

/* بانر بصورة كاملة من لوحة التحكم (hero_image) */
.hero-has-image {
  display: block;
  min-height: 0;
  background: none;
}
.hero-has-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.hero-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 20px 10px;
  text-align: center;
}

.hero-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
}

.hero-star {
  width: 52px;
  height: 52px;
  color: var(--gold);
  filter: drop-shadow(0 2px 6px rgba(245, 196, 27, 0.5));
}

.hero-title { text-align: left; color: #fff; }
.hero-title strong {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 4px;
  line-height: 1;
}
.hero-title span {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 10px;
  color: var(--gold);
}

.hero-cta {
  margin: 16px 0 2px;
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 700;
}

.hero-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.hero-meta {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
}
.hero-meta span {
  flex: 1;
  padding: 9px 6px;
  text-align: center;
  color: #fff;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-meta span + span { border-right: 1px solid rgba(255, 255, 255, 0.15); }

/* ---------- صفحة القسم ---------- */

.category-title {
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: right;
  color: var(--text);
}

.category-banner {
  margin-bottom: 4px;
}
.category-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* ---------- شريط الإعلان المتحرك (بطاقة أسفل البانر كما في التصميم المرجعي) ---------- */

.ticker {
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 42px;
  margin: 20px 0;
  border-radius: 4px;
  background: var(--announce-bg);
  box-shadow: var(--card-shadow);
}

.ticker-track {
  display: flex;
  gap: 80px;
  width: max-content;
  animation: ticker 30s linear infinite;
}
.ticker-track span {
  white-space: nowrap;
  color: var(--announce-text);
  font-size: 1rem;
  padding: 0 12px;
}
.ticker:hover .ticker-track { animation-play-state: paused; }

/* في اتجاه RTL القيم الموجبة لـ X تتحرك نحو اليمين، لذا نحرك المسار من اليسار لليمين */
@keyframes ticker {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ---------- Search ---------- */

.search { margin: 18px 0 26px; }

.search input {
  width: 100%;
  height: 52px;
  padding: 0 22px;
  border: 1px solid var(--pill-border);
  border-radius: 28px;
  background: var(--pill);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--gold); }

/* ---------- Category grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 8px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.card:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 12px; }

.card-art {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

/* بطاقة بصورة حقيقية بدل الرسم الافتراضي */
.card-art.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* تدرجات لونية مختلفة قليلاً لكل قسم */
.art-1 { background: linear-gradient(155deg, #1b2c5e 0%, #101a3d 100%); }
.art-2 { background: linear-gradient(155deg, #3d1e5e 0%, #151031 100%); }
.art-3 { background: linear-gradient(155deg, #1e4a5e 0%, #0e1f33 100%); }
.art-4 { background: linear-gradient(155deg, #5e2c1e 0%, #2b1210 100%); }
.art-5 { background: linear-gradient(155deg, #2c3d5e 0%, #10182f 100%); }
.art-6 { background: linear-gradient(155deg, #5e1e2c 0%, #250d15 100%); }
.art-7 { background: linear-gradient(155deg, #1e5e38 0%, #0c2417 100%); }
.art-8 { background: linear-gradient(155deg, #4a1e5e 0%, #1d0b28 100%); }
.art-9 { background: linear-gradient(155deg, #5e4a1e 0%, #292008 100%); }

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  direction: ltr;
}
.card-badge svg { width: 12px; height: 12px; }

.card-icons {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
}
.card-icons span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 1.7rem;
}

.card-ribbon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(90deg, rgba(245, 196, 27, 0.95), rgba(201, 158, 8, 0.95));
  color: #1c1c1c;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  margin: 0;
  font-size: 0.9375rem; /* 15px مثل التصميم المرجعي */
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.5;
}

/* شارة السعر على بطاقات الباقات */
.price-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #1c1c1c;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
}

/* ---------- Content pages (about / policies / login) ---------- */

.page {
  background: var(--pill);
  border: 1px solid var(--pill-border);
  border-radius: 14px;
  padding: 28px 26px;
}
.page h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: var(--gold);
}
[data-theme="light"] .page h1 { color: var(--gold-dark); }
.page h2 { font-size: 1.1rem; margin: 22px 0 6px; }
.page p, .page li { color: var(--muted); line-height: 1.9; }

/* ---------- Login ---------- */

.auth-box {
  max-width: 420px;
  margin: 20px auto;
  background: var(--pill);
  border: 1px solid var(--pill-border);
  border-radius: 16px;
  padding: 30px 26px;
  text-align: center;
}
.auth-box h1 { margin: 0 0 4px; font-size: 1.4rem; }
.auth-box > p { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; }

.field { text-align: right; margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 500;
}
.field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  background: var(--navy-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
[data-theme="light"] .field input { background: #fff; }
.field input:focus { border-color: var(--gold); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--pill-border);
}

.form-msg {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--gold);
}
[data-theme="light"] .form-msg { color: var(--gold-dark); }

/* ---------- صفحة الطلب ---------- */

.order-box { max-width: 460px; }

.order-price {
  margin: 0 0 18px;
  color: var(--muted);
}
.order-price strong { color: var(--gold); font-size: 1.1rem; }
[data-theme="light"] .order-price strong { color: var(--gold-dark); }

.order-total {
  margin: 4px 0 16px;
  font-size: 1.05rem;
}
.order-total strong { color: var(--gold); }
[data-theme="light"] .order-total strong { color: var(--gold-dark); }

.order-success { font-size: 3rem; line-height: 1; margin-bottom: 6px; }

/* ---------- Footer ---------- */

.site-footer {
  /* يتحاذى مع عمود المحتوى بدل التمدد لعرض الشاشة كاملاً */
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 26px 16px 34px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 14px;
}
.footer-links a {
  color: var(--muted);
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold); }

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* ---------- المحفظة وإضافة الرصيد ---------- */

/* شارة الرصيد في الشريط الذهبي */
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  color: #1c1c1c;
  font-weight: 800;
  font-size: 0.9rem;
  direction: ltr;
  transition: background 0.2s;
}
.balance-pill:hover { background: rgba(0, 0, 0, 0.24); }
.balance-pill svg { width: 15px; height: 15px; }

.drawer-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--pill);
  border: 1px solid var(--pill-border);
}
.drawer-balance span { color: var(--muted); font-size: 0.85rem; }
.drawer-balance strong { color: var(--gold); font-size: 1.1rem; }
[data-theme="light"] .drawer-balance strong { color: var(--gold-dark); }

.section-intro {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.card-pay-icon { font-size: 2.4rem; }

/* صفحة طريقة الدفع */
.deposit-box { max-width: 480px; text-align: right; }
.deposit-box h1 { text-align: center; }

.deposit-instructions {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 16px;
}

.account-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.account-row {
  background: var(--navy-deep);
  border: 1px solid var(--pill-border);
  border-radius: 12px;
  padding: 10px 12px;
}
[data-theme="light"] .account-row { background: #fff; }
.account-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.account-value-row { display: flex; align-items: center; gap: 8px; }
.account-value {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  color: var(--text);
  padding: 2px 0;
}
.copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--pill-border);
  background: var(--pill);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.copy-btn:hover { background: var(--gold); color: #1c1c1c; }
.copy-btn.copied { background: var(--green); color: #05341c; border-color: transparent; }

.qr-box { text-align: center; margin: 6px 0 16px; }
.qr-box img {
  width: 180px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.deposit-meta {
  list-style: none;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--pill);
  border: 1px solid var(--pill-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.deposit-meta li { color: var(--muted); font-size: 0.86rem; }
.deposit-meta strong { color: var(--text); }

/* صفحة محفظتي */
.wallet-balance-card {
  text-align: center;
  background: linear-gradient(150deg, #1b2c5e, #101a3d);
  border: 1px solid var(--pill-border);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 22px;
}
.wallet-balance-card span { display: block; color: rgba(255, 255, 255, 0.75); font-size: 0.9rem; margin-bottom: 6px; }
.wallet-balance-card strong { display: block; color: var(--gold); font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; direction: ltr; }
.wallet-balance-card .btn { max-width: 220px; margin: 0 auto; }

.wallet-section-title { font-size: 1.1rem; font-weight: 800; margin: 22px 0 12px; color: var(--text); }

.wallet-tablewrap { overflow-x: auto; border: 1px solid var(--pill-border); border-radius: 12px; }
.wallet-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.wallet-table th, .wallet-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--pill-border);
  white-space: nowrap;
}
.wallet-table th { background: var(--pill); color: var(--gold); font-weight: 700; }
[data-theme="light"] .wallet-table th { color: var(--gold-dark); }
.wallet-table tr:last-child td { border-bottom: 0; }
.wallet-table small { color: var(--muted); }
.wallet-empty { text-align: center; color: var(--muted); }
.wallet-empty a, [data-theme="light"] .wallet-empty a { color: var(--gold); }
[data-theme="light"] .wallet-empty a { color: var(--gold-dark); }

/* ألوان الحالة (الواجهة) */
.status-pending { color: var(--gold); }
[data-theme="light"] .status-pending { color: var(--gold-dark); }
.status-done { color: #1fbf75; }
.status-rejected { color: #e0605e; }

/* ---------- الحساب والأمان (2FA) ---------- */

.profile-wrap { max-width: 560px; margin: 0 auto; }

.profile-card {
  background: var(--pill);
  border: 1px solid var(--pill-border);
  border-radius: 16px;
  padding: 24px 22px;
  margin-bottom: 18px;
}
.profile-card h1 { margin: 0 0 14px; font-size: 1.4rem; }
.profile-card h2 { margin: 0 0 6px; font-size: 1.2rem; }
.profile-sub { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

.profile-info { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.profile-info dt { color: var(--muted); font-size: 0.88rem; }
.profile-info dd { margin: 0; font-weight: 500; }

.twofa-status { padding: 12px 14px; border-radius: 10px; font-weight: 500; margin: 0 0 18px; }
.twofa-status.on  { background: rgba(0, 230, 118, 0.14); border: 1px solid rgba(0, 230, 118, 0.4); }
.twofa-status.off { background: var(--pill); border: 1px solid var(--pill-border); color: var(--muted); }
.twofa-status.on strong { color: #1fbf75; }

.twofa-steps { margin: 0 0 18px; padding-inline-start: 20px; color: var(--muted); line-height: 1.9; font-size: 0.9rem; }

.twofa-qr {
  display: flex;
  justify-content: center;
  padding: 14px;
  margin: 0 auto 16px;
  width: max-content;
  max-width: 100%;
  background: #fff;
  border-radius: 14px;
}
.twofa-qr img, .twofa-qr canvas { display: block; }

.twofa-key { margin-bottom: 18px; }
.twofa-key .account-value { font-size: 1.05rem; letter-spacing: 2px; }

.twofa-form { margin-bottom: 14px; }
.twofa-form .btn { margin-top: 4px; }
.twofa-danger { border-top: 1px solid var(--pill-border); padding-top: 16px; margin-top: 4px; }
.twofa-cancel { text-align: center; }
.twofa-cancel .btn { display: inline-block; width: auto; }

.recovery-panel {
  background: rgba(245, 196, 27, 0.10);
  border: 1px solid rgba(245, 196, 27, 0.45);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.recovery-panel h3 { margin: 0 0 8px; font-size: 1.05rem; }
.recovery-panel p { margin: 0 0 12px; color: var(--muted); font-size: 0.88rem; line-height: 1.7; }
.recovery-codes {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.recovery-codes li {
  background: var(--navy-deep);
  border: 1px solid var(--pill-border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  letter-spacing: 1px;
}
[data-theme="light"] .recovery-codes li { background: #fff; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
  .card-icons span { width: 42px; height: 42px; font-size: 1.35rem; border-radius: 10px; }
  .hero-title strong { font-size: 1.7rem; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-meta span { font-size: 0.7rem; }
  .footer-links { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- تفاصيل الطلب + الكود المسلَّم (محفظتي) ---------- */
.order-detail-row td { padding: 0 10px 10px; border-top: none; }
.order-detail-row details > summary {
  cursor: pointer; font-size: 0.82rem; color: var(--gold); padding: 4px 2px;
}
[data-theme="light"] .order-detail-row details > summary { color: var(--gold-dark); }
.delivery-hint { margin-inline-start: 8px; font-weight: 700; }
.order-detail-body { padding: 8px 4px 4px; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; }
.order-detail-body p { margin: 0; }
.order-detail-body p > span { opacity: 0.75; }
.delivery-code {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px; border: 1px dashed var(--gold); border-radius: 10px;
}
.delivery-code code { word-break: break-all; font-size: 0.95em; }

/* ---------- سلسلة رسائل تذكرة الدعم ---------- */
.ticket-thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  background: var(--pill); border: 1px solid var(--pill-border); font-size: 0.92rem;
}
.msg-user  { align-self: flex-start; }
.msg-admin { align-self: flex-end; border-color: var(--gold); }
.msg-meta  { display: block; margin-top: 6px; font-size: 0.74rem; opacity: 0.65; }
.msg-image img { max-width: 220px; max-height: 220px; border-radius: 8px; margin-top: 6px; display: block; }
.ticket-status-chip { font-size: 0.8rem; font-weight: 700; }
