/* ==========================================================================
   نظام التنسيق البصري - منصة الاستقطاع الدوري لجمعية تحفيظ شرورة (بينات)
   Designed with Premium Glassmorphism, Modern RTL Support & Smooth Animations
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Outfit:wght@400;600;700&display=swap');

:root {
  /* Dynamic Palette (Emerald & Emerald Gold for Quranic Charity) */
  --primary-hue: 160;
  --primary: hsl(var(--primary-hue), 84%, 39%);
  --primary-hover: hsl(var(--primary-hue), 84%, 32%);
  --primary-light: hsl(var(--primary-hue), 80%, 96%);
  --primary-glow: rgba(16, 185, 129, 0.35);

  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);

  /* ألوان هوية الجمعية (من الشعار): أزرق زيتي + ذهبي.
     الثابتان `--brand-teal` و `--brand-gold` هما لونا الهوية كما هما،
     أما `*-ink` فنسخة مقروءة على الخلفية وتتبدّل مع الوضع الليلي. */
  --brand-teal: #1F6E6E;
  --brand-gold: #C2933F;
  --brand-teal-ink: #1F6E6E;
  --brand-gold-ink: #9A7228;
  --brand-teal-soft: rgba(31, 110, 110, 0.10);
  --brand-gold-soft: rgba(194, 147, 63, 0.13);
  --brand-teal-line: rgba(31, 110, 110, 0.28);
  --brand-gold-line: rgba(194, 147, 63, 0.32);
  /* الأشرطة الزخرفية السميكة — تُفتَح قليلاً في الوضع الليلي لتبقى ظاهرة */
  --brand-teal-bar: var(--brand-teal);
  --brand-gold-bar: var(--brand-gold);

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;

  --border-color: #e2e8f0;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(16, 185, 129, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 35px rgba(16, 185, 129, 0.2);

  --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

/* Dark Mode Theme Overrides */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111827;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --primary-light: rgba(16, 185, 129, 0.12);
  --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.5);

  /* نسخ مقروءة من ألوان الهوية على الخلفية الداكنة */
  --brand-teal-ink: #5FC3C1;
  --brand-gold-ink: #E0B865;
  --brand-teal-soft: rgba(95, 195, 193, 0.12);
  --brand-gold-soft: rgba(224, 184, 101, 0.12);
  --brand-teal-line: rgba(95, 195, 193, 0.30);
  --brand-gold-line: rgba(224, 184, 101, 0.30);
  --brand-teal-bar: #3FA5A3;
  --brand-gold-bar: #D2A659;
}

/* تمرير سلس لروابط القائمة الداخلية مع ترك مساحة للشريط العلوي الثابت */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Glowing Orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
.bg-orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--primary-glow), transparent 70%);
  top: -100px;
  right: -100px;
}
.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-gold-glow), transparent 70%);
  bottom: -100px;
  left: -100px;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  transition: all 0.3s ease;
}
[data-theme="dark"] .navbar {
  background: rgba(17, 24, 39, 0.85);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #059669);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}
.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* شعار الجمعية في الشريط العلوي (index.html) — صورة بدلاً من الأيقونة النصية */
.logo-img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  object-fit: contain;
  display: block;
  box-shadow: 0 4px 12px rgba(31, 110, 110, 0.28);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   قائمة التنقل الرئيسية + زر القائمة على الجوال (بلا جافاسكربت)
   ========================================================================== */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--brand-teal-ink);
  background: var(--brand-teal-soft);
}
.nav-links a i {
  font-size: 1.05rem;
  color: var(--brand-gold-ink);
}

/* مربع اختيار مخفي يقود فتح/إغلاق القائمة على الجوال */
.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  /* مخفي تماماً على الشاشات الكبيرة فلا يستقبل تنقّل لوحة المفاتيح */
  visibility: hidden;
}
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s ease;
}
.nav-toggle:hover {
  border-color: var(--brand-teal-ink);
  color: var(--brand-teal-ink);
}
.nav-toggle .close-ico { display: none; }
.nav-toggle-input:checked ~ .nav-toggle .open-ico { display: none; }
.nav-toggle-input:checked ~ .nav-toggle .close-ico { display: block; }
.nav-toggle-input:focus-visible ~ .nav-toggle {
  outline: 2px solid var(--brand-teal-ink);
  outline-offset: 2px;
}

@media (max-width: 940px) {
  .nav-container { flex-wrap: wrap; row-gap: 10px; }
  .nav-toggle-input { visibility: visible; }
  .nav-toggle { display: flex; }
  .logo-text h1 { font-size: 1rem; }

  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }
  .nav-toggle-input:checked ~ .nav-menu { display: flex; }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .nav-links a {
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
  }

  .nav-menu .nav-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-menu .nav-actions .btn-sec,
  .nav-menu .nav-actions .user-chip {
    flex: 1 1 45%;
    justify-content: center;
  }
}
@media (max-width: 420px) {
  .logo-text p { display: none; }
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-sec {
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-sec:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary), #059669);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px var(--primary-glow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px var(--primary-glow);
  filter: brightness(1.05);
}
.btn-primary:active {
  transform: translateY(0);
}

/* زر «البطاقة الإلكترونية» — بلون الهوية الأزرق الزيتي */
.btn-primary.btn-brand {
  background: linear-gradient(135deg, var(--brand-teal), #14504F);
  box-shadow: 0 8px 20px var(--brand-teal-line);
}
.btn-primary.btn-brand:hover {
  box-shadow: 0 12px 25px var(--brand-teal-line);
}
.btn-primary.btn-brand i {
  color: var(--brand-gold);
}

/* Security Trust Banner */
.security-banner {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(245, 158, 11, 0.08));
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  text-align: center;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-weight: 700;
  color: var(--primary);
}

/* Main Container Layout */
.main-wrapper {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* App Grid Split (Banner + Form + Interactive Preview)
   ترتيب DOM: البنر ← النموذج ← عمود الملخص.
   على الجوال (عمود واحد) يظهر البنر فوق النموذج تلقائياً بحكم الترتيب،
   وعلى الشاشات الكبيرة يُوضع البنر في العمود المجاور للنموذج. */
.donation-grid {
  display: grid;
  /* minmax(0,…) يمنع تمدّد العمود بمحتواه فتنكسر النسبة على الشاشات الضيقة */
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.75rem;
  align-items: start;
}
.donation-grid > .promo-square { grid-column: 2; grid-row: 1; }
.donation-grid > .donate-form-col { grid-column: 1; grid-row: 1 / span 2; }
.donation-grid > .donate-side-col { grid-column: 2; grid-row: 2; }

/* عمود الملخص يلتصق أثناء التمرير على الشاشات الكبيرة فيبقى المبلغ
   والتكرار أمام عين المتبرع وهو يملأ الخطوات الطويلة */
.donate-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .donation-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  /* إلغاء التموضع الصريح ليعود الترتيب الطبيعي: بنر ← نموذج ← ملخص */
  .donation-grid > .promo-square,
  .donation-grid > .donate-form-col,
  .donation-grid > .donate-side-col {
    grid-column: auto;
    grid-row: auto;
  }
  /* على الجوال يتقدّم النموذج على البنر: الهدف التبرع لا التصفّح.
     والبنر يبقى ظاهراً فوقه بارتفاع محدود بدل مربع يملأ الشاشة. */
  .donation-grid > .promo-square {
    order: 1;
    aspect-ratio: 16 / 9;
  }
  .donation-grid > .donate-form-col { order: 2; }
  .donation-grid > .donate-side-col { order: 3; }
}

/* ==========================================================================
   البنرات الإعلانية — مربع 1:1 وعريض 4:1
   الصور غير مرفوعة بعد؛ فإن تعذّر تحميلها ظهر بديل بلون الهوية بدل صورة مكسورة.
   ========================================================================== */
.promo-banner {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-teal-line);
  box-shadow: var(--shadow-md);
  margin: 0;
  background: var(--brand-teal-soft);
}
.promo-square { aspect-ratio: 1 / 1; }
.promo-wide   { aspect-ratio: 4 / 1; }

.promo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* تُضاف is-missing من app.js عند فشل تحميل الصورة */
.promo-banner.is-missing .promo-img { display: none; }

.promo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 30% 20%, var(--brand-gold-soft), transparent 60%),
    linear-gradient(135deg, var(--brand-teal-soft), var(--brand-gold-soft));
  color: var(--brand-teal-ink);
}
.promo-fallback i {
  font-size: 2.2rem;
  color: var(--brand-gold-ink);
  line-height: 1;
}
.promo-fallback span {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.promo-fallback small {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  direction: ltr;
}
.promo-wide .promo-fallback i { font-size: 1.6rem; }
.promo-wide .promo-fallback span { font-size: 0.95rem; }

/* Glass Card Box */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Form Steps & Sections */
.form-step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px dashed var(--border-color);
}
.step-number {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

/* Custom Segment Control Buttons */
.segment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.5rem;
}
.segment-btn {
  padding: 0.8rem 0.5rem;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.segment-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.segment-btn h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.segment-btn p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.segment-grid-2 { grid-template-columns: repeat(2, 1fr); }
.segment-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Amount Pills Grid — 50 · 100 · 150 */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1rem;
}
.amount-pill {
  padding: 0.75rem 0.5rem;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.amount-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 16px var(--primary-glow);
}

/* Inputs & Form Control */
.form-group {
  margin-bottom: 1.2rem;
}
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}
.input-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-box {
  transform: translateY(0);
}

/* OTP Code Input Boxes */
.otp-inputs-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  direction: ltr;
  margin: 1.5rem 0;
}
.otp-digit {
  width: 52px;
  height: 60px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
}
.otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* Donor Dashboard / Subscriptions Table */
.sub-card-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.badge-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 1rem 1.4rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-right: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   جدول أيام الشهر (1 → 28) لاختيار يوم الاستقطاع
   ========================================================================== */
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 0.8rem;
}
.day-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.day-cell:hover {
  border-color: var(--brand-gold-ink);
  background: var(--brand-gold-soft);
  color: var(--brand-gold-ink);
}
/* اليوم المحدد يبرز بلون الهوية: أزرق زيتي معبّأ وحلقة ذهبية حوله */
.day-cell.active,
.day-cell.active:hover {
  border-color: var(--brand-gold-ink);
  background: var(--brand-teal);
  color: #fff;
  box-shadow: 0 0 0 3px var(--brand-gold-soft), 0 6px 14px var(--brand-teal-line);
  transform: translateY(-1px);
}
.day-grid.disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
}
.day-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   أيام الأسبوع (السبت → الجمعة) للاستقطاع الأسبوعي
   ثلاثة أعمدة لا سبعة: أسماء الأيام العربية أطول من الأرقام بكثير،
   وسبعة أعمدة تقطعها على الجوال.
   ========================================================================== */
.week-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0.8rem;
}
.week-cell {
  padding: 0.7rem 0.4rem;
  text-align: center;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.week-cell:hover {
  border-color: var(--brand-gold-ink);
  background: var(--brand-gold-soft);
  color: var(--brand-gold-ink);
}
.week-cell.active,
.week-cell.active:hover {
  border-color: var(--brand-gold-ink);
  background: var(--brand-teal);
  color: #fff;
  box-shadow: 0 0 0 3px var(--brand-gold-soft), 0 6px 14px var(--brand-teal-line);
}
@media (max-width: 380px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   نافذة الدفع (بنمط نموذج ميسر)
   ========================================================================== */
.pay-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 470px;
  padding: 2rem 2rem 1.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .pay-modal {
  transform: translateY(0);
}
.pay-close {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-close:hover {
  background: var(--bg-main);
}
.pay-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.8rem;
}
.pay-field {
  margin-bottom: 1.1rem;
}
.pay-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.pay-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  text-align: right;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pay-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}
.pay-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.pay-input.ltr {
  direction: ltr;
  text-align: right;
  font-family: 'Outfit', monospace;
  letter-spacing: 0.5px;
}
.pay-brands {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0.55rem 0 0.2rem;
}
.pay-brands img {
  height: 21px;
  width: auto;
  border-radius: 3px;
  opacity: 0.95;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.pay-brands img.dim {
  filter: grayscale(1);
  opacity: 0.35;
}
.pay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pay-submit {
  width: 100%;
  margin-top: 0.7rem;
  padding: 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: #0f7a5a;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}
.pay-submit:hover:not(:disabled) {
  filter: brightness(1.08);
}
.pay-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.pay-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.9rem;
  line-height: 1.7;
}
.pay-note strong {
  color: var(--primary);
  display: block;
  font-weight: 800;
}
.pay-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: none;
}
.pay-error.show {
  display: block;
}

/* بطاقة قفل قسم البطاقة قبل تسجيل الدخول */
.locked-box {
  background: var(--bg-main);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.locked-box i.lead {
  font-size: 2rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}
.locked-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* شارة حالة الدخول في الشريط العلوي */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* شارات تصنيف سجل التدقيق */
.log-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.log-auth      { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.log-payment   { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.log-subscription { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.log-security  { background: rgba(239, 68, 68, 0.15);  color: #ef4444; }
.log-system    { background: rgba(100, 116, 139, 0.15); color: #64748b; }

.log-status-failed  { color: #ef4444; font-weight: 800; }
.log-status-denied  { color: #ef4444; font-weight: 800; }
.log-status-warning { color: #f59e0b; font-weight: 800; }
.log-status-success { color: #10b981; font-weight: 800; }

/* صفحة دخول مستقلة (لوحة الإدارة) */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 10;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  width: 62px;
  height: 62px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary), #059669);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 20px var(--primary-glow);
}

/* ==========================================================================
   أقسام الصفحة العامة: «من نحن» و«الأسئلة الشائعة»
   ========================================================================== */
.section-anchor {
  display: block;
  height: 0;
  overflow: hidden;
}
.section-block {
  margin-top: 4.5rem;
  scroll-margin-top: 96px;
}
.section-head {
  text-align: center;
  margin-bottom: 1.8rem;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-gold-ink);
  background: var(--brand-gold-soft);
  border: 1px solid var(--brand-gold-line);
  padding: 5px 15px;
  border-radius: 30px;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.3;
}

/* وصف المشروع */
.project-title {
  color: var(--brand-teal-ink);
}
.project-card {
  border-top: 4px solid var(--brand-teal-bar);
}
.project-text {
  font-size: 0.98rem;
  line-height: 2.05;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}

/* من نحن */
.about-lead-card {
  border-inline-start: 4px solid var(--brand-teal-bar);
}
.about-lead {
  font-size: 0.98rem;
  line-height: 2;
  color: var(--text-muted);
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 780px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-card {
  border-top: 4px solid var(--brand-teal-bar);
}
.about-card.gold {
  border-top-color: var(--brand-gold-bar);
}
.about-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
  border: 1px solid var(--brand-teal-line);
  margin-bottom: 0.9rem;
}
.about-card.gold .about-card-icon {
  background: var(--brand-gold-soft);
  color: var(--brand-gold-ink);
  border-color: var(--brand-gold-line);
}
.about-card h4 {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 0.55rem;
  color: var(--brand-teal-ink);
}
.about-card.gold h4 {
  color: var(--brand-gold-ink);
}
.about-card p {
  font-size: 0.92rem;
  line-height: 1.95;
  color: var(--text-muted);
}

/* الأسئلة الشائعة — accordion بـ <details>/<summary> بلا جافاسكربت */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 840px;
  margin: 0 auto;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item[open] {
  border-color: var(--brand-teal-line);
  box-shadow: var(--shadow-md);
}
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.1rem 1.3rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ''; }
.faq-item summary:hover { color: var(--brand-teal-ink); }
.faq-item summary:focus-visible {
  outline: 2px solid var(--brand-teal-ink);
  outline-offset: -2px;
}
.faq-q-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  color: var(--brand-teal-ink);
}
.faq-chevron {
  margin-inline-start: auto;
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--brand-gold-ink);
}
.faq-item > p {
  padding-inline: 3.2rem 1.3rem;
  padding-block-end: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.95;
  color: var(--text-muted);
}

/* ==========================================================================
   الفوتر
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 10;
  margin-top: 5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.8rem 1rem 1.8rem;
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}
.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.9rem;
}
.footer-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 16px;
  object-fit: contain;
}
.footer-brand-head h4 {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.4;
}
.footer-desc {
  font-size: 0.88rem;
  line-height: 1.95;
  color: var(--text-muted);
  max-width: 46ch;
}
.footer-license {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 0.9rem;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.footer-license i {
  color: var(--brand-gold-ink);
  font-size: 1.05rem;
  flex-shrink: 0;
}
.footer-col h5 {
  font-size: 0.95rem;
  font-weight: 900;
  margin-bottom: 1rem;
  color: var(--brand-teal-ink);
}
.footer-links {
  list-style: none;
  display: grid;
  gap: 11px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--brand-teal-ink); }
.footer-links a i {
  font-size: 1.05rem;
  color: var(--brand-gold-ink);
  flex-shrink: 0;
}
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}
.footer-social a:hover {
  border-color: var(--brand-teal-line);
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
  transform: translateY(-2px);
}
.footer-social-note {
  margin-top: 0.7rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  opacity: 0.85;
}
.footer-pay-row {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 1.8rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-pay-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
}
.footer-pay {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.pay-badge i {
  font-size: 1.05rem;
  color: var(--brand-teal-ink);
}
.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 1.15rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* System Logs Drawer / Drawer Modal */
.logs-console {
  background: #090d16;
  color: #38bdf8;
  font-family: monospace;
  padding: 1rem;
  border-radius: var(--radius-md);
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  direction: ltr;
  text-align: left;
}

/* ==========================================================================
   صفحة «سجل استقطاعاتي» — my.html
   تُفتح في نافذة مستقلة، وغالب من يفتحها على جوال.
   ========================================================================== */
.narrow-wrapper { max-width: 900px; }

.auth-card {
  max-width: 430px;
  margin: 2rem auto;
  text-align: center;
}
.auth-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--brand-teal-soft);
  color: var(--brand-teal-ink);
  border: 1px solid var(--brand-teal-line);
}
.auth-card h2 {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 0.35rem;
}
.auth-lead {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1.1rem;
}
.ltr-input {
  direction: ltr;
  text-align: left;
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.ltr-inline {
  direction: ltr;
  display: inline-block;
  unicode-bidi: isolate;
}
.full-btn { width: 100%; justify-content: center; }
.auto-btn { width: auto; margin-top: 0.9rem; }

.sim-notice {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.sim-notice span { font-weight: 900; letter-spacing: 2px; }

.record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.record-title { font-size: 1.5rem; font-weight: 900; }
.record-sub { font-size: 0.9rem; color: var(--text-muted); margin-top: 3px; }

.record-section-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin: 2rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.record-section-title i { color: var(--primary); }

/* شريط الإحصاءات — أربع بطاقات تنطوي إلى عمودين على الجوال */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); }
.stat-value { font-size: 1.35rem; font-weight: 900; }
.stat-value.primary { color: var(--primary); }
.stat-value.ok { color: #10b981; }
.stat-value.bad { color: #ef4444; }

.sub-block { margin-bottom: 1rem; }
.sub-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.sub-amount { font-size: 1.35rem; color: var(--primary); margin-left: 8px; }
.chip {
  font-size: 0.78rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 10px;
}
.sub-facts { list-style: none; display: grid; gap: 7px; }
.sub-facts li {
  font-size: 0.87rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.7;
}
.sub-facts i { color: var(--primary); font-size: 1rem; flex-shrink: 0; }
.sub-facts strong { color: var(--text-main); }

.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1rem; }
.btn-danger { color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }

.loading-box, .empty-card {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.loading-box i, .empty-card i { font-size: 2.2rem; color: var(--primary); display: block; margin-bottom: 8px; }
.empty-note { font-size: 0.85rem; color: var(--text-muted); }

/* ==========================================================================
   جداول البيانات (سجل الخصميات في my.html ولوحة الإدارة)
   ========================================================================== */
.table-card { padding: 0.9rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.87rem;
  min-width: 480px;
}
.data-table thead tr {
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-main);
}
.data-table th { padding: 10px; font-weight: 800; white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--border-color); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .nowrap { white-space: nowrap; font-size: 0.8rem; color: var(--text-muted); }
.data-table .muted { color: var(--text-muted); }
.data-table .fail-reason { color: #ef4444; font-size: 0.82rem; line-height: 1.6; }
.data-table .details-cell { line-height: 1.6; }
.empty-cell { text-align: center; padding: 2rem !important; color: var(--text-muted); }

/* ==========================================================================
   تلميحات المحافظ الرقمية + صندوق نجاح الاستقطاع
   ========================================================================== */
.pay-wallet-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: right;
}
.pay-wallet-hint i { color: var(--brand-teal-ink); flex-shrink: 0; }

.success-box {
  border-color: var(--brand-teal-line);
  background: var(--brand-teal-soft);
}
.success-box .lead { color: #10b981; }

/* ==========================================================================
   ضبط الجوال — الغالبية العظمى من المتبرعين يدخلون من الهاتف
   ========================================================================== */
@media (max-width: 560px) {
  .main-wrapper { padding-left: 0.9rem; padding-right: 0.9rem; }

  .glass-card { padding: 1.1rem; }

  /* أهداف اللمس: 44 بكسل هو الحد الأدنى المريح للإصبع */
  .day-grid { gap: 6px; }
  .day-cell { font-size: 0.85rem; min-height: 40px; }
  .week-cell { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .segment-btn { min-height: 62px; }
  .amount-pill { min-height: 46px; display: flex; align-items: center; justify-content: center; }

  .segment-btn h4 { font-size: 0.88rem; }
  .segment-btn p { font-size: 0.66rem; }

  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.15rem; }

  .record-head { flex-direction: column; align-items: stretch; }
  .record-title { font-size: 1.25rem; }

  .hero-title { font-size: 1.65rem; }
  .hero-subtitle { font-size: 0.92rem; }

  /* الحقول: 16px فأكثر تمنع سفاري من تكبير الصفحة عند التركيز */
  .input-control, .pay-input, .otp-digit { font-size: 16px; }

  .modal-box, .pay-modal { padding: 1.15rem; }
  .sub-actions .btn-sec { flex: 1; justify-content: center; }
}

/* ==========================================================================
   لوحة التحكم: شريط التخزين ومكتبة البنرات
   ========================================================================== */
.storage-bar-wrap {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-bottom: 1.2rem;
}
.storage-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 8px;
  gap: 10px;
}
.storage-bar-head i { color: var(--primary); }
.storage-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-teal), var(--primary));
  transition: width 0.4s ease, background 0.3s ease;
}
.storage-bar-fill.warn   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.storage-bar-fill.danger { background: linear-gradient(90deg, #dc2626, #ef4444); }
.storage-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 7px;
  line-height: 1.7;
}

.upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.upload-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  padding: 1.2rem 1rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.upload-slot:hover {
  border-color: var(--brand-teal-ink);
  background: var(--brand-teal-soft);
}
.upload-title { font-size: 0.92rem; font-weight: 800; }
.upload-title i { color: var(--primary); }
.upload-sub { font-size: 0.76rem; color: var(--text-muted); }
.upload-btn { margin-top: 8px; pointer-events: none; }

.banner-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.banner-item {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-main);
  margin: 0;
}
.banner-item.is-live { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.banner-item img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  background: var(--border-color);
}
.banner-live {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.banner-item figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  font-size: 0.74rem;
}
.banner-name {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}
.banner-size { color: var(--text-muted); flex-shrink: 0; font-weight: 700; }
.banner-actions {
  display: flex;
  gap: 5px;
  padding: 6px 8px 10px;
  flex-wrap: wrap;
}
.banner-actions .btn-sec {
  flex: 1;
  justify-content: center;
  font-size: 0.72rem;
  padding: 5px 6px;
  min-width: 0;
}
.banner-actions .btn-del { flex: 0 0 auto; }
.banner-actions .btn-sec[disabled] { opacity: 0.45; pointer-events: none; }

@media (max-width: 560px) {
  .upload-row { grid-template-columns: 1fr; }
  .banner-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
