/* ================================================================
   رتّل – نظام التصميم الموحد المحدّث
   Design System v2 — Premium Dark Edition
   Font: IBM Plex Sans Arabic
   Accent: #10B981 (Emerald) + #D4A843 (Gold)
   BG: #06060E (Deep Void)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700;800&family=Amiri+Quran&display=swap');

/* ===== CSS Variables ===== */
:root {
  /* Colors */
  --accent:         #10B981;
  --accent-dark:    #059669;
  --accent-dim:     rgba(16, 185, 129, 0.10);
  --accent-border:  rgba(16, 185, 129, 0.22);
  --accent-glow:    rgba(16, 185, 129, 0.15);

  --gold:           #D4A843;
  --gold-dark:      #B8922E;
  --gold-dim:       rgba(212, 168, 67, 0.10);
  --gold-border:    rgba(212, 168, 67, 0.22);

  --red:            #EF4444;
  --red-dim:        rgba(239, 68, 68, 0.12);
  --blue:           #60A5FA;
  --blue-dim:       rgba(96, 165, 250, 0.10);

  /* Backgrounds */
  --bg:             #06060E;
  --bg-sb:          #08081A;
  --bg-card:        rgba(255, 255, 255, 0.025);
  --bg-card-hover:  rgba(255, 255, 255, 0.045);
  --bg-input:       rgba(255, 255, 255, 0.05);
  --bg-header:      rgba(6, 6, 14, 0.88);

  /* Text */
  --text:           #EEEEF5;
  --text-dim:       rgba(238, 238, 245, 0.55);
  --text-muted:     rgba(238, 238, 245, 0.28);

  /* Borders */
  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.12);

  /* Typography */
  --font:           'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  --font-quran:     'Amiri Quran', 'Traditional Arabic', serif;

  /* Spacing & Shape */
  --radius:         16px;
  --radius-sm:      10px;
  --radius-lg:      24px;
  --sidebar-w:      280px;

  /* Shadows */
  --shadow:         0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-sm:      0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-accent:  0 8px 24px rgba(16, 185, 129, 0.2);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.85; }
p { line-height: 1.75; }

/* ===== Page System (SPA) ===== */
/* Pages are shown/hidden via inline style by showPage() in script.js */

/* ===== App Layout ===== */
.app-layout { display: flex; min-height: 100vh; }
.main-with-sidebar { margin-right: var(--sidebar-w); flex: 1; min-width: 0; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sb);
  border-left: 1px solid var(--border);
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 4px;
  transition: transform .3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  text-decoration: none;
  color: var(--text);
}

.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), #E8C060);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #000;
  box-shadow: 0 4px 12px var(--gold-dim);
  flex-shrink: 0;
}

.sidebar-logo-text { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }

.sidebar-section { margin-bottom: 28px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }

.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-color: var(--border);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
}

.sidebar-user {
  margin-top: auto;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 700; }
.user-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== Top Header (inside pages) ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.page-title { font-size: 28px; font-weight: 800; }
.page-subtitle { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

/* ===== Main Content Area ===== */
.main-content {
  padding: 40px;
  min-height: 100vh;
  overflow-y: auto;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.card:hover {
  border-color: var(--accent-border);
  background: rgba(16, 185, 129, 0.02);
  transform: translateY(-4px);
}

.card:hover::before { opacity: 1; }

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  transition: all .3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.stat-card:hover { border-color: var(--accent-border); transform: translateY(-4px); }
.stat-card:hover::before { opacity: 1; }

.stat-label { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.stat-change { font-size: 12px; color: var(--accent); font-weight: 600; }
.stat-icon { font-size: 28px; margin-bottom: 12px; }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #047857, #065F46);
  color: #fff;
  border: none;
  font-family: var(--font);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(4, 120, 87, 0.35);
}

.btn-primary svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all .3s;
}

.btn-ghost:hover {
  background: rgba(255,255,255,.09);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.25);
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all .3s;
}

.btn-danger:hover { background: rgba(239,68,68,.2); transform: translateY(-1px); }

.btn-gold {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), #E8C060);
  color: #000;
  border: none;
  font-family: var(--font);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 8px 20px var(--gold-dim);
}

.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(212,168,67,.3); }

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s;
}
.btn-icon:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: all .2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-border);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-select option { background: #1a1a2e; color: var(--text); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ===== Modals ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #0d0d1f;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}

.modal-title { font-size: 20px; font-weight: 800; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; transition: color .2s; }
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== Tables ===== */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table thead tr {
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 14px 20px;
  font-size: 12px; font-weight: 700;
  color: var(--text-dim);
  text-align: right;
  letter-spacing: 0.3px;
}

.data-table td {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.data-table tbody tr:hover { background: rgba(255,255,255,.025); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-green  { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-gold   { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.badge-red    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,.22); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96,165,250,.22); }
.badge-muted  { background: rgba(255,255,255,.05); color: var(--text-dim); border: 1px solid var(--border); }

/* ===== Progress Bars ===== */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 99px;
  transition: width .5s ease;
}

.progress-fill.gold { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }

/* ===== Section Headers ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.section-title { font-size: 17px; font-weight: 700; }

/* ===== Landing Page ===== */
.landing-nav {
  position: fixed;
  top: 0; width: 100%;
  height: 62px;
  background: var(--bg-header);
  backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 1000;
}

.nav-logo { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); }
.nav-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), #E8C060);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #000;
  box-shadow: 0 4px 12px var(--gold-dim);
}
.nav-logo span { font-size: 18px; font-weight: 800; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 14px; color: var(--text-dim); transition: color .2s; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 60px;
  padding: 100px 80px 80px;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(16,185,129,.08) 0%, transparent 70%);
  pointer-events: none;
}

.landing-hero::after {
  content: '';
  position: absolute;
  bottom: -200px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(212,168,67,.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { max-width: 640px; position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  font-size: 13px; font-weight: 600; color: var(--accent);
  margin-bottom: 28px;
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}

.hero-content h1 {
  font-size: 52px; font-weight: 800;
  line-height: 1.2; letter-spacing: -1px;
  margin-bottom: 20px;
}

.text-primary { color: var(--accent); }
.text-gold { color: var(--gold); }

.hero-content p { font-size: 16px; color: var(--text-dim); line-height: 1.8; margin-bottom: 36px; }

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

/* ===== Hero Stats ===== */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stats .stat-item strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.hero-stats .stat-item span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Hero Widget & Sessions ===== */
.hero-widget {
  flex-shrink: 0;
  width: 380px;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.sessions-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(239,68,68,.15);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  animation: blink 2s infinite;
}

/* ===== Role Cards Grid ===== */
#role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
}

.role-card:hover {
  border-color: var(--accent-border);
  background: rgba(16,185,129,.04);
  transform: translateY(-2px);
}

.role-card h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.role-card p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Card Icon (role cards & feature icons) ===== */
.card-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.card-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ===== Landing Stats Bar ===== */
.landing-stats {
  padding: 60px 80px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-sb);
}

.stats-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.landing-stats .stat-item {
  text-align: center;
}

.landing-stats .stat-item strong {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
}

.landing-stats .stat-item span {
  font-size: 14px;
  color: var(--text-dim);
}

/* ===== Page Topbar ===== */
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-topbar h2 {
  font-size: 20px;
  font-weight: 800;
}

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

/* ===== Dashboard ===== */
.dashboard {
  padding: 40px;
}

/* ===== Sidebar Logout Button ===== */
.btn-logout-sidebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.22);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  margin-top: 16px;
}

.btn-logout-sidebar svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-logout-sidebar:hover { background: rgba(239,68,68,.2); }
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(20px);
}

.auth-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--gold), #E8C060);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: #000;
  margin: 0 auto 20px;
  box-shadow: 0 8px 20px rgba(212,168,67,.25);
}

.auth-header { text-align: center; margin-bottom: 36px; }
.auth-header h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-header p { color: var(--text-dim); font-size: 14px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== Notification Toast ===== */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: #0d1f15;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 14px; font-weight: 600;
  z-index: 9999;
  display: flex; align-items: center; gap: 8px;
  animation: slide-in .3s ease;
  box-shadow: var(--shadow-accent);
  max-width: 320px;
}

@keyframes slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ===== Quran Text ===== */
.quran-text {
  font-family: var(--font-quran);
  font-size: 26px;
  line-height: 2.2;
  text-align: center;
  color: var(--text);
}

/* ===== Live Session ===== */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px; font-weight: 800;
  animation: blink 2s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ===== Utilities ===== */
.text-accent  { color: var(--accent); }
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-danger  { color: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }

.w-full { width: 100%; }
.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .main-with-sidebar { margin-right: 0; }
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .landing-hero { padding: 100px 32px 60px; gap: 40px; flex-direction: column; align-items: flex-start; }
  .hero-widget { width: 100%; max-width: 500px; }
  .hero-content h1 { font-size: 36px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .landing-stats { padding: 40px 32px; }
}

@media (max-width: 768px) {
  .main-content { padding: 24px 16px; }
  .page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .modal { padding: 28px 20px; }
  .auth-card { padding: 30px 20px; }
  .landing-nav { padding: 0 16px; }
  .nav-links { display: none; }
  .landing-hero { padding: 90px 20px 40px; flex-direction: column; }
  .landing-stats { padding: 32px 20px; }
  .page-topbar { padding: 16px 20px; }
  .dashboard { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .landing-hero { padding: 90px 16px 40px; }
  .hero-content h1 { font-size: 28px; }
  .stats-grid { grid-template-columns: 1fr; }
  #role-cards { grid-template-columns: 1fr; }
}

/* ========================
   CMS Tab Buttons
======================== */
.cms-tab-btn {
  padding: .45rem 1rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: .85rem;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.cms-tab-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.cms-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cms-feature-item {
  display: grid;
  grid-template-columns: 80px 1fr 1fr auto;
  gap: .5rem;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.cms-feature-item:last-child { border-bottom: none; }

/* ========================
   Integrations Hub
======================== */
.int-tab-panel { display: block; }

.int-form { display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; }

.int-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

/* Notification rules table */
.int-notif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.int-notif-table th,
.int-notif-table td {
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
.int-notif-table th {
  background: var(--bg-sb);
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.int-notif-table tr:hover td {
  background: var(--bg-card-hover);
}
.int-notif-table select,
.int-notif-table input[type="text"],
.int-notif-table input[type="email"],
.int-notif-table input[type="tel"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .35rem .6rem;
  font-size: .84rem;
  font-family: var(--font);
}
.int-notif-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ===== وضع التباين العالي ===== */
body.high-contrast {
  --bg:         #000000;
  --bg-sb:      #0a0a0a;
  --bg-card:    #111111;
  --bg-card-hover: #1a1a1a;
  --bg-input:   #0a0a0a;
  --text:       #ffffff;
  --text-dim:   #e0e0e0;
  --text-muted: #bbbbbb;
  --border:     #555555;
  --border-hover: #888888;
  --accent:     #00ff88;
  --accent-dark: #00cc66;
  --accent-dim: rgba(0,255,136,.15);
  --accent-border: rgba(0,255,136,.5);
  --gold:       #ffff00;
  --gold-dim:   rgba(255,255,0,.2);
}

body.high-contrast .verse-text { color: #ffffff !important; }
body.high-contrast .card { border-color: #555 !important; }
body.high-contrast .btn-primary { background: #00cc66 !important; color: #000 !important; }
body.high-contrast .nav-item.active { color: #00ff88 !important; }

/* ===== New Feature Styles ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
#twofa-secret-display {
  user-select: all;
}
[contenteditable="true"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ===== Landing Footer ===== */
.landing-footer {
  background: var(--bg-sb);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}
.landing-footer .footer-content {
  max-width: 900px;
  margin: 0 auto;
}
.landing-footer .footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.landing-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.landing-footer .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
}
.landing-footer .footer-links a:hover {
  color: var(--accent);
}

/* ===== Task 14b: Badge Animations ===== */
@keyframes badge-earned {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35) rotate(-5deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(16,185,129,0); }
  50%       { box-shadow: 0 0 18px rgba(16,185,129,.55); }
}
#achievements-grid .card {
  transition: transform .2s, box-shadow .2s;
}
#achievements-grid .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
#achievements-grid .card:not([style*="opacity:.4"]) {
  animation: badge-glow 3s ease-in-out infinite;
}
#achievements-grid .card:not([style*="opacity:.4"]) > div:first-child {
  animation: badge-earned 0.6s ease-out;
}

/* ===== Messaging Styles ===== */
#messaging-messages {
  min-height: 120px;
}

/* ===== Speaker / Audio Icon – max 80px in all contexts ===== */
.btn-ghost svg,
.btn-ghost.btn-lg svg {
  max-width: 80px;
  max-height: 80px;
  width: 18px;
  height: 18px;
}

/* ===== Responsive Tables ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.table-wrap table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}
.table-wrap table th,
.table-wrap table td {
  padding: .55rem .75rem;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.table-wrap table th {
  background: var(--bg-sb);
  font-weight: 600;
  color: var(--text-dim);
  font-size: .8rem;
  letter-spacing: .3px;
}
.table-wrap table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* ===== Platform Settings Card (Owner CMS Quick Panel) ===== */
#platform-settings-card { border-color: rgba(212,168,67,.3); }
#platform-settings-card h3 svg { color: var(--gold); }
.cms-section-toggles {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}
.cms-section-toggle-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  cursor: pointer;
}
.cms-section-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
