/* =========================================================
   أكاديمية قيمي هويتي — Dashboard design system
   Fast by design: no backdrop blur, no heavy libraries, transform/opacity-only motion.
   Dark is the default; [data-theme="light"] switches tokens.
   ========================================================= */
:root {
  --bg: #04121c;
  --bg-2: #061a28;
  --surface: #0a2131;
  --surface-2: #0e2a3d;
  --surface-3: #13344b;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --ink: #f2ecdd;
  --ink-2: rgba(242, 236, 221, .74);
  --ink-3: rgba(242, 236, 221, .52);
  --gold: #d6b26a;
  --gold-2: #f1d99b;
  --gold-soft: rgba(214, 178, 106, .14);
  --blue: #3f8fd1;
  --blue-soft: rgba(63, 143, 209, .14);
  --green: #2bb673;
  --green-soft: rgba(43, 182, 115, .14);
  --red: #e5675f;
  --red-soft: rgba(229, 103, 95, .14);
  --amber: #e9a23b;
  --amber-soft: rgba(233, 162, 59, .15);
  --violet: #8f7ce8;
  --violet-soft: rgba(143, 124, 232, .15);
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .8);
  --r: 18px;
  --r-sm: 12px;
  --side: 268px;
  --top: 72px;
  --f-display: 'Alexandria', 'IBM Plex Sans Arabic', sans-serif;
  --f-body: 'IBM Plex Sans Arabic', 'Alexandria', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4efe4;
  --bg-2: #efe8da;
  --surface: #fffdf8;
  --surface-2: #f8f3e8;
  --surface-3: #efe7d6;
  --line: rgba(16, 36, 58, .08);
  --line-2: rgba(16, 36, 58, .14);
  --ink: #10243a;
  --ink-2: rgba(16, 36, 58, .76);
  --ink-3: rgba(16, 36, 58, .6);
  --gold: #b8892f;
  --gold-2: #7f5a1c;
  --gold-soft: rgba(184, 137, 47, .13);
  --blue: #22669a;
  --blue-soft: rgba(34, 102, 154, .1);
  --green: #1e8a53;
  --green-soft: rgba(30, 138, 83, .1);
  --red: #c4453d;
  --red-soft: rgba(196, 69, 61, .1);
  --amber: #b87612;
  --amber-soft: rgba(184, 118, 18, .12);
  --violet: #6b56c9;
  --violet-soft: rgba(107, 86, 201, .1);
  --shadow: 0 16px 34px -22px rgba(16, 36, 58, .28);
  --shadow-lg: 0 30px 60px -30px rgba(16, 36, 58, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--f-body); background: var(--bg); color: var(--ink); line-height: 1.7; font-size: 14.5px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; flex: none; }
::selection { background: var(--gold); color: #0b1f2c; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3, h4, h5 { font-family: var(--f-display); line-height: 1.35; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.gold { color: var(--gold-2); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .3s var(--ease); }
.shell.collapsed { --side: 84px; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--bg-2); border-inline-end: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; z-index: 40;
}
.side__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; min-height: 58px; }
.side__brand img { height: 40px; width: auto; }
.side__brand .logo-dark { filter: brightness(0) invert(1) sepia(.25) saturate(1.6); }
[data-theme="light"] .side__brand .logo-dark { display: none; }
.side__brand .logo-light { display: none; }
[data-theme="light"] .side__brand .logo-light { display: block; }
.side__role { font-family: var(--f-display); font-size: 11.5px; color: var(--gold-2); background: var(--gold-soft); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.side__label { font-family: var(--f-display); font-size: 11.5px; color: var(--ink-3); padding: 14px 12px 6px; letter-spacing: .02em; white-space: nowrap; }
.nav-i {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  font-family: var(--f-display); font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-i svg { width: 20px; height: 20px; }
.nav-i:hover { background: var(--surface); color: var(--ink); }
.nav-i.on { background: var(--gold-soft); color: var(--gold-2); }
.nav-i.on::before { content: ''; position: absolute; inset-inline-start: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--gold); }
.nav-i .badge { margin-inline-start: auto; }
.shell.collapsed .nav-i span, .shell.collapsed .side__label, .shell.collapsed .side__role, .shell.collapsed .nav-i .badge, .shell.collapsed .side__card { display: none; }
.shell.collapsed .nav-i { justify-content: center; }
.shell.collapsed .side__brand img.logo-dark, .shell.collapsed .side__brand img.logo-light { height: 34px; }
.side__foot { margin-top: auto; display: grid; gap: 8px; padding-top: 14px; }
.side__card { padding: 16px; border-radius: 16px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.side__card b { font-family: var(--f-display); font-size: 13.5px; display: block; margin-bottom: 4px; }
.side__card p { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-bottom: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line);
}
.top__title h1 { font-size: 19px; }
.top__title p { font-size: 12.5px; color: var(--ink-3); }
.top__search {
  margin-inline-start: auto; display: flex; align-items: center; gap: 10px; width: min(360px, 34vw);
  padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px;
}
.top__search kbd { margin-inline-start: auto; font-family: var(--f-display); font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); direction: ltr; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--gold-2); border-color: var(--gold); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface); }
.menu-btn { display: none; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 14px; }
.me:hover { background: var(--surface); }
.me b { font-family: var(--f-display); font-size: 13.5px; display: block; line-height: 1.3; }
.me span { font-size: 12px; color: var(--ink-3); }
.view { padding: 26px 28px 60px; display: grid; gap: 22px; align-content: start; animation: view-in .35s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Avatars ---------- */
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-family: var(--f-display); font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--green)); overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid var(--surface); margin-inline-start: -10px; }
.av-stack .av:first-child { margin-inline-start: 0; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__h h3 { font-size: 15.5px; display: flex; align-items: center; gap: 10px; }
.card__h h3 svg { color: var(--gold); width: 18px; height: 18px; }
.card__h .link { font-family: var(--f-display); font-size: 12.5px; color: var(--gold-2); }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
.span-2 { grid-column: span 2; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; display: grid; gap: 6px; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.kpi__ico svg { width: 20px; height: 20px; }
.kpi__label { font-size: 13px; color: var(--ink-3); }
.kpi__val { font-family: var(--f-display); font-weight: 800; font-size: 28px; line-height: 1.15; }
.kpi__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.kpi .spark { width: 96px; height: 34px; }
.t-gold { background: var(--gold-soft); color: var(--gold-2); }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-green { background: var(--green-soft); color: var(--green); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-violet { background: var(--violet-soft); color: var(--violet); }
.delta { font-family: var(--f-display); font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 99px; direction: ltr; }
.delta.up { color: var(--green); background: var(--green-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-display); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live i { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px; font-family: var(--f-display); font-weight: 600; font-size: 13.5px; transition: transform .15s, background .2s, border-color .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(135deg, #efd89e, #cfa653); color: #10243a; box-shadow: 0 10px 24px -12px rgba(214, 178, 106, .7); }
.btn-gold:hover { box-shadow: 0 14px 30px -12px rgba(214, 178, 106, .9); }
.btn-ghost { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-soft { background: var(--gold-soft); color: var(--gold-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field > label { font-family: var(--f-display); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line-2); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.input.ltr { direction: ltr; text-align: left; }
.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; top: 50%; inset-inline-start: 14px; translate: 0 -50%; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.input-wrap > .input { padding-inline-start: 44px; }
.input-wrap > button { position: absolute; top: 50%; inset-inline-end: 8px; translate: 0 -50%; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); }
.hint { font-size: 12px; color: var(--ink-3); }
.err { font-size: 12px; color: var(--red); display: none; }
.field.invalid .input { border-color: var(--red); }
.field.invalid .err { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-2); transition: transform .25s var(--ease), background .2s; }
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on::after { background: #fff; transform: translateX(-18px); }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---------- Tabs / segmented ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { font-family: var(--f-display); font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 10px; color: var(--ink-2); transition: background .2s, color .2s; }
.tabs button.on { background: var(--surface-2); color: var(--gold-2); box-shadow: var(--shadow); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: start; font-family: var(--f-display); font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 12px 14px; background: var(--bg-2); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.t tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.t .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.t .who b { display: block; font-family: var(--f-display); font-size: 13.5px; font-weight: 600; }
.t .who span { font-size: 12px; color: var(--ink-3); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input-wrap { flex: 1; min-width: 200px; max-width: 360px; }

/* ---------- Progress ---------- */
.bar { height: 7px; border-radius: 7px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--green)); transform-origin: right; animation: grow .8s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .ring__v { position: absolute; text-align: center; }
.ring .ring__v b { font-family: var(--f-display); font-size: 26px; font-weight: 800; display: block; line-height: 1.1; }
.ring .ring__v span { font-size: 12px; color: var(--ink-3); }

/* ---------- Lists ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; padding-top: 0; }
.li__main { min-width: 0; flex: 1; }
.li__main b { display: block; font-family: var(--f-display); font-size: 13.5px; font-weight: 600; }
.li__main span { font-size: 12.5px; color: var(--ink-3); }
.li__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.li__ico svg { width: 19px; height: 19px; }
.thumb { width: 64px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 240px; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); }
.chart .area { opacity: .9; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.donut-legend { display: grid; gap: 10px; }
.donut-legend div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.donut-legend span { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Hero banner inside dashboards ---------- */
.welcome {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  background: radial-gradient(70% 120% at 100% 0%, rgba(63, 143, 209, .28), transparent 60%), radial-gradient(60% 120% at 0% 100%, rgba(214, 178, 106, .22), transparent 60%), linear-gradient(135deg, #0f2d44, #0a1d2c);
  color: #f2ecdd; border: 1px solid rgba(241, 217, 155, .18);
}
.welcome::after { content: ''; position: absolute; inset-inline-start: -40px; bottom: -60px; width: 260px; height: 260px; background: url('/assets/img/web/emblem-gold.webp') center/contain no-repeat; opacity: .12; pointer-events: none; }
.welcome h2 { font-size: 24px; }
.welcome p { color: rgba(242, 236, 221, .75); margin-top: 4px; max-width: 60ch; }
.welcome .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.welcome .btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); color: #f2ecdd; }

/* ---------- Course cards ---------- */
.ccard { overflow: hidden; padding: 0; display: grid; grid-template-rows: auto 1fr; transition: transform .25s var(--ease), border-color .25s; }
.ccard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.ccard__img { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.ccard__img img { width: 100%; height: 100%; object-fit: cover; }
.ccard__img .badge { position: absolute; top: 12px; inset-inline-start: 12px; background: rgba(4, 18, 28, .82); color: #f1d99b; }
.ccard__b { padding: 16px 18px 18px; display: grid; gap: 10px; align-content: start; }
.ccard__b h4 { font-size: 15.5px; }
.ccard__meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Live session card ---------- */
.session { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.session__d { display: grid; justify-items: center; line-height: 1.2; padding: 8px 0; border-radius: 12px; background: var(--gold-soft); }
.session__d b { font-family: var(--f-display); font-size: 22px; color: var(--gold-2); }
.session__d span { font-size: 11px; color: var(--ink-3); }
.session__b b { display: block; font-family: var(--f-display); font-size: 14px; }
.session__b span { font-size: 12.5px; color: var(--ink-3); }
.session.is-live { border-color: rgba(229, 103, 95, .45); background: linear-gradient(135deg, var(--red-soft), var(--bg-2)); }
.zoom-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); direction: ltr; font-family: var(--f-display); }
.countdown { font-family: var(--f-display); font-weight: 700; font-size: 13px; color: var(--gold-2); direction: ltr; }

/* ---------- Empty state ---------- */
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 34px 20px; color: var(--ink-3); }
.empty svg { width: 42px; height: 42px; color: var(--gold); opacity: .8; }
.empty b { font-family: var(--f-display); color: var(--ink); font-size: 15px; }

/* ---------- Modal / drawer / toast / dropdown ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(2, 10, 16, .6); display: grid; place-items: center; padding: 20px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .28s var(--ease) both; }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal__h h3 { font-size: 17px; }
.modal__b { padding: 22px; display: grid; gap: 16px; }
.modal__f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 100; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .3s var(--ease) both; min-width: 260px; }
.toast svg { width: 20px; height: 20px; color: var(--green); }
.toast.err svg { color: var(--red); }
.dropdown { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 340px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 10px; z-index: 50; display: none; animation: pop .22s var(--ease) both; }
.dropdown.open { display: block; }
.dd-wrap { position: relative; }
.dropdown .li { padding: 10px; border-radius: 12px; border: 0; }
.dropdown .li:hover { background: var(--surface-2); }
.dropdown__h { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 10px; font-family: var(--f-display); font-size: 14px; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); color: var(--ink); }
.menu-list svg { width: 17px; height: 17px; }

/* ---------- Command palette ---------- */
.cmdk { width: min(600px, 100%); align-self: start; margin-top: 12vh; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .22s var(--ease) both; }
.cmdk input { width: 100%; padding: 18px 20px; background: transparent; border: 0; border-bottom: 1px solid var(--line); outline: none; font-size: 15px; }
.cmdk__list { max-height: 360px; overflow-y: auto; padding: 8px; }
.cmdk__list a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 14px; color: var(--ink-2); }
.cmdk__list a.on, .cmdk__list a:hover { background: var(--gold-soft); color: var(--gold-2); }
.cmdk__list svg { width: 18px; height: 18px; }

/* ---------- Calendar strip ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { display: grid; justify-items: center; gap: 2px; padding: 10px 0; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.day b { font-family: var(--f-display); font-size: 17px; color: var(--ink); }
.day.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-2); }
.day.on b { color: var(--gold-2); }
.day .dots { display: flex; gap: 3px; height: 6px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }

/* ---------- Player ---------- */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; }
.player img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.player__play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(214, 178, 106, .95); color: #10243a; box-shadow: 0 0 0 14px rgba(214, 178, 106, .2); transition: transform .2s; }
.player__play:hover { transform: scale(1.06); }
.player__play svg { width: 28px; height: 28px; margin-inline-start: -4px; }
.player__bar { position: absolute; bottom: 0; inset-inline: 0; padding: 14px 18px; display: flex; align-items: center; gap: 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: #fff; font-size: 12.5px; direction: ltr; }
.player__bar .bar { flex: 1; background: rgba(255, 255, 255, .25); }
.lessons { display: grid; gap: 4px; max-height: 460px; overflow-y: auto; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.lesson:hover { background: var(--surface-2); }
.lesson.on { background: var(--gold-soft); color: var(--gold-2); }
.lesson .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-size: 12px; background: var(--surface-3); flex: none; }
.lesson.done .n { background: var(--green-soft); color: var(--green); }
.lesson .d { margin-inline-start: auto; font-size: 12px; color: var(--ink-3); direction: ltr; }

/* ---------- Mobile bottom bar ---------- */
.bottom-bar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-main-r { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 290px; transform: translateX(100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.drawer .side { transform: none; }
  .shell.drawer::after { content: ''; position: fixed; inset: 0; background: rgba(2, 10, 16, .55); z-index: 35; }
  .shell.collapsed { --side: 268px; }
  .menu-btn { display: grid; }
  .top { padding: 0 16px; gap: 10px; }
  .top__search { display: none; }
  .top__title p { display: none; }
  .me > div { display: none; }
  .view { padding: 18px 16px 96px; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .bottom-bar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
    background: var(--bg-2); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-bar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; font-size: 11px; font-family: var(--f-display); color: var(--ink-3); }
  .bottom-bar a svg { width: 21px; height: 21px; }
  .bottom-bar a.on { color: var(--gold-2); background: var(--gold-soft); }
  .welcome { grid-template-columns: 1fr; padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 120px 1fr; }
  .dropdown { position: fixed; top: 80px; inset-inline: 12px; width: auto; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi__val { font-size: 22px; }
  .kpi .spark { display: none; }
  .card { padding: 16px; }
  .session { grid-template-columns: 54px 1fr; }
  .session > :last-child { grid-column: 1 / -1; }
  .top__title h1 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* LTR inputs (email, password, links) inside an RTL icon wrapper */
.input-wrap > .input.ltr { padding-left: 46px; padding-right: 44px; }
.input-wrap > .input.ltr:not(:has(~ button)) { padding-left: 14px; }

/* ---------- Certificate (shared with the public site) ---------- */
/* Certificate */
.cert { --c-ink: #13283a; aspect-ratio: 1.414; width: 100%; padding: 10px; border-radius: 10px; background: #f6efdc; box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .7); container-type: inline-size; }
.cert__in { position: relative; height: 100%; border: 2px solid #c9a55c; outline: 1px solid rgba(201, 165, 92, .5); outline-offset: -8px; border-radius: 6px; display: grid; justify-items: center; align-content: center; text-align: center; padding: 4% 7%; overflow: hidden; color: var(--c-ink); gap: 1.2cqw; }
.cert__wm { position: absolute; width: 58%; opacity: .07; top: 50%; left: 50%; translate: -50% -50%; filter: sepia(1) saturate(3) hue-rotate(-10deg); }
.cert__logo { width: 26%; height: auto; }
.cert__kicker { font-family: var(--f-display); font-weight: 800; font-size: 5.2cqw; color: #9a7228; line-height: 1.3; }
.cert__line { font-size: 2.3cqw; color: rgba(19, 40, 58, .7); line-height: 1.4; }
.cert__name { font-family: "Aref Ruqaa", var(--f-quran); font-size: 5.4cqw; line-height: 1.35; border-bottom: 1px solid rgba(201, 165, 92, .6); padding-inline: 6%; }
.cert__title { font-family: var(--f-display); font-weight: 800; font-size: 3.6cqw; color: #22669a; line-height: 1.4; }
.cert__foot { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; margin-top: 1.5cqw; }
.cert__meta { display: grid; gap: .2cqw; font-size: 1.8cqw; }
.cert__meta b { font-family: var(--f-display); font-size: 2.1cqw; }
.cert__meta span { color: rgba(19, 40, 58, .6); }
.cert__sig { font-family: "Aref Ruqaa", var(--f-quran); font-size: 3.4cqw !important; color: #22669a !important; line-height: 1.1; }
.cert__seal { width: 11cqw; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #f1d99b, #c9a55c 70%, #9a7228); box-shadow: 0 0 0 3px #f6efdc, 0 0 0 4px #c9a55c; }
.cert__seal img { width: 70%; filter: brightness(.35) sepia(1) saturate(2); }
.cert__id { font-size: 1.5cqw; color: rgba(19, 40, 58, .5); margin-top: .6cqw; }


.cert__meta span { color: rgba(19, 40, 58, .74); }
.cert__id { color: rgba(19, 40, 58, .65); }
.cert__name { color: #13283a; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cert-tile { padding: 14px; display: grid; gap: 12px; }
.cert-tile .cert { box-shadow: none; }
/* printing a certificate: a dedicated full-page copy, never the modal (which is clipped/scrolled) */
#print-root { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html.printing, html.printing body { background: #fff !important; margin: 0; padding: 0; }
  html.printing body > *:not(#print-root) { display: none !important; }
  html.printing #print-root { display: block; width: 297mm; height: 209mm; overflow: hidden; }
  html.printing #print-root .cert { width: 297mm; height: 209mm; aspect-ratio: auto; border-radius: 0; box-shadow: none; padding: 7mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.welcome .ring .ring__v b { color: #f2ecdd; }
.welcome .ring .ring__v span { color: rgba(242, 236, 221, .7); }
.welcome .ring svg circle:first-child { stroke: rgba(255, 255, 255, .12); }
.auth__note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.auth__note svg { width: 18px; height: 18px; color: var(--amber); margin-top: 3px; }

/* ---------- Loading skeleton ---------- */
.skel-wrap { display: grid; gap: 18px; }
.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 40%, var(--surface) 80%); background-size: 200% 100%; animation: skel 1.2s linear infinite; border: 1px solid var(--line); }
@keyframes skel { to { background-position: -200% 0; } }
.top__title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
@media (max-width: 960px) { .top__title h1 { font-size: 17px; max-width: 52vw; } }
.av svg { width: 55%; height: 55%; }
a.kpi { color: inherit; transition: border-color .2s, transform .2s var(--ease); }
a.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); }
.kpi__cmp { font-size: 11.5px; color: var(--ink-3); }
.attention { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.attn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--amber); box-shadow: var(--shadow); color: inherit; }
.attn:hover { border-color: var(--line-2); }
.attn b { font-family: var(--f-display); font-size: 20px; display: block; line-height: 1.2; }
.attn span { font-size: 12.5px; color: var(--ink-2); }
.attn.red { border-inline-start-color: var(--red); } .attn.violet { border-inline-start-color: var(--violet); } .attn.blue { border-inline-start-color: var(--blue); }
@media (max-width: 1200px) { .attention { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .attention { grid-template-columns: 1fr; } }

/* header never wider than the screen: the title shrinks and truncates */
.top__title { min-width: 0; flex: 1 1 auto; }
.top__title h1 { max-width: 100%; }
.top > .icon-btn, .top > .dd-wrap, .top > .top__search { flex: none; }
.shell { overflow-x: clip; }

/* horizontal-scroll hint for wide tables on small screens (scroll shadows) */
.table-wrap { background: linear-gradient(to left, var(--surface) 30%, transparent) right / 40px 100% no-repeat local, linear-gradient(to right, var(--surface) 30%, transparent) left / 40px 100% no-repeat local, radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) right / 14px 100% no-repeat scroll, radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent) left / 14px 100% no-repeat scroll; }
.t tr.t-empty td { text-align: center; padding: 34px 16px; color: var(--ink-3); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.soon { font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); margin-inline-start: 4px; }
.player__bar .bar i { transition: width .9s linear; }
.player.playing .player__play { opacity: 0; }
.player.playing:hover .player__play { opacity: 1; }
@media (max-width: 560px) {
  .session .row-actions, .session > div:last-child { justify-content: flex-start; justify-items: start; }
}
.lesson[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.lesson .n svg { width: 13px; height: 13px; }
.lesson:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.li__main .act { display: block; color: var(--ink-2); font-size: 13px; }
.li__main .act b { display: inline; font-size: inherit; color: var(--ink); }

[hidden] { display: none !important; }
