/* ==========================================================
   متوسطة صهيب بن سنان — الأنماط المشتركة
   لتغيير الخط: عدّل --font-body و --font-head فقط
   ========================================================== */
:root {
  --font-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-head: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;

  --teal-900: #0A3F37;
  --teal-700: #0E5A4E;
  --teal-50:  #E4EFEC;
  --gold:     #D9B26A;
  --gold-ink: #8C5E12;
  --gold-50:  #F4EBDA;
  --ground:   #F7F5EF;
  --surface:  #FFFFFF;
  --ink:      #16211F;
  --ink-2:    #3E4A47;
  --muted:    #55625F;
  --line:     #E2DDD0;
  --line-2:   #EEEAE0;
  --soft:     #F2EFE6;
  --on-teal:  #D5E6E2;

  --st-done-bg:#DDEFE8;  --st-done-fg:#0A4A3F;
  --st-on-bg:#DCE8F7;    --st-on-fg:#174A85;
  --st-late-bg:#FBE9D7;  --st-late-fg:#8A3F06;
  --st-check-bg:#EDE7F6; --st-check-fg:#4A2F80;
  --st-wait-bg:#ECEAE4;  --st-wait-fg:#3E4A47;

  --r-sm: 10px; --r-md: 16px; --r-lg: 24px;
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-700); }
a:hover { color: var(--teal-900); }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.3; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 64px; }
.eyebrow { color: var(--gold-ink); font-weight: 600; font-size: 15px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); margin-top: 6px; }
.lead { color: var(--muted); font-size: 16px; max-width: 440px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 22px; border-radius: var(--r-sm);
  font: 600 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-900); color: #fff; }
.btn-light { background: #fff; color: var(--teal-900); }
.btn-light:hover { background: var(--teal-50); color: var(--teal-900); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-outline { border-color: var(--teal-700); color: var(--teal-700); background: #fff; }
.btn-outline:hover { background: var(--teal-50); }

/* ---------- الترويسة ---------- */
.site-header { background: var(--teal-900); color: #fff; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; }
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  max-width: none; min-height: 64px; padding-inline: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-mark {
  height: 42px; width: auto; background: transparent; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font: 700 16px var(--font-head); white-space: nowrap; }
.brand-text small { font-size: 11px; color: #C9DDD8; white-space: nowrap; }
.main-nav { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; }
.main-nav a { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; white-space: nowrap; }
.main-nav a:hover { background: rgba(255,255,255,.1); }
.main-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.nav-toggle {
  display: none; background: rgba(255,255,255,.1); border: 0; color: #fff;
  width: 44px; height: 44px; border-radius: 10px; cursor: pointer; margin-inline-start: auto;
}
@media (max-width: 1180px) {
  .site-header .wrap { flex-wrap: wrap; }
  .nav-toggle { display: grid; place-items: center; }
  .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; order: 3; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 12px; }
}

/* ---------- البطل ---------- */
.hero { background: var(--teal-700); color: #fff; }
.hero .wrap { padding-block: 72px 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; }
.pill-glass { align-self: flex-start; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); padding: 8px 16px; border-radius: 999px; font-size: 14px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 52px); }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 18px; line-height: 1.8; color: var(--on-teal); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.stat-glass { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 28px; }
.stat-glass b { display: block; font: 700 clamp(36px, 4vw, 48px)/1 var(--font-head); }
.stat-glass span { display: block; margin-top: 10px; color: var(--on-teal); }

/* ---------- سلايدر الصور ---------- */
.slider { position: relative; height: clamp(440px, 72vh, 700px); background: var(--teal-900); color: #fff; overflow: hidden; }
.slides { position: absolute; inset: 0; }
.slide {
  margin: 0; position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .9s ease, visibility 0s linear .9s;
  /* خلفية بديلة تظهر إن لم توجد الصورة */
  background:
    radial-gradient(circle at 15% 20%, rgba(217,178,106,.25), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(127,196,179,.18), transparent 50%),
    var(--teal-700);
}
.slide.is-active { opacity: 1; visibility: visible; transition: opacity .9s ease; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 7s ease-out; }
.slide.is-active img { transform: scale(1); }
.slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to left, rgba(10,63,55,.55) 0%, rgba(10,63,55,.22) 34%, rgba(10,63,55,0) 68%),
              linear-gradient(to top, rgba(10,63,55,.35), transparent 28%);
}
.slide figcaption { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; padding-bottom: 60px; }
.slide figcaption .wrap { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.slide h1, .slide h2 { font-size: clamp(30px, 4.4vw, 54px); max-width: 760px; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.slide h1 span, .slide h2 span { color: var(--gold); }
.slide .hero-actions { margin-top: 6px; }
.slide.is-active figcaption .wrap > * { animation: rise .8s ease both; }
.slide.is-active figcaption .wrap > :nth-child(2) { animation-delay: .12s; }
.slide.is-active figcaption .wrap > :nth-child(3) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.slider-arrow {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(10,63,55,.35); color: #fff; display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(4px); transition: background .2s;
}
.slider-arrow:hover { background: rgba(10,63,55,.75); }
.slider-arrow.prev { inset-inline-start: 20px; }
.slider-arrow.next { inset-inline-end: 20px; }
.slider-bar { position: absolute; z-index: 3; bottom: 72px; inset-inline: 0; display: flex; justify-content: center; align-items: center; gap: 14px; }
.dots { display: flex; gap: 8px; }
.dots button {
  width: 34px; height: 44px; border: 0; background: none; cursor: pointer; padding: 0; position: relative;
}
.dots button::before {
  content: ""; position: absolute; inset-inline: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255,255,255,.35);
}
.dots button::after {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--gold); width: 0;
}
.dots button[aria-selected="true"]::after { width: 100%; transition: width var(--slide-ms, 6000ms) linear; }
.slider.paused .dots button[aria-selected="true"]::after { width: 100%; transition: none; }
.slider-pause { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(10,63,55,.35); color: #fff; display: grid; place-items: center; cursor: pointer; }
.slider-pause .i-play { display: none; }
.slider.paused .slider-pause .i-play { display: block; }
.slider.paused .slider-pause .i-pause { display: none; }
@media (max-width: 700px) {
  .slider-arrow { display: none; }
  .slide::after { background: linear-gradient(to top, rgba(10,63,55,.62) 0%, rgba(10,63,55,.22) 42%, rgba(10,63,55,0) 70%); }
  .slide figcaption { align-items: flex-end; padding-bottom: 110px; }
}

/* ---------- شريط الأرقام ---------- */
.stats-strip { position: relative; z-index: 5; margin-top: -48px; }
.stats-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 18px 40px rgba(10,63,55,.12);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stats-row div { padding: 24px 20px; text-align: center; border-inline-start: 1px solid var(--line-2); }
.stats-row div:first-child { border-inline-start: 0; }
.stats-row b { display: block; font: 700 clamp(28px, 3vw, 38px)/1.1 var(--font-head); color: var(--teal-700); }
.stats-row span { display: block; margin-top: 6px; color: var(--muted); font-size: 15px; }

/* ---------- بطاقات الخدمات ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.service {
  display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 24px; text-decoration: none; color: var(--ink); min-height: 150px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.service:hover { color: var(--ink); border-color: var(--teal-700); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10,63,55,.08); }
.icon-tile { width: 48px; height: 48px; border-radius: 12px; background: var(--teal-50); color: var(--teal-700); display: grid; place-items: center; }
.service h3 { font-size: 19px; font-weight: 600; }
.service p { color: var(--muted); font-size: 14px; }

/* ---------- الشارات والحالات ---------- */
.chip { display: inline-block; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--teal-50); color: var(--teal-900); }
.chip-outline { background: transparent; border: 1px solid var(--teal-700); font-weight: 600; padding: 10px 18px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.status { display: inline-block; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.status.done  { background: var(--st-done-bg);  color: var(--st-done-fg); }
.status.on    { background: var(--st-on-bg);    color: var(--st-on-fg); }
.status.late  { background: var(--st-late-bg);  color: var(--st-late-fg); }
.status.check { background: var(--st-check-bg); color: var(--st-check-fg); }
.status.wait  { background: var(--st-wait-bg);  color: var(--st-wait-fg); }

/* ---------- شريط التقدم (المنجز مقابل المتوقع) ---------- */
.progress { position: relative; height: 10px; background: var(--line-2); border-radius: 999px; }
.progress .bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--teal-700); border-radius: 999px; transition: width .6s ease; }
.progress .mark { position: absolute; inset-block: -4px; width: 2px; background: var(--ink); }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- لوحة الخطة في الرئيسية ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.hl-item { padding-block: 14px; border-bottom: 1px solid var(--line-2); }
.hl-item:last-child { border-bottom: 0; }
.hl-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; }

/* ---------- الأخبار والألبومات ---------- */
.news { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.news .ph { height: 170px; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 13px; }
.news .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.news .tag { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--gold-ink); background: var(--gold-50); padding: 4px 10px; border-radius: 999px; }
.news h3 { font-size: 18px; font-weight: 600; line-height: 1.5; }
.news time { color: var(--muted); font-size: 14px; }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  font: 600 15px var(--font-body); padding: 10px 18px; min-height: 44px; border-radius: 999px; cursor: pointer;
  border: 1px solid #D6D0C2; background: #fff; color: var(--ink);
}
.tab[aria-selected="true"] { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.album {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 200px; border-radius: var(--r-md);
  padding: 18px; color: #fff; text-decoration: none; background-size: cover; background-position: center; position: relative; overflow: hidden;
}
.album::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,63,55,.85), rgba(10,63,55,.1)); }
.album > * { position: relative; }
.album:hover { color: #fff; }
.album strong { font: 600 17px/1.45 var(--font-head); }
.album span { font-size: 13px; color: #E8F1EF; }

/* ---------- عن المدرسة ---------- */
.principal { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--teal-50); color: var(--teal-700); display: grid; place-items: center; font: 700 20px var(--font-head); flex-shrink: 0; }
.vm { border-radius: 18px; padding: 28px; }
.vm.dark { background: var(--teal-900); color: #fff; }
.vm.dark .label { color: var(--gold); }
.vm.light { background: var(--surface); border: 1px solid var(--line); }
.vm .label { font-weight: 600; font-size: 14px; color: var(--gold-ink); }
.vm p { margin-top: 10px; font-size: 17px; line-height: 1.8; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--teal-900); color: var(--on-teal); }
.site-footer .cols { padding-block: 56px 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.site-footer h4 { margin: 0 0 12px; color: #fff; font-size: 16px; }
.site-footer a { color: var(--on-teal); text-decoration: none; display: block; padding-block: 4px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.map-ph { height: 120px; border-radius: 12px; background: var(--teal-700); display: grid; place-items: center; font-size: 13px; }
.copy { border-top: 1px solid rgba(255,255,255,.12); padding-block: 18px 28px; font-size: 13px; color: #A9C3BD; }

/* ---------- صفحة الخطة ---------- */
.page-hero { background: var(--teal-700); color: #fff; }
.page-hero .wrap { padding-block: 48px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.page-hero h1 { font-size: clamp(32px, 4vw, 44px); margin-block: 8px; }
.page-hero p { color: var(--on-teal); font-size: 17px; max-width: 620px; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; flex: 1 1 480px; max-width: 620px; }
.summary div { background: rgba(255,255,255,.08); border-radius: 14px; padding: 18px; }
.summary b { display: block; font: 700 34px/1 var(--font-head); }
.summary b.warn { color: #F6C38C; }
.summary span { display: block; font-size: 13px; color: var(--on-teal); margin-top: 6px; }
@media (max-width: 560px) { .summary { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.domain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.domain-top { display: flex; justify-content: space-between; align-items: baseline; }
.domain-top h3 { font-size: 19px; font-weight: 600; }
.domain-top b { font: 700 28px var(--font-head); color: var(--teal-700); }
.domain p { color: var(--muted); font-size: 14px; }

.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.goal { background: var(--surface); border: 1px solid #D6D0C2; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.goal .num { width: 30px; height: 30px; border-radius: 8px; background: var(--teal-50); color: var(--teal-900); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.goal h3 { font: 600 15px/1.5 var(--font-body); }
.goal small { margin-top: auto; font-size: 13px; color: var(--teal-700); }
.goal.empty { background: #FBF8F1; border-style: dashed; }
.goal.empty .num { background: var(--st-wait-bg); color: var(--ink-2); }
.goal.empty small { color: var(--st-late-fg); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
table.programs { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 14px; }
.programs th { background: var(--soft); text-align: right; padding: 14px 16px; font-weight: 600; color: var(--ink-2); }
.programs td { padding: 16px; border-top: 1px solid var(--line-2); vertical-align: top; color: var(--ink-2); }
.programs td.name strong { display: block; color: var(--ink); font-size: 15px; }
.programs td.name small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.programs td.num { color: var(--muted); font-weight: 600; }
.programs td.prog { width: 220px; }
.note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- بوابة المنسوبين ---------- */
.portal { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 240px; background: var(--teal-900); color: var(--on-teal); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; }
.sidebar .brand { padding: 4px 8px 20px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; color: var(--on-teal); text-decoration: none; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.portal-main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 600px) { .portal-main { padding: 20px 16px; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field select, .field input[type="date"] {
  font: 15px var(--font-body); padding: 10px 14px; min-height: 44px; border: 1px solid #D6D0C2; border-radius: 10px; background: #fff; color: var(--ink); min-width: 170px;
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { display: block; font: 700 32px var(--font-head); margin-top: 4px; }
.kpi.p b { color: var(--st-done-fg); } .kpi.a b { color: var(--st-late-fg); } .kpi.l b { color: var(--st-on-fg); }
.kpi.rate { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.kpi.rate span { color: var(--on-teal); }
.roster { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.roster-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--soft); }
.row:first-of-type { border-top: 0; }
.who { display: flex; align-items: center; gap: 12px; }
.who .n { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--ink-2); display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.seg { display: flex; gap: 6px; }
.seg button {
  font: 600 14px var(--font-body); padding: 8px 14px; min-height: 44px; min-width: 64px; border-radius: 10px; cursor: pointer;
  border: 1px solid #D6D0C2; background: #fff; color: var(--ink-2);
}
.seg button[aria-pressed="true"][data-v="P"] { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.seg button[aria-pressed="true"][data-v="A"] { background: #B4540A; border-color: #B4540A; color: #fff; }
.seg button[aria-pressed="true"][data-v="L"] { background: #1E5FA8; border-color: #1E5FA8; color: #fff; }
.save-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--teal-700); }
.toast { position: fixed; inset-inline: 0; bottom: 24px; margin-inline: auto; width: max-content; max-width: 90vw; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

/* ---------- تطبيق ولي الأمر ---------- */
.app { max-width: 480px; margin-inline: auto; min-height: 100vh; background: var(--ground); padding-bottom: 96px; }
.app-top { background: var(--teal-900); color: #fff; padding: 28px 20px 72px; }
.app-top .row-x { display: flex; justify-content: space-between; align-items: center; }
.app-top small { color: #A9C3BD; font-size: 14px; }
.app-top h1 { font-size: 22px; margin-top: 4px; }
.app-top p { color: var(--on-teal); font-size: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.today { margin: -52px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; position: relative; }
.today-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 14px; }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; text-align: center; }
.mini div { background: var(--soft); border-radius: 12px; padding: 12px 6px; }
.mini b { font: 700 20px var(--font-head); display: block; }
.mini span { font-size: 12px; color: var(--muted); }
.tiles { padding: 20px 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 10px; min-height: 92px; font-weight: 600; }
.tile:hover { color: var(--ink); border-color: var(--teal-700); }
.tile svg { color: var(--teal-700); }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; max-width: 480px; margin-inline: auto; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding: 8px 8px 20px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 12px; padding: 6px 0; min-height: 44px; }
.tabbar a[aria-current="page"] { color: var(--teal-700); font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- بطاقات البرامج اللاصفية ---------- */
article.service:hover { transform: none; box-shadow: none; border-color: var(--line); }
.prog-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.prog-meta span:first-child { color: var(--teal-700); font-weight: 600; }

/* البرامج اللاصفية في صف واحد (يتمرر أفقيًا على الشاشات الصغيرة) */
.one-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin;
}
.one-row > .service { scroll-snap-align: start; padding: 20px; min-height: 0; gap: 12px; }
.one-row .service h3 { font-size: 17px; }
.one-row .service p { font-size: 13.5px; }
.one-row .prog-meta { flex-direction: column; font-size: 12.5px; }

/* ---------- أعذار الغياب ---------- */
.excuse { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(24px, 4vw, 48px); background: var(--teal-900); color: #fff; border-radius: var(--r-lg); padding: clamp(24px, 4vw, 44px); align-items: start; }
.excuse-info { display: flex; flex-direction: column; gap: 16px; }
.excuse-info .eyebrow { color: var(--gold); }
.excuse-info h2 { font-size: clamp(26px, 3vw, 34px); }
.excuse-info > p { color: var(--on-teal); font-size: 16px; line-height: 1.8; max-width: 460px; }
.steps { list-style: none; counter-reset: s; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; align-items: center; }
.steps li::before { content: counter(s); grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); border: 1px solid rgba(217,178,106,.6); color: var(--gold); display: grid; place-items: center; font: 700 16px var(--font-head); }
.steps b { font-size: 16px; }
.steps span { color: var(--on-teal); font-size: 14px; }
.excuse-note { font-size: 14px; color: #A9C3BD; }
.excuse-form, .excuse-done { background: var(--surface); color: var(--ink); border-radius: var(--r-md); padding: clamp(20px, 3vw, 28px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.field .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input[type="text"], .field input[type="tel"], .field textarea, .excuse-form .field select, .excuse-form .field input[type="date"] {
  font: 15px var(--font-body); padding: 10px 14px; min-height: 44px; border: 1px solid #D6D0C2; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; min-width: 0;
}
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: #B4261A; box-shadow: 0 0 0 3px rgba(180,38,26,.12); }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.reasons label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid #D6D0C2; border-radius: 999px; cursor: pointer; font-size: 14px; }
.reasons label:has(input:checked) { border-color: var(--teal-700); background: var(--teal-50); color: var(--teal-900); font-weight: 600; }
.reasons input { accent-color: var(--teal-700); width: 18px; height: 18px; margin: 0; }
.drop { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border: 1.5px dashed #C9C2B1; border-radius: 12px; color: var(--muted); cursor: pointer; font-size: 14px; }
.drop:hover, .drop.has-file { border-color: var(--teal-700); color: var(--teal-900); background: var(--teal-50); }
.form-error { margin-top: 14px; color: #8E1F14; background: #FBE4E1; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.excuse-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-block: 40px; }
.excuse-done[hidden] { display: none; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--st-done-bg); color: var(--teal-700); display: grid; place-items: center; }
.excuse-done h3 { font-size: 22px; }
.excuse-done p { color: var(--muted); max-width: 360px; }
.excuse-done b { color: var(--ink); font-family: var(--font-head); letter-spacing: .04em; }

/* رابط رفع أعذار الغياب */
.excuse-screen { padding-block: 8px 32px; }
.excuse-entry { display: flex; align-items: center; gap: 16px; width: 100%; max-width: none; padding: 16px 24px; border-radius: var(--r-md); background: var(--teal-900); color: #fff; text-decoration: none; transition: background .15s; }
.excuse-entry:hover { background: var(--teal-700); color: #fff; }
.excuse-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--gold); color: var(--teal-900); display: grid; place-items: center; flex-shrink: 0; }
.excuse-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.excuse-text b { font: 600 19px var(--font-head); }
.excuse-text small { color: var(--on-teal); font-size: 14px; }
.excuse-go { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; }

.news-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.news .body p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.contact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.contact-card { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.contact-card:hover { border-color: var(--teal-700); color: var(--ink); }
.contact-card span { color: var(--muted); font-size: 14px; }
.contact-card strong { font: 600 22px var(--font-head); }
.notice { background: var(--gold-50); color: var(--gold-ink); border-radius: 12px; padding: 14px 16px; line-height: 1.8; }
.doc-groups { display: grid; gap: 28px; }
.doc-groups h2 { font-size: 20px; margin-bottom: 12px; }
.doc-list { display: grid; gap: 8px; }
.doc-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.doc-list a:hover { border-color: var(--teal-700); color: var(--ink); }
.doc-list small { color: var(--muted); font-weight: 500; }

[hidden] { display: none !important; }

.goal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.goal-list li { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.goal-list .num { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-700); color: #fff; display: grid; place-items: center; font-weight: 700; }
.goal-list li.empty { background: transparent; border-style: dashed; }
.goal-list li.empty .num { background: #9AA5A1; }
.goal-list small { color: var(--gold-ink); font-weight: 600; }
.goal-list li.empty small { color: var(--muted); font-weight: 400; }
.plan-block { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 20px; overflow: hidden; }
.plan-block header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 16px 20px; background: #EAF1EE; border-bottom: 1px solid var(--line); }
.plan-row { display: grid; gap: 10px 16px; padding: 16px 20px; border-top: 1px solid var(--line-2); }
.plan-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.plan-head { display: none; }
@media (min-width: 980px) {
  .plan-row, .plan-head { grid-template-columns: 1.3fr 1.6fr .6fr 1.1fr 1.1fr 1fr .9fr; }
  .plan-head { display: grid; gap: 16px; padding: 14px 20px; background: #FAF8F2; color: var(--muted); font-size: 13px; font-weight: 600; }
  .plan-label { display: none; }
}

.gate { max-width: 520px; margin: 32px auto; display: flex; flex-direction: column; gap: 16px; }
.student-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.student-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.absence-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-block: 1px solid var(--line-2); }
.add-excuse { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--teal-700); color: #fff; display: grid; place-items: center; cursor: pointer; }
.phone-error { color: #8E1F14; font-size: 14px; font-weight: 600; }
.student-card[hidden], .excuse-panel[hidden], .excuse-note[hidden], .excuse-file-error[hidden], .phone-error[hidden] { display: none !important; }
