/* ===== إنماء — نظام التصميم ===== */
:root {
  --leaf: #7AC143;
  --leaf-2: #3FA535;
  --green: #1F7A3A;
  --green-deep: #0F4D2A;
  --gold: #D9A521;
  --red: #D7262B;
  --ink: #17231B;
  --ink-2: #4A5A50;
  --muted: #6E7D73;
  --line: #E3EAE3;
  --bg: #F5F8F3;
  --card: #FFFFFF;
  --soft: #EEF6E8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 77, 42, .06), 0 8px 24px -12px rgba(15, 77, 42, .18);
  --shadow-lg: 0 20px 50px -20px rgba(15, 77, 42, .35);
  --c-tarbawi: #2E8B57;
  --c-takhassusi: #2F6FB3;
  --c-idari: #B07A12;
  --c-shakhsi: #B5456B;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --display: 'Reem Kufi', 'IBM Plex Sans Arabic', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.7; font-size: 16px;
}
img { max-width: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.block { padding-top: 28px; padding-bottom: 28px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .88rem; margin-top: .6em; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.inline { display: inline; }

/* ---------- الترويسة ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.brand-school { height: 52px; width: auto; }
.brand-inmaa { height: 40px; width: auto; }
.brand-sep { width: 1px; height: 36px; background: var(--line); }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text b { font-size: .95rem; }
.brand-text small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { margin-inline-start: auto; display: flex; gap: 4px; align-items: center; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: .95rem;
  text-decoration: none; white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--soft); color: var(--green); }
.nav a.on { background: var(--soft); color: var(--green); font-weight: 600; }
.nav a.nav-cta { background: var(--green); color: #fff; }
.nav a.nav-cta:hover, .nav a.nav-cta.on { background: var(--green-deep); color: #fff; }
.nav a.nav-admin { border: 1px solid var(--line); }
.dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-style: normal; font-size: .72rem; font-weight: 700; margin-inline-start: 4px; }

/* ---------- الأزرار والشارات ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; border: 1px solid transparent; border-radius: 12px;
  padding: 10px 18px; font: 600 .95rem var(--font); cursor: pointer; text-decoration: none !important;
  transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--green-deep); box-shadow: 0 6px 16px -8px rgba(15, 77, 42, .6); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--green); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--leaf); background: var(--soft); box-shadow: none; }
.btn.danger { background: #fff; color: var(--red); border-color: #F2C9CA; }
.btn.danger:hover { background: #FDF1F1; box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn.full { width: 100%; }
.btn.icon { width: 40px; height: 40px; padding: 0; font-size: 1.1rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--green); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger-txt { color: var(--red); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--soft); color: var(--green); }
.cat-tarbawi.badge { background: #E5F4EA; color: var(--c-tarbawi); }
.cat-takhassusi.badge { background: #E6F0FA; color: var(--c-takhassusi); }
.cat-idari.badge { background: #FBF1DC; color: var(--c-idari); }
.cat-shakhsi.badge { background: #FBE8EF; color: var(--c-shakhsi); }
.st-pending { background: #FFF4D6; color: #8A6200; }
.st-approved { background: #E3F5E4; color: var(--green); }
.st-rejected, .st-cancelled { background: #F4E7E7; color: #9A2B2B; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: #F1F4F1; color: var(--ink-2); }
.chip.soon { background: #FFF1CC; color: #7A5600; font-weight: 600; }
.chip.full { background: #FBE3E3; color: #9A2B2B; }

/* ---------- الرسائل ---------- */
.flash {
  margin-top: 16px; padding: 12px 16px; border-radius: 14px; display: flex; gap: 12px; align-items: flex-start;
  background: #E7F6E8; color: var(--green-deep); border: 1px solid #C6E8C9; font-weight: 500; transition: opacity .4s;
}
.flash-err { background: #FDEEEE; color: #8F1F1F; border-color: #F4CACA; }
.flash.fade { opacity: 0; pointer-events: none; }
.flash-x { margin-inline-start: auto; background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- البطل ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(122, 193, 67, .28), transparent 60%),
    radial-gradient(700px 360px at 0% 110%, rgba(217, 165, 33, .14), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 28px;
}
.hero::after {
  content: ""; position: absolute; inset-inline-end: -60px; top: 40px; width: 280px; height: 280px;
  background: url(leaf.svg) no-repeat center / contain; opacity: .07; transform: rotate(-20deg); pointer-events: none;
}
.hero-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; position: relative; z-index: 1; }
.hero-logos { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.hero-logos img:first-child { height: 92px; filter: drop-shadow(0 6px 12px rgba(15, 77, 42, .15)); }
.hero-logos img:last-child { height: 74px; padding-inline-start: 18px; border-inline-start: 1px solid var(--line); }
.eyebrow { display: inline-block; color: var(--green); background: var(--soft); border-radius: 999px; padding: 3px 14px; font-weight: 600; font-size: .85rem; margin-bottom: 14px; }
.hero h1 { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 700; letter-spacing: 0; margin-bottom: 14px; }
.grad { background: linear-gradient(90deg, var(--leaf-2), var(--leaf)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 36em; }
.paths { display: grid; gap: 14px; }
.path {
  display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 20px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  text-decoration: none !important; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.path:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--leaf); }
.path-ico { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; }
.path-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.path-attend .path-ico { background: #E6F4E0; color: var(--green); }
.path-present .path-ico { background: #FBF1DA; color: #A9760A; }
.path-txt { display: flex; flex-direction: column; flex: 1; }
.path-txt b { font-size: 1.15rem; }
.path-txt small { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.path-go { font-size: 1.4rem; color: var(--leaf-2); transition: transform .18s; }
.path:hover .path-go { transform: translateX(-4px); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 32px; position: relative; z-index: 1; }
.stat { background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: flex; align-items: baseline; gap: 10px; }
.stat b { font-size: 1.8rem; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .9rem; }

/* ---------- البطاقات ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.page-title { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.page-intro { margin-bottom: 20px; max-width: 760px; }
.sub { margin-top: 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.wcard {
  display: flex; gap: 16px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.wcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #CFE6C2; }
.wbody { min-width: 0; flex: 1; }
.wbody h3 { margin: 6px 0 10px; font-size: 1.08rem; }
.wtags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dateblock {
  flex: none; width: 70px; border-radius: 14px; text-align: center; padding: 8px 4px;
  background: linear-gradient(160deg, var(--leaf) 0%, var(--leaf-2) 55%, var(--green) 100%); color: #fff;
  display: flex; flex-direction: column; justify-content: center; align-self: flex-start;
}
.dateblock b { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dateblock span { font-size: .8rem; font-weight: 600; }
.dateblock small { font-size: .7rem; opacity: .9; }
.presenter { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.presenter > span:last-child { display: flex; flex-direction: column; line-height: 1.4; }
.presenter small { color: var(--muted); font-size: .8rem; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: #FBF1DA; color: #8A5E00; font-weight: 700; border: 2px solid #fff; box-shadow: 0 0 0 1px #F0DFB5;
}
.avatar.xl { width: 64px; height: 64px; font-size: 1.6rem; }
.presenter.big { padding: 14px; background: var(--soft); border-radius: 14px; margin: 16px 0; }
.presenter.big .avatar { width: 48px; height: 48px; font-size: 1.2rem; }
.presenter.big b { font-size: 1.1rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: .85rem; margin: 0; align-items: center; }

.empty { text-align: center; padding: 40px 20px; background: #fff; border: 1px dashed #CFDCCD; border-radius: var(--radius); }
.empty h3, .empty h2 { margin-top: 10px; }
.empty p { color: var(--muted); }

.today { background: linear-gradient(135deg, #0F4D2A, #1F7A3A); color: #fff; border-radius: 24px; padding: 22px; box-shadow: var(--shadow-lg); }
.today-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.today-head h2 { margin: 0; }
.today-head p { margin: 0; opacity: .85; font-size: .92rem; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: #9BE15D; box-shadow: 0 0 0 0 rgba(155, 225, 93, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(155, 225, 93, 0); } 100% { box-shadow: 0 0 0 0 rgba(155, 225, 93, 0); } }

.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: s; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; position: relative; counter-increment: s; display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--green); font-weight: 700; }
.steps span { color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* ---------- التقويم ---------- */
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { font-family: var(--display); font-size: 1.35rem; min-width: 150px; text-align: center; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.legend a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; text-decoration: none; }
.legend a.on { border-color: var(--green); color: var(--green); font-weight: 600; background: var(--soft); }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.lg-tarbawi i { background: var(--c-tarbawi); } .lg-takhassusi i { background: var(--c-takhassusi); }
.lg-idari i { background: var(--c-idari); } .lg-shakhsi i { background: var(--c-shakhsi); }
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.cal-dow { padding: 10px 6px; text-align: center; font-weight: 600; font-size: .85rem; background: #F7FAF5; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.cal-dow.we { color: #A3ACA5; }
.cal-cell { min-height: 118px; border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-cell:nth-child(7n + 1) { border-inline-start: 0; }
.cal-cell.out { background: #FAFBF9; }
.cal-cell.we { background: repeating-linear-gradient(135deg, #FBFCFA 0 8px, #F5F7F3 8px 16px); }
.cal-cell.past .cal-d { color: #A3ACA5; }
.cal-d { font-size: .85rem; font-weight: 600; color: var(--ink-2); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-d { background: var(--green); color: #fff; }
.ev {
  display: block; border-radius: 8px; padding: 4px 8px; font-size: .78rem; line-height: 1.4; text-decoration: none !important;
  border-inline-start: 3px solid; background: #F2F8EE; color: var(--ink); overflow: hidden; transition: filter .15s;
}
.ev:hover { filter: brightness(.96); }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ev small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.cat-tarbawi { border-color: var(--c-tarbawi); background: #EAF6EE; }
.ev.cat-takhassusi { border-color: var(--c-takhassusi); background: #EAF2FB; }
.ev.cat-idari { border-color: var(--c-idari); background: #FCF4E2; }
.ev.cat-shakhsi { border-color: var(--c-shakhsi); background: #FCEDF3; }
.ev.ev-pending { background: #fff; border: 1px dashed #C9B26A; border-inline-start-width: 3px; opacity: .85; }

/* ---------- صفحة الورشة ---------- */
.back { display: inline-block; margin-bottom: 14px; color: var(--ink-2); font-size: .92rem; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.detail-side { position: sticky; top: 92px; }
.detail-title { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 10px 0 0; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 18px; }
.facts div { background: #F8FAF7; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; font-weight: 600; }
.prose { color: var(--ink-2); }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.seats-row { display: flex; align-items: baseline; gap: 8px; }
.seats-row b { font-size: 2rem; color: var(--green); }
.bar { height: 8px; background: #EDF2EC; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--leaf-2)); border-radius: 99px; }
.bar.thin { height: 6px; margin: 0; min-width: 80px; }
.attend-card { border: 2px solid var(--leaf); }
.code-input { font-size: 1.8rem !important; letter-spacing: .5em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.code-card { text-align: center; }
.code-big { font-size: 3rem; font-weight: 700; letter-spacing: .25em; color: var(--green); font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.small-card summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.small-card[open] summary { margin-bottom: 12px; }

/* ---------- النماذج ---------- */
.form h2 { display: flex; align-items: center; gap: 10px; }
.num { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--green); display: grid; place-items: center; font-size: .95rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: .9rem; color: var(--ink-2); padding: 0; }
.field small { font-weight: 400; color: var(--muted); }
.req { color: var(--red); font-weight: 700; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #D5DED4; border-radius: 12px;
  padding: 10px 14px; transition: border-color .15s, box-shadow .15s; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf-2); box-shadow: 0 0 0 4px rgba(122, 193, 67, .2); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 1.2fr 1.4fr .8fr; gap: 0 14px; }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: all .15s; }
.choice b { font-size: 1rem; }
.choice small { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.choice:hover > span { border-color: #BFD9B0; }
.choice input:checked + span { border-color: var(--green); background: var(--soft); box-shadow: 0 0 0 3px rgba(122, 193, 67, .2); }
.choice input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.choice.cat-tarbawi b { color: var(--c-tarbawi); } .choice.cat-takhassusi b { color: var(--c-takhassusi); }
.choice.cat-idari b { color: var(--c-idari); } .choice.cat-shakhsi b { color: var(--c-shakhsi); }
.note { background: #F6FAF1; border: 1px solid #DDEBD1; border-radius: 12px; padding: 10px 14px; font-size: .92rem; color: var(--ink-2); margin-bottom: 14px; }
.slot:empty { display: none; }
.slot { margin: -4px 0 14px; }
.slot-ok, .slot-bad { padding: 8px 12px; border-radius: 10px; font-size: .9rem; }
.slot-ok { background: #E7F6E8; color: var(--green-deep); }
.slot-bad { background: #FFF3DC; color: #7A4F00; }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.submit-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 0 24px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.auth { text-align: center; }
.auth .field { text-align: start; }
.auth-logo { height: 70px; margin: 0 auto 10px; display: block; }

.success { text-align: center; padding: 34px 24px; }
.success h1 { font-family: var(--display); }
.linkbox { text-align: start; background: #F8FAF7; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 20px 0; }
.linkbox label { display: block; font-size: .9rem; color: var(--ink-2); margin-bottom: 8px; }
.qr-card {
  max-width: 360px; margin: 22px auto 10px; padding: 20px 20px 16px; text-align: center; background: #fff;
  border: 2px solid var(--leaf); border-radius: 24px; box-shadow: var(--shadow-lg);
}
.qr-card-head { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 6px; }
.qr-card-head img:first-child { height: 50px; }
.qr-card-head img:last-child { height: 38px; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.qr-card-label { margin: 4px 0 2px; color: var(--green); font-weight: 600; font-size: .85rem; }
.qr-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.qr-card-sub { color: var(--muted); font-size: .82rem; margin: 0 0 10px; }
.qr-box { width: 220px; height: 220px; margin: 0 auto; }
.qr-box svg { width: 100%; height: 100%; }
.qr-box svg path, .qr-box svg rect[fill="black"] { fill: var(--green-deep); }
.qr-fallback { height: auto; word-break: break-all; direction: ltr; font-size: .8rem; }
.qr-card-hint { font-size: .8rem; color: var(--ink-2); margin: 10px 0 0; line-height: 1.6; }
.qr-save { max-width: 360px; margin: 0 auto 8px; display: flex; }
.detail-side .qr-card { margin-top: 12px; box-shadow: none; }
.copyrow { display: flex; gap: 8px; margin-bottom: 10px; }
.copyrow input { font-size: .82rem; }

.track { display: flex; gap: 0; margin: 0 0 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; overflow-x: auto; }
.track-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; min-width: 110px; font-size: .88rem; color: var(--muted); }
.track-step i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #CBD6CA; background: #fff; position: relative; z-index: 1; }
.track-step::before { content: ""; position: absolute; top: 10px; inset-inline-start: 50%; width: 100%; height: 2px; background: #E1E8E0; }
.track-step:last-child::before { display: none; }
.track-step.done { color: var(--green); font-weight: 600; }
.track-step.done i { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 4px #fff; }
.track-step.done::before { background: var(--leaf); }

/* ---------- الجداول والقوائم ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: .82rem; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #F0F3EF; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.tick { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font: 600 .82rem var(--font); cursor: pointer; color: var(--ink-2); }
.tick.on { background: #E3F5E4; border-color: #BFE3C2; color: var(--green); }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none !important; flex-wrap: wrap; }
a.row:hover { border-color: #CFE6C2; box-shadow: var(--shadow); }
.row .dateblock { width: 58px; padding: 6px 2px; }
.row .dateblock b { font-size: 1.3rem; }
.row > div { display: flex; flex-direction: column; min-width: 0; }
.row small { color: var(--muted); }
.row small.warn { color: #9A5A00; font-weight: 600; }
.row.req { border-inline-start: 4px solid var(--gold); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0 8px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; }
.kpi b { font-size: 1.9rem; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi.alert { background: #FFF8E6; border-color: #F1DFAE; }
.kpi.alert b { color: #9A6A00; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; overflow-x: auto; max-width: 100%; }
.tabs a { padding: 8px 14px; border-radius: 10px; color: var(--ink-2); text-decoration: none; white-space: nowrap; font-weight: 500; font-size: .92rem; }
.tabs a.on { background: var(--green); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.filters select, .filters input { width: auto; min-width: 150px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 140px; }
.quote { margin: 10px 0; padding: 10px 14px; border-inline-start: 3px solid var(--leaf); background: #F8FAF7; border-radius: 8px; }
.quote cite { display: block; font-style: normal; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.dept-box { margin: 0; }
.dept-box legend { font-weight: 700; padding: 0 6px; }
.check.is-in { color: var(--green); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; align-items: start; }
.coords { margin-top: 6px; }
.coords > legend { font-weight: 700; font-size: 1rem; color: var(--ink); }
.coord-row { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.coord-row .check { font-size: .82rem; white-space: nowrap; }
@media (max-width: 720px) { .coord-row { grid-template-columns: 1fr 1fr; } }
.credit { color: var(--muted); font-size: .8rem; margin: 0; }
.credit b { color: var(--green); font-weight: 600; }
.dept-list { list-style: none; padding: 0; margin: 0 0 12px; }
.dept-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #F0F3EF; }
.dept-list li.off span { color: #A3ACA5; text-decoration: line-through; }
details summary { cursor: pointer; font-weight: 600; margin: 10px 0; color: var(--green); }

.me-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; }
.me-head h1 { margin: 0; font-size: 1.4rem; }
.me-head p { margin: 0; }
.me-stats { display: flex; gap: 10px; margin-inline-start: auto; }
.me-stats div { text-align: center; background: var(--soft); border-radius: 14px; padding: 8px 16px; display: flex; flex-direction: column; }
.me-stats b { font-size: 1.4rem; color: var(--green); line-height: 1.2; }
.me-stats span { font-size: .8rem; color: var(--ink-2); }
.me-out { position: absolute; top: 10px; inset-inline-end: 14px; font-size: .82rem; }
.rate { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.rate input[name=feedback] { flex: 1; min-width: 160px; min-height: 36px; padding: 6px 12px; }
.stars { display: inline-flex; flex-direction: row-reverse; }
.stars input { position: absolute; opacity: 0; width: 1px; }
.stars label { font-size: 1.5rem; color: #D6DCD5; cursor: pointer; padding: 0 1px; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--gold); }
.stars input:focus-visible + label { outline: 2px solid var(--green); border-radius: 4px; }

/* ---------- التذييل ---------- */
.foot { margin-top: 40px; background: #fff; border-top: 1px solid var(--line); padding: 22px 0; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand div { display: flex; flex-direction: column; }
.foot-brand small { color: var(--muted); font-size: .8rem; }
.foot-links { display: flex; gap: 14px; align-items: center; font-size: .9rem; color: var(--muted); }

/* ---------- شاشة الحضور ---------- */
.screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: radial-gradient(1000px 600px at 50% -20%, rgba(122, 193, 67, .25), transparent 60%), #fff; }
.screen-top { display: flex; gap: 24px; align-items: center; margin-bottom: 18px; }
.screen h1 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 3rem); margin: 0; }
.screen-by { color: var(--ink-2); font-size: 1.2rem; }
.screen-main { display: flex; gap: 40px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.screen-code { display: flex; flex-direction: column; align-items: center; background: linear-gradient(160deg, var(--green-deep), var(--green)); color: #fff; border-radius: 32px; padding: 30px 56px; box-shadow: var(--shadow-lg); }
.screen-code span { font-size: 1.3rem; opacity: .9; }
.screen-code b { font-size: clamp(5rem, 14vw, 10rem); letter-spacing: .15em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.screen-code small { opacity: .85; max-width: 22em; }
.screen-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.screen-qr #qr { width: 260px; height: 260px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 10px; }
.screen-qr svg { width: 100%; height: 100%; }
.screen-count { font-size: 1.3rem; color: var(--ink-2); }
.screen-count b { color: var(--green); font-size: 1.8rem; }

/* ---------- الشهادة ---------- */
.cert-page { background: #E9EEE7; padding: 24px 16px; }
.cert-tools { text-align: center; margin-bottom: 16px; }
.cert { width: 297mm; max-width: 100%; aspect-ratio: 297 / 210; margin: 0 auto; background: #fff; padding: 12mm; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.cert::before { content: ""; position: absolute; inset-inline-start: -40mm; bottom: -40mm; width: 120mm; height: 120mm; background: url(leaf.svg) no-repeat center / contain; opacity: .06; transform: rotate(20deg); }
.cert-frame { height: 100%; border: 2px solid var(--green); outline: 1px solid var(--gold); outline-offset: -8px; border-radius: 6px; padding: 8mm 14mm; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.cert-head { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cert-org { display: flex; flex-direction: column; text-align: start; font-size: .9rem; line-height: 1.6; }
.cert-inmaa { height: 22mm; }
.cert-school { height: 28mm; justify-self: end; }
.cert-title { font-family: 'Amiri', var(--display); font-size: 2.8rem; color: var(--green-deep); margin: 4mm 0 2mm; }
.cert-lead { font-size: 1.15rem; color: var(--ink-2); margin: 0; }
.cert-name { font-family: 'Amiri', var(--display); font-size: 2.4rem; color: var(--ink); margin: 3mm 0 0; border-bottom: 2px solid var(--gold); padding: 0 12mm 1mm; }
.cert-dept { color: var(--muted); margin: 2mm 0 4mm; }
.cert-body { font-size: 1.15rem; line-height: 2; max-width: 210mm; color: var(--ink-2); }
.cert-body b { color: var(--green-deep); }
.cert-foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
.cert-foot > div { display: flex; flex-direction: column; }
.cert-foot span { color: var(--muted); font-size: .9rem; }
.cert-seal { align-items: center; gap: 2px; color: var(--muted); font-size: .72rem; }

/* ---------- الكشوف المطبوعة ---------- */
.sheet-page { background: #E9EEE7; padding: 24px 16px; }
.sheet { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; padding: 12mm 14mm; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.sheet-head { display: grid; grid-template-columns: 1fr 1.6fr 1fr; align-items: center; border-bottom: 2px solid var(--green); padding-bottom: 4mm; }
.sh-school { height: 24mm; }
.sh-mid { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: .95rem; }
.sh-inmaa { height: 14mm; margin-top: 2mm; }
.sh-year { text-align: end; font-size: .85rem; color: var(--ink-2); }
.sheet-title { text-align: center; font-size: 1.35rem; margin: 6mm 0 1mm; }
.sheet-sub { text-align: center; color: var(--muted); margin: 0 0 4mm; }
.pinfo, .ptable { width: 100%; border-collapse: collapse; margin-bottom: 5mm; font-size: .92rem; }
.pinfo th, .pinfo td, .ptable th, .ptable td { border: 1px solid #9FB09F; padding: 6px 8px; text-align: start; }
.pinfo th, .ptable th { background: #EEF4EA; font-weight: 700; white-space: nowrap; }
.ptable td { height: 9mm; }
.ptable td:first-child, .ptable th:first-child { text-align: center; }
.sheet-sign { margin-top: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(38mm, 1fr)); gap: 4mm; text-align: center; padding-top: 8mm; }
.cert-foot .cert-coords { display: flex; flex-direction: row; justify-content: center; gap: 10mm; }
.cert-coords > div { display: flex; flex-direction: column; }
.sheet-sign div { display: flex; flex-direction: column; }
.sheet-sign span { color: var(--muted); font-size: .88rem; }

/* ---------- الشاشات الصغيرة ---------- */
@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; gap: 24px; }
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .choices { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .brand-text { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar-in { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; min-height: 0; }
  .brand-school { height: 42px; } .brand-inmaa { height: 32px; }
  .nav { width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 12px; font-size: .9rem; }
  .hero { padding: 28px 0 20px; }
  .hero-logos img:first-child { height: 70px; } .hero-logos img:last-child { height: 54px; }
  .is-home .topbar .brand { display: none; }
  .stats { grid-template-columns: 1fr 1fr; margin-top: 20px; }
  .stat { padding: 10px 14px; flex-direction: column; gap: 0; }
  .stat b { font-size: 1.5rem; }
  .cards { grid-template-columns: 1fr; }
  .wcard { padding: 14px; gap: 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .facts div { padding: 8px 10px; }
  .facts dd { font-size: .9rem; }
  .steps { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .cal-cell { min-height: 58px; padding: 3px; }
  .cal-dow { font-size: .62rem; padding: 8px 0; letter-spacing: -.02em; }
  .ev { padding: 0; height: 6px; border-radius: 3px; border-inline-start: 0; }
  .ev b, .ev small { display: none; }
  .ev.cat-tarbawi { background: var(--c-tarbawi); } .ev.cat-takhassusi { background: var(--c-takhassusi); }
  .ev.cat-idari { background: var(--c-idari); } .ev.cat-shakhsi { background: var(--c-shakhsi); }
  .ev.ev-pending { background: #D9C27A; border: 0; }
  .cal-d { width: 24px; height: 24px; font-size: .78rem; }
  .cal-month { min-width: 0; font-size: 1.15rem; }
  .table { font-size: .85rem; }
  .table th, .table td { padding: 8px 6px; }
  .hide-sm { display: none; }
  .card:has(> .table) { overflow-x: auto; }
  .me-stats { margin-inline-start: 0; width: 100%; }
  .me-stats div { flex: 1; }
  .me-out { position: static; }
  .filters select, .filters input { flex: 1; min-width: 0; }
  .screen-code { padding: 20px 28px; }
  .screen-qr #qr { width: 200px; height: 200px; }
}

@media print {
  @page { margin: 0; }
  body.cert-page, body.sheet-page { background: #fff; padding: 0; }
  .cert-tools { display: none; }
  .cert { box-shadow: none; width: 297mm; height: 210mm; aspect-ratio: auto; }
  .sheet { box-shadow: none; width: 210mm; min-height: 297mm; }
}
@page cert { size: A4 landscape; }
.cert-page .cert { page: cert; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
