@charset "UTF-8";
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Visible keyboard focus on custom interactive elements (WCAG 2.4.7).
   outline (not box-shadow) so it isn't clipped by overflow:hidden on cards. */
.t-circle:focus-visible, .t-hub:focus-visible, .stats-pill:focus-visible,
.bn-item:focus-visible, .th-card:focus-visible, .th-pill:focus-visible, .th-chip:focus-visible,
.t-hero__act:focus-visible, .t-chip:focus-visible, .surah-step:focus-visible, .ayah-step:focus-visible,
.chip:focus-visible, .qr:focus-visible {
  outline: 3px solid var(--t-gold);
  outline-offset: 2px;
}

html {
  position: relative;
  min-height: 100%;
  overflow-x: clip;   /* viewport-level clip so the fixed off-canvas drawer can't scroll the page sideways */
}

body {
  margin-bottom: 0;
  overflow-x: hidden;   /* fallback for browsers without clip */
  overflow-x: clip;     /* stop the off-canvas mobile drawer from creating horizontal scroll */
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ============================================================
   App shell: slim topbar + role-aware sidebar (RTL-aware)
   ============================================================ */
:root {
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --sidebar-bg: #0f3d3e;          /* deep teal-green */
  --sidebar-fg: #cfe8e6;
  --sidebar-fg-muted: #8fb8b5;
  --sidebar-active-bg: rgba(255, 255, 255, .12);
  --sidebar-accent: #f5c451;      /* gold */
}

.app-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  overflow-y: auto;
  z-index: 1045;
  transition: transform .25s ease;
}

.app-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: .5rem;
  height: var(--topbar-h);
  padding: 0 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.app-topbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--sidebar-bg);
}

.app-topbar-logo { height: 24px; width: 24px; vertical-align: -6px; margin-inline-end: 8px; border-radius: 5px; }
.app-topbar-spacer { flex: 1 1 auto; }
.app-main { flex: 1 1 auto; padding: 1.25rem; }
.app-footer { padding: 1rem 1.25rem; border-top: 1px solid #e5e7eb; font-size: .85rem; }

/* sidebar inner */
/* Column layout so the foot block can be pushed to the bottom of the rail. min-height:100% (the
   sidebar is a fixed, full-height, scrolling box) keeps the foot at the bottom on short menus and
   lets it scroll naturally with the list on tall ones. */
.app-sidebar-inner { padding: 1rem .75rem; display: flex; flex-direction: column; min-height: 100%; }
.app-nav { display: flex; flex-direction: column; flex: 1 1 auto; }

.app-sidebar-brand {
  padding: .25rem .5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  margin-bottom: .75rem;
}

.brand-mark { color: #fff; font-weight: 700; font-size: 1.4rem; text-decoration: none; }

.brand-school {
  color: var(--sidebar-fg-muted);
  font-size: .85rem;
  margin-top: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-nav-section { margin-bottom: 1.25rem; }

.app-nav-title {
  color: var(--sidebar-fg-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 .5rem .35rem;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .65rem;
  margin-bottom: .15rem;
  color: var(--sidebar-fg);
  text-decoration: none;
  border-radius: .5rem;
  font-size: .95rem;
}

.app-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.app-nav-link.active { background: var(--sidebar-active-bg); color: #fff; box-shadow: inset 3px 0 0 var(--sidebar-accent); }
[dir="rtl"] .app-nav-link.active { box-shadow: inset -3px 0 0 var(--sidebar-accent); }

/* Account menu ────────────────────────────────────────────────────────────────
   One person can hold an account per school here, so the menu's first job is to say WHICH
   account this is. The identity block is the only loud thing; every setting stays quiet. */
/* The button keeps a 44px tap target (see #acctMenu) — the avatar inside is a FIXED square so it
   stays a circle. Sizing it to 100% let the button's own height stretch it into an ellipse. */
.acct-btn {
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: var(--bs-body-color);
}

.acct-btn:hover .acct-avatar,
.acct-btn:focus-visible .acct-avatar { box-shadow: 0 0 0 2px var(--sidebar-accent, #157347); }
.acct-btn:focus-visible { outline: 0; }

.acct-avatar {
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sidebar-bg, #10412c);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
}

.acct-avatar--lg { width: 2.2rem; height: 2.2rem; font-size: 1rem; }

/* Capped: the school name is the only long string here and it should truncate, not widen the menu. */
.acct-menu { min-width: 12.5rem; max-width: 16rem; padding-top: 0; }

.acct-id { display: flex; align-items: center; gap: .55rem; padding: .7rem .75rem .6rem; }
.acct-id__text { min-width: 0; flex: 1 1 auto; }
.acct-id__name { font-weight: 600; font-size: .92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acct-id__meta {
  font-size: .75rem;
  color: var(--bs-secondary-color, #6c757d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-id__sep { margin-inline: .25rem; }

/* Appearance + language: two switches on one row, no titles — each control shows both of its states,
   so a label would only repeat what is already on screen. The current value is marked, never filled;
   it is state, and a solid bar made it the loudest thing in a menu full of real actions. */
.acct-switches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding: .4rem .75rem .5rem;
}

.acct-seg__opts {
  display: inline-flex;
  border: 1px solid var(--bs-border-color);
  border-radius: .45rem;
  overflow: hidden;
}

.acct-seg__opts form { display: contents; }

.acct-seg__opt {
  border: 0;
  background: transparent;
  color: var(--bs-body-color);
  font: inherit;
  font-size: .78rem;
  padding: .18rem .45rem;
  cursor: pointer;
  white-space: nowrap;
}

.acct-seg__opt + .acct-seg__opt,
.acct-seg__opts form + form .acct-seg__opt { border-inline-start: 1px solid var(--bs-border-color); }

.acct-seg__opt:hover { background: var(--bs-tertiary-bg, rgba(0, 0, 0, .04)); }
.acct-seg__opt.is-on { background: var(--bs-tertiary-bg, rgba(0, 0, 0, .06)); font-weight: 600; cursor: default; }
.acct-seg__opt:focus-visible { outline: 2px solid var(--sidebar-accent, #157347); outline-offset: -2px; }

/* Icon halves of the appearance switch: square, and the icon shrunk to match the text halves' weight. */
.acct-seg__opt--ico { display: inline-grid; place-items: center; padding: .18rem .4rem; }
.acct-seg__opt--ico .t-ico { width: 14px; height: 14px; }
.acct-seg__opt--ico:not(.is-on) { opacity: .55; }

/* Meter — the one genuinely new piece on إحصائيات. Everything else on that screen reuses .t-stat,
   .t-circle and .t-learner, the components the other stats screens already share; a parallel set
   (.t-kpi / .t-crow / .t-lrow) lived here briefly and was the reason the screens stopped matching.

   ONE hue for every bar. Length carries the magnitude; colouring a bar by how short it is would put
   back the "behind" verdict the app has no basis for. Each bar's scale is the biggest value on the
   same screen, so rows compare to each other rather than to an invented target. */
.t-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--t-line);
  overflow: hidden;
  margin: .5rem 0 .1rem;
}

.t-meter--sm { height: 6px; margin: .4rem 0 .1rem; }

.t-meter__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--t-green);
  min-width: 3px;   /* a learner with one page should still be visible */
}

/* A COMPLETION meter is different: zero must read as zero. The 3px nub above is right when the bar
   compares quantities, and a lie when it reports "0 of 4 done". */
.t-meter--goal .t-meter__fill { min-width: 0; }

/* الطلاب roster: a circle is a heading over its learners, not a card to click through. With several
   circles the collapsed headers ARE the overview — who is where and how many — so <details> does the
   expanding natively and the page never becomes a hundred-name scroll. */
.t-fold + .t-fold { margin-top: .9rem; }

.t-fold__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .55rem .35rem;
  cursor: pointer;
  list-style: none;
  border-radius: .5rem;
}

.t-fold__head::-webkit-details-marker { display: none; }
.t-fold__head:hover { background: var(--bs-tertiary-bg, rgba(0, 0, 0, .03)); }
.t-fold__head:focus-visible { outline: 2px solid var(--sidebar-accent, #157347); outline-offset: 2px; }

/* Disclosure caret: DOWN when closed (the content is below), UP when open. Physical borders, and no
   RTL branch — a vertical caret must not mirror, and the logical/RTL version pointed up while closed,
   which reads as "collapse me" on a section that is already collapsed. */
.t-fold__head::before {
  content: "";
  width: .45rem;
  height: .45rem;
  flex: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .5;
  transition: transform .15s ease;
  margin-inline-end: .1rem;
}

.t-fold[open] > .t-fold__head::before { transform: translateY(2px) rotate(-135deg); }

.t-fold__title { font-weight: 600; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.t-fold__count { color: var(--bs-secondary-color, #6c757d); font-size: .85rem; margin-inline-start: auto; }
.t-fold > .t-panel { margin-top: .35rem; }

@media (prefers-reduced-motion: reduce) {
  .t-fold__head::before { transition: none; }
}

/* "تواصل مع تحفيظ" — reachable but out of the daily task flow, so it sits alone at the foot behind
   a divider rather than competing with the work links above it. */
.app-nav-foot {
  margin-top: auto;
  padding-top: .6rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.app-nav-icon { font-size: 1.15rem; line-height: 1; width: 1.5rem; text-align: center; }
.app-nav-label { flex: 1 1 auto; }
.app-nav-badge { font-size: .7rem; }

/* mobile (default): off-canvas drawer */
.app-sidebar { transform: translateX(-100%); }
[dir="rtl"] .app-sidebar { transform: translateX(100%); }
body.sidebar-open .app-sidebar { transform: none; }

.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1040;
}

body.sidebar-open .app-sidebar-backdrop { display: block; }
.app-sidebar-toggle { font-size: 1.2rem; line-height: 1; padding: .15rem .6rem; min-height: 44px; }

/* ============================================================
   Recording table — one markup at every width.
   ============================================================ */
/* Recording TABLE at every width: a header row, then one short row per learner (# | name | ID |
   attendance | ▾). Header and rows share one grid template so the columns line up; tapping a row
   opens its entry underneath, full width. The layout keys off the TABLE's width (container query),
   not the viewport's — the sidebar decides how much room it really has. */
.qrec-wrap { container-type: inline-size; }
.qrec {
  /* fixed widths (not auto): header and rows are separate grids, and auto would size each on its own */
  --qrec-cols: 2rem minmax(7rem, 1fr) 6.8rem 11rem 1.8rem;
  border: 1px solid var(--t-line); border-radius: var(--t-radius); overflow: hidden; background: #fff;
  overflow: clip;   /* clips like hidden but is no scroll container, so the sticky .part-tabs can stick */
}
.qrec-head {
  display: grid; grid-template-columns: var(--qrec-cols); align-items: center; gap: .6rem;
  padding: .45rem .75rem; background: #f3f7f6; border-bottom: 1px solid var(--t-line);
  font-size: .8rem; font-weight: 700; color: var(--t-muted);
}
.qrec-row { border-bottom: 1px solid #eef2f1; background: #fff; transition: background .15s ease; }
.qrec-row:last-child { border-bottom: 0; }
.qrec-row.is-absent { background: #fdf5f5; }
.qrec-row.is-excused { background: #fdf8f3; }
.qrec-summary {
  display: grid; grid-template-columns: var(--qrec-cols); align-items: center; gap: .6rem;
  padding: .3rem .75rem; cursor: pointer;
}
.qrec-summary:hover { background: rgba(15, 61, 62, .03); }
.qrec-num { color: var(--t-muted); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: center; }
.qc-num { text-align: center; }
.qrec-name { min-width: 0; font-weight: 600; line-height: 1.3; }
.qrec-nid { font-size: .82rem; color: var(--t-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* collapsed-row recap: what's recorded, at a glance */
.qrec-recap { font-size: .72rem; font-weight: 400; margin-top: .1rem; line-height: 1.35; word-break: break-word; }
.qrec-recap.done { color: #157347; font-weight: 600; }
.qrec-recap.pending { color: #aab4b2; }
.qrec-recap.exc { color: var(--t-amber); font-weight: 600; }
.qrec-recap.off { color: #b3261e; font-weight: 600; }
/* absent / excused / awaiting only echo the attendance buttons beside them — don't spend a line on it */
.qrec-recap.exc, .qrec-recap.off, .qrec-recap.pending { display: none; }
/* today's plan target hint under the learner name */
.qrec-target { margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.qrec-target-lbl { font-size: .74rem; color: var(--t-muted); font-weight: 600; }
/* "لا خطة" indicator on a learner's recording card */
.noplan-badge { display: inline-block; margin-inline-start: .4rem; font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .08rem .5rem; background: #fde2e1; color: #b3261e; }
/* dev-only "simulate day" widget in the topbar */
.dev-clock { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; background: #fff3cd; color: #7a5b00; border: 1px solid #f0d98c; border-radius: 999px; padding: .12rem .55rem; margin-inline-start: .5rem; white-space: nowrap; }
.dev-clock__btn { color: var(--t-brand, #0f3d3e); text-decoration: none; border: 1px solid #d9c98a; border-radius: 6px; padding: 0 .35rem; background: #fff; }
.dev-clock__btn:hover { background: #f3faf5; }
.qrec-row.open .qrec-recap { display: none; }
.qrec-entry { display: none; padding: .4rem .75rem .85rem; border-top: 1px dashed #e3ebe9; }
.qrec-row.open .qrec-entry { display: block; }
.qrec-cell { margin-top: .75rem; }
.qrec-cell::before {
  content: attr(data-label);
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--t-brand);
}
.qrec-save { margin-top: .9rem; }
.qrec-save .q-save { width: 100%; }
.qrec-chev {
  border: 0; background: transparent; color: #6a8a87;
  font-size: 1.05rem; line-height: 1; padding: .2rem .3rem; transition: transform .2s ease;
}
.qrec-row.open .qrec-chev { transform: rotate(180deg); }

/* attendance — 3-state segmented control (Present / Excused / Absent) */
.att-seg { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--t-line); border-radius: 11px; overflow: hidden; }
.att-opt { appearance: none; border: 0; background: var(--t-surface); color: var(--t-muted); font: inherit; font-weight: 700; font-size: .82rem; padding: .5rem .55rem; min-height: 44px; cursor: pointer; border-inline-start: 1px solid var(--t-line); }
/* in the recording table the control sits in a normal-height row */
.qrec .att-seg { border-radius: 8px; }
/* min-width:0 lets the three buttons share the column instead of spilling over the name */
.qrec .att-opt { min-height: 30px; min-width: 0; padding: .2rem .15rem; font-size: .78rem; flex: 1 1 0; text-align: center; white-space: nowrap; }
.qrec-summary .att-seg { display: flex; width: 100%; min-width: 0; }
/* narrow table (phone, or a tight window): five columns don't fit, so the ID tucks under the name */
@container (max-width: 559.98px) {
  .qrec { --qrec-cols: 1.5rem minmax(0, 1fr) 9.3rem 1.3rem; }
  .qrec-head .qc-nid { display: none; }
  .qrec-head, .qrec-summary { column-gap: .45rem; padding-inline: .5rem; }
  .qrec-summary { grid-template-areas: "num name att chev" "num nid att chev"; row-gap: 0; }
  .qrec-num { grid-area: num; }
  .qrec-name { grid-area: name; }
  .qrec-nid { grid-area: nid; font-size: .74rem; }
  .qrec-summary .att-seg { grid-area: att; }
  .qrec-summary .qrec-chev { grid-area: chev; }
  .qrec .att-opt { font-size: .72rem; }
}
.att-opt:first-child { border-inline-start: 0; }
.att-opt.on.p { background: var(--t-green); color: #fff; }
.att-opt.on.e { background: var(--t-amber); color: #fff; }
.att-opt.on.a { background: #c0392b; color: #fff; }
[data-bs-theme="dark"] .att-opt { background: var(--t-surface); color: var(--t-muted); border-color: var(--t-line); }

/* cascade: full-width selects that wrap — no sideways scroll on a phone */
.qpick { display: flex; flex-wrap: wrap; gap: .4rem; }
.qpick .form-select { flex: 1 1 40%; min-width: 0; }
.qual-sel { width: 100%; }

/* 16px text stops iOS Safari auto-zoom on focus; bigger tap targets */
.form-select, .form-control { font-size: 16px; }
.qrec .form-select, .qrec .btn { min-height: 44px; }

/* درس (new) = green, مراجعة (revision) = orange — colour-code the two ranges */
.col-lesson { color: var(--t-green); }
.col-revision { color: var(--t-amber); }
.qpick-lesson .form-select { border-color: #b6dcc5; background-color: #f3faf5; }
.qpick-lesson .form-select:focus { border-color: #157347; box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .2); }
.qpick-revision .form-select { border-color: #f3cda0; background-color: #fff7ee; }
.qpick-revision .form-select:focus { border-color: #e8590c; box-shadow: 0 0 0 .2rem rgba(253, 126, 20, .25); }


/* desktop: sidebar pinned, content offset */
@media (min-width: 768px) {
  .app-sidebar,
  [dir="rtl"] .app-sidebar { transform: none; }
  body.has-sidebar .app-content { margin-inline-start: var(--sidebar-w); }
  .app-sidebar-backdrop { display: none !important; }

  /* collapsed: slide the pinned sidebar away and reclaim the space */
  body.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
  [dir="rtl"] body.sidebar-collapsed .app-sidebar { transform: translateX(100%); }
  body.sidebar-collapsed.has-sidebar .app-content { margin-inline-start: 0; }
}

/* ============================================================
   "Calm Scholarly" design layer — refined components shared by
   the teacher home + التقدم pages. Harmonised with the existing
   deep teal-green / gold app shell. Scoped via .t-* classes so
   the rest of the app is untouched. RTL-safe (logical props).
   ============================================================ */
:root {
  --t-font: 'Readex Pro', system-ui, 'Segoe UI', Tahoma, sans-serif;
  /* Re-point Bootstrap's default blue to the brand (links / .text-primary). */
  --bs-primary: #157347;
  --bs-primary-rgb: 21, 115, 71;
  --bs-link-color: #157347;
  --bs-link-color-rgb: 21, 115, 71;
  --bs-link-hover-color: #0f5a37;
  --t-brand: #0f3d3e;        /* deep teal-green (matches sidebar) */
  --t-green: #157347;        /* memorization / درس */
  --t-green-soft: #e8f3ec;
  --t-amber: #c05600;        /* revision / مراجعة */
  --t-amber-soft: #fbeede;
  --t-amber-ink: #863c00;    /* amber TEXT on amber-soft — ≥7:1 (plain --t-amber is only 4:1) */
  --t-gold: #f5c451;
  --t-red: #c0392b;          /* blocked right now — the top of the count scale */
  --t-blue: #1d5fb4;         /* مراجعة الدرس السابق — the third part colour beside درس/مراجعة */
  --t-surface: #ffffff;
  --t-bg: #fbfcfb;
  --t-ink: #16231f;
  --t-muted: #6c7d7b;
  --t-line: #e6ede9;
  --t-radius: 16px;
  --t-shadow: 0 1px 2px rgba(15, 61, 62, .05), 0 14px 30px -18px rgba(15, 61, 62, .28);
  --t-shadow-hover: 0 2px 4px rgba(15, 61, 62, .06), 0 22px 40px -20px rgba(15, 61, 62, .38);
  --t-th-bg: #eef5f2;        /* table header + sticky first column */
  --t-row-hover: #f7faf8;
}

body { font-family: var(--t-font); color: var(--t-ink); background: var(--t-bg); }

/* page hero ------------------------------------------------- */
.t-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(110deg, var(--t-brand) 0%, #134e4a 60%, #0c5c4a 100%);
  border-radius: var(--t-radius);
  color: #eafaf5;
  box-shadow: var(--t-shadow);
}
/* faint Islamic-geometric watermark in the hero corner */
.t-hero::after {
  content: ""; position: absolute; inset-block: -40%; inset-inline-end: -3%;
  width: 220px; opacity: .12; pointer-events: none;
  background:
    repeating-conic-gradient(from 22.5deg, var(--t-gold) 0deg 45deg, transparent 45deg 90deg);
  -webkit-mask: radial-gradient(circle at center, #000 60%, transparent 62%);
          mask: radial-gradient(circle at center, #000 60%, transparent 62%);
  transform: rotate(8deg);
}
.t-hero__title { margin: 0; font-weight: 700; font-size: 1.5rem; line-height: 1.2; }
.t-hero__sub { color: #bfe4da; font-size: .92rem; }
/* An action in the hero ("+ إضافة عضو"). The back links that used to share this pill are gone —
   the sidebar is the way around — so nothing here carries an arrow any more. */
.t-hero__act {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(255, 255, 255, .14); color: #eafaf5; text-decoration: none;
  border-radius: 999px; padding: .4rem .85rem; font-size: .9rem; font-weight: 500;
  transition: background .18s ease;
}
.t-hero__act:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.t-hero__spacer { flex: 1 1 auto; }

/* stat tiles ------------------------------------------------ */
.t-stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.6rem; }
.t-stat {
  position: relative; overflow: hidden;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); padding: 1.15rem 1.3rem;
  box-shadow: var(--t-shadow);
  display: flex; align-items: center; gap: 1rem;
}
.t-stat::before {                       /* colored rail on the inline-start edge */
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px;
  background: var(--rail, var(--t-green));
}
.t-stat__icon {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.4rem;
  background: var(--chip, var(--t-green-soft));
}
.t-stat__body { min-width: 0; flex: 1 1 auto; }
/* denominator beside a headline figure: present, but never competing with it */
.t-of { font-size: .5em; font-weight: 600; opacity: .55; margin-inline-start: .1em; }
.t-stat__num { font-size: 2.1rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.t-stat__label { color: var(--t-muted); font-size: .88rem; margin-top: .2rem; }
.t-stat--green { --rail: var(--t-green); --chip: var(--t-green-soft); }
.t-stat--green .t-stat__num { color: var(--t-green); }
.t-stat--amber { --rail: var(--t-amber); --chip: var(--t-amber-soft); }
.t-stat--amber .t-stat__num { color: var(--t-amber); }
.t-stat--brand { --rail: var(--t-brand); --chip: #e4efee; }
.t-stat--brand .t-stat__num { color: var(--t-brand); }
.t-stat--red { --rail: #c0392b; --chip: #f8e7e4; }
.t-stat--red .t-stat__num { color: #c0392b; }

/* inline SVG icons — hero chip, KPI tile, hub card, inline title (#15) ------ */
.t-ico { display: inline-block; vertical-align: middle; }
.t-hero__icon {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #eafaf5;
}
.t-hero__icon .t-ico { width: 28px; height: 28px; }
.t-stat__icon .t-ico { width: 24px; height: 24px; color: var(--rail, var(--t-green)); }
.t-hub__icon .t-ico { width: 24px; height: 24px; color: var(--t-green); }
.t-circle__name .t-ico, .t-hub__title .t-ico {
  width: 20px; height: 20px; vertical-align: -4px; color: var(--t-green); margin-inline-end: .15rem;
}
.t-hero__title .t-ico { width: 26px; height: 26px; vertical-align: -4px; margin-inline-end: .35rem; }
.app-nav-icon .t-ico { width: 20px; height: 20px; }
.bn-ico .t-ico { width: 22px; height: 22px; }
/* Tap target stays 44px; the avatar inside is a fixed square, so the button no longer draws a
   rounded rectangle around a stretched circle. */
#acctMenu { min-height: 44px; min-width: 44px; padding: 0; border: 0; background: transparent; }
#acctMenu .t-ico { width: 18px; height: 18px; vertical-align: -3px; }
.dropdown-menu .t-ico { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: .5rem; }
[data-bs-theme="dark"] .t-hub__icon .t-ico,
[data-bs-theme="dark"] .t-circle__name .t-ico,
[data-bs-theme="dark"] .t-hub__title .t-ico,
[data-bs-theme="dark"] .t-stat--brand .t-stat__icon .t-ico { color: #8fd3c9; }

/* teacher home — "record today" (Approach A) --------------- */
.th-today { text-align: center; line-height: 1.2; }
.th-today__dow { display: block; font-weight: 700; font-size: 1.05rem; color: #eafaf5; }
.th-today__date { display: block; font-size: .82rem; color: #bfe4da; }

.th-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.th-switch__label { font-size: .85rem; font-weight: 600; color: var(--t-muted); margin-inline-end: 2px; }
.th-pill { border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: .95rem; border: 1.5px solid var(--t-green); color: var(--t-green); background: #fff; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.th-pill:hover { transform: translateY(-1px); }
.th-pill--on { background: var(--t-green); color: #fff; }

.th-card { position: relative; overflow: hidden; display: block; border-radius: 20px; padding: 1.9rem 1.5rem; text-align: center; text-decoration: none; box-shadow: 0 10px 28px rgba(15,61,62,.12); margin-bottom: 1rem; }
.th-card--go { background: linear-gradient(135deg, var(--t-green), #17585a); color: #fff; transition: transform .15s, box-shadow .15s; }
.th-card--go::after {                    /* faint Islamic-geometric watermark, echoing .t-hero */
  content: ""; position: absolute; inset-block: -45%; inset-inline-end: -8%;
  width: 210px; opacity: .16; pointer-events: none;
  background: repeating-conic-gradient(from 22.5deg, var(--t-gold) 0deg 45deg, transparent 45deg 90deg);
  -webkit-mask: radial-gradient(circle at center, #000 60%, transparent 62%);
          mask: radial-gradient(circle at center, #000 60%, transparent 62%);
  transform: rotate(8deg);
}
.th-card--go:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15,61,62,.22); color: #fff; }
.th-card__badge { position: relative; display: inline-block; background: rgba(255,255,255,.18); color: #fff; font-weight: 700; font-size: .85rem; padding: .3rem .95rem; border-radius: 999px; margin-bottom: .95rem; }
.th-card__title { position: relative; font-weight: 800; font-size: 1.5rem; margin-bottom: .3rem; }
.th-card__learners { position: relative; font-size: .95rem; opacity: .9; margin-bottom: 1.15rem; }
.th-when { font-size: 1rem; opacity: .85; margin-bottom: 1rem; }
.th-cta { position: relative; display: inline-block; background: var(--t-gold); color: var(--t-brand); font-weight: 800; font-size: 1.5rem; border-radius: 16px; padding: .9rem 1.7rem; box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.th-meta { font-size: .95rem; opacity: .9; margin-top: 1rem; color: inherit; }
.th-card--done { background: #eaf5ec; border: 1.5px solid #2e7d32; color: #1b5e20; }
.th-ok { font-size: 2.6rem; line-height: 1; }
.th-title { font-weight: 800; font-size: 1.3rem; margin: .4rem 0; }
.th-card--calm { background: #f3f5f4; border: 1px dashed #b9c2c1; color: #3a4544; }
.th-card--calm .th-title { color: var(--t-green); }
.th-btn { display: inline-block; border-radius: 12px; padding: .7rem 1.4rem; font-weight: 700; text-decoration: none; margin-top: 1rem; }
.th-btn--outline { border: 1.5px solid currentColor; color: inherit; background: transparent; }

.th-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.th-chip { display: inline-block; background: #e9f0ef; color: var(--t-green); border-radius: 999px; padding: .5rem 1rem; font-weight: 600; font-size: .9rem; text-decoration: none; }
.th-chip--red { background: #f8e1de; color: #b3261e; }

/* manager home — lean "attention first" landing (mh-*) ------ */
.mh-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.mh-act { display: inline-block; border-radius: 999px; padding: .4rem .9rem; font-size: .88rem; font-weight: 600; text-decoration: none;
  background: rgba(255,255,255,.15); color: #eafaf5; border: 1px solid rgba(255,255,255,.28); transition: background .15s ease, transform .15s ease; }
.mh-act:hover { background: rgba(255,255,255,.28); color: #fff; transform: translateY(-1px); }
.mh-act--primary { background: var(--t-gold); color: var(--t-brand); border-color: transparent; }
.mh-act--primary:hover { background: #f7cf6a; color: var(--t-brand); }

.mh-section { margin-bottom: 1.4rem; }
.mh-title { margin: 0; font-weight: 700; font-size: 1.12rem; color: var(--t-ink); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mh-title small { font-weight: 500; font-size: .82rem; color: var(--t-muted); }
.mh-title--warn { color: var(--t-amber); margin-bottom: .8rem; }
.mh-title__dot { font-size: 1rem; }

.mh-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .mh-row { grid-template-columns: 1fr; } }
.mh-card { position: relative; overflow: hidden; display: block; text-decoration: none; color: var(--t-ink);
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius);
  padding: 1.15rem 1.3rem 1.2rem; box-shadow: var(--t-shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.mh-card:hover { transform: translateY(-3px); box-shadow: var(--t-shadow-hover); border-color: #bcdcd2; color: var(--t-ink); }
.mh-card::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--mh-rail, transparent); }
.mh-card--attend  { --mh-rail: var(--t-green); }

/* head is a left cluster (icon + title), with count + chevron pushed to the end */
.mh-card__head { display: flex; align-items: center; gap: .55rem; margin-bottom: .7rem; }
.mh-card__head .mh-title { font-size: 1.04rem; font-weight: 800; }
.mh-card__go { margin-inline-start: auto; }
.mh-muted { color: var(--t-muted); font-size: .9rem; margin: 0; }

.mh-tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.mh-tally__n { text-align: center; border-radius: 12px; padding: .6rem .3rem .45rem;
  background: #f5f8f7; border: 1px solid var(--t-line); }
.mh-tally__n b { display: block; font-size: 1.55rem; line-height: 1; font-weight: 800; }
.mh-tally__n span { display: block; margin-top: .2rem; font-size: .74rem; color: var(--t-muted); }
.mh-tally__n--p { background: var(--t-green-soft); border-color: #bfe0d1; }
.mh-tally__n--p b { color: var(--t-green); }
.mh-tally__n--a { background: #fbeceb; border-color: #f0cdc9; }
.mh-tally__n--a b { color: #c0392b; }
.mh-tally__n--e { background: var(--t-amber-soft); border-color: #e6c294; }
.mh-tally__n--e b { color: var(--t-amber); }
.mh-tally__n--u b { color: #8a9a95; }

.mh-badge { background: var(--t-amber-soft); color: var(--t-amber-ink); border-radius: 999px; padding: .05rem .55rem; font-size: .82rem; font-weight: 700; }
.mh-appr { list-style: none; margin: 0; padding: 0; }
.mh-appr__item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--t-line); font-size: .92rem; }
.mh-appr__item:last-child { border-bottom: 0; }
.mh-appr__role { color: var(--t-muted); font-size: .82rem; }
.mh-appr__more { margin-top: .3rem; }

/* announcements (an-*) — home banner + manage list -------- */
.an-banner { display: flex; gap: .85rem; align-items: flex-start;
  background: var(--t-green-soft); border: 1px solid #bcdcd2; border-inline-start: 4px solid var(--t-green);
  border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: 1.3rem; }
.an-banner__icon { color: var(--t-green); flex: 0 0 auto; margin-top: 2px; }
.an-banner__title { font-weight: 700; color: var(--t-brand); }
.an-banner__body { color: var(--t-ink); font-size: .94rem; white-space: pre-line; margin-top: .15rem; }

.an-list { display: flex; flex-direction: column; gap: .7rem; }
.an-item { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start;
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius);
  padding: 1rem 1.15rem; box-shadow: var(--t-shadow); }
.an-item--off { opacity: .62; }
.an-item__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.an-item__title { font-weight: 700; font-size: 1.05rem; color: var(--t-ink); }
/* in the table the notice is a preview, not the notice: two lines, then the row stays a row. */
.an-item__body { color: var(--t-muted); font-size: .92rem; margin-top: .3rem; white-space: pre-line;
                 display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.an-item__meta { color: var(--t-muted); font-size: .8rem; margin-top: .4rem; }
.an-item__actions { display: flex; gap: .4rem; flex-wrap: wrap; flex: 0 0 auto; }
.an-badge { background: #eef2f0; color: var(--t-muted); border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; font-weight: 700; }
.an-badge--on { background: var(--t-green-soft); color: var(--t-green); }
.an-badge--aud { background: #eef4fb; color: #2b5c8a; }

/* home announcement feed (an-feed / an-note) — several notices may stack ------ */
.an-feed { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.4rem; }
.an-note {
  position: relative; overflow: hidden;
  display: flex; gap: .95rem; align-items: flex-start;
  background:
    linear-gradient(180deg, rgba(21,115,71,.05), rgba(21,115,71,0) 60%),
    var(--t-surface);
  border: 1px solid #cfe3da; border-radius: 16px;
  padding: 1rem 1.15rem 1rem 1.25rem;
  box-shadow: var(--t-shadow);
  animation: an-rise .45s cubic-bezier(.2,.7,.2,1) both;
}
.an-note::before {                       /* accent rail: brand → green gradient */
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px;
  background: linear-gradient(180deg, var(--t-brand), var(--t-green));
}
.an-note:nth-child(2) { animation-delay: .06s; }
.an-note:nth-child(3) { animation-delay: .12s; }
.an-note:nth-child(n+4) { animation-delay: .18s; }
.an-note__mark {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: var(--t-green); background: var(--t-green-soft);
  box-shadow: inset 0 0 0 1px #bfe0d1;
}
.an-note__mark .t-ico { width: 22px; height: 22px; }
.an-note__content { min-width: 0; flex: 1 1 auto; }
.an-note__title { margin: 0; font-size: 1.04rem; font-weight: 800; color: var(--t-brand); line-height: 1.3; }
.an-note__body { margin: .2rem 0 0; color: var(--t-ink); font-size: .94rem; white-space: pre-line; }
.an-note__meta { margin-top: .55rem; }
.an-note__timer {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .76rem; font-weight: 700; letter-spacing: .1px;
  color: var(--t-amber); background: var(--t-amber-soft, #fbe9d6);
  border-radius: 999px; padding: .16rem .6rem;
}
.an-note__timer::before {                /* tiny clock glyph, pure CSS (no emoji) */
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  border: 1.6px solid currentColor;
  box-shadow: inset 0 -3px 0 -2px currentColor, inset -3px 0 0 -2px currentColor;
}
@keyframes an-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .an-note { animation: none; } }
/* one notice at a time (see the rotator in site.js): the box keeps the height of whichever note
   is showing, and the dots say how many are waiting behind it. */
.an-rotator { position: relative; }
.an-dots { display: flex; gap: .35rem; justify-content: center; margin-top: .5rem; }
.an-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
          background: var(--t-line); transition: background .18s ease, transform .18s ease; }
.an-dot.is-on { background: var(--t-green); transform: scale(1.25); }
.an-dot:focus-visible { outline: 2px solid var(--t-green); outline-offset: 2px; }

/* survey vote card (sv-*) — inline poll inside the announcement feed ---------- */
.an-note--survey .an-note__mark { color: var(--t-brand); }
.sv-voted { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: .5rem 0 .1rem; }
.sv-voted__badge { font-size: .78rem; font-weight: 800; color: var(--t-green); background: var(--t-green-soft);
  border: 1.5px solid #bfe0d1; border-radius: 999px; padding: .1rem .6rem; }
.sv-voted__answer { font-size: .86rem; color: var(--t-muted); font-weight: 600; }
.sv-form { margin-top: .6rem; }
.sv-options { display: flex; flex-direction: column; gap: .4rem; }
.sv-opt { display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem; margin: 0;
  border: 1.5px solid var(--t-line); border-radius: 10px; background: var(--t-surface); cursor: pointer;
  transition: border-color .12s, background .12s; }
.sv-opt:hover { border-color: #bcdcd2; background: #f6faf8; }
.sv-opt__input { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; accent-color: var(--t-green); }
.sv-opt__input:checked ~ .sv-opt__text { font-weight: 700; color: var(--t-brand); }
.sv-opt__text { font-size: .93rem; }
.sv-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }

/* survey options editor on the form (an-opt-*) + locked list ------------------ */
.an-survey { border: 1.5px dashed #bcdcd2; border-radius: 12px; padding: .85rem 1rem; background: #f7fbf9; }
#an-opts { display: flex; flex-direction: column; gap: .5rem; }
.an-opt-row { display: flex; gap: .5rem; align-items: center; }
.an-opt-row .form-control { flex: 1 1 auto; }
.an-opt-row .an-opt-del { flex: 0 0 auto; line-height: 1; padding: .25rem .6rem; font-weight: 800; }
.an-opts-locked { margin: 0; padding-inline-start: 1.1rem; color: var(--t-ink); }

/* staff survey results (sr-*) ------------------------------------------------- */
.sr-panel { padding: 1.1rem 1.25rem; }
.sr-total { color: var(--t-muted); margin-bottom: 1rem; }
.sr-row { margin-bottom: 1rem; }
.sr-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.sr-row__text { font-weight: 700; }
.sr-row__count { font-weight: 800; color: var(--t-brand); }
.sr-bar { height: 9px; border-radius: 999px; background: #e9f0ec; overflow: hidden; margin: .35rem 0; }
.sr-bar__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--t-brand), var(--t-green)); }
.sr-voters { font-size: .84rem; color: var(--t-muted); }

[data-bs-theme="dark"] .an-survey { background: #16211f; border-color: #284034; }
[data-bs-theme="dark"] .sv-opt { background: #16211f; border-color: #284034; }
[data-bs-theme="dark"] .sv-opt:hover { background: #1a2a24; border-color: #2f5744; }
[data-bs-theme="dark"] .sr-bar { background: #223129; }

/* announcement form — audience picker (an-aud) ------------------------------- */
.an-aud { display: flex; flex-wrap: wrap; gap: .5rem; }
.an-aud__opt {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--t-line); border-radius: 999px;
  padding: .4rem .85rem; cursor: pointer; user-select: none;
  font-weight: 600; color: var(--t-ink); transition: border-color .15s, background .15s;
}
.an-aud__opt:has(input:checked) { border-color: var(--t-green); background: var(--t-green-soft); color: var(--t-green); }
.an-aud__opt .form-check-input { margin: 0; }

/* learner-registration tabs (lt-*) — Student / Child / Transfer, CSS-only ----- */
.lt-radio { position: absolute; opacity: 0; pointer-events: none; }
.lt-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.lt-tab {
  display: flex; align-items: center; gap: .7rem; cursor: pointer;
  flex: 1 1 200px; min-width: 180px;
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 14px;
  padding: .75rem .9rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.lt-tab__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  color: var(--t-muted); background: #eef2f0; flex: 0 0 auto; }
.lt-tab__ico .t-ico { width: 21px; height: 21px; }
.lt-tab__title { display: block; font-weight: 800; color: var(--t-ink); }
.lt-tab__sub { display: block; font-size: .78rem; color: var(--t-muted); }
.lt-panel { display: none; animation: an-rise .35s cubic-bezier(.2,.7,.2,1) both; }

/* active tab + matching panel (sibling selectors need the radios to precede these) */
#lt-student:checked ~ .lt-bar .lt-tab[for="lt-student"],
#lt-child:checked ~ .lt-bar .lt-tab[for="lt-child"],
#lt-transfer:checked ~ .lt-bar .lt-tab[for="lt-transfer"] {
  border-color: var(--t-green); background: var(--t-green-soft);
  box-shadow: inset 0 0 0 1px var(--t-green);
}
#lt-student:checked ~ .lt-bar .lt-tab[for="lt-student"] .lt-tab__ico,
#lt-child:checked ~ .lt-bar .lt-tab[for="lt-child"] .lt-tab__ico,
#lt-transfer:checked ~ .lt-bar .lt-tab[for="lt-transfer"] .lt-tab__ico {
  color: #fff; background: var(--t-green);
}
#lt-student:checked ~ .lt-panel--student,
#lt-child:checked ~ .lt-panel--child,
#lt-transfer:checked ~ .lt-panel--transfer { display: block; }

/* circle cards (home + التقدم index) ------------------------ */
.t-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.t-circle {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: .55rem;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); padding: 1.25rem 1.3rem 1.15rem;
  box-shadow: var(--t-shadow); text-decoration: none; color: var(--t-ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.t-circle::before {                     /* soft arc glow in the corner */
  content: ""; position: absolute; inset-block-start: -55px; inset-inline-end: -55px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(21, 115, 71, .14), transparent 70%);
  transition: transform .25s ease;
}
.t-circle:hover { transform: translateY(-4px); box-shadow: var(--t-shadow-hover); border-color: #bcdcd2; color: var(--t-ink); }
.t-circle:hover::before { transform: scale(1.25); }
.t-circle__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.t-circle__name { font-weight: 600; font-size: 1.18rem; line-height: 1.25; }
.t-circle__icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--t-green-soft); }
.t-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--t-green-soft); color: var(--t-green);
  font-size: .82rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px;
}
.t-chip--amber { background: var(--t-amber-soft); color: var(--t-amber); }
.t-chip--soft { background: #eef3f1; color: #4a5d59; }
.t-circle__chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.t-circle__foot { margin-top: .35rem; display: flex; align-items: center; justify-content: space-between; color: var(--t-muted); font-size: .9rem; }
.t-circle__go { color: var(--t-green); font-weight: 600; opacity: 0; transform: translateX(6px); transition: opacity .18s, transform .18s; }
[dir="rtl"] .t-circle__go { transform: translateX(-6px); }
.t-circle:hover .t-circle__go { opacity: 1; transform: translateX(0); }

/* Directional nav glyphs — emitted via CSS so they auto-flip for LTR English (#17).
   RTL (primary) keeps the original Arabic-correct glyph; LTR shows its mirror. The literal
   →/←/‹/› were removed from the views so these are the single source of truth. */
.t-circle__go::after { content: "→"; margin-inline-start: .35rem; }
[dir="rtl"] .t-circle__go::after { content: "←"; }
.t-chevron-fwd::before { content: "›"; }
[dir="rtl"] .t-chevron-fwd::before { content: "‹"; }
/* prev/next steppers are direction-independent (prev=‹ decrement, next=› increment) */
.surah-step[data-dir="-1"]::before { content: "‹"; }
.surah-step[data-dir="1"]::before  { content: "›"; }

/* learner rows (circle detail) ------------------------------ */
.t-panel { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius); box-shadow: var(--t-shadow); overflow: hidden; }
.t-panel--grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t-learner { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.15rem; border-block-end: 1px solid var(--t-line); transition: background .15s ease; }
.t-learner:last-child { border-block-end: 0; }
.t-learner:hover { background: #f6faf8; }
.t-learner__avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: 1.05rem;
  color: var(--t-brand); background: linear-gradient(135deg, var(--t-green-soft), #d8ece2);
}
.t-learner__main { flex: 1 1 auto; min-width: 0; }
.t-learner__name { font-weight: 600; }
.t-learner__name small { font-weight: 400; color: var(--t-muted); margin-inline-start: .4rem; }
.t-learner__stats { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .3rem; }
.t-learner__action { flex: 0 0 auto; }
.t-learner__action .btn { border-radius: 999px; }

/* session-log rows (الجلسات) — clean scannable list, mirrors .t-learner */
.t-session { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.15rem; border-block-end: 1px solid var(--t-line); min-height: 44px; color: inherit; text-decoration: none; transition: background .15s ease; }
.t-session:last-child { border-block-end: 0; }
.t-session:hover { background: #f6faf8; }
.t-session__date { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; line-height: 1; background: linear-gradient(135deg, var(--t-green-soft), #d8ece2); }
.t-session__day { font-weight: 700; font-size: 1.25rem; color: var(--t-brand); }
.t-session__mon { font-size: .7rem; color: var(--t-muted); margin-top: .1rem; }
.t-session__main { flex: 1 1 auto; min-width: 0; }
.t-session__circle { font-weight: 600; color: var(--t-ink); }
.t-session__when { font-size: .82rem; color: var(--t-muted); margin-top: .15rem; }
.t-session .t-chevron-fwd { flex: 0 0 auto; color: var(--t-muted); font-size: 1.3rem; }

@media (max-width: 575px) {
  .t-learner__action .btn { padding-inline: .6rem; }
}

/* section sub-heading above a grid/panel */
.t-section-title { font-weight: 600; font-size: 1.05rem; color: var(--t-ink); margin: 0 0 .9rem; }

/* hub cards (home: role shortcuts) -------------------------- */
.t-hub {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); padding: 1.15rem 1.25rem;
  box-shadow: var(--t-shadow); text-decoration: none; color: var(--t-ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.t-hub:hover { transform: translateY(-3px); box-shadow: var(--t-shadow-hover); border-color: #bcdcd2; color: var(--t-ink); }
.t-hub__icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--t-green-soft); }
.t-hub__body { min-width: 0; }
.t-hub__title { font-weight: 600; font-size: 1.05rem; margin-bottom: .2rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.t-hub__desc { color: var(--t-muted); font-size: .9rem; }

/* Small variant: the manager's home opens with three of these as a toolbar, so the card shrinks to
   its title. Wrapping flex rather than .t-grid — auto-fill would leave a half-width orphan when the
   third card drops to its own row. */
.t-quick { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.t-quick__label { font-size: .8rem; font-weight: 600; color: var(--t-muted); margin: 0 0 .45rem; }

/* الإعلانات as one line above the action row: label, newest notice, how many more, and the single
   control at the end. The notice truncates rather than wrapping — the strip must stay one line, or
   it stops being a strip. */
.t-strip {
  display: flex; align-items: center; gap: .6rem;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); box-shadow: var(--t-shadow);
  padding: .5rem .85rem; margin-bottom: 1.2rem;
}
.t-strip__main { display: flex; align-items: center; gap: .5rem; flex: 1 1 auto; min-width: 0; text-decoration: none; color: var(--t-ink); }
.t-strip__label { flex: 0 0 auto; font-size: .78rem; font-weight: 600; color: var(--t-muted); }
.t-strip__text { min-width: 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-strip__more { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--t-brand); font-variant-numeric: tabular-nums; }
.t-strip__add { flex: 0 0 auto; font-size: .85rem; font-weight: 600; color: var(--t-green); text-decoration: none; white-space: nowrap; }
.t-strip__add:hover { text-decoration: underline; }
.t-quick > .t-hub { flex: 1 1 7rem; }
.t-hub--sm { padding: .65rem .8rem; align-items: center; justify-content: center; text-align: center; }
.t-hub--sm:hover { transform: translateY(-2px); }
.t-hub--sm .t-hub__title { font-size: .92rem; margin-bottom: 0; justify-content: center; }

/* A count inside a small card's title. Same font size as the label it follows, so the card's box
   stays identical to the action cards above; colour does the work instead — and it is a SCALE, not
   decoration. --t-brand (#0f3d3e) is a hair off --t-ink (#16231f), so a "plain" count was reading as
   ordinary black text and the two states looked the same.
     amber = a gap in the roster, true last week and still true tomorrow
     red   = someone is blocked right now (locked out, or a teacher waiting on access) */
.t-hub__n { font-weight: 700; color: var(--t-amber); font-variant-numeric: tabular-nums; }
.t-hub__n--flag { color: var(--t-red); }

/* simple data table inside a .t-panel (session history) ----- */
.t-table { width: 100%; border-collapse: collapse; }
.t-table th { text-align: start; font-weight: 600; color: var(--t-brand); background: var(--t-th-bg); padding: .7rem 1rem; font-size: .9rem; border-bottom: 1px solid var(--t-line); }
.t-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--t-line); }
.t-table tr:last-child td { border-bottom: 0; }
.t-table tbody tr:hover { background: var(--t-row-hover); }
.t-table .btn { border-radius: 999px; }
/* An in-page filter hides rows by setting [hidden]. The mobile block below re-declares
   `.t-table tr { display: block }`, which outranks the browser's own [hidden] rule — without
   this line a filtered-out row would keep showing on phones. */
.t-table tr[hidden] { display: none; }

/* empty state */
.t-empty { background: var(--t-surface); border: 1px dashed var(--t-line); border-radius: var(--t-radius); padding: 1.6rem; text-align: center; color: var(--t-muted); }

/* ============================================================
   MOBILE (<768px): every .t-table becomes labeled cards — one
   card per row, each cell shows its column label (data-label).
   Add data-label="..." to every <td>; action-only cells use
   data-label="" to drop the label.
   ============================================================ */
@media (max-width: 767.98px) {
  /* a panel that only wraps a table sheds its frame so the row-cards stand alone — but not one that
     opted out below: :has() carries its argument's specificity, so this rule would outrank .t-panel--grid
     and hand the scrolling table back overflow: visible. */
  .t-panel:has(> .t-table):not(.t-panel--grid) { border: 0; box-shadow: none; background: transparent; border-radius: 0; overflow: visible; }

  .t-table thead { display: none; }
  .t-table, .t-table tbody, .t-table tr, .t-table td { display: block; width: 100%; }
  .t-table tr {
    border: 1px solid var(--t-line); border-radius: 14px; margin-bottom: .65rem;
    background: var(--t-surface); box-shadow: var(--t-shadow); padding: .35rem .8rem;
  }
  .t-table tbody tr:hover { background: var(--t-surface); }
  /* A pick row borrows .rs-row--pick for the ticked highlight. Its negative inline margin was cut
     for a flex row inside a card; on a row-card it would hang outside the container. */
  .t-table tr.rs-row--pick { margin-inline: 0; }
  .t-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    border: 0; border-bottom: 1px solid #f0f4f2; padding: .6rem .1rem; text-align: end;
  }
  .t-table tr td:last-child { border-bottom: 0; }
  .t-table td::before {
    content: attr(data-label); font-weight: 600; color: var(--t-muted);
    text-align: start; flex: 0 0 auto; white-space: nowrap;
  }
  .t-table td[data-label=""]::before { display: none; }
  .t-table td[data-label=""] { justify-content: flex-end; padding-top: .35rem; }

  /* Opt out: a table that is a GRID of dense values — logs, where the point is scanning a column
     of timestamps — reads worse stacked. It stays a table and scrolls sideways instead. */
  .t-panel--grid { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--t-line); background: var(--t-surface); border-radius: var(--t-radius); }
  .t-panel--grid .t-table { display: table; width: max-content; min-width: 100%; }
  .t-panel--grid .t-table thead { display: table-header-group; }
  .t-panel--grid .t-table tbody { display: table-row-group; }
  /* :not([hidden]) so a row a filter hid stays hidden — .t-table tr[hidden] ties this on specificity
     and loses on source order. */
  .t-panel--grid .t-table tr:not([hidden]) { display: table-row; border: 0; border-radius: 0; margin: 0; padding: 0; box-shadow: none; background: transparent; }
  .t-panel--grid .t-table td {
    display: table-cell; text-align: start; border: 0; border-bottom: 1px solid var(--t-line);
    padding: .6rem .8rem; white-space: nowrap; width: auto;
  }
  .t-panel--grid .t-table td::before { content: none; }
  /* the message is the one column allowed to wrap, so a long line does not stretch the row forever */
  .t-panel--grid .t-table td.lg-msg { white-space: normal; min-width: 18rem; }

  /* action buttons: stay in a row, don't wrap on mobile */
  .t-table td .d-flex.flex-wrap { flex-wrap: nowrap !important; }

}

/* Hide secondary columns on narrow screens (<576px). The grid-panel block above re-declares
   `.t-panel--grid .t-table td { display: table-cell }` at (0,2,1), which outranks a bare
   `.t-col-opt` at (0,1,0): the header cell hid, the body cell did not, and every column after it
   sat under the wrong heading. The qualified selectors below outrank it — and both th AND td must
   be listed, or the table misaligns the other way. */
@media (max-width: 575.98px) {
  .t-col-opt,
  .t-panel--grid .t-table th.t-col-opt,
  .t-panel--grid .t-table td.t-col-opt { display: none; }
}

/* sticky first column + edge fade for dense grids (all widths) */
.t-panel--grid .t-table th:first-child,
.t-panel--grid .t-table td:first-child {
  position: sticky; inset-inline-start: 0; z-index: 2; background: var(--t-surface);
}
.t-panel--grid .t-table th:first-child { background: var(--t-th-bg); }
.t-panel--grid .t-table tbody tr:hover td:first-child { background: var(--t-row-hover); }
/* No edge fade. It was meant to hint "this table scrolls sideways", but CSS cannot ask whether the
   panel actually overflows, so it painted a 1.5rem shadow down the inline-end of EVERY grid table —
   including the great majority that fit and never scroll. The sticky first column below is the real
   affordance, and it costs nothing when there is nothing to scroll. */
.t-panel--grid { position: relative; }

/* auth pages (anonymous) — centered branded card --------------- */
.t-auth { max-width: 440px; margin: 2.4rem auto; }
.t-auth--wide { max-width: 660px; }
.t-auth__brand { text-align: center; margin-bottom: 1.1rem; }
.t-auth__logo { display: block; width: 56px; height: 56px; margin: 0 auto .6rem; border-radius: 11px; }
.t-auth__brand .mark { font-weight: 700; font-size: 1.7rem; color: var(--t-brand); letter-spacing: -.01em; }
.t-auth__card { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius); box-shadow: var(--t-shadow); padding: 1.7rem 1.6rem; }
.t-auth__title { font-weight: 600; font-size: 1.3rem; margin-bottom: .2rem; color: var(--t-ink); }
.t-auth__sub { color: var(--t-muted); font-size: .92rem; margin-bottom: 1.2rem; }

/* Registration form: two named sections, a required-marker, and the approval notice that has to be
   read before anyone starts typing. */
.rf-sec { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 .8rem; color: var(--t-ink); }
.rf-sec:first-of-type { margin-top: .5rem; }
.rf-req { color: #c0392b; font-weight: 700; }
/* The "no account yet?" door at the foot of the login card — separated by a rule so it reads as a
   different action, not a third line of fine print. */
.t-auth__alt {
  display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap;
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--t-line);
  font-size: .88rem; color: var(--t-muted);
}

/* A password handed over once: big enough to read aloud from across a desk, monospaced so 0/O and
   1/l are distinguishable, and boxed so it cannot be mistaken for body text. */
.pi-card {
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius);
  box-shadow: var(--t-shadow); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; max-width: 34rem;
}
.pi-label { font-size: .8rem; font-weight: 600; color: var(--t-muted); margin-bottom: .5rem; }
.pi-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.pi-value {
  flex: 1 1 12rem; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; color: var(--t-ink);
  background: var(--t-green-soft); border-radius: .5rem; padding: .55rem .8rem;
  user-select: all; word-break: break-all;
}
.pi-note { color: var(--t-muted); font-size: .85rem; margin: .8rem 0 0; }

.pw-wrap { position: relative; }
.pw-wrap > .form-control { padding-inline-end: 46px; }
/* Edge ships its own reveal eye on password inputs — one eye per field is enough. */
.pw-wrap > input::-ms-reveal, .pw-wrap > input::-ms-clear { display: none; }
/* 44px square (a finger-sized target) centred on the field's end edge; it overhangs the ~38px input a
   few pixels top and bottom, which is invisible because the button has no background. inline-end puts
   it on the left in Arabic and on the right in English. */
.pw-eye {
  position: absolute; inset-block-start: 50%; inset-inline-end: 0; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; background: none; border-radius: .4rem; cursor: pointer; color: var(--t-muted);
}
.pw-eye:hover { color: var(--t-ink); }
.pw-eye:focus-visible { outline: 2px solid var(--t-green); outline-offset: 1px; }
.pw-eye .t-ico { width: 18px; height: 18px; }
.rf-note {
  background: var(--t-green-soft); border: 1px solid var(--t-line);
  border-radius: .6rem; padding: .6rem .8rem; margin-bottom: 1rem;
  font-size: .85rem; color: var(--t-ink);
}

/* friendly "add a child" form (cf-*) — warm, guided, larger targets ---- */
/* Card forms sit at the width of the teacher-side cards (34rem + room for two columns), not page-wide. */
.cf-wrap { max-width: 620px; margin-inline: auto; }

/* الدور as chips: every role this staff may create in one row, one tap, no list to open. */
.rc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.rc-chip { position: relative; }
.rc-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rc-chip span {
  display: block; border: 1px solid var(--t-line); border-radius: 999px; background: var(--t-surface);
  padding: .34rem .8rem; font-size: .88rem; font-weight: 600; color: var(--t-ink); transition: .12s;
}
.rc-chip input:checked + span { background: var(--t-green); border-color: var(--t-green); color: #fff; }
.rc-chip input:focus-visible + span { box-shadow: 0 0 0 .2rem rgba(21, 115, 71, .25); }
.rc-chip:hover span { border-color: var(--t-green); }
.cf-card__ico { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--t-green); box-shadow: 0 2px 8px rgba(21, 115, 71, .15); }
.cf-card__ico .t-ico { width: 24px; height: 24px; }
/* member forms: short fields two per row; one per row in a narrow card */
.cf-body { container-type: inline-size; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.cf-grid > .cf-field { margin-bottom: 1rem; }
.cf-grid > .cf-field--full { grid-column: 1 / -1; }
@container (max-width: 539.98px) { .cf-grid { grid-template-columns: minmax(0, 1fr); } }
.cf-member { counter-reset: cfsec; }
.cf-member .cf-section:not([hidden]) > .cf-section__label .cf-num::before { counter-increment: cfsec; content: counter(cfsec); }
.cf-member .cf-section { margin-bottom: 1.15rem; }
.cf-member .cf-field .form-control, .cf-member .cf-field .form-select { min-height: 44px; }
.cf-password { display: flex; gap: .5rem; flex-wrap: wrap; }
.cf-password .form-control { flex: 1 1 11rem; font-weight: 800; letter-spacing: .12em; }
.cf-password .btn { min-height: 44px; border-radius: 12px; font-weight: 700; }
/* t-lookup: type-to-search on the server (a school's parents) */
.t-lookup { position: relative; }
.t-lookup__list { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: .3rem; list-style: none; background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px; box-shadow: var(--t-shadow); max-height: 18rem; overflow: auto; }
.t-lookup__opt { padding: .55rem .7rem; border-radius: 8px; cursor: pointer; }
.t-lookup__opt:hover, .t-lookup__opt.is-active { background: var(--t-green-soft); }
.t-lookup__msg { padding: .55rem .7rem; color: var(--t-muted); font-size: .88rem; }
.rs-lookup { flex: 1 1 14rem; }
/* circle form: meeting days as toggle chips, the default direction as two option cards */
.cc-days { display: flex; flex-wrap: wrap; gap: .45rem; }
.cc-day { position: relative; cursor: pointer; margin: 0; }
.cc-day input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cc-day span { display: inline-flex; align-items: center; min-height: 40px; padding: .35rem .95rem; border-radius: 999px; border: 1.5px solid var(--t-line); background: var(--t-surface); font-weight: 600; color: var(--t-ink); transition: background .12s ease, border-color .12s ease; }
.cc-day input:checked + span { background: var(--t-green-soft); border-color: var(--t-green); color: var(--t-green); }
.cc-day input:checked + span::before { content: "✓"; margin-inline-end: .3rem; }
.cc-day input:focus-visible + span { outline: 2px solid var(--t-green); outline-offset: 2px; }
.cc-dirs { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem; }
.cc-dir { position: relative; display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: .7rem .85rem; border: 1.5px solid var(--t-line); border-radius: 12px; background: var(--t-surface); cursor: pointer; }
.cc-dir input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cc-dir:has(input:checked) { border-color: var(--t-green); background: var(--t-green-soft); }
.cc-dir:has(input:disabled) { cursor: not-allowed; opacity: .75; }
.cc-dir:has(input:focus-visible) { outline: 2px solid var(--t-green); outline-offset: 2px; }
.cc-dir__title { font-weight: 700; }
.cc-dir__hint { font-size: .8rem; line-height: 1.5; color: var(--t-muted); }
/* a search list must not be clipped by the card it opens in (cf-card hides overflow for its rounded head) */
.cf-card:has(.t-lookup) { overflow: visible; }
.cf-card:has(.t-lookup) > .cf-card__head { border-start-start-radius: inherit; border-start-end-radius: inherit; }
.cf-card { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius); box-shadow: var(--t-shadow); overflow: hidden; }
.cf-card__head { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; background: linear-gradient(120deg, var(--t-green-soft), #eef8f1); border-bottom: 1px solid var(--t-line); }
.cf-avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem; line-height: 1;
  background: radial-gradient(circle at 32% 26%, #fff6df, var(--t-gold));
  box-shadow: 0 4px 14px rgba(245, 196, 81, .45), inset 0 0 0 3px rgba(255, 255, 255, .55);
}
.cf-card__title { font-weight: 700; font-size: 1.05rem; color: var(--t-brand); }
.cf-card__sub { color: var(--t-muted); font-size: .82rem; margin-top: .1rem; }
.cf-body { padding: 1rem 1.1rem 1.1rem; }

.cf-section { margin-bottom: 1.05rem; }
.cf-section:last-of-type { margin-bottom: .6rem; }
.cf-section__label {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: .88rem; color: var(--t-green);
  margin-bottom: .6rem; padding-bottom: .4rem; border-bottom: 1px dashed var(--t-line);
}
.cf-num {
  flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%;
  background: var(--t-green); color: #fff; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800;
}

.cf-field { margin-bottom: .7rem; }
.cf-field:last-child { margin-bottom: 0; }
.cf-field > label { font-weight: 600; font-size: .85rem; color: var(--t-ink); margin-bottom: .25rem; display: block; }
.cf-field .form-control, .cf-field .form-select { min-height: 44px; border-radius: 10px; border-color: #d7e4de; font-size: 16px; }
.cf-field .form-control:focus, .cf-field .form-select:focus { border-color: var(--t-green); box-shadow: 0 0 0 .2rem rgba(21, 115, 71, .16); }
.cf-hint { font-size: .82rem; color: var(--t-muted); margin-top: .4rem; display: flex; gap: .4rem; align-items: flex-start; line-height: 1.5; }
.cf-hint__ico { flex: 0 0 auto; opacity: .8; }

/* «تتصفح كمدير النظام» — the bar a SuperAdmin sees on every page of a school they are visiting.
   Amber so it never reads as part of the school's own UI, and its way back never scrolls away. */
.sa-bar { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; justify-content: space-between;
          background: var(--t-amber-soft); color: var(--t-amber-ink); border-bottom: 1px solid #e6c294;
          padding: .5rem 1rem; font-size: .9rem; }
.sa-bar__who { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.sa-bar__ico .t-ico { width: 18px; height: 18px; }
.sa-bar__go { display: inline-flex; gap: .4rem; flex: 0 0 auto; }
.sa-bar__go .btn { border-radius: 10px; font-weight: 600; }
@media (max-width: 575px) { .sa-bar { font-size: .84rem; } .sa-bar__go .btn { padding-inline: .6rem; } }
[data-bs-theme="dark"] .sa-bar { border-bottom-color: #4a3618; }
[data-bs-theme="dark"] .sa-bar__go .btn-dark { background: var(--t-amber-ink); border-color: var(--t-amber-ink); color: #1a1205; }
[data-bs-theme="dark"] .sa-bar__go .btn-outline-dark { color: var(--t-amber-ink); border-color: var(--t-amber-ink); }

/* read-only facts inside a card form (الملف الشخصي): the same two-column rhythm as .cf-grid,
   but the values are text — nothing here posts, so nothing here looks like a field. */
.pf-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .9rem; }
/* dashed, like every other read-only surface here (.t-empty) — so it never reads as a field. */
.pf-fact { background: var(--t-bg); border: 1px dashed var(--t-line); border-radius: 12px; padding: .6rem .8rem; min-width: 0; }
.pf-fact__k { display: block; font-size: .78rem; color: var(--t-muted); margin-bottom: .15rem; }
.pf-fact__v { display: block; font-weight: 600; color: var(--t-ink); overflow-wrap: anywhere; }
@media (max-width: 575px) { .pf-facts { grid-template-columns: 1fr; } }

.cf-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.cf-actions .btn { min-height: 44px; border-radius: 10px; font-weight: 700; padding-inline: 1.5rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.cf-actions .btn-success { flex: 1 1 auto; font-size: 1.05rem; box-shadow: 0 6px 16px rgba(21, 115, 71, .25); }
.cf-actions .btn-success:hover { box-shadow: 0 8px 20px rgba(21, 115, 71, .32); }
@media (max-width: 575px) { .cf-actions { flex-direction: column-reverse; } .cf-actions .btn { width: 100%; } }

/* searchable select (t-combo) — progressive enhancement of a native <select>;
   the hidden <select> stays the form's source of truth, the button + panel drive it.
   Token-based, so it adapts to dark mode and RTL for free. */
.t-combo-wrap { position: relative; }
.t-combo-wrap > select.t-combo { display: none; }
.t-combo__control { display: flex; align-items: center; width: 100%; text-align: start; cursor: pointer; }
.t-combo__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-combo__control.is-empty .t-combo__value { color: var(--t-muted); }
.t-combo__pop {
  position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px);
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px;
  box-shadow: var(--t-shadow-hover); padding: .5rem;
}
.t-combo__search { margin-bottom: .45rem; }
.t-combo__list { list-style: none; margin: 0; padding: 0; max-height: 244px; overflow-y: auto; }
.t-combo__opt {
  padding: .55rem .6rem; border-radius: 8px; cursor: pointer;
  font-size: .95rem; line-height: 1.35; color: var(--t-ink);
}
.t-combo__opt[hidden] { display: none; }
.t-combo__opt:hover, .t-combo__opt.is-active { background: var(--t-green-soft); }
.t-combo__opt.is-selected { background: var(--t-green-soft); color: var(--t-green); font-weight: 700; }
.t-combo__empty { padding: .65rem; text-align: center; color: var(--t-muted); font-size: .9rem; }

/* roster-gap manage lists (rg-*) — inline "link parent" / "enroll" per row --- */
.rg-wrap { max-width: 720px; }

/* roster setup: friendly cf-card sections with cleanly-aligned rows (rs-*) --- */
.rs-card { margin-bottom: 1.4rem; scroll-margin-top: 70px; }
.rs-card .cf-card__title .mh-badge { margin-inline-start: .5rem; }
/* Page head without the hero block. On a narrow screen the gradient banner was the loudest thing
   on the first fold and carried nothing actionable — the school name never changes and the date is
   already on the phone. The page states its own condition instead. */
.t-pagehead { margin-bottom: 1rem; }
.t-pagehead__t { font-size: 1.4rem; font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.t-pagehead__s { color: var(--t-muted); font-size: .85rem; margin: .2rem 0 0; }

/* Section heading between panels — the manager dashboard needs one and there was no shared rule,
   which is part of why it grew its own mh-sec__t. */
.t-h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.8rem 0 .7rem;
  color: var(--t-ink);
}
.t-h2:first-of-type { margin-top: 0; }

/* Roster picker: one form per section — a radio list plus a single guardian/circle picker at the
   foot. Replaces a form (and a full re-rendered option list) on every single row. */
.rs-row--pick { cursor: pointer; border-radius: .5rem; padding-inline: .5rem; margin-inline: -.5rem; }
.rs-row--pick:hover { background: var(--t-green-soft); }
.rs-row--pick:has(.rs-check:checked) { background: var(--t-green-soft); }
.rs-row--pick:has(.rs-check:focus-visible) { outline: 2px solid var(--t-green); outline-offset: -2px; }
.rs-check { flex: none; width: 1.05rem; height: 1.05rem; accent-color: var(--t-green); margin: 0; }
.rs-list { max-height: 26rem; overflow-y: auto; }
/* the box scrolls, so a table inside it must keep its header in view while you tick rows */
.rs-list > .t-table thead th { position: sticky; top: 0; z-index: 1; background: var(--t-surface); }

/* Filter + select-all sit above the list; the filter narrows what "all" means. */
.rs-search { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.rs-search > input[type="search"] { flex: 1 1 auto; min-width: 0; }
.rs-all { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--t-muted); white-space: nowrap; cursor: pointer; }

/* The action bar sticks to the foot of the list so the picker stays reachable on a long roster. */
.rs-bar {
  display: flex; gap: .5rem; align-items: center;
  margin-top: .9rem; padding-top: .9rem;
  border-top: 1px solid var(--t-line);
  position: sticky; bottom: 0; background: var(--t-surface);
}
.rs-bar > .form-select, .rs-bar > .t-combo-wrap { flex: 1 1 auto; min-width: 0; }

.rs-row { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-block-end: 1px solid var(--t-line); flex-wrap: wrap; }
.rs-row:first-child { padding-block-start: 0; }
.rs-row:last-child { border-block-end: 0; padding-block-end: 0; }
.rs-av { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; background: var(--t-green-soft); color: var(--t-green); }
.rs-av .t-ico { width: 20px; height: 20px; }
.rs-main { flex: 1 1 150px; min-width: 0; }
.rs-name { font-weight: 600; }
.rs-name small { font-weight: 400; color: var(--t-muted); margin-inline-start: .35rem; }
.rs-action { flex: 0 0 auto; margin-inline-start: auto; }
.rs-action .input-group { width: 265px; max-width: 100%; }
.rs-action .btn { white-space: nowrap; }
@media (max-width: 520px) {
  .rs-action { flex: 1 1 100%; margin-inline-start: 0; }
  .rs-action .input-group { width: 100%; }
}

/* distinct theming per roster card so the two sections never read as one merged block */
.rs-card .cf-avatar .t-ico { width: 28px; height: 28px; color: #fff; }
.rs-card--children { border-top: 4px solid var(--t-amber); }
.rs-card--children .cf-card__head { background: linear-gradient(120deg, var(--t-amber-soft), #fff3e6); }
.rs-card--children .cf-card__title { color: var(--t-amber); }
.rs-card--children .cf-avatar { background: radial-gradient(circle at 32% 26%, #ffe1bf, var(--t-amber)); box-shadow: 0 4px 14px rgba(192, 86, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .55); }
.rs-card--children .rs-av { background: var(--t-amber-soft); color: var(--t-amber); }
.rs-card--students { border-top: 4px solid var(--t-green); }
.rs-card--students .cf-card__head { background: linear-gradient(120deg, var(--t-green-soft), #eef8f1); }
.rs-card--students .cf-card__title { color: var(--t-green); }
.rs-card--students .cf-avatar { background: radial-gradient(circle at 32% 26%, #cdeede, var(--t-green)); box-shadow: 0 4px 14px rgba(21, 115, 71, .35), inset 0 0 0 3px rgba(255, 255, 255, .55); }
.rs-card--students .rs-av { background: var(--t-green-soft); color: var(--t-green); }

/* hero "today" chip on the manager home */
.mh-today { text-align: end; color: #eafaf5; line-height: 1.25; }
.mh-today__dow { display: block; font-weight: 800; font-size: 1.02rem; }
.mh-today__date { display: block; font-size: .82rem; opacity: .82; }

/* primary action tiles (register a learner / create a circle / transfer) */
.mh-quick { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1.3rem; }
@media (max-width: 720px) { .mh-quick { grid-template-columns: 1fr; } }
.mh-action { position: relative; overflow: hidden; display: flex; align-items: center; gap: .95rem;
  text-decoration: none; color: var(--t-ink);
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius);
  padding: 1.05rem 1.2rem; box-shadow: var(--t-shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.mh-action:hover { transform: translateY(-3px); box-shadow: var(--t-shadow-hover); color: var(--t-ink); border-color: #bcdcd2; }
.mh-action::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; }
.mh-action--student::before { background: var(--t-green); }
.mh-action--circle::before { background: var(--t-amber); }
.mh-action__ico { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; }
.mh-action__ico .t-ico { width: 24px; height: 24px; }
.mh-action--student .mh-action__ico { background: var(--t-green-soft); color: var(--t-green); }
.mh-action--circle .mh-action__ico { background: var(--t-amber-soft); color: var(--t-amber); }
.mh-action--transfer::before { background: #2b5c8a; }
.mh-action--transfer .mh-action__ico { background: #eef4fb; color: #2b5c8a; }
.mh-action__text { display: flex; flex-direction: column; }
.mh-action__title { font-weight: 800; font-size: 1.06rem; color: var(--t-ink); }
.mh-action__sub { font-size: .84rem; color: var(--t-muted); }
.mh-action__go { margin-inline-start: auto; color: var(--t-muted); }

/* phone tuning — comfortable single-column cards */
@media (max-width: 560px) {
  .mh-quick, .mh-row { grid-template-columns: 1fr; }
  .mh-card { padding: 1rem 1.05rem 1.05rem; }
  .mh-card__head .mh-title { font-size: .98rem; }
  .mh-tally { gap: .4rem; }
  .mh-tally__n b { font-size: 1.35rem; }
  .t-hero.mh-hero { flex-wrap: wrap; row-gap: .5rem; }
  .mh-today { text-align: start; }
}

/* shell polish — topbar + footer in the Calm Scholarly finish ---- */
.app-topbar {
  background: var(--t-surface);
  border-bottom: 1px solid var(--t-line);
  box-shadow: 0 1px 3px rgba(15, 61, 62, .05);
}
.app-topbar-brand { color: var(--t-brand); font-size: 1.2rem; letter-spacing: -.01em; }
.app-topbar .btn { border-radius: 999px; }
.app-footer {
  text-align: center;
  color: var(--t-muted);
  border-top: 1px solid var(--t-line);
  background: var(--t-surface);
}
.app-footer a { color: var(--t-green); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* mobile bottom navigation — always-visible, large icon+label targets (older-user friendly).
   Hidden on desktop where the pinned sidebar takes over. */
.app-bottomnav { display: none; }
@media (max-width: 767.98px) {
  .app-bottomnav {
    display: flex;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 1035;
    background: #fff; border-top: 1px solid var(--t-line);
    box-shadow: 0 -2px 12px rgba(15, 61, 62, .10);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .app-bottomnav .bn-item {
    flex: 1 1 0; min-width: 0; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: .4rem .2rem; min-height: 58px;
    background: transparent; border: 0; font: inherit;
    color: var(--t-muted); text-decoration: none; cursor: pointer;
  }
  .app-bottomnav .bn-ico { font-size: 1.35rem; line-height: 1; }
  .app-bottomnav .bn-lbl { font-size: .72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .app-bottomnav .bn-item.active { color: var(--t-brand); }
  /* teacher: الرئيسية as a raised, highlighted centre button */
  .app-bottomnav .bn-item--home { color: var(--t-green); font-weight: 700; }
  .app-bottomnav .bn-item--home .bn-ico {
    background: var(--t-green); color: #fff;
    width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center; margin-top: -16px;
    box-shadow: 0 4px 12px rgba(21, 115, 71, .40);
  }
  .app-bottomnav .bn-item--home .bn-ico .t-ico { width: 24px; height: 24px; }
  .app-bottomnav .bn-badge { position: absolute; top: 5px; inset-inline-end: calc(50% - 18px); background: #dc3545; color: #fff; font-size: .62rem; font-weight: 700; border-radius: 999px; padding: 0 .32rem; }
  /* keep page content clear of the fixed bar */
  .app-main { padding-bottom: 80px; }
  /* one line for the school name on phones (a long name used to wrap to 3 lines) */
  .app-topbar-brand { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
}

/* ===== smart recording ===== */
/* tapping labels/buttons/chips/surah-list shouldn't highlight text (esp. on a phone) */
.qrec, #change-panel { -webkit-user-select:none; -moz-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent; }
.qrec input, .qrec textarea, #change-panel input, #change-panel textarea { -webkit-user-select:text; user-select:text; }
:root{--tab-lesson:#198754;--tab-prev:#0d6efd;--tab-rev:#fd7e14}   /* the three part colours (dark overrides below) */
.part{position:relative;border:1px solid #e6ecea;border-radius:11px;padding:.7rem .8rem;background:#fcfefe;margin-top:.6rem}
.part-lesson{border-top:3px solid var(--tab-lesson)}
.part-revision{border-top:3px solid var(--tab-rev)}
.part.incomplete .part-ttl{padding-inline-end:8rem}   /* room for the absolute .end-hint badge */
.part-ttl{font-weight:700;font-size:.9rem;margin-bottom:.5rem;display:flex;align-items:center;gap:.35rem;flex-wrap:wrap}
.part-lesson .part-ttl{color:#157347}
.part-revision .part-ttl{color:#c05600}
.part-target-lbl{font-size:.72rem;color:var(--t-muted);font-weight:600}
/* "آخر درس / آخر مراجعة" — the resume point, riding the card's title line: coloured text + 🔖 so it
   still scans instantly, without spending a whole plaque-height line of its own. */
.anchor{
  display:inline-flex;align-items:center;gap:.3rem .4rem;flex-wrap:wrap;
  font-weight:600;
}
.part-lesson   .anchor{--anchor-bg:var(--t-green-soft);--anchor-line:#cfe7d9;--anchor-bar:var(--t-green);--anchor-ink:#0f6b3e}
.part-revision .anchor{--anchor-bg:var(--t-amber-soft);--anchor-line:#eccfa8;--anchor-bar:var(--t-amber);--anchor-ink:var(--t-amber-ink)}
.anchor-lbl{
  display:inline-flex;align-items:center;gap:.3rem;
  font-weight:700;font-size:.78rem;
  color:var(--anchor-bar,#157347);
}
.anchor-lbl::before{content:"🔖";font-size:.9rem;filter:saturate(.9)}   /* "where we left off" marker */
.anchor-val{
  font-weight:800;font-size:.95rem;line-height:1.1;letter-spacing:.01em;
  color:var(--anchor-ink,#0f6b3e);
}
.part-revision .anchor-val{color:var(--t-amber-ink)}
.btn-change{border:1px solid #9cc;background:#eef9fb;color:#067;border-radius:999px;font-size:.72rem;padding:.2rem .65rem;min-height:auto}
/* «🔁 دورة جديدة» beside «تغيير» on the آخر مراجعة line. Near the lesson end it is an offer; once the cycle is
   done the picker stays hidden until the teacher presses it. */
.btn-new-cycle{border:1px solid #eccfa8;background:var(--t-amber-soft);color:var(--t-amber-ink);border-radius:999px;font-size:.72rem;font-weight:700;padding:.2rem .65rem;min-height:auto;cursor:pointer}
.btn-new-cycle:hover{background:#fde6d4}
.part.cycle-done .to-row,.part.cycle-done .counts,.part.cycle-done .end-hint,.part.cycle-done .anchor .btn-change{display:none}
/* Another day: درس/مراجعة are view-only — keep the recorded values, drop the editing chrome. */
.qrec-locked__note{font-size:.82rem;font-weight:600;color:var(--t-muted);background:#f3f7f6;border:1px solid var(--t-line);border-radius:9px;padding:.4rem .7rem;margin-bottom:.6rem}
.qrec-locked .part .chips,.qrec-locked .part .surah-step,.qrec-locked .part .ayah-step,.qrec-locked .part .num-step,
.qrec-locked .part .btn-change,.qrec-locked .part .end-hint,.qrec-locked .part .skip-toggle{display:none !important}

/* First session for a learner: a step-by-step wizard takes the place of both cards until «تم». */
.nl-wiz{display:none}
.qrec-row.nl-active .part{display:none !important}
.qrec-row.nl-active.open .qrec-entry{display:block}
.qrec-row.nl-active.open .nl-wiz{display:block}
.nl-wiz{flex:1;background:var(--t-surface,#fff);border:1px solid var(--t-line);border-top:3px solid var(--t-amber);border-radius:11px;padding:.75rem .85rem;margin-top:.6rem}
.nl-wiz__head{display:flex;align-items:flex-start;justify-content:space-between;gap:.6rem}
.nl-wiz__title{font-weight:700;font-size:.88rem;color:var(--t-amber-ink)}
.nl-wiz__count{flex:0 0 auto;font-size:.75rem;font-weight:700;color:var(--t-muted);background:var(--t-amber-soft);border-radius:999px;padding:.05rem .55rem;direction:ltr}
.nl-wiz__claim{font-size:.78rem;color:var(--t-muted);margin-top:.2rem}
.nl-wiz__q{font-size:1rem;font-weight:800;color:var(--t-brand);margin:.7rem 0 .2rem}
.nl-wiz__why{font-size:.8rem;line-height:1.5;color:var(--t-muted);margin:0 0 .55rem}
.nl-wiz__memo{color:var(--t-ink);font-weight:600}
.nl-wiz__opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:.5rem}
.nl-wiz__opt{display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;text-align:start;border:1.5px solid var(--t-line);background:#fff;border-radius:10px;padding:.55rem .7rem;cursor:pointer;color:var(--t-ink);transition:border-color .12s ease,background .12s ease}
.nl-wiz__opt strong{font-size:.9rem}
.nl-wiz__opt span{font-size:.76rem;line-height:1.45;color:var(--t-muted)}
.nl-wiz__opt:hover{border-color:#b6dcc5}
.nl-wiz__opt.is-on{border-color:var(--t-green);background:var(--t-green-soft)}
.nl-wiz__opt.is-on strong::before{content:"✓ ";color:var(--t-green)}
.nl-wiz__step[data-step="3"] .nl-wiz__opt.is-on{border-color:var(--t-amber);background:var(--t-amber-soft)}
.nl-wiz__step[data-step="3"] .nl-wiz__opt.is-on strong::before{color:var(--t-amber)}
.nl-wiz__nav{display:flex;justify-content:flex-end;gap:.5rem;margin-top:.75rem}
.nl-wiz__nav .btn{min-height:38px;min-width:6rem;font-weight:700}
/* Hidden, not greyed: with no start chosen the surah list is empty and the آية box blank, so a
   dimmed copy of it is just an unexplained gap. It appears the moment the question is answered. */
.part.needs-start .to-row{display:none}
.part.needs-start .anchor .btn-change{display:none}   /* the same control, offered above */
/* …except on «مراجعة الدرس السابق» with no previous lesson: «تغيير» IS how مخصص gets its start. */
.part-prevlesson.needs-start .anchor .btn-change{display:inline-block}

.to-row{display:flex;align-items:center;gap:.45rem .55rem;flex-wrap:wrap;margin-bottom:.45rem}
.to-row .to-lbl{flex:0 0 auto;font-size:.85rem;color:#566;font-weight:600}
/* surah navigator: ‹ name › — steppers flank the name (one surah per press) */
.surah-nav{flex:1 1 auto;display:flex;align-items:center;gap:.3rem;min-width:0}
.surah-nav .q-surah,.surah-nav .rr-surah{flex:1 1 auto;min-width:0;font-size:16px;min-height:44px;font-weight:700;text-align:center}
.surah-step{flex:0 0 auto;min-width:42px;min-height:44px;border:1px solid #b6dcc5;background:#eef9f1;color:#157347;border-radius:10px;font-weight:900;font-size:1.25rem;line-height:1;padding:0;cursor:pointer;transition:background .12s ease}
.surah-step:hover:not(:disabled){background:#dcefe3}
.surah-step:disabled{opacity:.4;cursor:not-allowed}
.part-revision .surah-step{border-color:#f3cda0;background:#fff7ee;color:#c05600}
.part-revision .surah-step:hover:not(:disabled){background:#fde6d4}
/* ayah row: آية [n] ⁄ max — the bound shown at the point of entry */
.ayah-row{flex:1 1 100%;display:flex;flex-wrap:nowrap;justify-content:center;align-items:center;gap:.25rem;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}
.ayah-row::-webkit-scrollbar{display:none}
.ayah-row .ayah-lbl{flex:0 0 auto;font-size:.85rem;color:#566;font-weight:600;white-space:nowrap}
.ayah-row .q-ayah,.ayah-row .rr-ayah{flex:0 0 3.4rem;min-width:3.4rem;width:auto;max-width:6rem;text-align:center;font-weight:800;font-size:1.15rem;min-height:44px;border:1px solid #157347;border-radius:9px}
.ayah-step{flex:1 1 auto;min-width:28px;max-width:46px;min-height:44px;border:1px solid #b6dcc5;background:#eef9f1;color:#157347;border-radius:9px;font-weight:900;font-size:1.2rem;line-height:1;padding:0;cursor:pointer;transition:background .12s ease}
.ayah-step:hover:not(:disabled){background:#dcefe3}
.ayah-step:disabled{opacity:.4;cursor:not-allowed}
/* ±5 / ±10 jumps — same pill, slightly smaller text so they read as coarse steps */
.ayah-step--big{min-width:30px;font-size:.85rem;font-weight:800}
/* a very narrow phone keeps ±1 and ±10 on one line */
@media (max-width:379.98px){.qrec .ayah-step--big[data-d="5"],.qrec .ayah-step--big[data-d="-5"]{display:none}}
.part-revision .ayah-step{border-color:#f3cda0;background:#fff7ee;color:#c05600}
.part-revision .ayah-step:hover:not(:disabled){background:#fde6d4}
.part-revision .ayah-row .q-ayah,.part-revision .ayah-row .rr-ayah{border-color:#c05600}
.part.incomplete .ayah-row .q-ayah{box-shadow:0 0 0 2px #f0d68a}
.ayah-max{flex:0 0 auto;font-size:.9rem;color:#789;font-weight:700;white-space:nowrap}
@media (max-width:420px){.ayah-row{gap:.15rem}.ayah-row .q-ayah{font-size:1.05rem}}
/* very narrow phones: the field itself is self-evident, so drop the word "آية" and keep the bound. */
@media (max-width:360px){.ayah-row .ayah-lbl{display:none}.ayah-step{min-width:26px}}
/* the آية stepper with the unit chips directly under it — one column, so the chips share its width */
.ayah-col{flex:1 1 100%;display:flex;flex-direction:column;gap:.4rem;min-width:0}
/* each chip names its own action («إلى نهاية الجزء تبارك»): a two-column grid, so long juz/hizb names wrap inside
   their cell instead of pushing the row sideways. width:0 + min-width:100% — never wider than the stepper. */
.chips{display:grid;grid-template-columns:1fr 1fr;gap:.35rem;width:0;min-width:100%}
.chips .chip{min-width:0;overflow-wrap:anywhere;justify-content:center;text-align:center}
.chip{border:1px solid #9cc;background:#f0fafa;color:#067;border-radius:999px;font-size:.74rem;padding:.35rem .65rem;min-height:auto}
.end-hint{display:none;position:absolute;top:.6rem;inset-inline-end:.8rem;z-index:1;font-size:.68rem;color:#b26a00;background:#fff3d6;border:1px solid #f0d68a;border-radius:999px;padding:.1rem .45rem;white-space:nowrap}
.part.incomplete .end-hint{display:block}
/* التقييم — three always-visible choices, colours match the old cycle states. */
.qual { display:inline-flex; border:1px solid var(--bs-border-color); border-radius:999px; overflow:hidden; }
.qual-opt { display:inline-flex; align-items:center; justify-content:center; min-height:44px; cursor:pointer; border:0; background:transparent; padding:.3rem .65rem; font-size:.85rem; line-height:1.2; }
.qual-opt + .qual-opt { border-inline-start:1px solid var(--bs-border-color); }
.qual-opt.on[data-q="Excellent"]  { background:#157347; color:#fff; }
.qual-opt.on[data-q="Acceptable"] { background:#f2c200; color:#3d2f00; }
.qual-opt.on[data-q="Repeat"]     { background:#dc2626; color:#fff; }
/* absent student ⇒ greyed, disabled entry */
.qrec-row.is-absent .part,.qrec-row.is-excused .part{opacity:.5;filter:grayscale(.4)}
/* revision with nothing memorized yet ⇒ inert/greyed */
.part.no-start{opacity:.5}
/* "لا درس / لا مراجعة اليوم" per-part skip */
.skip-toggle{display:inline-flex;align-items:center;gap:.4rem;font-size:.78rem;font-weight:700;color:var(--t-muted);cursor:pointer;margin:.15rem 0 .45rem}
.skip-toggle input{width:16px;height:16px;accent-color:var(--t-amber)}
.part.skipped .skip-toggle{color:var(--t-amber)}
.part-ttl .skip-toggle{margin:0;gap:.3rem;font-weight:600;white-space:nowrap}
.part-ttl .skip-toggle input{width:14px;height:14px;margin:0}
.part.skipped .anchor,.part.skipped>.to-row,.part.skipped>.end-hint,.part.skipped>.counts{display:none}
/* one grading line: شكّات | تردد | التقييم, each a caption over its control */
.counts{display:flex;gap:.6rem;margin-top:.35rem;align-items:flex-end}
.counts .cf{flex:1 1 0;min-width:0;font-size:.74rem;color:#566;display:flex;flex-direction:column;gap:.2rem}
/* the count's name is its grey placeholder, with no side padding. التقييم is now three options
   (ممتاز|مقبول|يعاد) side by side, so its cell takes its natural width rather than a fixed one. */
.counts .num{padding-inline:0}
.counts .num::placeholder{color:var(--t-muted);opacity:.7;font-weight:600;font-size:.78rem}
.counts .cf-rate{flex:0 0 auto}
/* three controls share the line, so the steppers' buttons slim down */
.counts .num-stepper{gap:.15rem}
.counts .num-step{min-width:26px}
.counts .qual{font-size:.8rem}
.counts .qual-opt{padding:.25rem .5rem}
/* a wide card: surah picker and آية stepper share one line; the unit chips wrap beneath the stepper */
.part{container-type:inline-size}
@container (min-width:640px){
  .to-row{align-items:flex-start}
  .to-row .to-lbl{min-height:44px;display:flex;align-items:center}
  .to-row .surah-nav{flex:1 1 14rem}
  .to-row .ayah-col{flex:1 1 auto}
}
.num-stepper{display:flex;align-items:center;gap:.25rem;min-width:0}
.num-stepper .num{flex:1 1 0;min-width:0;width:100%;min-height:44px;border:1px solid #cfd9d7;border-radius:8px;text-align:center;font-weight:800;font-size:16px}
.num-step{flex:0 0 auto;min-width:38px;min-height:44px;border:1px solid #cfd9d7;background:#f3faf5;color:#157347;border-radius:8px;font-weight:900;font-size:1.15rem;line-height:1;padding:0;cursor:pointer;transition:background .12s ease}
.num-step:hover:not(:disabled){background:#e4f1ea}
.num-step:disabled{opacity:.5;cursor:not-allowed}
/* per-row save feedback (✓ تم الحفظ / ✗) */
.q-status{display:inline-block;margin-top:.15rem;font-size:.78rem;font-weight:700;line-height:1.3;transition:opacity .5s ease}
.q-status.saving{color:#6c757d}
.q-status.ok{color:#157347}
.q-status.bad{color:#dc2626}
.q-status.gone{opacity:0}
/* floating "saved" toast — always visible on a phone */
#q-toast{position:fixed;left:50%;bottom:1.1rem;transform:translateX(-50%) translateY(1rem);z-index:1090;padding:.6rem 1.15rem;border-radius:999px;font-weight:700;font-size:.9rem;color:#fff;background:#157347;box-shadow:0 6px 20px rgba(0,0,0,.22);opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease}
#q-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
#q-toast.bad{background:#dc2626}
/* change-start panel (built by JS, appended to body) */
/* ── «من أين يبدأ؟» — one search, no tabs ──────────────────────────────────
   A column with a fixed head and foot and ONE scrolling middle. The old panel
   let the surah list own a hard max-height:170px, which guillotined a row
   mid-word and left the آية select and «تم» crushed underneath it on a short
   screen. Here the results take whatever is left over and nothing else moves. */
#change-panel{
  position:fixed; z-index:1080; left:50%; top:10%; transform:translateX(-50%);
  background:var(--t-surface); color:var(--t-ink);
  border:1px solid var(--t-line); border-radius:14px;
  box-shadow:0 14px 36px rgba(0,0,0,.25);
  width:360px; max-width:94vw;
  max-height:80vh; display:none;
}
#change-panel.is-open{ display:flex; flex-direction:column; }
#change-panel .cp-header{
  flex:0 0 auto; background:var(--t-brand); color:#fff; padding:.6rem .8rem;
  display:flex; justify-content:space-between; align-items:flex-start; gap:.5rem;
  font-weight:700; border-radius:13px 13px 0 0;
}
/* The title is a sentence, not a word: let it wrap instead of pushing the ✕ off the edge. */
#change-panel .cp-title{ flex:1 1 auto; min-width:0; font-size:.95rem; line-height:1.35; }
#change-panel .cp-close{ flex:0 0 auto; }
#change-panel .cp-close{ border:0; background:transparent; color:#fff; font-size:1.15rem; line-height:1; cursor:pointer; padding:.1rem .35rem; }

#change-panel .cp-body{ flex:1 1 auto; min-height:0; display:flex; flex-direction:column; padding:.7rem .8rem 0; }
#change-panel .cp-search{
  flex:0 0 auto; font-size:16px; min-height:44px; width:100%;
  border:1px solid var(--t-line); border-radius:10px; padding:.4rem .7rem;
  background:var(--t-bg); color:var(--t-ink);
}

/* The one scrolling region. min-height:0 is what lets it actually shrink inside
   the flex column instead of pushing the foot off the bottom. */
#change-panel .cp-results{
  flex:1 1 auto; min-height:0; overflow-y:auto; margin:.55rem 0 .7rem;
  border:1px solid var(--t-line); border-radius:10px;
  scrollbar-width:thin;
}
#change-panel .cp-result{
  display:flex; flex-direction:column; align-items:flex-start; gap:.1rem;
  width:100%; text-align:start; border:0; border-block-end:1px solid var(--t-line);
  background:transparent; color:inherit; padding:.55rem .75rem; cursor:pointer;
}
#change-panel .cp-result:last-child{ border-block-end:0; }
#change-panel .cp-result:hover{ background:var(--t-row-hover); }
#change-panel .cp-result.selected{ background:var(--t-green-soft); }
#change-panel .cp-result-lbl{ font-weight:700; line-height:1.3; }
#change-panel .cp-result-sub{ font-size:.78rem; color:var(--t-muted); }
/* The kind is carried by a coloured edge, so «جزء ٢٣» and «صفحة ٢٣» are told
   apart at a glance when a bare number offers both. */
#change-panel .cp-result--surah{ border-inline-start:3px solid var(--t-green); }
#change-panel .cp-result--juz{ border-inline-start:3px solid var(--t-amber); }
/* --t-brand is deliberately NOT re-lit for dark mode (it stays teal for hero and
   sidebar fills), so it is invisible against a dark panel. The dark override below
   is required — this is the one colour here that a token does not carry. */
#change-panel .cp-result--page{ border-inline-start:3px solid var(--t-brand); }
#change-panel .cp-none{ padding:1rem; text-align:center; color:var(--t-muted); font-size:.9rem; }

#change-panel .cp-foot{ flex:0 0 auto; padding:.6rem .8rem .8rem; border-block-start:1px solid var(--t-line); }
/* Nothing is chosen yet, so there is nothing to say about it — and an empty
   «الآية» select above a dead «تم» is what made the old panel look broken. */
#change-panel:not(.has-choice) .cp-chosen,
#change-panel:not(.has-choice) .cp-verse-row{ display:none; }
#change-panel .cp-chosen{ margin-bottom:.5rem; }
#change-panel .cp-chosen-lbl{ display:block; font-weight:700; }
#change-panel .cp-chosen-sub{ display:block; font-size:.78rem; color:var(--t-muted); }
#change-panel .cp-verse-row{ display:flex; align-items:center; gap:.6rem; margin-bottom:.6rem; }
#change-panel .cp-verse-lbl{ flex:0 0 auto; font-size:.85rem; font-weight:600; color:var(--t-muted); }
#change-panel .cp-verse-sel{
  flex:1 1 auto; font-size:16px; min-height:44px; width:100%;
  border:1px solid var(--t-line); border-radius:10px; padding:.4rem;
  background:var(--t-bg); color:var(--t-ink);
}
#change-panel .cp-ok{
  width:100%; background:var(--t-green); color:#fff; border:0; border-radius:10px;
  padding:.65rem; font-weight:700; font-size:1rem; cursor:pointer;
}
#change-panel .cp-ok:disabled{ opacity:.45; cursor:default; }

/* Phone: a bottom sheet, and the head/foot still hold while the results scroll. */
@media (max-width:767px){
  #change-panel{ left:0; right:0; bottom:0; top:auto; transform:none; width:auto;
                 max-width:none; max-height:85vh; border-radius:14px 14px 0 0; }
  #change-panel .cp-header{ border-radius:13px 13px 0 0; }
}

/* desktop: the open card fills the row under its tabs (one card at a time at every width) */
@media (min-width:768px){
  .qrec-row.open .qrec-entry{display:flex;flex-wrap:wrap;gap:0 1rem}
  .part{flex:1}
  .part-tabs{flex:1 1 100%}
}

/* One card at a time (see _SessionTable). The wizard replaces the whole entry, tabs included. */
/* The tabs stay in reach under the topbar while a long card scrolls; padding (not margin) so the painted strip
   covers the gap, and the row's own background (via .qrec-entry) so absent/dark rows match. */
.qrec-entry{background:inherit}
.part-tabs{display:flex;gap:.25rem;padding-top:.5rem;position:sticky;top:var(--topbar-h);z-index:3;background:inherit}
.part-tab{flex:1;min-height:44px;border:1px solid var(--bs-border-color);background:var(--bs-body-bg);color:var(--t-muted);border-radius:.6rem;
          padding:.45rem .25rem;font-size:.9rem;display:flex;align-items:center;justify-content:center;gap:.35rem}
.part-tab.on{border-color:currentColor;font-weight:600}
/* three tabs on a phone: keep each label on one line */
@media (max-width:420px){.part-tab{font-size:.8rem;padding-inline:.15rem;gap:.25rem;white-space:nowrap}}
.part-tab[data-tab="Lesson"].on{color:var(--tab-lesson)}
.part-tab[data-tab="Revision"].on{color:var(--tab-rev)}
.part-tab[data-tab="PrevLesson"].on{color:var(--tab-prev)}
/* legible without colour: empty = hollow ring, done = filled, skipped = filled with a diagonal slash */
.part-tab__dot{width:.6rem;height:.6rem;border-radius:50%;box-sizing:border-box;border:2px solid var(--bs-border-color);background:transparent}
.part-tab__dot[data-state="done"]{border-color:var(--tab-lesson);background:var(--tab-lesson)}
.part-tab__dot[data-state="skipped"]{border-color:#6c757d;background:linear-gradient(135deg,#6c757d 42%,transparent 42%,transparent 58%,#6c757d 58%)}
/* Hide only the INACTIVE cards; the active one keeps whatever display .part (and the wizard's rules) give it. */
.qrec-entry[data-active="Lesson"]   > .part:not([data-part="Lesson"]),
.qrec-entry[data-active="Revision"] > .part:not([data-part="Revision"]),
.qrec-entry[data-active="PrevLesson"] > .part:not([data-part="PrevLesson"]){display:none}
/* مراجعة الدرس السابق — the blue card between the lesson and the revision */
.part-prevlesson{border-top:3px solid var(--tab-prev)}
.part-prevlesson .part-ttl{color:#0a58ca}
.part-prevlesson .anchor{--anchor-bg:#e7f0fe;--anchor-line:#bcd3fb;--anchor-bar:#0d6efd;--anchor-ink:#0a58ca}
.prev-opts{display:flex;flex-wrap:wrap;gap:.35rem;margin:0 0 .5rem}
.prev-opt{min-height:52px;border:1px solid var(--tab-prev);color:var(--tab-prev);background:transparent;border-radius:12px;padding:.25rem .8rem;font-size:.85rem;
  display:inline-flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.25}
.prev-opt.on{background:var(--tab-prev);color:#fff}
/* each preset's own range, under its label */
.prev-opt__span{font-size:.75rem;font-weight:600;opacity:.8}
/* يُعاد: «الدرس نفسه» is today's lesson again — small but solid: #0a58ca on the unlit option (6.4:1), white on the lit one (4.5:1) */
.prev-opt__note{font-size:.7rem;font-weight:500}
.prev-opt:not(.on) .prev-opt__note{color:#0a58ca}
.prev-none{margin:-.25rem 0 .5rem}
/* «آخر درس» on this card is information, not a control: small and muted. */
.prev-anchor .anchor-lbl,.prev-anchor .anchor-val{color:var(--t-muted);font-size:.78rem;font-weight:600}
.prev-anchor .anchor-lbl::before{content:none}
/* «سيُراجِع: …» — one sentence saying what today's review is */
.prev-summary{margin:.1rem 0 .55rem;padding:.4rem .65rem;border:1px solid #bcd3fb;background:#f3f7ff;border-radius:10px;font-size:.88rem;color:#0a58ca}
.prev-summary__val{font-weight:800}
.prev-ranges{margin-bottom:.5rem}
.part.skipped>.prev-opts,.part.skipped>.prev-none,.part.skipped>.rev-adv,.part.skipped>.prev-ranges,.part.skipped>.prev-summary{display:none}

/* «خيارات متقدمة» → مراجعات متفرقة (revision card). Multi mode hides the sequential picker. */
.rev-adv{margin-top:.6rem}
.rev-adv summary{font-size:.8rem;color:var(--t-muted);cursor:pointer;width:max-content;max-width:100%}
.rev-mode{display:flex;flex-wrap:wrap;gap:.25rem 1rem;margin:.4rem 0;font-size:.85rem}
.rev-mode label{display:inline-flex;align-items:center;gap:.3rem;min-height:36px}
/* «مراجعات متفرقة»: one entry editor (من / إلى — the card's own surah/ayah controls) + the ranges as chips */
.rr-editor{border:1px solid #f3dcc0;background:#fffdf9;border-radius:12px;padding:.5rem .55rem;margin-top:.2rem}
.rr-end{display:flex;align-items:center;gap:.4rem .5rem;flex-wrap:wrap;padding:.3rem 0}
.rr-end+.rr-end{border-top:1px dashed #eadfce}
.rr-end .to-lbl{flex:0 0 2.2rem;font-size:.85rem;color:#566;font-weight:700}
.rr-actions{display:flex;gap:.5rem;margin-top:.45rem}
.rr-add,.rr-whole{flex:1 1 0;min-height:44px;border-radius:10px;font-weight:700;font-size:.9rem;padding:.3rem .6rem;cursor:pointer}
.rr-add{border:1px solid #157347;background:#157347;color:#fff}
.rr-whole{border:1px solid #157347;background:#fff;color:#157347}
.rr-half{margin-top:.45rem;padding:.35rem .6rem;border-radius:9px;background:#fdf0ee;border:1px solid #f1c4bf;color:#b3261e;font-size:.85rem;font-weight:600}
.rr-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.55rem 0 .2rem}
.rr-chips:empty{display:none}
.rr-chip{display:inline-flex;align-items:stretch;max-width:100%;border:1px solid #f0c996;background:#fdf1e3;border-radius:999px;overflow:hidden}
.rr-chip.editing{border-color:#c05600;outline:2px solid #c05600;outline-offset:1px}
.rr-chip-lbl{border:0;background:transparent;color:#5b3a12;font-weight:700;font-size:.85rem;padding-block:.35rem;padding-inline:.75rem .15rem;min-height:36px;cursor:pointer;text-align:start;overflow-wrap:anywhere}
.rr-chip-del{border:0;background:transparent;color:#b3261e;font-weight:800;min-width:34px;min-height:36px;cursor:pointer}
.rev-ranges .counts{justify-content:flex-start;margin-top:.5rem}
.rev-ranges .counts .cf:not(.cf-rate){display:none}
.rr-note{font-size:.75rem;color:var(--t-muted);margin-top:.3rem}
.part.rev-multi>.to-row,.part.rev-multi>.end-hint,.part.rev-multi .anchor .btn-change{display:none}
.qrec-row.nl-active .part-tabs{display:none}

/* ============================================================
   الإحصائيات (statistics) — period selector, report cards,
   chart panels and the CSS/SVG bar fallback. All token-based
   (var(--t-*)) so dark mode is automatic.
   ============================================================ */

/* period selector ------------------------------------------- */
.stats-period { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.4rem; }
.stats-period__label { font-weight: 600; color: var(--t-muted); font-size: .9rem; }
.stats-period__chips { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .5rem; }
.stats-pill {
  display: inline-block; border-radius: 999px; padding: .4rem 1rem; cursor: pointer;
  font-weight: 600; font-size: .9rem; text-decoration: none; list-style: none;
  border: 1.5px solid var(--t-line); color: var(--t-ink); background: var(--t-surface);
  transition: background .15s, color .15s, border-color .15s;
}
.stats-pill:hover { border-color: var(--t-green); color: var(--t-green); }
.stats-pill--on { background: var(--t-green); border-color: var(--t-green); color: #fff; }
.stats-pill--on:hover { color: #fff; }
.stats-pill::-webkit-details-marker { display: none; }   /* hide the <summary> triangle */
.stats-custom { position: relative; }
.stats-custom__form {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem; margin-top: .65rem;
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius);
  box-shadow: var(--t-shadow); padding: .9rem 1rem;
}
.stats-custom__form label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; color: var(--t-muted); }

/* report cards (hub) ---------------------------------------- */
.stats-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stats-card { display: flex; flex-direction: column; gap: .4rem; }
/* --h sets the height (the hub cards leave it unset: 120px); a chart card on a report page sets --h
   (220 bars/donuts, 260 line trends) and --h-sm, its phone height. */
.stats-card__chart { position: relative; height: var(--h, 120px); margin: .35rem 0 .15rem; }
.stats-card__chart canvas { max-height: var(--h, 120px); }
@media (max-width: 575.98px) {
  .stats-card__chart { height: var(--h-sm, var(--h, 120px)); }
  .stats-card__chart canvas { max-height: var(--h-sm, var(--h, 120px)); }
}
section.stats-card { margin-bottom: 1.25rem; }
section.stats-card > .t-section-title { margin-bottom: .4rem; }
/* "this one exports" — on the card, because the export button lives one page deeper and the
   question it answers ("which reports can I get as a spreadsheet?") is asked from here. */
.stats-card__xlsx {
  flex: 0 0 auto; margin-inline-start: auto; border-radius: 999px; padding: .05rem .5rem;
  font-size: .68rem; font-weight: 800; white-space: nowrap;
  background: var(--t-green-soft); color: var(--t-green);
}

/* chart panels (report pages) ------------------------------- */
.stats-panel { position: relative; padding: 1rem 1.15rem; }
.stats-panel canvas { max-width: 100%; }

/* CSS/SVG bar fallback — hidden unless Chart.js is unavailable */
.stats-fallback { display: none; }
.no-chart .stats-card__chart canvas,
.no-chart .stats-panel > canvas { display: none; }
.no-chart .stats-fallback { display: block; }
.stats-fallback__bars {
  display: flex; align-items: flex-end; gap: 4px; height: 110px;
  padding: .25rem 0; overflow: hidden;
}
.stats-fallback__bar {
  flex: 1 1 0; min-width: 3px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--t-green), var(--t-green-soft));
}
.stats-fallback__empty { color: var(--t-muted); text-align: center; padding: 1.2rem; }
.no-chart .stats-card__chart { height: auto; }
.stats-fallback__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.stats-fallback__list li { display: flex; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--t-line); padding: .2rem 0; }

/* ============================================================
   Dark mode — toggled via [data-bs-theme="dark"] on <html>.
   Components are token-based, so we mostly re-point the design
   tokens; the rest are targeted overrides for surfaces that were
   hard-coded light. Bootstrap 5.3 themes its own components.
   ============================================================ */
[data-bs-theme="dark"] {
  --t-bg: #0e1413;
  --t-surface: #16211f;
  --t-ink: #e6efec;
  --t-muted: #9fb4b0;
  --t-line: #2b3a36;
  --t-green: #34b07a;
  --t-green-soft: #15352a;
  --t-amber: #e0922f;
  --t-amber-soft: #382713;
  --t-amber-ink: #ecb27a;
  --t-red: #ef7a6d;
  --t-blue: #5b9cf0;
  --t-shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 30px -18px rgba(0,0,0,.75);
  --t-shadow-hover: 0 2px 4px rgba(0,0,0,.6), 0 22px 40px -20px rgba(0,0,0,.85);
  --t-th-bg: #15302b;
  --t-row-hover: #1d2a27;
}
/* --t-brand stays teal for hero/sidebar fills; re-light it where used as TEXT */
[data-bs-theme="dark"] .app-topbar-brand,
[data-bs-theme="dark"] .t-auth__brand .mark { color: #cfe8e6; }
[data-bs-theme="dark"] .qrec-cell::before { color: var(--t-ink); }
/* #change-panel rides theme tokens for everything except the صفحة edge: --t-brand
   keeps its dark teal in dark mode by design, which is invisible on a dark panel. */
[data-bs-theme="dark"] #change-panel .cp-result--page{ border-inline-start-color:#8fd3c9; }
[data-bs-theme="dark"] .t-stat--brand { --chip: #1c3a37; }
[data-bs-theme="dark"] .t-stat--brand .t-stat__num { color: #8fd3c9; }
[data-bs-theme="dark"] .app-sidebar-toggle { background: #1f2d29; border-color: #2f4a40; color: #cfe8e6; }

/* Brand the common Bootstrap components (blue → teal). var(--t-green) is theme-aware,
   so these adapt automatically in dark; the rgb link var is set per-theme below. */
.btn-primary { --bs-btn-bg: var(--t-green); --bs-btn-border-color: var(--t-green); --bs-btn-hover-bg: var(--t-brand); --bs-btn-hover-border-color: var(--t-brand); --bs-btn-active-bg: var(--t-brand); --bs-btn-active-border-color: var(--t-brand); --bs-btn-disabled-bg: var(--t-green); --bs-btn-disabled-border-color: var(--t-green); }
.btn-outline-primary { --bs-btn-color: var(--t-green); --bs-btn-border-color: var(--t-green); --bs-btn-hover-bg: var(--t-green); --bs-btn-hover-border-color: var(--t-green); --bs-btn-active-bg: var(--t-green); --bs-btn-active-border-color: var(--t-green); }
.pagination { --bs-pagination-color: var(--t-green); --bs-pagination-hover-color: var(--t-brand); --bs-pagination-active-bg: var(--t-green); --bs-pagination-active-border-color: var(--t-green); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--t-green); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--t-green); }
[data-bs-theme="dark"] .dropdown-menu { background: var(--t-surface); border-color: var(--t-line); box-shadow: var(--t-shadow); }
[data-bs-theme="dark"] .dropdown-item { color: var(--t-ink); }
[data-bs-theme="dark"] .dropdown-item:hover, [data-bs-theme="dark"] .dropdown-item:focus { background: #1f2d29; color: #fff; }
[data-bs-theme="dark"] .dropdown-header { color: var(--t-muted); }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--t-line); }
.form-check-input:checked { background-color: var(--t-green); border-color: var(--t-green); }
.form-check-input:focus { border-color: var(--t-green); }
[data-bs-theme="dark"] { --bs-primary: #34b07a; --bs-primary-rgb: 52, 176, 122; --bs-link-color: #34b07a; --bs-link-color-rgb: 52, 176, 122; --bs-link-hover-color: #5cc89a; }

/* surfaces that were hard-coded light */
[data-bs-theme="dark"] .qrec { background: var(--t-surface); }
[data-bs-theme="dark"] .qrec-head { background: var(--t-surface); border-color: var(--t-line); }
[data-bs-theme="dark"] .qrec-row { background: var(--t-surface); border-color: var(--t-line); }
[data-bs-theme="dark"] .qrec-row.is-absent { background: #2a1818; border-color: #5b2e2e; }
[data-bs-theme="dark"] .app-bottomnav { background: var(--t-surface); }
[data-bs-theme="dark"] .th-pill { background: var(--t-surface); }
[data-bs-theme="dark"] .th-chip { background: var(--t-green-soft); color: var(--t-green); }
[data-bs-theme="dark"] .t-chip--soft { background: #25332f; color: #b9c9c5; }
[data-bs-theme="dark"] .t-learner__avatar { background: linear-gradient(135deg, #15352a, #1d4636); color: #8fd3c9; }

/* tables + hover bands */
[data-bs-theme="dark"] .t-table th { color: #cfe8e6; }   /* background rides --t-th-bg */
[data-bs-theme="dark"] .t-learner:hover { background: var(--t-row-hover); }
[data-bs-theme="dark"] .t-table td { border-color: var(--t-line); }
[data-bs-theme="dark"] .t-circle:hover,
[data-bs-theme="dark"] .t-hub:hover { border-color: #34564e; }

/* teacher-home state cards + status colors */
[data-bs-theme="dark"] .th-card--done { background: #163026; border-color: #2f7d52; color: #bfe9cf; }
[data-bs-theme="dark"] .th-card--calm { background: #1b2522; border-color: #3a4843; color: #c3d3cf; }
[data-bs-theme="dark"] .th-card--calm .th-title { color: var(--t-green); }
[data-bs-theme="dark"] .mh-card:hover { border-color: #34564e; }
[data-bs-theme="dark"] .an-banner { border-color: #2f5a4b; }
[data-bs-theme="dark"] .an-banner__title { color: #bfe9cf; }
[data-bs-theme="dark"] .an-badge { background: #243330; }
[data-bs-theme="dark"] .t-stat--red { --chip: #3a1f1c; }
[data-bs-theme="dark"] .t-stat--red .t-stat__num,
[data-bs-theme="dark"] .th-chip--red { color: #ef8a80; }
[data-bs-theme="dark"] .th-chip--red { background: #3a1f1c; }
[data-bs-theme="dark"] .att-badge.present { background: #15352a; color: #6fd6a4; }
[data-bs-theme="dark"] .att-badge.absent { background: #3a1f1c; color: #ef8a80; }
[data-bs-theme="dark"] .qrec-recap.done { color: #6fd6a4; }
[data-bs-theme="dark"] .qrec-recap.pending { color: #7d8c89; }

/* recording picker */
[data-bs-theme="dark"]{--tab-lesson:#34b07a;--tab-prev:#6ea8fe;--tab-rev:#f0a83a}   /* ≥5.8:1 on the dark card */
[data-bs-theme="dark"] .prev-opt.on { color: #0b1a33; }   /* dark ink on the light-blue fill */
[data-bs-theme="dark"] .prev-opt:not(.on) .prev-opt__note{color:inherit}
[data-bs-theme="dark"] .part-lesson .part-ttl{color:var(--tab-lesson)}
[data-bs-theme="dark"] .part-prevlesson .part-ttl{color:var(--tab-prev)}
[data-bs-theme="dark"] .part-revision .part-ttl{color:var(--tab-rev)}
[data-bs-theme="dark"] .part { background: #16211f; border-color: var(--t-line); }
[data-bs-theme="dark"] .to-row .to-lbl,
[data-bs-theme="dark"] .ayah-row .ayah-lbl,
[data-bs-theme="dark"] .ayah-max,
[data-bs-theme="dark"] .counts .cf { color: var(--t-muted); }
[data-bs-theme="dark"] .anchor-val { color: #6fd6a4; }
[data-bs-theme="dark"] .part-revision .anchor-val { color: #f0a83a; }
[data-bs-theme="dark"] .part-lesson   .anchor{--anchor-bg:rgba(21,115,71,.16);--anchor-line:rgba(95,191,140,.32);--anchor-bar:#34b07a}
[data-bs-theme="dark"] .part-revision .anchor{--anchor-bg:rgba(192,86,0,.16);--anchor-line:rgba(224,146,47,.32);--anchor-bar:#e0922f}
[data-bs-theme="dark"] .anchor-lbl{color:var(--anchor-bar)}
[data-bs-theme="dark"] .surah-step,
[data-bs-theme="dark"] .ayah-step,
[data-bs-theme="dark"] .num-step { background: #1f2d29; border-color: #2f4a40; color: #34b07a; }
[data-bs-theme="dark"] .surah-step:hover:not(:disabled),
[data-bs-theme="dark"] .ayah-step:hover:not(:disabled),
[data-bs-theme="dark"] .num-step:hover:not(:disabled) { background: #25382f; }
[data-bs-theme="dark"] .part-revision .surah-step,
[data-bs-theme="dark"] .part-revision .ayah-step { background: #34250f; border-color: #5a3f1c; color: #e0922f; }
[data-bs-theme="dark"] .num-stepper .num { background: var(--t-surface); color: var(--t-ink); border-color: #2f4a40; }
[data-bs-theme="dark"] .ayah-row .q-ayah,
[data-bs-theme="dark"] .ayah-row .rr-ayah { background: var(--t-surface); color: var(--t-ink); }
[data-bs-theme="dark"] .rr-editor { background: var(--t-surface); border-color: #5a3f1c; }
[data-bs-theme="dark"] .rr-chip { background: #34250f; border-color: #5a3f1c; }
[data-bs-theme="dark"] .rr-chip-lbl { color: #e0922f; }
[data-bs-theme="dark"] .rr-whole { background: var(--t-surface); }
[data-bs-theme="dark"] .prev-summary { background: rgba(13,110,253,.12); border-color: rgba(13,110,253,.4); color: #8bb9fe; }
[data-bs-theme="dark"] .part.incomplete .ayah-row .q-ayah { box-shadow: 0 0 0 2px #5a4a1c; }
[data-bs-theme="dark"] .chip,
[data-bs-theme="dark"] .btn-change { background: #16302e; border-color: #2f5a57; color: #74c7c2; }
[data-bs-theme="dark"] .btn-new-cycle { background: #34250f; border-color: #5a3f1c; color: #e0922f; }
[data-bs-theme="dark"] .qpick-lesson .form-select { background-color: #16211f; border-color: #2f4a40; }
[data-bs-theme="dark"] .qpick-revision .form-select { background-color: #1f1a12; border-color: #5a3f1c; }
[data-bs-theme="dark"] .qr { background: #1f2d29; border-color: #2f4a40; color: #b9c9c5; }
[data-bs-theme="dark"] .qr.on { background: #15352a; border-color: #34b07a; color: #8fe3b8; }
[data-bs-theme="dark"] .end-hint { background: #342a14; border-color: #5a4a1c; color: #e3b657; }

/* ============================================================
   Manager dashboard — "High-Contrast Clarity" (accessibility-first)
   Scoped under .mh-dash. Priorities: strong contrast, large legible
   type, clear boundaries (borders, not faint shadows), big tap
   targets, status shown by icon + TEXT + colour (never colour alone),
   visible focus, minimal decoration. Token-based (light/dark),
   RTL-safe (logical props), reduced-motion aware.
   ============================================================ */
.mh-dash { position: relative; max-width: 940px; margin-inline: auto; }  /* one column — desktop width buys line-length, not extra columns */
/* focus ring: dark teal on light surfaces (gold was 1.6:1 there); gold stays for dark mode */
.mh-dash a:focus-visible { outline: 3px solid var(--t-brand); outline-offset: 3px; border-radius: 14px; }
[data-bs-theme="dark"] .mh-dash a:focus-visible { outline-color: var(--t-gold); }

/* gentle, short entrance — disabled entirely for reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  .mh-dash > .mh-hero, .mh-dash .mh-main > * { animation: mhFade .4s ease both; }
  .mh-dash .mh-main > *:nth-child(2) { animation-delay: .06s; }
  .mh-dash .mh-main > *:nth-child(3) { animation-delay: .12s; }
  .mh-dash .mh-main > *:nth-child(4) { animation-delay: .18s; }
}
@keyframes mhFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* hero — solid brand, no busy ornament, strong white text */
.mh-dash .mh-hero {
  background: var(--t-brand);
  border: 2px solid #0a2e2e;
  box-shadow: none;
  padding: 1.3rem 1.5rem;
}
.mh-dash .mh-hero::after { display: none; }                 /* remove geometric medallion (visual noise) */
.mh-dash .mh-hero__title { font-size: 1.7rem; font-weight: 800; color: #ffffff; }
.mh-dash .mh-hero__sub { color: #dcf2eb; font-size: 1rem; }
.mh-dash .mh-hero__icon { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .30); }
.mh-dash .mh-today { background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .40);
  border-radius: 12px; padding: .55rem 1rem; }
.mh-dash .mh-today__dow { color: #fff; font-size: 1.12rem; }
.mh-dash .mh-today__date { color: #fff; opacity: .9; font-size: .95rem; }
/* hero status chip — the day in one glance: «بانتظارك اليوم: N» or «كل شيء تمام ✓» */
.mh-dash .mh-hero__status { display: flex; align-items: center; gap: .5rem;
  background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .40);
  border-radius: 12px; padding: .55rem 1rem; color: #fff; font-weight: 800; font-size: 1.02rem; }
.mh-dash .mh-hero__status b { display: grid; place-items: center; min-width: 1.7rem; height: 1.7rem;
  padding: 0 .5rem; border-radius: 999px; background: var(--t-gold); color: var(--t-brand); font-size: 1.02rem; }
.mh-dash .mh-hero__status .mh-hero__status-ok { background: transparent; color: var(--t-gold); font-size: 1.3rem; }

/* section headers — labelled, count-badged groups (sectioned layout) */
.mh-dash .mh-sec { margin-bottom: 1.5rem; }
.mh-dash .mh-sec:last-child { margin-bottom: 0; }
.mh-dash .mh-sec__h { display: flex; align-items: center; gap: .55rem; margin: 0 .15rem .7rem; }
.mh-dash .mh-sec__t { margin: 0; font-size: 1.02rem; font-weight: 800; color: var(--t-brand); }
.mh-dash .mh-sec__h::after { content: ""; flex: 1 1 auto; height: 2px; border-radius: 2px; background: var(--t-line); }
[data-bs-theme="dark"] .mh-dash .mh-sec__t { color: #8fd3c9; }

/* cards — bold outline, larger head, obvious hover (ring, not lift) */
.mh-dash .mh-card {
  border: 2px solid #c7d3cf; border-radius: 14px;
  background: var(--t-surface); box-shadow: none;
  padding: 1.25rem 1.35rem;
}
.mh-dash .mh-card::before { width: 6px; }                   /* thicker category rail */
.mh-dash .mh-card:hover, .mh-dash .mh-action:hover {
  transform: none; border-color: var(--t-brand); box-shadow: 0 0 0 3px rgba(15, 61, 62, .14);
}
.mh-dash .mh-muted { color: #435049; font-size: .98rem; }  /* darker → AA contrast */
.mh-dash .mh-card__more { display: block; margin-top: .8rem; font-weight: 800; font-size: .98rem; color: #0d5233; }
.mh-dash .mh-badge { font-size: .95rem; font-weight: 800; min-width: 1.65rem; height: 1.65rem;
  display: inline-grid; place-items: center; padding: 0 .5rem; }

/* attendance — icon-less coin BUT number + text label, high-contrast, 2px ring per state */
.mh-dash .mh-tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.mh-dash .mh-tally__n { display: flex; flex-direction: column; align-items: center; gap: .2rem;
  padding: .8rem .4rem; border-radius: 12px; border: 2px solid; }
.mh-dash .mh-tally__n b { font-size: 1.7rem; font-weight: 800; line-height: 1; color: inherit; }
.mh-dash .mh-tally__n span { font-size: .95rem; font-weight: 700; color: inherit; }
.mh-dash .mh-tally__n--p { background: #eaf5ee; border-color: #157347; color: #0d5233; }
.mh-dash .mh-tally__n--a { background: #fdecec; border-color: #c0392b; color: #9a281d; }
.mh-dash .mh-tally__n--e { background: #fdf0e3; border-color: #c05600; color: #863c00; }
.mh-dash .mh-tally__n--u { background: #edf1ef; border-color: #6f7f7b; color: #37433f; }
/* zero-count tiles go calm grey — colour only ever means "this needs you" */
.mh-dash .mh-tally__n--zero { background: #f2f5f4; border-color: #c4cfcb; color: #5c6b66; }

/* «يحتاجك اليوم» digest — one card, one row per concern, one labelled action each */
.mh-dash .mh-digest { list-style: none; margin: 0; padding: 0; background: var(--t-surface);
  border: 2px solid #c7d3cf; border-radius: 14px; overflow: hidden; }
.mh-dash .mh-digest__item { display: flex; align-items: center; gap: .85rem; padding: .95rem 1.15rem;
  border-block-end: 2px solid var(--t-line); flex-wrap: wrap; }
.mh-dash .mh-digest__item:last-child { border-block-end: 0; }
.mh-dash .mh-digest__ico { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 11px; color: #fff; }
.mh-dash .mh-digest__ico .t-ico { width: 24px; height: 24px; }
.mh-dash .mh-digest__ico--amber { background: #9a4600; }
.mh-dash .mh-digest__ico--green { background: var(--t-green); }
.mh-dash .mh-digest__ico--blue { background: #2b5c8a; }
.mh-dash .mh-digest__body { flex: 1 1 240px; min-width: 0; }
.mh-dash .mh-digest__t { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  font-weight: 800; font-size: 1.08rem; color: var(--t-ink); }
.mh-dash .mh-digest__s { display: block; color: #435049; font-size: .95rem; margin-top: .1rem; }

/* Edit-page relationship cards (guardians / children / circles) — Manager-only */
.eg-wrap { max-width: 620px; margin-top: 1.4rem; display: flex; flex-direction: column; gap: 1.1rem; }
.eg-card { background: var(--t-surface); border: 2px solid #cfe0d7; border-radius: 14px; overflow: hidden; }
.eg-card__head { display: flex; align-items: center; gap: .6rem; padding: .7rem .95rem; background: var(--t-green-soft); border-block-end: 2px solid #cfe0d7; }
.eg-card__ico { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--t-green); color: #fff; }
.eg-card__ico .t-ico { width: 20px; height: 20px; }
.eg-card__t { font-weight: 800; font-size: 1.02rem; color: #0d5233; }
.eg-card__count { margin-inline-start: auto; background: #dcefe3; color: #0d5233; border-radius: 999px; min-width: 1.6rem; height: 1.6rem; display: grid; place-items: center; font-weight: 800; font-size: .85rem; padding: 0 .4rem; }
.eg-row { display: flex; align-items: center; gap: .55rem; padding: .6rem .95rem; border-block-end: 1.5px solid var(--t-line); flex-wrap: wrap; margin: 0; }
.eg-row:last-child { border-block-end: 0; }
.eg-name { font-weight: 700; }
.eg-nid { color: var(--t-muted); font-size: .85rem; font-weight: 600; }
.eg-spacer { flex: 1 1 auto; }
.eg-add { display: flex; gap: .5rem; align-items: center; padding: .7rem .95rem; background: #f7fbf9; border-block-start: 1.5px solid var(--t-line); }
.eg-add .form-control { max-width: 200px; }
.eg-move { max-width: 210px; }
.eg-movebtn { background: var(--t-amber); border: 1px solid var(--t-amber); color: #fff; font-weight: 700; }
.eg-movebtn:hover { background: #a94b00; color: #fff; }
.eg-card--circle { border-color: #eccfa8; }
.eg-card--circle .eg-card__head { background: var(--t-amber-soft); border-block-end-color: #eccfa8; }
.eg-card--circle .eg-card__ico { background: var(--t-amber); }
.eg-card--circle .eg-card__t { color: var(--t-amber-ink); }
.eg-card--circle .eg-card__count { background: #f3ddc0; color: var(--t-amber-ink); }
[data-bs-theme="dark"] .eg-card { background: #16211f; border-color: #284034; }
[data-bs-theme="dark"] .eg-card__head { background: rgba(21, 115, 71, .16); border-block-end-color: #284034; }
[data-bs-theme="dark"] .eg-card__t { color: #7fd3a6; }
[data-bs-theme="dark"] .eg-card__count { background: rgba(21, 115, 71, .3); color: #a7e6c4; }
[data-bs-theme="dark"] .eg-row { border-block-end-color: #223129; }
[data-bs-theme="dark"] .eg-add { background: #12201b; border-block-start-color: #223129; }
[data-bs-theme="dark"] .eg-card--circle { border-color: #5c421f; }
[data-bs-theme="dark"] .eg-card--circle .eg-card__head { background: rgba(192, 86, 0, .16); border-block-end-color: #5c421f; }
[data-bs-theme="dark"] .eg-card--circle .eg-card__t { color: #f0b968; }
[data-bs-theme="dark"] .eg-card--circle .eg-card__count { background: rgba(192, 86, 0, .3); color: #f0c48a; }

/* اتجاهات الطلاب — one aligned "board": EVERY row shares the same grid skeleton
   (student · الدرس · المراجعة · action). A locked row is the SAME shape with a locked cell + a soft
   amber wash — never a differently-shaped row. Stacks to labelled fields on mobile. */
.dir-board { display: flex; flex-direction: column; }
.dir-filter { display:flex; align-items:center; gap:.6rem; margin-bottom:.6rem; }
.dir-filter input { max-width: 22rem; }
.dir-filter__count { font-size:.78rem; font-weight:700; color:var(--t-muted); }
/* A text button in the filter bar: expand/collapse all sections, or narrow a list to its gaps. */
.dir-filter__toggle {
  margin-inline-start:auto; background:transparent; border:1px solid var(--t-line); border-radius:999px;
  padding:.2rem .7rem; font-size:.76rem; font-weight:700; color:var(--t-muted); cursor:pointer;
  white-space:nowrap; transition:background .12s, border-color .12s, color .12s;
}
.dir-filter__toggle:hover { background:var(--t-row-hover); color:var(--t-ink); }
.dir-filter__toggle.is-on { background:var(--t-amber-soft); border-color:var(--t-amber); color:var(--t-amber-ink); }

/* ── Directions, grouped by circle ──────────────────────────────────────────
   One <details> per circle. The summary is the whole clickable strip, so the
   hit target is the row rather than the triangle. */
.dir-group { margin-bottom:.7rem; }
.dir-group__head {
  display:flex; align-items:center; gap:.6rem; cursor:pointer; list-style:none;
  padding:.65rem 1rem; border:1px solid var(--t-line); border-radius:var(--t-radius);
  background:var(--t-th-bg); color:var(--t-brand); font-weight:800;
}
.dir-group__head::-webkit-details-marker { display:none; }
/* The disclosure caret, drawn on the logical start edge so RTL does not need a second rule. */
.dir-group__head::before {
  content:""; flex:0 0 auto; width:.5rem; height:.5rem; margin-inline-end:.1rem;
  border-inline-end:2px solid currentColor; border-block-end:2px solid currentColor;
  transform:rotate(-45deg); transition:transform .15s ease;
}
[dir="rtl"] .dir-group__head::before { transform:rotate(135deg); }
.dir-group[open] > .dir-group__head::before { transform:rotate(45deg); }
[dir="rtl"] .dir-group[open] > .dir-group__head::before { transform:rotate(45deg); }
.dir-group[open] > .dir-group__head { border-end-start-radius:0; border-end-end-radius:0; }
.dir-group__name { display:flex; align-items:center; gap:.45rem; min-width:0; }
.dir-group__name .t-ico { width:18px; height:18px; flex:0 0 auto; }
.dir-group__count {
  margin-inline-start:auto; flex:0 0 auto; min-width:1.9rem; text-align:center;
  background:var(--t-surface); border:1px solid var(--t-line); border-radius:999px;
  padding:.05rem .5rem; font-size:.8rem; font-weight:800; color:var(--t-muted);
}
.dir-group[open] > .dir-board { border-start-start-radius:0; border-start-end-radius:0; border-block-start:0; }
[data-bs-theme="dark"] .dir-group__head { color:#cfe8e6; }

/* ── A gap worth noticing: a circle with no teacher, or with nobody in it ──── */
.t-flag {
  display:inline-block; margin-inline-start:.4rem; border-radius:999px; padding:.05rem .5rem;
  font-size:.7rem; font-weight:800; white-space:nowrap;
}
.t-flag--warn { background:var(--t-amber-soft); color:var(--t-amber-ink); }

/* ── Sortable column heading ────────────────────────────────────────────────
   A real <button> so it is reachable by keyboard; it inherits the <th> type so
   the header does not suddenly look like a form control. */
.t-sort {
  background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer;
  display:inline-flex; align-items:center; gap:.3rem;
}
.t-sort:hover { text-decoration:underline; }
.t-sort::after { content:"↕"; font-size:.8em; opacity:.35; }
.t-sort[data-dir="asc"]::after  { content:"↑"; opacity:1; }
.t-sort[data-dir="desc"]::after { content:"↓"; opacity:1; }
.dir-reset-btn { display:inline-flex; align-items:center; gap:.3rem; margin-top:.35rem; background:transparent; border:1px solid transparent; border-radius:999px; padding:.15rem .5rem; font-size:.74rem; font-weight:700; color:#b23; cursor:pointer; white-space:nowrap; transition:background .12s, border-color .12s; }
.dir-reset-btn:hover { background:#fdeaea; border-color:#f0c2c2; }
[data-bs-theme="dark"] .dir-reset-btn { color:#f4a49a; }
[data-bs-theme="dark"] .dir-reset-btn:hover { background:#331a18; border-color:#5b2e2e; }
/* Each axis is a labelled block carrying the SAME colour it wears on the recording card — درس green,
   مراجعة orange — so "which one is this?" is answered by the colour the teacher already knows, and
   every control inside a block belongs to that block. */
.dir-cell--lesson, .dir-cell--rev { border-inline-start: 3px solid transparent; padding-inline-start: .6rem; }
.dir-cell--lesson { border-inline-start-color: var(--t-green); }
.dir-cell--rev    { border-inline-start-color: var(--t-amber); }

/* The reset is not a second Save — it deletes lessons. Fence it below a rule and print the cost, so a
   first-time teacher can tell the two buttons apart before opening the confirm dialog. */
.dir-danger { margin-top:.4rem; padding-top:.35rem; border-top:1px dashed var(--t-line); }
.dir-danger__cost { display:block; font-size:.68rem; line-height:1.4; color:var(--t-muted); padding-inline-start:.5rem; }
/* Only the line that reports a real loss carries warning weight — a page where everything is red
   reads as a page where nothing is. */
.dir-danger__cost--warn { color:#b23; font-weight:700; }
[data-bs-theme="dark"] .dir-danger__cost--warn { color:#f4a49a; }
/* Same button, calmer colour: المراجعة restarts a cycle but deletes nothing, so it must not wear the
   red that the record-destroying lesson reset earns. */
.dir-danger--soft { border-top-style: solid; }
/* "Inherited from the circle" — a fact about the value, not a third option to choose. */
.dir-inherit { display:inline-block; margin-inline-start:.4rem; font-size:.68rem; font-weight:700;
  color:var(--t-muted); border:1px solid var(--t-line); border-radius:999px; padding:.02rem .4rem; }
.dir-reset-btn--rev { color: var(--t-amber-ink); }
.dir-reset-btn--rev:hover { background: var(--t-amber-soft); border-color: #eccfa8; }
[data-bs-theme="dark"] .dir-reset-btn--rev { color: var(--t-amber); }
[data-bs-theme="dark"] .dir-reset-btn--rev:hover { background:#33291a; border-color:#5b4a2e; }
.dir-board__head,
.dir-row {
  display: grid;
  /* Three columns since the action column went: each axis now carries its own button. */
  grid-template-columns: minmax(150px, 1.4fr) minmax(200px, 1fr) minmax(200px, 1fr);
  align-items: center;
  gap: .5rem 1rem;
}
.dir-board__head { padding: .6rem 1.1rem; font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; color: var(--t-muted); border-block-end: 2px solid var(--t-line); }
.dir-row { padding: .85rem 1.1rem; border-block-end: 1.5px solid var(--t-line); transition: background .15s; margin: 0; }
.dir-row:last-child { border-block-end: 0; }
.dir-row:hover { background: #f6faf8; }
.dir-row.is-frozen { background: #fdfaf3; }

.dir-who__name { font-weight: 800; line-height: 1.3; }
.dir-who__meta { font-size: .8rem; color: var(--t-muted); font-weight: 600; }
.dir-cell { min-width: 0; }
.dir-cell__k { display: none; }
.dir-val { font-weight: 700; font-size: .93rem; }
.dir-muted { color: var(--t-muted); }

/* a frozen lesson reads as a soft locked pill (never a dead disabled dropdown) */
.dir-lock { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .9rem;
  color: var(--t-amber-ink); background: var(--t-amber-soft); border: 1.5px solid #eccfa8;
  border-radius: 999px; padding: .22rem .65rem; }
.dir-lock__i { font-size: .78rem; opacity: .85; }
.dir-frozen { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 800;
  color: var(--t-amber-ink); background: var(--t-amber-soft); border: 1.5px solid #eccfa8;
  border-radius: 999px; padding: .18rem .6rem; white-space: nowrap; }

/* manager inline reset: picker + danger button, danger-tinted */

@media (max-width: 880px) {
  .dir-board__head { display: none; }
  .dir-row { grid-template-columns: 1fr; gap: .5rem; padding: .9rem 1rem; }
  /* Stacked, the key IS the only thing naming each block — give it its own line and its axis colour
     instead of leaving it to share a line with the value. */
  .dir-cell__k { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .01em;
    text-transform: uppercase; color: var(--t-muted); margin: 0 0 .25rem; }
  .dir-cell--lesson > .dir-cell__k { color: var(--t-green); }
  .dir-cell--rev > .dir-cell__k { color: var(--t-amber-ink); }
}

[data-bs-theme="dark"] .dir-row:hover { background: rgba(21, 115, 71, .10); }
[data-bs-theme="dark"] .dir-row.is-frozen { background: rgba(192, 86, 0, .10); }
[data-bs-theme="dark"] .dir-lock,
[data-bs-theme="dark"] .dir-frozen { color: #f0b968; background: rgba(192, 86, 0, .16); border-color: #5c421f; }


/* «حلقات لم تُسجّل اليوم» — one collapsible card: summary line (icon + title + count) that
   opens to reveal each circle as a row. Native <details>, no JS. */
.mh-dash .mh-uncard { background: var(--t-surface); border: 2px solid #eac79a; border-radius: 14px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(192, 86, 0, .08); margin-bottom: 1rem; }
.mh-dash .mh-uncard__head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1.1rem; background: #fdf0e1; }
.mh-dash .mh-uncard__head::-webkit-details-marker { display: none; }
.mh-dash .mh-uncard__ico { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; background: #c05600; color: #fff; box-shadow: 0 3px 10px rgba(192, 86, 0, .30); }
.mh-dash .mh-uncard__ico .t-ico { width: 22px; height: 22px; }
.mh-dash .mh-uncard__t { flex: 1 1 auto; min-width: 0; font-weight: 800; font-size: 1.08rem; color: #863c00; }
.mh-dash .mh-uncard__count { flex: 0 0 auto; background: #c05600; color: #fff; border-radius: 999px;
  min-width: 1.8rem; height: 1.8rem; display: grid; place-items: center; font-weight: 800; font-size: .95rem; padding: 0 .45rem; }
.mh-dash .mh-uncard__chev { flex: 0 0 auto; width: 0; height: 0; border-inline-start: 6px solid transparent;
  border-inline-end: 6px solid transparent; border-block-start: 7px solid #c05600; transition: transform .2s ease; }
.mh-dash .mh-uncard[open] .mh-uncard__chev { transform: rotate(180deg); }
.mh-dash .mh-uncard__row { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.1rem;
  border-block-start: 1.5px solid #f2e2cd; flex-wrap: wrap; }
.mh-dash .mh-uncard__body { flex: 1 1 200px; min-width: 0; }
.mh-dash .mh-uncard__name { display: block; font-weight: 800; font-size: 1.12rem; color: var(--t-ink); }
.mh-dash .mh-uncard__teacher { display: block; margin-top: .12rem; color: #7a5a35; font-size: .92rem; font-weight: 700; }
/* gentle "look here" pulse on the card icon (calm, respects reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .mh-dash .mh-uncard__ico { animation: mhAlertPulse 2.6s ease-in-out infinite; }
}
@keyframes mhAlertPulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(192, 86, 0, .30); }
  50%      { box-shadow: 0 3px 10px rgba(192, 86, 0, .30), 0 0 0 7px rgba(192, 86, 0, .10); }
}
[data-bs-theme="dark"] .mh-dash .mh-uncard { background: #16211f; border-color: #5c421f; }
[data-bs-theme="dark"] .mh-dash .mh-uncard__head { background: rgba(192, 86, 0, .16); }
[data-bs-theme="dark"] .mh-dash .mh-uncard__t { color: #f0b968; }
[data-bs-theme="dark"] .mh-dash .mh-uncard__row { border-block-start-color: #2b3a30; }
[data-bs-theme="dark"] .mh-dash .mh-uncard__name { color: #e7efec; }
[data-bs-theme="dark"] .mh-dash .mh-uncard__teacher { color: #c8a877; }

/* action buttons — explicit, labelled, ≥44px tall (never a bare chevron) */
.mh-dash .mh-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .45rem 1.15rem; border-radius: 999px; text-decoration: none;
  background: var(--t-green); color: #fff; font-weight: 800; font-size: .98rem; }
.mh-dash .mh-btn:hover { background: #0f5a37; color: #fff; }
.mh-dash .mh-btn--amber { background: #9a4600; }
.mh-dash .mh-btn--amber:hover { background: #7d3900; }
.mh-dash .mh-btn--outline { background: var(--t-surface); color: #0d5233; border: 2px solid var(--t-green); }
.mh-dash .mh-btn--outline:hover { background: var(--t-green-soft); color: #0d5233; }

/* quiet day — the whole digest collapses to one green line */
.mh-dash .mh-allclear { display: flex; align-items: center; gap: .7rem; background: var(--t-green-soft);
  border: 2px solid var(--t-green); border-radius: 14px; padding: 1rem 1.2rem;
  font-weight: 800; font-size: 1.08rem; color: #0d5233; }
.mh-dash .mh-allclear__ico { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--t-green); color: #fff; font-size: 1.05rem; }

/* الإعلانات — broadcast strip: newest notice (proof it's live) + create button */
.mh-dash .mh-annstrip { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  background: var(--t-surface); border: 2px solid #c7d3cf; border-inline-start: 6px solid var(--t-green);
  border-radius: 14px; padding: .85rem 1.15rem; margin-bottom: 1.5rem; }
.mh-dash .mh-annstrip__ico { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; background: var(--t-green-soft); color: var(--t-green); }
.mh-dash .mh-annstrip__ico .t-ico { width: 21px; height: 21px; }
.mh-dash .mh-annstrip__text { flex: 1 1 220px; min-width: 0; text-decoration: none; }
.mh-dash .mh-annstrip__text:hover .mh-annstrip__title { text-decoration: underline; }
.mh-dash .mh-annstrip__title { display: block; font-weight: 800; font-size: 1.02rem; color: var(--t-brand); }
.mh-dash .mh-annstrip__line { display: block; font-size: .95rem; color: #435049;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-dash .mh-annstrip__more { flex: 0 0 auto; background: var(--t-amber-soft); color: var(--t-amber-ink);
  border-radius: 999px; padding: .1rem .6rem; font-size: .9rem; font-weight: 800; }

/* action tiles — big, clearly tappable, ≥ comfortable target */
.mh-dash .mh-quick { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.mh-dash .mh-action { border: 2px solid #c7d3cf; border-radius: 14px; box-shadow: none;
  gap: .7rem; padding: 1.1rem 1.15rem; min-height: 74px; }
.mh-dash .mh-action__ico { width: 46px; height: 46px; border-radius: 12px; }
.mh-dash .mh-action__ico .t-ico { width: 24px; height: 24px; }
.mh-dash .mh-action__title { font-size: 1.08rem; line-height: 1.2; color: var(--t-ink); }
.mh-dash .mh-action__sub { color: #435049; font-size: .95rem; }
.mh-dash .mh-action__go { color: var(--t-brand); }

/* quick actions — distinct COLOUR-CODED tiles per action (chosen: colored tiles) */
.mh-dash .mh-action::before { display: none; }              /* whole tile is colour-coded now — drop the thin rail */
.mh-dash .mh-action__title { color: inherit; }
.mh-dash .mh-action__sub { color: currentColor; opacity: .82; }
.mh-dash .mh-action__go { color: currentColor; opacity: .55; }
.mh-dash .mh-action:hover { box-shadow: inset 0 0 0 2px currentColor, 0 6px 16px rgba(15, 61, 62, .12); }
.mh-dash .mh-action--student  { background: #e9f5ee; border-color: #7fbf9c; color: #0d5233; }
.mh-dash .mh-action--student  .mh-action__ico { background: #157347; color: #fff; }
.mh-dash .mh-action--circle   { background: #e9f0f8; border-color: #8fb3d6; color: #1f4a72; }
.mh-dash .mh-action--circle   .mh-action__ico { background: #2b5c8a; color: #fff; }
.mh-dash .mh-action--transfer { background: #fdefe0; border-color: #e6b483; color: #8a3d00; }
.mh-dash .mh-action--transfer .mh-action__ico { background: #c05600; color: #fff; }
[data-bs-theme="dark"] .mh-dash .mh-action--student  { background: #12291f; border-color: #2f6f4d; color: #8fe0b3; }
[data-bs-theme="dark"] .mh-dash .mh-action--circle   { background: #122436; border-color: #2f5c86; color: #9cc4ea; }
[data-bs-theme="dark"] .mh-dash .mh-action--transfer { background: #2a1c0e; border-color: #7a4e22; color: #e6b483; }

/* phone — larger targets, comfortable rhythm; digest buttons become full-width bars */
@media (max-width: 560px) {
  .mh-dash .mh-hero__title { font-size: 1.4rem; }
  .mh-dash .mh-card, .mh-dash .mh-action { padding: 1.15rem; }
  .mh-dash .mh-tally { gap: .5rem; }
  .mh-dash .mh-tally__n b { font-size: 1.5rem; }
  .mh-dash .mh-action__ico { width: 48px; height: 48px; }
  .mh-dash .mh-digest__item .mh-btn { flex: 1 1 100%; }
  .mh-dash .mh-annstrip .mh-btn { flex: 1 1 100%; }
}

/* dark theme — keep strong borders + contrast */
[data-bs-theme="dark"] .mh-dash .mh-card,
[data-bs-theme="dark"] .mh-dash .mh-action,
[data-bs-theme="dark"] .mh-dash .mh-digest,
[data-bs-theme="dark"] .mh-dash .mh-annstrip { border-color: #3a4b46; }
[data-bs-theme="dark"] .mh-dash .mh-muted,
[data-bs-theme="dark"] .mh-dash .mh-digest__s,
[data-bs-theme="dark"] .mh-dash .mh-annstrip__line,
[data-bs-theme="dark"] .mh-dash .mh-action__sub { color: #b6c7c2; }
[data-bs-theme="dark"] .mh-dash .mh-tally__n--p { background: #123326; border-color: #2f9463; color: #7fe0ac; }
[data-bs-theme="dark"] .mh-dash .mh-tally__n--a { background: #331a18; border-color: #d0453a; color: #f4a49a; }
[data-bs-theme="dark"] .mh-dash .mh-tally__n--e { background: #332413; border-color: #cf6a12; color: #ecb27a; }
[data-bs-theme="dark"] .mh-dash .mh-tally__n--u { background: #232d2a; border-color: #5a6a66; color: #c3d3cf; }
[data-bs-theme="dark"] .mh-dash .mh-tally__n--zero { background: #1a2321; border-color: #3a4844; color: #8fa09b; }
[data-bs-theme="dark"] .mh-dash .mh-allclear { background: #123326; border-color: #2f9463; color: #7fe0ac; }
[data-bs-theme="dark"] .mh-dash .mh-allclear__ico { background: #2f9463; color: #0e1413; }
[data-bs-theme="dark"] .mh-dash .mh-btn--outline { background: transparent; color: #7fe0ac; border-color: #2f9463; }
[data-bs-theme="dark"] .mh-dash .mh-btn--outline:hover { background: #123326; color: #7fe0ac; }
[data-bs-theme="dark"] .mh-dash .mh-today,
[data-bs-theme="dark"] .mh-dash .mh-hero__status { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.30); }
/* dark: brand-teal text/icons go light so they stay legible on dark surfaces (contrast) */
[data-bs-theme="dark"] .mh-dash .mh-annstrip__title,
[data-bs-theme="dark"] .mh-dash .mh-action__go { color: #8fd3c9; }
[data-bs-theme="dark"] .mh-dash .mh-card__more { color: #7fe0ac; }

/* session-recording fixes */
/* Unit-jump range chips are secondary shortcuts beside the 44px steppers, so they run
   compact — big enough to tap, small enough to keep all four on one line.
   Only size properties are set here, so the base chip tint (lesson/revision) is preserved. */
.chip{min-height:32px;padding:.3rem .6rem;font-size:.82rem;display:inline-flex;align-items:center}
/* Narrower phones (~360px viewport → ~290px card): trim so all four still share one line. */
@media (max-width:400px){.chips{gap:.18rem}.chip{padding:.25rem .38rem;font-size:.74rem}}
/* nothing to move to (already at that unit end) — dimmed, the tap is a no-op */
.chip.chip--idle{opacity:.45}

/* teacher home (today's circles) fixes */
.th-card--progress { background: linear-gradient(135deg, #e2751a, var(--t-amber)); color: #fff; transition: transform .15s, box-shadow .15s; }
.th-card--progress:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(192,86,0,.28); color: #fff; }
.th-progress { font-weight: 800; font-size: 1.15rem; margin-bottom: .35rem; }
.th-meter { height: 10px; max-width: 320px; margin: .2rem auto 1rem; border-radius: 999px; background: rgba(255,255,255,.35); overflow: hidden; }
.th-meter__fill { display: block; height: 100%; border-radius: 999px; background: #fff; transition: width .2s ease; }
.th-cta--sm { font-size: 1.15rem; padding: .7rem 1.3rem; }

/* circle-progress (oversight) fixes */
/* whole learner row is now a link (drop the «عرض» pill) — mirror .t-session's link reset */
.t-learner--link { color: inherit; text-decoration: none; }
.t-learner--link:hover { color: inherit; }
/* right-aligned status column: attendance % + «آخر جلسة» recency */
.t-learner__status { flex: 0 0 auto; text-align: end; margin-inline-start: auto; }
.t-learner__att { font-weight: 700; color: var(--t-green); font-size: .95rem; }
.t-learner__att span { font-weight: 400; color: var(--t-muted); font-size: .78rem; margin-inline-start: .2rem; }
.t-learner__last { color: var(--t-muted); font-size: .78rem; margin-top: .2rem; }

/* ============================================================
   PRINT — a report becomes a document.
   Everything that is chrome (sidebar, topbar, footer, the period
   selector, the export/print buttons themselves) is dropped, and
   what is left is the report and its tables. Ctrl+P, the «طباعة»
   button and the browser's "Save as PDF" all go through this —
   which is also how an Arabic PDF gets produced without a server
   side PDF engine, since the browser already shapes the text.
   ============================================================ */
@media print {
  /* Chrome drops backgrounds and colours when printing; these reports are read
     partly BY colour (درس green, مراجعة amber, the at-risk flags), so keep them. */
  *, *::before, *::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  @page { margin: 14mm; }

  html { font-size: 12px; }
  body { background: #fff !important; }

  .app-sidebar,
  .app-sidebar-backdrop,
  .app-sidebar-toggle,
  .app-topbar,
  .app-footer,
  .stats-period,        /* the period selector — the range is printed in the hero instead */
  .dir-filter,
  .sa-bar,
  .toast-container,
  .t-hero__act,
  .t-noprint { display: none !important; }

  .app-content { margin: 0 !important; }
  .app-main { padding: 0 !important; }

  /* Panels stop being cards and become plain blocks: a shadow costs toner and a
     rounded clip cuts the last row off the bottom of a page. */
  .t-panel, .t-panel--grid, .t-circle, .t-stat {
    box-shadow: none !important;
    overflow: visible !important;
    border-radius: 0;
  }
  .t-panel--grid .t-table th:first-child,
  .t-panel--grid .t-table td:first-child { position: static; }   /* nothing to stick to */

  .t-table { width: 100% !important; font-size: .95em; }
  .t-table thead { display: table-header-group; }   /* repeat the headings on every page */
  .t-table tr { break-inside: avoid; page-break-inside: avoid; }
  .t-table tbody tr:hover { background: transparent !important; }

  /* Columns hidden on a narrow phone are not hidden on A4 — paper is wide. */
  .t-col-opt { display: table-cell !important; }

  /* Sections of اتجاهات الطلاب print open; a collapsed circle would print as a heading
     with nothing under it. */
  details, details .dir-board { display: block !important; }

  /* The hero is a full-bleed dark gradient on screen. On paper that is a band of toner across
     the top of every page for no information, so it becomes a plain titled rule. The data's own
     colours stay — those carry meaning, this did not. */
  .t-hero {
    background: none !important;
    color: #000 !important;
    box-shadow: none !important;
    border-radius: 0;
    border-block-end: 2px solid #000;
    padding: 0 0 .5rem;
    margin-bottom: 1rem;
  }
  .t-hero__title, .t-hero__sub { color: #000 !important; }
  .t-hero__icon { display: none; }
  .t-hero::after { display: none; }   /* the gold star motif — decoration, and it ghosts on paper */

  /* A disclosure caret has nothing to disclose once the section is printed open. */
  .dir-group__head::before { display: none; }

  .t-hero { break-after: avoid; page-break-after: avoid; }
  h1, h2, h3, .t-section-title { break-after: avoid; page-break-after: avoid; }

  /* Bootstrap prints an href after every link by default in some stylesheets; the
     reports are full of them and the URLs are noise on paper. */
  a[href]::after { content: none !important; }
  a { color: inherit !important; text-decoration: none !important; }

  canvas { max-width: 100% !important; break-inside: avoid; }
}

/* ── Telegram (optional): registration step 2, the home nudge, the profile's live status ── */
.tg-kicker { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--t-green); background: var(--t-green-soft); border-radius: 999px; padding: .15rem .7rem; margin-bottom: .6rem; }
.tg-open { font-weight: 600; }
.tg-howto { margin: 1rem 0; }
.tg-howto__intro { font-size: .9rem; color: var(--t-muted); margin-bottom: .6rem; }
.tg-howto__steps { list-style: none; counter-reset: tg; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tg-howto__steps li { counter-increment: tg; display: flex; align-items: center; gap: .6rem; font-size: .95rem; color: var(--t-ink); }
.tg-howto__steps li::before { content: counter(tg); flex: 0 0 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .8rem; background: var(--t-green); color: #fff; }
.tg-howto__ico { flex: 0 0 2.2rem; width: 2.2rem; height: 2.2rem; padding: .4rem; border-radius: 10px; background: var(--t-green-soft); fill: none; stroke: var(--t-green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tg-howto-toggle > summary { cursor: pointer; color: var(--bs-link-color); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.tg-status { border-top: 1px solid var(--t-line); padding-top: 1rem; text-align: center; display: grid; gap: .6rem; }
.tg-status[hidden] { display: none; }
.tg-status__line { font-weight: 600; color: var(--t-muted); display: flex; align-items: center; justify-content: center; gap: .5rem; }
.tg-status__line--done { color: var(--t-green); font-size: 1.15rem; }
.tg-foot { text-align: center; margin-top: 1rem; }
.tg-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: var(--t-green-soft); border: 1px solid var(--t-line); border-radius: 12px; padding: .6rem .8rem; margin-bottom: 1rem; }
.tg-nudge__text { flex: 1 1 12rem; font-weight: 500; color: var(--t-ink); }
.tg-nudge__close { border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--t-muted); min-width: 44px; min-height: 44px; }

/* Users page: role tabs (plain links over the role/status filters) --------------------------- */
.t-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.t-tabs__tab {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 40px;
  padding: .35rem .85rem; border: 1px solid var(--t-line); border-radius: 999px;
  background: var(--t-surface); color: var(--t-ink); font-weight: 600; font-size: .92rem; text-decoration: none;
}
.t-tabs__tab:hover { border-color: #bcdcd2; color: var(--t-ink); }
.t-tabs__tab[aria-current="page"] { background: var(--t-green-soft); border-color: var(--t-green); color: var(--t-green); }
.t-tabs__tab:focus-visible { outline: 2px solid var(--t-green); outline-offset: 2px; }
.t-tabs__n { font-size: .78rem; font-weight: 700; color: var(--t-muted); font-variant-numeric: tabular-nums; }
.t-tabs__n.t-chip { padding: .05rem .5rem; color: var(--t-amber); }

/* Users list: the whole row opens the profile (site.js); the name link is the keyboard path. */
.t-users tr[data-href] { cursor: pointer; }
.t-users .t-users__act { text-align: end; white-space: nowrap; }

/* Phones: each row is a compact card — name, then role + status badge, and the one button. */
@media (max-width: 575.98px) {
  .t-users .t-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; padding: .7rem .9rem; }
  .t-users .t-table td { display: block; width: auto; padding: 0; border: 0; text-align: start; }
  .t-users .t-table td::before { content: none; }
  .t-users .t-table td.t-users__name { flex: 1 0 100%; font-size: 1.02rem; }
  .t-users .t-table td.t-users__role { color: var(--t-muted); font-size: .9rem; }
  .t-users .t-table td.t-users__act { margin-inline-start: auto; }
  .t-users .t-table td.t-users__act:empty { display: none; }
  .t-users .t-table td.t-col-opt { display: none; }
}

/* Exams: the request form (juz steppers + the «نطاق مخصص» editor reused from the session card) ------------ */
.exam-juz { display: flex; flex-wrap: wrap; gap: .75rem; }
.exam-juz[hidden], .exam-custom[hidden] { display: none; }
.exam-counter { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--t-muted); font-weight: 600; min-width: 9rem; }

/* Exams: the tester's queue and the result form (rows become cards below 768px via .t-table + data-label) --- */
.exam-grade { display: flex; align-items: center; gap: .35rem; }
.exam-grade__num { width: 4.75rem; min-height: 44px; text-align: center; font-weight: 800; font-size: 16px; }
.exam-grade__max { color: var(--t-muted); font-size: .85rem; }
.exam-band { font-weight: 700; color: var(--t-green); white-space: nowrap; }
.exam-notes { min-width: 10rem; font-size: 16px; }
.exam-locked td { color: var(--t-muted); }
.exam-by { font-weight: 600; }
.exam-act { white-space: nowrap; }
.exam-act .btn + .btn { margin-inline-start: .25rem; }
@media (max-width: 575.98px) {
  .exam-act { white-space: normal; }
  .exam-act .btn { margin-top: .25rem; }
  .exam-notes { min-width: 0; width: 100%; }
  .exam-counter { min-width: 0; }
}

/* Exams: «طلب اختبار» — two screens of one form (exam-request.js sets data-screen): 1) the students (a table; cards
   below 768px), 2) the range (a card: «→ تغيير الطالب», name + meta, the chooser, the summary + send at the end).
   Without JS (no data-screen) both show stacked, with their step headings and radios. -------------------------------- */
.exam-req[data-screen="1"] .exam-back, .exam-req[data-screen="1"] .exam-range,
.exam-req[data-screen="2"] .exam-pick { display: none; }
.exam-req[data-screen] .exam-req__step { display: none; }
.exam-req__screens { display: flex; flex-direction: column; gap: 1rem; }
.exam-req__step { font-size: 1rem; font-weight: 700; color: var(--t-green); margin: 0 0 .6rem; }
.exam-ok { background: var(--t-green-soft); color: var(--t-green); border-radius: 10px; padding: .65rem .9rem; margin-bottom: .75rem; font-weight: 600; }
.exam-ok a { color: inherit; margin-inline-start: .35rem; }

/* screen 1: the students */
.exam-pick__tools { display: flex; gap: .5rem; margin-bottom: .6rem; max-width: 34rem; }
.exam-pick__tools > * { flex: 1 1 0; min-width: 0; font-size: 16px; }
.exam-pick__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px; overflow: hidden; }
.exam-pick__table th { background: var(--t-bg); color: var(--t-muted); font-weight: 600; text-align: start; padding: .55rem .75rem; }
.exam-pick__table td { padding: .7rem .75rem; border-top: 1px solid var(--t-line); vertical-align: middle; }
.exam-pick__row { cursor: pointer; }
.exam-pick__row:hover td { background: var(--t-row-hover); }
.exam-pick__row.is-selected td { background: var(--t-green-soft); }
.exam-pick__row.is-open td { color: var(--t-muted); cursor: not-allowed; background: transparent; }
.exam-pick__name label { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; cursor: inherit; }
.exam-pick__radio { accent-color: var(--t-green); width: 1.05rem; height: 1.05rem; flex: none; }
/* with JS the row is the control: the radio stays (it posts LearnerUserId, and keyboard users reach it) but unseen */
.exam-req.js-on .exam-pick__radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.exam-req.js-on .exam-pick__name label:focus-within { outline: 2px solid var(--t-green); outline-offset: 2px; border-radius: 4px; }
.exam-pick__circle-sm { display: none; }
.exam-pick__mem { white-space: nowrap; font-weight: 600; }
.exam-pick__last { font-size: .85rem; color: var(--t-muted); white-space: nowrap; }
.exam-pick__go { color: var(--t-green); font-weight: 700; white-space: nowrap; text-align: end; }
.exam-req:not(.js-on) .exam-pick__go { display: none; }
.exam-pick__none { color: var(--t-muted); padding: .75rem .5rem; margin: 0; }

/* screen 2: the range */
.exam-back { align-self: flex-start; background: none; border: 0; padding: .25rem 0; color: var(--t-green); font-weight: 600; min-height: 44px; }
.exam-back:hover { text-decoration: underline; }
.exam-req[data-screen="2"] .exam-req__screens { gap: .25rem; }
.exam-range { padding: 1rem 1.1rem; max-width: 50rem; min-width: 0; overflow: visible; }
.exam-req[data-screen] .exam-who__name { font-size: 1.2rem; }
.exam-req__foot { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; }
.exam-sum { flex: 1; min-width: 0; background: var(--t-green-soft); color: var(--t-ink); border-radius: 10px; padding: .65rem .8rem; font-size: .95rem; }
.exam-sum b { white-space: nowrap; }
.exam-send { flex: none; font-weight: 700; min-height: 46px; padding-inline: 1.6rem; }
.exam-cancel { display: inline-block; margin-top: .5rem; font-size: .85rem; color: var(--t-muted); }

/* the chooser (unchanged from the approved design) */
.exam-who__name { font-weight: 700; font-size: 1.05rem; }
.exam-who__hint { color: var(--t-muted); font-size: .85rem; }
.exam-seg { display: inline-flex; border: 1px solid var(--t-green); border-radius: 10px; overflow: hidden; margin: .65rem 0; }
.exam-seg__btn { flex: 1; border: 0; background: transparent; color: var(--t-green); padding: .5rem 1.4rem; font-weight: 600; min-height: 44px; white-space: nowrap; }
.exam-seg__btn.is-on { background: var(--t-green); color: #fff; }
.exam-sugs-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .6rem; }
.exam-sug { border: 1px solid var(--t-green); color: var(--t-green); background: transparent; border-radius: 999px; padding: .35rem .8rem; font-size: .88rem; min-height: 38px; }
.exam-sug.is-on { background: var(--t-green); color: #fff; }
.exam-hint { font-size: .8rem; color: var(--t-muted); margin: .2rem 0 .35rem; }
.exam-legend { display: flex; gap: .8rem; font-size: .75rem; color: var(--t-muted); margin-bottom: .35rem; }
.exam-legend span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-inline-end: .3rem; vertical-align: -1px; }
.exam-legend__mem::before { border: 2px solid color-mix(in srgb, var(--t-green) 50%, transparent); }
.exam-legend__sel::before { background: var(--t-green); }
.exam-jgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .3rem; }
.exam-j, .exam-s { border: 1px solid var(--t-line); border-radius: 8px; background: var(--t-surface); color: var(--t-ink); min-height: 40px; font-size: .9rem; padding: 0; user-select: none; }
.exam-s { padding: .5rem .9rem; font-size: 1rem; min-height: 44px; border-radius: 10px; }
.exam-j.is-mem, .exam-s.is-mem { background: var(--t-surface); color: var(--t-ink); border: 2px solid color-mix(in srgb, var(--t-green) 50%, transparent); }
/* outside a known memorized extent: muted, still tappable (a teacher may test beyond); a selection still shows over it */
.exam-j.is-no, .exam-s.is-no { background: var(--t-bg); color: color-mix(in srgb, var(--t-muted) 55%, transparent); }
.exam-j.is-in, .exam-s.is-in { background: var(--t-green-soft); border-color: var(--t-green); color: var(--t-ink); }
.exam-j.is-end, .exam-s.is-end { background: var(--t-green); border-color: var(--t-green); color: #fff; }
.exam-jrow { display: flex; flex-wrap: wrap; gap: .25rem; padding-bottom: .3rem; margin-bottom: .4rem; }
.exam-jrow .exam-j { flex: 0 0 2.4rem; min-height: 38px; font-size: .82rem; }
.exam-jrow .exam-j.is-cur { outline: 2px solid var(--t-green); outline-offset: -2px; font-weight: 700; }
.exam-schips { display: flex; flex-wrap: wrap; gap: .45rem; min-height: 44px; }
.exam-ssearch { margin-bottom: .5rem; font-size: 16px; }
.exam-ayah-link { background: none; border: 0; color: var(--t-green); font-size: .85rem; padding: .5rem 0 0; }
.exam-ayah-link:hover { text-decoration: underline; }
.exam-fallback { display: flex; flex-wrap: wrap; gap: .75rem; }
.exam-fallback label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--t-muted); font-weight: 600; }
.exam-req.js-on .exam-fallback { display: none; }

/* Phones: the students become cards (name; tags: circle · المحفوظ · آخر اختبار; a «‹» chevron), bigger targets,
   a 6-column juz grid, a full-width segmented control, the juz row scrolls, summary above a full-width send. */
@media (max-width: 767.98px) {
  .exam-pick__tools { max-width: none; }
  .exam-pick__table, .exam-pick__table tbody { display: block; background: none; border: 0; border-radius: 0; overflow: visible; }
  .exam-pick__table thead { display: none; }
  .exam-pick__row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .25rem; min-height: 56px; margin-bottom: .5rem;
    padding: .65rem .75rem; padding-inline-end: 2.4rem; background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px; }
  .exam-req:not(.js-on) .exam-pick__row { padding-inline-end: .75rem; }
  .exam-pick__row[hidden] { display: none; }
  .exam-pick__row:hover, .exam-pick__row:hover td { background: var(--t-row-hover); }
  .exam-pick__row.is-selected, .exam-pick__row.is-selected td { background: var(--t-green-soft); }
  .exam-pick__row.is-open { opacity: .6; }
  .exam-pick__row.is-open, .exam-pick__row.is-open td { background: var(--t-surface); }
  .exam-pick__table td { display: block; padding: 0; border: 0; }
  .exam-pick__table td.exam-pick__name { flex: 1 0 100%; font-size: 1rem; }
  .exam-pick__radio { width: 1.3rem; height: 1.3rem; }
  .exam-pick__table td.exam-pick__circle, .exam-pick__table td.exam-pick__mem, .exam-pick__table td.exam-pick__last {
    font-size: .74rem; font-weight: 600; color: var(--t-muted); background: var(--t-bg); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap;
  }
  .exam-pick__table td.is-none { display: none; }
  .exam-pick__mem[data-label]::before, .exam-pick__last[data-label]::before { content: attr(data-label) " "; font-weight: 400; }
  .exam-pick__table .exam-pick__row.is-open td.exam-pick__last { background: transparent; padding: 0; }
  .exam-pick__table td.exam-pick__go { position: absolute; inset-inline-end: .8rem; top: 50%; transform: translateY(-50%); color: var(--t-muted); font-size: 1.4rem; font-weight: 400; background: none; }
  .exam-pick__go-lbl { display: none; }

  .exam-range { padding: .85rem .8rem; }
  .exam-seg { display: flex; width: 100%; }
  .exam-sug { min-height: 44px; }
  .exam-jgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem; }
  .exam-jgrid .exam-j { min-height: 46px; font-size: 1.05rem; font-weight: 600; }
  .exam-jrow { flex-wrap: nowrap; overflow-x: auto; }
  .exam-jrow .exam-j { flex: 0 0 2.9rem; min-height: 44px; font-size: .95rem; }
  .exam-s { min-height: 48px; font-size: 1.05rem; padding: .55rem 1rem; }
  .exam-schips { gap: .5rem; }
  .exam-req__foot { flex-direction: column; align-items: stretch; gap: .6rem; }
  .exam-send { width: 100%; min-height: 48px; }
}

/* ============================================================
   «تقدّمي» — the student dashboard (/{code}/Progress). Mobile-first; rides the theme tokens, so dark mode
   follows [data-bs-theme="dark"] without a second palette. Quality colours: ممتاز green, مقبول amber, يُعاد red.
   ============================================================ */
.sp-sec { margin-bottom: 1.6rem; }
.t-panel.sp-sec { padding: 1rem 1.15rem; }
.sp-muted { color: var(--t-muted); font-weight: 400; }
.sp-link { font-weight: 600; font-size: .9rem; }

.sp-alert { border: 1px solid var(--t-line); border-inline-start: 4px solid var(--t-amber); background: var(--t-amber-soft); border-radius: var(--t-radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.sp-alert__title { font-weight: 600; color: var(--t-amber-ink); margin-bottom: .35rem; }
.sp-alert__title .t-ico { width: 18px; height: 18px; vertical-align: -3px; }
.sp-alert__row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .25rem 0; }
.sp-alert__who { flex: 1 1 12rem; min-width: 0; }
.sp-alert__who small { color: var(--t-muted); }

.sp-hero { align-items: flex-start; }
.sp-hero__body { flex: 1 1 14rem; min-width: 0; position: relative; z-index: 1; }
.sp-hero__kicker { font-size: .8rem; letter-spacing: .02em; color: #bfe4da; margin-bottom: .15rem; }
.sp-hero .t-hero__sub .t-ico { width: 16px; height: 16px; vertical-align: -3px; color: #bfe4da; }
.sp-hero__frontier { margin-top: .6rem; font-size: 1.15rem; font-weight: 700; color: #fff; }
.sp-hero__frontier--empty { font-size: .95rem; font-weight: 400; color: #eafaf5; }
.sp-track { position: relative; z-index: 1; flex: none; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: .25rem .8rem; font-size: .82rem; font-weight: 600; }

.sp-juz { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35rem; }
@media (min-width: 576px) { .sp-juz { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
.sp-juz__cell {
  min-height: 40px; display: grid; place-items: center; border-radius: 10px; font-weight: 700; font-size: .95rem;
  border: 1px solid var(--t-line); color: var(--t-muted); background: var(--t-surface);
}
.sp-juz__cell--part { color: var(--t-ink); background: linear-gradient(to top, var(--t-green-soft) var(--fill), var(--t-surface) var(--fill)); border-color: var(--t-green); }
.sp-juz__cell--full { color: #fff; background: var(--t-green); border-color: var(--t-green); }

.sp-goal__text { font-weight: 600; }

.sp-streak { margin-top: .35rem; font-size: .85rem; font-weight: 600; color: var(--t-green); }
.sp-streak .t-ico { width: 16px; height: 16px; vertical-align: -3px; }
.sp-surahs { margin-top: .35rem; font-size: .85rem; color: var(--t-ink); line-height: 1.5; }

.sp-exam__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.sp-exam__head .t-section-title { margin: 0; }
.sp-exam__head .t-ico { width: 20px; height: 20px; vertical-align: -4px; color: var(--t-green); }
.sp-exam__body { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.sp-exam__grade { font-size: 1.8rem; font-weight: 700; color: var(--t-green); line-height: 1; }

.sp-q { display: inline-flex; align-items: center; border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.sp-q--exc { background: var(--t-green-soft); color: var(--t-green); }
.sp-q--acc { background: var(--t-amber-soft); color: var(--t-amber-ink); }
.sp-q--rep { background: color-mix(in srgb, var(--t-red) 14%, transparent); color: var(--t-red); }
.sp-q--skip, .sp-q--none { background: var(--t-line); color: var(--t-muted); }

/* «أين وصلتُ في المصحف» — three equal rings across at every width (hizb · juz · Quran) */
.sp-rings { margin-bottom: .25rem; }
.sp-rings section.stats-card { margin-bottom: .75rem; height: calc(100% - .75rem); }
/* the ring sits on the card's bottom edge, so a title or caption that wraps on a phone never drops one ring below the others */
.sp-rings .stats-card__chart { margin-top: auto; }
.sp-rings__note { margin: -.25rem 0 1rem; font-size: .85rem; text-align: center; }
.sp-rings .stats-card > .t-section-title { font-size: .95rem; display: flex; flex-direction: column; gap: .15rem; text-align: center; }
.sp-rings .stats-card > .t-section-title small { font-size: .8rem; font-weight: 500; }
.sp-rings .stats-panel { padding: .5rem; }
@media (max-width: 575.98px) {
  .sp-rings .stats-card > .t-section-title { font-size: .8rem; }
  .sp-rings .stats-card > .t-section-title small { font-size: .72rem; }
}

.sp-log { display: flex; flex-direction: column; gap: .6rem; }
/* the log's header: the title, and the من/إلى range filter inline beside it (wraps under it on phones) */
.sp-log__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.sp-log__head .t-section-title { margin: 0; }
.sp-log__filter { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sp-log__filter label { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: .85rem; color: var(--t-muted); }
.sp-log__filter input[type="date"] { width: auto; }
/* the log as a table (student page): a range then its grade pill in one cell; the date never wraps */
.sp-log-table .sp-card__date { white-space: nowrap; }
.sp-log-table .sp-range { font-size: .95rem; white-space: nowrap; }
.sp-log-table td:nth-child(4) .sp-range { white-space: normal; }   /* the scattered list may wrap */
.sp-log-table .sp-range + .sp-q { margin-inline-start: .4rem; }
/* phones: the row-cards (site-wide .t-table rule) — the value side may wrap, the label keeps its width */
@media (max-width: 767.98px) {
  .sp-log-table .sp-card__date, .sp-log-table .sp-range { white-space: normal; }
  .sp-log-table td > div, .sp-log-table td > .sp-range { min-width: 0; }
  .sp-log-table .sp-range + .sp-q { margin-inline-start: 0; margin-block-start: .25rem; }
  .sp-log-table td { flex-wrap: wrap; }
  .sp-log-table td .sp-range { flex: 1 1 100%; }
  .sp-log-table td::before { align-self: flex-start; }
}
.sp-card { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px; }
.sp-card--slim { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; font-size: .9rem; color: var(--t-muted); }
.sp-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .6rem .9rem; }
.sp-card__date { flex: none; font-weight: 600; font-size: .88rem; color: var(--t-ink); white-space: nowrap; }
.sp-card--session .sp-card__date { font-weight: 700; font-size: .95rem; }
.sp-att { flex: none; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: .05rem .5rem; }
.sp-att--present { background: var(--t-green-soft); color: var(--t-green); }
.sp-att--absent { background: color-mix(in srgb, var(--t-red) 14%, transparent); color: var(--t-red); }
.sp-att--excused { background: var(--t-line); color: var(--t-muted); }
.sp-card__body { border-top: 1px solid var(--t-line); padding: .6rem .9rem .75rem; display: grid; gap: .55rem; }
/* one part per درس / الدرس السابق / مراجعة, each on its colour rail */
.sp-part { display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem; align-items: baseline; border-inline-start: 4px solid var(--t-line); padding-inline-start: .65rem; }
.sp-part__name { font-size: .82rem; font-weight: 600; color: var(--t-muted); }
.sp-part--lesson { border-inline-start-color: var(--t-green); }
.sp-part--prev { border-inline-start-color: var(--t-blue); }
.sp-part--revision { border-inline-start-color: var(--t-amber); }
.sp-part--lesson .sp-part__name { color: var(--t-green); }
.sp-part--prev .sp-part__name { color: var(--t-blue); }
.sp-part--revision .sp-part__name { color: var(--t-amber-ink); }
[data-bs-theme="dark"] .sp-part--revision .sp-part__name { color: var(--t-amber); }
.sp-part__main { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; min-width: 0; }
.sp-range { font-weight: 700; font-size: 1rem; color: var(--t-ink); }
/* where a one-surah درس falls in its surah: the surah as a thin track, --a..--b filled (ayah 1 at the start edge) */
.sp-track-bar { position: relative; display: block; flex: 1 0 100%; max-width: 18rem; height: 6px; border-radius: 3px; background: var(--t-line); }
.sp-track-bar::after {
  content: ""; position: absolute; inset-block: 0; border-radius: 3px; background: var(--t-green);
  inset-inline-start: var(--a); inset-inline-end: calc(100% - var(--b));
}
.sp-more { margin-top: .6rem; }
@media (max-width: 575px) {
  .sp-part { grid-template-columns: 1fr; gap: .15rem; }
  .sp-card__date { font-size: .82rem; }
}

/* التقدم › one circle, phones: each learner is a <details> row (name + attendance/absences closed; the rest inside),
   so the per-learner table never scrolls sideways. */
.cp-learners { margin-bottom: 1rem; }
.cp-learner { border-bottom: 1px solid var(--t-line); }
.cp-learner .t-fold__title { min-width: 0; overflow-wrap: anywhere; }
.cp-learner__body { margin: 0 0 .5rem; display: grid; gap: .3rem; }
.cp-learner__body > div { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cp-learner__body dt { font-weight: 500; color: var(--bs-secondary-color, #6c757d); }
.cp-learner__body dd { margin: 0; text-align: end; }
.cp-learner > .btn { margin-bottom: .6rem; }

/* سجل الجلسات: a day with work is a closed <details>; its summary is the head (date · attendance · recap), a caret at
   the line's end, the recap on its own line and hidden once the card is open (the parts say it in full). */
.sp-card--session > .sp-card__head { cursor: pointer; list-style: none; }
.sp-card--session > .sp-card__head::-webkit-details-marker { display: none; }
.sp-card--session > .sp-card__head:focus-visible { outline: 2px solid var(--sidebar-accent, #157347); outline-offset: 2px; border-radius: 12px; }
.sp-card--session > .sp-card__head::after {
  content: ""; order: 1; margin-inline-start: auto; width: .45rem; height: .45rem; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .5;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
.sp-card--session[open] > .sp-card__head::after { transform: translateY(2px) rotate(-135deg); }
.sp-card__recap { order: 2; flex: 1 1 100%; min-width: 0; font-size: .85rem; color: var(--t-muted); overflow-wrap: anywhere; }
.sp-card--session[open] .sp-card__recap { display: none; }
@media (prefers-reduced-motion: reduce) {
  .sp-card--session > .sp-card__head::after { transition: none; }
}
