/* =========================================================
   منصة المعايير والمؤشرات المدرسية — الأنماط العامة
   ========================================================= */
:root {
  --brand: #0f5c55;
  --brand-700: #0b4440;
  --brand-600: #0d514b;
  --brand-100: #d7ebe8;
  --brand-50: #edf6f4;
  --accent: #b8892b;
  --accent-50: #faf3e3;
  --ink: #16242a;
  --ink-2: #33454c;
  --muted: #64767c;
  --line: #e2e9e8;
  --bg: #f3f6f5;
  --card: #ffffff;
  --danger: #b93a2e;
  --danger-50: #fcecea;
  --ok: #1d8656;
  --ok-50: #e7f5ee;
  --warn: #b7700b;
  --warn-50: #fdf3e2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 40, .05), 0 6px 20px rgba(16, 40, 40, .06);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.5; margin: 0; }
p { margin: 0; }
a { color: var(--brand); }
img, svg { display: inline-block; vertical-align: middle; }
.ic { flex-shrink: 0; }

.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid rgba(15, 92, 85, .35); outline-offset: 2px; border-radius: 6px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px;
  font: 600 15px/1.2 var(--font);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-700); }
.btn--ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--danger { background: var(--card); color: var(--danger); border-color: #f0cdc9; }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ---------- التنبيهات ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 500;
  border: 1px solid transparent;
}
.alert .ic { margin-top: 4px; }
.alert--success { background: var(--ok-50); color: #12603d; border-color: #c4e6d4; }
.alert--error { background: var(--danger-50); color: #8f2a20; border-color: #f2c9c4; }

/* ---------- الحالة الفارغة ---------- */
.empty {
  text-align: center; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 40px 16px;
}
.empty .ic { color: var(--brand-100); margin-bottom: 8px; }

/* =========================================================
   صفحة الزوار
   ========================================================= */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(900px 300px at 85% -10%, rgba(184, 137, 43, .28), transparent 60%),
    radial-gradient(700px 320px at 0% 120%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(135deg, #0f5c55 0%, #0a3f3b 100%);
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero__top { position: relative; z-index: 2; display: flex; justify-content: flex-end; padding-top: 16px; }
.admin-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 7px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .28);
  font: 600 14px/1.2 var(--font);
  backdrop-filter: blur(4px);
  transition: background-color .15s, color .15s, border-color .15s;
}
.admin-btn:hover { background: #fff; color: var(--brand); border-color: #fff; }
.hero__inner { position: relative; z-index: 1; padding-block: 12px 64px; text-align: center; }
.hero__mark {
  display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 14px;
  border-radius: 18px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
}
.hero__title { font-size: clamp(1.5rem, 4.2vw, 2.25rem); font-weight: 700; }
.hero__sub { margin-top: 6px; color: rgba(255, 255, 255, .82); font-size: 1.05rem; }
.hero__stats {
  list-style: none; padding: 0; margin: 22px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.hero__stats li {
  padding: 6px 16px; border-radius: 999px; font-size: 15px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
}
.hero__stats strong { font-size: 1.1rem; margin-inline-end: 4px; color: #f6dfa8; }

.main { margin-top: -34px; position: relative; z-index: 2; padding-bottom: 40px; }

.bar-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.bar-top__info { color: var(--muted); font-size: 15px; }
.bar-top__info strong { color: var(--ink); }
.jump { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jump select {
  min-height: 36px; min-width: 200px; max-width: 100%;
  font: 500 14px var(--font); color: var(--ink);
  padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}

.standards { display: grid; gap: 20px; }

.std {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 16px;
}
.std__head {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: start;
  padding: 18px 20px; background: linear-gradient(180deg, var(--brand-50), #fff);
  border-bottom: 1px solid var(--line);
  border-inline-start: 5px solid var(--brand);
}
.std__label {
  grid-column: 1 / -1; justify-self: start;
  display: inline-block; padding: 2px 12px; border-radius: 999px;
  background: var(--accent-50); color: #8a6417; border: 1px solid #efdcb3;
  font-size: 13px; font-weight: 700;
}
.std__title { font-size: 1.15rem; font-weight: 700; color: var(--brand-700); }
.std__count {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 13px; color: var(--muted); padding-top: 4px;
}
.std__empty { padding: 18px 20px; color: var(--muted); }

.els { list-style: none; margin: 0; padding: 0; }
.el { padding: 16px 20px; border-top: 1px solid var(--line); }
.el:first-child { border-top: 0; }
.el__head { display: flex; gap: 12px; align-items: flex-start; }
.el__num {
  flex-shrink: 0; display: grid; place-items: center;
  width: 30px; height: 30px; margin-top: 1px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700;
}
.el__title { font-size: 1rem; font-weight: 600; color: var(--ink); }
.el__body { padding-inline-start: 42px; }

.el__desc { margin-top: 6px; }
.el__desc summary {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none;
  color: var(--brand); font-size: 14px; font-weight: 600; user-select: none;
}
.el__desc summary::-webkit-details-marker { display: none; }
.el__desc summary .ic { transition: transform .2s; }
.el__desc[open] summary .ic { transform: rotate(180deg); }
.el__desc p {
  margin-top: 8px; padding: 10px 14px; font-size: 15px; color: var(--ink-2);
  background: #f8faf9; border-radius: var(--radius-sm); border-inline-start: 3px solid var(--brand-100);
}

.el__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ev-link {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 7px 14px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.ev-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.ev-none { font-size: 13px; color: var(--muted); background: #f5f6f6; padding: 4px 12px; border-radius: 999px; }

/* ---------- التنقل بين الصفحات ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 30px; flex-wrap: wrap;
}
.pager__arrow {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 46px; padding: 8px 18px; border-radius: 999px;
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 4px 14px rgba(15, 92, 85, .25);
  transition: background-color .15s, transform .15s;
}
.pager__arrow:hover { background: var(--brand-700); transform: translateY(-1px); }
.pager__arrow.is-disabled { background: #dfe6e5; color: #93a2a5; box-shadow: none; cursor: not-allowed; transform: none; }
.pager__nums { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; justify-content: center; }
.pager__num {
  display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 6px;
  border-radius: 50%; background: var(--card); border: 1px solid var(--line);
  color: var(--ink-2); text-decoration: none; font-weight: 600;
}
a.pager__num:hover { border-color: var(--brand); color: var(--brand); }
.pager__num.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager__dots { display: grid; place-items: center; min-width: 24px; height: 42px; color: var(--muted); }
.pager__info { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }

.to-top {
  position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 5;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); color: var(--brand); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.to-top .ic { transform: rotate(180deg); }

.site-foot { padding: 22px 0 28px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: #fff; }

@media (max-width: 640px) {
  .hero__inner { padding-block: 10px 56px; }
  .hero__top { padding-top: 12px; }
  .admin-btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .std__head { grid-template-columns: 1fr; padding: 16px; }
  .std__count { padding-top: 0; }
  .el { padding: 14px 16px; }
  .el__body { padding-inline-start: 0; }
  .bar-top { flex-direction: column; align-items: stretch; }
  .jump select { flex: 1; min-width: 0; }
  .pager { gap: 8px; }
  .pager__arrow span { display: none; }
  .pager__arrow { width: 46px; padding: 0; justify-content: center; }
  .pager__num { min-width: 38px; height: 38px; }
}

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