/* ══════════════════════════════════════════════════════════════════
   MAQRAA PWA — SHARED STYLESHEET
   مسجد أبي بكر الصديق — نظام المقرأة القرآنية
   v3.1 | CSS مشترك بين الأدمن والطالب
══════════════════════════════════════════════════════════════════ */

/* ── FONTS ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@700;800&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────────────── */
:root {
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --gold-dark:   #9a7a30;
  --green-deep:  #0d3b2e;
  --green-mid:   #1a5c44;
  --green-light: #2d8a65;
  --cream:       #fdf8f0;
  --red:         #ef4444;
  --amber:       #f59e0b;
  --num-font:    'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Amiri', serif;
  background: var(--green-deep);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(201,168,76,.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(45,138,101,.07) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c9a84c' fill-opacity='0.035'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z M40 10 L70 40 L40 70 L10 40 Z'/%3E%3C/g%3E%3C/svg%3E");
}

#app { position: relative; z-index: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 16px 12px 48px; }

#login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201,168,76,.07) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(26,92,68,.15) 0%, transparent 55%);
}
.login-box {
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  border: 1px solid rgba(201,168,76,.35);
  border-radius: 32px;
  padding: 44px 36px;
  width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: 0 32px 100px rgba(0,0,0,.5), 0 0 0 1px rgba(201,168,76,.08), inset 0 1px 0 rgba(201,168,76,.18);
  position: relative; overflow: hidden;
}
.login-box::before {
  content: '';
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,168,76,.08) 0%, transparent 70%);
  pointer-events: none;
}
.login-ornament { color: var(--gold); font-size: 1.5rem; letter-spacing: 12px; margin-bottom: 8px; opacity: .75; }
.login-mosque-name {
  font-family: 'Cairo', sans-serif; font-weight: 900;
  font-size: clamp(1.1rem, 5vw, 2rem);
  color: var(--gold-light);
  text-shadow: 0 0 40px rgba(201,168,76,.3);
  line-height: 1.2; margin-bottom: 16px;
}
.login-location { font-family: 'Cairo', sans-serif; font-size: .85rem; color: rgba(253,248,240,.42); letter-spacing: 3px; margin-bottom: 8px; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0 14px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(201,168,76,.35), transparent); }
.login-divider-icon { color: var(--gold); font-size: .75rem; opacity: .6; }
.login-system { font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1rem; color: var(--gold); margin-bottom: 24px; }
.login-pw-wrap { position: relative; margin-bottom: 16px; }
.login-pw-wrap .form-input { padding-right: 44px; font-size: 1.1rem; letter-spacing: 3px; text-align: center; }
.login-pw-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: rgba(201,168,76,.5); }
.login-error {
  color: #fca5a5; font-size: .85rem; margin-top: 10px; display: none;
  background: rgba(220,38,38,.08); border: 1px solid rgba(252,165,165,.18);
  border-radius: 10px; padding: 8px 12px;
}
.login-hint { font-size: .68rem; color: rgba(253,248,240,.25); margin-top: 16px; }
.forgot-pw { color: rgba(201,168,76,.6); font-size: .75rem; margin-top: 12px; cursor: pointer; text-decoration: underline; }
.forgot-pw:hover { color: var(--gold); }

.header {
  text-align: center; padding: 20px 16px 16px; margin-bottom: 16px;
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(201,168,76,.1);
}
.header::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.2), transparent);
}
.header-ornament { color: var(--gold); font-size: 1.2rem; letter-spacing: 10px; opacity: .6; margin-bottom: 4px; }
.header-mosque {
  font-family: 'Cairo', sans-serif; font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  color: var(--gold-light);
  text-shadow: 0 0 40px rgba(201,168,76,.22);
  line-height: 1.2; margin-bottom: 12px;
}
.header-location {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(.8rem, 2vw, .95rem);
  color: rgba(253,248,240,.42); font-weight: 500; letter-spacing: 3px;
  margin-bottom: 4px;
}
.header-welcome {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(.9rem, 2vw, 1.1rem);
  color: rgba(253,248,240,.7); margin-bottom: 5px;
}
.header-system {
  display: inline-block; font-family: 'Cairo', sans-serif; font-weight: 700;
  font-size: clamp(.8rem, 2vw, 1rem);
  color: var(--green-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  padding: 4px 20px; border-radius: 30px;
  box-shadow: 0 2px 12px rgba(201,168,76,.3);
}
.header-actions {
  position: absolute; top: 12px; left: 10px;
  display: flex; gap: 4px; flex-wrap: wrap;
  background: rgba(0,0,0,.2); padding: 4px 6px; border-radius: 12px;
  backdrop-filter: blur(8px); border: 1px solid rgba(201,168,76,.12);
}
.btn-action {
  padding: 5px 8px; border-radius: 8px;
  font-family: 'Cairo', sans-serif; font-size: .7rem; font-weight: 700;
  cursor: pointer; transition: all .2s; border: 1px solid;
  display: inline-flex; align-items: center; gap: 3px; background: transparent;
}
.btn-action:hover { transform: translateY(-1px); }
.btn-act-red   { color: #fca5a5; border-color: rgba(252,165,165,.2); }
.btn-act-red:hover   { background: rgba(220,38,38,.2); }
.btn-act-amber { color: #fcd34d; border-color: rgba(252,211,77,.2); }
.btn-act-amber:hover { background: rgba(245,158,11,.18); }

.nav {
  display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap;
  background: rgba(0,0,0,.15); padding: 5px; border-radius: 16px;
  border: 1px solid rgba(201,168,76,.15); backdrop-filter: blur(12px);
}
.nav-btn {
  flex: 1; min-width: 70px; padding: 12px 8px; border: none; border-radius: 12px;
  font-family: 'Cairo', 'Tajawal', sans-serif; font-weight: 700; font-size: .85rem;
  cursor: pointer; transition: all .3s; background: transparent;
  color: rgba(253,248,240,.5); position: relative; overflow: hidden;
}
.nav-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  opacity: 0; transition: opacity .3s; border-radius: 12px;
}
.nav-btn.active::before { opacity: 1; }
.nav-btn.active {
  color: var(--green-deep);
  box-shadow: 0 4px 20px rgba(201,168,76,.4), 0 0 0 1px rgba(201,168,76,.2);
}
.nav-btn:hover:not(.active) { background: rgba(201,168,76,.08); color: var(--gold-light); }
.nav-btn span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }

.notif-badge {
  background: var(--red); color: white; border-radius: 50%;
  min-width: 16px; height: 16px; font-size: .6rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 3px;
  position: absolute; top: -6px; right: -8px;
  box-shadow: 0 0 0 2px var(--green-deep);
  animation: badgePulse 2s infinite;
  pointer-events: none;
}

.card {
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  border: 1px solid rgba(201,168,76,.16); border-radius: 22px;
  padding: 20px 18px; margin-bottom: 16px; backdrop-filter: blur(14px);
  box-shadow: 0 6px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(201,168,76,.1);
}
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-title h2 { font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--gold-light); }
.section-title-bar {
  width: 4px; height: 20px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
  border-radius: 4px; flex-shrink: 0;
  box-shadow: 0 0 8px rgba(201,168,76,.3);
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 11px 16px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  color: var(--green-deep); border: none; border-radius: 13px;
  font-weight: 700; font-size: .97rem; cursor: pointer; transition: all .3s;
  box-shadow: 0 4px 16px rgba(201,168,76,.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,.42); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px 16px;
  background: transparent; color: rgba(253,248,240,.68);
  border: 1px solid rgba(201,168,76,.28); border-radius: 13px;
  font-weight: 600; font-size: .94rem; cursor: pointer; transition: all .3s;
}
.btn-secondary:hover { background: rgba(201,168,76,.09); color: var(--gold-light); border-color: var(--gold); }
.btn-green {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px 16px;
  background: rgba(45,138,101,.2); color: #6ee7b7;
  border: 1px solid rgba(110,231,183,.25); border-radius: 13px;
  font-weight: 600; font-size: .94rem; cursor: pointer; transition: all .3s;
}
.btn-green:hover { background: rgba(45,138,101,.35); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 10px; border: none; border-radius: 8px;
  font-family: 'Cairo', sans-serif; font-size: .75rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.btn-edit { background: rgba(201,168,76,.12); color: var(--gold-light); border: 1px solid rgba(201,168,76,.2); }
.btn-edit:hover { background: rgba(201,168,76,.22); }
.btn-del  { background: rgba(220,38,38,.1); color: #fca5a5; border: 1px solid rgba(252,165,165,.2); }
.btn-del:hover  { background: rgba(220,38,38,.22); }
.btn-wa   { background: rgba(37,211,102,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.22); }
.btn-wa:hover   { background: rgba(37,211,102,.22); }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .84rem; color: var(--gold); margin-bottom: 4px; font-weight: 600; }
.form-input {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(201,168,76,.22);
  border-radius: 11px; color: var(--cream);
  font-family: 'Cairo', sans-serif; font-size: .93rem; outline: none;
  transition: border-color .2s, background .2s;
}
.form-input:focus { border-color: var(--gold); background: rgba(201,168,76,.06); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }
.form-input option { background: #0d3b2e; color: var(--cream); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.section-sep { height: 1px; background: linear-gradient(90deg, transparent, rgba(201,168,76,.22), transparent); margin: 16px 0; }
.sub-label { font-size: .78rem; color: var(--gold-dark); font-weight: 700; margin-bottom: 7px; }
.hint-error { color: var(--red); font-size: .75rem; margin-top: 4px; display: none; }

.prog-wrap { background: rgba(255,255,255,.06); border-radius: 20px; height: 10px; overflow: hidden; margin-top: 5px; }
.prog-bar  { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }

.badge         { display: inline-block; padding: 2px 9px; border-radius: 18px; font-size: .78rem; font-weight: 700; }
.badge-present { background: rgba(45,138,101,.22); color: #6ee7b7; border: 1px solid rgba(110,231,183,.28); }
.badge-absent  { background: rgba(220,38,38,.13); color: #fca5a5; border: 1px solid rgba(252,165,165,.28); }
.badge-excuse  { background: rgba(245,158,11,.13); color: #fcd34d; border: 1px solid rgba(252,211,77,.28); }
.badge-gold    { background: rgba(201,168,76,.13); color: var(--gold-light); border: 1px solid rgba(201,168,76,.24); }
.achievement-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 14px;
  font-size: .7rem; font-weight: 700; background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.28); color: var(--gold-light);
}
.level-badge { padding: 2px 8px; border-radius: 12px; font-size: .7rem; font-weight: 700; }

.page { display: none; animation: fadeIn .35s ease; }
.page.active { display: block; }

.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,59,46,.9); backdrop-filter: blur(8px);
  justify-content: center; align-items: center;
  z-index: 1000; padding: 14px;
}
.modal-overlay.open { display: flex !important; }
.modal-box {
  background: linear-gradient(145deg, #12442f, #0d3b2e);
  border: 1px solid rgba(201,168,76,.28); border-radius: 24px;
  padding: 24px 20px; width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.modal-title {
  font-weight: 700; font-size: 1.3rem; color: var(--gold-light);
  text-align: center; margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(201,168,76,.18);
}

#toast {
  position: fixed; bottom: 28px; right: 50%; transform: translateX(50%);
  background: linear-gradient(135deg, rgba(26,92,68,.97), rgba(13,59,46,.99));
  border: 1px solid rgba(201,168,76,.4); color: var(--cream);
  padding: 11px 20px 11px 16px; border-radius: 32px; font-size: .85rem; font-weight: 600;
  z-index: 9999; opacity: 0; transition: opacity .35s, transform .35s;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 10px 36px rgba(0,0,0,.45);
  display: flex; align-items: center; gap: 8px;
}
#toast.show { opacity: 1; transform: translateX(50%) translateY(-6px); }
#toast.toast-success { background: linear-gradient(135deg, rgba(16,80,50,.97), rgba(13,59,46,.99)); border-color: rgba(110,231,183,.4); }
#toast.toast-error   { background: linear-gradient(135deg, rgba(100,20,20,.97), rgba(80,10,10,.99)); border-color: rgba(252,165,165,.4); }
#toast.toast-warning { background: linear-gradient(135deg, rgba(90,65,10,.97), rgba(70,50,5,.99)); border-color: rgba(251,191,36,.4); }
#toast.toast-info    { background: linear-gradient(135deg, rgba(13,59,80,.97), rgba(10,45,65,.99)); border-color: rgba(99,179,237,.4); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; }

#offline-banner {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
  background: linear-gradient(135deg, rgba(120,40,10,.97), rgba(90,20,5,.99));
  border-bottom: 1px solid rgba(252,165,165,.35);
  padding: 10px 16px; align-items: center; justify-content: center; gap: 10px;
  font-size: .82rem; font-weight: 700; color: #fecaca;
  animation: slideDown .4s ease;
}
#offline-banner.show { display: flex; }
.offline-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fca5a5;
  animation: pulseDot 1.5s infinite; flex-shrink: 0;
}

.pwa-install-banner {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  background: linear-gradient(135deg, rgba(18,68,47,.98), rgba(13,59,46,.99));
  border: 1px solid rgba(201,168,76,.35); border-radius: 18px;
  padding: 14px 18px; display: none; align-items: center; gap: 12px;
  z-index: 8000; box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.pwa-install-banner .pwa-icon { font-size: 2rem; flex-shrink: 0; }
.pwa-install-banner .pwa-text { flex: 1; }
.pwa-install-banner .pwa-text p { font-family: 'Cairo', sans-serif; font-size: .85rem; color: var(--cream); }

.fb-status {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 10px; margin-bottom: 14px;
  font-family: 'Cairo', sans-serif; font-size: .78rem; font-weight: 600;
  border: 1px solid transparent;
}
.fb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fb-dot.g { background: #6ee7b7; box-shadow: 0 0 8px #6ee7b740; }
.fb-dot.r { background: #fca5a5; box-shadow: 0 0 8px #fca5a540; }
.fb-dot.y { background: #fcd34d; box-shadow: 0 0 8px #fcd34d40; }

.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid rgba(201,168,76,.16);
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-mid), var(--green-deep));
  border: 2px solid rgba(201,168,76,.4);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0;
}
.profile-info h3 { font-weight: 700; font-size: 1.3rem; color: var(--gold-light); }
.profile-info p  { font-size: .82rem; color: rgba(253,248,240,.5); margin-top: 3px; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 16px; }
.profile-stat { background: rgba(255,255,255,.04); border: 1px solid rgba(201,168,76,.14); border-radius: 12px; padding: 12px; text-align: center; }
.profile-stat .pv { font-size: 1.5rem; color: var(--gold-light); font-weight: 700; }
.profile-stat .pl { font-size: .75rem; color: rgba(253,248,240,.45); margin-top: 2px; }
.history-list { max-height: 260px; overflow-y: auto; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(255,255,255,.03); border-radius: 10px; margin-bottom: 6px;
}
.history-date { font-size: .8rem; color: rgba(253,248,240,.5); }

.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px; }
.stat-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(201,168,76,.12);
  border-radius: 14px; padding: 14px 8px; text-align: center;
}
.stat-card.clickable { cursor: pointer; transition: background .2s; }
.stat-card.clickable:hover { background: rgba(201,168,76,.08); }
.stat-icon  { display:flex; align-items:center; justify-content:center; margin-bottom:4px; min-height:22px; }
.stat-icon svg { width:20px; height:20px; flex-shrink:0; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--gold-light); }
.stat-label { font-size: .68rem; color: rgba(253,248,240,.45); margin-top: 3px; }

/* ══════════════════════════════════════════════════════════════════
   TABLE — موحّد الخط، مسافات متناسقة، hover + alternating rows
   ══════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; font-family: 'Cairo', sans-serif; }
thead tr { background: linear-gradient(90deg, rgba(45,100,80,.75), rgba(45,138,101,.45)); }
th {
  padding: 10px 9px; color: var(--gold-light); font-weight: 700;
  text-align: right; white-space: nowrap; font-size: .76rem;
  letter-spacing: .25px; border-bottom: 2px solid rgba(201,168,76,.18);
}
td {
  padding: 9px 9px; border-bottom: 1px solid rgba(201,168,76,.07);
  color: var(--cream); font-size: .82rem; line-height: 1.45; vertical-align: middle;
}
.date-cell, td.date-cell {
  font-size: .75rem !important; color: rgba(253,248,240,.5);
  white-space: nowrap; letter-spacing: .1px;
}
tbody tr:nth-child(even) td { background: rgba(255,255,255,.018); }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: rgba(201,168,76,.055); }

/* ══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 40px 20px; color: rgba(253,248,240,.3); }
.empty-icon  { font-size: 2.2rem; margin-bottom: 10px; opacity: .3; }

/* ══════════════════════════════════════════════════════════════════
   NOTIFICATIONS
   ══════════════════════════════════════════════════════════════════ */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 14px; margin-bottom: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(201,168,76,.1);
  position: relative; transition: transform .18s, box-shadow .18s; cursor: pointer;
}
.notif-item.unread::before {
  content: ''; position: absolute; top: 12px; right: -3px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 6px rgba(239,68,68,.6);
}
.notif-item:hover { transform: translateX(-3px); box-shadow: 3px 4px 18px rgba(0,0,0,.25); }
.notif-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 12px; background: rgba(255,255,255,.06); flex-shrink: 0;
}
.notif-content { flex: 1; }
.notif-title   { font-weight: 700; font-size: .9rem; color: var(--gold-light); margin-bottom: 4px; }
.notif-message { font-size: .82rem; color: rgba(253,248,240,.72); line-height: 1.4; }
.notif-time    { font-size: .68rem; color: rgba(253,248,240,.32); margin-top: 5px; }

.confirm-icon   { font-size: 2.2rem; margin-bottom: 8px; }
.confirm-title  { font-weight: 700; font-size: 1.1rem; color: var(--gold-light); margin-bottom: 8px; }
.confirm-msg    { color: rgba(253,248,240,.7); font-size: .9rem; margin-bottom: 16px; line-height: 1.5; }
.btn-confirm-yes { width: 100%; padding: 10px; background: rgba(220,38,38,.2); color: #fca5a5; border: 1px solid rgba(252,165,165,.28); border-radius: 12px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.btn-confirm-yes:hover { background: rgba(220,38,38,.35); }
.btn-confirm-no  { width: 100%; padding: 10px; background: transparent; color: rgba(253,248,240,.6); border: 1px solid rgba(201,168,76,.2); border-radius: 12px; font-weight: 700; cursor: pointer; }
.btn-confirm-no:hover  { background: rgba(201,168,76,.08); }

.detail-panel { display: none; margin-bottom: 10px; }
.detail-panel.open { display: block; }
.det-title { font-weight: 700; font-size: .9rem; color: var(--gold-light); margin-bottom: 6px; padding: 8px 12px; background: rgba(255,255,255,.04); border-radius: 10px; }
.det-list  { list-style: none; padding: 0 8px; }
.det-list li { padding: 4px 0; font-size: .85rem; color: rgba(253,248,240,.65); border-bottom: 1px solid rgba(255,255,255,.04); }

.att-log-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 10px; margin-bottom: 6px; background: rgba(255,255,255,.03); flex-wrap: wrap; gap: 8px; }
.att-log-date { font-size: .75rem; color: rgba(253,248,240,.4); min-width: 90px; }
.att-log-name { font-size: .88rem; font-weight: 600; color: var(--cream); flex: 1; }
.att-log-excuse { font-size: .72rem; color: #fcd34d; cursor: pointer; }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-wrap .search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: rgba(201,168,76,.5); }
.search-input { padding-right: 36px !important; }
.search-count { font-size: .72rem; color: rgba(253,248,240,.35); margin-top: 3px; }

.hifz-log-item {
  display: flex; gap: 12px; padding: 10px 14px; margin-bottom: 8px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(201,168,76,.1);
  border-radius: 12px; align-items: flex-start;
}
.hifz-log-date   { font-size: .75rem; color: rgba(253,248,240,.4); min-width: 85px; margin-top: 2px; }
.hifz-log-detail { flex: 1; }
.hifz-log-surah  { font-weight: 700; font-size: .9rem; color: var(--gold-light); margin-bottom: 3px; }
.hifz-log-athman { font-size: .78rem; color: rgba(253,248,240,.55); }

#loading-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--green-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: opacity .75s ease;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-ornament { font-size: 2.5rem; color: var(--gold); letter-spacing: 8px; animation: pulse 1.8s ease-in-out infinite; }
.loading-text { font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1rem; color: rgba(253,248,240,.5); }

.session-pending-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3);
  border-radius: 20px; padding: 3px 10px; font-size: .75rem; color: #fbbf24; font-weight: 700;
  animation: badgePulse 2s infinite;
}
.nav-notif-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #fbbf24; margin-right: 4px;
  animation: badgePulse 1.5s infinite; vertical-align: middle;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .header-actions { position: static; justify-content: center; margin-bottom: 10px; }
  .nav-btn { font-size: .72rem; padding: 8px 4px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 500px) {
  .form-row, .btn-row { grid-template-columns: 1fr; }
  .container { padding: 12px 8px 32px; }
  .modal-box { padding: 18px 14px; }
}

/* ══════════════════════════════════════════════════════════════════
   SHEIKH MODALS
══════════════════════════════════════════════════════════════════ */
.sheikh-modal-header { text-align:center; margin-bottom:22px; }
.sheikh-modal-icon   { font-size:2.8rem; margin-bottom:8px; filter:drop-shadow(0 0 12px rgba(201,168,76,.4)); }
.sheikh-modal-title  { font-size:1.2rem; font-weight:800; color:var(--gold-light); margin-bottom:4px; }
.sheikh-modal-sub    { font-size:.8rem; color:rgba(253,248,240,.45); }
.sheikh-input-wrap   { position:relative; display:flex; align-items:center; }
.sheikh-input-icon   { position:absolute; right:12px; font-size:1rem; z-index:1; }
.sheikh-input        { padding-right:36px !important; }
.sheikh-btn-confirm  {
  flex:1; padding:12px 16px; border-radius:14px; font-weight:700; font-size:.95rem; cursor:pointer;
  background:linear-gradient(135deg, rgba(45,138,101,.35), rgba(16,80,50,.45));
  border:1px solid rgba(110,231,183,.4); color:#6ee7b7;
  transition:all .2s; font-family:'Cairo',sans-serif;
}
.sheikh-btn-confirm:hover { background:linear-gradient(135deg,rgba(45,138,101,.55),rgba(16,80,50,.65)); transform:translateY(-1px); box-shadow:0 4px 16px rgba(110,231,183,.15); }
.sheikh-btn-cancel {
  flex:1; padding:12px 16px; border-radius:14px; font-weight:700; font-size:.9rem; cursor:pointer;
  background:transparent; border:1px solid rgba(253,248,240,.12); color:rgba(253,248,240,.5);
  transition:all .2s; font-family:'Cairo',sans-serif;
}
.sheikh-btn-cancel:hover { background:rgba(255,255,255,.04); color:rgba(253,248,240,.75); }

.sheikh-del-icon  { font-size:3rem; margin-bottom:10px; }
.sheikh-del-title { font-size:1.2rem; font-weight:800; color:#fca5a5; margin-bottom:10px; }
.sheikh-del-msg   { color:rgba(253,248,240,.65); font-size:.9rem; line-height:1.7; }
.sheikh-btn-del-confirm {
  flex:1; padding:12px 16px; border-radius:14px; font-weight:700; font-size:.9rem; cursor:pointer;
  background:linear-gradient(135deg,rgba(220,38,38,.25),rgba(185,28,28,.35));
  border:1px solid rgba(252,165,165,.4); color:#fca5a5;
  transition:all .2s; font-family:'Cairo',sans-serif;
}
.sheikh-btn-del-confirm:hover { background:linear-gradient(135deg,rgba(220,38,38,.45),rgba(185,28,28,.55)); transform:translateY(-1px); }

.dup-icon  { font-size:3rem; margin-bottom:10px; }
.dup-title { font-size:1.15rem; font-weight:800; color:#fcd34d; margin-bottom:10px; }
.dup-msg   { color:rgba(253,248,240,.7); font-size:.9rem; line-height:1.8; }

.backup-inline-btn {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  border-radius: 16px; cursor: pointer; border: 1.5px solid;
  text-align: right; transition: all .22s cubic-bezier(.4,0,.2,1);
  font-family: 'Cairo', sans-serif; width: 100%;
  position: relative; overflow: hidden;
  flex-direction: row; justify-content: flex-start;
}
.backup-inline-btn::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity .22s;
  pointer-events: none;
}
.backup-inline-btn:hover::before { opacity: 1; }
.backup-inline-btn:active { transform: scale(.97) translateY(0) !important; }

.bkp-icon {
  font-size: 1.6rem; flex-shrink: 0; line-height: 1;
  filter: drop-shadow(0 0 6px currentColor);
  transition: transform .22s;
}
.backup-inline-btn:hover .bkp-icon { transform: scale(1.18) rotate(-4deg); }
.bkp-text { display: flex; flex-direction: column; gap: 2px; }
.bkp-label { font-weight: 800; font-size: .86rem; letter-spacing: .3px; line-height: 1; }
.bkp-sub { font-size: .68rem; opacity: .55; font-weight: 500; }

.export-inline {
  background: linear-gradient(135deg, rgba(16,80,50,.35), rgba(6,40,26,.45));
  border-color: rgba(110,231,183,.32);
  box-shadow: 0 2px 12px rgba(110,231,183,.08), inset 0 1px 0 rgba(110,231,183,.08);
  color: #a7f3d0;
}
.export-inline::before { background: linear-gradient(135deg, rgba(110,231,183,.1), rgba(52,211,153,.05)); }
.export-inline:hover {
  border-color: rgba(110,231,183,.55);
  box-shadow: 0 4px 20px rgba(110,231,183,.18), inset 0 1px 0 rgba(110,231,183,.15);
  transform: translateY(-2px);
}
.export-inline .bkp-label { color: #6ee7b7; }

.import-inline {
  background: linear-gradient(135deg, rgba(80,60,10,.35), rgba(40,30,5,.45));
  border-color: rgba(252,211,77,.28);
  box-shadow: 0 2px 12px rgba(252,211,77,.07), inset 0 1px 0 rgba(252,211,77,.08);
  color: #fde68a;
}
.import-inline::before { background: linear-gradient(135deg, rgba(252,211,77,.1), rgba(245,158,11,.05)); }
.import-inline:hover {
  border-color: rgba(252,211,77,.55);
  box-shadow: 0 4px 20px rgba(252,211,77,.16), inset 0 1px 0 rgba(252,211,77,.15);
  transform: translateY(-2px);
}
.import-inline .bkp-label { color: #fcd34d; }

/* ══════════════════════════════════════════════════════════════
   SVG ICONS
   ══════════════════════════════════════════════════════════════ */
svg:not([width]):not([height]):not(.ic-svg) { max-width: 20px; max-height: 20px; }

.ic-svg {
  display: inline-block;
  width: 1em; height: 1em;
  min-width: 14px; max-width: 20px;
  vertical-align: -0.18em;
  flex-shrink: 0;
  stroke: var(--gold-light);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary .ic-svg, .btn-secondary .ic-svg, .btn-green .ic-svg, .btn-action .ic-svg {
  width: 0.95em; height: 0.95em; max-width: 18px; vertical-align: -0.12em;
}

.nav-btn .ic-svg { width: 1.1em; height: 1.1em; max-width: 20px; }

.section-title h2 .ic-svg { width: 1em; height: 1em; max-width: 18px; vertical-align: -0.18em; }

.det-title .ic-svg { width: 0.95em; height: 0.95em; max-width: 17px; vertical-align: -0.12em; }

.btn-del .ic-svg  { stroke: #fca5a5; }
.btn-edit .ic-svg { stroke: var(--gold-light); }
.btn-green .ic-svg { stroke: var(--green-deep); }

.search-icon .ic-svg, .login-pw-icon .ic-svg { stroke: rgba(201,168,76,.6); }

.legend-present .ic-svg { stroke: #6ee7b7; }
.legend-absent  .ic-svg { stroke: #fca5a5; }
.legend-excuse  .ic-svg { stroke: #fbbf24; }
.legend-holiday .ic-svg { stroke: var(--gold); }
.legend-event   .ic-svg { stroke: #93c5fd; }

#toast .ic-svg { width: 16px; height: 16px; max-width: 16px; flex-shrink: 0; }

.form-label .ic-svg { width: 0.9em; height: 0.9em; max-width: 16px; }

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
input[type=number] { -moz-appearance:textfield; }

/* ══════════════════════════════════════════════════════════════════
   ANIMATIONS — مشتركة
   ══════════════════════════════════════════════════════════════════ */

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

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .5; transform: scale(.7); }
}

@keyframes pulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.06); }
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, .35); }
  50%      { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}

@keyframes rowFlash {
  0%   { background: rgba(201, 168, 76, .18); }
  100% { background: transparent; }
}

@keyframes cellPop {
  0%   { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes dashCardEntrance {
  0%   { opacity: 0; transform: translateY(14px) scale(.96); }
  70%  { transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statCardIn {
  0%   { opacity: 0; transform: translateY(18px) scale(.94); }
  60%  { transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statNumPop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.18); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, .0); }
  50%      { box-shadow: 0 0 0 6px rgba(201, 168, 76, .12); }
}

@keyframes absentCardSlide {
  0%   { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes excuseCardSlide {
  0%   { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes absentPulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 165, 165, .0); border-color: rgba(252, 165, 165, .2); }
  50%      { box-shadow: 0 0 0 5px rgba(252, 165, 165, .1); border-color: rgba(252, 165, 165, .4); }
}

@keyframes excusePulseYellow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 211, 77, .0); border-color: rgba(252, 211, 77, .2); }
  50%      { box-shadow: 0 0 0 5px rgba(252, 211, 77, .08); border-color: rgba(252, 211, 77, .4); }
}

@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .0); border-color: rgba(239, 68, 68, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .85); }
}

@keyframes urgentRowFade {
  from { background: rgba(239, 68, 68, .04); }
  to   { background: rgba(239, 68, 68, .12); }
}

@keyframes urgentText {
  from { opacity: .8; }
  to   { opacity: 1; filter: drop-shadow(0 0 4px rgba(252, 165, 165, .6)); }
}
/* ══════════════════════════════════════════════════════════════════
   أرقام إحصاء اليوم — Impact + حجم أكبر
   ══════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════════
   أرقام إحصاء اليوم — Impact + حجم أكبر
   ══════════════════════════════════════════════════════════════════ */
.today-stat-item.present .today-stat-num,
.today-stat-item.absent .today-stat-num,
.today-stat-item.excuse .today-stat-num,
.today-stat-item .today-stat-num {
  font-family: 'Impact', 'Arial Black', sans-serif !important;
  font-size: 28px !important;
  font-weight: 400 !important;
  letter-spacing: 1px !important;
  -webkit-text-fill-color: unset !important;
  background: none !important;
}
/* ══════════════════════════════════════════════════════════════════
   تحسينات التنسيق النهائية
   ══════════════════════════════════════════════════════════════════ */

/* 1. جميع الأزرار بخط Cairo */
button,
.btn-primary,
.btn-secondary,
.btn-green,
.btn-icon,
.btn-wa,
.btn-action,
.btn-approve,
.btn-reject,
.btn-profile,
.btn-att,
.qbtn,
.qexc-opt,
.sq-nextbtn,
.sq-statusbar .btn-icon,
.sq-rate-active,
.pg-btn,
.cal-nav-btn,
.cal-filter-btn,
.hifz-filter-btn,
.schedule-day-btn,
.sheikh-btn-confirm,
.sheikh-btn-cancel,
.sheikh-btn-del-confirm,
.rating-opt,
.btn-confirm-yes,
.btn-confirm-no,
.ath-quick-btn,
.action-btn,
.call-dismiss,
.retry-btn,
.sync-btn,
.backup-inline-btn,
.btn-absence-history,
.abs-manager-btn,
.nav-btn {
  font-family: 'Cairo', sans-serif !important;
}

/* 2. عمود الترتيب في الجداول — 18px */
table td:first-child {
  font-size: 18px !important;
}

/* 3. التقارير: أسماء 16px + أرقام 18px + توسيط */
#monthlyTable td:nth-child(1) { font-size: 14px !important; }
#monthlyTable td:nth-child(5),
#monthlyTable td:nth-child(6) { 
  font-size: 16px !important; 
  text-align: center !important; 
}
.yearly-kpi-num { font-size: 18px !important; }

/* 4. مدة الجلسة في الإعدادات — 18px */
#session-duration {
  font-size: 18px !important;
  font-family: 'Cairo', sans-serif !important;
  font-weight: 700 !important;
}

/* 5. أرقام إحصاء اليوم — Impact كبير */
.today-stat-num {
  font-family: 'Impact', 'Arial Black', sans-serif !important;
  font-size: 28px !important;
  font-weight: 400 !important;
  letter-spacing: 1px !important;
}
/* ══ جميع الجداول: نصوص يمين + أرقام وسط ═══════════════════════ */
th { text-align: center !important; }
td { text-align: center !important; }
td:first-child, th:first-child { text-align: center !important; }
td:nth-child(2), th:nth-child(2) { text-align: right !important; }

/* استثناء: التقارير الشهرية - الطالب فقط يمين */
#monthlyTable td:nth-child(1),
#monthlyTable th:nth-child(1) { text-align: right !important; }

/* استثناء: التقارير السنوية - الطالب فقط يمين */
#yearly-content td:nth-child(1),
#yearly-content th:nth-child(1) { text-align: right !important; }
/* استثناء: التقارير السنوية - الطالب فقط يمين + أسماء 14px + أرقام 16px */
#yearly-content td:nth-child(1),
#yearly-content th:nth-child(1) { text-align: right !important; font-size: 14px !important; }
#yearly-content td:nth-child(3),
#yearly-content td:nth-child(4),
#yearly-content td:nth-child(5) { font-size: 14px !important; }
/* ══ زرا الكل حاضر / الكل غائب ═══════════════════════════════ */
.quick-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.qall-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: .85rem;
  transition: transform .3s;
}
.present-all {
  background: rgba(45,138,101,.12);
  border-color: rgba(110,231,183,.3);
  color: #6ee7b7;
}
.present-all .qall-icon {
  background: rgba(110,231,183,.2);
}
.present-all:hover {
  background: rgba(45,138,101,.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(110,231,183,.15);
  animation: greenPulse 1.5s ease-in-out infinite;
}
.absent-all {
  background: rgba(220,38,38,.08);
  border-color: rgba(252,165,165,.25);
  color: #fca5a5;
}
.absent-all .qall-icon {
  background: rgba(252,165,165,.15);
}
.absent-all:hover {
  background: rgba(220,38,38,.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252,165,165,.12);
  animation: redPulse 1.5s ease-in-out infinite;
}
@keyframes greenPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(110,231,183,.2); }
  50% { box-shadow: 0 0 0 10px rgba(110,231,183,0); }
}
@keyframes redPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(252,165,165,.15); }
  50% { box-shadow: 0 0 0 10px rgba(252,165,165,0); }
}