/* =========================================================
 *  Banoda University — design system
 *  Every colour, font and size comes from these tokens. Settings → Theme, Typography and Layout
 *  re-emit them (includes/functions.php → theme_head()), so pages never hard-code brand colours.
 * ========================================================= */
:root {
  /* Brand (from the university logo) */
  --primary: #0b4db3;
  --secondary: #0a2a66;
  --accent: #17b26a;
  --sidebar-bg: #0a2357;
  --sidebar-text: #c9d6ec;
  --heading: #0a2357;
  /* Neutrals */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --topbar-bg: #ffffff;
  --text: #1b2536;
  --border: #e3e8f0;
  /* Typography */
  --font: 'Inter';
  --heading-font: 'Inter';
  --sidebar-font: var(--font);
  --table-font: var(--font);
  --form-font: var(--font);
  --button-font: var(--font);
  --arabic-font: 'Noto Kufi Arabic';
  --base-size: 16px;
  --title-size: 20px;
  --nav-size: 14px;
  --table-size: 14px;
  --body-weight: 400;
  --heading-weight: 700;
  --line-height: 1.5;
  --letter-spacing: 0em;
  --heading-scale: 1;
  /* Shape, spacing, depth */
  --radius: 12px;
  --radius-sm: calc(var(--radius) * .66);
  --radius-pill: 999px;
  --sidebar-w: 264px;
  --sidebar-rail: 76px;
  --topbar-h: 64px;
  --card-gap: 24px;
  --space: 1;
  --cell-y: .62rem;
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  --shadow-pop: 0 12px 32px rgba(15, 35, 80, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .2s;
  /* Derived */
  --primary-hover: color-mix(in srgb, var(--primary) 84%, black);
  --primary-dark: var(--primary-hover);
  --primary-light: color-mix(in srgb, var(--primary) 70%, white);
  --primary-soft: color-mix(in srgb, var(--primary) 10%, var(--surface));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --focus-ring: 0 0 0 .22rem color-mix(in srgb, var(--primary) 28%, transparent);
  --navy: var(--sidebar-bg);
  --navy-2: color-mix(in srgb, var(--sidebar-bg) 82%, white);
  --gold: var(--accent);
  --text-muted: color-mix(in srgb, var(--text) 66%, var(--bg));
  --surface-2: color-mix(in srgb, var(--bg) 55%, var(--surface));
  --surface-3: color-mix(in srgb, var(--bg) 85%, var(--border));
  --hover: color-mix(in srgb, var(--primary) 4%, var(--surface));
  --shadow: rgba(16, 24, 40, .04);
  --popup-shadow: rgba(15, 35, 80, .16);
  --link: var(--primary);
  --success: #12804c; --warning: #b26a00; --danger: #c62f2f; --info: #0b7285;
  /* Bootstrap bridge */
  --bs-primary: var(--primary);
  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-hover);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
  --bs-heading-color: var(--heading);
  --bs-body-font-family: var(--font), system-ui, sans-serif;
  --bs-border-color: var(--border);
  --bs-focus-ring-color: color-mix(in srgb, var(--primary) 28%, transparent);
}
html { font-size: var(--base-size); }
body { font-family: var(--font), system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: var(--body-weight); line-height: var(--line-height); letter-spacing: var(--letter-spacing);
  background: var(--bg); color: var(--text); font-size: .925rem; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, h6, .page-title, .brand-name, .stat-value, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--heading-font), var(--font), system-ui, sans-serif; font-weight: var(--heading-weight); letter-spacing: -.01em; color: var(--heading); }
h1, .h1 { font-size: calc(2rem * var(--heading-scale)); } h2, .h2 { font-size: calc(1.65rem * var(--heading-scale)); } h3, .h3 { font-size: calc(1.4rem * var(--heading-scale)); }
h4, .h4 { font-size: calc(1.2rem * var(--heading-scale)); } h5, .h5 { font-size: calc(1.06rem * var(--heading-scale)); } h6, .h6 { font-size: calc(.95rem * var(--heading-scale)); }
:lang(ar), [dir="rtl"], .arabic { font-family: var(--arabic-font), var(--font), sans-serif; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 70%, transparent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* ---------- Buttons ---------- */
.btn { font-family: var(--button-font), var(--font), sans-serif; font-weight: 500; border-radius: var(--radius-sm); transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform .08s ease; }
.btn:not(.btn-sm):not(.btn-lg):not(.btn-link) { min-height: 2.4rem; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: color-mix(in srgb, var(--primary) 55%, var(--surface)); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-hover); --bs-btn-hover-color: #fff; }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-border-color: var(--border); }
.btn.is-loading { pointer-events: none; opacity: .85; position: relative; }
.btn.is-loading::after { content: ''; width: 1em; height: 1em; margin-left: .5em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -.15em; animation: ums-spin .7s linear infinite; }
@keyframes ums-spin { to { transform: rotate(360deg); } }
.text-bg-primary { background-color: var(--primary) !important; color: #fff !important; }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--primary); --bs-nav-link-color: var(--text-muted); --bs-nav-link-hover-color: var(--primary); }
.list-group { --bs-list-group-active-bg: var(--primary); --bs-list-group-active-border-color: var(--primary); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: var(--focus-ring); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.page-link { color: var(--primary); } .active > .page-link, .page-link.active { background-color: var(--primary); border-color: var(--primary); color: #fff; }
.progress { border-radius: var(--radius-pill); }
.progress-bar { background-color: var(--primary); }
.btn-gold, .btn-accent { background: var(--accent); border-color: var(--accent); color: color-mix(in srgb, var(--accent) 18%, black); font-weight: 600; }
.btn-gold:hover, .btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, black); border-color: color-mix(in srgb, var(--accent) 86%, black); color: #fff; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text); position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .25s var(--ease); font-family: var(--sidebar-font), var(--font), sans-serif;
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent 260px); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; } .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); min-height: var(--topbar-h); }
.brand img { border-radius: 10px; background: rgba(255,255,255,.06); padding: 2px; }
.brand-name { font-weight: 700; font-size: 1rem; line-height: 1.2; color: #fff; }
.brand-sub { font-size: .68rem; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.sidebar-nav { padding: 12px 12px 30px; }
.nav-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--sidebar-text) 65%, var(--sidebar-bg)); padding: 16px 12px 6px; font-weight: 600; }
.sidebar .nav-link { position: relative; display: flex; align-items: center; gap: 11px; color: var(--sidebar-text); padding: 8px 12px; border-radius: var(--radius-sm); font-size: var(--nav-size); margin-bottom: 2px; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active { background: color-mix(in srgb, var(--primary) 55%, transparent); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .nav-link.active i { color: #fff; opacity: 1; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; background: var(--topbar-bg); border-bottom: 1px solid var(--border); padding: 10px calc(24px * var(--space)); min-height: var(--topbar-h); position: sticky; top: 0; z-index: 1020; }
[data-sticky="off"] .topbar, [data-sticky="off"] .context-bar { position: static; }
[data-header="glass"] .topbar { background: color-mix(in srgb, var(--topbar-bg) 78%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
[data-header="brand"]:not([data-bs-theme="dark"]) .topbar { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--secondary))); border-bottom-color: transparent; color: #fff; }
[data-header="brand"]:not([data-bs-theme="dark"]) .topbar .page-title, [data-header="brand"]:not([data-bs-theme="dark"]) .topbar .crumbs, [data-header="brand"]:not([data-bs-theme="dark"]) .topbar .crumbs a,
[data-header="brand"]:not([data-bs-theme="dark"]) .topbar .user-chip, [data-header="brand"]:not([data-bs-theme="dark"]) .topbar .user-chip .text-muted { color: #fff !important; }
[data-header="brand"]:not([data-bs-theme="dark"]) .topbar .btn-light { --bs-btn-bg: rgba(255,255,255,.14); --bs-btn-border-color: rgba(255,255,255,.22); --bs-btn-color: #fff; --bs-btn-hover-bg: rgba(255,255,255,.24); --bs-btn-hover-color: #fff; --bs-btn-active-bg: rgba(255,255,255,.3); --bs-btn-active-color: #fff; }
[data-header="brand"]:not([data-bs-theme="dark"]) .topbar .btn-light .text-primary, [data-header="brand"]:not([data-bs-theme="dark"]) .topbar .btn-light .text-warning { color: #fff !important; }
.topbar-title { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.page-title { font-size: var(--title-size); font-weight: var(--heading-weight); margin: 0; color: var(--heading); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; font-size: .76rem; color: var(--text-muted); margin: 0 0 2px; padding: 0; list-style: none; white-space: nowrap; overflow: hidden; }
.crumbs li { overflow: hidden; text-overflow: ellipsis; }
.crumbs li + li::before { content: '\203A'; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--text-muted); text-decoration: none; } .crumbs a:hover { color: var(--primary); }
.user-chip { color: var(--text); }
.content { padding: calc(24px * var(--space)) calc(28px * var(--space)); flex: 1; }
.content > .row, .content .row.g-4 { --bs-gutter-y: var(--card-gap); }
.content .row.g-4 { --bs-gutter-x: var(--card-gap); }
.app-footer { padding: 14px calc(28px * var(--space)); font-size: .8rem; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--surface); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(8, 15, 35, .45); backdrop-filter: blur(2px); z-index: 1030; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .topbar { padding: 8px 14px; gap: 8px; }
  .page-title { font-size: calc(var(--title-size) * .85); }
}
@media (max-width: 575.98px) { .crumbs { display: none; } .content { padding: 12px; } }

/* ---------- Collapsible sidebar (desktop) ---------- */
.sidebar, .main { transition: width .22s var(--ease), margin-left .22s var(--ease), transform .25s var(--ease); }
@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar { width: var(--sidebar-rail); overflow-x: hidden; }
  body.sidebar-collapsed .main { margin-left: var(--sidebar-rail); }
  body.sidebar-collapsed .brand { justify-content: center; padding: 14px 8px; }
  body.sidebar-collapsed .brand > div,
  body.sidebar-collapsed .sidebar .nav-link span { display: none; }
  body.sidebar-collapsed .nav-heading { font-size: 0; padding: 10px 0 4px; margin: 0 14px; border-top: 1px solid rgba(255,255,255,.08); }
  body.sidebar-collapsed .sidebar-nav { padding: 10px 10px 30px; }
  body.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: 10px 0; }
  body.sidebar-collapsed .sidebar .nav-link i { font-size: 1.2rem; width: auto; }
  body.sidebar-collapsed .sidebar .nav-link.active { box-shadow: none; }
}
/* Tooltip for the icon rail */
.rail-tip { position: fixed; z-index: 1080; background: #0f172a; color: #fff; font-size: .78rem; padding: 5px 10px; border-radius: 6px; pointer-events: none; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.25); transform: translateY(-50%); }

/* ---------- Components ---------- */
.card { --bs-card-bg: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); color: var(--text); }
a > .card, a .stat-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
a:hover > .card, a:hover .stat-card { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); box-shadow: 0 8px 22px rgba(15, 35, 80, .08); }
.card-header { background: var(--surface); color: var(--heading); border-bottom: 1px solid var(--border); font-weight: 600; padding: calc(14px * var(--space)) calc(18px * var(--space)); border-radius: var(--radius) var(--radius) 0 0 !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--heading-font), var(--font), sans-serif; }
.card-header > .bi:first-child, .card-header > i:first-child { color: var(--primary); width: 1.75rem; height: 1.75rem; border-radius: 8px; background: var(--primary-soft); display: inline-grid; place-items: center; font-size: .95rem; }
.card-header .card-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-header .card-actions .form-control, .card-header .card-actions .form-select { width: auto; max-width: 220px; }
.card-body { padding: calc(18px * var(--space)) calc(20px * var(--space)); }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border); }
.stat-card { display: flex; align-items: center; gap: 14px; padding: calc(18px * var(--space)) calc(20px * var(--space)); position: relative; overflow: hidden; }
.stat-icon { width: 48px; height: 48px; border-radius: calc(var(--radius) * .9); display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: var(--heading-weight); line-height: 1.1; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.bg-soft-primary { background: var(--primary-soft); color: var(--primary); } .bg-soft-success { background: #e3f5ec; color: #12804c; }
.bg-soft-warning { background: #fdf3dc; color: #a35f00; } .bg-soft-danger { background: #fde8e8; color: #c0392b; }
.bg-soft-info { background: #e2f4f8; color: #0b7285; } .bg-soft-purple { background: #efe8fb; color: #6f42c1; }
.bg-soft-accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, black); }
/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: var(--hover); --bs-table-hover-color: var(--text); --bs-table-border-color: var(--border); --bs-table-striped-bg: var(--surface-2); margin-bottom: 0; font-family: var(--table-font), var(--font), sans-serif; font-size: var(--table-size); font-variant-numeric: tabular-nums; }
.table > :not(caption) > * > * { padding-top: var(--cell-y); padding-bottom: var(--cell-y); }
.table.table-sm > :not(caption) > * > * { padding-top: calc(var(--cell-y) * .55); padding-bottom: calc(var(--cell-y) * .55); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; background: var(--surface-2); border-bottom-width: 1px; white-space: nowrap; }
.table > tbody > tr:last-child > * { border-bottom-color: transparent; }
.table td { vertical-align: middle; }
.table .num, .table td.text-end { font-variant-numeric: tabular-nums; }
.card > .table-responsive:last-child > .table, .card > .table:last-child { border-radius: 0 0 var(--radius) var(--radius); }
/* Forms */
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .32rem; color: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.form-control, .form-select, .input-group-text, .ss-toggle { border-radius: var(--radius-sm); font-size: .9rem; font-family: var(--form-font), var(--font), sans-serif; border-color: color-mix(in srgb, var(--border) 80%, var(--text)); }
.form-control:not(textarea):not(.form-control-sm):not(.form-control-lg):not(.form-control-color), .form-select:not(.form-select-sm):not(.form-select-lg) { min-height: 2.4rem; }
.form-control:focus, .form-select:focus, .ss-toggle:focus { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); box-shadow: var(--focus-ring); }
.form-control::placeholder { color: color-mix(in srgb, var(--text-muted) 80%, transparent); }
.input-group-text { background: var(--surface-2); color: var(--text-muted); }
.form-text { color: var(--text-muted); font-size: .78rem; }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--danger); }
.form-switch .form-check-input { width: 2.2em; }
/* Tabs */
.nav-tabs { --bs-nav-tabs-border-color: var(--border); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 500; padding: .6rem 1rem; border-radius: 0; margin-bottom: -1px; }
.nav-tabs .nav-link:hover { color: var(--primary); border-bottom-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.nav-tabs .nav-link.active { color: var(--primary); background: transparent; border-bottom-color: var(--primary); font-weight: 600; }
.nav-pills .nav-link { border-radius: var(--radius-pill); font-weight: 500; padding: .45rem 1rem; }
.nav-pills .nav-link:not(.active):hover { background: var(--primary-soft); }
/* Badges, alerts, dropdowns, modals */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: var(--radius-pill); padding: .38em .7em; }
.alert { border-radius: var(--radius); border-width: 1px; border-left-width: 4px; box-shadow: var(--shadow-card); }
.alert > .bi:first-child { font-size: 1.1rem; }
.alert-light { border-left-color: var(--primary); background: var(--surface); }
.dropdown-menu { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop) !important; padding: 6px; --bs-dropdown-link-active-bg: var(--primary); }
.dropdown-item { border-radius: calc(var(--radius-sm) * .8); padding: .45rem .75rem; }
.modal-content { border-radius: calc(var(--radius) * 1.15); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(8, 20, 50, .25); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-backdrop.show { opacity: .45; }
.confirm-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.pagination { --bs-pagination-border-radius: var(--radius-sm); gap: 4px; }
.page-link { border-radius: var(--radius-sm) !important; border-color: var(--border); min-width: 2.1rem; text-align: center; }
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex-shrink: 0; }
.avatar-initials { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: inline-grid; place-items: center; font-weight: 600; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-muted); }
.empty-state i { font-size: 1.6rem; width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); opacity: 1; }
.empty-state p { margin: 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: ums-shimmer 1.2s infinite; border-radius: 6px; min-height: 1em; }
@keyframes ums-shimmer { to { background-position: -200% 0; } }
.dataTables_wrapper .row { margin: 0; } .dataTables_wrapper .dataTables_filter input { border-radius: var(--radius-pill); padding-left: .9rem; min-width: 220px; }
div.dataTables_wrapper div.dataTables_info, div.dataTables_wrapper div.dataTables_paginate { padding: 12px 10px 8px; }
div.dataTables_wrapper div.dataTables_length, div.dataTables_wrapper div.dataTables_filter { padding: 10px 10px 10px; }
div.dataTables_wrapper div.dataTables_info { color: var(--text-muted); font-size: .82rem; }
.announcement { border-left: 3px solid var(--accent); padding: 10px 14px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-radius: 0 8px 8px 0; margin-bottom: 10px; }
.announcement h6 { margin-bottom: 4px; font-weight: 600; }
.profile-header { background: linear-gradient(120deg, var(--secondary), var(--primary)); color: #fff; border-radius: var(--radius); padding: 22px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; }
.dl-grid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: .9rem; }
.dl-grid dt { color: var(--text-muted); font-weight: 500; } .dl-grid dd { margin: 0; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; gap: 0 0; } .dl-grid dd { margin-bottom: 8px; } }
.score-input { width: 90px; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 1090; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast-stack .alert { margin: 0; box-shadow: var(--shadow-pop); animation: ums-toast-in .3s var(--ease); }
@keyframes ums-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Dashboard ---------- */
.welcome-banner { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.15); padding: calc(24px * var(--space)) calc(28px * var(--space)); color: #fff; margin-bottom: var(--card-gap);
  background: radial-gradient(1200px 300px at 100% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%), linear-gradient(120deg, var(--secondary), var(--primary)); box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 25%, transparent); }
.welcome-banner::before, .welcome-banner::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); pointer-events: none; }
.welcome-banner::before { width: 340px; height: 340px; right: -90px; top: -160px; }
.welcome-banner::after { width: 220px; height: 220px; right: 120px; bottom: -150px; background: rgba(255,255,255,.04); }
.welcome-banner h2 { color: #fff; font-size: calc(1.45rem * var(--heading-scale)); margin: 0 0 4px; }
.welcome-banner .wb-sub { opacity: .85; font-size: .9rem; }
.welcome-banner .wb-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.welcome-banner .wb-chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-pill); padding: 4px 12px; font-size: .78rem; display: inline-flex; align-items: center; gap: 6px; }
.welcome-banner > * { position: relative; z-index: 1; }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shortcut { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; font-size: .86rem; transition: all var(--dur) var(--ease); }
.shortcut i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.1rem; }
.shortcut:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 35, 80, .07); }
.section-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin: 0 0 10px; }

/* ---------- Timetable ---------- */
.timetable { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tt-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tt-day-name { background: var(--surface-3); padding: 8px 12px; font-weight: 600; color: var(--heading); }
.tt-today .tt-day-name { background: var(--navy); color: #fff; }
.tt-slot { padding: 10px 12px; border-top: 1px solid var(--border); }
.tt-time { font-size: .78rem; color: var(--primary); font-weight: 600; }
.tt-course { font-size: .88rem; } .tt-meta { font-size: .78rem; color: var(--text-muted); }

/* ---------- Sign-in & authentication pages ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); background: var(--surface); }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; isolation: isolate;
  background: radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%),
              radial-gradient(700px 420px at -10% -10%, color-mix(in srgb, var(--primary) 70%, transparent), transparent 60%),
              linear-gradient(155deg, var(--secondary) 0%, color-mix(in srgb, var(--secondary) 55%, var(--primary)) 55%, var(--primary) 100%); }
.auth-side::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 75%); mask-image: linear-gradient(160deg, #000 10%, transparent 75%); }
.auth-shape { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.auth-shape.s1 { width: 520px; height: 520px; right: -200px; top: -180px; border: 1px solid rgba(255,255,255,.12); }
.auth-shape.s2 { width: 340px; height: 340px; right: -60px; top: -60px; border: 1px solid rgba(255,255,255,.09); }
.auth-shape.s3 { width: 180px; height: 180px; left: -50px; bottom: 90px; background: color-mix(in srgb, var(--accent) 30%, transparent); filter: blur(30px); }
.auth-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.auth-brand img { width: 56px; height: 56px; object-fit: contain; border-radius: 14px; background: rgba(255,255,255,.95); padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.auth-brand .ab-name { font-family: var(--heading-font), var(--font), sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.2; letter-spacing: -.01em; }
.auth-brand .ab-motto { font-size: .78rem; opacity: .75; letter-spacing: .03em; }
.auth-hero { max-width: 520px; }
.auth-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: color-mix(in srgb, var(--accent) 40%, white); margin-bottom: 14px; }
.auth-kicker::before { content: ''; width: 28px; height: 2px; background: var(--accent); border-radius: 2px; }
.auth-hero h1, .auth-hero h2 { color: #fff; font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 14px; font-weight: 800; }
.auth-hero p { font-size: 1rem; opacity: .82; margin: 0; max-width: 46ch; line-height: 1.6; }
.auth-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; padding: 0; list-style: none; }
.auth-features li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--radius-pill); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-size: .8rem; backdrop-filter: blur(4px); }
.auth-features i { color: color-mix(in srgb, var(--accent) 50%, white); }
.auth-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .78rem; opacity: .7; }
.auth-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-form { display: grid; place-items: center; padding: clamp(24px, 4vw, 56px) clamp(18px, 4vw, 48px); background: var(--surface); color: var(--text); position: relative; }
.auth-card { width: 100%; max-width: 420px; }
.auth-mobile-brand { display: none; }
.auth-card h1 { font-size: calc(1.75rem * var(--heading-scale)); margin: 0 0 6px; letter-spacing: -.02em; }
.auth-lead { color: var(--text-muted); margin: 0 0 26px; }
.auth-card .form-label { font-weight: 600; color: var(--text); }
.auth-field { position: relative; }
.auth-field > .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 1rem; z-index: 3; }
.auth-field .form-control { height: 3rem; padding-left: 2.6rem; border-radius: calc(var(--radius) * .8); background: var(--surface-2); font-size: .95rem; transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur); }
.auth-field .form-control:focus { background: var(--surface); }
.auth-field .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-muted); width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; z-index: 3; }
.auth-field .pw-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.auth-field .pw-toggle:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.auth-field.has-toggle .form-control { padding-right: 3rem; }
.auth-submit { height: 3rem; font-weight: 600; font-size: 1rem; border-radius: calc(var(--radius) * .8); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.auth-submit .spinner-border { display: none; width: 1.1rem; height: 1.1rem; border-width: .15em; }
.auth-submit.is-busy .spinner-border { display: inline-block; }
.auth-submit.is-busy .bi { display: none; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .86rem; margin-top: 22px; }
.auth-links a { text-decoration: none; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .75rem; margin: 26px 0 0; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-roles { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--text-muted); margin-top: 12px; }
.auth-roles span { display: inline-flex; align-items: center; gap: 5px; }
.auth-roles i { color: var(--primary); }
.auth-copy { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: .75rem; color: var(--text-muted); }
.auth-error { display: flex; gap: 10px; align-items: flex-start; border-radius: calc(var(--radius) * .8); }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); } .auth-features { display: none; } }
@media (max-width: 767.98px) {
  .auth-wrap { grid-template-columns: 1fr; background: var(--bg); }
  .auth-side { display: none; }
  .auth-form { align-items: start; padding: 28px 16px 64px; background: transparent; }
  .auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.2); padding: 24px 20px; box-shadow: var(--shadow-card); }
  .auth-mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; text-decoration: none; color: var(--heading); }
  .auth-mobile-brand img { width: 44px; height: 44px; object-fit: contain; }
  .auth-mobile-brand strong { font-family: var(--heading-font), var(--font), sans-serif; font-size: 1.02rem; line-height: 1.2; display: block; }
  .auth-mobile-brand small { color: var(--text-muted); font-size: .75rem; }
  .auth-card h1 { font-size: 1.45rem; }
}
.hero { background: radial-gradient(900px 400px at 100% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%), linear-gradient(150deg, var(--secondary) 0%, var(--primary) 100%); color: #fff; padding: 80px 0 90px; }
.hero h1 { font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); color: #fff; letter-spacing: -.02em; }
.landing-nav { background: var(--secondary); }

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .app-footer, .no-print, .toast-stack, .welcome-banner, .dataTables_filter, .dataTables_length, .dataTables_paginate, .dataTables_info, .btn { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; }
  .card { border: none; box-shadow: none; } body { background: #fff; font-size: 12px; }
  .print-only { display: block; }
}

/* ---------- Context bar, search & alarms ---------- */
.context-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 24px 10px; position: sticky; top: 57px; z-index: 1010; }
.context-field { display: flex; flex-direction: column; min-width: 150px; flex: 1 1 170px; max-width: 260px; }
.context-field label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.context-field label i { color: var(--gold); }
.context-semester { max-width: 220px; padding-bottom: 6px; }
.context-reset { padding-bottom: 6px; }
.topbar-search { width: 300px; }
.alarm-menu { width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; }
.alarm-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0; }
@media (max-width: 991.98px) { .context-bar { padding: 8px 16px; top: 53px; } .context-field { max-width: none; flex-basis: 45%; } .topbar-search { width: 200px; } }
@media (max-width: 575.98px) { .context-field { flex-basis: 100%; } .context-bar { position: static; } }

/* ---------- Roles & permissions matrix ---------- */
.perm-matrix td, .perm-matrix th { padding: .35rem .4rem; }
.perm-matrix thead th { font-size: .7rem; vertical-align: bottom; }

/* ---------- Student registration ---------- */
.photo-box { width: 140px; height: 170px; border: 2px dashed var(--border); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box i { font-size: 3.5rem; color: var(--text-muted); opacity: .5; }
.student-form .card-header { font-size: .95rem; }
.info-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; margin: 4px 0 8px; }
.logo-preview { width: 96px; height: 96px; border: 1px solid var(--border); border-radius: var(--radius); display: grid; place-items: center; background: #fff; padding: 8px; flex-shrink: 0; } /* logos are previewed on paper white */
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Exam permits ---------- */
.exam-permit { border: 2px solid var(--p-head, #0f2a4a); border-radius: 10px; padding: 14px 16px; background: #fff; color: #212529; page-break-inside: avoid; break-inside: avoid; margin-bottom: 18px; }
.ep-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--p-accent, #f2b632); padding-bottom: 8px; margin-bottom: 10px; }
.ep-head img { height: 48px; width: auto; }
.ep-uni { font-weight: 700; color: var(--p-head, #0f2a4a); }
.ep-title { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: .85em; }
.ep-exam { font-size: .82em; color: #555; }
.ep-status { margin-left: auto; font-weight: 800; letter-spacing: .06em; padding: 4px 10px; border-radius: 6px; font-size: .85em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ep-status.ok { background: #d1f2e0; color: #0f5132; } .ep-status.warn { background: #fde2e1; color: #842029; }
.ep-body { display: flex; gap: 14px; margin-bottom: 8px; }
.ep-photo { width: 84px; height: 100px; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; background: #f6f7f9; }
.ep-photo img { width: 100%; height: 100%; object-fit: cover; } .ep-photo i { font-size: 2.5rem; color: #bbb; }
.ep-info { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: .9em; align-content: start; }
.ep-info span { display: block; font-size: .75em; color: #777; text-transform: uppercase; }
.ep-table { font-size: .82em; margin-bottom: 6px; }
.ep-instr { font-size: .78em; color: #444; margin-bottom: 6px; }
.ep-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 26px; font-size: .8em; }
.ep-sign div { flex: 1; border-top: 1px solid #333; text-align: center; padding-top: 3px; }
.permit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
.print-page .permit-grid { display: block; }
.print-page .exam-permit:nth-of-type(2n) { page-break-after: always; break-after: page; }

/* ---------- Searchable drop-downs (assets/js/app.js) ---------- */
.ss-wrap { position: relative; }
.ss-wrap .ss-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.ss-toggle { display: block; width: 100%; text-align: left; background-color: var(--bs-body-bg, #fff); color: var(--bs-body-color); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-height: calc(1.5em + .75rem + 2px); }
.ss-toggle.form-select-sm { min-height: calc(1.5em + .5rem + 2px); }
.ss-toggle.ss-placeholder { color: var(--text-muted); }
.ss-toggle:disabled { background-color: var(--bs-secondary-bg, #e9ecef); }
.ss-toggle.is-invalid { border-color: #dc3545; box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .2); }
.ss-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 1065; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 8px); box-shadow: 0 8px 24px var(--popup-shadow); }
.ss-wrap.open .ss-menu { display: block; }
.ss-wrap.ss-up .ss-menu { top: auto; bottom: calc(100% + 2px); }
.ss-search { position: relative; padding: 6px; border-bottom: 1px solid var(--border); }
.ss-search .bi { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .8rem; }
.ss-search input { padding-left: 26px; }
.ss-list { max-height: 260px; overflow-y: auto; padding: 4px 0; position: relative; }
.ss-item { padding: 6px 12px; cursor: pointer; font-size: .92em; color: var(--text); }
.ss-item.active { background: var(--primary, #0f2a4a); color: #fff; }
.ss-item.selected:not(.active) { font-weight: 600; background: var(--hover); }
.ss-item.disabled { color: var(--text-muted); opacity: .6; cursor: not-allowed; }
.ss-item.ss-empty:not(.active) { color: var(--text-muted); font-style: italic; }
.ss-group { padding: 6px 12px 2px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }
.ss-none { padding: 8px 12px; color: var(--text-muted); font-size: .9em; }
.ss-sm .ss-item { padding: 4px 10px; font-size: .85em; }
.topbar .ss-menu, .context-bar .ss-menu { min-width: 260px; }
@media print { .ss-menu { display: none !important; } }

/* ---------- Grouped side menu ---------- */
.nav-filter { position: relative; margin: 2px 2px 10px; }
.nav-filter i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: color-mix(in srgb, var(--sidebar-text) 60%, var(--sidebar-bg)); }
.nav-filter input { width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: #fff; border-radius: calc(var(--radius) * .66); padding: 7px 10px 7px 30px; font-size: calc(var(--nav-size) * .95); outline: none; }
.nav-filter input::placeholder { color: color-mix(in srgb, var(--sidebar-text) 55%, var(--sidebar-bg)); }
.nav-filter input:focus { border-color: var(--accent); background: rgba(255,255,255,.1); }
.nav-group { margin-bottom: 2px; }
.nav-group-plain { margin-bottom: 6px; }
.nav-account { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-group-toggle { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: color-mix(in srgb, var(--sidebar-text) 80%, var(--sidebar-bg)); padding: 9px 12px; border-radius: calc(var(--radius) * .66);
  font-size: var(--nav-size); font-weight: 600; text-align: left; cursor: pointer; white-space: nowrap; }
.nav-group-toggle span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.nav-group-toggle:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-group-toggle span:first-of-type { flex: 1; }
.nav-group-icon { font-size: .95rem; width: 20px; text-align: center; opacity: .85; }
.nav-group-count { font-size: .68rem; background: rgba(255,255,255,.1); border-radius: 10px; padding: 1px 7px; letter-spacing: 0; font-weight: 600; }
.nav-group-chevron { font-size: .7rem; transition: transform .2s ease; }
.nav-group.open .nav-group-chevron { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-toggle { color: var(--accent); }
.nav-collapsible .nav-group-items { overflow: hidden; }
.nav-collapsible .nav-group-items { display: block; max-height: 0; transition: max-height .25s ease; }
.nav-collapsible .nav-group.open .nav-group-items { max-height: 600px; }
.nav-collapsible .nav-group-items .nav-link { margin-left: 12px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.08); border-radius: 0 calc(var(--radius) * .66) calc(var(--radius) * .66) 0; }
.nav-collapsible .nav-group-items .nav-link i { font-size: .95rem; }
.nav-empty { padding: 10px 12px; font-size: .85rem; color: color-mix(in srgb, var(--sidebar-text) 60%, var(--sidebar-bg)); }
.sidebar-nav.filtering .nav-group-items { max-height: none !important; }
.sidebar-nav.filtering .nav-group-chevron, .sidebar-nav.filtering .nav-group-count { visibility: hidden; }
@media (min-width: 992px) {
  body.sidebar-collapsed .nav-filter, body.sidebar-collapsed .nav-group-toggle span, body.sidebar-collapsed .nav-group-chevron { display: none; }
  body.sidebar-collapsed .nav-group-toggle { justify-content: center; padding: 8px 0 4px; pointer-events: none; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0; margin-top: 4px; }
  body.sidebar-collapsed .nav-group-icon { display: none; }
  body.sidebar-collapsed .nav-collapsible .nav-group-items { max-height: none; }
  body.sidebar-collapsed .nav-collapsible .nav-group-items .nav-link { margin-left: 0; padding-left: 0; border-left: 0; border-radius: calc(var(--radius) * .66); }
}

/* =========================================================
 *  Dark mode — <html data-bs-theme="dark">. Colours can be changed in Settings → Appearance
 *  (they are re-emitted by theme_head()); Bootstrap 5.3 switches its own components.
 * ========================================================= */
:root[data-bs-theme="dark"] {
  --bg: #0f1623;
  --surface: #172131;
  --surface-2: #1b2638;
  --surface-3: #223047;
  --hover: #1f2b3f;
  --text: #dbe2ec;
  --heading: #eef3fa;
  --text-muted: #94a3b8;
  --border: #2a3850;
  --shadow: rgba(0, 0, 0, .25);
  --popup-shadow: rgba(0, 0, 0, .5);
  --primary-soft: color-mix(in srgb, var(--primary) 26%, var(--surface));
  --primary-dark: color-mix(in srgb, var(--primary) 75%, white);
  --link: color-mix(in srgb, var(--primary) 55%, white);
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--text);
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-color: var(--text-muted);
  --bs-secondary-bg: var(--surface-3);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-link-color: var(--link);
  --bs-link-hover-color: color-mix(in srgb, var(--primary) 35%, white);
  --bs-heading-color: var(--heading);
  color-scheme: dark;
}
[data-bs-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.brand):not(.list-group-item):not(.badge) { color: var(--link); }
[data-bs-theme="dark"] .text-primary { color: var(--link) !important; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--link); --bs-btn-border-color: var(--link); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select, [data-bs-theme="dark"] .ss-toggle, [data-bs-theme="dark"] .input-group-text { background-color: var(--surface-2); border-color: var(--border); color: var(--text); }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-control[readonly], [data-bs-theme="dark"] .form-select:disabled { background-color: var(--surface-3); color: var(--text-muted); }
[data-bs-theme="dark"] .form-control::placeholder { color: color-mix(in srgb, var(--text-muted) 75%, transparent); }
[data-bs-theme="dark"] .dropdown-menu, [data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .list-group, [data-bs-theme="dark"] .offcanvas { --bs-dropdown-bg: var(--surface); --bs-modal-bg: var(--surface); --bs-list-group-bg: var(--surface); --bs-list-group-color: var(--text); --bs-list-group-border-color: var(--border); --bs-dropdown-link-hover-bg: var(--hover); --bs-dropdown-border-color: var(--border); }
[data-bs-theme="dark"] .nav-tabs { --bs-nav-tabs-link-active-bg: var(--surface); --bs-nav-tabs-link-active-color: var(--text); --bs-nav-tabs-border-color: var(--border); --bs-nav-tabs-link-active-border-color: var(--border) var(--border) var(--surface); }
[data-bs-theme="dark"] .nav-tabs .nav-link:not(.active) { color: var(--text-muted); }
/* Light-only utility classes used across pages */
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-light { background-color: var(--surface-2) !important; color: var(--text); }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--surface-3) !important; color: var(--text) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--text) !important; }
[data-bs-theme="dark"] .border { border-color: var(--border) !important; }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: var(--surface-3); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: var(--border); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--hover); --bs-btn-active-color: #fff; }
[data-bs-theme="dark"] .table-light, [data-bs-theme="dark"] .table > :not(caption) > .table-light > * { --bs-table-bg: var(--surface-3); --bs-table-color: var(--text); background-color: var(--surface-3) !important; color: var(--text) !important; }
[data-bs-theme="dark"] .table-warning > * { --bs-table-bg: #3d3214; --bs-table-color: #ffe9a8; }
[data-bs-theme="dark"] .table-success > * { --bs-table-bg: #143425; --bs-table-color: #b9f0d2; }
[data-bs-theme="dark"] .table-danger > * { --bs-table-bg: #3d1a1d; --bs-table-color: #ffc9cc; }
[data-bs-theme="dark"] .table-info > * { --bs-table-bg: #13313a; --bs-table-color: #bde9f5; }
[data-bs-theme="dark"] .alert-info { --bs-alert-bg: #12303a; --bs-alert-color: #bde9f5; --bs-alert-border-color: #1d4a58; }
[data-bs-theme="dark"] .alert-success { --bs-alert-bg: #12301f; --bs-alert-color: #b9f0d2; --bs-alert-border-color: #1d4a33; }
[data-bs-theme="dark"] .alert-warning { --bs-alert-bg: #3a2f12; --bs-alert-color: #ffe9a8; --bs-alert-border-color: #5a4a1d; }
[data-bs-theme="dark"] .alert-danger { --bs-alert-bg: #3a1619; --bs-alert-color: #ffc9cc; --bs-alert-border-color: #5a2328; }
[data-bs-theme="dark"] .bg-soft-success { background: #143425; color: #6fdca2; }
[data-bs-theme="dark"] .bg-soft-warning { background: #3d3214; color: #f5c75b; }
[data-bs-theme="dark"] .bg-soft-danger { background: #3d1a1d; color: #ff8a8a; }
[data-bs-theme="dark"] .bg-soft-info { background: #13313a; color: #6fd3eb; }
[data-bs-theme="dark"] .bg-soft-purple { background: #2a1f45; color: #b79cff; }
[data-bs-theme="dark"] .bg-soft-primary { color: var(--link); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] .progress { --bs-progress-bg: var(--surface-3); }
[data-bs-theme="dark"] .page-link { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--link); --bs-pagination-disabled-bg: var(--surface-2); }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input, [data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select { background-color: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
[data-bs-theme="dark"] .dataTables_wrapper, [data-bs-theme="dark"] .dataTables_info { color: var(--text-muted) !important; }
[data-bs-theme="dark"] img.logo-light-bg, [data-bs-theme="dark"] .brand img { background: transparent; }
[data-bs-theme="dark"] .profile-header { background: linear-gradient(120deg, color-mix(in srgb, var(--sidebar-bg) 85%, black), var(--surface-3)); }
[data-bs-theme="dark"] .ep-photo { background: #f6f7f9; }
[data-bs-theme="dark"] .letterhead, [data-bs-theme="dark"] .exam-permit { color-scheme: light; }

/* ---------- Theme switch (top bar) ---------- */
.theme-switch .dropdown-item.active, .theme-switch .dropdown-item:active { background: var(--primary); color: #fff; }
.theme-switch .theme-icon-dark, .theme-switch .theme-icon-auto { display: none; }
[data-theme-choice="dark"] .theme-switch .theme-icon-light, [data-theme-choice="auto"] .theme-switch .theme-icon-light { display: none; }
[data-theme-choice="dark"] .theme-switch .theme-icon-dark { display: inline; }
[data-theme-choice="auto"] .theme-switch .theme-icon-auto { display: inline; }
.auth-theme { position: fixed; top: 14px; right: 14px; z-index: 10; }
[data-bs-theme="dark"] .tt-time, [data-bs-theme="dark"] .bg-soft-primary i { color: var(--link); }
[data-bs-theme="dark"] .text-danger { color: #ff7b7b !important; }
[data-bs-theme="dark"] .text-success { color: #4fd18b !important; }
[data-bs-theme="dark"] .text-warning { color: #f5c75b !important; }
[data-bs-theme="dark"] .text-info { color: #6fd3eb !important; }
[data-bs-theme="dark"] .btn-outline-secondary { color: var(--bs-btn-color); --bs-btn-color: #b9c4d3; --bs-btn-border-color: #4a5a72; --bs-btn-hover-bg: #4a5a72; --bs-btn-hover-border-color: #4a5a72; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #56677f; }
[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: #dbe2ec; --bs-btn-border-color: #6b7c94; --bs-btn-hover-bg: #dbe2ec; --bs-btn-hover-color: #0f1623; --bs-btn-active-bg: #dbe2ec; --bs-btn-active-color: #0f1623; }
[data-bs-theme="dark"] .btn-outline-info { --bs-btn-color: #6fd3eb; --bs-btn-border-color: #3fa9c2; --bs-btn-hover-color: #0f1623; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #ff7b7b; --bs-btn-border-color: #d9534f; }
[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: #4fd18b; --bs-btn-border-color: #2f9e62; --bs-btn-hover-color: #0f1623; }
[data-bs-theme="dark"] .btn-outline-warning { --bs-btn-color: #f5c75b; --bs-btn-border-color: #c99a2e; }
[data-bs-theme="dark"] .text-bg-dark { background-color: #e2e8f0 !important; color: #0f1623 !important; }
[data-bs-theme="dark"] .text-muted { color: var(--text-muted) !important; }
.profile-header :is(h1,h2,h3,h4,h5,h6), .hero :is(h1,h2,h3,h4,h5,h6), .auth-side :is(h1,h2,h3,h4,h5,h6), .text-white :is(h1,h2,h3,h4,h5,h6), [class*="text-bg-"] :is(h1,h2,h3,h4,h5,h6) { color: inherit; }
[data-bs-theme="dark"] .btn-light { background-color: var(--bs-btn-bg); color: var(--bs-btn-color); border-color: var(--bs-btn-border-color); }
[data-bs-theme="dark"] .btn-light:hover, [data-bs-theme="dark"] .btn-light:focus-visible, [data-bs-theme="dark"] .btn-light.show { background-color: var(--bs-btn-hover-bg); color: var(--bs-btn-hover-color); }

/* ---------- v11: calendar, ratings, admissions, public pages ---------- */
.landing-footer { background: var(--surface); }
.public-page { background: var(--bg, var(--surface-2)); }
.cal-grid { width: 100%; }
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; text-align: center; padding: 6px 0; }
.cal-cell { min-height: 92px; border: 1px solid var(--border); margin: -1px 0 0 -1px; padding: 4px; background: var(--surface); overflow: hidden; }
.cal-cell.cal-empty { background: var(--surface-2); }
.cal-cell.cal-weekend { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.cal-cell.cal-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.cal-day a { color: inherit; text-decoration: none; }
.cal-day a:hover { color: var(--link); }
.cal-ev { font-size: .7rem; border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-date { min-width: 64px; white-space: normal; }
@media (max-width: 575.98px) { .cal-cell { min-height: 58px; } .cal-ev { font-size: 0; height: 6px; padding: 0; } }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 1.7rem; color: var(--border); cursor: pointer; line-height: 1; transition: color .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f2b632; }
.star-input input:focus-visible + label { outline: 2px solid var(--link); border-radius: 4px; }
.app-steps { display: flex; gap: 6px; }
.app-step { flex: 1; text-align: center; font-size: .8rem; color: var(--text-muted); border-top: 4px solid var(--border); padding-top: 8px; }
.app-step span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); margin-right: 4px; font-weight: 700; font-size: .72rem; }
.app-step.done { color: var(--text); border-top-color: var(--bs-success); }
.app-step.done span { background: var(--bs-success); color: #fff; }
.app-step.bad { border-top-color: var(--bs-danger); }
.app-step.bad span { background: var(--bs-danger); }
.twofa-qr svg { width: 180px; height: 180px; display: block; }
.msg-unread { background: color-mix(in srgb, var(--link) 7%, var(--surface)); }
.min-w-0 { min-width: 0; }

/* ---------- Motion ---------- */
[data-anim="off"] *, [data-anim="off"] *::before, [data-anim="off"] *::after { transition: none !important; animation-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- Dark mode refinements for the design system ---------- */
[data-bs-theme="dark"] .sidebar { background-image: none; }
[data-bs-theme="dark"] .card-header > .bi:first-child, [data-bs-theme="dark"] .card-header > i:first-child { color: var(--link); }
[data-bs-theme="dark"] .shortcut i, [data-bs-theme="dark"] .empty-state i { color: var(--link); }
[data-bs-theme="dark"] .auth-field .form-control { background: var(--surface-2); }
[data-bs-theme="dark"] .alert-light { background: var(--surface); color: var(--text); }
[data-bs-theme="dark"] .bg-soft-accent { color: color-mix(in srgb, var(--accent) 60%, white); }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: var(--surface-3); }
[data-bs-theme="dark"] .rail-tip { background: #e2e8f0; color: #0f172a; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select, [data-bs-theme="dark"] .input-group-text { border-color: var(--border); }

/* ---------- System Settings ---------- */
.settings-nav { display: flex; flex-wrap: wrap; gap: 14px 28px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.settings-nav-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 700; margin: 0 0 6px 4px; }
.settings-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font-size: .86rem; font-weight: 500; border: 1px solid transparent; transition: all var(--dur) var(--ease); }
.settings-tab i { color: var(--text-muted); }
.settings-tab:hover { background: var(--primary-soft); color: var(--primary); } .settings-tab:hover i { color: var(--primary); }
.settings-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent); } .settings-tab.active i { color: #fff; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; bottom: 0; z-index: 5; padding: 12px 14px; margin: 0 -2px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.preview-sticky { position: sticky; top: calc(var(--topbar-h) + 70px); }
@media (max-width: 1199.98px) { .preview-sticky { position: static; } }
.color-field { display: flex; align-items: stretch; border: 1px solid color-mix(in srgb, var(--border) 80%, var(--text)); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.color-field:focus-within { box-shadow: var(--focus-ring); border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.color-field .form-control-color { border: 0; border-right: 1px solid var(--border); border-radius: 0; width: 44px; max-width: 44px; min-height: 2.4rem; padding: 4px; background: transparent; }
.color-field .form-control { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; text-transform: lowercase; }
.form-control-color { max-width: 52px; padding: .25rem; }
.preset-swatch { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.preset-swatch span { width: 12px; height: 18px; display: block; }
.logo-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.logo-swatch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); padding: 3px 10px 3px 4px; font: 500 .76rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); cursor: copy; }
.logo-swatch span { width: 18px; height: 18px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.logo-swatch.copied { border-color: var(--success); color: var(--success); }
.contrast-row { display: flex; flex-wrap: wrap; gap: 6px; }
.contrast-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); }
.contrast-chip.ok { color: #12804c; background: #e9f7ef; border-color: #bfe6cf; }
.contrast-chip.mid { color: #8a5300; background: #fff5e0; border-color: #f3d9a4; }
.contrast-chip.bad { color: #b42318; background: #fdecea; border-color: #f5c2bd; }
[data-bs-theme="dark"] .contrast-chip.ok { background: #143425; color: #6fdca2; border-color: #1f5138; }
[data-bs-theme="dark"] .contrast-chip.mid { background: #3d3214; color: #f5c75b; border-color: #5a4a1d; }
[data-bs-theme="dark"] .contrast-chip.bad { background: #3d1a1d; color: #ff8a8a; border-color: #5a2328; }
.seg { flex-wrap: wrap; }
.seg .btn { flex: 1 1 auto; font-weight: 500; }
.seg .btn-check:checked + .btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.brand-swatch { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.brand-swatch > span { width: 30px; height: 30px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.paper-preview { color-scheme: light; color: #1e2a3b; }
/* Mini app used by the Theme / Layout previews */
.pv-app { display: flex; height: 230px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font), sans-serif; font-size: 11px; box-shadow: var(--shadow-card); }
.pv-side { width: 30%; max-width: 140px; background: var(--sidebar-bg); color: var(--sidebar-text); padding: 8px 6px; font-family: var(--sidebar-font), var(--font), sans-serif; flex-shrink: 0; }
.pv-brand { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; padding: 2px 4px 8px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 6px; }
.pv-brand img { width: 18px; height: 18px; object-fit: contain; background: rgba(255,255,255,.9); border-radius: 4px; padding: 1px; }
.pv-link { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: calc(var(--radius) * .5); margin-bottom: 2px; white-space: nowrap; overflow: hidden; }
.pv-link.active { background: color-mix(in srgb, var(--primary) 55%, transparent); color: #fff; box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.pv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv-top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--topbar-bg); border-bottom: 1px solid var(--border); position: relative; }
.pv-crumb { position: absolute; top: 2px; left: 10px; font-size: 8px; color: color-mix(in srgb, var(--text) 55%, var(--bg)); }
.pv-title { font-family: var(--heading-font), var(--font), sans-serif; font-weight: var(--heading-weight); color: var(--heading); margin-top: 6px; font-size: 12px; }
.pv-avatar { margin-left: auto; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.pv-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.pv-banner { border-radius: calc(var(--radius) * .6); padding: 7px 9px; color: rgba(255,255,255,.8); font-size: 9px; background: linear-gradient(120deg, var(--secondary), var(--primary)); }
.pv-banner b { display: block; color: #fff; font-size: 12px; }
.pv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pv-card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * .6); padding: 6px 8px; box-shadow: var(--shadow-card); }
.pv-card i { color: var(--primary); } .pv-card b { display: block; color: var(--heading); font-size: 13px; line-height: 1.1; } .pv-card small { color: color-mix(in srgb, var(--text) 60%, var(--surface)); font-size: 9px; }
.pv-table { padding: 0; overflow: hidden; }
.pv-tr { display: flex; justify-content: space-between; padding: 3px 8px; border-top: 1px solid var(--border); }
.pv-th { border-top: 0; text-transform: uppercase; font-size: 8px; letter-spacing: .05em; color: color-mix(in srgb, var(--text) 55%, var(--surface)); background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.pv-btns { display: flex; gap: 5px; align-items: center; }
.pv-btn { background: var(--primary); color: #fff; border-radius: calc(var(--radius) * .45); padding: 2px 9px; font-family: var(--button-font), var(--font), sans-serif; }
.pv-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.pv-badge { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: color-mix(in srgb, var(--accent) 60%, var(--text)); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
/* Typography preview */
.tp-nav { background: var(--sidebar-bg); color: var(--sidebar-text); border-radius: var(--radius-sm); padding: 6px; font-family: var(--sidebar-font), var(--font), sans-serif; font-size: var(--nav-size); }
.tp-nav-item { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: calc(var(--radius-sm) * .8); }
.tp-nav-item.active { background: color-mix(in srgb, var(--primary) 55%, transparent); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.tp-report { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.type-preview .form-label { font-size: .78rem; }
/* Branding previews */
.brand-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 575.98px) { .brand-previews { grid-template-columns: 1fr; } }
.bp-login { display: flex; height: 110px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.bp-login-side { flex: 1.1; background: linear-gradient(150deg, var(--secondary), var(--primary)); color: #fff; padding: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 9px; }
.bp-login-side img { width: 20px; height: 20px; object-fit: contain; background: #fff; border-radius: 4px; padding: 1px; }
.bp-login-side strong { font-size: 11px; }
.bp-login-form { flex: 1; background: var(--surface); padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; font-size: 9px; }
.bp-login-form i { display: block; height: 10px; border-radius: 3px; background: var(--surface-3); }
.bp-login-form em { display: block; height: 12px; border-radius: 3px; background: var(--primary); }
.bp-app { display: flex; height: 110px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.bp-side { width: 30%; background: var(--sidebar-bg); padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.bp-side img { width: 18px; height: 18px; object-fit: contain; background: #fff; border-radius: 4px; padding: 1px; margin-bottom: 4px; }
.bp-side i { display: block; height: 7px; border-radius: 3px; background: rgba(255,255,255,.18); } .bp-side i.on { background: var(--accent); }
.bp-main { flex: 1; } .bp-top { background: var(--topbar-bg); border-bottom: 1px solid var(--border); padding: 5px 8px; font-size: 9px; color: var(--heading); }
.bp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 8px; } .bp-cards i { height: 28px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); }
.bp-tab { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-3); border-radius: 10px 10px 0 0; max-width: 240px; font-size: .78rem; }
.bp-tab img { width: 16px; height: 16px; object-fit: contain; } .bp-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-footer { font-size: .75rem; color: var(--text-muted); border-top: 1px solid var(--border); padding: 8px 4px; }
[data-bs-theme="dark"] a.shortcut, [data-bs-theme="dark"] a.user-chip, [data-bs-theme="dark"] .crumbs a, [data-bs-theme="dark"] a.settings-tab:not(.active) { color: var(--text) !important; }
[data-bs-theme="dark"] a.shortcut:hover, [data-bs-theme="dark"] .crumbs a:hover { color: var(--link) !important; }
[data-bs-theme="dark"] .crumbs a { color: var(--text-muted) !important; }
@media (max-width: 767.98px) { .auth-form { padding-top: 60px; } }
[data-bs-theme="dark"] a.settings-tab.active { color: #fff !important; }
.form-range::-webkit-slider-thumb { background: var(--primary); }
.form-range::-moz-range-thumb { background: var(--primary); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--surface), var(--focus-ring); }
/* Status colours (fixed, accessible, never the brand colours) */
.text-bg-success { background-color: var(--success) !important; color: #fff !important; }
.text-bg-danger { background-color: var(--danger) !important; color: #fff !important; }
.text-bg-info { background-color: var(--info) !important; color: #fff !important; }
.text-bg-warning { background-color: #f4b740 !important; color: #3d2a00 !important; }
.btn-success { --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success); --bs-btn-hover-bg: #0e6b3f; --bs-btn-hover-border-color: #0e6b3f; --bs-btn-active-bg: #0e6b3f; }
.progress-bar.bg-success, .bg-success { background-color: var(--success) !important; }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { color: var(--link); border-bottom-color: var(--link); }
[data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: var(--link); }
:root:not([data-bs-theme="dark"]) .text-success { color: var(--success) !important; }
:root:not([data-bs-theme="dark"]) .text-danger { color: var(--danger) !important; }
:root:not([data-bs-theme="dark"]) .text-warning { color: var(--warning) !important; }
:root:not([data-bs-theme="dark"]) .btn-outline-success { --bs-btn-color: var(--success); --bs-btn-border-color: var(--success); --bs-btn-hover-bg: var(--success); --bs-btn-hover-border-color: var(--success); --bs-btn-hover-color: #fff; }
.card.stat-card { flex-direction: row; }
.stat-card > div:last-child { min-width: 0; }
@media (min-width: 1400px) { .col-xxl-2 > a > .stat-card, .col-xxl-2 > .stat-card { flex-direction: column; align-items: flex-start; gap: 12px; } }

/* ---------- Top-bar live search ---------- */
.topbar-search { position: relative; width: min(380px, 34vw); }
.ts-field { position: relative; }
.ts-field .form-control { height: 2.4rem; padding-left: 2.3rem; padding-right: 4.2rem; border-radius: var(--radius-pill); background: var(--surface-2); border-color: var(--border); font-size: .88rem; transition: background-color var(--dur), box-shadow var(--dur), border-color var(--dur); }
.ts-field .form-control:focus { background: var(--surface); }
.ts-field .form-control::-webkit-search-cancel-button { margin-right: 2.6rem; }
.ts-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; z-index: 2; }
.ts-kbd, .ts-pop kbd { font: 600 .66rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: .22rem .35rem; }
.ts-kbd { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ts-spin { position: absolute; right: 4.1rem; top: 50%; width: .9rem; height: .9rem; margin-top: -.45rem; border-width: .14em; color: var(--primary); display: none; }
.ts-field.loading .ts-spin { display: block; }
.topbar-search.is-open .ts-kbd { opacity: 0; }
.ts-pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 380px; z-index: 1080; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: min(72vh, 560px); overflow-y: auto; padding: 6px; animation: ums-toast-in .16s var(--ease); }
.ts-pop[hidden] { display: none; }
.ts-group + .ts-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.ts-label { display: flex; align-items: center; gap: 6px; font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--text-muted); padding: 8px 10px 4px; }
.ts-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: calc(var(--radius) * .7); color: var(--text) !important; text-decoration: none; }
.ts-item.active { background: var(--primary-soft); }
.ts-item.active .ts-t { color: var(--primary); }
.ts-fig { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); color: var(--primary); }
.ts-fig img { width: 100%; height: 100%; object-fit: cover; }
.ts-fig .ts-ini { width: 100%; height: 100%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.ts-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ts-t { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-s { font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-item mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; padding: 0 1px; border-radius: 3px; }
.ts-b { font-size: .66rem; text-transform: capitalize; }
.ts-enter { font-size: .8rem; color: var(--text-muted); opacity: 0; }
.ts-item.active .ts-enter { opacity: 1; }
.ts-all { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px; border-top: 1px solid var(--border); font-size: .84rem; font-weight: 600; text-decoration: none; color: var(--primary); }
.ts-all span { margin-left: auto; }
.ts-all:hover { background: var(--primary-soft); border-radius: calc(var(--radius) * .7); }
.ts-empty { text-align: center; padding: 22px 12px; color: var(--text-muted); font-size: .88rem; }
.ts-empty > i { display: block; font-size: 1.4rem; margin-bottom: 6px; }
.ts-hint { display: flex; gap: 8px; align-items: center; padding: 12px; color: var(--text-muted); font-size: .82rem; }
.ts-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px 4px; border-top: 1px solid var(--border); font-size: .72rem; color: var(--text-muted); }
.ts-foot kbd { margin: 0 2px; }
[data-header="brand"]:not([data-bs-theme="dark"]) .ts-field .form-control { background: rgba(255,255,255,.95); border-color: transparent; }
[data-bs-theme="dark"] .ts-item.active .ts-t { color: var(--link); }
[data-bs-theme="dark"] a.ts-all { color: var(--link) !important; }
@media (max-width: 991.98px) { .topbar-search { width: 260px; } .ts-pop { min-width: 320px; } }
@media (max-width: 767.98px) {
  .topbar-search { display: none; position: fixed; left: 10px; right: 10px; top: 10px; width: auto; z-index: 1085; }
  body.search-open .topbar-search { display: block; }
  body.search-open .ts-field .form-control { height: 2.9rem; box-shadow: var(--shadow-pop); background: var(--surface); }
  .ts-pop { min-width: 0; max-height: calc(100vh - 90px); }
  body.search-open::after { content: ''; position: fixed; inset: 0; background: rgba(8,15,35,.35); z-index: 1070; }
}
/* Staff registration */
@media (min-width: 1200px) { .form-side { position: sticky; top: calc(var(--topbar-h) + 70px); } }
.staff-form .photo-box { width: 132px; height: 160px; }
@media (max-width: 767.98px) { body.search-open .topbar { z-index: 1090; backdrop-filter: none; -webkit-backdrop-filter: none; } }
.photo-box-sm { width: 64px; height: 78px; flex-shrink: 0; } .photo-box-sm i { font-size: 1.8rem; }

/* ---------- Room page ---------- */
.print-col { display: none; }
@media print { .print-col { display: table-cell !important; } }
.print-page .print-col { display: table-cell !important; }
.room-badge { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent); }
.room-hero h3 { margin: 0; }
.room-kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.room-kpis > div { min-width: 104px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.room-kpis strong { display: block; font-size: 1.35rem; line-height: 1.1; color: var(--heading); font-family: var(--heading-font), var(--font), sans-serif; }
.room-kpis span { font-size: .74rem; color: var(--text-muted); }
.cand-list { max-height: 420px; overflow-y: auto; padding: 8px 10px; }
.cand-list .form-check { padding-top: 3px; padding-bottom: 3px; border-bottom: 1px dashed var(--border); }

/* ---------- Teaching attendance ---------- */
.teach-kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.teach-kpis > div { flex: 1 1 110px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .78rem; color: var(--text-muted); box-shadow: var(--shadow-card); border-top: 3px solid var(--primary); }
.teach-kpis span { display: block; font-size: 1.4rem; font-weight: 700; color: var(--heading); font-family: var(--heading-font), var(--font), sans-serif; line-height: 1.15; }
.teach-kpis .tk-success { border-top-color: var(--success); } .teach-kpis .tk-warning { border-top-color: #f4b740; } .teach-kpis .tk-info { border-top-color: var(--info); }
.teach-kpis .tk-danger { border-top-color: var(--danger); } .teach-kpis .tk-secondary { border-top-color: #94a3b8; } .teach-kpis .tk-dark { border-top-color: #334155; } .teach-kpis .tk-none { border-top-color: var(--border); }
.teach-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.teach-seg .btn { display: inline-flex; align-items: center; gap: 4px; padding: .22rem .5rem; font-size: .76rem; border-radius: var(--radius-pill); }
.teach-row .teach-extra { display: none; margin-bottom: 4px; }
.teach-row[data-status="late"] .teach-late, .teach-row[data-status="substitute"] .teach-sub { display: block; }
.teach-row[data-status=""] td:first-child { box-shadow: inset 3px 0 0 var(--border); }
.teach-row[data-status="present"] td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.teach-row[data-status="late"] td:first-child { box-shadow: inset 3px 0 0 #f4b740; }
.teach-row[data-status="absent"] td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.teach-row[data-status="substitute"] td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.teach-row[data-status="excused"] td:first-child, .teach-row[data-status="cancelled"] td:first-child { box-shadow: inset 3px 0 0 #94a3b8; }
@media (max-width: 1399.98px) { .teach-seg .btn span { display: none; } .teach-seg .btn { padding: .3rem .55rem; font-size: .85rem; } }
@media print { .teach-seg .btn:not(.active) { display: none; } .teach-seg input:not(:checked) + .btn { display: none; } .teach-seg .btn span { display: inline; } }
.teach-time { width: 58px; text-align: center; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); padding: 6px 0; line-height: 1.15; }
.teach-time strong { display: block; } .teach-time span { font-size: .75rem; opacity: .8; }

/* ---------- v16: profile pages (admin student / lecturer view) ---------- */
.pf-card { border-radius: calc(var(--radius) * 1.15); overflow: hidden; margin-bottom: var(--card-gap); }
.pf-cover { height: 118px; position: relative; overflow: hidden;
  background: radial-gradient(700px 200px at 100% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%), linear-gradient(120deg, var(--secondary), var(--primary)); }
.pf-cover::before, .pf-cover::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); pointer-events: none; }
.pf-cover::before { width: 320px; height: 320px; right: -80px; top: -190px; }
.pf-cover::after { width: 200px; height: 200px; right: 140px; top: -130px; }
.pf-cover .pf-cover-tag { position: absolute; left: 20px; top: 14px; color: rgba(255,255,255,.85); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.pf-main { display: flex; gap: 20px; padding: 0 22px 18px; align-items: flex-end; flex-wrap: wrap; }
.pf-avatar { margin-top: -56px; position: relative; flex-shrink: 0; }
.pf-avatar .avatar, .pf-avatar img, .pf-avatar > span { border: 4px solid var(--surface) !important; box-shadow: var(--shadow-pop); border-radius: 50% !important; }
.pf-dot { position: absolute; right: 8px; bottom: 8px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--surface); background: var(--bs-success); }
.pf-dot.off { background: var(--bs-secondary); } .pf-dot.warn { background: var(--bs-warning); } .pf-dot.bad { background: var(--bs-danger); }
.pf-id { flex: 1 1 280px; min-width: 0; padding-top: 10px; }
.pf-id h3 { margin: 0 0 2px; font-weight: 700; color: var(--heading); font-size: 1.45rem; line-height: 1.2; }
.pf-sub { color: var(--text-muted); font-size: .92rem; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.pf-chip i { color: var(--text-muted); }
.pf-chip.pf-chip-strong { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); font-weight: 600; }
[data-bs-theme="dark"] .pf-chip.pf-chip-strong { color: var(--link); }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 10px; }
.pf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--border); }
.pf-kpi { padding: 14px 20px; border-right: 1px solid var(--border); min-width: 0; }
.pf-kpi:last-child { border-right: 0; }
.pf-kpi .v { font-size: 1.35rem; font-weight: 700; color: var(--heading); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-kpi .l { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.pf-kpi .s { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.pf-kpi .pf-meter { height: 5px; border-radius: 99px; background: var(--surface-3, var(--surface-2)); margin-top: 7px; overflow: hidden; }
.pf-kpi .pf-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.pf-meter.ok > span { background: var(--bs-success); } .pf-meter.warn > span { background: var(--bs-warning); } .pf-meter.bad > span { background: var(--bs-danger); }
@media (max-width: 575.98px) { .pf-kpi { border-right: 0; border-bottom: 1px solid var(--border); } .pf-main { padding: 0 16px 16px; } .pf-actions { width: 100%; } .pf-cover { height: 84px; } .pf-cover .pf-cover-tag { display: none; } }
.pf-side .list-group-item { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; padding: 10px 16px; }
.pf-side .list-group-item > i { color: var(--text-muted); width: 18px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.pf-side .k { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.pf-side .list-group-item > div { min-width: 0; overflow-wrap: anywhere; }
.pf-alert { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; font-size: .85rem; margin-bottom: 8px; border: 1px solid; }
.pf-alert i { margin-top: 1px; }
.pf-alert.warn { background: color-mix(in srgb, var(--bs-warning) 12%, var(--surface)); border-color: color-mix(in srgb, var(--bs-warning) 35%, transparent); }
.pf-alert.bad { background: color-mix(in srgb, var(--bs-danger) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bs-danger) 30%, transparent); }
.pf-alert.info { background: color-mix(in srgb, var(--bs-info) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bs-info) 30%, transparent); }
.pf-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.pf-tabs .nav-link { white-space: nowrap; }
.pf-tabs .nav-link .badge { font-size: .68rem; vertical-align: 1px; }
.pf-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.pf-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.pf-box .info-section-title { display: flex; align-items: center; gap: 6px; }
.pf-box .dl-grid { grid-template-columns: 130px minmax(0, 1fr); font-size: .87rem; }
.pf-box .dl-grid dd { overflow-wrap: anywhere; min-width: 0; }
.pf-sem { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.pf-sem-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .88rem; }
.pf-sem-head strong { color: var(--heading); }
.pf-sem table { margin: 0; }
.pf-att { display: flex; align-items: center; gap: 10px; }
.pf-att .pf-meter { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 0; }
.pf-att .pf-meter > span { display: block; height: 100%; border-radius: inherit; }
.pf-ring { --p: 0; --c: var(--primary); width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.pf-ring > div { width: 86px; height: 86px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.pf-ring strong { font-size: 1.35rem; color: var(--heading); display: block; }
.pf-ring small { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.pf-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pf-mini > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.pf-mini .v { font-weight: 700; font-size: 1.1rem; color: var(--heading); }
.pf-mini .l { font-size: .74rem; color: var(--text-muted); }
.pf-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.pf-timeline li { position: relative; padding: 0 0 16px 26px; font-size: .88rem; }
.pf-timeline li::before { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.pf-timeline li:last-child::before { display: none; }
.pf-timeline .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.pf-timeline .when { font-size: .76rem; color: var(--text-muted); }
@media print { .pf-cover { height: 40px; } .pf-actions, .pf-tabs { display: none !important; } .pf-card { box-shadow: none; } }
.btn-check:checked + .btn-outline-success, .btn-outline-success:active { --bs-btn-active-bg: #146c43; --bs-btn-active-border-color: #146c43; --bs-btn-active-color: #fff; }

/* ---------- v17: ID card set-up style pickers ---------- */
.sc-style-opt { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; height: 100%; background: var(--surface); }
.sc-style-opt i { font-size: 1.6rem; color: var(--primary); line-height: 1; }
.sc-style-opt strong { display: block; color: var(--heading); } .sc-style-opt small { color: var(--text-muted); display: block; margin-top: 2px; }
.btn-check:checked + .sc-style-opt { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
[data-style-only][hidden] { display: none !important; }
.btn-check:focus-visible + .sc-style-opt { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- v17: staff & lecturers ---------- */
.portal-switch { display: inline-flex; align-items: center; border-radius: 999px; padding: .3rem .8rem; font-weight: 600; font-size: .8rem; border: 1px solid color-mix(in srgb, #146c43 45%, transparent); color: #146c43; background: color-mix(in srgb, var(--bs-success) 9%, var(--surface)); white-space: nowrap; }
.portal-switch:hover { background: var(--bs-success); color: #fff; border-color: var(--bs-success); }
.portal-switch.is-lecturer { border-color: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.portal-switch.is-lecturer:hover { background: var(--primary); color: #fff; }
[data-bs-theme="dark"] .portal-switch { color: #5fd49b; } [data-bs-theme="dark"] .portal-switch.is-lecturer { color: var(--link); }
[data-bs-theme="dark"] .portal-switch:hover { color: #fff; }
.people-tabs .nav-link { border-radius: 999px; padding: .35rem .85rem; font-size: .88rem; color: var(--text-muted); font-weight: 500; }
.people-tabs .nav-link.active { background: var(--primary); color: #fff; }
.people-tabs .nav-link:not(.active):hover { background: var(--surface-2); color: var(--text); }
a.stat-card:hover { box-shadow: var(--shadow-pop); }
.job-opt { position: relative; padding-right: 34px; }
.job-opt .job-tick { position: absolute; top: 10px; right: 10px; font-size: 1.1rem; color: var(--primary); opacity: 0; transition: opacity .15s; }
.btn-check:checked + .job-opt .job-tick { opacity: 1; }
.kid-row + .kid-row { padding-top: .25rem; border-top: 1px dashed var(--border); }

/* ---------- v20: transcript paper on screen ---------- */
.tx-paper { background: #fff; border-radius: 6px; box-shadow: 0 2px 14px rgba(0,0,0,.12); padding: 10mm 0 8mm; overflow-x: auto; color-scheme: light; }
[data-bs-theme="dark"] .tx-paper { box-shadow: 0 2px 18px rgba(0,0,0,.5); }
.print-page .tx-paper { box-shadow: none; padding: 0; border-radius: 0; }
@media print { .tx-paper { box-shadow: none !important; padding: 0 !important; } }

/* =========================================================
 *  Classic design — the look of the previous Banoda system (UBold style):
 *  dark top bar, white side menu with section titles, page title + breadcrumb row, flat cards with dashed headers.
 *  Turned on by Settings → Appearance → Layout → Design style (html[data-skin="classic"]). Colours still come from the theme settings.
 * ========================================================= */
.page-title-head, .nav-section { display: none; }
[data-skin="classic"] { --topbar-h: 70px; --shadow-card: 0 1px 4px rgba(130, 143, 163, .15); --nav-hover: var(--primary); --nav-active: var(--primary); }
[data-skin="classic"][data-bs-theme="dark"] { --shadow-card: 0 1px 4px rgba(0, 0, 0, .35); --nav-hover: color-mix(in srgb, var(--primary) 45%, white); --nav-active: color-mix(in srgb, var(--primary) 40%, white); }
[data-skin="classic"] body { background: var(--bg); }

/* Side menu: white, grey items, purple when active, small uppercase section titles */
[data-skin="classic"] .sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--border); }
[data-skin="classic"] .sidebar::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--sidebar-text) 30%, transparent); }
[data-skin="classic"] .brand { background: var(--topbar-bg); border-bottom: 0; min-height: var(--topbar-h); padding: 14px 18px; }
[data-skin="classic"] .brand img { background: transparent; }
[data-skin="classic"] .brand-name { color: color-mix(in srgb, var(--topbar-ink) 55%, white); }
[data-skin="classic"]:not([data-bs-theme="dark"]) .brand-name { color: #fff; }
[data-skin="classic"] .brand-sub { color: color-mix(in srgb, var(--accent) 80%, white); }
[data-skin="classic"] .sidebar-nav { padding: 6px 10px 30px; }
[data-skin="classic"] .nav-section { display: block; font-size: calc(var(--nav-size) * .72); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sidebar-text); padding: 16px 12px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-skin="classic"] .sidebar-nav.filtering .nav-section { display: none; }
[data-skin="classic"] .nav-filter { margin: 10px 2px 2px; }
[data-skin="classic"] .nav-filter input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: calc(var(--radius) * 1.2); }
[data-skin="classic"] .nav-filter input::placeholder, [data-skin="classic"] .nav-filter i { color: var(--sidebar-text); }
[data-skin="classic"] .nav-filter input:focus { border-color: var(--primary); background: var(--surface); }
[data-skin="classic"] .nav-group-toggle { color: var(--sidebar-text); font-weight: 400; border-radius: 0; padding: 8px 12px; }
[data-skin="classic"] .nav-group-toggle:hover, [data-skin="classic"] .nav-group.has-active > .nav-group-toggle { color: var(--nav-hover); background: none; }
[data-skin="classic"] .nav-group-icon { opacity: 1; font-size: 1rem; }
[data-skin="classic"] .nav-group-count { display: none; }
[data-skin="classic"] .sidebar .nav-link { color: var(--sidebar-text); border-radius: 0; background: none; box-shadow: none; padding: 7px 12px; }
[data-skin="classic"] .sidebar .nav-link:hover { color: var(--nav-hover); background: none; }
[data-skin="classic"] .sidebar .nav-link.active { color: var(--nav-active); background: none; box-shadow: none; font-weight: 700; }
[data-skin="classic"] .sidebar .nav-link.active i { color: var(--nav-active); }
[data-skin="classic"] .nav-collapsible .nav-group-items .nav-link { margin-left: 0; padding-left: 43px; border-left: 0; border-radius: 0; }
[data-skin="classic"] .nav-collapsible .nav-group-items .nav-link i { display: none; }
[data-skin="classic"] .nav-account { border-top-color: var(--border); }
[data-skin="classic"] .nav-empty { color: var(--sidebar-text); }
[data-skin="classic"] .nav-heading { color: var(--sidebar-text); font-weight: 700; letter-spacing: .1em; }
@media (min-width: 992px) {
  [data-skin="classic"] body.sidebar-collapsed .nav-section { display: none; }
  [data-skin="classic"] body.sidebar-collapsed .nav-group-toggle { border-top-color: var(--border); }
  [data-skin="classic"] body.sidebar-collapsed .nav-collapsible .nav-group-items .nav-link { padding-left: 0; }
  [data-skin="classic"] body.sidebar-collapsed .nav-collapsible .nav-group-items .nav-link i { display: inline-block; }
}

/* Top bar: dark slate, light icons, rounded search */
[data-skin="classic"] .topbar { background: var(--topbar-bg); border-bottom: 0; color: var(--topbar-ink); min-height: var(--topbar-h); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
[data-skin="classic"] .topbar-title { display: none; }
[data-skin="classic"] .topbar .btn-light { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--topbar-ink);
  --bs-btn-hover-bg: color-mix(in srgb, var(--topbar-ink) 14%, transparent); --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: var(--topbar-ink);
  --bs-btn-active-bg: color-mix(in srgb, var(--topbar-ink) 20%, transparent); --bs-btn-active-border-color: transparent; --bs-btn-active-color: var(--topbar-ink); }
[data-skin="classic"] .topbar .btn-light.border { border-color: transparent !important; }
[data-skin="classic"] .topbar .user-chip, [data-skin="classic"] .topbar .user-chip .text-muted { color: var(--topbar-ink) !important; }
[data-skin="classic"] .topbar .user-chip .fw-semibold { color: var(--topbar-ink) !important; font-weight: 700 !important; }
[data-skin="classic"] .topbar-search .form-control { background: color-mix(in srgb, var(--topbar-bg) 90%, var(--topbar-ink)); border-color: transparent; color: var(--topbar-ink); border-radius: 30px; }
[data-skin="classic"] .topbar-search .form-control::placeholder { color: color-mix(in srgb, var(--topbar-ink) 75%, var(--topbar-bg)); }
[data-skin="classic"] .topbar-search .form-control:focus { border-color: color-mix(in srgb, var(--topbar-ink) 40%, transparent); box-shadow: none; }
[data-skin="classic"] .topbar-search .ts-icon { color: var(--topbar-ink); }
[data-skin="classic"] .topbar-search .ts-kbd { background: transparent; color: var(--topbar-ink); border-color: color-mix(in srgb, var(--topbar-ink) 35%, transparent); }
[data-skin="classic"] .context-bar { top: var(--topbar-h); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
@media (max-width: 991.98px) { [data-skin="classic"] .context-bar { top: 0; position: static; } [data-skin="classic"] { --topbar-h: 62px; } }

/* Page title on the left, breadcrumb on the right */
[data-skin="classic"] .page-title-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 calc(var(--card-gap) * .8); min-height: 40px; }
.pth-title { font-size: var(--title-size); font-weight: var(--heading-weight); color: var(--heading); margin: 0; font-family: var(--heading-font), var(--font), sans-serif; }
.pth-crumbs { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: .875rem; color: var(--text-muted); }
.pth-crumbs li + li::before { content: '\203A'; margin: 0 6px 0 2px; opacity: .6; }
.pth-crumbs a { color: var(--heading); text-decoration: none; } .pth-crumbs a:hover { color: var(--primary); }
@media (max-width: 575.98px) { [data-skin="classic"] .pth-crumbs { display: none; } }

/* Cards: borderless with a soft shadow and a dashed line under the title */
[data-skin="classic"] .card { border: 0; box-shadow: var(--shadow-card); }
[data-skin="classic"] .card-header { background: transparent; border-bottom: 1px dashed var(--border); padding: calc(16px * var(--space)) calc(22px * var(--space)); font-weight: 700; }
[data-skin="classic"] .card-header > .bi:first-child, [data-skin="classic"] .card-header > i:first-child { background: none; width: auto; height: auto; color: var(--text-muted); font-size: 1rem; }
[data-skin="classic"] .card-body { padding: calc(20px * var(--space)) calc(22px * var(--space)); }
[data-skin="classic"] .card-footer { background: transparent; border-top: 1px dashed var(--border); }
[data-skin="classic"] .stat-icon { border-radius: 50%; width: 54px; height: 54px; }
[data-skin="classic"] .stat-value { font-weight: 700; }

/* Tables: plain uppercase headings, light rows */
[data-skin="classic"] .table thead th { background: transparent; color: color-mix(in srgb, var(--heading) 80%, var(--surface)); font-weight: 700; font-size: .72rem; border-bottom: 1px solid var(--border); }
[data-skin="classic"] .table > tbody > tr > * { border-bottom-color: var(--border); }

/* Dashboard banner: a plain white card instead of the colour gradient */
[data-skin="classic"] .welcome-banner { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); border-radius: var(--radius); border-left: 4px solid var(--primary); }
[data-skin="classic"] .welcome-banner::before, [data-skin="classic"] .welcome-banner::after { display: none; }
[data-skin="classic"] .welcome-banner h2 { color: var(--heading); }
[data-skin="classic"] .welcome-banner .wb-sub { opacity: 1; color: var(--text-muted); }
[data-skin="classic"] .welcome-banner .wb-chip { background: var(--bg); border-color: var(--border); color: var(--text); }
[data-skin="classic"] .welcome-banner .btn-light { border: 1px solid var(--border); }
/* Classic design in the small preview of Settings → Appearance */
[data-skin="classic"] .pv-side { border-right: 1px solid var(--border); padding-top: 0; }
[data-skin="classic"] .pv-brand { background: var(--topbar-bg); color: var(--topbar-ink); margin: 0 -6px 6px; padding: 7px 10px; border-bottom: 0; }
[data-skin="classic"] .pv-link.active { background: none; box-shadow: none; color: var(--primary); }
[data-skin="classic"] [data-pv="dark"] .pv-link.active { color: color-mix(in srgb, var(--primary) 45%, white); }
[data-skin="classic"] .pv-top { border-bottom: 0; }
[data-skin="classic"] .pv-title, [data-skin="classic"] .pv-crumb { color: var(--topbar-ink); }
[data-skin="classic"] .pv-banner { background: var(--surface); color: var(--text); border-left: 3px solid var(--primary); box-shadow: var(--shadow-card); }
[data-skin="classic"] .pv-banner b { color: var(--heading); }
[data-skin="classic"] .pv-card { border: 0; }
[data-skin="classic"] .tp-nav-item.active { background: none; box-shadow: none; color: var(--primary); }
[data-skin="classic"][data-bs-theme="dark"] .tp-nav-item.active { color: color-mix(in srgb, var(--primary) 45%, white); }
.pv-th { color: color-mix(in srgb, var(--text) 80%, var(--surface)); }
/* Re-exams: a student's heading row above their failed courses */
.rx-group > td { background: var(--surface-3) !important; color: var(--heading); }
.rx-group .text-muted { color: color-mix(in srgb, var(--text) 75%, var(--surface-3)) !important; }

/* =========================================================
 *  Portals: attendance steps, app-style tiles, bottom tab bar, mobile app page
 * ========================================================= */
.bg-soft-secondary { background: #eceff3; color: #495057; }
[data-bs-theme="dark"] .bg-soft-secondary { background: #2a2f38; color: #c3cad3; }

/* Old-system attendance steps: Class → Date → Mark students */
.att-steps { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.att-steps > * { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem .35rem .4rem; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; }
.att-steps b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--hover); font-size: .75rem; }
.att-steps .on { color: var(--primary); border-color: var(--primary); font-weight: 700; }
.att-steps .on b { background: var(--primary); color: #fff; }
.att-steps .done b { background: #1abc9c; color: #fff; }
.class-tile { display: block; height: 100%; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.class-tile:hover { border-color: var(--primary); box-shadow: var(--shadow-card); transform: translateY(-2px); color: var(--text); }
.class-tile.is-live { border-color: #1abc9c; box-shadow: 0 0 0 3px color-mix(in srgb, #1abc9c 22%, transparent); }
.ct-time { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.ct-code { font-size: 1.15rem; font-weight: 800; color: var(--heading); margin-top: .2rem; }
.ct-code small { font-weight: 500; color: var(--text-muted); font-size: .8rem; }
.ct-title { font-size: .9rem; margin-bottom: .6rem; }
.ct-foot { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: .55rem; }
.ct-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 1.15rem; flex-shrink: 0; }
.att-list { padding: .5rem 0; }
.att-row { display: grid; grid-template-columns: 2rem 38px minmax(0, 1fr) auto; align-items: center; gap: .25rem .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.att-row:last-child { border-bottom: 0; }
.att-no { color: var(--text-muted); font-size: .8rem; text-align: right; }
.att-who { min-width: 0; }
.att-who .fw-semibold { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-pick { display: flex; gap: .3rem; }
.att-pick .ap { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .7rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: .82rem; font-weight: 600; cursor: pointer; user-select: none; transition: background .12s, color .12s, border-color .12s; }
.att-pick .ap:hover { border-color: var(--text-muted); }
.btn-check:checked + .ap-present { background: #1abc9c; border-color: #1abc9c; color: #fff; }
.btn-check:checked + .ap-late { background: #f7b84b; border-color: #f7b84b; color: #2b2100; }
.btn-check:checked + .ap-absent { background: #f1556c; border-color: #f1556c; color: #fff; }
.btn-check:checked + .ap-excused { background: #4fc6e1; border-color: #4fc6e1; color: #062a33; }
.btn-check:focus-visible + .ap { outline: 2px solid var(--primary); outline-offset: 2px; }
.att-pick .ap-note { padding: 0 .6rem; }
.att-pick .ap-short { display: none; font-style: normal; font-weight: 800; }
.att-pick .ap-note.has { color: var(--primary); border-color: var(--primary); }
.att-note { grid-column: 3 / -1; margin-top: .35rem; }
.att-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .75rem 1rem; background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 16px rgba(0, 0, 0, .05); }
.att-savebar .form-control { flex: 1 1 200px; }
.att-count { display: flex; gap: .7rem; font-weight: 600; }
.list-group-item.active-soft { background: var(--primary-soft); }
@media (max-width: 767.98px) {
  .att-row { grid-template-columns: 38px minmax(0, 1fr); padding: .75rem; }
  .att-no { display: none; }
  .att-pick { grid-column: 1 / -1; }
  .att-pick .ap { flex: 1; justify-content: center; padding: 0 .3rem; }
  .att-pick .ap span { display: none; }
  .att-pick .ap-short { display: inline; }
  .att-pick .ap-note { flex: 0 0 44px; }
  .att-note { grid-column: 1 / -1; }
  .att-savebar .btn { flex: 1 1 100%; }
}
@media (min-width: 768px) and (max-width: 1199.98px) { .att-pick .ap span { display: none; } .att-pick .ap-short { display: inline; } }

/* App-style tiles on the portal home pages */
.portal-tiles { display: grid; grid-template-columns: repeat(var(--pt-cols, 8), minmax(0, 1fr)); gap: .75rem; }
.pt-tile { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .9rem .4rem .75rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pt-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); color: var(--text); }
.pt-ic { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 1.35rem; }
.pt-badge { position: absolute; top: -6px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #f1556c; color: #fff; font-size: .7rem; font-weight: 700; line-height: 20px; box-shadow: 0 0 0 2px var(--surface); }
.pt-label { font-size: .8rem; font-weight: 600; line-height: 1.2; }
@media (max-width: 1199.98px) { .portal-tiles { grid-template-columns: repeat(min(var(--pt-cols, 8), 4), minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .portal-tiles { grid-template-columns: repeat(min(var(--pt-cols, 8), 3), minmax(0, 1fr)); } .portal-tiles[style*="--pt-cols:4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .portal-tiles { gap: .5rem; } .pt-tile { padding: .75rem .25rem .6rem; } .pt-ic { width: 44px; height: 44px; font-size: 1.2rem; } .pt-label { font-size: .74rem; } }

/* "Get the app" suggestion */
.app-promo { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border-radius: var(--radius); background: linear-gradient(100deg, var(--primary-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)); }
.app-promo[hidden] { display: none; }
.app-promo .ap-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 1.2rem; flex-shrink: 0; }
.app-promo b { display: block; color: var(--heading); }
.app-promo span:not(.ap-ic) { font-size: .85rem; color: var(--text-muted); }
@media (max-width: 575.98px) { .app-promo { flex-wrap: wrap; } .app-promo .btn { order: 3; flex: 1; } }
.auth-app-link { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px dashed var(--border); color: var(--text); text-decoration: none; }
.auth-app-link:hover { border-color: var(--primary); color: var(--text); }
.auth-app-link > .bi-phone { font-size: 1.4rem; color: var(--primary); }
.auth-app-link span { display: flex; flex-direction: column; line-height: 1.2; }
.auth-app-link small { color: var(--text-muted); }

/* Bottom tab bar (phones) for lecturers, students and parents */
.app-tabbar { display: none; }
@media (max-width: 991.98px) {
  .app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(0, 0, 0, .07); padding-bottom: env(safe-area-inset-bottom); }
  .app-tabbar a, .app-tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; border: 0; background: none; color: var(--text-muted); font-size: .68rem; font-weight: 600; text-decoration: none; }
  .app-tabbar i { font-size: 1.25rem; line-height: 1; }
  .app-tabbar .on { color: var(--primary); }
  .app-tabbar .on i { transform: translateY(-1px); }
  .app-tabbar .on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
  .app-tabbar a { position: relative; }
  body.has-tabbar .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.has-tabbar .att-savebar { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media print { .app-tabbar { display: none !important; } }

/* Get the app page */
.app-public { background: var(--bg); color: var(--text); }
.app-public-bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.app-public-bar strong { color: var(--heading); }
.app-hero { overflow: hidden; background: radial-gradient(circle at 85% 20%, var(--primary-soft), transparent 55%), var(--surface); }
.app-hero .card-body { padding: clamp(1.25rem, 4vw, 2.5rem); }
.app-hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: var(--heading); letter-spacing: -.02em; }
.app-dl { display: inline-flex; align-items: center; text-align: left; border-radius: 14px; padding: .55rem 1.1rem; }
.app-dl i { font-size: 1.6rem; }
.app-dl span { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; }
.app-dl small { font-size: .7rem; font-weight: 500; opacity: .8; }
.app-dl[hidden] { display: none; }
.app-phone { display: inline-block; width: 230px; padding: 10px; border-radius: 36px; background: #1f2329; box-shadow: 0 24px 50px rgba(20, 24, 40, .25); }
.ap-screen { border-radius: 28px; background: #f5f6f8; padding: 14px 12px 0; height: 430px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; text-align: left; color: #343a40; }
.ap-top { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: #343a40; }
.ap-top img { width: 26px; height: 26px; border-radius: 7px; }
.ap-card { background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; font-size: 11px; color: #6c757d; box-shadow: 0 2px 6px rgba(0, 0, 0, .05); }
.ap-card b { font-size: 14px; color: #343a40; }
.ap-card.wide { background: #6658dd; color: #e6e3ff; } .ap-card.wide b { color: #fff; }
.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-grid span { background: #fff; border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .05); }
.ap-grid i { font-size: 18px; color: #6658dd; }
.ap-tabs { margin-top: auto; display: flex; justify-content: space-around; padding: 12px 0 16px; background: #fff; margin-left: -12px; margin-right: -12px; font-size: 18px; color: #98a6ad; }
.ap-tabs i:first-child { color: #6658dd; }
.dl-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 1rem; }
.dl-steps li { counter-increment: s; position: relative; padding: 0 0 .85rem 2.6rem; }
.dl-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .85rem; }
.app-address { padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--hover); }
.app-address code { font-size: .95rem; word-break: break-all; }
.app-qr { width: 180px; max-width: 100%; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.app-qr svg { width: 100%; height: auto; display: block; }
.app-safe > div { display: flex; gap: .8rem; }
.app-safe i { font-size: 1.5rem; color: var(--primary); }
.app-safe b { display: block; color: var(--heading); }
.app-safe span { font-size: .87rem; color: var(--text-muted); }
[data-bs-theme="dark"] .app-tabbar a, [data-bs-theme="dark"] .pt-tile, [data-bs-theme="dark"] .class-tile, [data-bs-theme="dark"] .auth-app-link, [data-bs-theme="dark"] .att-steps a { color: var(--text-muted); }
[data-bs-theme="dark"] .app-tabbar a { color: var(--text-muted) !important; }
[data-bs-theme="dark"] .pt-tile, [data-bs-theme="dark"] .class-tile, [data-bs-theme="dark"] .auth-app-link, [data-bs-theme="dark"] .app-public-bar a.d-flex { color: var(--text) !important; }
[data-bs-theme="dark"] .app-tabbar a.on { color: var(--link) !important; }
[data-bs-theme="dark"] .app-tabbar .on::before { background: var(--link); }
[data-bs-theme="dark"] .app-public-bar a.d-flex { color: var(--text); }

/* Inside the Flutter app the bottom tabs are native, so the web tab bar is hidden */
html.in-app .app-tabbar, html.in-app .app-promo, html.in-app .auth-app-link { display: none !important; }
html.in-app body.has-tabbar .main { padding-bottom: 0; }
html.in-app body.has-tabbar .att-savebar { bottom: 0; }

/* Marks: exam gate cards (scheduled → attendance taken → marks open) */
.gate-card { height: 100%; padding: .85rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #adb5bd; }
.gate-card.is-open { border-left-color: #1abc9c; }
.gate-dot { width: 10px; height: 10px; border-radius: 50%; background: #adb5bd; flex-shrink: 0; }
.gate-card.is-open .gate-dot { background: #1abc9c; box-shadow: 0 0 0 3px color-mix(in srgb, #1abc9c 25%, transparent); }
/* Mobile App settings: live preview of the app colours */
.app-phone-sm { width: 210px; }
.app-phone-sm .ap-screen { height: 380px; padding: 0; gap: 0; }
.pv-screen { background: #f5f6f8; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px; background: var(--pv-bar); color: #fff; font-weight: 800; font-size: 14px; }
.pv-bar img { width: 24px; height: 24px; border-radius: 7px; background: #fff; }
.pv-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pv-hero { border-radius: 14px; padding: 12px; background: var(--pv-primary); color: #fff; display: flex; flex-direction: column; }
.pv-hero small { opacity: .8; font-size: 11px; } .pv-hero b { font-size: 16px; }
.pv-screen .ap-grid i { color: var(--pv-primary); }
.pv-nav { display: flex; justify-content: space-around; padding: 8px 4px 14px; background: var(--pv-nav); border-top: 1px solid rgba(0,0,0,.06); font-size: 10px; color: #8a94a6; }
.pv-nav span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pv-nav i { font-size: 16px; }
.pv-nav .on { color: var(--pv-primary); font-weight: 700; }

/* Inside the app (lecturer, student and parent portals) the app draws the top bar, menu and tabs itself */
html[data-app] body[data-portal="lecturer"] .topbar, html[data-app] body[data-portal="student"] .topbar, html[data-app] body[data-portal="parent"] .topbar,
html[data-app] body[data-portal="lecturer"] .sidebar, html[data-app] body[data-portal="student"] .sidebar, html[data-app] body[data-portal="parent"] .sidebar,
html[data-app] body[data-portal="lecturer"] .app-footer, html[data-app] body[data-portal="student"] .app-footer, html[data-app] body[data-portal="parent"] .app-footer,
html[data-app] body[data-portal="lecturer"] .page-title-head, html[data-app] body[data-portal="student"] .page-title-head, html[data-app] body[data-portal="parent"] .page-title-head,
html[data-app] .sidebar-backdrop, html[data-app] .app-tabbar, html[data-app] .app-promo, html[data-app] .auth-app-link, html[data-app] .theme-switch { display: none !important; }
html[data-app] body[data-portal="lecturer"] .main, html[data-app] body[data-portal="student"] .main, html[data-app] body[data-portal="parent"] .main { margin-left: 0 !important; }
html[data-app] body:not([data-portal="admin"]) .content { padding-top: 14px; }
html[data-app] .welcome-banner, html[data-app] .card { border-radius: 16px; }
@media (max-width: 575.98px) {
  .stat-card { gap: .6rem; padding: .85rem; }
  .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1rem; flex-shrink: 0; }
  .stat-card .stat-value { font-size: 1.2rem; white-space: nowrap; }
  .stat-card .stat-label { font-size: .75rem; }
}

/* Lecturer attendance from the timetable */
.tt-day { padding: .9rem 0 1.1rem; border-bottom: 1px dashed var(--border); }
.tt-day:last-child { border-bottom: 0; padding-bottom: .2rem; }
.tt-day:first-child { padding-top: 0; }
.tt-day-name { font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .7rem; display: flex; align-items: center; gap: .5rem; }
.tt-day.is-today .tt-day-name { color: var(--primary); }
.tt-day.is-today .class-tile { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.ct-venue { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .55rem 0 .65rem; padding: .45rem .6rem; border-radius: calc(var(--radius) - 4px); background: color-mix(in srgb, var(--primary) 9%, transparent); font-size: .82rem; }
.ct-venue i { color: var(--primary); }
.ct-venue span { color: var(--text-muted); }
.ct-venue strong { color: var(--text); }
.att-meta { display: flex; flex-wrap: wrap; gap: .45rem .9rem; font-size: .85rem; color: var(--text-muted); }
.att-venue { padding: .25rem .65rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--primary) 11%, transparent); color: var(--text); }
.att-venue i { color: var(--primary); }

/* Course Offerings — permanent assignment (read-only on edit) */
.locked-assign { border: 1px dashed var(--border); border-radius: var(--radius); padding: .75rem .9rem; background: color-mix(in srgb, var(--primary) 5%, transparent); }
.locked-assign .la-head { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .45rem; }
.locked-assign dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .88rem; }
.locked-assign dt { color: var(--text-muted); font-weight: 600; }
.locked-assign dd { margin: 0; }

/* Results — laid out like the old Banoda system */
.results-head .rh-item { text-align: center; }
.results-head .rh-label { font-size: .75rem; color: var(--text-muted); }
.results-head .rh-value { font-weight: 700; }
.result-year { overflow: hidden; }
.result-year-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; color: #fff;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); }
.ryh-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.2); font-size: 1.15rem; }
.ryh-title { font-size: 1.1rem; font-weight: 700; }
.ryh-sub { font-size: .85rem; opacity: .85; }
.ryh-warn { font-size: .82rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; background: rgba(220, 53, 69, .3); }
.result-stat { border-radius: 12px; padding: 1rem 1.1rem; }
.result-stat .rs-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .25rem; }
.result-stat .rs-value { font-size: 1.6rem; font-weight: 800; }
.result-stat .rs-value small { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.rs-blue { background: color-mix(in srgb, #3b82f6 12%, transparent); } .rs-blue .rs-value { color: #2563eb; }
.rs-green { background: color-mix(in srgb, #22c55e 12%, transparent); } .rs-green .rs-value { color: #16a34a; }
.rs-purple { background: color-mix(in srgb, #a855f7 12%, transparent); } .rs-purple .rs-value { color: #9333ea; }
[data-bs-theme="dark"] .rs-blue .rs-value { color: #93c5fd; } [data-bs-theme="dark"] .rs-green .rs-value { color: #86efac; } [data-bs-theme="dark"] .rs-purple .rs-value { color: #d8b4fe; }

/* Transcript entry: a subject just moved to another semester */
.txe-row.txe-moved > td { background: color-mix(in srgb, var(--primary) 14%, transparent) !important; transition: background .4s; }
.rs-orange { background: color-mix(in srgb, #f97316 12%, transparent); } .rs-orange .rs-value { color: #ea580c; }
[data-bs-theme="dark"] .rs-orange .rs-value { color: #fdba74; }
