:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --text: #0f172a;
  --muted: #5b6478;
  --border: #e3e8f0;
  --primary: #14427a;
  --primary-2: #1f6fb2;
  --gold: #c9a24a;
  --gold-2: #e9cf86;
  --navy: #0a2142;
  --primary-ink: #ffffff;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --bg-alt: #111a2e;
    --text: #e8edf7;
    --muted: #9aa6bf;
    --border: #1f2a44;
    --card: #131d33;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --primary: #3b7fd0;
    --primary-2: #1f5fa8;
    --gold: #d9b65f;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.container--narrow { width: min(800px, 100% - 32px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 12px; font-weight: 700; font-size: 1rem;
  border: 1.5px solid transparent; cursor: pointer; transition: .2s; font-family: inherit;
}
.btn--primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: 0 8px 20px rgba(20, 66, 122, .3); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(20, 66, 122, .4); }
.btn--ghost { border-color: var(--border); background: var(--card); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--sm { padding: 9px 18px; font-size: .95rem; }
.btn--block { width: 100%; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo__mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; filter: drop-shadow(0 4px 8px rgba(10,33,66,.25)); }
.logo__mark img { width: 44px; height: 44px; }
.logo__text { display: grid; line-height: 1.15; }
.logo__text b { font-family: "El Messiri", "Tajawal", serif; font-weight: 700; font-size: 1.45rem; letter-spacing: 0; color: var(--text); }
.logo__text small { font-size: .74rem; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.nav__links { display: flex; align-items: center; gap: 26px; font-weight: 500; }
.nav__links a:not(.btn):hover { color: var(--primary); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }

/* Hero */
.hero { padding: 80px 0 60px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(20,66,122,.18), transparent 60%); z-index: -1;
}
.hero__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); font-size: .9rem; font-weight: 500; margin-bottom: 18px; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.3; font-weight: 800; margin-bottom: 18px; }
.grad { background: linear-gradient(135deg, #a8761f, #d2a648 50%, #8f6418); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 28px; max-width: 560px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.hero__checks { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .95rem; }
.hero__checks li::before { content: "✓"; color: #10b981; font-weight: 800; margin-inline-end: 6px; }

.hero__visual { position: relative; }
.mock { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mock__bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.mock__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock__body { padding: 24px; display: grid; gap: 14px; }
.mock__line { height: 12px; border-radius: 6px; background: var(--bg-alt); }
.w70 { width: 70%; } .w40 { width: 40%; }
.mock__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock__cards div { height: 70px; border-radius: 12px; background: linear-gradient(135deg, rgba(20,66,122,.15), rgba(6,182,212,.15)); }
.mock__chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.mock__chart span { flex: 1; border-radius: 8px 8px 0 0; background: linear-gradient(to top, var(--primary), var(--primary-2)); }
.float {
  position: absolute; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: .9rem; animation: bob 4s ease-in-out infinite;
}
.float--a { top: -18px; left: -10px; }
.float--b { bottom: -18px; right: -10px; animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* Stats */
.stats { padding: 20px 0 50px; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.9rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat span { color: var(--muted); }

/* Sections */
.section { padding: 90px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.eyebrow { display: inline-block; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.35; font-weight: 800; margin-bottom: 12px; }
.section__head p, .why__text p, .contact__info p { color: var(--muted); font-size: 1.05rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; transition: .25s; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card__icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--bg-alt); margin-bottom: 18px; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--muted); }

/* Why */
.why { display: grid; grid-template-columns: 1fr 1.4fr; gap: 50px; align-items: center; }
.why__text .btn { margin-top: 22px; }
.why__list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.why__list li { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; border-inline-start: 4px solid var(--primary); }
.why__list b { display: block; margin-bottom: 4px; }
.why__list span { color: var(--muted); font-size: .95rem; }

/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: s; }
.steps li { text-align: center; padding: 20px; position: relative; }
.steps__num {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px rgba(20,66,122,.3);
}
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); }

/* Work */
.filters { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.filter { font-family: inherit; font-size: 1rem; padding: 8px 20px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; transition: .2s; }
.filter.is-active, .filter:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work__item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .25s; }
.work__item:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.work__item.is-hidden { display: none; }
.work__thumb { height: 190px; display: grid; place-items: center; font-size: 4rem; }
.t1 { background: linear-gradient(135deg, #fbcfe8, #c4b5fd); }
.t2 { background: linear-gradient(135deg, #bae6fd, #a7f3d0); }
.t3 { background: linear-gradient(135deg, #fed7aa, #fde68a); }
.t4 { background: linear-gradient(135deg, #c7d2fe, #bfdbfe); }
.t5 { background: linear-gradient(135deg, #e7d3c1, #fcd9b8); }
.t6 { background: linear-gradient(135deg, #a5f3fc, #c4b5fd); }
.work__info { padding: 18px 22px; }
.work__info span { color: var(--muted); font-size: .95rem; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.plan { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; position: relative; }
.plan--featured { border: 2px solid var(--primary); box-shadow: 0 20px 40px rgba(20,66,122,.18); transform: scale(1.03); }
.plan__tag { position: absolute; top: -14px; right: 50%; transform: translateX(50%); background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; padding: 4px 16px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.plan h3 { font-size: 1.3rem; }
.plan__desc { color: var(--muted); margin-bottom: 18px; }
.plan__price { margin-bottom: 20px; color: var(--muted); }
.plan__price b { font-size: 2.2rem; color: var(--text); font-weight: 800; }
.plan ul { list-style: none; margin-bottom: 26px; flex: 1; display: grid; gap: 10px; align-content: start; }
.plan li::before { content: "✓"; color: #10b981; font-weight: 800; margin-inline-end: 8px; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); margin-top: 10px; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; align-items: start; }
.contact__list { list-style: none; margin-top: 24px; display: grid; gap: 12px; font-weight: 500; }
.form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.form input, .form select, .form textarea {
  font-family: inherit; font-size: 1rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); transition: .2s; width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,66,122,.15); }
.form .invalid { border-color: #ef4444; }
.form__msg { text-align: center; font-weight: 700; min-height: 1.5em; }
.form__msg.ok { color: #10b981; }
.form__msg.err { color: #ef4444; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); }

.fab {
  position: fixed; bottom: 22px; left: 22px; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem; z-index: 40;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 25px rgba(20,66,122,.4);
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float { animation: none; }
  html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero__grid, .why, .contact { grid-template-columns: 1fr; }
  .hero { padding-top: 50px; }
  .hero__visual { max-width: 520px; margin: 20px auto 0; width: 100%; }
  .cards, .work, .plans { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .plan--featured { transform: none; }
}

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 72px; inset-inline: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .nav__links a.btn { margin-top: 12px; border: 0; padding: 12px; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 620px) {
  .section { padding: 64px 0; }
  .cards, .work, .plans, .why__list, .steps, .form__row { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); padding: 20px; }
  .float { font-size: .8rem; padding: 8px 12px; }
  .float--a { left: 0; } .float--b { right: 0; }
  .form { padding: 22px; }
}

/* Hero quiz preview */
.qprev { display: grid; gap: 10px; }
.qprev b { color: var(--primary); font-size: .95rem; }
.qprev p { font-size: 1.2rem; font-weight: 700; }
.qprev__opt { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }
.qprev__opt.is-right { border-color: #10b981; background: rgba(16,185,129,.12); color: #059669; font-weight: 700; }
.mock__progress { height: 8px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.mock__progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: inherit; transition: width .4s; }
.note { margin-top: 12px; font-size: .95rem !important; }

/* Quiz */
.quiz__tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.quiz__card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: grid; gap: 16px; }
.quiz__head { display: flex; justify-content: space-between; color: var(--muted); font-weight: 500; }
.quiz__passage { background: var(--bg-alt); border-inline-start: 4px solid var(--primary); border-radius: 10px; padding: 14px 18px; line-height: 2; }
.quiz__q { font-size: 1.3rem; }
.quiz__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz__opt {
  font-family: inherit; font-size: 1.05rem; text-align: start; padding: 14px 18px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; transition: .2s;
}
.quiz__opt:hover:not(:disabled) { border-color: var(--primary); }
.quiz__opt:disabled { cursor: default; }
.quiz__opt.is-right { border-color: #10b981; background: rgba(16,185,129,.12); color: #059669; font-weight: 700; }
.quiz__opt.is-wrong { border-color: #ef4444; background: rgba(239,68,68,.1); color: #dc2626; }
.quiz__fb { font-weight: 500; min-height: 1.5em; }
.quiz__fb.ok { color: #059669; }
.quiz__fb.err { color: #dc2626; }
.quiz__card > .btn { justify-self: start; }
.quiz__result { text-align: center; display: grid; gap: 10px; justify-items: center; }
.quiz__score { font-size: 3rem; font-weight: 800; color: var(--primary); }
.quiz__result p { color: var(--muted); }
.quiz__result .hero__cta { justify-content: center; margin: 10px 0 0; }
@media (max-width: 620px) {
  .quiz__opts { grid-template-columns: 1fr; }
  .quiz__card { padding: 20px; }
}

/* Mock test setup & results */
.quiz__title { font-size: 1.25rem; }
.quiz__setup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quiz__field { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.quiz__field select {
  font-family: inherit; font-size: 1rem; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%;
}
.quiz__field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,66,122,.15); }
.quiz__desc { color: var(--muted); font-size: .95rem; }
.quiz__desc:empty { display: none; }
.quiz__info { font-weight: 700; color: var(--primary); }
.quiz__card > .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.quiz__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: rgba(20,66,122,.12); color: var(--primary); }
.chip--soft { background: var(--bg-alt); color: var(--muted); font-weight: 500; }
.quiz__passage b { display: block; margin-bottom: 4px; color: var(--primary); }
.quiz__breakdown { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; }
.quiz__breakdown h4 { font-size: 1.05rem; }
.bd { display: grid; gap: 4px; }
.bd__label { display: flex; justify-content: space-between; gap: 10px; font-size: .95rem; }
.bd__val { color: var(--muted); white-space: nowrap; }
.bd__track { height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.bd__track span { display: block; height: 100%; border-radius: inherit; }
.bd__track .is-high { background: #10b981; }
.bd__track .is-mid { background: #f59e0b; }
.bd__track .is-low { background: #ef4444; }
.quiz__review { border-top: 1px solid var(--border); padding-top: 14px; }
.quiz__review summary { cursor: pointer; font-weight: 700; }
.quiz__review ol { margin-top: 12px; padding-inline-start: 20px; display: grid; gap: 14px; }
.quiz__review .ok { color: #059669; }
.quiz__review .err { color: #dc2626; }
.quiz__review-q { font-weight: 700; }
.quiz__review-e { color: var(--muted); font-size: .92rem; }
.quiz__actions { justify-content: center; margin: 0; }

/* Standards map */
.stdmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.std { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; }
.std__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.std__head h3 { font-size: 1.25rem; }
.std__grades, .std__levels { color: var(--muted); font-size: .92rem; }
.std__list { list-style: none; display: grid; gap: 12px; }
.std__list li { border-inline-start: 3px solid var(--primary); padding-inline-start: 12px; }
.std__list p { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.std__row { display: flex; justify-content: space-between; gap: 10px; }
.std__n { font-weight: 800; color: var(--primary); }

@media (max-width: 960px) { .stdmap { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) {
  .quiz__setup, .stdmap { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ok { color: #059669; } .err { color: #dc2626; } .mid { color: #d97706; }
.quiz__save { font-weight: 500; }
.quiz__save a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.nav__auth { font-weight: 700; }
.join .card { display: flex; flex-direction: column; }
.join .card p { flex: 1; margin-bottom: 18px; }
.join__login { text-align: center; margin-top: 24px; color: var(--muted); }
.join__login a, .auth__alt a { color: var(--primary); font-weight: 700; }

/* Auth pages */
.nav__back { font-weight: 500; color: var(--muted); }
.nav__back:hover { color: var(--primary); }
.auth { min-height: calc(100vh - 73px); display: grid; place-items: center; padding: 40px 16px; background: var(--bg-alt); }
.auth__card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; display: grid; gap: 16px; }
.auth__card--wide { width: min(640px, 100%); }
.auth__card h1 { font-size: 1.7rem; margin: 0; }
.auth__sub, .auth__alt { color: var(--muted); text-align: center; }
.auth__card h1 { text-align: center; }
.form--flat { padding: 0; border: 0; box-shadow: none; background: none; }
.form__group { display: grid; gap: 16px; }
.hint { color: var(--muted); font-size: .88rem; }
.hint:empty { display: none; }
.role-tabs { margin: 0; }
.role-note { background: var(--bg-alt); border-radius: 10px; padding: 10px 14px; font-size: .95rem; color: var(--muted); text-align: center; }
.link-btn { background: none; border: 0; color: var(--primary); font-family: inherit; font-size: .95rem; cursor: pointer; justify-self: center; }
.link-btn:disabled { opacity: .5; cursor: default; }
.notice { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.notice--center { text-align: center; justify-items: center; padding: 40px 24px; margin: 40px auto; max-width: 560px; background: var(--card); color: var(--text); border-color: var(--border); gap: 12px; }
.notice__icon { font-size: 2.6rem; }
.notice--center p { color: var(--muted); }

/* Dashboard */
.page-dash { background: var(--bg-alt); }
.who { display: flex; align-items: center; gap: 12px; }
.who__name { display: grid; line-height: 1.3; font-weight: 700; text-align: end; }
.who__name small { color: var(--muted); font-weight: 500; }
.dash { padding: 32px 0 60px; display: grid; gap: 22px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.dash__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash__head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.dash__tabs { justify-content: flex-start; margin: 0; }
.dash__tabs .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-inline-start: 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .8rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat-card__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--bg-alt); flex-shrink: 0; }
.stat-card strong { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.stat-card span:not(.stat-card__icon) { color: var(--muted); font-size: .9rem; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: grid; gap: 16px; min-width: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel__head h2 { font-size: 1.2rem; margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .mini-select {
  font-family: inherit; font-size: .95rem; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.toolbar input { flex: 1; min-width: 200px; }
.mini-select { padding: 4px 8px; font-size: .9rem; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { background: var(--bg-alt); font-weight: 700; color: var(--muted); font-size: .88rem; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--bg-alt); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.badge--active { background: rgba(16,185,129,.14); color: #059669; }
.badge--pending { background: rgba(245,158,11,.16); color: #b45309; }
.badge--suspended { background: rgba(239,68,68,.12); color: #dc2626; }
.btn--xs { padding: 5px 12px; font-size: .88rem; border-radius: 8px; }
.btn--ok { background: #10b981; color: #fff; }
.btn--ok:hover { background: #059669; }
.btn--danger { background: transparent; color: #dc2626; border-color: rgba(239,68,68,.4); }
.btn--danger:hover { background: rgba(239,68,68,.08); }
.btn:disabled { opacity: .55; cursor: wait; }
.row-actions { display: flex; gap: 6px; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.subj { border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: grid; gap: 10px; align-content: start; }
.subj__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.subj__head h3 { font-size: 1.1rem; margin: 0; }
.quiz__breakdown--flat { border-top: 0; padding-top: 0; }

@media (max-width: 620px) {
  .auth__card { padding: 22px; }
  .who__name { display: none; }
  .panel { padding: 16px; }
  /* Tables become stacked cards on phones */
  .tbl-wrap { border: 0; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; }
  .tbl td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 14px; white-space: normal; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; flex-shrink: 0; }
}

/* ---------- Question figures (SVG) ---------- */
:root {
  --fig-a: #0d9488; --fig-b: #2563eb; --fig-c: #f59e0b; --fig-d: #e11d48;
  --fig-soft: #ccfbf1; --fig-soft2: #e0f2fe; --fig-gray: #94a3b8;
  --fig-leaf: #22a046; --fig-soil: #c9a27a; --fig-water: #60a5fa; --fig-sky: #e0f2fe;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --fig-soft: #134e4a; --fig-soft2: #1e3a5f; --fig-gray: #64748b; --fig-soil: #7c5a3c; --fig-sky: #1e3a5f; }
}
:root[data-theme="dark"] { --fig-soft: #134e4a; --fig-soft2: #1e3a5f; --fig-gray: #64748b; --fig-soil: #7c5a3c; --fig-sky: #1e3a5f; }

.quiz__fig { margin: 0; position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.quiz__fig figcaption { color: var(--primary); font-weight: 700; font-size: .95rem; }
.quiz__zoom { position: absolute; top: 10px; left: 10px; font-family: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.quiz__zoom:hover { border-color: var(--primary); color: var(--primary); }
.fig-svg { width: 100%; height: auto; max-height: 380px; display: block; margin: 0 auto; font-family: "Tajawal", system-ui, sans-serif; }
.quiz__fig.is-zoomed { position: fixed; inset: 0; z-index: 100; border-radius: 0; padding: 56px 16px 16px; align-content: center; background: var(--bg); }
.quiz__fig.is-zoomed .fig-svg { max-height: calc(100vh - 110px); }
.quiz__fig.is-zoomed .quiz__zoom { top: 14px; left: 14px; font-size: 1rem; padding: 8px 16px; }

.fig-svg text { fill: var(--text); }
.fig-svg text.muted { fill: var(--muted); }
.fig-svg text.on-fill { fill: #fff; }
.fig-svg text.txt-d { fill: var(--fig-d); }
.fig-svg .ln, .fig-svg .ln-thick, .fig-svg .ln-dash, .fig-svg .ln-ink { stroke: var(--text); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fig-svg .ln-thick { stroke-width: 3; }
.fig-svg .ln-dash { stroke-dasharray: 6 5; stroke-width: 2; }
.fig-svg .ln-muted { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.fig-svg .grid { stroke: var(--border); stroke-width: 1; }
.fig-svg .ln-a { stroke: var(--fig-a); stroke-width: 3; fill: none; stroke-linecap: round; }
.fig-svg .ln-a-thick { stroke: var(--fig-a); stroke-width: 4; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.fig-svg .ln-d { stroke: var(--fig-d); stroke-width: 3; fill: none; stroke-linecap: round; }
.fig-svg .ln-d-thick { stroke: var(--fig-d); stroke-width: 5; fill: none; }
.fig-svg .ln-b { stroke: var(--fig-b); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.fig-svg .ln-b-thick { stroke: var(--fig-b); stroke-width: 4; fill: none; stroke-linecap: round; }
.fig-svg .ln-b-dash { stroke: var(--fig-b); stroke-width: 3; stroke-dasharray: 3 7; fill: none; stroke-linecap: round; }
.fig-svg .ln-c { stroke: var(--fig-c); stroke-width: 3; stroke-linecap: round; }
.fig-svg .stroke-bg { stroke: var(--card); stroke-width: 2; }
.fig-svg .fill-ink { fill: var(--text); }
.fig-svg .fill-a { fill: var(--fig-a); }
.fig-svg .fill-b { fill: var(--fig-b); }
.fig-svg .fill-c { fill: var(--fig-c); }
.fig-svg .fill-d { fill: var(--fig-d); }
.fig-svg .fill-gray { fill: var(--fig-gray); }
.fig-svg .fill-soft { fill: var(--fig-soft); }
.fig-svg .fill-soft2 { fill: var(--fig-soft2); }
.fig-svg .fill-b-soft { fill: color-mix(in srgb, var(--fig-b) 30%, var(--card)); }
.fig-svg .fill-card { fill: var(--card); }
.fig-svg .fill-bg { fill: var(--card); }
.fig-svg .hand-h { stroke: var(--text); stroke-width: 7; stroke-linecap: round; }
.fig-svg .hand-m { stroke: var(--fig-d); stroke-width: 4; stroke-linecap: round; }
.fig-svg .stick { stroke: #c08a4a; stroke-width: 6; stroke-linecap: round; }
.fig-svg .wire { stroke: var(--text); stroke-width: 3; fill: none; stroke-linejoin: round; }
.fig-svg .plate { stroke: var(--text); stroke-width: 6; }
.fig-svg .fill-bulb { fill: #fde68a; }
.fig-svg .node-a { fill: color-mix(in srgb, var(--fig-leaf) 30%, var(--card)); stroke: var(--fig-leaf); stroke-width: 2; }
.fig-svg .node-b { fill: color-mix(in srgb, var(--fig-c) 30%, var(--card)); stroke: var(--fig-c); stroke-width: 2; }
.fig-svg .node-c { fill: color-mix(in srgb, var(--fig-d) 22%, var(--card)); stroke: var(--fig-d); stroke-width: 2; }
.fig-svg .fill-soil { fill: var(--fig-soil); }
.fig-svg .root { stroke: #8b5e34; stroke-width: 3; fill: none; stroke-linecap: round; }
.fig-svg .stem { stroke: #15803d; stroke-width: 7; stroke-linecap: round; }
.fig-svg .fill-leaf { fill: var(--fig-leaf); }
.fig-svg .vein { stroke: #166534; stroke-width: 1.5; }
.fig-svg .fill-petal { fill: #f472b6; }
.fig-svg .fill-water { fill: var(--fig-water); }
.fig-svg .fill-water-soft { fill: color-mix(in srgb, var(--fig-water) 45%, var(--card)); }
.fig-svg .fill-mountain { fill: #a3a37a; }
.fig-svg .fill-cloud { fill: #cbd5e1; stroke: #94a3b8; stroke-width: 1.5; }
.fig-svg .fill-stone { fill: #78716c; }
.fig-svg .fill-shadow { fill: rgba(30, 41, 59, .75); }
.fig-svg .fill-shadow-soft { fill: rgba(100, 116, 139, .28); }
.fig-svg .fill-earth { fill: #2563eb; stroke: #16a34a; stroke-width: 6; }
.fig-svg .fill-crust { fill: #78716c; }
.fig-svg .fill-mantle { fill: #f97316; }
.fig-svg .fill-outer { fill: #facc15; }
.fig-svg .fill-inner { fill: #fef3c7; stroke: #f59e0b; stroke-width: 2; }
.fig-svg .fill-box { fill: #d6b98c; }
.fig-svg .fill-north { fill: #dc2626; }
.fig-svg .fill-south { fill: #2563eb; }
.fig-svg .fill-wall { fill: #15803d; }
.fig-svg .fill-cyto { fill: #dcfce7; }
.fig-svg .fill-vac { fill: #bfdbfe; stroke: #60a5fa; stroke-width: 1.5; }
.fig-svg .fill-nucleus { fill: #c4b5fd; stroke: #7c3aed; stroke-width: 1.5; }
.fig-svg .ph0 { fill: #b91c1c; } .fig-svg .ph1 { fill: #dc2626; } .fig-svg .ph2 { fill: #ea580c; } .fig-svg .ph3 { fill: #f97316; }
.fig-svg .ph4 { fill: #f59e0b; } .fig-svg .ph5 { fill: #eab308; } .fig-svg .ph6 { fill: #a3e635; } .fig-svg .ph7 { fill: #22c55e; }
.fig-svg .ph8 { fill: #14b8a6; } .fig-svg .ph9 { fill: #06b6d4; } .fig-svg .ph10 { fill: #3b82f6; } .fig-svg .ph11 { fill: #4f46e5; }
.fig-svg .ph12 { fill: #7c3aed; } .fig-svg .ph13 { fill: #6d28d9; } .fig-svg .ph14 { fill: #581c87; }
@media (max-width: 620px) { .quiz__fig { padding: 10px; } }

/* School: add accounts, credentials, print cards, password dialog */
.add-form { display: grid; gap: 14px; }
.add-form__row { display: flex; gap: 14px; flex-wrap: wrap; }
.add-form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; min-width: 180px; }
.add-form select, .add-form textarea, .dlg input {
  font-family: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%;
}
.add-form textarea { resize: vertical; line-height: 1.8; }
.add-form select:focus, .add-form textarea:focus, .dlg input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,66,122,.15); }
.add-form__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.add-form__actions .form__msg { text-align: start; margin: 0; }
.panel .hint { margin: 0; }
.tbl code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; background: var(--bg-alt); padding: 2px 8px; border-radius: 6px; letter-spacing: .03em; }
.new-tag { margin-inline-start: 8px; font-size: .72rem; }
.dlg { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: min(420px, calc(100% - 32px)); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(15, 23, 42, .45); }
.dlg h2 { font-size: 1.2rem; margin: 0; }
.dlg .form { gap: 14px; }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing { background: #fff; }
  body.printing #printArea { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; padding: 12mm; }
  .pcard { border: 1.5px dashed #64748b; border-radius: 10px; padding: 6mm; break-inside: avoid; color: #0f172a; display: grid; gap: 2mm; font-size: 11pt; }
  .pcard__brand { color: #14427a; font-weight: 800; font-size: 10pt; }
  .pcard__name { font-size: 14pt; }
  .pcard__meta { color: #475569; font-size: 9.5pt; }
  .pcard dl { display: grid; grid-template-columns: auto 1fr; gap: 1mm 4mm; margin: 2mm 0 0; }
  .pcard dt { color: #475569; }
  .pcard dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13pt; font-weight: 700; text-align: left; }
  .pcard small { color: #64748b; font-size: 8pt; word-break: break-all; }
}

/* ---------- Exams: questions, answer sheet (OMR), print ---------- */
.xq { break-inside: avoid; display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.xq__q { display: flex; gap: 10px; font-weight: 700; font-size: 1.08rem; line-height: 1.8; }
.xq__num { flex: none; min-width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .95rem; }
.xq__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-inline-start: 42px; }
.xq__opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--card); }
label.xq__opt { cursor: pointer; }
label.xq__opt:hover { border-color: var(--primary); }
.xq__opt input { position: absolute; opacity: 0; pointer-events: none; }
.xq__letter { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.xq__opt:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); }
.xq__opt:has(input:checked) .xq__letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.xq__opt:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.xq__opt.is-right { border-color: #10b981; background: rgba(16,185,129,.1); }
.xq__opt.is-right .xq__letter { background: #10b981; border-color: #10b981; color: #fff; }
.xq__opt.is-wrong { border-color: #ef4444; background: rgba(239,68,68,.08); }
.xq__opt.is-wrong .xq__letter { background: #ef4444; border-color: #ef4444; color: #fff; }
.xq__exp { color: var(--muted); font-size: .95rem; padding-inline-start: 42px; margin: 0; }
.xq__passage, .xq__figwrap { break-inside: avoid; margin-top: 12px; }
.xq__figwrap { display: grid; gap: 6px; }
.xq__figcap { color: var(--primary); }
.xq__fig { padding: 10px; }
.xq.is-missing .xq__num { background: #f59e0b; }
.key-tbl td.key-letter { font-weight: 800; font-size: 1.1rem; color: var(--primary); }
@media (max-width: 620px) { .xq__opts { grid-template-columns: 1fr; padding-inline-start: 0; } }

.omr-sheet { position: relative; width: 210mm; height: 297mm; background: #fff; color: #111; font-family: "Tajawal", system-ui, sans-serif; overflow: hidden; }
.omr-sheet > div { position: absolute; }
.omr-sheet, .omr-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* الحدود تُطبع دائماً حتى لو أُلغيت طباعة الخلفيات، فالمربع الأسود مرسوم بحدود سميكة */
.omr-marker { box-sizing: border-box; border: 5mm solid #000; background: #000; }
.omr-head { display: grid; gap: 1.6mm; align-content: start; text-align: center; }
.omr-brand { font-size: 9pt; color: #14427a; font-weight: 800; }
.omr-title { font-size: 15pt; font-weight: 800; }
.omr-meta { font-size: 10pt; color: #333; }
.omr-name { font-size: 12pt; border-bottom: .3mm solid #333; padding-bottom: 1.5mm; margin-top: 2mm; text-align: start; display: flex; gap: 2mm; align-items: baseline; }
.omr-name b { flex: 1; }
.omr-idx { font-size: 9pt; color: #555; }
.omr-help { font-size: 9pt; color: #333; display: grid; gap: 1mm; }
.omr-eg { display: inline-flex; gap: 1.5mm; align-items: center; justify-content: center; }
.omr-eg-on { display: inline-block; box-sizing: border-box; width: 4mm; height: 4mm; border-radius: 50%; border: 2mm solid #111; background: #111; }
.omr-eg-x { display: inline-grid; place-items: center; width: 4mm; height: 4mm; border-radius: 50%; border: .3mm solid #555; font-style: normal; font-size: 7pt; }
.omr-colhead { text-align: center; font-weight: 800; font-size: 11pt; }
.omr-num { text-align: center; font-weight: 700; font-size: 11pt; line-height: 5.2mm; }
.omr-bubble { border: .35mm solid #444; border-radius: 50%; box-sizing: border-box; }
.omr-foot { text-align: center; font-size: 8pt; color: #666; }

/* Exam pages */
.exam { padding: 28px 0 60px; display: grid; gap: 18px; }
.exam__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.exam__head h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; }
.exam__bar { position: sticky; top: 72px; z-index: 5; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow); }
.exam__paper { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 22px 22px; }
.print-opts { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.print-opts label { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.sheet-scroll { overflow-x: auto; }
.sheet-preview { display: grid; gap: 16px; justify-items: center; }
.sheet-preview .omr-sheet { box-shadow: var(--shadow); border: 1px solid var(--border); }
.booklet-head { display: grid; gap: 6px; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 4px; }
.booklet-head h2 { margin: 0; }
.booklet-head .name-line { display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.scan-row { display: flex; align-items: center; gap: 6px; }
.scan-row b { min-width: 28px; text-align: center; }
.scan-row button { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; font-weight: 700; cursor: pointer; }
.scan-row button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.scan-row button.key { box-shadow: 0 0 0 2px #10b981; }
.scan-row.flag b { color: #d97706; }
.scan-canvas { max-width: 100%; max-height: 70vh; border-radius: 10px; border: 1px solid var(--border); display: block; margin: 0 auto; }
.scan-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.report-bars { display: grid; gap: 14px; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  .no-print, .nav, .fab { display: none !important; }
  body.exam-print { background: #fff; }
  body.exam-print main { padding: 0 !important; width: auto !important; }
  .print-section[hidden] { display: none !important; }
  .print-section { break-after: page; }
  .booklet { padding: 14mm 16mm; color: #111; }
  .booklet .xq { border-bottom: .2mm dashed #999; }
  .booklet .xq__num { background: none; color: #000; border: .45mm solid #000; }
  .booklet .xq__opt { border-color: #999; background: #fff; padding: 2mm 3mm; }
  .booklet .fig-svg { max-height: 80mm; }
  .sheet-preview { display: block; }
  .sheet-preview .omr-sheet { box-shadow: none; border: 0; break-after: page; }
  .sheet-scroll { overflow: visible; }
  .key-page { padding: 16mm; }
  body.printing #printArea.report { display: block; padding: 12mm; color: #111; }
}

.dlg--wide { width: min(920px, calc(100% - 24px)); max-height: 90vh; overflow: auto; display: grid; gap: 14px; }
.dlg--wide[open] { display: grid; }
.report { display: grid; gap: 14px; }
.report h2 { font-size: 1.35rem; margin: 0; }
.report h3 { font-size: 1.05rem; margin: 6px 0 0; }
.test-new { border: 1px dashed var(--border); border-radius: 12px; padding: 12px 16px; }
.test-new summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.test-new[open] summary { margin-bottom: 12px; }
.add-form input[type=text] { font-family: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; }
.stu-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin-top: 8px; max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stu-pick label { display: flex; gap: 8px; align-items: center; font-weight: 400; min-width: 0; }
.stu-pick .stu-all { grid-column: 1 / -1; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
@media print { body.printing #printArea.report .stat-cards { grid-template-columns: repeat(3, 1fr); } }

/* ---------- تحليل المهارات والمتابعة ---------- */
.badge--mid { background: rgba(245,158,11,.16); color: #b45309; }
.notice--warn { background: rgba(239,68,68,.07); color: inherit; border-color: rgba(239,68,68,.3); }
.notice--warn b { color: #dc2626; }
.notice--warn ol { margin: 4px 0 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.notice--ok { background: rgba(16,185,129,.08); color: inherit; border-color: rgba(16,185,129,.3); }
.panel .notice { margin-bottom: 14px; }
.weak-list { margin: 8px 0 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.stu-filter { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 600; }
.panel__actions select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; }
.item-dist { display: flex; gap: 4px; flex-wrap: wrap; }
.item-dist span { padding: 1px 7px; border-radius: 6px; background: var(--bg-alt); font-size: .82rem; white-space: nowrap; }
.item-dist span.is-key { background: rgba(16,185,129,.16); color: #059669; font-weight: 700; }
.item-dist span.is-trap { background: rgba(239,68,68,.12); color: #dc2626; font-weight: 700; }
.item-q { max-width: 420px; }
.tbl td.item-q { white-space: normal; min-width: 240px; }

/* ---------- الهوية: معيار التفوق ---------- */
h1, h2, .section__head h2 { font-family: "El Messiri", "Tajawal", sans-serif; }
.eyebrow { color: var(--gold) !important; }
.hero::after { content: ""; position: absolute; inset: auto auto -20% -10%; width: 520px; height: 520px; background: radial-gradient(circle, rgba(201,162,74,.16), transparent 60%); z-index: -1; }
.badge--brand { background: linear-gradient(135deg, rgba(201,162,74,.16), rgba(20,66,122,.10)); border-color: rgba(201,162,74,.45); color: var(--text); font-weight: 700; }
.vision { padding: 0 0 30px; }
.vision__box { display: grid; grid-template-columns: 1.1fr 2fr; gap: 28px; align-items: center; padding: 30px; border-radius: var(--radius);
  background: linear-gradient(225deg, #0a2142, #123a6b 55%, #1b5290); color: #fff; box-shadow: 0 20px 40px rgba(10,33,66,.25); position: relative; overflow: hidden; border: 1px solid rgba(201,162,74,.5); }
.vision__box::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 92% 0%, rgba(233,207,134,.22), transparent 40%); pointer-events: none; }
.vision__head { display: flex; gap: 16px; align-items: center; position: relative; }
.vision__head img { width: 72px; height: 72px; flex: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,.35)); }
.vision__head span { display: block; color: var(--gold-2); font-weight: 700; font-size: .9rem; }
.vision__head h2 { font-size: 1.5rem; line-height: 1.4; color: #fff; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; position: relative; }
.pillar { background: rgba(255,255,255,.07); border: 1px solid rgba(233,207,134,.35); border-radius: 14px; padding: 16px; }
.pillar b { display: block; font-family: "El Messiri", "Tajawal", sans-serif; font-size: 1.3rem; color: var(--gold-2); }
.pillar p { font-size: .92rem; color: rgba(255,255,255,.85); line-height: 1.6; }
@media (max-width: 860px) {
  .vision__box { grid-template-columns: 1fr; padding: 22px; }
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .logo__text small { display: none; } .logo__text b { font-size: 1.25rem; } }
@media (prefers-color-scheme: dark) { .grad { background: linear-gradient(135deg, #e9cf86, #d9b65f 50%, #c9a24a); -webkit-background-clip: text; background-clip: text; } }

/* ---------- الباقات ---------- */
.plans--5 { grid-template-columns: repeat(5, 1fr); gap: 16px; }
.plans--5 .plan { padding: 24px 18px; }
.plans--5 .plan--featured { transform: none; }
.plans--5 .plan__price b { font-size: 1.9rem; }
.plan__price small { display: block; font-size: .8rem; }
.plans--5 .plan li { font-size: .93rem; }
.offers { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.offers span { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(201,162,74,.45); background: rgba(201,162,74,.08); font-weight: 600; font-size: .92rem; }
@media (max-width: 1100px) { .plans--5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .plans--5 { grid-template-columns: 1fr; } }
.sub-panel { border-color: rgba(201,162,74,.5); }
.sub-panel--expired { border-color: rgba(239,68,68,.5); }
.sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 12px; }
.sub-grid > div { background: var(--bg-alt); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.sub-grid b { font-size: 1.1rem; }
@media (max-width: 640px) { .sub-grid { grid-template-columns: 1fr; } }
.plan-pick { display: grid; gap: 6px; }
.sub-panel select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; max-width: 100%; }

/* ---------- ولي الأمر ---------- */
.link-code { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.link-code code { font-size: 1.7rem; font-weight: 800; letter-spacing: .18em; padding: 8px 18px; border-radius: 12px; border: 2px dashed var(--gold); background: rgba(201,162,74,.08); color: var(--text); }
.child .panel__head { align-items: flex-start; }
.child .panel__head p { margin: 0; }
.parent-tips { display: grid; gap: 12px; margin-top: 14px; }
.child__more { margin-top: 14px; }
.child__more summary { cursor: pointer; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.cards.join { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.noor { margin-top: 18px; }
.noor input[type=file] { padding: 8px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg-alt); width: 100%; }
.add-form label.check-line { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.add-form label.check-line input { width: auto; margin: 0; }

/* ---------- ترويسة الاختبار الرسمية ---------- */
.moe-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 6px 0 10px; border-bottom: 2px solid currentColor; }
.moe-head__side { display: grid; gap: 2px; font-size: .95rem; line-height: 1.6; text-align: center; justify-self: start; }
.moe-head__side--left { justify-self: end; text-align: start; }
.moe-head__logo { display: grid; place-items: center; min-width: 120px; }
.moe-head__logo img { width: 130px; height: auto; }
.moe-title { text-align: center; padding: 8px 0 4px; }
.moe-title h2 { margin: 0; font-size: 1.35rem; }
.moe-title p { margin: 2px 0 0; font-weight: 600; }
.moe-student { width: 100%; border-collapse: collapse; margin: 8px 0 6px; font-weight: 600; }
.moe-student td { border: 1.5px solid currentColor; padding: 8px 10px; vertical-align: middle; white-space: nowrap; }
.moe-student__name { width: 48%; }
.moe-student .dots { display: inline-block; min-width: 60%; border-bottom: 1.5px dotted currentColor; height: 1em; vertical-align: bottom; }
.moe-student .dots--s { min-width: 50px; }
.moe-student__score { text-align: center; width: 1%; }
.moe-student__score div { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 2px; }
.moe-student .box { display: inline-block; width: 38px; height: 26px; border: 1.5px solid currentColor; border-radius: 4px; }
.moe-note { font-size: .9rem; margin: 2px 0 6px; }
.print-opts--head { margin: 8px 0 4px; }
.print-opts--head input[type=text] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; width: 150px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
@media (max-width: 640px) {
  .moe-head { grid-template-columns: 1fr 1fr; }
  .moe-head__logo { grid-column: 1 / -1; order: -1; }
  .moe-head__logo img { width: 100px; }
  .moe-student td { white-space: normal; }
}
@media print {
  .booklet { padding-top: 10mm; }
  .moe-head, .moe-student td, .moe-title, .moe-note { color: #000; }
  .moe-head__side { font-size: 10.5pt; }
  .moe-head__logo img { width: 34mm; }
  .moe-title h2 { font-size: 15pt; }
}

/* ---------- كراسة الأسئلة المضغوطة: عمودان، وعشرة أسئلة فأكثر في الورقة ---------- */
.booklet--compact { font-size: 10.5pt; line-height: 1.55; }
.booklet--compact .bk-body { column-count: 2; column-gap: 7mm; column-rule: .3mm solid #c9ced8; margin-top: 3mm; }
.booklet--compact .xq, .booklet--compact .xq-group { break-inside: avoid; }
.booklet--compact .xq-group { margin: 0 0 2.5mm; padding: 2mm 2.5mm; border: .3mm solid #c9ced8; border-radius: 2.5mm; }
.booklet--compact .xq-group--passage { break-inside: auto; }
.booklet--compact .xq { display: block; padding: 1.6mm 0 2mm; border-bottom: .25mm dotted #b8bec9; }
.booklet--compact .xq-group .xq:last-child { border-bottom: 0; }
.booklet--compact .xq__q { gap: 2mm; font-size: 10.5pt; line-height: 1.6; margin-bottom: 1.2mm; }
.booklet--compact .xq__num { min-width: 0; width: 5.6mm; height: 5.6mm; font-size: 8.5pt; background: none; color: inherit; border: .45mm solid currentColor; margin-top: .4mm; }
.booklet--compact .xq__opts { display: flex; flex-wrap: wrap; gap: .8mm 4mm; padding-inline-start: 7.6mm; }
.booklet--compact .xq__opt { border: 0; padding: 0; gap: 1.4mm; background: none; font-size: 10pt; flex: 0 1 auto; min-width: 18%; }
.booklet--compact .xq__letter { width: 4.6mm; height: 4.6mm; border-width: .3mm; font-size: 7.5pt; border-color: currentColor; }
.booklet--compact .xq__passage { margin: 0 0 1.5mm; padding: 1.5mm 2.5mm; font-size: 9.8pt; line-height: 1.75; border-inline-start-width: .8mm; border-radius: 1.5mm; }
.booklet--compact .xq__passage b { font-size: 9.5pt; margin-bottom: .5mm; }
.booklet--compact .xq__figwrap { margin: 0 0 1mm; gap: 1mm; }
.booklet--compact .xq__figcap { font-size: 9pt; }
.booklet--compact .xq__fig { padding: 1mm; border: 0; background: none; }
.booklet--compact .fig-svg { max-height: 36mm; width: 100%; }
.booklet--compact .quiz__zoom { display: none; }
.booklet--compact .moe-head { padding: 0 0 2mm; }
.booklet--compact .moe-head__side { font-size: 9.5pt; line-height: 1.5; gap: 0; }
.booklet--compact .moe-head__logo img { width: 27mm; }
.booklet--compact .moe-title { padding: 1.5mm 0 0; }
.booklet--compact .moe-title h2 { font-size: 13pt; }
.booklet--compact .moe-title p { font-size: 9.5pt; }
.booklet--compact .moe-student { margin: 2mm 0 1.5mm; font-size: 9.5pt; }
.booklet--compact .moe-student td { padding: 1.6mm 2.5mm; }
.booklet--compact .moe-student .box { width: 9mm; height: 6mm; }
.booklet--compact .moe-note { font-size: 8.8pt; margin: 0; }
.bk-end { text-align: center; font-weight: 700; font-size: 9.5pt; margin-top: 3mm; column-span: all; }
@media (max-width: 760px) { .booklet--compact .bk-body { column-count: 1; } }
@media print {
  .booklet--compact { padding: 8mm 10mm 8mm; }
  .booklet.exam__paper { border: 0; border-radius: 0; box-shadow: none; background: #fff; }
  .booklet--compact .xq__q, .booklet--compact .xq__opt { color: #000; }
  .booklet--compact .xq__passage { background: none; border: .3mm solid #999; border-inline-start: .8mm solid #333; }
  .booklet--compact .xq__passage b, .booklet--compact .xq__figcap { color: #000; }
  .booklet--compact .bk-body { column-rule-color: #999; }
}

/* ---------- ربط المعلم بطلابه ---------- */
.link-grade { border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px 12px; margin: 0; }
.link-grade legend { padding: 0 6px; font-weight: 700; }
.link-grade legend label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.dlg input[type=search] { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; width: 100%; }
.dlg .stu-pick label, .dlg .link-grade legend label { display: flex; flex-direction: row; align-items: center; gap: 8px; width: auto; font-weight: 500; white-space: nowrap; }
.dlg .stu-pick input[type=checkbox], .dlg .link-grade input[type=checkbox] { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; }
.dlg .link-grade legend { white-space: nowrap; }
.dlg .link-grade .stu-pick { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-height: 320px; }

/* ---------- واتساب ---------- */
.btn--wa { background: #25d366; color: #fff; border-color: #25d366; gap: 8px; box-shadow: 0 8px 18px rgba(37,211,102,.25); }
.btn--wa:hover { background: #1ebe5b; color: #fff; transform: translateY(-2px); }
.wa-ico { width: 1.25em; height: 1.25em; flex: none; }
.wa-box { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 26px; padding: 18px 22px; border-radius: var(--radius); border: 1px solid rgba(37,211,102,.4); background: rgba(37,211,102,.07); }
.wa-box p { margin: 2px 0 0; color: var(--muted); }
.wa-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.footer__inner .btn--wa { margin-inline-start: auto; }
