/* ==========================================================
   منصة الرياضة المدرسية — جهة درعة تافيلالت
   نظام التصميم
   ========================================================== */
:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #16201b;
  --ink-2: #3a4640;
  --muted: #6a746e;
  --faint: #98a19b;
  --line: #e6e0d3;
  --line-2: #efeae0;

  --g-950: #072219;
  --g-900: #0b3427;
  --g-800: #0e4635;
  --g-700: #115c45;
  --g-600: #157555;
  --g-500: #1d8f69;
  --g-200: #bfe0d1;
  --g-100: #dcefe5;
  --g-50: #eef7f2;

  --o-700: #9c5418;
  --o-600: #bf6a22;
  --o-500: #d6863a;
  --o-200: #f0d2b0;
  --o-100: #f7e6d2;
  --o-50: #fcf4ea;

  --r-600: #b3261e;
  --r-100: #f9dcd9;
  --r-50: #fdeeec;
  --b-600: #2a5fa6;
  --b-100: #d9e6f7;
  --b-50: #eef4fc;
  --p-600: #6d47a8;
  --p-50: #f3effa;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 28, 22, .06);
  --shadow: 0 1px 2px rgba(16, 28, 22, .04), 0 10px 28px -12px rgba(16, 28, 22, .16);
  --shadow-lg: 0 30px 70px -24px rgba(7, 34, 25, .45);

  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-display: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;

  --zellige: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.1'%3E%3Crect x='27' y='27' width='42' height='42'/%3E%3Crect x='27' y='27' width='42' height='42' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='9'/%3E%3Cpath d='M0 0L19 19M96 0L77 19M0 96L19 77M96 96L77 77M48 0v9M48 96v-9M0 48h9M96 48h-9'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.35; margin: 0; letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--o-200); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--g-700); color: #fff; box-shadow: 0 6px 16px -8px rgba(17, 92, 69, .7); }
.btn-primary:hover { background: var(--g-800); }
.btn-accent { background: var(--o-600); color: #fff; box-shadow: 0 6px 16px -8px rgba(191, 106, 34, .8); }
.btn-accent:hover { background: var(--o-700); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--g-200); color: var(--g-700); background: var(--g-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255, 255, 255, .2); }
.btn-danger { background: var(--r-600); color: #fff; }
.btn-danger:hover { background: #951d17; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; gap: 6px; }
.btn-sm [data-lucide], .btn-sm svg.lucide { width: 16px; height: 16px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 13px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge [data-lucide], .badge svg.lucide { width: 13px; height: 13px; }
.badge-green { background: var(--g-50); color: var(--g-700); }
.badge-ocher { background: var(--o-50); color: var(--o-700); }
.badge-red { background: var(--r-50); color: var(--r-600); }
.badge-blue { background: var(--b-50); color: var(--b-600); }
.badge-purple { background: var(--p-50); color: var(--p-600); }
.badge-dark { background: var(--g-900); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: all .15s;
}
.chip:hover { border-color: var(--g-200); }
.chip.active { background: var(--g-800); color: #fff; border-color: var(--g-800); }
.chip .chip-count { font-size: 11.5px; background: var(--line-2); color: var(--muted); border-radius: 999px; padding: 0 7px; line-height: 20px; }
.chip.active .chip-count { background: rgba(255, 255, 255, .18); color: #fff; }
.chip .sport-dot { width: 9px; height: 9px; border-radius: 50%; }

/* segmented tabs */
.seg { display: inline-flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 36px; padding: 0 16px; border-radius: 9px;
  font-weight: 600; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
}
.seg button.active { background: var(--surface); color: var(--g-800); box-shadow: var(--shadow-sm); }
.seg button .seg-count { font-size: 11.5px; color: var(--faint); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, .select, .textarea {
  height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  padding: 0 14px; outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14.5px;
}
.textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; padding-inline-start: 14px; padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a746e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--g-500); box-shadow: 0 0 0 4px rgba(29, 143, 105, .12); }
.input-icon { position: relative; }
.input-icon [data-lucide], .input-icon svg.lucide { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .input { padding-inline-start: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--g-800); font-size: 14px; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 16px; }
.form-section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; }
.check-pill span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; cursor: pointer; background: var(--surface); }
.check-pill input:checked + span { background: var(--g-50); border-color: var(--g-500); color: var(--g-800); font-weight: 600; }

.dropzone {
  border: 1.5px dashed var(--g-200); border-radius: 14px; background: var(--g-50);
  padding: 26px; text-align: center; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--g-500); background: #e3f2ea; }
.dropzone .dz-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; color: var(--g-600); box-shadow: var(--shadow-sm); }
.dropzone strong { font-size: 14.5px; }
.dropzone small { color: var(--muted); }
.dz-file { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-top: 4px; text-align: start; width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h3 { font-size: 15.5px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px 20px 20px; }
.card-link { font-size: 13px; color: var(--g-700); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { color: var(--o-600); }

/* ==========================================================
   PUBLIC SITE
   ========================================================== */
.pub { background: var(--bg); }
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

.topstrip { background: var(--g-950); color: #b9cfc5; font-size: 12.5px; }
.topstrip .wrap { display: flex; justify-content: space-between; align-items: center; height: 36px; gap: 16px; }
.topstrip .ts-items { display: flex; gap: 22px; align-items: center; }
.topstrip .ts-items span { display: inline-flex; gap: 6px; align-items: center; }
.topstrip [data-lucide], .topstrip svg.lucide { width: 14px; height: 14px; }

.pub-nav { position: sticky; top: 0; z-index: 40; background: rgba(245, 242, 234, .86); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.pub-nav.scrolled { border-bottom-color: var(--line); background: rgba(250, 248, 243, .94); }
.pub-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; flex-shrink: 0; }
.brand-text strong { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--g-900); line-height: 1.3; }
.brand-text small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.pub-links { display: flex; align-items: center; gap: 4px; }
.pub-links a { padding: 8px 13px; border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: all .15s; }
.pub-links a:hover { background: var(--line-2); color: var(--g-800); }
.pub-menu-btn { display: none; }

.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 85% -10%, #1a7253 0%, transparent 60%), linear-gradient(160deg, var(--g-900) 0%, var(--g-950) 100%); color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 96px; opacity: .07; }
.hero::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 140px; background: linear-gradient(to top, rgba(7, 34, 25, .6), transparent); }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center; padding: 84px 0 110px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; padding-inline-start: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 13px; color: #d4e7de; }
.hero-eyebrow b { background: var(--o-500); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.hero h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 800; margin-top: 22px; line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--o-500); position: relative; }
.hero .lead { font-size: 17.5px; color: #c6dad1; margin-top: 18px; max-width: 590px; line-height: 1.85; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 46px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 26px; max-width: 560px; }
.hero-stats div + div { border-inline-start: 1px solid rgba(255, 255, 255, .12); padding-inline-start: 22px; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; color: #fff; line-height: 1.2; }
.hero-stats span { font-size: 13px; color: #9fbcaf; }

.hero-panel { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .13); border-radius: 24px; padding: 22px; backdrop-filter: blur(10px); box-shadow: var(--shadow-lg); }
.hp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.hp-head h3 { font-size: 15px; color: #fff; }
.hp-feature { background: linear-gradient(140deg, var(--o-600), #a95517); border-radius: 18px; padding: 20px; position: relative; overflow: hidden; }
.hp-feature::after { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 70px; opacity: .12; }
.hp-feature > * { position: relative; z-index: 1; }
.hp-feature .tag { font-size: 12px; background: rgba(0, 0, 0, .18); padding: 3px 10px; border-radius: 999px; display: inline-block; }
.hp-feature h4 { font-size: 19px; margin-top: 10px; line-height: 1.5; }
.hp-feature .meta { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: #fde9d5; flex-wrap: wrap; }
.hp-feature .meta span { display: inline-flex; align-items: center; gap: 5px; }
.hp-feature .meta [data-lucide], .hp-feature .meta svg.lucide { width: 15px; height: 15px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.countdown div { background: rgba(0, 0, 0, .16); border-radius: 12px; text-align: center; padding: 8px 4px; }
.countdown strong { display: block; font-size: 22px; font-family: var(--font-display); line-height: 1.3; }
.countdown span { font-size: 11.5px; color: #fde9d5; }
.hp-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.hp-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; background: rgba(255, 255, 255, .05); }
.hp-item .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; }
.hp-item strong { display: block; font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.45; }
.hp-item small { font-size: 12px; color: #9fbcaf; }
.hp-item .d { margin-inline-start: auto; text-align: center; font-size: 11.5px; color: #c6dad1; line-height: 1.3; }
.hp-item .d b { display: block; font-size: 17px; color: #fff; font-family: var(--font-display); }

.section { padding: 96px 0; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line-2); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 40px; }
.section-head .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--o-600); }
.section-head .kicker::before { content: ""; width: 22px; height: 2px; background: var(--o-500); border-radius: 2px; }
.section-head h2 { font-size: clamp(25px, 3vw, 34px); font-weight: 800; margin-top: 10px; color: var(--g-950); }
.section-head p { color: var(--muted); max-width: 560px; margin-top: 10px; font-size: 15.5px; }

.welcome { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.welcome-visual { position: relative; aspect-ratio: 1 / .92; border-radius: 28px; overflow: hidden; background: linear-gradient(160deg, var(--o-500), var(--o-700)); }
.welcome-visual::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 84px; opacity: .14; }
.welcome-visual .wv-badge { position: absolute; inset-inline-start: 22px; bottom: 22px; inset-inline-end: 22px; background: rgba(255, 255, 255, .95); border-radius: 18px; padding: 18px 20px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.welcome-visual .wv-badge .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--g-700); color: #fff; display: grid; place-items: center; }
.welcome-visual .wv-badge strong { display: block; font-size: 15px; color: var(--g-900); }
.welcome-visual .wv-badge small { color: var(--muted); font-size: 13px; }
.welcome-visual .wv-art { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 80px; }
.welcome-visual .wv-art svg { width: 62%; height: auto; }
.welcome-visual .wv-center { position: absolute; top: calc(50% - 40px); left: 50%; transform: translate(-50%, -50%); color: var(--o-600); }
.welcome-visual .wv-center [data-lucide], .welcome-visual .wv-center svg.lucide { width: 64px; height: 64px; stroke-width: 1.5; }
.welcome-text blockquote { margin: 22px 0 0; padding: 0; font-size: 17px; line-height: 2; color: var(--ink-2); }
.welcome-text .sign { margin-top: 22px; display: flex; align-items: center; gap: 12px; }
.welcome-text .sign .av { width: 46px; height: 46px; border-radius: 50%; background: var(--g-100); color: var(--g-800); display: grid; place-items: center; font-weight: 700; }
.welcome-text .sign strong { display: block; font-size: 14.5px; }
.welcome-text .sign small { color: var(--muted); }
.missions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.missions div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.missions [data-lucide], .missions svg.lucide { color: var(--g-600); margin-top: 3px; }

.ref-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.ref-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.ref-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ref-card .n { position: absolute; inset-inline-end: 16px; top: 12px; font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--line-2); line-height: 1; }
.ref-card .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--g-50); color: var(--g-700); }
.ref-card h4 { font-size: 15px; margin-top: 16px; color: var(--g-950); }
.ref-card p { font-size: 13.2px; color: var(--muted); margin-top: 6px; line-height: 1.75; }

.proj-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.proj { border-radius: 22px; padding: 26px; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.proj .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--o-50); color: var(--o-600); }
.proj h4 { font-size: 17px; color: var(--g-950); }
.proj p { font-size: 14px; color: var(--muted); line-height: 1.85; }
.proj .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.proj.big { grid-row: span 2; background: linear-gradient(165deg, var(--g-800), var(--g-950)); color: #fff; border: 0; }
.proj.big::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 90px; opacity: .06; }
.proj.big > * { position: relative; }
.proj.big h4 { color: #fff; font-size: 22px; }
.proj.big p { color: #c3d8ce; font-size: 15px; }
.proj.big .ic { background: rgba(255, 255, 255, .1); color: var(--o-500); }
.proj.big .pillars { display: grid; gap: 10px; margin-top: 10px; }
.proj.big .pillars div { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: 13px; padding: 12px 14px; font-size: 14px; }
.proj.big .pillars b { width: 30px; height: 30px; border-radius: 9px; background: var(--o-600); display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }

.struct-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.struct { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: all .2s; }
.struct:hover { border-color: var(--g-200); box-shadow: var(--shadow); }
.struct .ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: #fff; }
.struct h4 { font-size: 15.5px; color: var(--g-950); }
.struct p { font-size: 13.4px; color: var(--muted); line-height: 1.8; }
.struct .more { margin-top: auto; font-size: 13px; color: var(--g-700); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.struct.wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 20px; background: linear-gradient(120deg, var(--o-50), var(--surface)); }
.struct.wide .branches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.pub-comps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pcomp { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: all .2s; }
.pcomp:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pcomp-top { height: 92px; position: relative; display: flex; align-items: flex-end; padding: 14px 18px; color: #fff; }
.pcomp-top::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 64px; opacity: .14; }
.pcomp-top > * { position: relative; }
.pcomp-top .sport-ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.pcomp-top .date-box { margin-inline-start: auto; background: #fff; color: var(--ink); border-radius: 12px; padding: 4px 12px; text-align: center; line-height: 1.25; box-shadow: var(--shadow-sm); }
.pcomp-top .date-box b { display: block; font-family: var(--font-display); font-size: 20px; }
.pcomp-top .date-box small { font-size: 11.5px; color: var(--muted); }
.pcomp-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcomp-body h4 { font-size: 15.5px; line-height: 1.6; }
.pcomp-body .meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pcomp-body .meta span { display: inline-flex; align-items: center; gap: 5px; }
.pcomp-body .meta [data-lucide], .pcomp-body .meta svg.lucide { width: 15px; height: 15px; }

.prov-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.prov { border-radius: 20px; overflow: hidden; position: relative; aspect-ratio: 1 / 1.15; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; }
.prov::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 80px; opacity: .1; }
.prov::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 60%); }
.prov > * { position: relative; z-index: 1; }
.prov .pin { position: absolute; top: 16px; inset-inline-start: 16px; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; z-index: 1; }
.prov h4 { font-size: 20px; }
.prov small { font-size: 12.5px; color: rgba(255, 255, 255, .8); }
.prov .pstats { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; }
.prov .pstats b { font-family: var(--font-display); font-size: 16px; display: block; line-height: 1.2; }

.pub-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pdoc-col { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 8px; }
.pdoc-col-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.pdoc-col-head h4 { font-size: 15.5px; }
.pdoc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; transition: background .15s; }
.pdoc:hover { background: var(--surface-2); }
.pdoc .meta { flex: 1; min-width: 0; }
.pdoc strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.55; }
.pdoc small { color: var(--muted); font-size: 12.3px; }

.cta-band { background: linear-gradient(120deg, var(--o-600), #9a4c13); border-radius: 28px; padding: 44px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 90px; opacity: .12; }
.cta-band > * { position: relative; }
.cta-band h3 { font-size: 26px; }
.cta-band p { color: #fde9d5; margin-top: 8px; max-width: 560px; }

.footer { background: var(--g-950); color: #9fbcaf; padding: 64px 0 28px; margin-top: 96px; position: relative; overflow: hidden; }
.footer::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 96px; opacity: .03; }
.footer .wrap { position: relative; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
.footer h5 { color: #fff; font-family: var(--font-display); font-size: 14.5px; margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer .brand-text strong { color: #fff; }
.footer .brand-text small { color: #9fbcaf; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; font-size: 13px; flex-wrap: wrap; }
.proto-note { display: inline-flex; align-items: center; gap: 6px; color: var(--o-500); }

/* cartes cliquables */
a.ref-card { display: block; color: inherit; }
a.proj, a.struct { color: inherit; }
a.proj { transition: transform .2s, box-shadow .2s; }
a.proj:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.read-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--g-700); }
.read-more [data-lucide], .read-more svg.lucide, .struct .more svg.lucide, .struct .more [data-lucide] { width: 15px; height: 15px; transition: transform .2s; }
.proj .tags .read-more { margin-top: 0; margin-inline-start: auto; }
.proj.big .read-more { color: var(--o-500); margin-top: 14px; }
a.ref-card:hover .read-more svg, a.proj:hover .read-more svg, a.struct:hover .more svg { transform: translateX(-4px); }

/* ==========================================================
   ARTICLES
   ========================================================== */
.art-hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(900px 420px at 90% -20%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 65%), linear-gradient(160deg, var(--g-900), var(--g-950)); }
.art-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 96px; opacity: .07; }
.art-hero .wrap { position: relative; padding: 34px 0 60px; }
.art-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9fbcaf; flex-wrap: wrap; }
.art-crumbs a:hover { color: #fff; }
.art-crumbs svg.lucide, .art-crumbs [data-lucide] { width: 14px; height: 14px; }
.art-crumbs span { color: #d4e7de; }
.art-hero-main { display: flex; gap: 24px; align-items: flex-start; margin-top: 30px; }
.art-hero-ic { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--accent); color: #fff; flex-shrink: 0; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); }
.art-hero-ic svg.lucide, .art-hero-ic [data-lucide] { width: 36px; height: 36px; }
.art-kicker { display: inline-flex; font-size: 13px; font-weight: 700; color: var(--o-500); }
.art-hero h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; margin-top: 8px; line-height: 1.45; max-width: 900px; }
.art-hero .lead { color: #c6dad1; font-size: 17px; line-height: 1.95; margin-top: 14px; max-width: 860px; }
.art-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 20px; font-size: 13px; color: #9fbcaf; }
.art-meta span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; padding: 4px 12px; }
.art-meta svg.lucide, .art-meta [data-lucide] { width: 15px; height: 15px; }

.art-section { padding: 0 0 20px; }
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; margin-top: -28px; position: relative; }
.art-body { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 38px 42px; box-shadow: var(--shadow); min-width: 0; }
.art-sec + .art-sec { margin-top: 38px; padding-top: 34px; border-top: 1px solid var(--line-2); }
.art-sec h2 { font-size: 21px; color: var(--g-950); display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.art-sec h2 .num { width: 38px; height: 38px; border-radius: 11px; background: var(--g-50); color: var(--g-700); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; font-family: var(--font); }
.art-sec h2 .num svg.lucide, .art-sec h2 .num [data-lucide] { width: 17px; height: 17px; }
.art-sec p { font-size: 16px; line-height: 2; color: var(--ink-2); }
.art-sec p + p, .art-sec p + ul, .art-sec ul + p, .art-sec blockquote + p, .art-sec p + blockquote, .art-sec div + p, .art-sec p + div { margin-top: 14px; }
.art-sec strong { color: var(--ink); }
.muted-p { font-size: 13.5px !important; color: var(--muted) !important; margin-top: 12px; }

blockquote.legal { margin: 16px 0; padding: 20px 24px 18px; background: linear-gradient(140deg, var(--o-50), #fffaf3); border: 1px solid var(--o-100); border-inline-start: 4px solid var(--o-500); border-radius: 16px; position: relative; }
blockquote.legal::before { content: "”"; position: absolute; inset-inline-end: 18px; top: -8px; font-size: 72px; line-height: 1; color: var(--o-200); font-family: Georgia, serif; }
blockquote.legal p { font-size: 16.5px; line-height: 2.05; color: #3d2a14; font-weight: 500; position: relative; }
blockquote.legal ul { margin: 8px 0; padding-inline-start: 22px; color: #3d2a14; font-size: 16px; line-height: 2; font-weight: 500; }
blockquote.legal cite { display: inline-flex; margin-top: 10px; font-style: normal; font-size: 13px; font-weight: 700; color: var(--o-700); background: #fff; border: 1px solid var(--o-100); border-radius: 999px; padding: 3px 12px; }

.art-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.art-list li { position: relative; padding-inline-start: 26px; font-size: 15.5px; line-height: 1.9; color: var(--ink-2); }
.art-list li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--g-500); }
.art-list.check li::before { width: 18px; height: 18px; top: 6px; inset-inline-start: 0; background: var(--g-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23157555' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; border: 1px solid var(--g-200); }

.art-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.art-points > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.art-points b { display: block; font-family: var(--font-display); font-size: 14.5px; color: var(--g-800); margin-bottom: 4px; }
.art-points span { font-size: 14px; color: var(--ink-2); line-height: 1.8; }

.art-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.art-figures > div { border-radius: 16px; padding: 16px; background: linear-gradient(150deg, var(--g-800), var(--g-950)); color: #fff; position: relative; overflow: hidden; }
.art-figures > div::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 60px; opacity: .08; }
.art-figures strong { position: relative; display: block; font-family: var(--font-display); font-size: 28px; line-height: 1.3; color: var(--o-500); }
.art-figures span { position: relative; font-size: 13px; color: #c6dad1; line-height: 1.6; display: block; }

.art-note { margin-top: 14px; background: var(--b-50); border: 1px solid var(--b-100); color: #1f4a85; border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.85; }
.art-regional { display: flex; gap: 12px; align-items: flex-start; background: var(--o-50); border: 1px dashed var(--o-200); border-radius: 14px; padding: 12px 16px; margin-bottom: 26px; font-size: 14px; color: var(--o-700); }
.art-regional b { display: block; color: var(--o-700); }
.art-regional span { color: #6b4a26; line-height: 1.8; }
.art-regional svg.lucide, .art-regional [data-lucide] { margin-top: 3px; }

.art-articles { display: grid; gap: 10px; }
.art-articles > div { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.art-articles .n { flex-shrink: 0; background: var(--g-800); color: #fff; font-size: 12.5px; font-weight: 700; border-radius: 9px; padding: 4px 10px; white-space: nowrap; }
.art-articles b { display: block; font-size: 15px; color: var(--g-900); }
.art-articles p { font-size: 14.5px !important; line-height: 1.9 !important; margin-top: 2px !important; }

.art-axes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.art-axes > div { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface-2); }
.art-axes > div.hl { border-color: var(--o-200); background: var(--o-50); }
.art-axes b { font-family: var(--font-display); font-size: 16px; color: var(--g-900); }
.art-axes ul { margin: 8px 0 0; padding-inline-start: 18px; font-size: 14px; line-height: 2; color: var(--ink-2); }

.art-timeline { display: grid; gap: 0; margin: 14px 0; border-inline-start: 2px solid var(--g-200); padding-inline-start: 22px; }
.art-timeline > div { position: relative; padding: 8px 0; }
.art-timeline > div::before { content: ""; position: absolute; inset-inline-start: -30px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--g-600); }
.art-timeline b { display: block; font-family: var(--font-display); color: var(--g-800); font-size: 15px; }
.art-timeline span { font-size: 14.5px; color: var(--ink-2); }

.art-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.art-steps li { counter-increment: st; display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; align-items: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.art-steps li::before { content: counter(st); grid-row: span 2; width: 36px; height: 36px; border-radius: 11px; background: var(--o-600); color: #fff; display: grid; place-items: center; font-weight: 700; }
.art-steps b { font-size: 15px; color: var(--g-900); }
.art-steps span { font-size: 14px; color: var(--ink-2); line-height: 1.8; }

.art-pyramid { display: grid; justify-items: center; gap: 6px; margin: 16px 0; }
.art-pyramid > div { width: var(--w); text-align: center; padding: 11px 12px; border-radius: 12px; color: #fff; font-size: 14px; background: var(--g-700); }
.art-pyramid > div:nth-child(1) { background: var(--r-600); }
.art-pyramid > div:nth-child(2) { background: var(--o-600); }
.art-pyramid > div:nth-child(3) { background: var(--g-600); }
.art-pyramid > div:nth-child(4) { background: var(--g-800); }

.art-org { display: grid; justify-items: center; gap: 10px; margin-top: 12px; }
.art-org > div { text-align: center; border-radius: 14px; padding: 12px 18px; }
.art-org .top { background: var(--g-900); color: #fff; }
.art-org .mid { background: var(--o-600); color: #fff; }
.art-org .mid span { display: block; font-size: 12.5px; opacity: .85; }
.art-org .leaves { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; }
.art-org .leaves span { background: var(--g-50); border: 1px solid var(--g-200); color: var(--g-800); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; }
.art-org .base { background: var(--surface-2); border: 1px dashed var(--line); color: var(--ink-2); width: 100%; }

.art-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.art-table th { background: var(--g-800); color: #fff; font-size: 13.5px; font-weight: 600; text-align: start; padding: 11px 14px; }
.art-table td { padding: 11px 14px; font-size: 14.5px; color: var(--ink-2); line-height: 1.8; border-top: 1px solid var(--line-2); vertical-align: top; }
.art-table tr:nth-child(even) td { background: var(--surface-2); }
.art-table td:first-child { font-weight: 600; color: var(--g-900); white-space: nowrap; }
.chips-static { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips-static span { background: var(--g-50); border: 1px solid var(--g-200); color: var(--g-800); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; }
.doc-src { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--g-700); background: var(--g-50); border-radius: 999px; padding: 1px 8px; margin-inline-start: 6px; font-weight: 600; }
.doc-src svg.lucide, .doc-src [data-lucide] { width: 12px; height: 12px; }
.art-sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.art-sources a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--b-600); transition: background .15s; }
.art-sources a:hover { background: var(--b-50); }
.art-sources svg.lucide, .art-sources [data-lucide] { width: 16px; height: 16px; flex-shrink: 0; }

.art-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.art-pager a { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; transition: all .15s; }
.art-pager a:hover { border-color: var(--g-200); background: var(--g-50); }
.art-pager a.next { text-align: end; }
.art-pager small { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.art-pager small svg.lucide, .art-pager small [data-lucide] { width: 14px; height: 14px; }
.art-pager b { display: block; font-size: 14.5px; color: var(--g-900); margin-top: 2px; line-height: 1.6; }

.art-aside { position: sticky; top: 96px; display: grid; gap: 12px; margin-top: 48px; }
.art-toc { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 2px; }
.art-toc h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--g-900); margin-bottom: 8px; }
.art-toc a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; font-size: 13.8px; color: var(--ink-2); line-height: 1.6; }
.art-toc a:hover { background: var(--g-50); color: var(--g-800); }
.art-toc a .num { font-size: 12px; color: var(--faint); font-weight: 700; }

.art-related-wrap { margin-top: 56px; }
.art-related-wrap h3 { font-size: 20px; color: var(--g-950); margin-bottom: 16px; }
.art-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.art-rel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: all .2s; }
.art-rel:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.art-rel .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; margin-bottom: 6px; }
.art-rel small { font-size: 12px; color: var(--muted); }
.art-rel b { font-size: 15px; color: var(--g-950); line-height: 1.6; }
.art-rel .more { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--g-700); display: inline-flex; align-items: center; gap: 4px; }
.art-rel .more svg.lucide, .art-rel .more [data-lucide] { width: 15px; height: 15px; }

@media (max-width: 1024px) {
  .art-layout { grid-template-columns: 1fr; }
  .art-aside { position: static; margin-top: 0; }
  .art-toc { display: none; }
  .art-related { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .art-hero-main { flex-direction: column; gap: 14px; }
  .art-hero-ic { width: 58px; height: 58px; border-radius: 17px; }
  .art-body { padding: 24px 18px; border-radius: 18px; }
  .art-sec h2 { font-size: 18px; }
  .art-sec p { font-size: 15px; }
  .art-axes, .art-related, .art-pager { grid-template-columns: 1fr; }
  .art-pyramid > div { width: 100% !important; }
  blockquote.legal { padding: 16px 16px 14px; }
}

/* ==========================================================
   LOGIN
   ========================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; }
.login-art { background: linear-gradient(165deg, var(--g-800), var(--g-950)); color: #fff; position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 96px; opacity: .08; }
.login-art > * { position: relative; }
.login-art .brand-text strong { color: #fff; }
.login-art .brand-text small { color: #9fbcaf; }
.login-art h2 { font-size: 34px; font-weight: 800; line-height: 1.45; }
.login-art h2 em { font-style: normal; color: var(--o-500); }
.login-art p { color: #b9cfc5; margin-top: 14px; max-width: 460px; font-size: 15.5px; }
.role-diagram { display: grid; gap: 10px; margin-top: 30px; max-width: 460px; }
.rd-node { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 12px 14px; }
.rd-node .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--o-600); }
.rd-node strong { display: block; font-size: 14px; }
.rd-node small { color: #9fbcaf; font-size: 12.5px; }
.rd-children { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding-inline-start: 24px; border-inline-start: 2px dashed rgba(255, 255, 255, .18); margin-inline-start: 18px; padding-top: 4px; }
.rd-children span { font-size: 12px; text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #d4e7de; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form { width: min(460px, 100%); }
.login-form h1 { font-size: 28px; font-weight: 800; color: var(--g-950); }
.login-form > p { color: var(--muted); margin-top: 8px; }
.role-options { display: grid; gap: 12px; margin-top: 28px; }
.role-opt { display: flex; gap: 14px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface); cursor: pointer; transition: all .15s; position: relative; }
.role-opt:hover { border-color: var(--g-200); }
.role-opt.active { border-color: var(--g-600); background: var(--g-50); box-shadow: 0 0 0 4px rgba(29, 143, 105, .1); }
.role-opt .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--g-800); color: #fff; flex-shrink: 0; }
.role-opt.is-prov .ic { background: var(--o-600); }
.role-opt strong { display: block; font-size: 15px; }
.role-opt small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; line-height: 1.6; }
.role-opt .radio { position: absolute; top: 16px; inset-inline-end: 16px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); }
.role-opt.active .radio { border-color: var(--g-600); background: radial-gradient(circle, var(--g-600) 45%, transparent 50%); }
.role-opt .select { margin-top: 12px; }
.login-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; background: var(--o-50); border: 1px solid var(--o-100); border-radius: 12px; padding: 10px 12px; }
.login-note [data-lucide], .login-note svg.lucide { color: var(--o-600); width: 16px; height: 16px; margin-top: 3px; }

/* ==========================================================
   APP SHELL
   ========================================================== */
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--g-950); color: #b7cbc1; display: flex; flex-direction: column; overflow: hidden; }
.sidebar::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 96px; opacity: .035; pointer-events: none; }
.sidebar > * { position: relative; }
.sb-brand { padding: 22px 20px 18px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sb-brand .brand-text strong { color: #fff; font-size: 14.5px; }
.sb-brand .brand-text small { color: #8eaa9d; font-size: 11.5px; }
.sb-role { margin: 16px 16px 4px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); display: flex; gap: 10px; align-items: center; }
.sb-role .av { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--o-600); flex-shrink: 0; font-size: 14px; }
.sb-role.super .av { background: linear-gradient(140deg, var(--o-500), var(--o-700)); }
.sb-role strong { display: block; color: #fff; font-size: 13.5px; line-height: 1.4; }
.sb-role small { font-size: 11.5px; color: #8eaa9d; }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.sb-group { margin-top: 14px; }
.sb-group-title { font-size: 11.5px; font-weight: 600; color: #6f8d80; padding: 0 12px 6px; letter-spacing: 0; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; font-size: 14px; font-weight: 500; color: #b7cbc1; transition: all .15s; position: relative; }
.sb-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sb-link.active { background: rgba(255, 255, 255, .09); color: #fff; }
.sb-link.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--o-500); }
.sb-link.active [data-lucide], .sb-link.active svg.lucide { color: var(--o-500); }
.sb-link .count { margin-inline-start: auto; font-size: 11.5px; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 0 8px; line-height: 20px; color: #cfe0d8; }
.sb-link .lock { margin-inline-start: auto; color: #6f8d80; }
.sb-link .lock[data-lucide], .sb-link svg.lucide.lock { width: 14px; height: 14px; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); display: grid; gap: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 70px; background: rgba(245, 242, 234, .88); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.topbar .tb-title { display: flex; flex-direction: column; min-width: 0; }
.topbar .crumbs { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.topbar .crumbs [data-lucide], .topbar .crumbs svg.lucide { width: 13px; height: 13px; }
.topbar .crumbs a:hover { color: var(--g-700); }
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--g-950); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { flex: 1; }
.tb-season { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; height: 40px; padding-inline-start: 12px; }
.tb-season [data-lucide], .tb-season svg.lucide { color: var(--g-600); width: 16px; height: 16px; }
.tb-season select { border: 0; background: transparent; height: 38px; outline: none; font-weight: 600; font-size: 13.5px; padding-inline-end: 10px; cursor: pointer; }
.tb-switch { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; padding-inline-start: 12px; border-radius: 11px; background: var(--o-50); border: 1px dashed var(--o-200); }
.tb-switch span { font-size: 12px; color: var(--o-700); font-weight: 600; white-space: nowrap; }
.tb-switch select { border: 0; background: transparent; outline: none; font-weight: 600; font-size: 13px; height: 36px; cursor: pointer; color: var(--ink); max-width: 190px; }
.tb-bell { position: relative; }
.tb-bell .pip { position: absolute; top: 7px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--r-600); border: 2px solid var(--bg); }
.sb-toggle { display: none; }

.page { padding: 28px; max-width: 1360px; width: 100%; margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 800; color: var(--g-950); }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input-icon { width: 280px; }
.toolbar .select { width: auto; min-width: 160px; height: 40px; }
.toolbar .input { height: 40px; }
.toolbar .grow { flex: 1; }

.readonly-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--b-50); border: 1px solid var(--b-100); color: #1f4a85; font-size: 13.5px; margin-bottom: 18px; }
.readonly-banner .ic { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--b-600); flex-shrink: 0; }
.readonly-banner strong { font-weight: 700; }

/* ---------- Dashboard ---------- */
.welcome-banner { border-radius: 22px; padding: 26px 28px; background: linear-gradient(120deg, var(--g-800), var(--g-950)); color: #fff; position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 22px; }
.welcome-banner::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 96px; opacity: .07; }
.welcome-banner > * { position: relative; }
.welcome-banner h2 { font-size: 23px; }
.welcome-banner p { color: #b9cfc5; margin-top: 6px; font-size: 14.5px; }
.welcome-banner .wb-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.kpi .label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.kpi .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--g-950); }
.kpi .foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .foot b { color: var(--g-600); font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 16px; }
.dash-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.dash-col > * { min-width: 0; }
.kpi { min-width: 0; }
.kpi .foot { flex-wrap: wrap; row-gap: 2px; }

/* bar chart */
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 52px; align-items: center; gap: 12px; position: relative; }
.bar-row .bl { font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 26px; position: relative; display: flex; align-items: center; }
.bar-track::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--line-2); }
.bar-fill { position: relative; height: 18px; border-radius: 4px; background: var(--g-600); transition: width .7s cubic-bezier(.2, .8, .2, 1); min-width: 4px; }
.bar-fill.ocher { background: var(--o-600); }
.bar-row .bv { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: end; }
.bar-row:hover .bar-fill { filter: brightness(1.12); }
.bar-hit { position: absolute; inset: -6px 0; cursor: default; }
.chart-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--g-950); color: #fff; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 240px; line-height: 1.6; }
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip b { font-size: 14px; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 18px; color: #b9cfc5; }
.chart-tip .tip-row span:last-child { color: #fff; font-weight: 600; }

/* list rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row .meta { flex: 1; min-width: 0; }
.row strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small { color: var(--muted); font-size: 12.5px; }
.date-chip { width: 50px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 0; line-height: 1.25; }
.date-chip b { display: block; font-family: var(--font-display); font-size: 18px; color: var(--g-900); }
.date-chip small { font-size: 11px; color: var(--muted); }

.file-ic { width: 42px; height: 46px; flex-shrink: 0; border-radius: 9px; position: relative; display: grid; place-items: end center; padding-bottom: 6px; font-size: 10px; font-weight: 800; color: #fff; letter-spacing: .3px; font-family: 'Segoe UI', sans-serif; }
.file-ic::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 13px; height: 13px; background: rgba(255, 255, 255, .35); border-end-end-radius: 6px; }
.file-ic.pdf { background: linear-gradient(160deg, #d8473c, #a82a20); }
.file-ic.docx, .file-ic.doc { background: linear-gradient(160deg, #3b78d0, #22549c); }
.file-ic.sm { width: 34px; height: 38px; font-size: 9px; padding-bottom: 4px; border-radius: 8px; }

/* activity feed */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.feed-item .fi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.feed-item .fi [data-lucide], .feed-item .fi svg.lucide { width: 16px; height: 16px; }
.feed-item p { font-size: 13.5px; line-height: 1.6; }
.feed-item small { color: var(--faint); font-size: 12px; }

/* ---------- Documents ---------- */
.season-tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.season-tab { flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 16px; text-align: start; min-width: 150px; transition: all .15s; }
.season-tab strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.season-tab small { color: var(--muted); font-size: 12px; }
.season-tab.active { background: var(--g-800); border-color: var(--g-800); }
.season-tab.active strong { color: #fff; }
.season-tab.active small { color: #b9cfc5; }
.season-tab .cur { font-size: 10.5px; background: var(--o-500); color: #fff; border-radius: 999px; padding: 1px 7px; margin-inline-start: 6px; vertical-align: middle; font-family: var(--font); }

.doc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.doc-table th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.doc-table th:first-child { border-start-start-radius: var(--radius); }
.doc-table th:last-child { border-start-end-radius: var(--radius); }
.doc-table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table tbody tr { transition: background .12s; }
.doc-table tbody tr:hover { background: #fcfbf8; }
.doc-title { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.doc-title strong { display: block; font-weight: 600; line-height: 1.55; font-size: 14.2px; }
.doc-title small { color: var(--muted); font-size: 12.5px; }
.doc-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
.new-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--o-500); margin-inline-start: 6px; vertical-align: middle; }

/* ---------- Competitions ---------- */
.level-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.level-tab { border: 1.5px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; text-align: start; transition: all .15s; }
.level-tab:hover { border-color: var(--g-200); }
.level-tab .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex-shrink: 0; }
.level-tab strong { display: block; font-size: 15.5px; font-family: var(--font-display); }
.level-tab small { color: var(--muted); font-size: 12.5px; }
.level-tab .lt-count { margin-inline-start: auto; font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--faint); }
.level-tab.active { border-color: var(--g-700); background: var(--g-50); box-shadow: 0 0 0 4px rgba(29, 143, 105, .08); }
.level-tab.active .ic { background: var(--g-700); color: #fff; }
.level-tab.active .lt-count { color: var(--g-700); }

.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.comp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: all .18s; cursor: pointer; }
.comp-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--g-200); }
.comp-card .cc-top { padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line-2); position: relative; }
.comp-card .cc-top::before { content: ""; position: absolute; inset-inline-start: 0; top: 16px; bottom: 16px; width: 4px; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--sport); }
.sport-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.comp-card h4 { font-size: 15px; line-height: 1.6; font-family: var(--font); font-weight: 700; }
.comp-card .cc-sub { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.comp-card .cc-body { padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; font-size: 13px; color: var(--ink-2); }
.comp-card .cc-body span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.comp-card .cc-body [data-lucide], .comp-card .cc-body svg.lucide { width: 16px; height: 16px; color: var(--faint); }
.comp-card .cc-foot { margin-top: auto; padding: 12px 18px; background: var(--surface-2); border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.comp-card .cc-foot b { color: var(--ink); font-weight: 700; }
.comp-card .cc-foot .go { margin-inline-start: auto; color: var(--g-700); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; height: 24px; padding: 0 9px; border-radius: 999px; }
.status.upcoming { background: var(--b-50); color: var(--b-600); }
.status.ongoing { background: var(--o-50); color: var(--o-700); }
.status.done { background: var(--line-2); color: var(--muted); }
.status .dot { width: 6px; height: 6px; }
.status.ongoing .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* comp detail */
.comp-hero { border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.comp-hero-band { padding: 26px 28px; color: #fff; position: relative; overflow: hidden; display: flex; gap: 18px; align-items: flex-start; }
.comp-hero-band::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 84px; opacity: .12; }
.comp-hero-band > * { position: relative; }
.comp-hero-band .sport-ic { width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, .18); color: #fff; }
.comp-hero-band .sport-ic [data-lucide], .comp-hero-band .sport-ic svg.lucide { width: 30px; height: 30px; }
.comp-hero-band h2 { font-size: 24px; line-height: 1.5; }
.comp-hero-band .chb-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.comp-hero-band .chb-tags .badge { background: rgba(255, 255, 255, .16); color: #fff; }
.comp-hero-band .chb-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-shrink: 0; }
.comp-facts { display: grid; grid-template-columns: repeat(6, 1fr); }
.comp-facts div { padding: 16px 22px; border-inline-start: 1px solid var(--line-2); }
.comp-facts div:first-child { border-inline-start: 0; }
.comp-facts small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.comp-facts small [data-lucide], .comp-facts small svg.lucide { width: 14px; height: 14px; }
.comp-facts strong { display: block; font-size: 15px; margin-top: 3px; }
.comp-facts strong.big { font-family: var(--font-display); font-size: 22px; line-height: 1.3; }

.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.school-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: all .18s; cursor: pointer; }
.school-card:hover { box-shadow: var(--shadow); border-color: var(--g-200); }
.school-card .sc-head { display: flex; gap: 12px; align-items: flex-start; }
.school-card .sc-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--g-50); color: var(--g-700); flex-shrink: 0; }
.school-card h4 { font-size: 14.8px; font-family: var(--font); font-weight: 700; line-height: 1.55; }
.school-card .sc-sub { font-size: 12.5px; color: var(--muted); }
.school-card .sc-teacher { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; }
.av-sm { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.school-card .sc-teacher strong { display: block; font-size: 13.5px; line-height: 1.4; }
.school-card .sc-teacher small { color: var(--muted); font-size: 12px; }
.school-card .sc-foot { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.avatars { display: flex; }
.avatars span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); margin-inline-start: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.avatars span:first-child { margin-inline-start: 0; }

/* school detail */
.school-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.idcard { border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 90px; }
.idcard-top { background: linear-gradient(150deg, var(--g-700), var(--g-950)); color: #fff; padding: 18px 20px 54px; position: relative; overflow: hidden; }
.idcard-top::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 70px; opacity: .1; }
.idcard-top > * { position: relative; }
.idcard-top .it-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #b9cfc5; }
.idcard-top h4 { font-size: 15px; margin-top: 10px; }
.idcard-photo { width: 92px; height: 92px; border-radius: 24px; background: linear-gradient(140deg, var(--o-500), var(--o-700)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: -46px auto 0; border: 4px solid var(--surface); position: relative; box-shadow: var(--shadow); }
.idcard-body { padding: 14px 22px 22px; text-align: center; }
.idcard-body h3 { font-size: 19px; }
.idcard-body .role { color: var(--muted); font-size: 13px; }
.idcard-fields { margin-top: 18px; display: grid; gap: 0; text-align: start; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.idcard-fields div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.idcard-fields div:last-child { border-bottom: 0; }
.idcard-fields span { color: var(--muted); }
.idcard-fields b { font-weight: 600; text-align: end; }
.idcard-actions { display: flex; gap: 8px; margin-top: 16px; }
.idcard-actions .btn { flex: 1; }

.stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.stucard { border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); position: relative; transition: all .18s; }
.stucard:hover { box-shadow: var(--shadow); }
.stucard-top { height: 64px; background: var(--sport, var(--g-700)); position: relative; overflow: hidden; padding: 10px 14px; color: #fff; display: flex; justify-content: space-between; font-size: 11.5px; }
.stucard-top::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 56px; opacity: .16; }
.stucard-top > * { position: relative; }
.stucard-top b { font-size: 12px; }
.stucard-photo { width: 64px; height: 64px; border-radius: 18px; margin: -34px 14px 0; position: relative; border: 3px solid var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 21px; box-shadow: var(--shadow-sm); }
.stucard-body { padding: 8px 14px 14px; }
.stucard-body h5 { font-size: 15px; font-family: var(--font-display); margin: 0; line-height: 1.5; }
.stucard-body .massar { font-size: 12.5px; color: var(--muted); font-family: 'Segoe UI', monospace; letter-spacing: .5px; }
.stucard-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.stucard-fields div { background: var(--surface-2); border-radius: 10px; padding: 6px 10px; }
.stucard-fields small { display: block; font-size: 11px; color: var(--muted); }
.stucard-fields b { font-size: 13px; font-weight: 600; }
.stucard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.qr { width: 38px; height: 38px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.qr i { background: var(--ink); border-radius: 1px; }
.qr i.o { background: transparent; }
.stucard .stu-actions { position: absolute; top: 8px; inset-inline-end: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; z-index: 2; }
.stucard:hover .stu-actions { opacity: 1; }
.stu-actions .btn-icon { background: rgba(255, 255, 255, .92); color: var(--ink-2); width: 30px; height: 30px; border-radius: 9px; border: 0; }
.stu-actions .btn-icon:hover { background: #fff; color: var(--r-600); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.8px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .who { display: flex; align-items: center; gap: 10px; }

/* activities timeline */
.timeline { display: grid; gap: 22px; }
.tl-month { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }
.tl-label { position: sticky; top: 90px; align-self: start; }
.tl-label strong { display: block; font-family: var(--font-display); font-size: 20px; color: var(--g-900); }
.tl-label small { color: var(--muted); font-size: 12.5px; }
.tl-items { display: grid; gap: 10px; border-inline-start: 2px solid var(--line); padding-inline-start: 20px; position: relative; }
.tl-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; position: relative; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: -28px; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--lvl, var(--g-600)); transform: translateY(-50%); }
.tl-item.past { opacity: .72; }
.tl-item .meta { flex: 1; min-width: 0; }
.tl-item strong { display: block; font-size: 14.5px; line-height: 1.55; }
.tl-item small { color: var(--muted); font-size: 12.8px; display: inline-flex; align-items: center; gap: 5px; }
.tl-item small [data-lucide], .tl-item small svg.lucide { width: 14px; height: 14px; }
.tl-item .tl-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tl-empty { color: var(--faint); font-size: 13px; padding: 10px 0; }

/* provinces page */
.prov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.prov-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.prov-card-top { padding: 18px 20px; color: #fff; position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; }
.prov-card-top::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); background-size: 70px; opacity: .12; }
.prov-card-top > * { position: relative; }
.prov-card-top .pin { width: 44px; height: 44px; border-radius: 13px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.prov-card-top h4 { font-size: 18px; }
.prov-card-top small { color: rgba(255, 255, 255, .8); font-size: 12.5px; }
.prov-card-body { padding: 16px 20px 20px; display: grid; gap: 14px; }
.prov-admin { display: flex; align-items: center; gap: 12px; }
.prov-admin strong { display: block; font-size: 14px; }
.prov-admin small { color: var(--muted); font-size: 12.5px; }
.prov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prov-stats div { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.prov-stats b { display: block; font-family: var(--font-display); font-size: 19px; color: var(--g-900); }
.prov-stats small { color: var(--muted); font-size: 11.8px; }
.perm-list { display: grid; gap: 6px; font-size: 13px; }
.perm-list div { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.perm-list [data-lucide], .perm-list svg.lucide { width: 15px; height: 15px; }
.perm-list .yes { color: var(--g-600); }
.perm-list .ro { color: var(--b-600); }

/* empty */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; background: var(--line-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }
.empty .ic [data-lucide], .empty .ic svg.lucide { width: 28px; height: 28px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7, 26, 19, .48); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s ease; }
.modal { background: var(--surface); border-radius: 22px; width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: popIn .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(780px, 100%); }
.modal.narrow { width: min(440px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--g-50); color: var(--g-700); }
.modal-head h3 { font-size: 17px; }
.modal-head small { color: var(--muted); font-size: 12.8px; display: block; }
.modal-head .btn-icon { margin-inline-start: auto; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-end-start-radius: 22px; border-end-end-radius: 22px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 300; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--g-950); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; animation: popIn .25s ease; max-width: 400px; }
.toast .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--g-600); flex-shrink: 0; }
.toast.info .ic { background: var(--b-600); }
.toast.warn .ic { background: var(--o-600); }
.toast.error .ic { background: var(--r-600); }
.toast [data-lucide], .toast svg.lucide { width: 16px; height: 16px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }

.sb-overlay { display: none; }

/* ---------- البنيات: الجمعيات، المراكز، رياضة ودراسة ---------- */
/* ---------- البطولات الرياضية المدرسية ---------- */
.level-tabs { grid-template-columns: repeat(4, 1fr); }
.level-tabs.pub-levels { grid-template-columns: repeat(3, 1fr); }
.level-tab strong { font-size: 14.5px; }
.comp-tabs { display: flex; gap: 4px; background: var(--line-2); border-radius: 14px; padding: 5px; margin: 0 0 18px; overflow-x: auto; }
.comp-tabs button { flex: 1; border: 0; background: transparent; height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.comp-tabs button.active { background: var(--surface); color: var(--g-800); box-shadow: var(--shadow-sm); }
.comp-tabs svg.lucide { width: 16px; height: 16px; }
.comp-facts small + small { display: block; }

.prog { display: grid; gap: 16px; }
.prog-day { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; }
.prog-date { display: flex; align-items: center; gap: 10px; align-self: start; }
.prog-date b { font-size: 13.5px; color: var(--g-900); }
.prog-items { display: grid; gap: 6px; border-inline-start: 2px solid var(--g-200); padding-inline-start: 16px; }
.prog-item { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; }
.prog-item > span { font-weight: 700; color: var(--o-700); min-width: 46px; font-size: 13.5px; }
.prog-item p { flex: 1; font-size: 14px; color: var(--ink-2); }

.stat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stat-tiles > div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; text-align: center; }
.stat-tiles span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--g-50); color: var(--g-700); }
.stat-tiles span svg.lucide { width: 17px; height: 17px; }
.stat-tiles b { display: block; font-family: var(--font-display); font-size: 22px; color: var(--g-950); line-height: 1.4; margin-top: 4px; }
.stat-tiles small { font-size: 12px; color: var(--muted); }

.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.res-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface); }
.res-card h4 { font-size: 14.5px; color: var(--g-900); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.res-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.res-row .rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line-2); color: var(--ink-2); flex-shrink: 0; font-size: 13px; }
.res-row .meta { flex: 1; min-width: 0; }
.res-row b { display: block; font-size: 13.8px; font-weight: 600; }
.res-row small { color: var(--muted); font-size: 12px; }

.media-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.poster-box { border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.poster-svg, .poster-img { display: block; width: 100%; height: auto; border-radius: 16px; }
.poster-img { aspect-ratio: 3 / 4; object-fit: cover; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; background: var(--line-2); }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-grid figcaption { font-size: 12.3px; padding: 8px 10px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 14px 14px; }
.photo-del { position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: var(--r-600); }
.img-missing { opacity: .25; }

.champ-intro { font-size: 16px !important; line-height: 2 !important; max-width: 920px !important; color: var(--ink-2) !important; }
.axes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.axis-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: all .2s; position: relative; overflow: hidden; }
.axis-card::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.axis-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.axis-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.axis-card h4 { font-size: 15.5px; color: var(--g-950); }
.axis-card p { font-size: 13.5px; color: var(--muted); line-height: 1.85; }
.axis-card .more { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--g-700); display: inline-flex; align-items: center; gap: 4px; }
.axis-card .more svg.lucide { width: 15px; height: 15px; }

.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.champ-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; transition: all .2s; }
.champ-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--g-200); }
.champ-poster .poster-thumb { width: 100%; height: auto; display: block; border-radius: 12px; aspect-ratio: 3 / 4; object-fit: cover; }
.champ-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ-body .status { align-self: flex-start; }
.champ-body h4 { font-size: 14.5px; line-height: 1.6; color: var(--g-950); font-family: var(--font); font-weight: 700; }
.champ-body small { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.champ-body small svg.lucide { width: 14px; height: 14px; flex-shrink: 0; }
.champ-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.champ-foot b { color: var(--ink); }
.pub-season { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; display: inline-flex !important; }
.pub-season select { color: #fff; }
.pub-season select option { color: var(--ink); }
.champ-detail { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: -28px; position: relative; }
.champ-side { position: sticky; top: 96px; }
.art-meta .status { height: 26px; }
@media (max-width: 1024px) {
  .level-tabs, .level-tabs.pub-levels { grid-template-columns: 1fr 1fr; }
  .media-layout, .champ-detail { grid-template-columns: 1fr; }
  .champ-side { position: static; max-width: 320px; }
  .axes-grid { grid-template-columns: 1fr 1fr; }
  .stat-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .level-tabs, .level-tabs.pub-levels, .axes-grid { grid-template-columns: 1fr; }
  .prog-day { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .champ-grid { grid-template-columns: 1fr; }
  .champ-card { grid-template-columns: 96px minmax(0, 1fr); }
}
.page-actions { align-items: center; }
.vis-select { width: auto !important; min-width: 150px; height: 34px !important; font-size: 12.8px; padding-inline-start: 10px; border-radius: 9px; flex-shrink: 0; }
.row .badge { flex-shrink: 0; }
.vis-legend { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; color: var(--ink-2); line-height: 2.1; }
.vis-legend > svg.lucide { color: var(--g-600); margin-top: 6px; flex-shrink: 0; }
.page-actions .select { width: auto; min-width: 180px; height: 42px; }
.struct-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.struct-tile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; transition: all .18s; }
.struct-tile:hover { border-color: var(--g-200); box-shadow: var(--shadow); }
.struct-tile .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.struct-tile div { flex: 1; min-width: 0; }
.struct-tile small { display: block; font-size: 12.8px; color: var(--muted); }
.struct-tile b.num { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1.3; color: var(--g-950); }
.struct-tile span { font-size: 12.3px; color: var(--muted); }
.struct-tile span b { color: var(--ink); }
.struct-tile .go { color: var(--faint); width: 18px; height: 18px; }
@media (max-width: 1024px) { .struct-strip { grid-template-columns: 1fr; } }
.readonly-banner.demo { background: var(--o-50); border-color: var(--o-100); color: #6b4a26; }
.readonly-banner.demo > svg.lucide, .readonly-banner.demo > [data-lucide] { color: var(--o-600); flex-shrink: 0; }
.data-table.matrix th, .data-table.matrix td { text-align: center; }
.data-table.matrix th:first-child, .data-table.matrix td:first-child { text-align: start; font-weight: 600; }
.data-table.matrix tr.total td { background: var(--g-50); font-weight: 700; color: var(--g-900); border-top: 2px solid var(--g-200); }
.data-table tr.clickable { cursor: pointer; transition: background .12s; }
.data-table tr.clickable:hover td { background: #fcfbf8; }
.data-table td small { font-size: 11.8px; }
.file-ic.img { background: linear-gradient(160deg, #8a5cc7, #5b3a94); }

.fee-dist { display: grid; gap: 8px; }
.fee-dist > div { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.fee-dist > div:first-child { background: var(--g-50); border-color: var(--g-200); }
.fd-pct { font-family: var(--font-display); font-weight: 700; color: var(--g-700); font-size: 15px; }
.fd-label { font-size: 13.5px; color: var(--ink-2); }
.fee-dist b { font-size: 14px; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.info-grid > div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; }
.info-grid small { display: block; font-size: 12px; color: var(--muted); }
.info-grid b { font-size: 14px; font-weight: 600; }
.modal-sub { font-size: 14.5px; margin: 20px 0 10px; color: var(--g-900); }
.steps-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps-check li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.steps-check li svg.lucide { color: var(--faint); margin-top: 3px; width: 16px; height: 16px; }
.steps-check li.ok { color: var(--ink-2); }
.steps-check li.ok svg.lucide { color: var(--g-600); }

.centre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.centre-card { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.cc-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.cc-head h4 { font-size: 15px; font-family: var(--font); font-weight: 700; line-height: 1.55; }
.cc-head small { font-size: 12.5px; }
.lv-bars { display: grid; gap: 6px; }
.lv-row { display: grid; grid-template-columns: 56px 1fr 34px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.lv-track { position: relative; height: 14px; }
.lv-fill, .lv-girls { position: absolute; inset-inline-start: 0; top: 0; height: 14px; border-radius: 3px; }
.lv-fill { background: var(--o-200); }
.lv-girls { background: var(--p-600); height: 6px; top: 4px; border-radius: 3px; }
.lv-row b { text-align: end; font-size: 12.5px; }
.lv-legend { display: flex; gap: 14px; font-size: 11.8px; color: var(--muted); margin: 6px 0 10px; }
.lv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.cc-stats > div { background: var(--surface-2); border-radius: 12px; padding: 8px; text-align: center; }
.cc-stats b { display: block; font-family: var(--font-display); font-size: 17px; color: var(--g-900); }
.cc-stats small { font-size: 11.5px; color: var(--muted); }
.feeders { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; line-height: 2; }
.feeders small { display: inline-flex; align-items: center; gap: 4px; }
.feeders small svg.lucide { width: 14px; height: 14px; }
.lv-inputs { display: grid; gap: 6px; }
.lv-inputs > div { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; align-items: center; font-size: 13.5px; }
.lv-inputs .lv-h { font-size: 12px; color: var(--muted); font-weight: 600; }
.lv-inputs .input { height: 38px; }
.se-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
.art-lib .row { padding: 10px 0; }
.art-lib .row strong { font-size: 14px; }
@media (max-width: 680px) {
  .info-grid { grid-template-columns: 1fr; }
  .lib-grid, .centre-grid, .se-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .ref-grid { grid-template-columns: repeat(3, 1fr); }
  .struct-grid { grid-template-columns: repeat(2, 1fr); }
  .prov-grid { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .comp-facts { grid-template-columns: repeat(3, 1fr); }
  .comp-facts div:nth-child(4) { border-inline-start: 0; }
  .comp-facts div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
  .tb-switch span { display: none; }
}
@media (max-width: 1024px) {
  .pub-links { display: none; }
  .pub-menu-btn { display: inline-flex; }
  .pub-links.open { display: flex; flex-direction: column; position: absolute; top: 76px; inset-inline: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); align-items: stretch; }
  .hero .wrap { grid-template-columns: 1fr; padding: 60px 0 80px; }
  .welcome { grid-template-columns: 1fr; }
  .welcome-visual { max-width: 520px; }
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .proj.big { grid-column: 1 / -1; grid-row: auto; }
  .pub-comps { grid-template-columns: 1fr 1fr; }
  .pub-docs { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }

  .shell { grid-template-columns: 1fr; }
  html, body { overflow-x: hidden; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 286px; z-index: 90; transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
  .shell.sb-open .sidebar { transform: none; visibility: visible; }
  .shell.sb-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(7, 26, 19, .45); z-index: 80; }
  .sb-toggle { display: inline-flex; }
  .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
  .school-layout { grid-template-columns: 1fr; }
  .idcard { position: static; }
  .level-tabs { grid-template-columns: 1fr; }
  .tb-season { display: none; }
}
@media (max-width: 680px) {
  .topstrip { display: none; }
  .ref-grid, .struct-grid, .proj-grid, .pub-comps, .prov-grid, .footer-grid, .missions { grid-template-columns: 1fr; }
  .struct.wide { grid-column: auto; flex-direction: column; align-items: flex-start; }
  .prov { aspect-ratio: auto; min-height: 170px; }
  .section { padding: 64px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 28px; }
  .hero-stats strong { font-size: 24px; }
  .wrap { width: calc(100% - 32px); }
  .brand-text small { display: none; }
  .page { padding: 18px 16px; }
  .topbar { padding: 0 16px; gap: 8px; }
  .tb-switch { display: none; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .bar-row { grid-template-columns: 72px minmax(0, 1fr) 40px; gap: 8px; }
  .kpi .value { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .input-icon { width: 100%; }
  .comp-facts { grid-template-columns: 1fr 1fr; }
  .comp-facts div { border-inline-start: 0 !important; border-top: 1px solid var(--line-2); }
  .comp-hero-band { flex-wrap: wrap; }
  .comp-hero-band .chb-actions { margin-inline-start: 0; }
  .tl-month { grid-template-columns: 1fr; gap: 8px; }
  .tl-label { position: static; }
  .tl-item { flex-wrap: wrap; }
  .welcome-banner { flex-direction: column; align-items: flex-start; }
  .comp-grid { grid-template-columns: 1fr; }
}

/* ---------- Print (student cards) ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-head, .toolbar, .idcard, .no-print, .stu-actions, #toast-root, .readonly-banner { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; }
  .school-layout { display: block; }
  .stu-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stucard { break-inside: avoid; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stucard-top, .stucard-photo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ==========================================================
   إدارة الموقع
   ========================================================== */
.cms-card + .cms-card { margin-top: 18px; }
.cms-head-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cms-status { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--g-50); color: var(--g-700); font-size: 13px; font-weight: 600; border: 1px solid var(--g-100, #d5ebe0); }
.cms-status.dirty { background: var(--o-50); color: var(--o-700); border-color: var(--o-100); }
.cms-status svg.lucide { width: 15px; height: 15px; }
.cms-list { display: flex; flex-direction: column; gap: 8px; }
.cms-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; flex-wrap: wrap; }
.cms-row:hover { border-color: var(--g-200); box-shadow: var(--shadow-sm); }
.cms-row.is-open { border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(29, 143, 105, .1); }
.cms-row.is-hidden { background: var(--surface-2); }
.cms-row.is-hidden .meta, .cms-row.is-hidden .cms-ic { opacity: .55; }
.cms-row .meta { flex: 1; min-width: 160px; }
.cms-row .meta strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cms-row .meta small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cms-ord { width: 26px; text-align: center; font-size: 12px; color: var(--faint); font-weight: 700; flex-shrink: 0; }
.cms-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--g-50); color: var(--g-700); display: grid; place-items: center; flex-shrink: 0; }
.cms-ic svg.lucide { width: 17px; height: 17px; }
.cms-acts { display: flex; gap: 2px; margin-inline-start: auto; }
.cms-acts .btn[disabled] { opacity: .3; pointer-events: none; }
.cms-danger { color: var(--r-600) !important; }
.cms-danger:hover { background: var(--r-50) !important; }
.cms-add { margin-top: 12px; }
.cms-sub { margin: -2px 26px 6px 0; padding: 14px; border-inline-start: 3px solid var(--g-200); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.cms-empty { color: var(--faint); font-size: 13px; padding: 10px 4px; }
.cms-group-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--g-800); margin: 14px 2px 2px; display: flex; align-items: center; gap: 8px; }
.cms-group-title:first-child { margin-top: 0; }
.cms-group-title .num { font-size: 11.5px; background: var(--line-2); color: var(--muted); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.cms-dgroup { border: 1px dashed var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cms-dgroup + .cms-dgroup { margin-top: 12px; }
.cms-dgroup-head { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.cms-role { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; user-select: none; }
.cms-role input { accent-color: var(--g-600, #157555); width: 15px; height: 15px; }
.cms-role:has(input:disabled) { opacity: .55; cursor: default; }
.cms-hero-prev { background: linear-gradient(150deg, var(--g-800), var(--g-950)); color: #fff; border-radius: 16px; padding: 18px 20px; }
.cms-hero-prev small { color: #9fd8bf; font-size: 12.5px; }
.cms-hero-prev b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.6; margin: 6px 0; }
.cms-hero-prev b em { font-style: normal; color: var(--o-500); }
.cms-hero-prev p { font-size: 13.5px; color: #cfe6dc; line-height: 1.8; }
.cms-brand-prev { display: flex; align-items: center; gap: 14px; }
.cms-brand-prev .brand-mark { width: 52px; height: 52px; }
.cms-brand-prev b { display: block; font-family: var(--font-display); font-size: 17px; color: var(--g-950); }
.cms-brand-prev small { display: block; color: var(--muted); font-size: 12.5px; }
.cms-notices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cms-notices > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.cms-notices small { color: var(--muted); font-size: 12px; font-weight: 600; }
.cms-notices p { font-size: 14px; color: var(--ink-2); margin-top: 4px; white-space: pre-line; }
.cms-notice { background: var(--o-50); border-color: var(--o-100); color: #6b4a26; }
.cms-notice .ic { color: var(--o-600); }
.cms-pubstate { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--g-50); border: 1px solid var(--g-200); flex-wrap: wrap; }
.cms-pubstate.dirty { background: var(--o-50); border-color: var(--o-100); }
.cms-pubstate .ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; color: var(--g-700); flex-shrink: 0; }
.cms-pubstate.dirty .ic { color: var(--o-600); }
.cms-pubstate > div { flex: 1; min-width: 200px; }
.cms-pubstate b { display: block; font-size: 14.5px; }
.cms-pubstate small { color: var(--muted); font-size: 12.5px; }
.cms-howto { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.cms-howto li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.cms-howto li > svg.lucide { width: 18px; height: 18px; color: var(--g-600, #157555); flex-shrink: 0; margin-top: 4px; }
.cms-howto code, .hint code { direction: ltr; unicode-bidi: embed; background: var(--line-2); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }
.muted { color: var(--muted); }

/* حقول النماذج */
.cms-link { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 8px; }
.cms-link [hidden], .rte [hidden] { display: none !important; }
.cms-icon-field { display: flex; gap: 8px; align-items: center; }
.cms-icon-prev { width: 44px; height: 44px; border-radius: 12px; background: var(--g-50); color: var(--g-700); display: grid; place-items: center; flex-shrink: 0; }
.cms-color { padding: 4px; height: 44px; cursor: pointer; }
.cms-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; padding-top: 6px; }
.cms-check input { width: 17px; height: 17px; accent-color: var(--g-600, #157555); }
.modal.cms-wide { width: min(920px, 100%); }
.rte { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.rte:focus-within { border-color: var(--g-500); box-shadow: 0 0 0 4px rgba(29, 143, 105, .12); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.rte-bar button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.rte-bar button:hover, .rte-bar button.on { background: var(--surface); color: var(--g-700); box-shadow: var(--shadow-sm); }
.rte-bar button svg.lucide { width: 16px; height: 16px; }
.rte-area { min-height: 140px; max-height: 420px; overflow-y: auto; padding: 14px 16px; outline: none; }
.rte-area h3 { font-size: 17px; color: var(--g-900, #0e4635); margin: 10px 0 6px; }
.rte-area ul, .rte-area ol, .cms-html ul, .cms-html ol { padding-inline-start: 22px; line-height: 1.9; }
.rte-area blockquote, .cms-html blockquote:not(.legal) { border-inline-start: 4px solid var(--o-500); background: var(--o-50); padding: 10px 14px; border-radius: 10px; margin: 10px 0; }
.rte-area a, .cms-html a { color: var(--g-700); text-decoration: underline; }
.rte-src { border: 0; border-radius: 0; min-height: 220px; font-family: Consolas, monospace; font-size: 12.5px; }
.cms-html h3 { font-size: 18px; color: var(--g-950); margin: 18px 0 8px; }
.cms-secs-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--g-800); margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.cms-secs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.cms-sec { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--surface-2); }
.cms-sec-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cms-sec-head .num { width: 32px; height: 32px; border-radius: 9px; background: var(--g-50); color: var(--g-700); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.cms-sec-head .input { flex: 1; font-weight: 600; }

/* أدوات التحرير في الواجهة العامة */
.section, .art-hero { position: relative; }
.cms-pin { position: absolute; top: 28px; left: max(20px, calc((100% - 1200px) / 2)); z-index: 5; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--g-800); border: 1px solid var(--g-200); font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-sm); opacity: .75; transition: opacity .15s, transform .15s; }
.cms-pin:hover { opacity: 1; transform: translateY(-1px); }
.cms-pin svg.lucide { width: 14px; height: 14px; }
.hero .cms-pin { top: 0; left: auto; position: relative; margin-bottom: 12px; }
.art-hero .cms-pin { top: 18px; }
.cms-bar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--g-950); color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: calc(100vw - 24px); }
.cms-bar > svg.lucide { width: 18px; height: 18px; color: #7fd3ad; }
.cms-dot { background: var(--o-500); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
@media (max-width: 680px) {
  .cms-link, .cms-notices { grid-template-columns: 1fr; }
  .cms-row .meta { min-width: 0; flex-basis: calc(100% - 90px); }
  .cms-acts { margin-inline-start: 0; }
  .cms-sub { margin-inline-end: 0; }
  .cms-bar > span:not(.cms-dot) { display: none; }
}
@media print { .cms-pin, .cms-bar { display: none !important; } }
/* القائمة الجانبية لفضاء المديريات الإقليمية: لون برتقالي */
.sidebar.sb-prov { background: linear-gradient(180deg, #b0601d 0%, #8a4614 55%, #6a340e 100%); color: #fbe3cb; }
.sidebar.sb-prov::before { opacity: .06; }
.sb-prov .sb-brand { border-bottom-color: rgba(255, 255, 255, .14); }
.sb-prov .sb-brand .brand-text small, .sb-prov .sb-role small { color: #f6cfa8; }
.sb-prov .sb-role { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); }
.sb-prov .sb-role .av { background: var(--g-800); }
.sb-prov .sb-group-title { color: #f3c393; }
.sb-prov .sb-link { color: #fde9d6; }
.sb-prov .sb-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sb-prov .sb-link.active { background: rgba(255, 255, 255, .18); color: #fff; }
.sb-prov .sb-link.active::before { background: #fff; }
.sb-prov .sb-link.active [data-lucide], .sb-prov .sb-link.active svg.lucide { color: #fff; }
.sb-prov .sb-link .count { background: rgba(255, 255, 255, .16); color: #fff; }
.sb-prov .sb-link .lock { color: #f3c393; }
.sb-prov .sb-foot { border-top-color: rgba(255, 255, 255, .14); }
.sb-prov .sb-nav { scrollbar-color: rgba(255, 255, 255, .25) transparent; }