/* ====================================================================
 *  مدرسة العنتراوي للتعليم الأساسي - الموقع الرسمي v2
 *  ملف التنسيق الرئيسي
 *  البرمجة: أحمد الشحات - 2026
 *  ✦ تحديث الهوية البصرية: أزرق فيروزي + أخضر زمردي + لمسات ذهبية
 * ==================================================================== */

:root {
  /* الألوان الرئيسية الجديدة */
  --teal: #0e7490;            /* أزرق فيروزي عميق */
  --teal-light: #0891b2;      /* أزرق فيروزي */
  --teal-dark: #155e75;       /* أزرق فيروزي داكن */
  --emerald: #059669;         /* أخضر زمردي */
  --emerald-light: #10b981;   /* أخضر زمردي فاتح */
  --emerald-dark: #047857;    /* أخضر زمردي داكن */
  --gold: #d4af37;            /* ذهبي - للُمسات التمييز */
  --gold-dark: #bd9a2b;
  --gold-light: #f5e6a8;
  /* أسماء قديمة محفوظة للتوافق مع الكود الموجود */
  --navy: var(--teal-dark);
  --navy-light: var(--teal);
  /* ألوان أساسية */
  --bg: #f0f9ff;              /* خلفية فاتحة بلمسة فيروزية */
  --bg-soft: #e0f2fe;         /* خلفية ناعمة */
  --white: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --line: #cbd5e1;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(14, 116, 144, 0.10);
  --shadow-lg: 0 20px 50px rgba(14, 116, 144, 0.18);
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
}
a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--emerald); }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ====================  شريط أعلى (Top Bar) ==================== */
.topbar {
  background: linear-gradient(90deg, var(--teal-dark) 0%, var(--teal) 100%);
  color: #fff;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 2px solid var(--gold);
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .info { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.topbar .info span { display: inline-flex; align-items: center; gap: 6px; }
.topbar .info a { color: #fff; }
.topbar .info a:hover { color: var(--gold-light); }
.topbar .social { display: flex; gap: 8px; }
.topbar .social a {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .15);
  color: #fff; border-radius: 50%; font-size: 14px; font-weight: 800;
  border: 1px solid rgba(255,255,255,.25);
  transition: all .2s;
}
.topbar .social a:hover { background: var(--gold); color: var(--teal-dark); border-color: var(--gold); transform: translateY(-1px); }

/* ====================  الهيدر (Header + Nav) ==================== */
.site-header {
  background: #fff;
  box-shadow: 0 4px 18px rgba(14,116,144,.08);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--bg-soft);
}
.site-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--emerald), var(--gold));
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand .logo-circle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 12px rgba(14,116,144,.25);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .3s;
}
.brand:hover .logo-circle { transform: rotate(-5deg) scale(1.05); }
.brand .logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.1));
}
.brand .brand-text { line-height: 1.35; }
.brand .brand-text .name {
  font-size: 18px;
  font-weight: 900;
  color: var(--teal-dark);
  letter-spacing: .3px;
}
.brand .brand-text .sub {
  font-size: 12px;
  color: var(--emerald);
  font-weight: 700;
  letter-spacing: .5px;
}
.brand .brand-text .sub span.h { color: var(--teal-dark); font-weight: 800; }

.nav { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.nav a {
  padding: 9px 11px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--teal-dark);
  border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
}
.nav a:hover,
.nav a.active {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
}
.nav a.cta-results {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--teal-dark);
  margin-right: 2px;
}
.nav a.cta-results:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(212,175,55,.4);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--teal-dark);
}
.nav a.cta-register {
  background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
  color: #fff;
  border: 1px solid var(--gold);
}
.nav a.cta-register:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(5,150,105,.35); color: #fff; }
.nav a.cta-login {
  background: #fff;
  color: var(--teal-dark);
  border: 1.5px solid var(--teal);
}
.nav a.cta-login:hover {
  background: var(--teal);
  color: #fff;
}
.nav a.cta-dashboard {
  background: linear-gradient(135deg, var(--emerald), var(--teal-dark));
  color: #fff;
  border: 1px solid var(--gold);
}
.nav a.cta-logout {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #dc2626;
}
.nav a.cta-logout:hover { background: #dc2626; color: #fff; }

.menu-toggle {
  display: none;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 16px;
  cursor: pointer;
  font-family: 'Cairo';
  font-weight: 700;
}

@media (max-width: 1080px) {
  .nav a { padding: 8px 9px; font-size: 12.5px; }
}
@media (max-width: 980px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    gap: 4px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 8px; font-size: 14px; }
}

/* ====================  Hero / Slideshow ==================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 50%, var(--emerald-dark) 100%);
  color: #fff;
  min-height: 480px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212,175,55,.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(16,185,129,.20) 0%, transparent 40%);
  z-index: 1;
  pointer-events: none;
}
.hero .slides { position: absolute; inset: 0; }
.hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.hero .slide.active { opacity: 1; }
.hero .slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,116,144,.88) 0%, rgba(8,145,178,.65) 50%, rgba(4,120,87,.78) 100%);
}
.hero .hero-content {
  position: relative;
  z-index: 2;
  padding: 90px 20px;
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
  animation: fadeUp 1s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero h1 {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 4px 18px rgba(0,0,0,.35);
  line-height: 1.3;
}
.hero h1 .accent {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,175,55,.4);
}
.hero p {
  font-size: 18px;
  max-width: 760px;
  margin: 0 auto 28px;
  color: rgba(255,255,255,.95);
  line-height: 1.8;
}
.hero .hero-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 15px;
  font-family: 'Cairo';
  cursor: pointer;
  border: none;
  transition: all .25s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--teal-dark);
  border: 1px solid var(--gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(212,175,55,.45); color: var(--teal-dark); }
.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}
.btn-secondary:hover { background: #fff; color: var(--teal-dark); }
.btn-navy {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  border: 1px solid var(--gold);
}
.btn-navy:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(14,116,144,.3); color: #fff; }
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(220,38,38,.4); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--teal-dark);
  border: 2px solid var(--line);
}
.btn-ghost:hover { border-color: var(--teal); }

.hero .dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero .dots button {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: transparent;
  cursor: pointer;
  transition: all .2s;
}
.hero .dots button.active { background: var(--gold); border-color: var(--gold); width: 28px; border-radius: 6px; }
.hero .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 3;
  font-size: 20px;
  transition: all .2s;
}
.hero .arrow:hover { background: var(--gold); color: var(--teal-dark); border-color: var(--gold); }
.hero .arrow.prev { right: 18px; }
.hero .arrow.next { left: 18px; }

/* ====================  Quick Links ==================== */
.quick-links { padding: 50px 0; }
.quick-links .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.quick-link-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: all .25s;
  display: block;
  position: relative;
  overflow: hidden;
}
.quick-link-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--emerald), var(--gold));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s;
}
.quick-link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.quick-link-card:hover::before { transform: scaleX(1); }
.quick-link-card .icon {
  width: 64px; height: 64px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: var(--gold);
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 28px;
  transition: transform .3s;
}
.quick-link-card:hover .icon { transform: rotate(-5deg) scale(1.1); }
.quick-link-card h3 {
  color: var(--teal-dark);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}
.quick-link-card p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* ====================  Page Header (داخلي) ==================== */
.page-header {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 50%, var(--emerald-dark) 100%);
  color: #fff;
  padding: 50px 20px 40px;
  position: relative;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 30%, rgba(212,175,55,.20), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(16,185,129,.15), transparent 50%);
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.page-header .breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  font-weight: 700;
}
.page-header .breadcrumb a { color: var(--gold-light); }
.page-header .breadcrumb a:hover { color: var(--gold); }

/* ====================  Page Section ==================== */
.page-section { padding: 50px 0; }
.page-section .lead {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 800px;
  margin-bottom: 30px;
  line-height: 1.9;
}
.section-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--teal-dark);
  margin-bottom: 18px;
  position: relative;
  padding-right: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 28px;
  background: linear-gradient(180deg, var(--teal), var(--emerald));
  border-radius: 6px;
}
.section-title.center { text-align: center; padding-right: 0; }
.section-title.center::before { display: none; }

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 30px;
}
.info-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--emerald);
  transition: all .25s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-right-color: var(--gold); }
.info-card .ico {
  font-size: 30px;
  color: var(--teal);
  margin-bottom: 12px;
}
.info-card h4 {
  color: var(--teal-dark);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}
.info-card p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}

/* ====================  News / Gallery / Activities grids ==================== */
.news-grid,
.gallery-grid,
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 30px;
}
.news-card,
.activity-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: all .25s;
  display: flex;
  flex-direction: column;
}
.news-card:hover,
.activity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card .thumb,
.activity-card .thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.news-card .thumb img,
.activity-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .5s;
}
.news-card:hover .thumb img,
.activity-card:hover .thumb img { transform: scale(1.06); }
.news-card .date-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gold);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  z-index: 2;
}
.news-card .body,
.activity-card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.news-card .body h3,
.activity-card .body h3 {
  color: var(--teal-dark);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.5;
}
.news-card .body p,
.activity-card .body p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
  flex: 1;
}
.news-card .read-more,
.activity-card .read-more {
  color: var(--emerald);
  font-weight: 800;
  font-size: 13px;
}

.gallery-grid .photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.gallery-grid .photo img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .5s;
}
.gallery-grid .photo:hover img { transform: scale(1.08); }
.gallery-grid .photo .caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(14,116,144,.85));
  color: #fff;
  padding: 18px 14px 12px;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(100%);
  transition: transform .3s;
}
.gallery-grid .photo:hover .caption { transform: translateY(0); }

/* ====================  Forms ==================== */
.form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  max-width: 720px;
  margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--teal-dark);
  margin-bottom: 6px;
}
.form-group label .req { color: var(--red); }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-family: 'Cairo';
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #fbfcfe;
  transition: all .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8,145,178,.15);
}
textarea.form-control { resize: vertical; min-height: 120px; }
.form-actions { margin-top: 20px; text-align: center; }
.form-note {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 10px;
  text-align: center;
}
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-weight: 700;
  display: none;
}
.alert.show { display: block; animation: slideIn .3s ease-out; }
.alert-success { background: #dcfce7; color: #166534; border-right: 4px solid var(--green); }
.alert-error { background: #fee2e2; color: #991b1b; border-right: 4px solid var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ====================  Results Page ==================== */
.results-card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 38px 32px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--gold);
  text-align: center;
}
.results-card .logos { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.results-card .logos img { height: 70px; }
.results-card h1 {
  color: var(--teal-dark);
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 6px;
}
.results-card h2 {
  color: var(--emerald);
  font-size: 15px;
  margin-bottom: 26px;
  font-weight: 700;
}

/* حاوية الشهادة (iframe) */
.cert-wrapper { width: 100%; margin-top: 30px; }
.cert-frame {
  width: 100%;
  min-height: 820px;
  border: 0;
  border-radius: 12px;
  background: #f0f9ff;
}
.cert-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0;
  flex-wrap: wrap;
}

/* ====================  Stats ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px;
  margin: 30px 0;
}
.stat-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border-bottom: 4px solid var(--emerald);
  transition: transform .25s;
}
.stat-box:hover { transform: translateY(-3px); }
.stat-box .num {
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--teal-dark), var(--emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-box .label {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
  margin-top: 6px;
}

/* ====================  Footer (متجدد v3) ==================== */
.site-footer {
  background: linear-gradient(180deg, var(--teal-dark) 0%, #064e63 100%);
  color: #fff;
  padding: 60px 0 0;
  margin-top: 0;
  position: relative;
  border-top: 3px solid var(--gold);
  box-shadow: 0 -10px 40px rgba(14, 116, 144, 0.15);
}
/* مثلث زخرفي علوي على اليمين */
.site-footer::after {
  content: "";
  position: absolute;
  top: -3px;
  right: 0;
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-light), var(--emerald-light));
  box-shadow: 0 0 12px rgba(245,230,168,.6);
}
.site-footer .footer-top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 30px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
  margin-bottom: 30px;
}
.site-footer .footer-top h3 {
  color: var(--gold);
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 4px 0;
  letter-spacing: .3px;
}
.site-footer .footer-top .footer-tagline {
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
}
.site-footer .footer-grid {
  display: grid;
  /* ✅ v5: 3 أعمدة دائماً مع minmax(0, 1fr) عشان ما يفيضوش بره الشاشة */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
  align-items: start;
}
/* ✅ v5: خلي الأعمدة جمب بعض على كل الشاشات (موبايل وديسكتوب) */
@media (max-width: 900px) {
  .site-footer .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 22px;
  }
  .site-footer .footer-top h3 { font-size: 18px; }
  .site-footer .footer-col h4 { font-size: 14px; margin-bottom: 14px; }
  .site-footer .footer-col ul li { font-size: 12.5px; margin-bottom: 8px; }
  .site-footer .footer-contact li { font-size: 12.5px; gap: 8px; margin-bottom: 10px; line-height: 1.5; }
  .site-footer .footer-contact li .ic { width: 24px; height: 24px; font-size: 12px; }
}
@media (max-width: 560px) {
  .site-footer .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 14px;
    padding-bottom: 28px;
  }
  .site-footer .footer-top { flex-direction: column; text-align: center; gap: 12px; padding-bottom: 22px; margin-bottom: 22px; }
  .site-footer .footer-top h3 { font-size: 16px; }
  .site-footer .footer-top .footer-tagline { font-size: 12px; }
  .site-footer .footer-logo { width: 60px; height: 60px; }
  .site-footer .footer-col h4 { font-size: 13px; margin-bottom: 10px; padding-bottom: 6px; }
  .site-footer .footer-col ul li { font-size: 11px; margin-bottom: 6px; }
  .site-footer .footer-col ul li a { gap: 4px; }
  .site-footer .footer-col ul li a::before { font-size: 7px; }
  .site-footer .footer-contact li { font-size: 10.5px; gap: 6px; margin-bottom: 8px; line-height: 1.4; }
  .site-footer .footer-contact li .ic { width: 20px; height: 20px; font-size: 10px; }
  .site-footer .footer-bottom { font-size: 11px; padding: 16px 0 20px; }
  .site-footer .footer-bottom .sep { margin: 0 4px; }
}
.site-footer .footer-about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.site-footer .footer-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: grid;
  place-items: center;
  border: 3px solid var(--gold-light);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,255,255,.15);
}
.site-footer .footer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.site-footer .footer-about h4 {
  color: var(--gold);
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 4px 0;
  letter-spacing: .5px;
}
.site-footer .footer-about .school-tagline {
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.site-footer .footer-about p {
  font-size: 13.5px;
  color: rgba(255,255,255,.78);
  line-height: 1.9;
  margin: 0;
  text-align: justify;
}
.site-footer .footer-col h4 {
  color: var(--gold);
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  position: relative;
}
.site-footer .footer-col h4::before {
  content: "";
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 40px;
  height: 2px;
  background: var(--gold);
}
.site-footer .footer-col ul { list-style: none; }
.site-footer .footer-col ul li {
  margin-bottom: 10px;
  font-size: 13.5px;
}
.site-footer .footer-col ul li a {
  color: rgba(255,255,255,.82);
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.site-footer .footer-col ul li a::before {
  content: "◀";
  font-size: 9px;
  color: var(--gold-dark);
  opacity: .7;
  transition: all .2s;
}
.site-footer .footer-col ul li a:hover { color: var(--gold); padding-right: 8px; }
.site-footer .footer-col ul li a:hover::before { color: var(--gold); opacity: 1; }
.site-footer .footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: rgba(255,255,255,.85);
  margin-bottom: 14px;
  font-size: 13.5px;
  line-height: 1.7;
  /* ✅ v5: ضمان لف النصوص الطويلة (العنوان) داخل العمود */
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}
.site-footer .footer-contact li > span,
.site-footer .footer-contact li > a {
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.site-footer .footer-contact li .ic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}
.site-footer .footer-contact li a { color: rgba(255,255,255,.82); }
.site-footer .footer-contact li a:hover { color: var(--gold); }

.site-footer .footer-bottom {
  padding: 22px 0 26px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  line-height: 1.7;
}
.site-footer .footer-bottom a { color: var(--gold); font-weight: 800; }
.site-footer .footer-bottom a:hover { color: var(--gold-light); }
.site-footer .footer-bottom .sep {
  display: inline-block;
  margin: 0 8px;
  color: rgba(212, 175, 55, 0.4);
}

/* ====================  Login Page ==================== */
.auth-wrap {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 50%, var(--emerald-dark) 100%);
  padding: 40px 20px;
  position: relative;
}
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212,175,55,.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(16,185,129,.20) 0%, transparent 40%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
  border: 2px solid var(--gold);
  text-align: center;
  position: relative;
  z-index: 1;
}
.auth-card .auth-logo {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  display: grid; place-items: center;
  border: 2px solid var(--gold);
  overflow: hidden;
}
.auth-card .auth-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-card h1 {
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 4px;
}
.auth-card .auth-sub {
  color: var(--emerald);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
}
.auth-card .form-group { text-align: right; }
.auth-card .form-group input {
  text-align: right;
}
.auth-back {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
}

/* ====================  Dashboard ==================== */
.dash-wrap { padding: 30px 0; }
.dash-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.dash-header .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-header .user-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: var(--gold);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900;
  border: 2px solid var(--gold);
}
.dash-header .user-name {
  font-size: 18px; font-weight: 800; color: var(--teal-dark);
}
.dash-header .user-role {
  font-size: 12px; color: var(--emerald); font-weight: 700;
}
.dash-header .dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.dash-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: #fff;
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}
.dash-tab {
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--text-soft);
  border: none;
  font-family: 'Cairo';
  font-size: 14px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dash-tab:hover { background: var(--bg-soft); color: var(--teal-dark); }
.dash-tab.active {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  border: 1px solid var(--gold);
}

.dash-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.dash-panel h2 {
  color: var(--teal-dark);
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 18px;
  padding-right: 14px;
  position: relative;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.dash-panel h2::before {
  content: "";
  position: absolute;
  right: 0;
  top: 4px;
  width: 5px; height: 22px;
  background: linear-gradient(180deg, var(--teal), var(--emerald));
  border-radius: 5px;
}
.panel-hidden { display: none; }

.content-list { display: grid; gap: 10px; margin-bottom: 20px; }
.content-list button {
  text-align: right;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Cairo';
  font-weight: 700;
  font-size: 14px;
  color: var(--teal-dark);
  transition: all .2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.content-list button:hover { background: #e0f2fe; }
.content-list button.active {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  border-color: var(--gold);
}
.content-list button .arrow { font-size: 18px; }

.editor-wrap { margin-top: 20px; }
.editor-wrap .form-control {
  min-height: 280px;
  font-family: 'Cairo', sans-serif;
  line-height: 1.7;
  direction: rtl;
  font-size: 14px;
}

/* جدول التسجيلات */
.reg-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 13px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
.reg-table th, .reg-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}
.reg-table th {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}
.reg-table tr:nth-child(even) td { background: #f0f9ff; }
.reg-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 10px;
}

/* قائمة الأخبار */
.news-admin-list { display: grid; gap: 12px; margin-bottom: 20px; }
.news-admin-item {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  border-right: 4px solid var(--emerald);
}
.news-admin-item .info { flex: 1; min-width: 200px; }
.news-admin-item .info h4 {
  color: var(--teal-dark);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}
.news-admin-item .info .meta {
  font-size: 12px;
  color: var(--emerald);
  font-weight: 700;
  margin-bottom: 6px;
}
.news-admin-item .info p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}
.news-admin-item .actions { display: flex; gap: 8px; flex-shrink: 0; }
.news-admin-item .actions button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Cairo';
  font-weight: 700;
  font-size: 12px;
}
.btn-edit { background: var(--teal); color: #fff; }
.btn-edit:hover { background: var(--teal-dark); }
.btn-del { background: #fee2e2; color: #991b1b; }
.btn-del:hover { background: #dc2626; color: #fff; }

/* ====================  Misc ==================== */
.text-center { text-align: center; }
.mt-30 { margin-top: 30px; }
.mt-50 { margin-top: 50px; }
.mb-30 { margin-bottom: 30px; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-soft);
}
.empty-state .ico { font-size: 50px; color: var(--gold); margin-bottom: 14px; }

.loading-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  color: var(--teal-dark);
  font-weight: 700;
}
.loading-spinner.show { display: flex; }
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.timeline { position: relative; padding-right: 30px; margin-top: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  right: 8px;
  top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--teal), var(--emerald));
}
.timeline .item {
  position: relative;
  margin-bottom: 28px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.timeline .item::before {
  content: "";
  position: absolute;
  right: -30px;
  top: 22px;
  width: 18px; height: 18px;
  background: var(--gold);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline .item .date {
  font-size: 13px;
  color: var(--emerald);
  font-weight: 800;
  margin-bottom: 6px;
}
.timeline .item h4 {
  color: var(--teal-dark);
  font-size: 17px;
  margin-bottom: 6px;
  font-weight: 800;
}
.timeline .item p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}

/* lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(14,116,144,.92);
  z-index: 2000;
  align-items: center; justify-content: center;
  padding: 20px;
  display: none;
}
#lightbox.show { display: flex; }
#lightbox img {
  max-width: 90%; max-height: 90vh;
  border-radius: 14px; border: 3px solid var(--gold);
}
#lightbox .close-x {
  position: absolute; top: 20px; left: 20px;
  color: #fff; font-size: 30px; cursor: pointer;
  background: rgba(0,0,0,.5);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
}
