/* ==========================================================================
   Itqan Design System — the formal visual identity shared by the foundation's
   sites (foundation portal, centers, Sheikh Yahya heritage center).
   Each site may override --accent / --accent-ink only.
   ========================================================================== */

:root {
  --green-950: #0d2a20;
  --green-900: #12352a;
  --green-800: #1f4d3a;
  --green-700: #2b6350;
  --green-100: #e6efe9;
  --gold-700: #8a6d3b;
  --gold-600: #a8874f;
  --gold-500: #b9975b;
  --gold-200: #e9dcc3;
  --gold-100: #f5eee1;
  --ivory: #faf8f3;
  --paper: #ffffff;
  --ink: #1b2420;
  --ink-2: #33403a;
  --muted: #5e6a64;
  --line: #e4dfd3;
  --line-strong: #cfc7b5;
  --danger: #9b2c2c;
  --success: #276749;

  --accent: var(--green-800);
  --accent-ink: #ffffff;

  --font-display: "Amiri", "Times New Roman", serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(18, 53, 42, .06);
  --shadow: 0 6px 24px -12px rgba(18, 53, 42, .25);
  --container: 1200px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--ivory);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-800); text-decoration: none; }
a:hover { color: var(--gold-700); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--green-900); line-height: 1.35; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 84px; }
.section--tight { padding-block: 56px; }
.section--paper { background: var(--paper); }
.section--tint { background: var(--gold-100); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- section heading ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
  color: var(--gold-700); text-transform: none; margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold-500); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.rule { width: 56px; height: 3px; background: var(--gold-500); border: 0; margin: 14px 0 22px; }
.section-head--center .rule { margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1;
  padding: 14px 24px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s; white-space: nowrap;
}
.btn--primary { background: var(--green-800); color: #fff; }
.btn--primary:hover { background: var(--green-900); color: #fff; }
.btn--gold { background: var(--gold-500); color: var(--green-950); }
.btn--gold:hover { background: var(--gold-600); color: var(--green-950); }
.btn--outline { border-color: var(--line-strong); color: var(--green-900); background: transparent; }
.btn--outline:hover { border-color: var(--green-800); color: var(--green-800); }
.btn--ghost-light { border-color: rgba(255,255,255,.45); color: #fff; }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.btn--sm { padding: 10px 16px; font-size: .88rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--green-800); }
.link-arrow i { transition: transform .2s; }
.link-arrow:hover i { transform: translateX(-4px); }
[dir="ltr"] .link-arrow:hover i { transform: translateX(4px); }

/* ---------- top bar & header ---------- */
.topbar { background: var(--green-950); color: rgba(255,255,255,.78); font-size: .84rem; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.topbar a { color: rgba(255,255,255,.85); }
.topbar a:hover { color: var(--gold-200); }
.topbar__info, .topbar__end { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar__info span, .topbar__info a { display: inline-flex; align-items: center; gap: 8px; }
.topbar i { color: var(--gold-500); }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { padding: 2px 8px; border-radius: var(--radius-sm); }
.lang-switch a.is-active { background: rgba(255,255,255,.12); color: #fff; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.site-header .container { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--green-900); flex-shrink: 0; }
.brand img { width: 50px; height: 50px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; white-space: nowrap; }
.brand__sub { font-size: .76rem; color: var(--muted); white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a, .nav__drop > button {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px;
  color: var(--ink-2); font-weight: 500; font-size: .95rem; white-space: nowrap;
  background: none; border: 0; font-family: inherit; cursor: pointer; border-radius: var(--radius-sm);
  position: relative;
}
.nav a:hover, .nav__drop > button:hover { color: var(--green-800); background: var(--green-100); }
.nav a.is-active { color: var(--green-800); }
.nav a.is-active::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 2px; height: 2px; background: var(--gold-500);
}
.nav a.btn--primary, .nav a.btn--primary:hover { background: var(--green-800); color: #fff; }
.nav a.btn--primary:hover { background: var(--green-900); }
.nav__drop { position: relative; }
.nav__menu {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 280px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; display: none;
}
.nav__drop:hover .nav__menu, .nav__drop:focus-within .nav__menu, .nav__drop.is-open .nav__menu { display: block; }
.nav__menu a { display: flex; width: 100%; padding: 10px 12px; gap: 12px; white-space: normal; }
.nav__menu a i { width: 20px; color: var(--gold-600); }
.nav__menu small { display: block; color: var(--muted); font-size: .78rem; }
.header-cta { flex-shrink: 0; }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); width: 44px; height: 44px; font-size: 1.1rem; color: var(--green-900); cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background-color: var(--green-900);
  background-image:
    linear-gradient(90deg, rgba(13,42,32,.96) 0%, rgba(18,53,42,.88) 55%, rgba(31,77,58,.8) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23b9975b' stroke-opacity='.16' stroke-width='1'%3E%3Cpath d='M40 4l10 26 26 10-26 10-10 26-10-26L4 40l26-10z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; padding-block: 96px 104px; }
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero__tag { display: inline-flex; align-items: center; gap: 10px; color: var(--gold-200); font-weight: 600; font-size: .9rem; margin-bottom: 18px; }
.hero__tag::before { content: ""; width: 36px; height: 2px; background: var(--gold-500); }
.hero__lead { font-size: 1.15rem; color: rgba(255,255,255,.86); max-width: 620px; margin-bottom: 34px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__emblem {
  justify-self: center; width: min(320px, 100%); aspect-ratio: 1;
  display: grid; place-items: center; padding: 34px;
  background: rgba(255,255,255,.96); border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(185,151,91,.5), 0 0 0 10px rgba(255,255,255,.06), 0 30px 60px -30px rgba(0,0,0,.6);
}
.hero__emblem img { max-height: 100%; object-fit: contain; }

.page-hero { background: var(--green-900); color: #fff; padding-block: 64px 56px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23b9975b' stroke-opacity='.12' stroke-width='1'%3E%3Cpath d='M40 4l10 26 26 10-26 10-10 26-10-26L4 40l26-10z'/%3E%3C/g%3E%3C/svg%3E"); pointer-events: none; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,.82); max-width: 680px; margin: 0; }
.breadcrumb { display: flex; gap: 8px; font-size: .85rem; color: var(--gold-200); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: rgba(255,255,255,.75); }
.breadcrumb a:hover { color: #fff; }

/* ---------- stats band ---------- */
.stats { background: var(--paper); border-bottom: 1px solid var(--line); }
.stats .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { padding: 30px 20px; text-align: center; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; }
.stat__num { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; color: var(--green-800); line-height: 1.1; }
.stat__label { color: var(--muted); font-size: .92rem; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
a.card:hover, .card--hover:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--line-strong); }
.card__media { aspect-ratio: 16/10; background: var(--gold-100); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__meta { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card__title { font-family: var(--font-display); font-size: 1.25rem; color: var(--green-900); margin: 0; line-height: 1.45; }
.card__text { color: var(--muted); font-size: .95rem; margin: 0; flex: 1; }
.card__foot { margin-top: 12px; }

/* entity cards */
.entity {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px 26px; display: flex; flex-direction: column; gap: 12px; color: inherit;
  transition: box-shadow .2s, transform .2s;
}
.entity::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--entity, var(--green-800)); border-radius: var(--radius) var(--radius) 0 0; }
a.entity:hover { box-shadow: var(--shadow); transform: translateY(-3px); color: inherit; }
.entity__icon {
  width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.4rem;
  color: var(--entity, var(--green-800)); background: var(--gold-100); border: 1px solid var(--gold-200); border-radius: var(--radius-sm);
}
.entity__name { font-family: var(--font-display); font-size: 1.35rem; color: var(--green-900); margin: 0; }
.entity__text { color: var(--muted); font-size: .94rem; flex: 1; margin: 0; }
.entity__link { font-weight: 600; color: var(--entity, var(--green-800)); display: inline-flex; gap: 8px; align-items: center; }
.entity--soon { background: linear-gradient(var(--paper), var(--paper)) padding-box; border-style: dashed; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: .76rem; font-weight: 600;
  border-radius: 999px; background: var(--gold-100); color: var(--gold-700); border: 1px solid var(--gold-200); width: fit-content;
}
.badge--green { background: var(--green-100); color: var(--green-800); border-color: #cfe0d6; }

/* about split */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.prose p { color: var(--ink-2); font-size: 1.04rem; }
.pillars { display: grid; gap: 16px; }
.pillar { background: var(--paper); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold-500); border-radius: var(--radius); padding: 22px 24px; }
.pillar h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pillar h3 i { color: var(--gold-600); font-size: 1rem; }
.pillar p { margin: 0; color: var(--muted); }
.values { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.values span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; }
.values i { color: var(--gold-600); }

/* people */
.person { text-align: center; }
.person__photo { aspect-ratio: 1; background: var(--gold-100); }
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person__body { padding: 18px 16px 20px; }
.person__name { font-family: var(--font-display); font-size: 1.15rem; color: var(--green-900); margin: 0; }
.person__role { color: var(--gold-700); font-size: .88rem; font-weight: 500; }

/* partners */
.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.partner { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); height: 110px; display: grid; place-items: center; padding: 18px; }
.partner img { max-height: 70px; width: auto; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.partner:hover img { filter: none; opacity: 1; }

/* cta band */
.cta-band { background: var(--green-800); color: #fff; border-radius: var(--radius); padding: 44px 48px; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; margin: 0 0 6px; font-size: 1.8rem; }
.cta-band p { color: rgba(255,255,255,.82); margin: 0; }

/* empty state */
.empty { text-align: center; padding: 48px 24px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty i { font-size: 2rem; color: var(--gold-500); margin-bottom: 12px; display: block; }

/* forms */
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.field input, .field textarea, .field select, .form input[type=text], .form input[type=search], .form select, .form textarea {
  width: 100%; font-family: inherit; font-size: 1rem; padding: 12px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--paper); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus, .form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 3px var(--green-100); }
.field .errorlist { color: var(--danger); font-size: .85rem; list-style: none; padding: 0; margin: 4px 0 0; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 28px; }
.toolbar input, .toolbar select { flex: 1 1 220px; font-family: inherit; font-size: .95rem; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid; }
.alert--success { background: #eef6f1; border-color: #cfe0d6; color: var(--success); }
.alert--error { background: #fbeeee; border-color: #efcaca; color: var(--danger); }

/* pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink-2); font-weight: 500; }
.pagination .is-current { background: var(--green-800); border-color: var(--green-800); color: #fff; }

/* article */
.article { max-width: 820px; margin-inline: auto; }
.article__cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; border: 1px solid var(--line); }
.article__body { font-size: 1.08rem; color: var(--ink-2); white-space: pre-line; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 28px; }
.gallery a { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; border: 1px solid var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* definition list (book details) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.facts dt { color: var(--muted); font-size: .92rem; }
.facts dd { margin: 0; font-weight: 500; }

/* contact list */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list i { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-700); border-radius: var(--radius-sm); }
.contact-list strong { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { background: var(--green-950); color: rgba(255,255,255,.72); font-size: .93rem; margin-top: 0; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-block: 64px 44px; }
.site-footer h4 { font-family: var(--font-body); color: #fff; font-size: 1rem; font-weight: 600; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid rgba(185,151,91,.35); }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--gold-200); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: #fff; }
.footer-brand img { width: 52px; height: 52px; background: #fff; border-radius: var(--radius-sm); padding: 4px; object-fit: contain; }
.footer-brand span { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.socials { display: flex; gap: 8px; margin-top: 18px; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-sm); }
.socials a:hover { border-color: var(--gold-500); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 16px; padding-block: 20px; grid-template-columns: none; font-size: .85rem; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .nav-toggle { display: grid; place-items: center; }
  .header-cta { display: none; }
  .nav {
    position: fixed; inset: calc(var(--header-h) + 40px) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 10px 20px 20px; gap: 2px; display: none; max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
  }
  .nav.is-open { display: flex; }
  .nav a, .nav__drop > button { width: 100%; justify-content: space-between; padding: 12px 10px; }
  .nav a.is-active::after { display: none; }
  .nav__menu { position: static; box-shadow: none; border: 0; padding: 0 12px 8px; display: none; }
  .nav__drop.is-open .nav__menu { display: block; }
  .nav .nav__cta, .nav a.nav__cta:hover { display: flex; margin-top: 10px; justify-content: center; background: var(--green-800); color: #fff; }
  .hero .container { grid-template-columns: 1fr; padding-block: 64px 72px; gap: 36px; }
  .hero__emblem { width: 200px; padding: 24px; order: -1; }
  .split, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .section { padding-block: 64px; }
}
@media (min-width: 961px) { .nav .nav__cta { display: none; } }
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .topbar .container { flex-wrap: wrap; justify-content: center; padding-block: 4px; gap: 4px 16px; }
  .grid--4 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
  .stat { border-inline-start: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .cta-band { padding: 32px 24px; }
  .brand__sub { display: none; }
  .brand__name { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ==========================================================================
   Portal (dashboards): sidebar layout, KPIs, tables, tabs
   ========================================================================== */
.portal { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: var(--ivory); }
.portal__side { background: var(--green-950); color: rgba(255,255,255,.8); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.portal__brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.portal__brand img { width: 40px; height: 40px; background: #fff; border-radius: var(--radius-sm); padding: 3px; object-fit: contain; }
.portal__brand strong { font-family: var(--font-display); font-size: 1.15rem; display: block; line-height: 1.2; }
.portal__brand small { color: var(--gold-200); font-size: .75rem; }
.portal__nav { display: grid; gap: 2px; }
.portal__nav .label { font-size: .72rem; color: rgba(255,255,255,.45); padding: 14px 12px 6px; letter-spacing: .03em; }
.portal__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: rgba(255,255,255,.82); font-size: .93rem; }
.portal__nav a i { width: 18px; text-align: center; color: var(--gold-500); }
.portal__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.portal__nav a.is-active { background: rgba(185,151,91,.18); color: #fff; box-shadow: inset 3px 0 0 var(--gold-500); }
[dir="rtl"] .portal__nav a.is-active { box-shadow: inset -3px 0 0 var(--gold-500); }
.portal__main { min-width: 0; display: flex; flex-direction: column; }
.portal__top { background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; position: sticky; top: 0; z-index: 20; }
.portal__top h1 { font-size: 1.4rem; margin: 0; }
.portal__user { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.portal__user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green-800); color: #fff; display: grid; place-items: center; font-weight: 600; }
.portal__body { padding: 28px; display: grid; gap: 24px; align-content: start; }
.portal__toggle { display: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 16px; }
.kpi i { width: 46px; height: 46px; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-700); border-radius: var(--radius-sm); font-size: 1.1rem; flex-shrink: 0; }
.kpi__num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--green-900); line-height: 1.1; }
.kpi__label { font-size: .84rem; color: var(--muted); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel__head h2 { font-size: 1.2rem; margin: 0; }
.panel__body { padding: 20px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: .8rem; background: var(--ivory); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf7; }
.table .num { font-variant-numeric: tabular-nums; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.status--active, .status--completed { background: #eef6f1; color: var(--success); border-color: #cfe0d6; }
.status--in_progress, .status--soon { background: var(--gold-100); color: var(--gold-700); border-color: var(--gold-200); }
.status--graduated { background: #eef1f8; color: #2c4a8a; border-color: #cdd6ea; }
.status--suspended, .status--withdrawn, .status--not_started { background: #f4f4f2; color: var(--muted); border-color: var(--line); }

.score { display: inline-flex; align-items: center; gap: 8px; }
.score__bar { width: 70px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.score__bar span { display: block; height: 100%; background: var(--green-700); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 12px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.is-active { color: var(--green-800); border-color: var(--gold-500); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--green-900); background-image: linear-gradient(135deg, rgba(13,42,32,.97), rgba(31,77,58,.92)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23b9975b' stroke-opacity='.18' stroke-width='1'%3E%3Cpath d='M40 4l10 26 26 10-26 10-10 26-10-26L4 40l26-10z'/%3E%3C/g%3E%3C/svg%3E"); }
.auth-card { width: min(440px, 100%); background: var(--paper); border-radius: var(--radius); padding: 36px 34px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); border-top: 4px solid var(--gold-500); }
.auth-card .brand { justify-content: center; margin-bottom: 24px; }

@media (max-width: 960px) {
  .portal { grid-template-columns: 1fr; }
  .portal__side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  [dir="rtl"] .portal__side { inset: 0 0 0 auto; transform: translateX(100%); }
  .portal__side.is-open { transform: none; }
  .portal__toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-sm); cursor: pointer; }
  .portal__top { padding: 12px 16px; }
  .portal__body { padding: 18px 14px; }
  .portal__user span { display: none; }
}
