/* public/assets/css/nafia.css */

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

/* ============================================================
   متغيرات التصميم
   ============================================================ */
:root {
  --primary: #1B4F3A;
  --primary-light: #2D7A57;
  --primary-dark: #0f2e21;
  --primary-50: rgba(27, 79, 58, 0.08);
  --primary-100: rgba(27, 79, 58, 0.15);

  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --gold-dark: #9A7A2E;

  --success: #198754;
  --warning: #F59E0B;
  --danger: #DC2626;
  --info: #0EA5E9;

  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);

  --transition: 0.2s ease;

  /* الوضع النهاري */
  --bg: #F4F7F5;
  --bg-card: #FFFFFF;
  --bg-sidebar: var(--primary-dark);
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
  --border: var(--gray-200);
  --topbar-bg: #FFFFFF;
}

/* الوضع الليلي */
[data-theme="dark"] {
  --bg: #0D1B15;
  --bg-card: #162318;
  --bg-sidebar: #091410;
  --text: #E8F4EE;
  --text-muted: #9DBFAA;            /* PHASE 2 (v2.3.2): lightened from #7CA58C for WCAG contrast */
  --border: #2A4435;                /* slightly lighter so card edges are visible */
  --topbar-bg: #162318;

  /* PHASE 2 (v2.3.2): unified dark scheme — full gray ramp INVERTED so any
     component using --gray-* for text stays light and any using it for
     backgrounds stays dark. (Previously only 100/200 were remapped, so
     gray-600..900 text rendered near-black on the dark background.) */
  --gray-50:  #15231B;
  --gray-100: #1A2D23;
  --gray-200: #1E3429;
  --gray-300: #2C4636;
  --gray-400: #6F9480;
  --gray-500: #8FB39D;
  --gray-600: #AFCDBB;
  --gray-700: #C6DCCF;
  --gray-800: #DCEAE1;
  --gray-900: #EEF6F1;

  /* accents tuned for dark backgrounds */
  --primary-50:  rgba(45, 122, 87, 0.18);
  --primary-100: rgba(45, 122, 87, 0.30);
  --gold-light:  #d9b964;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow:    0 6px 18px rgba(0,0,0,.55);
}

/* ── PHASE 2 (v2.3.2): dark-mode harmonization for components that don't
      derive every color from our variables. data-bs-theme="dark" (set by
      the theme script) handles Bootstrap internals; these rules align them
      with the NAFEA palette and fix the remaining custom pieces. ───────── */
[data-theme="dark"] body { background: var(--bg); color: var(--text); }

/* Tables: readable text, our borders, subtle striping/hover */
[data-theme="dark"] .table { --bs-table-color: var(--text); --bs-table-bg: transparent;
  --bs-table-border-color: var(--border); --bs-table-striped-bg: rgba(255,255,255,.03);
  --bs-table-hover-bg: rgba(255,255,255,.05); color: var(--text); }
[data-theme="dark"] .table thead th { color: var(--text-muted); border-color: var(--border); }

/* Cards / modals / dropdowns / list groups follow the card surface */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item { background: var(--bg-card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .dropdown-item { color: var(--text); }
[data-theme="dark"] .dropdown-item:hover { background: var(--gray-100); color: var(--text); }

/* Forms: keep our surfaces inside BS wrappers too */
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text { background: var(--bg-card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .form-control:disabled, [data-theme="dark"] .form-select:disabled { background: var(--gray-100); color: var(--text-muted); }
[data-theme="dark"] .form-check-input { background-color: var(--bg-card); border-color: var(--gray-400); }

/* Alerts: translucent tints with readable light text */
[data-theme="dark"] .alert-success { background: rgba(25,135,84,.16); color: #7ddfae; border-color: rgba(25,135,84,.4); }
[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,.16); color: #f1a3a3; border-color: rgba(220,38,38,.4); }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.14); color: #f5cf85; border-color: rgba(245,158,11,.4); }
[data-theme="dark"] .alert-info    { background: rgba(14,165,233,.14); color: #9bd9f7; border-color: rgba(14,165,233,.4); }

/* Utility classes that hardcode light/dark intent */
[data-theme="dark"] .bg-white, [data-theme="dark"] .bg-light { background: var(--bg-card) !important; color: var(--text); }
[data-theme="dark"] .text-dark { color: var(--text) !important; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom { border-color: var(--border) !important; }

/* Badges that assume a light surface */
[data-theme="dark"] .badge-gray { background: var(--gray-200); color: var(--gray-800); }

/* Charts/report blocks render on card surface for legibility */
[data-theme="dark"] canvas { background: transparent; }

/* ============================================================
   أساسيات
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* ============================================================
   التخطيط الرئيسي
   ============================================================ */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   الشريط الجانبي
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
}

.sidebar-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(201,168,76,0.4);
}

.sidebar-title {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition);
}

.sidebar-subtitle {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle { opacity: 0; width: 0; overflow: hidden; }

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-group { margin-bottom: 4px; }

.nav-group-label {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-group-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: 0;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  font-size: 14px;
  font-weight: 500;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.25), rgba(201,168,76,0.08));
  color: var(--gold-light);
  border-right: 3px solid var(--gold);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-right: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar.collapsed .nav-item span:not(.nav-icon):not(.nav-badge) { display: none; }

/* User card */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-user-role { display: none; }

/* ============================================================
   المحتوى الرئيسي
   ============================================================ */
.main-content {
  margin-right: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-right var(--transition);
}

.sidebar.collapsed ~ .main-content {
  margin-right: var(--sidebar-collapsed);
}

/* ============================================================
   شريط العلوي
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  line-height: 1;
}
.topbar-toggle:hover { background: var(--gray-100); color: var(--primary); }

.topbar-breadcrumb {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-breadcrumb .current { color: var(--text); font-weight: 600; }

.topbar-spacer { flex: 1; }

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

.topbar-btn {
  background: none;
  border: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}
.topbar-btn:hover { background: var(--gray-100); color: var(--primary); }

.notif-badge {
  position: absolute;
  top: 4px; left: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px; height: 16px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  line-height: 1;
  padding: 0 4px;
}

/* ============================================================
   منطقة الصفحة
   ============================================================ */
.page-body {
  padding: 24px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   البطاقات
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }

/* بطاقات الإحصاء */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
}

.stat-card.green::before   { background: var(--primary-light); }
.stat-card.gold::before    { background: var(--gold); }
.stat-card.blue::before    { background: var(--info); }
.stat-card.orange::before  { background: var(--warning); }

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.green  { background: var(--primary-50); color: var(--primary-light); }
.stat-icon.gold   { background: rgba(201,168,76,.12); color: var(--gold-dark); }
.stat-icon.blue   { background: rgba(14,165,233,.1); color: var(--info); }
.stat-icon.orange { background: rgba(245,158,11,.1); color: var(--warning); }

.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-change {
  font-size: 12px;
  margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
  color: var(--success);
}

/* ============================================================
   الجداول
   ============================================================ */
.table-responsive { overflow-x: auto; }

.nafia-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.nafia-table th {
  background: var(--gray-50);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.nafia-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.nafia-table tr:last-child td { border-bottom: none; }
.nafia-table tr:hover td { background: var(--primary-50); }

/* ============================================================
   الأزرار
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27,79,58,0.35);
}
.btn-primary:hover { background: var(--primary-light); color: #fff; box-shadow: 0 4px 16px rgba(27,79,58,0.4); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(201,168,76,0.4);
}
.btn-gold:hover { opacity: 0.9; color: #fff; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--gray-100); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   النماذج
   ============================================================ */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.form-label .required { color: var(--danger); margin-right: 2px; }

.form-control, .form-select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  transition: all var(--transition);
  outline: none;
  direction: rtl;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.form-control::placeholder { color: var(--gray-400); }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   الشارات
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: rgba(25,135,84,0.12); color: #198754; }
.badge-danger  { background: rgba(220,38,38,0.12); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.12); color: #B45309; }
.badge-info    { background: rgba(14,165,233,0.12); color: #0369A1; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: var(--primary-100); color: var(--primary-light); }

/* ============================================================
   التنبيهات
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: rgba(25,135,84,0.1); border: 1px solid rgba(25,135,84,0.25); color: #155724; }
.alert-error, .alert-danger { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.2); color: #842029; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: #664d03; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.page-link {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--transition);
}

.page-link:hover, .page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-info {
  color: var(--text-muted);
  font-size: 13px;
  margin-right: auto;
}

/* ============================================================
   حضور سريع
   ============================================================ */
.attendance-grid {
  display: grid;
  gap: 8px;
}

.attendance-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
}

.attendance-item:hover { border-color: var(--primary-light); }

.att-name {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
}

.att-options {
  display: flex;
  gap: 6px;
}

.att-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all var(--transition);
  background: var(--bg);
  color: var(--text-muted);
}

.att-btn.present { border-color: var(--success); color: var(--success); }
.att-btn.present.selected, .att-btn.present:hover { background: var(--success); color: #fff; }
.att-btn.absent  { border-color: var(--danger); color: var(--danger); }
.att-btn.absent.selected, .att-btn.absent:hover  { background: var(--danger); color: #fff; }
.att-btn.excused { border-color: var(--warning); color: #B45309; }
.att-btn.excused.selected, .att-btn.excused:hover { background: var(--warning); color: #fff; }

/* ============================================================
   Progress Bar
   ============================================================ */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--gold));
  border-radius: 20px;
  transition: width 0.6s ease;
}

/* ============================================================
   Notifications Dropdown
   ============================================================ */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 360px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 500;
  overflow: hidden;
  animation: dropDown 0.2s ease;
}

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:hover { background: var(--primary-50); }
.notif-item.unread { background: var(--primary-50); }

.notif-item-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item-body  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   الاستجابة - الموبايل
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
  }
  .main-content { margin-right: 0 !important; }
  .page-body { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-value { font-size: 22px; }
}

/* ============================================================
   التحميل والانتقالات
   ============================================================ */
.page-loading {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--gold));
  z-index: 9999;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0%   { width: 0%; opacity: 1; }
  50%  { width: 70%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   مساعدات
   ============================================================ */
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary-light); }
.text-gold   { color: var(--gold-dark); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.rounded-full { border-radius: 50%; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* Overlay لإغلاق القائمة الجانبية في الموبايل */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.active { display: block; }

/* ============================================================
   محفظ القرآن - زخارف
   ============================================================ */
.quran-ornament {
  text-align: center;
  font-size: 24px;
  color: var(--gold);
  opacity: 0.5;
  margin: 4px 0;
  letter-spacing: 8px;
}

.arabic-text {
  font-family: 'Tajawal', serif;
  font-size: 18px;
  line-height: 2;
  direction: rtl;
}
