/* =====================================================================
   Infinity SMS - design system
   ONE set of sizes, colours and spacing used by every screen.
   Change a value in :root and the whole system follows.
   ===================================================================== */
:root {
  /* colours */
  --navy-950: #0b1d3a;
  --navy-900: #102a52;
  --brand: #1a3c6e;
  --brand-600: #1f4a8a;
  --brand-100: #e4ecf8;
  --brand-50: #f2f6fc;
  --accent: #2a78d6;
  --ink: #1c2433;
  --ink-2: #44506a;
  --muted: #6b7686;
  --line: #e2e7f0;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --line-strong: #d3dbe8;
  --btn-line: #c9d6ea;
  --track: #e8edf5;
  --bg: #f3f5fa;
  --ok: #138a4f;      --ok-bg: #e2f5ea;
  --warn: #a96400;    --warn-bg: #fdf0d5;
  --bad: #c0392b;     --bad-bg: #fbe5e2;
  --info: #1f62b5;    --info-bg: #e3eefb;
  --neutral: #5a6578; --neutral-bg: #eceff4;

  /* sizes (use these everywhere) */
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-base: 14px;
  --fs-small: 12.5px;
  --fs-title: 22px;
  --r-card: 14px;
  --r-ctl: 10px;
  --ctl-h: 40px;
  --ctl-h-sm: 32px;
  --gap: 16px;
  --pad: 20px;
  --appbar-h: 60px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 82, .06), 0 2px 10px rgba(16, 42, 82, .05);
  --shadow-md: 0 8px 28px rgba(16, 42, 82, .14);

  /* Bootstrap hooks */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: var(--fs-base);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-primary: var(--brand-600);
  --bs-primary-rgb: 31, 74, 138;
  --bs-link-color: var(--brand-600);
  --bs-link-hover-color: var(--brand);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--r-ctl);
  --bs-heading-color: var(--ink);
}

html { font-size: var(--fs-base); }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: var(--fs-base); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }
small, .small { font-size: var(--fs-small); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }
.text-muted { color: var(--muted) !important; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- consistent gaps ---------- */
.row.g-2, .row.g-3, .row.g-4 { --bs-gutter-x: var(--gap); --bs-gutter-y: var(--gap); }
.mb-3, .mb-4 { margin-bottom: var(--gap) !important; }
.stack > * + * { margin-top: var(--gap); }

/* =====================================================================
   App bar (top of every screen after login)
   ===================================================================== */
.app-bar { position: sticky; top: 0; z-index: 1030; height: var(--appbar-h); display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: linear-gradient(90deg, var(--navy-950), var(--brand)); color: #fff; box-shadow: 0 2px 12px rgba(11, 29, 58, .25); }
.app-brand { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; }
.app-brand:hover { color: #fff; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.brand-text span { display: block; font-size: 11.5px; opacity: .75; }
.app-bar .spacer { flex: 1; }
/* Menu / Dashboard switch: two halves of exactly the same width */
.seg { display: inline-grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 4px; gap: 4px; }
.seg a { color: rgba(255, 255, 255, .85); padding: 7px 18px; min-width: 140px; border-radius: 999px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg a:hover { color: #fff; text-decoration: none; }
.seg a.active { background: var(--surface); color: var(--brand); }
.account-btn { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; height: 44px; }
.account-btn:hover, .account-btn.show { background: rgba(255, 255, 255, .22); color: #fff; }
.account-btn .who { text-align: left; line-height: 1.15; max-width: 190px; }
.account-btn .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-btn .who span { display: block; font-size: 11px; opacity: .75; }
.account-btn .avatar-initials { background: var(--surface); color: var(--brand); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 8px; font-size: var(--fs-base); }
.dropdown-item { border-radius: 8px; padding: 9px 12px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.dropdown-item.text-danger:hover { background: var(--bad-bg); }
.account-menu { min-width: 260px; }
.account-menu .head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-menu .head strong { display: block; }
.account-menu .head span { color: var(--muted); font-size: var(--fs-small); }

.app-main { max-width: 1600px; margin: 0 auto; padding: 24px 28px 48px; }
body.login-page .app-main, .app-main.bare { max-width: none; padding: 0; }
@media (max-width: 767px) { .app-bar { padding: 0 14px; } .app-main { padding: 18px 14px 40px; } .brand-text span, .account-btn .who { display: none; } .account-btn { padding-right: 4px; } }

/* =====================================================================
   Page header (title, back / home buttons, actions)
   ===================================================================== */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-title { font-size: var(--fs-title); font-weight: 800; margin: 0; color: var(--ink); line-height: 1.2; }
.page-sub { color: var(--muted); margin: 2px 0 0; font-size: 13px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.icon-btn { width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--line); color: var(--brand); display: inline-grid; place-items: center; font-size: 18px; flex: none; }
.icon-btn:hover { background: var(--brand-50); border-color: var(--brand-100); text-decoration: none; color: var(--brand); }

/* =====================================================================
   Buttons / forms
   ===================================================================== */
.btn { min-height: var(--ctl-h); padding: .45rem 1.05rem; border-radius: var(--r-ctl); font-weight: 600; font-size: var(--fs-base); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-sm { min-height: var(--ctl-h-sm); padding: .2rem .7rem; font-size: 12.5px; border-radius: 8px; }
.btn-lg { min-height: 46px; font-size: 15px; }
.btn-brand, .btn-primary { --bs-btn-bg: var(--brand-600); --bs-btn-border-color: var(--brand-600); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--brand-600); --bs-btn-disabled-border-color: var(--brand-600);
  background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-brand:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-outline-primary, .btn-outline-secondary { --bs-btn-color: var(--brand-600); --bs-btn-border-color: var(--btn-line); --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-color: var(--brand);
  --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-100); --bs-btn-active-color: var(--brand); --bs-btn-active-border-color: var(--brand-600); background: var(--surface); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); }
.btn-outline-danger { background: var(--surface); }
.btn-light { --bs-btn-bg: var(--surface); border-color: var(--line); }
.form-label { font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.form-control, .form-select { height: var(--ctl-h); border-radius: var(--r-ctl); border: 1px solid var(--line-strong); font-size: var(--fs-base); color: var(--ink); background-color: var(--surface); padding: .4rem .85rem; }
textarea.form-control { height: auto; min-height: 88px; }
.form-control-sm, .form-select-sm { height: var(--ctl-h-sm); font-size: 12.5px; border-radius: 8px; }
.form-control-lg { height: 46px; font-size: 15px; }
.form-control::placeholder { color: #97a2b5; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 120, 214, .16); }
.form-text { font-size: var(--fs-small); color: var(--muted); }
.form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }
.input-group > .form-control, .input-group > .btn { height: var(--ctl-h); }

/* searchable dropdowns (Tom Select) look like normal fields */
.ts-wrapper { width: 100%; }
.ts-control { min-height: var(--ctl-h); border-radius: var(--r-ctl) !important; border: 1px solid var(--line-strong) !important; padding: .35rem .85rem !important; font-size: var(--fs-base); align-items: center; box-shadow: none !important; }
.ts-wrapper.focus .ts-control { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(42, 120, 214, .16) !important; }
.ts-control > input::placeholder, .ts-control .item + input::placeholder { color: #97a2b5; }
.ts-wrapper.single .ts-control { cursor: pointer; }
.ts-wrapper.single .ts-control > input { width: 4px !important; }
.ts-wrapper.single:not(.has-items) .ts-control > input { width: 100% !important; min-width: 4rem; }
.ts-dropdown { z-index: 2100; border-radius: 12px !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow-md); overflow: hidden; margin-top: 6px; }
.ts-dropdown .dropdown-input-wrap { padding: 10px 10px 4px; }
.ts-dropdown .dropdown-input { height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); padding: 0 12px; font-size: 13px; width: 100%; }
.ts-dropdown .dropdown-input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(42, 120, 214, .16); }
.ts-dropdown .option { padding: 9px 14px; }
.ts-dropdown .active { background: var(--brand-50); color: var(--brand); }
.ts-dropdown .no-results { padding: 12px 14px; color: var(--muted); }
.ts-dropdown .option.disabled { color: #9aa5b8; }
.ts-wrapper.multi .ts-control > div { background: var(--brand-100); color: var(--brand); border-radius: 6px; border: 0; }
.ts-wrapper .clear-button { right: 34px !important; }

/* =====================================================================
   Cards, tables, pills
   ===================================================================== */
.card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-sm); }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-body { padding: var(--pad); }
.card-header, .card-header-brand { background: transparent; color: var(--ink); font-weight: 700; font-size: 15px; padding: 16px var(--pad); border-bottom: 1px solid var(--line); border-radius: var(--r-card) var(--r-card) 0 0 !important; }
.card-footer { background: transparent; border-top: 1px solid var(--line); padding: 12px var(--pad); border-radius: 0 0 var(--r-card) var(--r-card) !important; }
.list-group-item { border-color: var(--line); padding: 12px var(--pad); }
.list-group-flush > .list-group-item { border-width: 0 0 1px; }
.card .list-group { border-radius: 0 0 var(--r-card) var(--r-card); }

.table { --bs-table-bg: transparent; --bs-table-striped-bg: transparent; --bs-table-hover-bg: var(--brand-50); margin-bottom: 0; color: var(--ink); }
.table > :not(caption) > * > * { padding: 13px 16px; border-bottom-color: var(--line); vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: 9px 14px; }
.table thead th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .02em; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table thead th:first-child { border-top-left-radius: var(--r-card); }
.table thead th:last-child { border-top-right-radius: var(--r-card); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody th { font-weight: 600; color: var(--ink-2); }
.form-body > .form-section:not(:first-child), .form-card .form-body > .form-section + .row ~ .form-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; }
.table tfoot td { background: var(--surface-2); }
.table .table-light, .table-light { --bs-table-bg: var(--surface-2); }
tr[data-panel] { cursor: pointer; }
tr[data-panel]:hover td { background: var(--brand-50); }
tr.row-open td { background: var(--brand-100) !important; }
.table-responsive { border-radius: var(--r-card); }

/* status pills (every Bootstrap "badge" becomes a soft pill) */
.badge { font-weight: 700; font-size: 11.5px; border-radius: 999px; padding: .38em .85em; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.no-dot::before { display: none; }
.badge.text-bg-success, .badge.bg-success { background: var(--ok-bg) !important; color: var(--ok) !important; }
.badge.text-bg-danger, .badge.bg-danger { background: var(--bad-bg) !important; color: var(--bad) !important; }
.badge.text-bg-warning, .badge.bg-warning { background: var(--warn-bg) !important; color: var(--warn) !important; }
.badge.text-bg-primary, .badge.text-bg-info, .badge.bg-primary, .badge.bg-info { background: var(--info-bg) !important; color: var(--info) !important; }
.badge.text-bg-secondary, .badge.bg-secondary, .badge.text-bg-light, .badge.bg-light, .badge.text-bg-dark { background: var(--neutral-bg) !important; color: var(--neutral) !important; }
.alert { border-radius: 12px; border: 0; padding: 12px 16px; }
.alert-success { background: var(--ok-bg); color: #0f6b3d; }
.alert-danger { background: var(--bad-bg); color: #9b2c20; }
.alert-warning { background: var(--warn-bg); color: #7a4800; }
.alert-info { background: var(--info-bg); color: #184f93; }
.progress { --bs-progress-bar-bg: var(--brand-600); height: 8px; border-radius: 999px; background: var(--track); }
.progress-bar { border-radius: 999px; }

.nav-tabs { border-bottom: 1px solid var(--line); gap: 6px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; padding: 10px 14px; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--brand); }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand-600); background: transparent; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.nav-pills .nav-link.active { background: var(--brand-600); }

/* avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initials { background: var(--brand-100); color: var(--brand); font-weight: 700; }

.profile-card .card-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-card .facts { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; color: var(--ink-2); }
.profile-card .facts i { color: var(--muted); margin-right: 4px; }

/* messages (toasts) */
#toastArea { position: fixed; top: calc(var(--appbar-h) + 14px); right: 20px; z-index: 2200; width: min(420px, calc(100vw - 40px)); display: flex; flex-direction: column; gap: 10px; }
#toastArea .alert { box-shadow: var(--shadow-md); margin: 0; padding-right: 44px; }
body.no-appbar #toastArea { top: 20px; }

/* =====================================================================
   Toolbar, filter chips, pager
   ===================================================================== */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search-box { position: relative; flex: 1; min-width: 240px; max-width: 560px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 40px; }
.toolbar .spacer { flex: 1; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; min-height: 0; }
.filter-chips:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-100); color: var(--brand); border-radius: 999px; padding: 5px 8px 5px 14px; font-size: 12.5px; font-weight: 600; }
.fchip button { border: 0; background: rgba(26, 60, 110, .12); color: var(--brand); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; padding: 0; }
.fchip button:hover { background: rgba(26, 60, 110, .25); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group input { position: absolute; opacity: 0; pointer-events: none; }
.chip-group label { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 16px; font-weight: 600; font-size: 13px; cursor: pointer; background: var(--surface); color: var(--ink-2); }
.chip-group label:hover { border-color: var(--brand-600); }
.chip-group input:checked + label { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.chip-group input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.table-footer { display: flex; align-items: center; gap: 16px; padding: 12px var(--pad); border-top: 1px solid var(--line); flex-wrap: wrap; }
.table-footer .count { color: var(--muted); font-size: 13px; }
.table-footer .sp { flex: 1; }
.table-footer .per { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.table-footer .per select { width: auto; min-width: 74px; height: var(--ctl-h-sm); font-size: 12.5px; }
.pager { display: inline-flex; gap: 6px; align-items: center; }
.pager button, .pager a { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; display: inline-grid; place-items: center; padding: 0 8px; }
.pager button:hover:not([disabled]) { border-color: var(--brand-600); color: var(--brand); text-decoration: none; }
.pager .on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pager [disabled] { opacity: .45; cursor: default; }
.pager .dots { color: var(--muted); padding: 0 2px; }

/* =====================================================================
   Menu (home) and module pages
   ===================================================================== */
body.menu-page { background: radial-gradient(1200px 600px at 80% -10%, #25518f 0%, transparent 60%), linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, #17407a 100%); min-height: 100vh; background-attachment: fixed; }
body.menu-page .app-bar { background: transparent; box-shadow: none; }
.menu-hello { color: #fff; margin: 8px 0 26px; }
.menu-hello h1 { font-size: 26px; font-weight: 800; margin: 0; color: #fff; }
.menu-hello p { margin: 4px 0 0; color: rgba(255, 255, 255, .72); }
/* small tiles: icon + one short name (the description is the tooltip) */
/* menu tiles: equal size, centred, the same space on the left and the right */
.menu-wrap { max-width: 1010px; margin: 0 auto; }
.menu-grid { display: grid; gap: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 640px) { .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.menu-tile { background: var(--surface); border-radius: 16px; padding: 20px 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; min-height: 176px; color: var(--ink); box-shadow: 0 6px 18px rgba(5, 15, 35, .2); transition: transform .16s ease, box-shadow .16s ease; position: relative; }
@media (max-width: 640px) { .menu-tile { min-height: 130px; gap: 12px; } }
.menu-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(5, 15, 35, .3); text-decoration: none; color: var(--ink); }
.menu-tile .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 25px; flex: none; }
.task-tile .ico { width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; flex: none; }
.menu-tile h3 { font-size: 17px; margin: 0; font-weight: 600; line-height: 1.25; }
.menu-foot { color: rgba(255, 255, 255, .55); font-size: 12.5px; text-align: center; margin-top: 28px; }

/* icon colour families, used by tiles everywhere */
.c-blue { background: #e3eefb; color: #1f62b5; }
.c-teal { background: #dff4f1; color: #0f7d72; }
.c-violet { background: #ece8fb; color: #5b3fc4; }
.c-orange { background: #fdeadc; color: #c4561a; }
.c-green { background: #e2f5ea; color: #138a4f; }
.c-rose { background: #fbe4ec; color: #b8325f; }
.c-amber { background: #fdf0d5; color: #a96400; }
.c-slate { background: #e8ecf3; color: #44506a; }
.c-indigo { background: #e6e9fb; color: #3949ab; }

.section-title { font-size: 14px; font-weight: 700; color: var(--muted); margin: 26px 0 12px; letter-spacing: .02em; }
.section-title:first-of-type { margin-top: 4px; }
/* area pages (Students, Fees ...): big task tiles, 3 in a row on a laptop */
.task-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 899px) { .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .task-grid { grid-template-columns: minmax(0, 1fr); } }
.task-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; display: flex; gap: 18px; align-items: center; color: var(--ink); min-height: 124px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.task-tile:hover { border-color: var(--brand-600); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; color: var(--ink); }
.task-tile h4 { font-size: 17px; font-weight: 700; margin: 0; }
.task-tile p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.4; }

/* =====================================================================
   Dashboard
   ===================================================================== */
/* small dashboard tiles */
/* dashboard tiles: 6 in a row on a laptop, 4 on a small screen, 2 on a phone */
.kpi-grid, .kpi-grid.cols-3 { display: grid; gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: var(--gap); }
@media (max-width: 1199px) { .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px) { .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; color: var(--ink); position: relative; overflow: hidden; min-height: 128px; }
a.kpi { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi[href]:hover { border-color: var(--brand-600); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; color: var(--ink); }
.kpi-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kpi .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; flex: none; }
.kpi .label { color: var(--muted); font-weight: 600; font-size: 12.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.kpi .value.money { font-size: 20px; }
.kpi .progress { height: 6px; position: relative; z-index: 1; }
.kpi .progress-bar { animation: kpi-grow 1.1s ease-out both; }
@keyframes kpi-grow { from { width: 0; } }
.kpi .sub { color: var(--muted); font-size: 12px; line-height: 1.3; position: relative; z-index: 1; max-width: 62%; }
.kpi:not(:has(.spark-box)) .sub { max-width: none; }
.kpi .sub b { color: var(--ink); }
.kpi .trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.kpi .trend.up { background: var(--ok-bg); color: var(--ok); }
.kpi .trend.down { background: var(--bad-bg); color: var(--bad); }
.kpi .spark-box { position: absolute; right: 0; bottom: 0; width: 48%; height: 46px; opacity: .85; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .kpi .progress-bar { animation: none; } }
.kpi.danger { border-color: #f1c4be; }
.kpi.danger .value { color: var(--bad); }
.dash-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head .titles { flex: 1; min-width: 240px; }
.dash-head form { display: flex; gap: 10px; align-items: center; }
.dash-head .form-select { width: 190px; }
.dash-title { margin: 0; font-size: var(--fs-title); font-weight: 800; }
.updated { color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.updated::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1fb26b; box-shadow: 0 0 0 0 rgba(31, 178, 107, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(31, 178, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 178, 107, 0); } }
.dash-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: var(--gap); }
.dash-grid > .span-4 { grid-column: span 4; } .dash-grid > .span-5 { grid-column: span 5; } .dash-grid > .span-6 { grid-column: span 6; }
.dash-grid > .span-7 { grid-column: span 7; } .dash-grid > .span-8 { grid-column: span 8; } .dash-grid > .span-12 { grid-column: span 12; }
@media (max-width: 1099px) { .dash-grid > * { grid-column: span 12 !important; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; }
.panel-head { padding: 16px var(--pad); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel-head h3 { font-size: 15px; margin: 0; font-weight: 700; flex: 1; }
.panel-head .hint { color: var(--muted); font-size: 12.5px; }
.panel-body { padding: var(--pad); flex: 1; min-width: 0; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.donut-wrap .chart-box { width: 210px; height: 210px; flex: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 26px; font-weight: 800; line-height: 1; }
.donut-center span { color: var(--muted); font-size: 12px; }
.legend-list { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 160px; }
.legend-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-list b { margin-left: auto; font-variant-numeric: tabular-nums; }
.fill-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) 2fr 54px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.fill-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fill-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-table { margin-top: 10px; font-size: 12.5px; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.chart-table table { width: 100%; margin-top: 6px; }
.chart-table th, .chart-table td { padding: 3px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.rise > * { animation: rise .5s ease both; }
.rise > *:nth-child(2) { animation-delay: .06s; } .rise > *:nth-child(3) { animation-delay: .12s; } .rise > *:nth-child(4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise > *, .updated::before, .menu-tile, .task-tile, .kpi { animation: none !important; transition: none !important; } }

/* =====================================================================
   Report tiles
   ===================================================================== */
.report-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199px) { .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .report-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
.report-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px var(--pad); display: flex; align-items: center; gap: 14px; color: var(--ink); min-height: 112px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.report-tile:hover { border-color: var(--brand-600); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; color: var(--ink); }
.report-tile .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; }
.report-tile b { font-size: 14px; display: block; line-height: 1.3; }
.report-tile small { color: var(--muted); }

/* =====================================================================
   Side panel (opens when a row is clicked)
   ===================================================================== */
.offcanvas.side-panel { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-width: 540px; border-left: 0; box-shadow: -12px 0 40px rgba(16, 42, 82, .2); }
.side-panel .offcanvas-body { padding: 0; display: flex; flex-direction: column; }
.sp-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.sp-head .titles { flex: 1; min-width: 0; }
.sp-head h3 { font-size: 18px; margin: 0 0 2px; font-weight: 800; overflow-wrap: anywhere; }
.sp-head p { margin: 0; color: var(--muted); font-size: 13px; }
.sp-tabs { padding: 0 24px; }
.sp-body { padding: 20px 24px; flex: 1; overflow-y: auto; }
.sp-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; background: var(--surface-2); }
.sp-section { margin-bottom: 22px; }
.sp-section h4 { font-size: 13px; color: var(--muted); font-weight: 700; margin: 0 0 8px; letter-spacing: .02em; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv > div { padding: 10px 14px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 13px; }
.sp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.sp-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.sp-stat span { color: var(--muted); font-size: 12px; display: block; }
.sp-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.sp-loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* =====================================================================
   Modals / pop-up forms: title + subtitle, labelled fields, footer buttons
   ===================================================================== */
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-md); }
.modal-header { border-bottom: 1px solid var(--line); padding: 20px 24px 16px; align-items: flex-start; gap: 12px; }
.modal-title { font-size: 18px; font-weight: 800; }
.modal-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 20px 24px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 24px; gap: 10px; }
.modal-footer > * { margin: 0; }
.modal-footer .btn { min-width: 110px; }
.modal-backdrop.show { opacity: .5; }
.btn-close { opacity: .55; }

/* full-page forms use the same look as pop-ups */
.form-page { max-width: 1180px; margin: 0 auto; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.form-card > .form-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.form-card > .form-body { padding: 20px 24px; }
.form-card > .form-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--r-card) var(--r-card); }
.form-section { font-size: 13px; font-weight: 700; color: var(--muted); margin: 6px 0 12px; letter-spacing: .02em; }

/* confirmation window (log out, delete ...) */
.confirm-overlay { position: fixed; inset: 0; background: rgba(11, 29, 58, .55); z-index: 2300; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: confirm-fade .15s ease-out; }
.confirm-box { background: var(--surface); border-radius: 18px; max-width: 420px; width: 100%; padding: 28px 28px 22px; text-align: center; box-shadow: var(--shadow-md); }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 26px; background: var(--brand-100); color: var(--brand); }
.confirm-icon.is-danger { background: var(--bad-bg); color: var(--bad); }
.confirm-title { font-weight: 800; margin-bottom: .35rem; font-size: 18px; }
.confirm-text { color: var(--ink-2); margin-bottom: 1.3rem; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { flex: 1; }
@keyframes confirm-fade { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   Roles and access (permission matrix)
   ===================================================================== */
.perm-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.perm-matrix { width: 100%; border-collapse: collapse; }
.perm-matrix th, .perm-matrix td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.perm-matrix thead th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.perm-matrix thead th:first-child, .perm-matrix td:first-child { text-align: left; }
.perm-matrix td:not(:first-child) { text-align: center; width: 110px; }
.perm-matrix tbody tr:last-child td { border-bottom: 0; }
.perm-matrix .mod { font-weight: 600; }
.perm-matrix .mod small { display: block; color: var(--muted); font-weight: 400; }
.perm-matrix .na { color: #c3cbd9; }
.perm-matrix input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand-600); cursor: pointer; }
.perm-matrix input[disabled] { cursor: not-allowed; opacity: .7; }
.perm-matrix thead label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.perm-matrix .grp td { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }

/* =====================================================================
   Login (split screen)
   ===================================================================== */
body.login-page { background: var(--surface); }
.login-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { position: relative; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 15% 0%, #2d5da3 0%, transparent 60%), linear-gradient(155deg, var(--navy-950), var(--navy-900) 60%, #1b4684); overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; border: 70px solid rgba(255, 255, 255, .06); }
.login-art::before { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; left: -90px; bottom: 120px; border: 44px solid rgba(255, 255, 255, .05); }
.login-art h2 { font-size: 38px; line-height: 1.15; font-weight: 800; max-width: 460px; margin: 0 0 14px; color: #fff; }
.login-art p { max-width: 440px; color: rgba(255, 255, 255, .75); font-size: 15px; }
.login-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.login-points li { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .88); }
.login-points i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.login-form-side { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 400px; }
.login-card .login-logo { display: block; width: 112px; height: 112px; border-radius: 50%; margin: 0 0 18px; object-fit: contain; background: var(--surface); box-shadow: 0 6px 20px rgba(11, 29, 58, .12); }
.login-card h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.login-card .lead { color: var(--muted); margin-bottom: 26px; font-size: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 46px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; }
.pw-wrap button:hover { background: var(--brand-50); color: var(--brand); }
@media (max-width: 899px) { .login-split { grid-template-columns: 1fr; } .login-art { display: none; } }

/* print */
@media print { .app-bar, .no-print, .page-head .actions, .toolbar, #toastArea { display: none !important; } body { background: var(--surface); } .app-main { padding: 0; max-width: none; } .card { box-shadow: none; } }

/* =====================================================================
   Summary cards (fees, teacher accounts) + success button
   ===================================================================== */
.stat-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: var(--gap); }
.stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1199px) { .stat-grid, .stat-grid.cols-4, .stat-grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .stat-grid, .stat-grid.cols-4, .stat-grid.cols-3, .stat-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px var(--pad); box-shadow: var(--shadow-sm); min-height: 84px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: block; margin-bottom: 6px; }
.stat .value { font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .value.ok { color: var(--ok); } .stat .value.bad { color: var(--bad); } .stat .value.brand { color: var(--brand); }
.btn-success, .btn-success:focus { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-success:hover, .btn-success:active { background: var(--brand); border-color: var(--brand); color: #fff; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-gap { margin-bottom: var(--gap); }

/* inline filter bar used on pages whose filters depend on each other (attendance, timetable, reports) */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px var(--pad); box-shadow: var(--shadow-sm); margin-bottom: var(--gap); }
.filter-bar > .f { flex: 1 1 190px; min-width: 160px; max-width: 320px; }
.filter-bar > .f.wide { flex-basis: 320px; max-width: 460px; }
.filter-bar > .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar .form-label { margin-bottom: 6px; }
.tt-week { display: grid; gap: 12px; grid-template-columns: repeat(7, minmax(160px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
.tt-week.one-day { grid-template-columns: minmax(0, 520px); }
.tt-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); min-width: 0; }
.tt-day.is-empty { opacity: .7; }
.tt-slot .nm { font-weight: 600; }
.tt-slot .who { color: var(--muted); font-size: 12px; }
.tt-day > h6 { margin: 0; padding: 12px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); color: var(--brand); }
.tt-day .slots { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tt-slot { border-left: 3px solid var(--brand-600); background: var(--brand-50); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; }
.tt-slot.cancelled { border-left-color: #9aa5b8; background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.tt-slot b { font-size: 13px; }

.empty-state { max-width: 460px; margin: 8vh auto 0; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 40px 32px; box-shadow: var(--shadow-sm); }
.empty-state .ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; margin: 0 auto 16px; }
.empty-state h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.page-head + .section-title { margin-top: 4px; }
.flex-none { flex: none; }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-action-hover-bg: var(--brand-50); }
.ts-wrapper.single .ts-control { height: var(--ctl-h); } .ts-wrapper.form-select { height: var(--ctl-h); min-height: var(--ctl-h); }

/* =====================================================================
   Added in the October 2026 update
   ===================================================================== */
/* institute logo */
.brand-logo { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); object-fit: contain; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.login-art .brand-logo { width: 44px; height: 44px; }
@media (max-width: 575px) { .app-bar { padding: 0 12px; gap: 8px; } .brand-text { display: none; } .seg a { padding: 6px 10px; } .account-btn .who { display: none; } .account-btn { padding: 4px; } }

/* month picker (two drop-downs) */
.month-picker { display: flex; gap: 6px; }
.month-picker .form-select:first-child { flex: 1.4 1 0; min-width: 120px; }
.month-picker .form-select:last-child { flex: 1 1 0; min-width: 90px; }
.month-picker.compact .form-select:first-child { min-width: 128px; }
.month-picker.compact .form-select:last-child { min-width: 92px; }

/* buttons that are busy (after a click, until the answer arrives) */
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy .spinner-border { width: 1em; height: 1em; border-width: .15em; margin-right: 6px; vertical-align: -2px; }

/* filter errors */
.filter-error { color: var(--bad); font-size: 13px; margin-top: 6px; }

/* toast with a link */
#toastArea .alert a.toast-link { font-weight: 700; margin-left: 6px; }

/* calendar */
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); min-width: 840px; }
.cal-head { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-date, .cal-day.out .cal-item { opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--brand-600); }
.cal-day.holiday { background: #fff6f6; }
.cal-date { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; }
.cal-add { border: 0; background: transparent; color: var(--muted); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-add:hover { background: var(--brand-50); color: var(--brand); }
@media (hover: none) { .cal-add { opacity: 1; } }
.cal-item { font-size: 11.5px; line-height: 1.3; background: var(--brand-50); border-left: 3px solid var(--brand-600); border-radius: 6px; padding: 3px 6px; overflow: hidden; }
.cal-item .who { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.cancelled { background: var(--surface-2); border-left-color: #9aa5b8; color: var(--muted); text-decoration: line-through; }
.cal-off { font-size: 11.5px; background: var(--bad-bg); color: var(--bad); border-radius: 6px; padding: 3px 6px; display: flex; align-items: flex-start; gap: 4px; }
.cal-x { border: 0; background: transparent; color: inherit; margin-left: auto; padding: 0 2px; line-height: 1; }

/* roles and access pop-up */
.perm-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.perm-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.perm-group-head label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.perm-items { padding: 6px 4px; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 10px; border-radius: 8px; cursor: pointer; margin: 0; }
.perm-item:hover { background: var(--brand-50); }
.perm-item[hidden] { display: none; }
.perm-item input, .perm-group-head input { width: 17px; height: 17px; accent-color: var(--brand-600); margin-top: 2px; flex: none; }
.perm-name { font-weight: 600; font-size: 13.5px; display: block; }
.perm-item small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }

/* =====================================================================
   Dark mode (Settings > Look and feel, or the account menu). Only the colour tokens change.
   ===================================================================== */
:root[data-bs-theme="dark"] {
  --brand: #3f72c4;
  --brand-600: #4a80d6;
  --brand-100: #22365a;
  --brand-50: #1a2a46;
  --accent: #6aa4ff;
  --ink: #e4eaf4;
  --ink-2: #c2cbdb;
  --muted: #94a1b6;
  --line: #2a3a55;
  --line-strong: #34476a;
  --btn-line: #3a5078;
  --track: #2a3a55;
  --surface: #15213a;
  --surface-2: #1a2843;
  --bg: #0d1628;
  --ok: #4cc98a;      --ok-bg: rgba(76, 201, 138, .14);
  --warn: #f2b84b;    --warn-bg: rgba(242, 184, 75, .14);
  --bad: #ff7b6e;     --bad-bg: rgba(255, 123, 110, .14);
  --info: #7fb2ff;    --info-bg: rgba(127, 178, 255, .14);
  --neutral: #aab4c4; --neutral-bg: rgba(170, 180, 196, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .45);
  --bs-primary-rgb: 74, 128, 214;
  --bs-link-color: #8db8ff;
  --bs-link-hover-color: #b3d0ff;
  --bs-link-color-rgb: 141, 184, 255;
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-emphasis-color: #fff;
  color-scheme: dark;
}
[data-bs-theme="dark"] .text-brand { color: #8db8ff !important; }
[data-bs-theme="dark"] .c-blue { background: rgba(42, 120, 214, .18); color: #8db8ff; }
[data-bs-theme="dark"] .c-teal { background: rgba(20, 149, 138, .2); color: #5fd4c7; }
[data-bs-theme="dark"] .c-violet { background: rgba(91, 63, 196, .22); color: #b3a2ff; }
[data-bs-theme="dark"] .c-orange { background: rgba(196, 86, 26, .2); color: #ffab7a; }
[data-bs-theme="dark"] .c-green { background: rgba(19, 138, 79, .2); color: #6fdca2; }
[data-bs-theme="dark"] .c-rose { background: rgba(184, 50, 95, .22); color: #ff8fb4; }
[data-bs-theme="dark"] .c-amber { background: rgba(169, 100, 0, .22); color: #ffc766; }
[data-bs-theme="dark"] .c-indigo { background: rgba(57, 73, 171, .25); color: #a9b4ff; }
[data-bs-theme="dark"] .c-slate { background: rgba(170, 180, 196, .14); color: #c2cbdb; }
[data-bs-theme="dark"] .tt-day > h6, [data-bs-theme="dark"] .dash-title, [data-bs-theme="dark"] .page-title { color: var(--ink); }
[data-bs-theme="dark"] .tt-day > h6 { color: #8db8ff; }
[data-bs-theme="dark"] .seg a.active { background: var(--surface); color: #8db8ff; }
[data-bs-theme="dark"] .account-btn .avatar-initials { background: var(--surface); color: #8db8ff; }
[data-bs-theme="dark"] .alert-info { --bs-alert-bg: var(--info-bg); --bs-alert-color: var(--info); --bs-alert-border-color: transparent; }
[data-bs-theme="dark"] .alert-warning { --bs-alert-bg: var(--warn-bg); --bs-alert-color: var(--warn); --bs-alert-border-color: transparent; }
[data-bs-theme="dark"] .alert-danger { --bs-alert-bg: var(--bad-bg); --bs-alert-color: var(--bad); --bs-alert-border-color: transparent; }
[data-bs-theme="dark"] .alert-success { --bs-alert-bg: var(--ok-bg); --bs-alert-color: var(--ok); --bs-alert-border-color: transparent; }
[data-bs-theme="dark"] .ts-dropdown, [data-bs-theme="dark"] .ts-control, [data-bs-theme="dark"] .ts-control input { background: var(--surface) !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .ts-dropdown .active { background: var(--brand-50) !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div { background: var(--brand-100); color: var(--ink); }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-select:disabled { background-color: var(--surface-2); color: var(--muted); }
[data-bs-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-bs-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.85); }
[data-bs-theme="dark"] body.login-page, [data-bs-theme="dark"] .login-form-side { background: var(--surface); }
[data-bs-theme="dark"] .cal-day.holiday { background: rgba(255, 123, 110, .08); }
[data-bs-theme="dark"] .cal-item.cancelled, [data-bs-theme="dark"] .tt-slot.cancelled { background: var(--surface-2); }
[data-bs-theme="dark"] .text-bg-light { background: var(--surface-2) !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .bg-light { background: var(--surface-2) !important; }
[data-bs-theme="dark"] .empty-state, [data-bs-theme="dark"] .confirm-box { background: var(--surface); color: var(--ink); }
[data-bs-theme="dark"] .menu-tile h3, [data-bs-theme="dark"] .task-tile h4 { color: var(--ink); }

/* =====================================================================
   October 2026 (2): forms in numbered blocks, timetable for teachers, settings switches, account photo
   ===================================================================== */
.form-block { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; margin-bottom: 16px; background: var(--surface); }
.form-block-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.form-block-title .num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; }
.form-block .form-label { font-size: 13px; }
.kind-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 575px) { .kind-choice { grid-template-columns: 1fr; } }
.kind-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0; }
.kind-option:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }
.kind-option input { margin-top: 3px; }
.kind-option small { display: block; color: var(--muted); font-size: 12px; }
.busy-times { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 4px; }
.busy-times summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--brand-600); }
.busy-times table { margin-top: 8px; font-size: 12.5px; }
.tt-slot.extra { border-left-color: #e0a100; background: var(--warn-bg); }
.tt-slot.other { border-left-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.tt-slot.other b { color: var(--ink-2); }
.tt-slot.mine { box-shadow: inset 0 0 0 1px var(--brand-600); }
tr.tt-other td { color: var(--muted); }
.cal-item.extra { border-left-color: #e0a100; background: var(--warn-bg); }
.cal-item.other { border-left-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.cal-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #7a4800; background: #ffe2a3; border-radius: 4px; padding: 0 4px; margin-right: 4px; }
.cal-date { gap: 2px; }
.cal-date span { margin-right: auto; }
.account-photo { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); }
.theme-pick { display: flex; align-items: center; gap: 8px; cursor: default; }
.theme-pick:hover, .theme-pick:active { background: transparent; color: inherit; }
.theme-pick .btn.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
/* settings page */
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; position: sticky; top: calc(var(--appbar-h) + 8px); z-index: 5; background: var(--bg); padding: 6px 0; }
.settings-nav a { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.settings-nav a:hover { text-decoration: none; border-color: var(--brand-600); color: var(--brand-600); }
.settings-card { margin-bottom: 16px; padding: 0; overflow: hidden; scroll-margin-top: calc(var(--appbar-h) + 64px); }
.settings-head { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.settings-head .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; }
.settings-head h2 { font-size: 16px; margin: 0; }
.settings-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.switch-list { display: flex; flex-direction: column; }
.switch-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; margin: 0; }
.switch-row:last-child { border-bottom: 0; }
.switch-row:hover { background: var(--surface-2); }
.switch-row .txt { flex: 1; min-width: 0; }
.switch-row .txt b { display: block; font-weight: 600; font-size: 14px; }
.switch-row .txt small { display: block; color: var(--muted); font-size: 12.5px; }
.switch-row .form-switch .form-check-input { width: 2.9em; height: 1.5em; cursor: pointer; margin: 0; float: none; }
.switch-row .form-switch .form-check-input:checked { background-color: #16a34a; border-color: #16a34a; }
.switch-list + .settings-fields { border-top: 1px solid var(--line); }
.settings-fields { padding: 16px 20px 20px; margin: 0; }
.settings-save { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-md); margin-bottom: 12px; }

/* =====================================================================
   Phones (October 2026, update 4): the top bar never overlaps, nothing is wider than the screen
   ===================================================================== */
body { overflow-x: clip; }
@media (max-width: 767px) {
  .page-head { gap: 10px; }
  .page-title { font-size: 19px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > .btn, .page-head .actions > form, .page-head .actions > a { flex: 1 1 auto; }
  .page-head .actions > form > .btn { width: 100%; }
  .filter-bar > .f, .filter-bar > .f.wide { max-width: none; flex-basis: 100%; }
  .filter-bar > .actions { width: 100%; }
  .filter-bar > .actions > * { flex: 1 1 auto; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search-box { flex: 1 1 100%; }
  .settings-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .settings-nav a { white-space: nowrap; }
  .settings-save { flex-direction: column; align-items: stretch; }
  .switch-row { padding: 12px 14px; }
  .dash-head form { width: 100%; }
  .dash-head .form-select { width: 100%; }
  .modal-dialog { margin: .5rem; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal-footer > .btn { flex: 1 1 auto; }
  .form-block { padding: 14px; }
  .task-tile { min-height: 92px; padding: 16px; }
  .task-tile .ico { width: 48px; height: 48px; font-size: 22px; }
}
@media (max-width: 575px) {
  :root { --appbar-h: 58px; }
  .app-bar { padding: 0 10px; gap: 8px; }
  .app-bar .spacer { flex: 1 1 0; min-width: 0; }
  .app-brand { flex: none; gap: 0; }
  .app-brand .brand-logo { width: 38px; height: 38px; }
  .brand-text { display: none; }
  .seg { flex: 0 1 230px; min-width: 0; padding: 3px; gap: 3px; }
  .seg a { min-width: 0; padding: 7px 6px; font-size: 13px; gap: 5px; }
  .account-btn { padding: 3px; height: 42px; gap: 0; flex: none; }
  .account-btn.dropdown-toggle::after { display: none; }
  .account-btn .who { display: none; }
  .account-menu { min-width: min(300px, calc(100vw - 20px)); }
  .menu-hello { margin: 4px 0 18px; }
  .menu-hello h1 { font-size: 22px; }
  .menu-grid { gap: 12px; }
  .menu-tile { min-height: 118px; padding: 16px 10px; gap: 10px; border-radius: 14px; }
  .menu-tile .ico { width: 46px; height: 46px; font-size: 21px; }
  .menu-tile h3 { font-size: 15px; }
  .kpi { min-height: 118px; padding: 12px 12px 14px; }
  .kpi .value { font-size: 20px; }
  .kpi .value.money { font-size: 16px; }
  .dash-title { font-size: 20px; }
}
@media (max-width: 380px) {
  .seg a i { display: none; }
}

/* calendar: a class is a button that opens its details */
button.cal-item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; transition: filter .12s, box-shadow .12s; }
button.cal-item:hover, button.cal-item:focus-visible { filter: brightness(.96); box-shadow: 0 2px 8px rgba(16, 42, 82, .15); }
[data-bs-theme="dark"] button.cal-item:hover { filter: brightness(1.15); }
.session-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 575px) { .session-grid { grid-template-columns: minmax(0, 1fr); } }
.cal-item .cal-time { white-space: nowrap; }
.session-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.session-box .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.session-box b { font-size: 15px; }
.session-kv dt { font-weight: 600; color: var(--muted); font-size: 13px; padding-bottom: 6px; }
.session-kv dd { margin-bottom: 6px; }

/* =====================================================================
   October 2026 update 3: badges, bell, Collect fees, packages, cards
   ===================================================================== */
/* a badge = colour + text (never colour only); the text colour is picked for contrast */
.fee-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--fb, #475569); color: var(--fbt, #fff);
  border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.fee-badge i { font-size: 11px; }
[data-bs-theme="dark"] .fee-badge { box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }

/* the bell in the top bar */
.bell { margin-right: 6px; }
.bell-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 19px; }
.bell-btn:hover, .bell-btn.show { background: rgba(255, 255, 255, .22); }
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #e11d48;
  color: #fff; font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--navy-900); }
.bell-menu { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-items { max-height: 360px; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; padding: 10px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.bell-item:hover { background: var(--surface-2); color: var(--ink); }
.bell-item i { font-size: 17px; color: var(--muted); margin-top: 2px; }
.bell-item .txt { display: block; font-size: 13px; }
.bell-item small { color: var(--muted); }
.bell-item.unread { background: var(--brand-50); }
.bell-item.unread .txt { font-weight: 700; }
.bell-item.unread i { color: var(--accent); }
.bell-empty { padding: 18px 14px; color: var(--muted); text-align: center; }
.bell-all { display: block; padding: 9px 14px; text-align: center; font-weight: 600; background: var(--surface-2); text-decoration: none; }

/* Collect fees */
.collect-total { width: 100%; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border: 0; border-radius: var(--r-card);
  padding: 18px 22px; background: linear-gradient(120deg, var(--brand), var(--brand-600)); color: #fff; box-shadow: var(--shadow-sm); text-align: left; }
.collect-total .lbl { font-size: 15px; opacity: .85; font-weight: 600; }
.collect-total .amt { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.collect-total .hint { margin-left: auto; font-size: 13px; opacity: .85; }
.collect-total[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.collect-table .month-row th { background: var(--surface-2); color: var(--ink-2); font-size: 13px; }
.collect-table .pay-line.on td { background: var(--ok-bg); }
.collect-table .pay-amount, .collect-table .pay-discount { max-width: 130px; margin-left: auto; }
.collect-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 767.98px) {
  .collect-total .amt { font-size: 24px; }
  .collect-total .hint { margin-left: 0; width: 100%; }
  .collect-table thead { display: none; }
  .collect-table tr.pay-line { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .collect-table tr.pay-line td { display: block; border: 0; padding: 2px 0; text-align: left !important; }
  .collect-table tr.pay-line td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .collect-table tr.pay-line td:first-child { grid-column: 1 / -1; }
  .collect-table tr.pay-line td:first-child::before { content: "Pay this line"; display: inline; margin-right: 8px; }
  .collect-table tr.pay-line td[data-label="Class"], .collect-table tr.pay-line td[data-label="Discounts"] { grid-column: 1 / -1; }
  .collect-table .pay-amount, .collect-table .pay-discount { max-width: none; margin: 0; }
  .collect-table .month-row th { display: block; }
  .collect-bottom .btn-lg { width: 100%; }
}

/* class form: a fee per medium */
.medium-fees { border: 1px dashed var(--btn-line); border-radius: var(--r-ctl); padding: 12px 14px; background: var(--surface-2); }
.medium-fees-head { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }

/* package form rows */
.pkg-head, .pkg-row { display: grid; grid-template-columns: 2.2fr 1.6fr 1.2fr .8fr auto; gap: 8px; align-items: center; }
.pkg-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.pkg-row { margin-bottom: 10px; }
.pkg-row .pkg-note { grid-column: 1 / -1; margin-top: -4px; }
.pkg-row select.no-choice { color: var(--muted); }
@media (max-width: 767.98px) {
  .pkg-row { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); }
  .pkg-row .c1, .pkg-row .c2 { grid-column: 1 / -1; }
}
.pkg-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pkg-summary > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; }
.pkg-summary span { display: block; font-size: 12px; }
.pkg-summary b { font-size: 17px; }
@media (max-width: 575.98px) { .pkg-summary { grid-template-columns: 1fr; } }

/* cards */
.choice-cards { display: grid; gap: 8px; }
.choice-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  cursor: pointer; background: var(--surface); }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--brand-50); box-shadow: 0 0 0 2px rgba(42, 120, 214, .15); }
.choice-card.ok:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.choice-card.no:has(input:checked) { border-color: var(--bad); background: var(--bad-bg); }
.choice-card input { margin-top: 3px; }
.card-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.card-facts > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; }
.card-facts > div > span { display: block; font-size: 12px; color: var(--muted); }
.card-history { display: grid; gap: 10px; }
.ch-item { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; }
.ch-item.current { border-color: var(--accent); }
.ch-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch-list { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.card-status { font-weight: 700; }
.card-status.st-waiting { background: var(--warn-bg); color: var(--warn); }
.card-status.st-approved { background: var(--info-bg); color: var(--info); }
.card-status.st-active { background: var(--ok-bg); color: var(--ok); }
.card-status.st-declined { background: var(--bad-bg); color: var(--bad); }
.card-status.st-removed, .card-status.st-withdrawn { background: var(--neutral-bg); color: var(--neutral); }
.card-wait-panel { border-left: 4px solid var(--warn); }

/* settings: the extra button under a group; radio lists in pop-ups */
.settings-extra { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.form-control-color { width: 64px; height: var(--ctl-h); padding: 4px; }
.modal-body div[id^="id_subject"] > div, .modal-body div[id^="id_card_type"] > div { margin-bottom: 6px; }
.modal-body div[id^="id_subject"] label { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); cursor: pointer; }
.modal-body div[id^="id_subject"] label:has(input:checked) { border-color: var(--accent); background: var(--brand-50); }

/* ---- Who is online (Administration) ---- */
.presence-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #800000; vertical-align: middle; flex: none; }
.presence-dot.on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }
.presence { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .875rem; }
.presence.on { color: #15803d; }
.presence.off { color: #800000; }
[data-bs-theme="dark"] .presence.off { color: #e88a8a; }
[data-bs-theme="dark"] .presence-dot { background: #b03a3a; }
[data-bs-theme="dark"] .presence-dot.on { background: #22c55e; }
[data-bs-theme="dark"] .presence.on { color: #4ade80; }
