/* =====================================================================
   GSMaRT School System - school theme (loads after Bootstrap and app.css)

   Palette, from the classroom:
     slate   #22343c  the blackboard: the side menu and the school's own colour
     chalk   #e8eeea  writing on the board
     pencil  #f2b233  a No. 2 pencil: the one marker for "you are here"
     ink     #1f5191  fountain-pen ink: every action
     red pen #b3261e  corrections, negatives, things that went wrong
     paper   #f3f5f4  the page the work sits on
   Type: Literata (titles, the school's name) and Public Sans (everything people read and type).
   Each school can set its own slate, ink and pencil colours on School Profile & Branding.
   ===================================================================== */

@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/public-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/public-sans-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/literata-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/literata-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF; }

:root {
  --font-ui: "Public Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Literata", Georgia, "Times New Roman", serif;

  --slate: #22343c;
  --slate-deep: #182630;
  --slate-raise: #2c4049;
  --chalk: #e8eeea;
  --chalk-dim: #a7b7b4;
  --chalk-faint: rgba(232, 238, 234, .1);
  --pencil: #f2b233;

  --accent: #1f5191;
  --accent-deep: #193f72;
  --accent-deeper: #143460;
  --accent-light: #3f73b8;
  --accent-focus: #93b3df;
  --accent-tint: #e6edf7;
  --accent-tint-2: #f1f5fb;
  --accent-rgb: 31, 81, 145;

  --redpen: #b3261e;
  --green: #22714a;
  --amber: #946200;

  --page: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --ink: #1d2a2f;
  --ink-soft: #46555b;
  --muted: #687a7f;
  --line: #d8dfdd;
  --line-soft: #e8edeb;

  --radius: 8px;
  --radius-sm: 6px;
  --raise-1: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(20, 38, 46, .07), 0 6px 16px -10px rgba(20, 38, 46, .22);
  --raise-2: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(20, 38, 46, .08), 0 16px 30px -18px rgba(20, 38, 46, .34);
  --rail-w: 268px;
  --bar-h: 58px;

  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-primary: #1f5191;
  --bs-primary-rgb: 31, 81, 145;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 31, 81, 145;
  --bs-link-hover-color: var(--accent-deep);
  --bs-danger: #b3261e;
  --bs-danger-rgb: 179, 38, 30;
  --bs-success: #22714a;
  --bs-success-rgb: 34, 113, 74;
}

body.school-ui, body.login-page { font-family: var(--font-ui); font-size: .9rem; color: var(--ink); background: var(--page); font-feature-settings: "tnum" 0; }
.num, td.num, th.num, .figure, .kv dd.num, .stat-value { font-variant-numeric: tabular-nums; }
::selection { background: rgba(var(--accent-rgb), .18); }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .55); outline-offset: 2px; }
.neg, .text-danger { color: var(--redpen) !important; }
.text-success { color: var(--green) !important; }
.text-warning { color: var(--amber) !important; }
.text-primary { color: var(--accent) !important; }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--font-title); letter-spacing: -.005em; }
h4, h5, h6, .h4, .h5, .h6 { font-family: var(--font-ui); font-weight: 650; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--pencil); color: #1d1d1d; padding: .5rem .8rem; border-radius: 0 0 6px 0; }
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ Bootstrap in the school's colours */
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent-deep); --bs-btn-hover-bg: var(--accent-deep); --bs-btn-hover-border-color: var(--accent-deeper);
  --bs-btn-active-bg: var(--accent-deeper); --bs-btn-active-border-color: var(--accent-deeper); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent); --bs-btn-border-color: rgba(var(--accent-rgb), .45); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent-deep);
  --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--accent-deep); --bs-btn-active-border-color: var(--accent-deep); --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}
.btn-danger { --bs-btn-bg: var(--redpen); --bs-btn-border-color: #8f1e18; --bs-btn-hover-bg: #9a2019; --bs-btn-hover-border-color: #7d1913; --bs-btn-active-bg: #861c16; }
.btn-outline-danger { --bs-btn-color: var(--redpen); --bs-btn-border-color: rgba(179, 38, 30, .45); --bs-btn-hover-bg: var(--redpen); --bs-btn-hover-border-color: #8f1e18; }
.btn-success { --bs-btn-bg: var(--green); --bs-btn-border-color: #1a5a3a; --bs-btn-hover-bg: #1c603e; --bs-btn-hover-border-color: #164c31; --bs-btn-active-bg: #174f33; }
.btn-outline-success { --bs-btn-color: var(--green); --bs-btn-border-color: rgba(34, 113, 74, .45); --bs-btn-hover-bg: var(--green); --bs-btn-hover-border-color: #1a5a3a; }
.btn-outline-secondary { color: var(--ink-soft); border-color: #c4cfcc; }
.btn-outline-secondary:hover { background-color: #e9eeec; color: var(--ink); border-color: #b2bfbb; }
.btn-warning { --bs-btn-bg: var(--pencil); --bs-btn-border-color: #cf9419; --bs-btn-hover-bg: #e3a326; --bs-btn-hover-border-color: #b98415; --bs-btn-color: #2b2410; --bs-btn-hover-color: #2b2410; }
.form-control:focus, .form-select:focus { border-color: var(--accent-focus); box-shadow: inset 0 1px 2px rgba(20, 38, 46, .07), 0 0 0 .2rem rgba(var(--accent-rgb), .16); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent-deep); }
.form-check-input:focus { border-color: var(--accent-focus); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .16); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2393b3df'/%3e%3c/svg%3e"); }
.form-control, .form-select { border-color: #c6d0cd; }
.form-label { color: var(--ink-soft); font-size: .78rem; }
.page-link { color: var(--accent); }
.active > .page-link, .page-link.active { background-color: var(--accent); border-color: var(--accent); }
.nav-pills .nav-link.active { background: var(--accent); }
.progress-bar { background-color: var(--accent); }
.dropdown-item.active, .dropdown-item:active { background: var(--accent); }
.list-group-item.active { background: var(--accent); border-color: var(--accent); }
.alert { border-radius: var(--radius); }
.alert-danger { --bs-alert-color: #6e1712; --bs-alert-bg: #fbeceb; --bs-alert-border-color: #efc3bf; border-left-color: var(--redpen); }
.alert-success { --bs-alert-color: #154a30; --bs-alert-bg: #e9f4ee; --bs-alert-border-color: #bcdcc8; border-left-color: var(--green); }
.alert-warning { --bs-alert-color: #5b3d00; --bs-alert-bg: #fdf5e2; --bs-alert-border-color: #f0d9a2; border-left-color: #d79a1c; }
.alert-info { --bs-alert-color: #173a63; --bs-alert-bg: var(--accent-tint-2); --bs-alert-border-color: #c5d5ec; border-left-color: var(--accent); }
.table { --bs-table-hover-bg: #f2f6fa; --bs-table-border-color: var(--line-soft); }
.table thead th { background: #f1f4f3; color: #4a5a5f; border-bottom-color: #d3dbd8; font-size: .76rem; }
.card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--raise-1); }
.card > .card-header { background: #fafbfb; font-family: var(--font-ui); font-size: .9rem; border-color: var(--line); }
.modal-content { border-radius: 12px; }
.modal-header { border-radius: 12px 12px 0 0; }
.modal-footer { border-radius: 0 0 12px 12px; }
.badge { font-size: .8rem; }

/* status words: plain coloured text with a small square marker, never a capsule */
.st { font-weight: 650; font-size: .82rem; white-space: nowrap; color: var(--muted); }
.st::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .38em; border-radius: 1px; background: currentColor; vertical-align: .08em; opacity: .85; }
.st-green { color: var(--green); }
.st-blue { color: var(--accent); }
.st-amber { color: var(--amber); }
.st-red { color: var(--redpen); }
.st-grey { color: #78878b; }
.st-dark { color: #2b3940; }

/* ------------------------------------------------------------------ the shell: slate rail + paper stage */
.shell { display: flex; min-height: 100vh; }
.stage { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.rail, .rail.offcanvas-lg {
  width: var(--rail-w); min-width: var(--rail-w); background-color: var(--slate) !important; color: var(--chalk);
  display: flex; flex-direction: column;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25), 4px 0 18px -10px rgba(10, 20, 26, .5);
}
@media (min-width: 992px) {
  .rail { position: sticky; top: 0; height: 100vh; }
}
.rail-head { display: flex; align-items: center; gap: .5rem; padding: .95rem .9rem .85rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.rail-school { display: flex; align-items: center; gap: .7rem; color: #fff; min-width: 0; flex: 1 1 auto; }
.rail-school:hover { color: #fff; text-decoration: none; }
.crest {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 9px; display: inline-grid; place-items: center;
  font-family: var(--font-title); font-weight: 700; font-size: .98rem; letter-spacing: .02em; color: #2a2208;
  background: var(--pencil);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 -2px 0 rgba(0, 0, 0, .14) inset, 0 3px 8px rgba(0, 0, 0, .35);
}
.crest.has-logo { background: #fff; padding: 3px; overflow: hidden; }
.crest.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.rail-school-text { display: flex; flex-direction: column; min-width: 0; }
.rail-school-name { font-family: var(--font-title); font-weight: 650; font-size: .98rem; line-height: 1.2; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-school-sub { font-size: .74rem; color: var(--chalk-dim); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail-nav { flex: 1 1 auto; overflow-y: auto; padding: .4rem 0 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.rail-nav::-webkit-scrollbar { width: 8px; }
.rail-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 8px; }
.rail-section { padding: .95rem 1.1rem .3rem; font-size: .74rem; font-weight: 600; color: var(--chalk-dim); letter-spacing: .01em; }
.rail-mod {
  display: flex; align-items: center; gap: .65rem; width: calc(100% - 1rem); margin: 1px .5rem; padding: .48rem .6rem;
  background: none; border: 0; border-radius: 7px; color: var(--chalk); font-size: .865rem; font-weight: 550; text-align: left;
}
.rail-mod > .bi:first-child { width: 1.15rem; font-size: 1rem; color: var(--chalk-dim); text-align: center; }
.rail-mod span { flex: 1 1 auto; }
.rail-mod:hover { background: var(--chalk-faint); color: #fff; text-decoration: none; }
.rail-mod:focus-visible { outline: 2px solid var(--pencil); outline-offset: -2px; }
.rail-group > .rail-mod:not(.collapsed) { color: #fff; background: rgba(255, 255, 255, .06); }
.rail-group > .rail-mod:not(.collapsed) > .bi:first-child, .rail-mod-link.active > .bi:first-child { color: var(--pencil); }
.rail-caret { font-size: .7rem; opacity: .6; transition: transform .15s ease; }
.rail-mod.collapsed .rail-caret { transform: rotate(-90deg); }
.rail-mod-link.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--pencil); }
.rail-links { padding: .1rem 0 .45rem; }
.rail-link {
  display: block; margin: 0 .5rem 0 1.55rem; padding: .3rem .6rem .3rem .75rem; border-left: 1px solid rgba(255, 255, 255, .12);
  color: #c9d4d1; font-size: .83rem; line-height: 1.3;
}
.rail-link:hover { color: #fff; background: var(--chalk-faint); text-decoration: none; border-radius: 0 6px 6px 0; }
.rail-link.active { color: #fff; font-weight: 600; border-left: 3px solid var(--pencil); padding-left: .65rem; background: rgba(255, 255, 255, .07); border-radius: 0 6px 6px 0; }
.rail-sub { margin: .45rem .5rem .1rem 1.55rem; padding-left: .75rem; font-size: .72rem; color: var(--chalk-dim); border-left: 1px solid rgba(255, 255, 255, .12); }
.rail-reports summary { list-style: none; cursor: pointer; margin: .2rem .5rem 0 1.55rem; padding: .3rem .6rem .3rem .75rem; border-left: 1px solid rgba(255, 255, 255, .12); color: #c9d4d1; font-size: .83rem; display: flex; align-items: center; gap: .4rem; }
.rail-reports summary::-webkit-details-marker { display: none; }
.rail-reports summary::after { content: ""; margin-left: auto; width: 0; height: 0; border-left: 4px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; transition: transform .15s ease; opacity: .7; }
.rail-reports[open] summary::after { transform: rotate(90deg); }
.rail-reports summary:hover { color: #fff; }
.rail-count { font-size: .72rem; color: var(--chalk-dim); }
.rail-foot { padding: .6rem 1.1rem; font-size: .72rem; color: var(--chalk-dim); border-top: 1px solid rgba(255, 255, 255, .08); }

/* the rail as a drawer on tablets and phones */
@media (max-width: 991.98px) {
  .rail.offcanvas-lg { --bs-offcanvas-width: min(86vw, 320px); background: var(--slate); color: var(--chalk); }
  .rail .rail-link, .rail .rail-mod { padding-top: .55rem; padding-bottom: .55rem; }
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--bar-h); display: flex; align-items: center; gap: .75rem;
  padding: 0 1.25rem; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); box-shadow: 0 6px 14px -12px rgba(20, 38, 46, .35);
}
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 38px; height: 38px; display: inline-grid; place-items: center; font-size: 1.25rem; color: var(--ink); box-shadow: var(--raise-1); }
.top-search { position: relative; flex: 1 1 auto; max-width: 520px; }
.top-search .bi { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.top-search .form-control { padding-left: 2.2rem; height: 38px; border-radius: 8px; background: var(--surface-2); border-color: var(--line); }
.top-search .form-control:focus { background: #fff; }
.top-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.top-btn {
  position: relative; display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 .7rem; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--ink-soft); font-size: .84rem; font-weight: 550;
}
.top-btn:hover { background: #eef2f0; color: var(--ink); text-decoration: none; }
.top-btn .bi { font-size: 1.05rem; }
/* a waiting count is a plain number beside the label, in the red pen colour (no capsule) */
.top-btn .count { font-size: .84rem; font-weight: 700; color: var(--red-pen); font-variant-numeric: tabular-nums; }
.top-user { display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .5rem 0 .3rem; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: var(--raise-1); }
.top-user:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--slate); color: var(--pencil); font-family: var(--font-title); font-weight: 700; font-size: .85rem; }
.top-user-name { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; font-weight: 600; }
@media (max-width: 1199.98px) { .top-btn-text { display: none; } }
@media (max-width: 767.98px) {
  .topbar { padding: 0 .6rem; gap: .4rem; }
  .top-user-name, .top-user .bi-chevron-down { display: none; }
  .top-user { padding: 0 .3rem; }
  .top-btn { padding: 0 .5rem; }
  .top-search .form-control { font-size: 16px; }
}
@media (max-width: 420px) { .top-search { display: none; } }

.platform-strip, .company-strip { position: static; }

/* ------------------------------------------------------------------ page */
.main-area { padding: 1.25rem 1.5rem 2.5rem; max-width: 1680px; width: 100%; }
.bare-main { max-width: none; }
.page-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .6rem 1rem;
  margin: 0 0 1.1rem; padding: 0 0 .75rem; min-height: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; box-shadow: none;
}
.page-bar h1 { font-family: var(--font-title); font-size: 1.42rem; font-weight: 650; letter-spacing: -.01em; color: #15232a; margin: 0; line-height: 1.2; }
.page-sub { margin: .2rem 0 0; color: var(--muted); font-size: .86rem; max-width: 72ch; }
.page-bar .page-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
@media (max-width: 767.98px) {
  .main-area { padding: .9rem .8rem 2rem !important; }
  .page-bar { align-items: stretch; }
  .page-bar h1 { font-size: 1.22rem; }
}

/* toasts: brief "it worked" messages, bottom right; errors stay on the page as alerts */
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.school-toast { border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--raise-2); background: #fff; width: auto; }
.school-toast .toast-body { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; }
.school-toast .toast-body > span { flex: 1 1 auto; }
.school-toast.toast-success .bi { color: var(--green); font-size: 1.1rem; }
.school-toast.toast-info .bi { color: var(--accent); font-size: 1.1rem; }
.school-toast { border-left: 4px solid var(--green); }
.school-toast.toast-info { border-left-color: var(--accent); }

/* ------------------------------------------------------------------ building blocks of the school pages */
/* a row of figures: compact, one line of tiles, never oversized */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; box-shadow: var(--raise-1); min-width: 0; }
.stat-label { font-size: .76rem; color: var(--muted); font-weight: 550; line-height: 1.25; min-height: 1.9em; }
.stat-value { font-size: 1.22rem; font-weight: 700; color: #15232a; line-height: 1.25; margin-top: .1rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-note { font-size: .74rem; color: var(--muted); margin-top: .1rem; }
a.stat:hover { text-decoration: none; border-color: #b9c6c3; }
.stat.is-warn .stat-value { color: var(--amber); }
.stat.is-bad .stat-value { color: var(--redpen); }
.stat.is-good .stat-value { color: var(--green); }

/* label / value pairs */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: .35rem 1rem; margin: 0; font-size: .87rem; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.kv-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
@media (max-width: 767.98px) { .kv-2 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .45rem; } }

/* a filter row above a list */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .9rem; }
.filter-bar .ff { display: flex; flex-direction: column; min-width: 140px; }
.filter-bar .ff-grow { flex: 1 1 220px; }
.filter-bar .form-label { margin-bottom: .15rem; }
@media (max-width: 575.98px) { .filter-bar .ff { flex: 1 1 100%; } }

/* empty states: what to do next */
.empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }
.empty .bi { font-size: 1.6rem; color: #9fb0ad; display: block; margin-bottom: .4rem; }
.empty p { margin: 0 auto .7rem; max-width: 52ch; }

/* the head of a record (a student, an employee, an application) */
.record-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.record-mark { width: 54px; height: 54px; border-radius: 10px; display: grid; place-items: center; background: var(--slate); color: var(--pencil);
  font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); flex: 0 0 54px; overflow: hidden; }
.record-mark img { width: 100%; height: 100%; object-fit: cover; }
.record-title { font-family: var(--font-title); font-size: 1.25rem; font-weight: 650; margin: 0; color: #15232a; }
.record-meta { color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin-top: .15rem; }
.record-meta > span { white-space: nowrap; }

/* the steps of a workflow */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { position: relative; padding: .55rem 0 .7rem 2.4rem; border-left: 2px solid var(--line); margin-left: .85rem; }
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
  counter-increment: step; content: counter(step); position: absolute; left: -.95rem; top: .45rem; width: 1.8rem; height: 1.8rem; border-radius: 7px;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: #fff; border: 2px solid var(--line); color: var(--muted);
}
.steps > li.is-done::before { content: "\2713"; background: var(--green); border-color: var(--green); color: #fff; }
.steps > li.is-done { border-left-color: var(--green); }
.steps > li.is-current::before { background: var(--pencil); border-color: #d6981e; color: #2a2208; }
.steps > li.is-skipped::before { content: "\2013"; }
.step-name { font-weight: 650; }
.step-meta { font-size: .8rem; color: var(--muted); }

/* tab row inside a page */
.page-tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs a { padding: .5rem .85rem; color: var(--ink-soft); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; font-size: .87rem; }
.page-tabs a:hover { color: var(--ink); background: #eef2f0; text-decoration: none; border-radius: 6px 6px 0 0; }
.page-tabs a.active { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 650; }
.page-tabs a .tab-count { color: var(--muted); font-weight: 500; margin-left: .25rem; }

/* a slim note under a form section */
.hint { font-size: .8rem; color: var(--muted); }
.section-title { font-family: var(--font-ui); font-size: .95rem; font-weight: 700; color: #1d2a2f; margin: 1.1rem 0 .55rem; }
.section-title:first-child { margin-top: 0; }

/* list rows that are links (dashboards, inboxes) */
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list > li { display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; padding: .6rem .95rem; border-top: 1px solid var(--line-soft); }
.row-list > li:first-child { border-top: 0; }
.row-list .rl-main { min-width: 0; }
.row-list .rl-title { font-weight: 600; color: var(--ink); }
.row-list .rl-sub { font-size: .8rem; color: var(--muted); }
.row-list .rl-side { text-align: right; white-space: nowrap; font-size: .82rem; color: var(--muted); }
.row-list > li.is-unread { background: var(--accent-tint-2); }
.row-list > li.is-unread .rl-title::before { content: ""; display: inline-block; width: .45rem; height: .45rem; border-radius: 1px; background: var(--pencil); margin-right: .45rem; vertical-align: .1em; }

/* meter bars (capacity, load) */
.meter { height: 8px; background: #e6ecea; border-radius: 3px; overflow: hidden; min-width: 70px; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .06); }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.is-full > span { background: var(--amber); }
.meter.is-over > span { background: var(--redpen); }

/* ------------------------------------------------------------------ the timetable grid */
.tt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--raise-1); }
.tt { display: grid; min-width: 760px; position: relative; }
.tt-head { background: #f1f4f3; border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 650; color: var(--ink-soft); padding: .45rem .5rem; text-align: center; }
.tt-time { font-size: .72rem; color: var(--muted); text-align: right; padding: 0 .45rem; border-right: 1px solid var(--line-soft); transform: translateY(-.5em); }
.tt-cell { border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.tt-cell.is-hour { border-top-color: #dfe6e3; }
.tt-block {
  margin: 1px 3px; padding: .3rem .45rem; border-radius: 6px; font-size: .74rem; line-height: 1.25; overflow: hidden; z-index: 1;
  background: var(--accent-tint); border: 1px solid #bfd0e8; border-left: 3px solid var(--accent); color: #12304f;
  box-shadow: 0 1px 2px rgba(20, 38, 46, .1);
}
.tt-block strong { display: block; font-size: .78rem; }
.tt-block.is-lab { background: #eaf4ee; border-color: #bcdcc8; border-left-color: var(--green); color: #12391f; }
.tt-block.is-conflict { background: #fbeceb; border-color: #efc3bf; border-left-color: var(--redpen); color: #5c130f; }
.tt-block.is-draft { border-style: dashed; }
.tt-block a { color: inherit; }

/* ------------------------------------------------------------------ printed school documents */
.doc-sheet { max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--raise-1); padding: 40px 48px; font-size: .92rem; }
.doc-letterhead { display: flex; align-items: center; gap: 1rem; padding-bottom: .9rem; border-bottom: 2px solid #22343c; margin-bottom: 1.2rem; }
.doc-letterhead .crest { width: 58px; height: 58px; flex-basis: 58px; font-size: 1.2rem; }
.doc-letterhead .lh-name { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; color: #15232a; line-height: 1.2; }
.doc-letterhead .lh-sub { font-size: .8rem; color: var(--muted); }
.doc-title { font-family: var(--font-title); text-align: center; font-size: 1.35rem; font-weight: 700; margin: .4rem 0 1.2rem; letter-spacing: .01em; }
.doc-body p { line-height: 1.75; text-align: justify; }
.doc-sign { display: flex; justify-content: space-between; gap: 2rem; margin-top: 3rem; }
.doc-sign > div { text-align: center; min-width: 200px; }
.doc-sign .sig-line { border-top: 1px solid #222; padding-top: .3rem; font-weight: 700; }
.doc-sign .sig-title { font-size: .8rem; color: #444; }
.doc-foot { margin-top: 2rem; font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: .5rem; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.doc-table th, .doc-table td { border: 1px solid #b9c3c0; padding: .3rem .45rem; }
.doc-table th { background: #f0f3f2; font-weight: 650; }
@media (max-width: 767.98px) { .doc-sheet { padding: 20px 16px; } .doc-sign { flex-direction: column; } }
@media print {
  .doc-sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  body.school-ui { background: #fff; }
  .rail, .topbar, .toast-stack, .page-tabs, .filter-bar { display: none !important; }
  .main-area { padding: 0 !important; max-width: none; }
  .page-bar { border: 0; }
  .stat { box-shadow: none; }
}

/* ------------------------------------------------------------------ log in, public pages */
body.login-page { min-height: 100vh; background: var(--page); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 520px) minmax(0, 1fr); }
.login-board {
  background: var(--slate); color: var(--chalk); padding: 3rem 3rem 2rem; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .3);
}
.login-board .crest { width: 54px; height: 54px; flex-basis: 54px; font-size: 1.15rem; }
.login-board .lb-name { font-family: var(--font-title); font-size: 1.9rem; font-weight: 650; line-height: 1.15; color: #fff; margin: 1.4rem 0 .6rem; max-width: 16ch; }
.login-board .lb-text { color: var(--chalk-dim); max-width: 38ch; line-height: 1.6; }
.login-board .lb-foot { font-size: .78rem; color: var(--chalk-dim); }
.login-board .lb-list { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .5rem; color: var(--chalk); font-size: .9rem; }
.login-board .lb-list li { display: flex; gap: .55rem; align-items: baseline; }
.login-board .lb-list .bi { color: var(--pencil); }
.login-side { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-panel { width: 100%; max-width: 400px; }
.login-panel h1 { font-family: var(--font-title); font-size: 1.55rem; font-weight: 650; margin-bottom: .3rem; }
.login-panel .lp-sub { color: var(--muted); margin-bottom: 1.4rem; }
.login-panel .form-control { height: 44px; }
.login-panel .btn-primary { height: 44px; font-weight: 600; }
.login-panel .lp-links { margin-top: 1.2rem; font-size: .86rem; display: grid; gap: .35rem; }
.login-panel .lp-note { margin-top: 1.6rem; font-size: .78rem; color: var(--muted); }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-board { padding: 1.4rem 1.25rem; }
  .login-board .lb-name { font-size: 1.35rem; margin: .8rem 0 .3rem; }
  .login-board .lb-list, .login-board .lb-text, .login-board .lb-foot { display: none; }
  .login-panel .form-control { font-size: 16px; }
}
.public-shell { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.public-head { display: flex; align-items: center; gap: .8rem; padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.public-head .ph-name { font-family: var(--font-title); font-size: 1.3rem; font-weight: 650; line-height: 1.2; }
.public-head .ph-sub { color: var(--muted); font-size: .85rem; }

/* dashboard column layout */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.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: 1199.98px) { .dash-grid > .span-4, .dash-grid > .span-5, .dash-grid > .span-7 { grid-column: span 6; } }
@media (max-width: 767.98px) { .dash-grid > [class*="span-"] { grid-column: span 12; } }

@media (prefers-reduced-motion: reduce) {
  .rail-caret, .rail-reports summary::after { transition: none; }
}
.row-list .rl-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .95rem; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.row-list .rl-item:first-child { border-top: 0; }
.row-list .rl-item:hover { background: var(--accent-tint-2); }
.public-foot { border-top: 1px solid var(--line); padding-top: .8rem; }
.crest.crest-lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 1.3rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .9rem 0 .25rem; }
.form-actions .hint { margin: 0; }

/* ------------------------------------------------------------------ month calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-dow { padding: .35rem .5rem; font-size: .75rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--paper); }
.cal-day { min-height: 92px; padding: .3rem .35rem .4rem; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.is-out { background: var(--paper); }
.cal-day.is-weekend { background: rgba(0, 0, 0, .015); }
.cal-day.is-off { background: rgba(var(--accent-rgb), .045); }
.cal-day.is-today .cal-num { background: var(--slate); color: #fff; border-radius: 4px; }
.cal-num { display: inline-block; min-width: 1.5rem; padding: 0 .3rem; font-size: .8rem; font-weight: 600; text-align: center; margin-bottom: .2rem; }
.cal-ev { display: block; font-size: .72rem; line-height: 1.25; padding: .12rem .35rem; margin-top: .15rem; border-left: 3px solid var(--accent); background: var(--accent-tint-2);
  color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 2px; }
.cal-ev:hover { text-decoration: underline; }
.cal-ev.ev-holiday, .cal-ev.ev-no_class { border-left-color: var(--red-pen); background: rgba(179, 38, 30, .07); }
.cal-ev.ev-exam { border-left-color: var(--pencil); background: rgba(242, 178, 51, .14); }
.cal-ev.ev-deadline { border-left-color: var(--slate); background: rgba(34, 52, 60, .07); }
@media (max-width: 575.98px) {
  .cal-day { min-height: 54px; padding: .2rem; }
  .cal-ev { font-size: 0; height: 5px; padding: 0; margin-top: 2px; border-left-width: 0; background: var(--accent); }
  .cal-ev.ev-holiday, .cal-ev.ev-no_class { background: var(--red-pen); }
  .cal-ev.ev-exam { background: var(--pencil); }
  .cal-ev.ev-deadline { background: var(--slate); }
}

/* ------------------------------------------------------------------ a sequence of steps, in one line */
.wf-flow { list-style: none; counter-reset: wf; display: flex; flex-wrap: wrap; gap: .3rem .35rem; margin: .45rem 0 0; padding: 0; }
.wf-flow > li { counter-increment: wf; display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .12rem .45rem .12rem .2rem;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.wf-flow > li::before { content: counter(wf); display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; font-size: .68rem; font-weight: 700;
  border-radius: 3px; background: var(--slate); color: #fff; }
.wf-steps td { vertical-align: top; }
.doc-preview { font-family: var(--font-title); font-size: .95rem; line-height: 1.65; }
.doc-preview p { margin-bottom: .8rem; }

/* a table whose rows become stacked blocks on a phone (for lists of a few wide columns) */
@media (max-width: 575.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100% !important; }
  .table-stack tr { padding: .55rem .9rem; border-bottom: 1px solid var(--line-soft); }
  .table-stack td { border: 0 !important; padding: .1rem 0 !important; white-space: normal !important; text-align: left !important; }
}


/* ------------------------------------------------------------------ flat, tactile surfaces (no gradients)
   The raised feel comes from a light top edge and a soft shadow, not from colour washes. These replace the
   accounting screens' gradient fills wherever the school theme is used. */
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-secondary, .btn-info, .btn-dark { background-image: none; }
[class*="btn-outline-"], .btn-light { background-image: none; background-color: #fff; }
.btn-outline-primary:hover, .btn-outline-success:hover, .btn-outline-danger:hover, .btn-outline-warning:hover, .btn-outline-info:hover, .btn-outline-dark:hover { background-image: none; }
.input-group-text { background: #f2f4f3; }
.modal-header { background: #fff; }
.page-bar { background: transparent; }
.totals-box tr:last-child td { background: #f3f6f5; }
.bar { background: var(--accent); }
.kpi::after { display: none; }
.pos-default-grid thead th, .item-search-grid thead th, .logo-group-head { background: #f1f4f3; }
.rpt-doc.rc-shade-dark .report-table thead th { background: #2b333d; }
.rpt-doc.rc-shade-blue .report-table thead th { background: var(--accent-deep); }
.mc-fact, .code-card, .group-pricing, .rc-card .card-header, .rpt-designer-head { background-image: none !important; }
.mc-fact { background-color: #fff; }
.code-card { background-color: #f4f8fe; }
.table-stack td a { white-space: normal; }
