/* ==========================================================================
   أوراق — dashboard design system (Admin + School). RTL-first, no external assets.
   Class reference: server/CONTRACT.md § "CSS classes". Reuse these; add page CSS only
   in a page's own <style>-free way (extra classes appended at the end of this file by the owner).
   ========================================================================== */

:root {
  --teal: #0E5A56;
  --teal-deep: #083B38;
  --teal-600: #12706B;
  --teal-50: #E7F1F0;
  --teal-100: #CFE4E2;
  --gold: #C9A24A;
  --gold-ink: #A8822E;
  --gold-soft: #F4E7C5;
  --gold-50: #FBF4E2;
  --paper: #FBF8F3;
  --surface: #FFFFFF;
  --ink: #1F2A28;
  --ink-2: #44514E;
  --muted: #6F7B78;
  --line: #E7E1D6;
  --line-2: #F0EBE2;
  --red: #B42318;
  --red-50: #FDECEA;
  --green: #1E7B45;
  --green-50: #E6F4EC;
  --orange: #B54708;
  --orange-50: #FEF0E2;
  --blue: #175CD3;
  --blue-50: #EAF1FD;
  --gray-50: #F2F1EE;

  --font: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow: 0 1px 2px rgba(8, 59, 56, .05), 0 4px 16px rgba(8, 59, 56, .06);
  --shadow-lg: 0 10px 40px rgba(8, 59, 56, .16);
  --sidebar-w: 264px;
  --topbar-h: 68px;
  --focus: 0 0 0 3px rgba(201, 162, 74, .45);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); text-decoration: underline; }
img, svg { vertical-align: middle; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; color: var(--ink); }
p { margin: 0 0 .75rem; }
hr, .divider { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-xs); }
::selection { background: var(--gold-soft); }

/* ── Utilities ─────────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.bold { font-weight: 700; }
.mono { font-family: var(--mono); font-size: .92em; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-gold { color: var(--gold-ink); }
.text-center { text-align: center; }
.text-end { text-align: left; } /* RTL: "end" side is the left */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.row-center { justify-content: center; }
.spacer { flex: 1; }
.grid { display: grid; gap: 1rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.app { min-height: 100vh; display: flex; }

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;            /* right side in RTL */
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--teal-deep) 0%, #0A4642 100%);
  color: #DCEBE9;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .22s ease;
}
.brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.15rem 1.25rem 1rem;
  color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand:hover { color: #fff; text-decoration: none; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: var(--paper);
  display: grid; place-items: center; flex: none; padding: 5px;
}
.brand-logo img { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: 0; }
.brand-sub { font-size: 12px; color: var(--gold-soft); opacity: .9; }

.nav { flex: 1; overflow-y: auto; padding: .9rem .75rem; display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 11.5px; color: rgba(220, 235, 233, .55); padding: .9rem .75rem .35rem; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem .8rem; border-radius: var(--radius-sm);
  color: #DCEBE9; font-weight: 500; font-size: 14.5px;
  text-decoration: none; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(244, 231, 197, .14); color: #fff; font-weight: 700; }
.nav-item.active::before {
  content: ""; position: absolute; inset-inline-start: -.75rem; top: 8px; bottom: 8px;
  width: 4px; border-radius: 4px; background: var(--gold);
}
.nav-icon { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav-item.active .nav-icon { color: var(--gold); opacity: 1; }
.nav-badge {
  margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--gold); color: var(--teal-deep); font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}

.sidebar-foot { padding: .9rem 1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-chip { display: flex; align-items: center; gap: .65rem; margin-bottom: .7rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--gold-soft); color: var(--teal-deep);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-name { color: #fff; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: rgba(220, 235, 233, .7); font-size: 12px; }
.sidebar-foot .btn { width: 100%; }

.main { flex: 1; min-width: 0; margin-inline-start: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--topbar-h);
  display: flex; align-items: center; gap: .9rem;
  padding: .75rem 2rem;
  background: rgba(251, 248, 243, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-titles { display: flex; flex-direction: column; min-width: 0; }
.page-title { font-size: 21px; font-weight: 800; }
.page-subtitle { font-size: 13px; color: var(--muted); }
.page-actions { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.page-actions:empty { display: none; }
.topbar .sidebar-toggle { display: none; }

.content { padding: 1.75rem 2rem 3rem; width: 100%; max-width: 1320px; }
.content-narrow { max-width: 760px; }

.backdrop { display: none; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2);
}
.card-title { font-size: 16px; font-weight: 800; }
.card-sub { font-size: 13px; color: var(--muted); }
.card-body { padding: 1.25rem; }
.card-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--line-2); background: #FDFBF8; border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.card-accent { border-top: 4px solid var(--gold); }

/* Key/value list (order details, profile) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ── Stat tiles ────────────────────────────────────────────────────────── */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem; display: flex; gap: .9rem; align-items: flex-start;
  color: inherit; text-decoration: none;
}
a.stat:hover { border-color: var(--teal-100); text-decoration: none; color: inherit; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--teal-50); color: var(--teal);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat--gold .stat-icon { background: var(--gold-50); color: var(--gold-ink); }
.stat--green .stat-icon { background: var(--green-50); color: var(--green); }
.stat--red .stat-icon { background: var(--red-50); color: var(--red); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem 1rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.btn:hover { text-decoration: none; background: #F8F5EF; color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--teal-deep); }
.btn-gold:hover { background: var(--gold-ink); border-color: var(--gold-ink); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--teal-100); color: var(--teal); }
.btn-secondary:hover { background: var(--teal-50); color: var(--teal-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--gray-50); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #8F1C13; border-color: #8F1C13; color: #fff; }
.btn-danger-soft { background: var(--red-50); border-color: #F6C9C4; color: var(--red); }
.btn-danger-soft:hover { background: #FAD9D5; color: #8F1C13; }
.btn-light { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #E9F3F2; }
.btn-light:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: 13px; border-radius: 8px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { min-height: 48px; padding: .7rem 1.4rem; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-group { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
form.inline { display: inline; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.label { font-size: 14px; font-weight: 700; color: var(--ink); }
.label .req { color: var(--red); margin-inline-start: 2px; }
.label .opt { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.hint { font-size: 12.5px; color: var(--muted); }

.input, .select, .textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 42px; padding: .55rem .8rem;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid #D9D2C5; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236F7B78'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: left .7rem center;
  padding-left: 2.2rem;
}
.input:hover, .select:hover, .textarea:hover { border-color: #C8BFAF; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 90, 86, .15); }
.input::placeholder, .textarea::placeholder { color: #A39C90; }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--gray-50); color: var(--ink-2); }
.input-ltr { direction: ltr; text-align: right; }
.input[type="color"] { padding: 4px; width: 56px; min-height: 42px; }

.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: 14.5px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg { position: absolute; inset-inline-start: .75rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-group > .input { padding-inline-start: 2.4rem; }

.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding-top: .25rem; }

/* ASP.NET validation tag-helper output */
.field-validation-error, .field-error { color: var(--red); font-size: 13px; font-weight: 600; }
.field-validation-valid { display: none; }
.input-validation-error, .input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red) !important; background: #FFFBFA; }
.input-validation-error:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .14) !important; }
.validation-summary-errors {
  background: var(--red-50); border: 1px solid #F6C9C4; color: var(--red);
  border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: 14px; font-weight: 600;
}
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; }
.validation-summary-valid { display: none; }

/* Filters bar above tables */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; }
.toolbar .input-group { min-width: 240px; flex: 1; max-width: 420px; }
.toolbar .input-group .input { width: 100%; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: .75rem 1rem; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line-2); }
.table th {
  font-size: 12.5px; font-weight: 700; color: var(--muted); background: #FDFBF8; white-space: nowrap;
  position: sticky; top: 0;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FDFBF6; }
.table td.num, .table th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .table-actions { text-align: end; white-space: nowrap; width: 1%; }
.table .row-muted td { color: var(--muted); }
.table a.row-link { font-weight: 700; color: var(--ink); }
.table a.row-link:hover { color: var(--teal); }
.cell-title { font-weight: 700; color: var(--ink); }
.cell-sub { font-size: 12.5px; color: var(--muted); }

.pagination { display: flex; gap: .35rem; align-items: center; justify-content: center; padding: 1rem; flex-wrap: wrap; }
.pagination .btn { min-width: 36px; }
.pagination .current { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── Badges & chips ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .6rem; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; line-height: 1.6; white-space: nowrap;
  background: var(--gray-50); color: var(--ink-2); border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.no-dot::before { display: none; }
.badge-teal { background: var(--teal-50); color: var(--teal); }
.badge-gold { background: var(--gold-50); color: var(--gold-ink); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-orange { background: var(--orange-50); color: var(--orange); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-gray { background: var(--gray-50); color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
a.chip:hover { border-color: var(--teal-100); color: var(--teal); text-decoration: none; }
.chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tab {
  padding: .65rem 1rem; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent;
  white-space: nowrap; text-decoration: none; margin-bottom: -1px;
}
.tab:hover { color: var(--teal); text-decoration: none; }
.tab.active { color: var(--teal); border-bottom-color: var(--gold); }
.tab .nav-badge { margin-inline-start: .35rem; }

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid;
  font-size: 14.5px; font-weight: 600; margin-bottom: 1rem;
}
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-success { background: var(--green-50); border-color: #BFE3CD; color: #145A32; }
.alert-error { background: var(--red-50); border-color: #F6C9C4; color: #8F1C13; }
.alert-warning { background: var(--gold-50); border-color: #EBD9A8; color: #7A5A12; }
.alert-info { background: var(--teal-50); border-color: var(--teal-100); color: var(--teal-deep); }
.alert-close { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 .25rem; }
.alert-close:hover { opacity: 1; }

/* One-time secret (temporary password) */
.secret-box {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--gold-50); border: 1px dashed var(--gold); border-radius: var(--radius-sm); padding: .9rem 1rem;
}
.secret-value {
  direction: ltr; font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: .06em;
  color: var(--teal-deep); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .8rem;
  user-select: all;
}

/* ── Empty states ──────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%;
  background: var(--gold-50); color: var(--gold-ink); display: grid; place-items: center;
}
.empty-icon svg { width: 30px; height: 30px; }
.empty-title { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: .3rem; }
.empty-text { font-size: 14px; max-width: 420px; margin: 0 auto 1rem; }

/* ── Catalog bits ──────────────────────────────────────────────────────── */
.cover-swatch {
  width: 38px; height: 52px; border-radius: 4px 8px 8px 4px; flex: none;
  background: linear-gradient(160deg, var(--c1, var(--teal)), var(--c2, var(--teal-deep)));
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .12);
  position: relative;
}
.cover-swatch::after {
  content: ""; position: absolute; inset-inline: 6px; bottom: 8px; height: 3px; border-radius: 2px;
  background: var(--c3, var(--gold));
}
.cover-swatch.lg { width: 96px; height: 132px; border-radius: 6px 12px 12px 6px; }
.thumb-row { display: flex; align-items: center; gap: .75rem; min-width: 0; }

.progress { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.progress.gold > span { background: var(--gold); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.timeline li { display: flex; gap: .7rem; align-items: flex-start; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); margin-top: 6px; flex: none; box-shadow: 0 0 0 4px var(--teal-50); }
.timeline li.muted .dot { background: var(--line); box-shadow: 0 0 0 4px var(--line-2); }

/* ── Auth pages (setup / login / change password) ─────────────────────── */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(201, 162, 74, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(14, 90, 86, .14), transparent 60%),
    var(--paper);
}
.auth-card {
  width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg); padding: 2rem 1.75rem;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.4rem; text-align: center; }
.auth-brand img { width: 64px; height: 64px; }
.auth-title { font-size: 22px; font-weight: 800; }
.auth-sub { color: var(--muted); font-size: 14px; }
.auth-foot { text-align: center; margin-top: 1.25rem; font-size: 13px; color: var(--muted); }
.auth-badge { display: inline-block; background: var(--gold-soft); color: var(--gold-ink); font-weight: 800; font-size: 12px; padding: .15rem .65rem; border-radius: 999px; }

/* Error page */
.error-code { font-size: 64px; font-weight: 800; color: var(--gold); line-height: 1; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); }   /* RTL: hide to the right */
  html[dir="ltr"] .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sidebar-open .backdrop {
    display: block; position: fixed; inset: 0; background: rgba(8, 59, 56, .4); z-index: 30;
  }
  .main { margin-inline-start: 0; }
  .topbar .sidebar-toggle { display: inline-flex; }
  .topbar { padding: .65rem 1rem; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .grid-2, .grid-3, .grid-4, .form-row, .form-row-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .hidden-mobile { display: none !important; }
  .page-title { font-size: 18px; }
  .toolbar .input, .toolbar .select, .toolbar .input-group { min-width: 0; width: 100%; max-width: none; flex: 1 1 100%; }
}

@media (max-width: 520px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .kv dd { margin-bottom: .5rem; }
  .stat-value { font-size: 22px; }
  .topbar { flex-wrap: wrap; }
  .page-actions { width: 100%; margin-inline-start: 0; }
  .table th, .table td { padding: .6rem .7rem; }
}

@media print {
  .sidebar, .topbar, .page-actions, .btn, .toolbar { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; }
}

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

/* ==========================================================================
   Page-specific additions (owners append below, prefixed by area):
   .adm-*  → Admin agent      .sch-*  → School agent
   ========================================================================== */

/* school ──────────────────────────────────────────────────────────────────
   Owner: School agent. Only .sch-* classes. */
.sch-hero {
  display: flex; gap: 1.25rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 1.35rem 1.5rem;
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(201, 162, 74, .16), transparent 70%),
    linear-gradient(135deg, #FFFFFF 0%, var(--teal-50) 100%);
  border-color: var(--teal-100);
}
.sch-hero-main { flex: 1 1 320px; min-width: 0; }
.sch-hero-name { font-size: 20px; font-weight: 800; color: var(--teal-deep); }
.sch-hero-text { margin: .6rem 0 0; color: var(--ink-2); font-size: 14px; max-width: 560px; }
.sch-code-box {
  display: flex; flex-direction: column; align-items: center; gap: .45rem; flex: none;
  background: var(--teal-deep); color: #fff; border-radius: var(--radius); padding: 1rem 1.4rem; min-width: 210px;
  box-shadow: var(--shadow);
}
.sch-code-label { font-size: 12px; color: var(--gold-soft); font-weight: 700; }
.sch-code {
  direction: ltr; font-family: var(--mono); font-size: 28px; font-weight: 800; letter-spacing: .08em;
  color: #fff; user-select: all; line-height: 1.2;
}

.sch-list { list-style: none; margin: 0; padding: 0; }
.sch-list li {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--line-2);
}
.sch-list li:last-child { border-bottom: 0; }
.sch-list-main { display: flex; flex-direction: column; min-width: 0; color: inherit; }
.sch-list-main:hover { text-decoration: none; }
a.sch-list-main:hover .cell-title { color: var(--teal); }
.sch-list-main .cell-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sch-bulkbar { background: #FDFBF8; }
.sch-check { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; cursor: pointer; }

.sch-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sch-facts { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: 0; }
.sch-facts dt { font-size: 12.5px; color: var(--muted); }
.sch-facts dd { margin: 0; font-weight: 800; color: var(--ink); }
.sch-sheet-bar { display: flex; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; }
.sch-sheet-bar .check { padding-bottom: .6rem; }
.sch-max-field { width: 140px; }
.sch-score { display: flex; align-items: center; gap: .5rem; }
.sch-score .input { width: 96px; min-height: 38px; text-align: center; font-weight: 700; font-size: 16px; }
.sch-sheet tbody tr:focus-within td { background: var(--gold-50); }

.sch-scope { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.sch-scope legend { padding: 0; margin-bottom: .5rem; }
.sch-scope-options { display: grid; gap: .6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sch-scope-option { position: relative; cursor: pointer; }
.sch-scope-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sch-scope-option > span {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; height: 100%;
  padding: .8rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.sch-scope-option > span svg { width: 20px; height: 20px; color: var(--teal); margin-bottom: .2rem; }
.sch-scope-option b { font-size: 14.5px; }
.sch-scope-option small { font-size: 12.5px; color: var(--muted); }
.sch-scope-option:hover > span { border-color: var(--teal-100); }
.sch-scope-option input:checked + span { border-color: var(--teal); background: var(--teal-50); box-shadow: 0 0 0 3px rgba(14, 90, 86, .12); }
.sch-scope-option input:focus-visible + span { box-shadow: var(--focus); }

[data-scope-show][hidden] { display: none !important; }

.sch-notice-title { font-size: 16px; font-weight: 800; }
.sch-notice-body { margin: 0; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .sch-code-box { width: 100%; }
  .sch-scope-options { grid-template-columns: minmax(0, 1fr); }
}

/* admin ─────────────────────────────────────────────────────────────────
   Admin agent block (.adm-*). Used by Pages/Admin/**.
   ────────────────────────────────────────────────────────────────────── */
.adm-stat-money { font-size: 21px; white-space: nowrap; }
.adm-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adm-chips { gap: .45rem; }
.adm-actions { flex-wrap: nowrap; justify-content: flex-end; }
.adm-chips .chip .num { opacity: .75; font-size: 12px; }

.adm-dash-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.adm-detail-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.adm-form-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.adm-side { position: sticky; top: calc(var(--topbar-h) + 1rem); }

.adm-status-row { display: flex; flex-direction: column; gap: .35rem; color: inherit; text-decoration: none; padding: .2rem 0; }
.adm-status-row:hover { text-decoration: none; color: inherit; }
.adm-status-row:hover .badge { filter: brightness(.96); }

.adm-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.adm-quick a {
  display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #FDFBF8; color: var(--ink); font-weight: 700; font-size: 13.5px;
}
.adm-quick a:hover { border-color: var(--teal-100); background: var(--teal-50); color: var(--teal-deep); text-decoration: none; }
.adm-quick svg { width: 18px; height: 18px; color: var(--gold-ink); flex: none; }

.adm-date { display: inline-flex; align-items: center; gap: .35rem; }
.toolbar .adm-date .input { min-width: 150px; }

/* Order details */
.adm-badge-lg { font-size: 14px; padding: .3rem .85rem; }
.adm-steps { display: flex; gap: 0; padding: 0 1.25rem 1.25rem; overflow-x: auto; }
.adm-step { flex: 1; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: .4rem; position: relative; text-align: center; }
.adm-step::before {
  content: ""; position: absolute; top: 13px; inset-inline-start: 50%; width: 100%; height: 3px; background: var(--line-2); z-index: 0;
}
.adm-step:last-child::before { display: none; }
.adm-step.done::before { background: var(--teal-100); }
.adm-step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; z-index: 1;
  background: var(--surface); border: 2px solid var(--line); color: #fff;
}
.adm-step-dot svg { width: 15px; height: 15px; }
.adm-step.done .adm-step-dot { background: var(--teal); border-color: var(--teal); }
.adm-step.current .adm-step-dot { box-shadow: 0 0 0 5px var(--gold-soft); }
.adm-step.cancelled .adm-step-dot { background: var(--red); border-color: var(--red); }
.adm-step-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.adm-step.done .adm-step-label, .adm-step.current .adm-step-label { color: var(--ink); }

.adm-totals { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; margin: 0; max-width: 360px; margin-inline-start: auto; }
.adm-totals dt { color: var(--muted); font-size: 14px; }
.adm-totals dd { margin: 0; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-totals .adm-total { border-top: 1px solid var(--line); padding-top: .5rem; font-size: 17px; font-weight: 800; color: var(--ink); }
.adm-dot-red { background: var(--red) !important; box-shadow: 0 0 0 4px var(--red-50) !important; }
.adm-note { background: var(--gold-50); border: 1px solid #EBD9A8; border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: 14px; }

.adm-notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.adm-notif-list li { padding-bottom: .75rem; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: .15rem; }
.adm-notif-list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Books */
.adm-flags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .2rem; }
.adm-flags:empty { display: none; }
.adm-flags .badge { font-size: 11px; padding: 0 .45rem; }
.adm-help { background: var(--teal-50); color: var(--teal-deep); border-radius: var(--radius-sm); padding: .65rem .85rem; font-size: 13.5px; }
.adm-chapters { min-height: 280px; font-size: 14.5px; line-height: 1.8; }
.adm-cover-preview { display: flex; gap: 1rem; align-items: center; }
.adm-color { display: flex; align-items: center; gap: .6rem; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.adm-color .input[type="color"] { width: 46px; min-height: 36px; padding: 3px; }

/* Bookstores: product picker */
.adm-pick-group + .adm-pick-group { margin-top: 1.1rem; }
.adm-pick-title { font-size: 13px; font-weight: 800; color: var(--gold-ink); margin-bottom: .45rem; }
.adm-pick { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.adm-pick-item {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); min-width: 0;
}
.adm-pick-item:hover { border-color: var(--teal-100); }
.adm-pick-item:has(input:checked) { border-color: var(--teal); background: var(--teal-50); }
.adm-pick-item input { width: 18px; height: 18px; accent-color: var(--teal); flex: none; margin: 0; }
.adm-pick-item .cover-swatch { width: 26px; height: 36px; }
.adm-pick-item .cover-swatch::after { bottom: 5px; height: 2px; inset-inline: 4px; }
.adm-pick-item.is-inactive { opacity: .6; }
.adm-pick-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.adm-pick-text .bold { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Schools */
.adm-code-row { flex-wrap: nowrap; }
.adm-code-row .input { flex: 1; }
.adm-stages { display: grid; gap: .55rem 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.adm-stage { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.adm-stage:has(input:checked) { border-color: var(--teal); background: var(--teal-50); }
.adm-secret .secret-box { justify-content: space-between; }
.adm-secret .secret-box .small { min-width: 130px; }

/* Pricing */
.adm-example { padding: .7rem .85rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #FDFBF8; }

/* Notifications */
.adm-tabs-flat { border-bottom: 0; margin: -1rem 0 -1rem; }
.adm-tabs-flat .tab { padding: 1rem .9rem; }
.adm-sent { list-style: none; margin: 0; padding: 0; }
.adm-sent li { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.adm-sent li:last-child { border-bottom: 0; }
.adm-sent-main { min-width: 0; flex: 1; }
.adm-phone {
  background: linear-gradient(180deg, var(--teal-deep), #0A4642); border-radius: 22px; padding: 1.4rem .9rem;
  box-shadow: inset 0 0 0 6px #062E2B;
}
.adm-phone-notif {
  display: flex; gap: .65rem; align-items: flex-start; background: rgba(251, 248, 243, .97);
  border-radius: 14px; padding: .75rem .85rem; box-shadow: var(--shadow);
}
.adm-phone-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.adm-phone-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .adm-stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-dash-grid, .adm-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-form-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-side { position: static; }
}
@media (max-width: 520px) {
  .adm-stats-3 { grid-template-columns: minmax(0, 1fr); }
  .adm-quick { grid-template-columns: minmax(0, 1fr); }
  .adm-code-row { flex-wrap: wrap; }
  .adm-step { min-width: 76px; }
  .adm-totals { max-width: none; }
}
