/* National Admission Council Portal — base stylesheet (no build step, CSP-safe) */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

:root {
    --brand-900: #160f4d;
    --brand-800: #1f1670;
    --brand-700: #2a1c93;
    --brand-600: #3422ab;
    --brand-500: #4a37d1;
    --brand-100: #ecebfb;
    --brand-50: #f6f5fe;
    --gold-500: #ffcd20;
    --gold-100: #fff7d6;
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --line: #e2e8f0;
    --surface: #ffffff;
    --canvas: #f5f6fb;
    --success-700: #0f7a4d;
    --success-50: #e9f8f1;
    --danger-700: #b42318;
    --danger-50: #fef1f0;
    --warning-700: #8a5a00;
    --warning-50: #fff8e6;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 10px 30px -12px rgba(22, 15, 77, .18), 0 2px 6px rgba(15, 23, 42, .05);
    --focus: 0 0 0 3px rgba(255, 205, 32, .65);
    --font: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*, *::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.55; color: var(--ink-900); background: var(--canvas); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration: none; font-weight: 500; }
a:hover { color: var(--brand-800); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: var(--focus); }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink-900); }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink-900); color: #fff; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Auth layout ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 20px 16px 28px; background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 205, 32, .18) 0%, rgba(255, 205, 32, 0) 45%),
    radial-gradient(90% 80% at 0% 100%, rgba(74, 55, 209, .65) 0%, rgba(74, 55, 209, 0) 60%),
    linear-gradient(150deg, var(--brand-900) 0%, var(--brand-700) 55%, var(--brand-600) 100%); }
.auth-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand__mark { display: inline-flex; align-items: center; gap: 12px; }
.auth-brand__badge { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.auth-brand__badge img { width: 28px; height: auto; }
.auth-brand__org { font-weight: 600; font-size: 14px; letter-spacing: .2px; line-height: 1.3; }
.auth-brand__org small { display: block; font-weight: 400; font-size: 12px; opacity: .78; }
.auth-brand__headline { margin-top: 22px; font-size: 22px; font-weight: 600; color: #fff; letter-spacing: -.2px; }
.auth-brand__headline em { font-style: normal; color: var(--gold-500); }
.auth-brand__lead { margin-top: 8px; font-size: 14px; color: rgba(255, 255, 255, .82); max-width: 34rem; }
.auth-brand__features, .auth-brand__foot { display: none; }

.auth-main { flex: 1; display: flex; flex-direction: column; padding: 28px 16px 24px; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card__logo { width: 100%; max-width: 260px; height: auto; margin-bottom: 26px; }
.auth-card__eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; color: var(--brand-600); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 4px 10px; border-radius: 999px; }
.auth-card__title { margin-top: 14px; font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
.auth-card__subtitle { margin-top: 6px; color: var(--ink-500); font-size: 14.5px; }
.auth-form { margin-top: 24px; display: grid; gap: 18px; }
.auth-footer { margin-top: auto; padding-top: 32px; text-align: center; font-size: 12.5px; color: var(--ink-500); }
.auth-footer a { font-weight: 500; }
.auth-footer__sep { margin: 0 6px; color: var(--ink-400); }

@media (min-width: 960px) {
    .auth { flex-direction: row; }
    .auth-brand { flex: 0 0 46%; max-width: 640px; padding: 44px 52px; display: flex; flex-direction: column; }
    .auth-brand__badge { width: 52px; height: 52px; border-radius: 14px; }
    .auth-brand__badge img { width: 32px; }
    .auth-brand__org { font-size: 15px; }
    .auth-brand__headline { margin-top: auto; font-size: 36px; line-height: 1.18; max-width: 30rem; }
    .auth-brand__lead { margin-top: 14px; font-size: 15.5px; }
    .auth-brand__features { display: grid; gap: 14px; margin: 34px 0 0; padding: 0; list-style: none; }
    .auth-brand__features li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: rgba(255, 255, 255, .92); }
    .auth-brand__features svg { flex: 0 0 auto; width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, .12); color: var(--gold-500); }
    .auth-brand__features strong { display: block; font-weight: 600; color: #fff; }
    .auth-brand__features span { color: rgba(255, 255, 255, .72); font-size: 13.5px; }
    .auth-brand__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 36px; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
    .auth-brand__foot svg { width: 16px; height: 16px; color: var(--gold-500); }
    .auth-main { padding: 48px 56px 28px; justify-content: center; }
    .auth-card { margin: auto; }
    .auth-footer { margin-top: 0; }
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--ink-700); }
.field__hint { font-size: 12.5px; color: var(--ink-500); }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--danger-700); font-weight: 500; }
.field__error svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.input-wrap { position: relative; }
.input { width: 100%; height: 50px; padding: 0 14px 0 44px; font: inherit; font-size: 15px; color: var(--ink-900); background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--ink-400); }
.input:hover { border-color: #cbd5e1; }
.input:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(52, 34, 171, .14); }
.input[aria-invalid="true"] { border-color: var(--danger-700); background: #fffafa; }
.input--with-action { padding-right: 52px; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-400); pointer-events: none; }
.input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-500); border-radius: var(--radius-sm); cursor: pointer; }
.input-action:hover { background: var(--brand-50); color: var(--brand-600); }
.input-action svg { width: 20px; height: 20px; }
.input-action .icon-hide { display: none; }
.input-action[aria-pressed="true"] .icon-show { display: none; }
.input-action[aria-pressed="true"] .icon-hide { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; flex: 0 0 auto; height: 50px; padding: 0 22px; font: inherit; font-size: 15px; font-weight: 600; border-radius: var(--radius); border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: background-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { color: #fff; background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); box-shadow: 0 8px 20px -8px rgba(52, 34, 171, .6); }
.btn--primary:hover { color: #fff; background: linear-gradient(180deg, var(--brand-600), var(--brand-700)); }
.btn--ghost { color: var(--ink-700); background: #fff; border-color: var(--line); }
.btn--ghost:hover { color: var(--brand-700); border-color: var(--brand-100); background: var(--brand-50); }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled], .btn.is-loading { opacity: .75; cursor: progress; }
.btn__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.alert svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.alert--success { color: var(--success-700); background: var(--success-50); border-color: #bfe8d4; }
.alert--danger { color: var(--danger-700); background: var(--danger-50); border-color: #f6cfcb; }
.alert--info { color: var(--brand-800); background: var(--brand-50); border-color: var(--brand-100); }
.alert--warning { color: var(--warning-700); background: var(--warning-50); border-color: #f5dea0; }

.password-rules { margin: 0; padding: 12px 14px; list-style: none; display: grid; gap: 4px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12.5px; color: var(--ink-500); }
.password-rules li::before { content: "•"; color: var(--brand-500); margin-right: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.back-link svg { width: 16px; height: 16px; }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.topbar__logo img { height: 34px; width: auto; }
.topbar__spacer { flex: 1; }
.topbar__user { display: none; text-align: right; line-height: 1.25; }
.topbar__user strong { display: block; font-size: 13.5px; }
.topbar__user span { font-size: 12px; color: var(--ink-500); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 600; font-size: 14px; color: #fff; background: linear-gradient(140deg, var(--brand-500), var(--brand-800)); }
.logout-form { margin: 0; }
@media (min-width: 720px) {
    .topbar__inner { padding: 12px 24px; }
    .topbar__logo img { height: 40px; }
    .topbar__user { display: block; }
}

.page { max-width: 1240px; margin: 0 auto; padding: 22px 16px 48px; }
@media (min-width: 720px) { .page { padding: 32px 24px 64px; } }
.page-alerts { margin-bottom: 20px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-header__eyebrow { font-size: 12.5px; font-weight: 600; color: var(--brand-600); text-transform: uppercase; letter-spacing: .8px; }
.page-header h1 { margin-top: 4px; font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.page-header p { margin-top: 4px; color: var(--ink-500); font-size: 14.5px; }
@media (min-width: 720px) { .page-header h1 { font-size: 28px; } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip--role { color: var(--brand-800); background: var(--brand-50); border: 1px solid var(--brand-100); }
.chip--gold { color: #6b4e00; background: var(--gold-100); border: 1px solid #f7e09a; }
.chip--success { color: var(--success-700); background: var(--success-50); }
.chip--danger { color: var(--danger-700); background: var(--danger-50); }
.chip--muted { color: var(--ink-500); background: var(--canvas); border: 1px solid var(--line); }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
    .grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid--2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__header h2 { font-size: 15.5px; font-weight: 600; }
.card__header p { font-size: 12.5px; color: var(--ink-500); }
.card__body { padding: 18px; }
.section { margin-top: 16px; }

.kpi { padding: 16px; }
.kpi__label { font-size: 12.5px; font-weight: 500; color: var(--ink-500); }
.kpi__value { margin-top: 6px; font-size: 18px; font-weight: 600; color: var(--ink-900); line-height: 1.3; overflow-wrap: anywhere; }
.kpi__meta { margin-top: 4px; font-size: 12px; color: var(--ink-400); }
@media (min-width: 720px) { .kpi { padding: 18px 20px; } .kpi__value { font-size: 20px; } }

.hero-card { position: relative; overflow: hidden; color: #fff; border: 0; padding: 22px; background: radial-gradient(80% 120% at 100% 0%, rgba(255, 205, 32, .2), rgba(255, 205, 32, 0) 55%), linear-gradient(135deg, var(--brand-800), var(--brand-600)); }
.hero-card h2 { color: #fff; font-size: 20px; font-weight: 600; }
.hero-card p { margin-top: 6px; color: rgba(255, 255, 255, .82); font-size: 14px; max-width: 46rem; }
.hero-card .chip--role { margin-top: 14px; color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); }

/* Spreadsheet-style tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
/* Spreadsheet behaviour: columns keep a readable width and the table scrolls sideways on phones. */
.table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table td.nowrap { white-space: nowrap; }
.table th { position: sticky; top: 0; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-500); background: #fafbfe; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-700); }
.table tbody tr:nth-child(even) td { background: #fcfcfe; }
.table tbody tr:hover td { background: var(--brand-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--ink-500); font-size: 12.5px; }
.table-empty { padding: 22px; text-align: center; color: var(--ink-500); font-size: 13.5px; }

.dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; margin: 0; font-size: 14px; }
.dl dt { padding: 10px 0; color: var(--ink-500); border-bottom: 1px solid var(--line); }
.dl dd { margin: 0; padding: 10px 0 10px 12px; font-weight: 500; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

.module-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.module-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.module-list li span:first-child { font-weight: 500; }

/* ---------- Error pages ---------- */
.error-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas); }
.error-card { width: 100%; max-width: 480px; text-align: center; padding: 36px 24px; }
.error-card img { width: 52px; margin: 0 auto 16px; }
.error-card__code { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; color: var(--brand-600); }
.error-card h1 { margin-top: 8px; font-size: 24px; }
.error-card p { margin-top: 10px; color: var(--ink-500); }
.error-card .btn { margin-top: 22px; }

/* ---------- Super Admin navigation (Phase 2A) ---------- */
.shell { max-width: 1240px; margin: 0 auto; }
.shell .page { max-width: none; margin: 0; min-width: 0; }
.sidenav { padding: 12px 16px 0; }
.sidenav__title { display: none; }
.sidenav ul { list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sidenav__link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-700); white-space: nowrap; }
.sidenav__link svg { width: 18px; height: 18px; color: var(--ink-400); }
.sidenav__link:hover { text-decoration: none; color: var(--brand-700); background: var(--brand-50); }
.sidenav__link.is-current { color: var(--brand-800); background: var(--brand-100); font-weight: 600; }
.sidenav__link.is-current svg { color: var(--brand-600); }
@media (min-width: 720px) { .sidenav { padding: 16px 24px 0; } }
@media (min-width: 1024px) {
    .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
    .sidenav { position: sticky; top: 65px; padding: 32px 0 0 24px; }
    .sidenav__title { display: block; padding: 0 12px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-400); }
    .sidenav ul { flex-direction: column; padding: 6px; }
    .sidenav__link { display: flex; }
}

/* ---------- User directory ---------- */
.kpi--link { display: block; color: inherit; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.kpi--link:hover { text-decoration: none; color: inherit; border-color: var(--brand-100); box-shadow: var(--shadow); }
.kpi__value--success { color: var(--success-700); }
.kpi__value--danger { color: var(--danger-700); }
.card__header--wrap { flex-wrap: wrap; }
.role-counts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.role-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--ink-700); }
.role-count strong { font-variant-numeric: tabular-nums; color: var(--ink-900); }
.role-count:hover { text-decoration: none; color: var(--brand-800); border-color: var(--brand-100); background: var(--brand-50); }
.role-count.is-current { color: var(--brand-800); border-color: var(--brand-500); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-500); }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfe; }
.filters__field { display: grid; gap: 5px; min-width: 0; }
.filters__field .field__label { font-size: 12.5px; }
.filters__field--search { grid-column: 1 / -1; }
.filters__actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-end; }
.input--compact { height: 40px; font-size: 14px; padding-left: 40px; border-radius: 10px; }
.input--compact + .input-icon, .input-wrap .input-icon { width: 17px; height: 17px; }
.select { width: 100%; height: 40px; padding: 0 32px 0 12px; font: inherit; font-size: 14px; color: var(--ink-900); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; }
.select:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(52, 34, 171, .14); }
@media (min-width: 720px) {
    .filters { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) 90px auto; align-items: end; }
    .filters__field--search, .filters__actions { grid-column: auto; }
}
.table--directory { min-width: 760px; }
.table--directory th, .table--directory td { padding-left: 12px; padding-right: 12px; vertical-align: middle; }
.table--directory .cell-name { min-width: 150px; }
.table--directory .cell-email { min-width: 170px; overflow-wrap: anywhere; }
/* Spreadsheet-style frozen first column while the table scrolls sideways on small screens. */
.table--directory th:first-child, .table--directory td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line); }
.table--directory th:first-child { z-index: 2; background: #fafbfe; }
.table--directory tbody tr:nth-child(even) td:first-child { background: #fcfcfe; }
.table--directory tbody tr:hover td:first-child { background: var(--brand-50); }
.cell-strong { font-weight: 600; color: var(--ink-900); }
.sort-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-weight: 600; }
.sort-link:hover { text-decoration: none; color: var(--brand-700); }
.sort-link.is-sorted { color: var(--brand-700); }
.sort-link__arrow { font-size: 10px; color: var(--ink-400); }
.sort-link.is-sorted .sort-link__arrow { color: var(--brand-600); }
.table-empty p + p { margin-top: 6px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.pager__pages { display: none; list-style: none; margin: 0; padding: 0; gap: 4px; }
.pager__page { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 9px; font-size: 13.5px; color: var(--ink-700); border: 1px solid var(--line); background: #fff; }
.pager__page:hover { text-decoration: none; background: var(--brand-50); color: var(--brand-700); }
.pager__page.is-current { color: #fff; background: var(--brand-600); border-color: var(--brand-600); font-weight: 600; }
.pager__summary { font-size: 13px; color: var(--ink-500); }
.btn.is-disabled { opacity: .5; cursor: default; pointer-events: none; }
@media (min-width: 720px) { .pager__pages { display: flex; } .pager__summary { display: none; } }

/* ---------- Add user form ---------- */
.user-form { display: grid; gap: 0; max-width: 960px; }
.user-form > .alert { margin-bottom: 16px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.role-picker { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.role-picker legend { padding: 0; margin-bottom: 10px; }
.role-picker__grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .role-picker__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .role-picker__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.role-option { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; font-weight: 400; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.role-option:hover { border-color: var(--brand-100); background: var(--brand-50); }
.role-option input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-600); }
.role-option input:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 50%; }
.role-option:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-500); }
.role-option--elevated:has(input:checked) { border-color: #d9a800; background: var(--gold-100); box-shadow: inset 0 0 0 1px #d9a800; }
.role-option__body { display: grid; gap: 3px; min-width: 0; }
.role-option__name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.role-option__name .chip { padding: 2px 8px; font-size: 11px; }
.role-option__desc { font-size: 12.5px; line-height: 1.45; color: var(--ink-500); }
.role-picker[aria-invalid="true"] .role-option { border-color: #f1b8b2; }
.toggle-field { display: grid; gap: 6px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-900); width: fit-content; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__track { position: relative; flex: 0 0 auto; width: 44px; height: 26px; border-radius: 999px; background: #cbd5e1; transition: background-color .15s; }
.toggle__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .15s; }
.toggle input:checked + .toggle__track { background: var(--success-700); }
.toggle input:checked + .toggle__track .toggle__thumb { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { box-shadow: var(--focus); }
.form-notes { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 720px) { .form-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; padding: 14px 0; background: linear-gradient(180deg, rgba(245, 246, 251, 0), var(--canvas) 30%); }
.form-actions .btn { flex: 1 1 auto; }
@media (min-width: 720px) { .form-actions { position: static; background: none; } .form-actions .btn { flex: 0 0 auto; } }

/* ---------- User detail, edit, status, role, roles matrix, audit log (Phase 2A F3-F6) ---------- */
.breadcrumbs { margin-bottom: 10px; font-size: 13px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--ink-500); }
.breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--ink-400); }
.breadcrumbs a { font-weight: 500; }
.breadcrumbs [aria-current="page"] { color: var(--ink-700); font-weight: 600; overflow-wrap: anywhere; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip svg { width: 14px; height: 14px; }
.sidenav__link svg { flex: 0 0 auto; }
@media (min-width: 1024px) { .sidenav__link { white-space: normal; line-height: 1.3; } }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--danger { color: #fff; background: var(--danger-700); box-shadow: 0 8px 20px -8px rgba(180, 35, 24, .55); }
.btn--danger:hover { color: #fff; background: #93190f; }
.btn--success { color: #fff; background: var(--success-700); box-shadow: 0 8px 20px -8px rgba(15, 122, 77, .55); }
.btn--success:hover { color: #fff; background: #0b5e3b; }
.btn--danger-ghost { color: var(--danger-700); background: #fff; border-color: #f6cfcb; }
.btn--danger-ghost:hover { color: var(--danger-700); background: var(--danger-50); }
.btn--success-ghost { color: var(--success-700); background: #fff; border-color: #bfe8d4; }
.btn--success-ghost:hover { color: var(--success-700); background: var(--success-50); }
.section-gap { margin-top: 16px; }
.section-gap + .grid, .alert.section-gap { margin-bottom: 16px; }
.page-header + .alert.section-gap { margin-top: 0; }
.section-gap-sm { margin-top: 10px; }
.muted-text { color: var(--ink-500); font-size: 13.5px; }
.muted-link { font-size: 12.5px; }
.dl .muted, .dd-small { font-size: 12.5px; color: var(--ink-500); font-weight: 400; }
.role-summary__name { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.cell-link { color: var(--ink-900); }
.cell-link:hover { color: var(--brand-700); }
.confirm-card { max-width: 720px; }
.confirm-list { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-700); }
.form-actions--inline { position: static; background: none; padding-bottom: 0; }
.check-field { display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; color: var(--ink-900); cursor: pointer; }
.check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-600); }
.check input[aria-invalid="true"] { outline: 2px solid var(--danger-700); outline-offset: 2px; }
.super-admin-confirm[hidden] { display: none; }
.table--matrix { min-width: 980px; }
.table--matrix th[scope="row"] { position: sticky; left: 0; z-index: 1; min-width: 220px; text-align: left; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink-700); background: #fff; padding: 10px 14px; border-bottom: 1px solid var(--line); box-shadow: 1px 0 0 var(--line); }
.table--matrix thead th:first-child { position: sticky; left: 0; z-index: 3; box-shadow: 1px 0 0 var(--line); }
.matrix__role { text-align: center !important; vertical-align: bottom; white-space: normal !important; min-width: 92px; line-height: 1.3; }
.matrix__role span { display: block; }
.matrix__count { display: block; margin-top: 4px; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.matrix__group th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--brand-700); background: var(--brand-50) !important; padding: 7px 14px; border-bottom: 1px solid var(--line); position: static; }
.matrix__slug { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-500); }
.matrix__cell { position: relative; text-align: center; vertical-align: middle !important; }
.matrix__yes { margin: 0 auto; color: var(--success-700); }
.matrix__no { color: var(--ink-400); }
.input--plain { padding-left: 12px; }
.filters--audit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters--audit .filters__field:first-child, .filters--audit .filters__field:nth-child(2) { grid-column: 1 / -1; }
@media (min-width: 720px) {
    .filters--audit { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters--audit .filters__field:first-child, .filters--audit .filters__field:nth-child(2) { grid-column: auto; }
    .filters--audit .filters__actions { grid-column: auto; }
}
.table--audit { min-width: 860px; }
.table--audit td { vertical-align: middle; }
.pager__summary--always { display: inline !important; }

/* Phase 2A F6: role permission editing */
.chip--xs { margin-top: 6px; padding: 2px 8px; font-size: 11px; gap: 4px; }
.matrix__edit { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.perm-list { list-style: none; margin: 0; padding: 0; }
.perm-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--line); transition: background-color .15s ease; }
.perm-row:first-child { border-top: 0; }
.perm-row.is-changed { background: var(--gold-100); box-shadow: inset 3px 0 0 #d4a106; }
.perm-row[data-locked] .perm-row__main { cursor: not-allowed; color: var(--ink-500); }
.perm-row__main { display: flex; flex: 1 1 260px; min-width: 0; gap: 12px; align-items: flex-start; cursor: pointer; }
.perm-row__main input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-600); }
.perm-row__text { min-width: 0; overflow-wrap: anywhere; }
.perm-row__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-review__title { margin: 4px 0 8px; font-size: 14px; }
.perm-review__title--added { color: var(--success-700); }
.perm-review__title--removed { color: var(--danger-700); margin-top: 16px; }
.matrix__slug-inline { font-size: 12px; color: var(--ink-500); }
@media (max-width: 599px) { .perm-row { padding: 12px 16px; } .perm-row__meta { padding-left: 30px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Specification §2: Universities & Courses (catalogue) */
.field--full { grid-column: 1 / -1; }
.textarea { width: 100%; min-height: 96px; padding: 12px 14px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink-900); background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); resize: vertical; }
.textarea:hover { border-color: #cbd5e1; }
.textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(52, 34, 171, .14); }
.textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger-700); background: #fffafa; }
.select--field { height: 50px; font-size: 15px; border-radius: var(--radius); }
.list-lines { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.pre-line { white-space: pre-line; }
.inline-form { display: inline; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fee-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.fee-summary strong { font-size: 20px; color: var(--ink-900); }
/* Mobile-first stacked tables: each row becomes a card below 720px, the labels come from data-label. */
@media (max-width: 719px) {
    .table--stack { min-width: 0; }
    .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    .table--stack tbody tr:nth-child(even) td, .table--stack tbody tr:hover td { background: transparent; }
    .table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
    .table--stack td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; }
    .table--stack td.cell-primary { display: block; padding-bottom: 6px; text-align: left; font-size: 15px; }
    .table--stack td.cell-primary::before { content: none; }
    .table--stack td.num { text-align: right; }
    .table--stack .row-actions { justify-content: flex-end; }
}
.toggle-field--flush { margin-top: 0; padding-top: 0; border-top: 0; }
/* Specification §3: Hierarchy */
.subnav { margin: -6px 0 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.subnav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0 0 2px; }
.subnav__link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-700); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.subnav__link:hover { text-decoration: none; border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.subnav__link.is-current { color: #fff; background: var(--brand-600); border-color: var(--brand-600); }
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tree__node { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
.tree__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tree__children { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--brand-100); display: grid; gap: 6px; }
.tree__children li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.allocation { display: grid; gap: 4px; min-width: 160px; }
.progress { width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--canvas); overflow: hidden; appearance: none; }
.progress::-webkit-progress-bar { background: #eef0f6; border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--brand-600); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--brand-600); border-radius: 999px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); margin-left: 6px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-600); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline__meta { display: block; color: var(--ink-500); font-size: 12.5px; margin-top: 2px; }
.decision-form { display: grid; gap: 10px; }
.decision-form .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notice-config { border-style: dashed; }
/* Specification §4: Leads & Counselling */
.stepper { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper__step { flex: 1 1 110px; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink-500); counter-increment: step; }
.stepper__step::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--canvas); font-size: 12px; }
.stepper__step.is-done { color: var(--success-700); border-color: #bfe8d4; background: var(--success-50); }
.stepper__step.is-current { color: #fff; border-color: var(--brand-600); background: var(--brand-600); }
.stepper__step.is-current::before { background: rgba(255, 255, 255, .25); }
.inline-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 720px) { .inline-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; } }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.board__column { display: flex; flex-direction: column; min-width: 0; }
.board__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.board__head h2 { font-size: 14.5px; font-weight: 600; }
.board__list { list-style: none; margin: 0; padding: 10px; display: grid; gap: 8px; }
.board__card { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.board__empty { padding: 6px 4px; }
.board__more { display: block; padding: 10px 14px 14px; font-size: 13px; font-weight: 600; }
.session-list { list-style: none; margin: 0; padding: 0 18px 18px; display: grid; gap: 10px; }
.session { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.check input { width: 18px; height: 18px; }
/* Specification §5: Admissions */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.checklist li { position: relative; padding-left: 26px; color: var(--ink-700); }
.checklist li::before { content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.checklist li.is-done { color: var(--success-700); }
.checklist li.is-done::before { border-color: var(--success-700); background: var(--success-700); box-shadow: inset 0 0 0 3px #fff; }
details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.kit { max-width: 820px; }
.kit__head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.kit__head h2 { font-size: 18px; font-weight: 700; }
.kit__logo { width: 180px; height: auto; }
.kit__subhead { margin: 20px 0 10px; font-size: 14.5px; font-weight: 600; }
@media print {
    .topbar, .sidenav, .no-print, .skip-link, .page-alerts { display: none !important; }
    body, .page { background: #fff !important; padding: 0 !important; }
    .shell { display: block !important; }
    .kit { border: 0; box-shadow: none; max-width: none; }
}
/* Specification §6: Finance */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-reversed td { color: var(--ink-400); }
.table tr.is-reversed .money { text-decoration: line-through; }
.estimate-banner { display: grid; gap: 4px; margin-top: 12px; padding: 14px 16px; border: 2px dashed var(--warning-700); border-radius: var(--radius); background: var(--warning-50); color: var(--warning-700); font-size: 14px; }
.estimate-banner strong { font-size: 15px; letter-spacing: .5px; }
.reverse-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reverse-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
