/* ═══════════════════════════════════════════════════════════
   مجمع الإحسان التعليمي — النظام البصري
   هوية: أخضر زمردي عميق + ذهبي — طابع مؤسسات القرآن الكريم
   ═══════════════════════════════════════════════════════════ */

/* ─── المتغيرات ─────────────────────────────────────────────── */
:root {
  /* الأسماء القديمة محفوظة كما هي — القيم فقط تغيّرت للهوية الجديدة */
  --crimson:       #0E6B52;
  --crimson-dark:  #0A4F3C;
  --crimson-light: #16866A;
  --navy:          #1E3A5F;
  --navy-dark:     #152A45;
  --gold:          #C9A227;
  --gold-light:    #E8C547;
  --gray:          #6B7280;
  --gray-light:    #F3F4F1;
  --white:         #FFFFFF;
  --shadow-sm:     0 1px 3px rgba(10,79,60,0.06), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md:     0 8px 24px rgba(10,79,60,0.12);
  --shadow-lg:     0 20px 60px rgba(5,40,30,0.22);
  --radius:        16px;
  --radius-sm:     10px;
  --transition:    0.25s ease;
}

/* ─── القاعدة ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  direction: rtl;
  background: #f6f7f4;
  color: #1c2321;
  min-height: 100vh;
  overflow-x: hidden;
}

/* شريط تمرير أنيق */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(14,107,82,0.35);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(14,107,82,0.55); background-clip: content-box; }

/* ═══════════════════════════════════════════════════════════════
   صفحة الدخول
   ═══════════════════════════════════════════════════════════════ */
.login-page {
  background:
    radial-gradient(ellipse at 20% -10%, rgba(201,162,39,0.12), transparent 50%),
    linear-gradient(160deg, #05231B 0%, #0A3D2F 45%, #0E4A3A 75%, #123E4E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* خلفية زخرفية */
.bg-pattern { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: radial-gradient(circle, var(--crimson-light), transparent);
}
.bg-circle.c1 { width: 600px; height: 600px; top: -200px; right: -150px; animation: float1 12s ease-in-out infinite; }
.bg-circle.c2 { width: 400px; height: 400px; bottom: -100px; left: -100px; background: radial-gradient(circle, var(--gold), transparent); animation: float2 15s ease-in-out infinite; }
.bg-circle.c3 { width: 300px; height: 300px; top: 50%; left: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, var(--gold-light), transparent); opacity: 0.05; }

@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(20px,-30px) scale(1.05);} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-15px,20px) scale(1.08);} }

/* حاوية الدخول */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

/* رأس الصفحة */
.login-header { text-align: center; color: var(--white); }

.logo-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(201,162,39,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(201,162,39,0.25), 0 0 60px rgba(14,107,82,0.3);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,100%{ box-shadow: 0 0 30px rgba(14,107,82,0.45), 0 0 60px rgba(14,107,82,0.15); }
  50%    { box-shadow: 0 0 40px rgba(201,162,39,0.5), 0 0 80px rgba(201,162,39,0.2); }
}

/* الشعار الرسمي (النسخة البيضاء المعتمدة في دليل الهوية للخلفيات الملوّنة).
   object-fit ضروري: الرمز مربّع لكن الحاوية قد تختلف نسبتها. */
.logo-icon { width: 62px; height: 62px; object-fit: contain; display: block; }

.login-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  margin-bottom: 0.2rem;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
}

.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--gold);
  opacity: 0.8;
}
.divider-ornament span:not(.diamond) {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--gold));
}
.divider-ornament span:first-child {
  background: linear-gradient(to right, transparent, var(--gold));
}
.diamond { font-size: 0.6rem; }

/* بطاقة الدخول */
.login-card {
  width: 100%;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.1);
  border-top: 3px solid var(--gold);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--crimson-dark);
  margin-bottom: 0.2rem;
}
.card-hint {
  font-size: 0.88rem;
  color: var(--gray);
  margin-bottom: 1.6rem;
}

/* مجموعة الحقول */
.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--crimson-dark);
  margin-bottom: 0.4rem;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  right: 0.8rem;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  color: var(--crimson);
}
.input-icon svg { width: 18px; height: 18px; }

.input-wrap input {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 2.6rem;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  border: 2px solid #e4e7e2;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fafbf9;
  color: #1c2321;
  text-align: right;
  direction: ltr;
}

.input-wrap input:focus {
  border-color: var(--crimson);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(14,107,82,0.1);
}

.input-wrap input::placeholder { color: #b7beb9; font-family: 'Tajawal', sans-serif; }

.toggle-pass {
  position: absolute;
  left: 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray);
  padding: 0;
  line-height: 1;
  transition: color var(--transition);
}
.toggle-pass:hover { color: var(--crimson); }

/* رسالة الخطأ */
.error-msg {
  background: #fdf1f1;
  color: #a13232;
  border: 1px solid #f2caca;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* زر الدخول */
.btn-login {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--crimson-light), var(--crimson-dark));
  color: var(--white);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 15px rgba(10,79,60,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.5px;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(10,79,60,0.5);
}
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; }

/* مؤشر التحميل */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* شريط المساجد */
.mosques-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
}
.mosques-strip .sep { color: var(--gold); opacity: 0.7; }

.copyright {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   لوحة التحكم العامة — Sidebar Layout
   ═══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* القائمة الجانبية */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, #0A4F3C 0%, #063427 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.5rem 1.2rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(201,162,39,0.18), transparent 70%);
}

.sidebar-logo {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.7rem;
  font-size: 1.8rem;
  border: 1px solid rgba(201,162,39,0.4);
  box-shadow: inset 0 0 20px rgba(201,162,39,0.08);
}

.sidebar-org { font-size: 0.85rem; font-weight: 700; line-height: 1.3; }
.sidebar-sub { font-size: 0.72rem; color: var(--gold-light); margin-top: 0.2rem; }

.sidebar-user {
  padding: 0.8rem 1.2rem;
  background: rgba(0,0,0,0.22);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user-name { font-size: 0.88rem; font-weight: 600; }
.sidebar-user-role {
  font-size: 0.73rem;
  color: var(--gold-light);
  margin-top: 0.15rem;
}

.sidebar-nav { flex: 1; padding: 0.8rem 0; }

.nav-section-title {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.8rem 1.2rem 0.3rem;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 1rem;
  margin: 0.12rem 0.6rem;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 1.2rem);
  text-align: right;
  font-family: 'Tajawal', sans-serif;
  border-right: 3px solid transparent;
  border-radius: 10px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.09);
  color: var(--white);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201,162,39,0.22), rgba(201,162,39,0.06));
  color: var(--white);
  border-right-color: var(--gold);
}

.nav-item .icon {
  font-size: 1rem;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  text-align: center;
  transition: background var(--transition);
}
.nav-item.active .icon { background: rgba(201,162,39,0.25); }

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-logout:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* المحتوى الرئيسي */
.main-content {
  flex: 1;
  margin-right: 260px;
  min-height: 100vh;
  background: #f4f6f3;
  display: flex;
  flex-direction: column;
}

/* الشريط العلوي */
.topbar {
  background: var(--white);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e6e9e4;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--crimson-dark); }
.topbar-date { font-size: 0.82rem; color: var(--gray); }

/* منطقة المحتوى */
.content-area { flex: 1; padding: 1.5rem; }

/* ─── البطاقات الإحصائية ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 3px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.crimson { border-top-color: var(--crimson); }
.stat-card.navy    { border-top-color: var(--navy); }
.stat-card.gold    { border-top-color: var(--gold); }
.stat-card.green   { border-top-color: #2e7d32; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card.crimson .stat-icon { background: rgba(14,107,82,0.1); }
.stat-card.navy    .stat-icon { background: rgba(30,58,95,0.1); }
.stat-card.gold    .stat-icon { background: rgba(201,162,39,0.12); }
.stat-card.green   .stat-icon { background: rgba(46,125,50,0.1); }

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #10201a;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.stat-label { font-size: 0.82rem; color: var(--gray); font-weight: 500; }

/* ─── بطاقات المساجد ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--crimson-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mosques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.mosque-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid var(--crimson);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.mosque-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.mosque-card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.mosque-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 3px 10px rgba(10,79,60,0.25);
}
.mosque-name { font-size: 0.95rem; font-weight: 700; color: #10201a; }
.mosque-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  text-align: center;
  margin-top: 0.8rem;
}
.mosque-stat-item { padding: 0.5rem; background: var(--gray-light); border-radius: 8px; }
.mosque-stat-val { font-size: 1.1rem; font-weight: 700; color: var(--crimson-dark); }
.mosque-stat-lbl { font-size: 0.68rem; color: var(--gray); margin-top: 0.1rem; }

/* ─── جدول عام ───────────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-card-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #ecefe9;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--crimson-dark);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  background: #eef3ee;
  color: var(--crimson-dark);
  font-weight: 700;
  padding: 0.8rem 1rem;
  text-align: right;
  border-bottom: 2px solid #dde5dc;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f3ee;
  color: #2b332e;
}
.data-table tr:hover td { background: rgba(14,107,82,0.035); }
.data-table tr:last-child td { border-bottom: none; }

/* ─── الشارات (Badges) ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-crimson  { background: rgba(14,107,82,0.12); color: var(--crimson); }
.badge-navy     { background: rgba(30,58,95,0.12);  color: var(--navy); }
.badge-gold     { background: rgba(201,162,39,0.15); color: #9a7a10; }
.badge-green    { background: rgba(46,125,50,0.12);  color: #2e7d32; }
.badge-gray     { background: rgba(107,114,128,0.12); color: var(--gray); }

/* ─── أزرار ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--crimson-light), var(--crimson-dark));
  color: var(--white);
  box-shadow: 0 3px 10px rgba(10,79,60,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(10,79,60,0.4); }
.btn-secondary {
  background: var(--gray-light);
  color: #2b332e;
  border: 1px solid #dde2db;
}
.btn-secondary:hover { background: #e7ebe4; }
.btn-danger {
  background: #fdf1f1;
  color: #a13232;
  border: 1px solid #f2caca;
}
.btn-danger:hover { background: #a13232; color: var(--white); }

/* ─── تحميل ─────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray);
  gap: 1rem;
}
.loading-state .spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid #e8ece7;
  border-top-color: var(--crimson);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.empty-state { text-align: center; padding: 3rem; color: var(--gray); font-size: 0.9rem; }

/* ─── مودال ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,35,27,0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid #ecefe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--crimson-dark); }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--gray);
  line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--crimson); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #ecefe9;
  display: flex; gap: 0.8rem; justify-content: flex-end;
}

/* ─── تذييل الصفحة ────────────────────────────────────────────── */
.page-footer {
  padding: 0.8rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray);
  border-top: 1px solid #ecefe9;
  background: var(--white);
}

/* ─── الهوية الموحدة لمعاينة التقارير والطباعة ─────────────────── */
.report-brand-header {
  min-height: 96px;
  padding: 0.75rem 1.2rem;
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 1rem;
  background: #efe3cb;
  border-bottom: 3px solid #a71922;
}

.report-brand-header > img,
.report-mosque-mark img {
  display: block;
  max-width: 135px;
  max-height: 74px;
  object-fit: contain;
}

.report-heading { text-align: center; color: #443b31; }
.report-title { color: #6f1017; font-size: 1.2rem; font-weight: 800; }
.report-mosque-mark { display: flex; align-items: center; justify-content: flex-end; color: #6f1017; font-size: 0.8rem; font-weight: 800; }

.report-meta {
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #fffaf2;
  border-bottom: 1px solid #e2d2b6;
  color: #574b3a;
  font-size: 0.8rem;
}

.report-meta span {
  padding: 0.22rem 0.72rem;
  background: #fff;
  border: 1px solid #dcc9a9;
  border-radius: 999px;
}

.report-body { padding: 1rem; }
.report-table-wrap { width: 100%; overflow: auto; }
.report-card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 0.8rem; }

.report-summary-card {
  padding: 1rem;
  text-align: center;
  background: #f6f7f4;
  border: 1px solid #e6e9e4;
  border-radius: 12px;
}

.report-summary-card.good { background: #f0fdf4; }
.report-summary-card.bad { background: #fef2f2; }
.report-summary-value { color: #0a4f3c; font-size: 1.5rem; font-weight: 800; }
.report-summary-card.bad .report-summary-value { color: #b91c1c; }
.report-summary-label { margin-top: 0.3rem; color: #64748b; font-size: 0.78rem; }

.report-print-footer {
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #e2d2b6;
  color: #766b5c;
  font-size: 0.72rem;
}

/* ─── بطاقة تخصيص شاشة العرض ─────────────────────────────────── */
.display-customization {
  padding: 1rem;
  background: linear-gradient(145deg, #f7faf8, #fffdf8);
  border: 1px solid #dce6df;
  border-radius: 14px;
}

.display-customization-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
  color: #0a4f3c;
  font-size: 1rem;
  font-weight: 800;
}

.display-customization-hint {
  margin-bottom: 0.9rem;
  color: #718078;
  font-size: 0.78rem;
}

.display-slide-toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.display-slide-toggle {
  min-height: 52px;
  padding: 0.55rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #dce5de;
  border-radius: 10px;
  color: #314139;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.display-slide-toggle:has(input:checked) {
  background: #edf7f2;
  border-color: #82b9a2;
  color: #0a5944;
  box-shadow: inset 0 0 0 1px rgba(14,107,82,0.08);
}

.display-slide-toggle input {
  width: 17px;
  height: 17px;
  min-height: auto;
  accent-color: #0e6b52;
}

.display-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.display-control {
  padding: 0.7rem;
  background: #fff;
  border: 1px solid #e1e7e2;
  border-radius: 10px;
}

.display-control.wide { grid-column: 1 / -1; }

.display-control label {
  display: block;
  margin-bottom: 0.4rem;
  color: #27443a;
  font-size: 0.8rem;
  font-weight: 800;
}

.display-control select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  background: #fbfcfa;
  border: 1px solid #cfd9d1;
  border-radius: 8px;
  color: #1f2f28;
  font: 600 0.84rem 'Tajawal', sans-serif;
  outline: none;
}

.display-control select:focus {
  border-color: #0e6b52;
  box-shadow: 0 0 0 3px rgba(14,107,82,0.09);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .mosques-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ─── صقل واجهة الكمبيوتر ─────────────────────────────────────────
   هذه القواعد محصورة في الشاشات الكبيرة عمداً؛ نسخة الجوال لها مرحلة مستقلة.
   ─────────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
  body {
    background:
      radial-gradient(circle at 8% 0%, rgba(201,162,39,0.055), transparent 24rem),
      #f4f6f3;
  }

  .sidebar {
    width: 248px;
    min-width: 248px;
    box-shadow: -8px 0 28px rgba(4,39,29,0.13);
    border-left: 1px solid rgba(255,255,255,0.06);
  }

  .main-content { margin-right: 248px; }

  .sidebar-header { padding: 1.2rem 1rem 1rem; }

  .sidebar-logo {
    width: 68px;
    height: 68px;
    padding: 7px;
    background: #f4ead8;
    border: 1px solid rgba(232,197,71,0.75);
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  }

  .sidebar-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .sidebar-collapse-btn {
    width: 100%;
    min-height: 38px;
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: rgba(255,255,255,0.72);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 9px;
    font: 600 0.78rem 'Tajawal', sans-serif;
    cursor: pointer;
  }

  .sidebar-collapse-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
  }

  .sidebar,
  .main-content { transition: width .22s ease, min-width .22s ease, margin-right .22s ease; }

  .sidebar.is-collapsed {
    width: 82px;
    min-width: 82px;
    overflow-x: hidden;
  }

  .main-content.sidebar-is-collapsed { margin-right: 82px; }

  .sidebar.is-collapsed .sidebar-header { padding-inline: 0.45rem; }
  .sidebar.is-collapsed .sidebar-logo { width: 54px; height: 54px; margin-bottom: 0; }
  .sidebar.is-collapsed .sidebar-org,
  .sidebar.is-collapsed .sidebar-sub,
  .sidebar.is-collapsed .sidebar-user,
  .sidebar.is-collapsed .nav-section-title,
  .sidebar.is-collapsed .nav-item > :not(.icon),
  .sidebar.is-collapsed .sidebar-collapse-btn span,
  .sidebar.is-collapsed .btn-logout span:last-child { display: none; }

  .sidebar.is-collapsed .nav-item {
    width: 54px;
    min-height: 46px;
    margin: 0.28rem auto;
    padding: 0.45rem;
    justify-content: center;
    border-right-width: 0;
    font-size: 0;
  }

  .sidebar.is-collapsed .nav-item .icon {
    width: 34px;
    height: 34px;
  }

  .sidebar.is-collapsed .sidebar-footer { padding-inline: 0.7rem; }
  .sidebar.is-collapsed .sidebar-collapse-btn,
  .sidebar.is-collapsed .btn-logout { padding-inline: 0; }
  .sidebar.is-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

  .sidebar-org {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .nav-section-title {
    padding-top: 0.95rem;
    color: rgba(255,255,255,0.55);
  }

  .nav-item {
    min-height: 45px;
    margin-block: 0.18rem;
    border-radius: 11px;
  }

  .nav-item .icon {
    width: 31px;
    height: 31px;
    font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.06);
    filter: grayscale(1);
  }

  .nav-item.active .icon,
  .nav-item:hover .icon { filter: none; }

  .topbar {
    min-height: 68px;
    padding: 0.85rem 1.7rem;
    box-shadow: 0 3px 16px rgba(10,79,60,0.055);
  }

  .topbar-title {
    font-size: 1.15rem;
    letter-spacing: -0.01em;
  }

  .content-area {
    width: 100%;
    max-width: 1680px;
    margin-inline: auto;
    padding: 1.6rem 1.8rem 2.2rem;
  }

  .stats-grid { gap: 1.1rem; }

  .stat-card {
    border: 1px solid #e8ece6;
    border-top-width: 3px;
    box-shadow: 0 3px 13px rgba(12,56,43,0.055);
  }

  .stat-card:hover {
    transform: none;
    box-shadow: 0 5px 18px rgba(12,56,43,0.08);
  }

  .section-header { margin-bottom: 1.15rem; }

  .section-title {
    font-size: 1.05rem;
    gap: 0.6rem;
  }

  .table-card {
    border: 1px solid #e5e9e3;
    box-shadow: 0 3px 14px rgba(12,56,43,0.055);
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .table-card-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: 0.95rem 1.2rem;
    background: linear-gradient(180deg, #fff, #fcfdfb);
  }

  .data-table { min-width: 760px; }

  .data-table thead { position: sticky; top: 0; z-index: 3; }

  .data-table th {
    background: #e9f0eb;
    padding: 0.82rem 0.9rem;
    white-space: nowrap;
    box-shadow: inset 0 -1px #d4ded7;
  }

  .data-table td {
    padding: 0.78rem 0.9rem;
    vertical-align: middle;
  }

  .data-table tbody tr:nth-child(even) td { background: #fbfcfa; }

  .data-table tbody tr:hover td { background: #f1f7f3; }

  .btn {
    min-height: 38px;
    padding: 0.55rem 1rem;
    border-radius: 9px;
    justify-content: center;
    box-shadow: none;
  }

  .btn:hover { transform: none; }

  .btn-primary {
    background: #0e6b52;
    box-shadow: 0 3px 9px rgba(10,79,60,0.18);
  }

  .btn-primary:hover {
    background: #0a5944;
    box-shadow: 0 4px 12px rgba(10,79,60,0.22);
  }

  .btn-secondary {
    background: #fff;
    border-color: #d6ddd7;
  }

  .btn-secondary:hover {
    background: #f5f8f5;
    border-color: #b9c8bd;
  }

  .badge {
    line-height: 1.35;
    border: 1px solid transparent;
  }

  .empty-state {
    min-height: 170px;
    margin: 0.8rem;
    padding: 2.5rem 1.5rem;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.65rem;
    border: 1px dashed #cfd9d1;
    border-radius: 13px;
    background: linear-gradient(180deg, #fcfdfc, #f7faf7);
    color: #66756b;
    line-height: 1.75;
  }

  .empty-state::before {
    content: "◇";
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #e8f1eb;
    color: #0e6b52;
    font-size: 1.25rem;
  }

  .loading-state {
    min-height: 150px;
    padding: 2.5rem;
  }

  .modal {
    border: 1px solid #e3e8e3;
    box-shadow: 0 24px 70px rgba(4,39,29,0.24);
  }

  .modal-header {
    background: #fbfcfa;
    min-height: 62px;
  }

  input, select, textarea { min-height: 42px; }
}

/* ─── المتابعة اليومية ────────────────────────────────────────────── */
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-top: 1rem; }
.daily-card { background: var(--white); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); border: 1px solid #ecefe9; display: flex; flex-direction: column; gap: 0.8rem; transition: transform var(--transition); }
.daily-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.daily-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f3ee; padding-bottom: 0.5rem; }
.daily-name { font-weight: 700; font-size: 0.95rem; color: var(--crimson-dark); display: flex; align-items: center; gap: 0.4rem; }
.daily-circle { font-size: 0.75rem; color: var(--gray); }
.daily-status { font-size: 0.75rem; font-weight: bold; padding: 0.2rem 0.6rem; border-radius: 12px; }
.status-present { background: rgba(46,125,50,0.1); color: #2e7d32; }
.status-absent { background: rgba(161,50,50,0.1); color: #a13232; }
.status-unmarked { background: #f0f0f0; color: #888; }
.daily-blocks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.daily-block { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 0.5rem; text-align: center; display: flex; flex-direction: column; justify-content: space-between; min-height: 85px; }
.daily-block-title { font-size: 0.75rem; font-weight: bold; color: #475569; margin-bottom: 0.3rem; }
.daily-block-content { font-size: 0.75rem; color: #0f172a; margin-bottom: 0.3rem; line-height: 1.4; }
.daily-block-empty { font-size: 0.7rem; color: #94a3b8; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.daily-block-pct { font-size: 0.7rem; font-weight: bold; padding: 0.1rem 0.4rem; border-radius: 4px; display: inline-block; margin-top: auto; align-self: center; }
.pct-green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.pct-orange { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.pct-red { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.daily-overall { background: #f1f5f9; padding: 0.6rem; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: bold; color: #334155; }
.daily-overall-pct { background: #e2e8f0; padding: 0.1rem 0.5rem; border-radius: 4px; }

.ihsan-toast-host {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 100000;
  display: grid;
  gap: 0.65rem;
  width: min(390px, calc(100vw - 44px));
  pointer-events: none;
}
.ihsan-toast {
  direction: rtl;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid #d7e1da;
  background: #fff;
  color: #26352e;
  box-shadow: 0 14px 38px rgba(4,39,29,0.16);
  font-weight: 700;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .22s ease, transform .22s ease;
  white-space: pre-line;
}
.ihsan-toast.show { opacity: 1; transform: translateY(0); }
.ihsan-toast.success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.ihsan-toast.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.ihsan-confirm-overlay {
  position: fixed; inset: 0; z-index: 100001;
  display: grid; place-items: center;
  padding: 1.5rem; background: rgba(8,31,24,.52); backdrop-filter: blur(3px);
}
.ihsan-confirm-box {
  width: min(470px, 100%); background: #fff; border-radius: 16px;
  padding: 1.5rem; box-shadow: 0 25px 70px rgba(0,0,0,.25);
  text-align: center; direction: rtl;
}
.ihsan-confirm-icon { font-size: 2.2rem; margin-bottom: .6rem; }
.ihsan-confirm-message { white-space: pre-line; line-height: 1.8; color: #334155; font-weight: 700; }
.ihsan-confirm-actions { display: flex; justify-content: center; gap: .7rem; margin-top: 1.25rem; }
