﻿/* ==========================================================================
   BrooksCorp Design Framework — BOOTSTRAP BRIDGE  (School Communicator MIS)
   --------------------------------------------------------------------------
   WHY THIS FILE EXISTS

   The BrooksCorp standard says a new project uses no CSS framework. This is
   not a new project: 115 Razor views are already marked up in Bootstrap —
   `row`/`col-*`, `card`, `table`, `form-control`, `badge`, `modal`. Rewriting
   that markup was explicitly out of scope ("this is a layout and styling
   change"), and rewriting it blind, with no way to run the app, would have
   been the fastest way to break a working MIS.

   So Bootstrap stays as a headless grid-and-utility substrate, and everything
   it *looks* like comes from BCDF tokens. Materio — the actual thing being
   removed — is gone: no core.css, no theme-default.css, no menu.js, no
   template customiser, no purple.

   The rule still holds: there is no hex value in this file. Every colour is a
   var(--bc-*), so a school's theme or a new client theme reskins this bridge
   for free.

   LOAD ORDER (see _Layout.cshtml):
     1. brookscorp.fonts.css
     2. bootstrap.min.css          ← grid, utilities, JS component classes
     3. brookscorp.css             ← tokens, base, components, layouts
     4. themes/schoolcomm.css      ← the five brand tokens
     5. THIS FILE                  ← Bootstrap wears BCDF
     6. per-school <style>          ← one school's colour, from the database

   Sections
     1  Bootstrap variable remap        7  Alerts and toasts
     2  Typography                      8  Modals and dropdowns
     3  Buttons                         9  Tabs, pagination, breadcrumb, list group
     4  Cards                          10  Materio class shims
     5  Tables                         11  MIS shell extensions
     6  Forms                          12  Print
   ========================================================================== */


/* ==========================================================================
   1  BOOTSTRAP VARIABLE REMAP
   Bootstrap 5.3 is custom-property driven, so most of the work is done by
   pointing its variables at BCDF's. What remains is the handful of components
   whose look (radius, shadow, weight) is a BCDF decision rather than a colour.
   ========================================================================== */
:root {
  --bs-body-font-family:   var(--bc-font-body);
  --bs-body-font-size:     var(--bc-fs-base);
  --bs-body-font-weight:   var(--bc-fw-regular);
  --bs-body-line-height:   var(--bc-lh-base);
  --bs-body-color:         var(--bc-text-body);
  --bs-body-bg:            var(--bc-bg-app);
  --bs-emphasis-color:     var(--bc-text-strong);
  --bs-secondary-color:    var(--bc-text-muted);
  --bs-tertiary-color:     var(--bc-text-subtle);
  --bs-heading-color:      var(--bc-text-strong);

  --bs-border-color:           var(--bc-border);
  --bs-border-color-translucent: var(--bc-border);
  --bs-border-radius:          var(--bc-r-ctrl);
  --bs-border-radius-sm:       var(--bc-r-xs);
  --bs-border-radius-lg:       var(--bc-r-card);
  --bs-border-radius-xl:       var(--bc-r-lg);
  --bs-border-radius-pill:     var(--bc-r-pill);

  --bs-link-color:        var(--bc-accent-600);
  --bs-link-hover-color:  var(--bc-accent-700);

  --bs-box-shadow-sm: var(--bc-sh-xs);
  --bs-box-shadow:    var(--bc-sh-sm);
  --bs-box-shadow-lg: var(--bc-sh-lg);

  --bs-font-sans-serif: var(--bc-font-body);
  --bs-font-monospace:  var(--bc-font-mono);

  /* Two Account views set `style="color:var(--sc-primary)"` inline — a Materio
     variable that died with materio.css. An undefined var() on `color` resolves to
     `inherit`, so those links were rendering as plain body text. Re-pointed here
     rather than editing the views, which are out of scope for a styling change. */
  --sc-primary:   var(--bc-text-accent);
  --sc-secondary: var(--bc-text-muted);

  /* Bootstrap's colour keywords, re-pointed. `primary` is the accent, because
     in Bootstrap markup "primary" always means "the action colour" — which is
     precisely what BCDF calls accent. The navy brand is `dark`. */
  --bs-primary:   var(--bc-accent-500);
  --bs-secondary: var(--bc-grey-500);
  --bs-success:   var(--bc-success);
  --bs-info:      var(--bc-info);
  --bs-warning:   var(--bc-warning);
  --bs-danger:    var(--bc-danger);
  --bs-light:     var(--bc-grey-50);
  --bs-dark:      var(--bc-brand-600);
}

/* The -rgb triplets Bootstrap uses for .bg-*, .text-* and every alpha blend.
   These cannot be var()-derived — Bootstrap composes them inside rgba() — so
   they are set here and re-set per school by the layout's inline block. */
:root {
  --bs-primary-rgb:   24, 160, 242;
  --bs-secondary-rgb: 91, 108, 134;
  --bs-success-rgb:   39, 174, 96;
  --bs-info-rgb:      123, 107, 232;
  --bs-warning-rgb:   245, 158, 11;
  --bs-danger-rgb:    231, 76, 60;
  --bs-dark-rgb:      11, 42, 85;
  --bs-light-rgb:     243, 247, 252;
  --bs-body-color-rgb: 18, 32, 58;
  --bs-body-bg-rgb:    243, 247, 252;
}


/* ==========================================================================
   2  TYPOGRAPHY
   BCDF's base sheet already restyles h1–h6. Two adjustments for this MIS:
   the h4 page heading pattern the views use everywhere, and Bootstrap's own
   .h4/.h5/.small/.display-* helpers, which BCDF has no equivalent of.
   ========================================================================== */
.bc-mis h1 { font-size: 1.9rem; }
.bc-mis h2 { font-size: 1.6rem; }
.bc-mis h3 { font-size: 1.35rem; }

/* Nearly every view opens with <h4> as its page title. At the BCDF h4 of 18px
   that reads as a sub-heading, so it is nudged up on this surface only rather
   than changing the framework's scale for everybody. */
.bc-mis h4, .bc-mis .h4 { font-size: 1.25rem; font-weight: var(--bc-fw-semi); }
.bc-mis h5, .bc-mis .h5 { font-size: 1rem; }
.bc-mis h6, .bc-mis .h6 { font-size: var(--bc-fs-sm); font-weight: var(--bc-fw-semi); }

.small, small        { font-size: var(--bc-fs-sm); }
.display-4           { font-family: var(--bc-font-display); font-weight: var(--bc-fw-bold); letter-spacing: -.03em; }
.display-6           { font-family: var(--bc-font-display); font-weight: var(--bc-fw-semi); letter-spacing: -.02em; }
.fw-semibold         { font-weight: var(--bc-fw-semi) !important; }
.text-muted          { color: var(--bc-text-muted) !important; }
.text-body           { color: var(--bc-text-body) !important; }
.text-dark           { color: var(--bc-text-strong) !important; }
.text-primary        { color: var(--bc-text-accent) !important; }
.font-monospace      { font-family: var(--bc-font-mono) !important; }

/* Any figure in a table cell or a stat tile lines up. Cheap here, and it is
   what BCDF's .bc-money exists to guarantee elsewhere. */
.bc-mis td, .bc-mis th, .bc-mis .fs-1, .bc-mis .fs-2, .bc-mis .fs-3 { font-variant-numeric: tabular-nums; }


/* ==========================================================================
   3  BUTTONS
   BCDF geometry: 10px radius, semibold label, no gradient, soft focus halo.
   ========================================================================== */
.btn {
  --bs-btn-border-radius: var(--bc-r-btn);
  --bs-btn-font-weight:   var(--bc-fw-semi);
  --bs-btn-font-size:     var(--bc-fs-sm);
  --bs-btn-padding-y:     9px;
  --bs-btn-padding-x:     16px;
  --bs-btn-line-height:   1.35;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background-color var(--bc-transition), border-color var(--bc-transition),
              color var(--bc-transition), box-shadow var(--bc-transition);
}
.btn:focus-visible { box-shadow: var(--bc-focus-ring); }
.btn-sm { --bs-btn-padding-y: 6px; --bs-btn-padding-x: 12px; --bs-btn-font-size: var(--bc-fs-xs); --bs-btn-border-radius: var(--bc-r-xs); }
.btn-lg { --bs-btn-padding-y: 12px; --bs-btn-padding-x: 22px; --bs-btn-font-size: var(--bc-fs-base); }

.btn-primary {
  --bs-btn-bg: var(--bc-accent-500);          --bs-btn-border-color: var(--bc-accent-500);
  --bs-btn-hover-bg: var(--bc-accent-600);    --bs-btn-hover-border-color: var(--bc-accent-600);
  --bs-btn-active-bg: var(--bc-accent-700);   --bs-btn-active-border-color: var(--bc-accent-700);
  --bs-btn-disabled-bg: var(--bc-accent-200); --bs-btn-disabled-border-color: var(--bc-accent-200);
  /* Not #fff. A school whose accent is gold or pale blue gets an unreadable label
     from a hard-coded white, so the ink is measured against their colour. */
  --bs-btn-color: var(--bc-on-accent);
  --bs-btn-hover-color: var(--bc-on-accent);
  --bs-btn-active-color: var(--bc-on-accent);
  --bs-btn-disabled-color: var(--bc-on-accent);
}
.btn-secondary, .btn-dark {
  --bs-btn-bg: var(--bc-brand-600);        --bs-btn-border-color: var(--bc-brand-600);
  --bs-btn-hover-bg: var(--bc-brand-500);  --bs-btn-hover-border-color: var(--bc-brand-500);
  --bs-btn-active-bg: var(--bc-brand-700); --bs-btn-active-border-color: var(--bc-brand-700);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
}
.btn-success {
  --bs-btn-bg: var(--bc-success); --bs-btn-border-color: var(--bc-success);
  --bs-btn-hover-bg: var(--bc-success-fg); --bs-btn-hover-border-color: var(--bc-success-fg);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-danger {
  --bs-btn-bg: var(--bc-danger); --bs-btn-border-color: var(--bc-danger);
  --bs-btn-hover-bg: var(--bc-danger-fg); --bs-btn-hover-border-color: var(--bc-danger-fg);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-warning {
  --bs-btn-bg: var(--bc-warning); --bs-btn-border-color: var(--bc-warning);
  --bs-btn-hover-bg: var(--bc-warning-fg); --bs-btn-hover-border-color: var(--bc-warning-fg);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-info {
  --bs-btn-bg: var(--bc-info); --bs-btn-border-color: var(--bc-info);
  --bs-btn-hover-bg: var(--bc-info-fg); --bs-btn-hover-border-color: var(--bc-info-fg);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}

/* Outline variants. The secondary outline is the workhorse of this MIS — 141
   uses — so it is a quiet neutral, not a grey box. */
.btn-outline-secondary {
  --bs-btn-color: var(--bc-text-body);         --bs-btn-border-color: var(--bc-border-strong);
  --bs-btn-hover-bg: var(--bc-grey-100);       --bs-btn-hover-border-color: var(--bc-border-strong);
  --bs-btn-hover-color: var(--bc-text-strong);
  --bs-btn-active-bg: var(--bc-grey-200);      --bs-btn-active-border-color: var(--bc-border-strong);
  --bs-btn-active-color: var(--bc-text-strong);
  background: var(--bc-bg-surface);
}
.btn-outline-primary {
  --bs-btn-color: var(--bc-text-accent);      --bs-btn-border-color: var(--bc-accent-300);
  --bs-btn-hover-bg: var(--bc-accent-500);    --bs-btn-hover-border-color: var(--bc-accent-500);
  --bs-btn-hover-color: var(--bc-on-accent);
  --bs-btn-active-bg: var(--bc-accent-600);   --bs-btn-active-border-color: var(--bc-accent-600);
  --bs-btn-active-color: var(--bc-on-accent);
}
.btn-outline-danger  { --bs-btn-color: var(--bc-danger-fg);  --bs-btn-border-color: var(--bc-danger);  --bs-btn-hover-bg: var(--bc-danger);  --bs-btn-hover-border-color: var(--bc-danger);  --bs-btn-hover-color: #fff; }
.btn-outline-success { --bs-btn-color: var(--bc-success-fg); --bs-btn-border-color: var(--bc-success); --bs-btn-hover-bg: var(--bc-success); --bs-btn-hover-border-color: var(--bc-success); --bs-btn-hover-color: #fff; }
.btn-outline-warning { --bs-btn-color: var(--bc-warning-fg); --bs-btn-border-color: var(--bc-warning); --bs-btn-hover-bg: var(--bc-warning); --bs-btn-hover-border-color: var(--bc-warning); --bs-btn-hover-color: #fff; }
.btn-outline-info    { --bs-btn-color: var(--bc-info-fg);    --bs-btn-border-color: var(--bc-info);    --bs-btn-hover-bg: var(--bc-info);    --bs-btn-hover-border-color: var(--bc-info);    --bs-btn-hover-color: #fff; }

.btn-link { --bs-btn-color: var(--bc-text-accent); --bs-btn-hover-color: var(--bc-accent-700); --bs-btn-font-weight: var(--bc-fw-medium); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* A button used as a content tile rather than a control. The timetable editor's
   cells are buttons containing a subject over a teacher line; as row-direction
   flex items they collapsed onto one centred line, and text-align cannot move a
   flex item. Scoped to .text-start so ordinary buttons keep their centring. */
.btn.text-start { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
.btn.text-start > .d-block { flex-basis: 100%; }


/* ==========================================================================
   4  CARDS
   The single most-used component in this MIS: 259 of them.
   ========================================================================== */
.card {
  --bs-card-bg: var(--bc-bg-surface);
  --bs-card-border-color: var(--bc-border);
  --bs-card-border-radius: var(--bc-r-card);
  --bs-card-inner-border-radius: calc(var(--bc-r-card) - 1px);
  --bs-card-spacer-y: var(--bc-s-5);
  --bs-card-spacer-x: var(--bc-s-6);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: var(--bc-s-5);
  box-shadow: var(--bc-sh-sm);
  border: 1px solid var(--bc-border);
}
.card-header {
  border-bottom: 1px solid var(--bc-border-subtle);
  font-family: var(--bc-font-display);
  font-size: var(--bc-fs-h4);
  font-weight: var(--bc-fw-semi);
  color: var(--bc-text-strong);
  letter-spacing: -.01em;
}
.card-header h5, .card-header .card-title { margin-bottom: 0; }
.card-footer { border-top: 1px solid var(--bc-border-subtle); background: var(--bc-grey-25); }
.card-title  { font-family: var(--bc-font-display); color: var(--bc-text-strong); font-weight: var(--bc-fw-semi); }
.shadow-sm   { box-shadow: var(--bc-sh-sm) !important; }
.rounded     { border-radius: var(--bc-r-ctrl) !important; }
.rounded-top { border-radius: var(--bc-r-card) var(--bc-r-card) 0 0 !important; }


/* ==========================================================================
   5  TABLES
   Dense and scannable — an operational surface, not a marketing one.
   ========================================================================== */
.table {
  --bs-table-color: var(--bc-text-body);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--bc-border-subtle);
  --bs-table-striped-bg: var(--bc-grey-25);
  --bs-table-hover-bg: var(--bc-accent-50);
  --bs-table-hover-color: var(--bc-text-strong);
  font-size: var(--bc-fs-sm);
  margin-bottom: 0;
}
.table > thead {
  --bs-table-bg: var(--bc-grey-25);
  --bs-table-color: var(--bc-text-muted);
}
.table > thead th, .table > thead > tr > th {
  font-size: var(--bc-fs-xs);
  font-weight: var(--bc-fw-semi);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bc-text-muted);
  border-bottom: 1px solid var(--bc-border);
  white-space: nowrap;
  padding: 10px var(--bc-s-4);
}
.table > tbody > tr > td { padding: 11px var(--bc-s-4); vertical-align: middle; }
.table-light { --bs-table-bg: var(--bc-grey-25); --bs-table-color: var(--bc-text-muted); }
.table-sm > :not(caption) > * > * { padding: 7px 10px; }
.table-responsive { border-radius: inherit; }

/* Bootstrap's contextual row classes, re-pointed at the semantic tints so a
   cancelled lesson or an understaffed duty post reads the same everywhere. */
.table-secondary { --bs-table-bg: var(--bc-neutral-bg); --bs-table-color: var(--bc-neutral-fg); }
.table-warning   { --bs-table-bg: var(--bc-warning-bg); --bs-table-color: var(--bc-warning-fg); }
.table-success   { --bs-table-bg: var(--bc-success-bg); --bs-table-color: var(--bc-success-fg); }
.table-danger    { --bs-table-bg: var(--bc-danger-bg);  --bs-table-color: var(--bc-danger-fg); }
.table-info      { --bs-table-bg: var(--bc-info-bg);    --bs-table-color: var(--bc-info-fg); }

/* A card whose only child is a table should not double its border. */
.card > .table-responsive > .table > :last-child > tr:last-child > * { border-bottom: 0; }


/* ==========================================================================
   6  FORMS
   Label above field, 10px radius, accent focus halo. Never placeholder-as-label
   — that rule is enforced in review, not in CSS, but the label styling here is
   what makes following it painless.
   ========================================================================== */
.form-label {
  font-size: var(--bc-fs-sm);
  font-weight: var(--bc-fw-medium);
  color: var(--bc-text-strong);
  margin-bottom: 5px;
}
.form-control, .form-select {
  --bs-border-radius: var(--bc-r-ctrl);
  font-size: var(--bc-fs-sm);
  color: var(--bc-text-strong);
  background-color: var(--bc-bg-surface);
  border: 1px solid var(--bc-border-strong);
  padding: 9px 12px;
  transition: border-color var(--bc-transition), box-shadow var(--bc-transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--bc-accent-400);
  box-shadow: var(--bc-focus-ring);
}
.form-control::placeholder { color: var(--bc-text-subtle); }
.form-control:disabled, .form-select:disabled { background: var(--bc-grey-50); color: var(--bc-text-muted); }
.form-control-sm, .form-select-sm { font-size: var(--bc-fs-xs); padding: 6px 10px; border-radius: var(--bc-r-xs); }
/* The shorthand padding above also wiped Bootstrap's right padding on selects, so the
   chevron sat on top of the text ("2 weeks", "FirstBreak"). Reserve room for it. */
.form-select    { padding-right: 36px; background-position: right 12px center; }
.form-select-sm { padding-right: 30px; background-position: right 9px center; }
.form-text { font-size: var(--bc-fs-xs); color: var(--bc-text-muted); }
.form-check-input { border-color: var(--bc-border-strong); }
.form-check-input:checked { background-color: var(--bc-accent-500); border-color: var(--bc-accent-500); }
.form-check-input:focus { border-color: var(--bc-accent-400); box-shadow: var(--bc-focus-ring); }
.form-check-label { font-size: var(--bc-fs-sm); }
.input-group-text {
  background: var(--bc-grey-50);
  border-color: var(--bc-border-strong);
  color: var(--bc-text-muted);
  font-size: var(--bc-fs-sm);
}
textarea.form-control { min-height: 84px; }


/* ==========================================================================
   7  BADGES, ALERTS AND TOASTS
   ========================================================================== */
.badge {
  --bs-badge-border-radius: var(--bc-r-pill);
  --bs-badge-font-weight: var(--bc-fw-semi);
  --bs-badge-font-size: var(--bc-fs-2xs);
  --bs-badge-padding-y: 4px;
  --bs-badge-padding-x: 9px;
  letter-spacing: .02em;
}

/* `bg-label-*` is Materio's soft badge and appears in 32 views. Reimplemented
   here on BCDF's semantic tints — the alternative was editing 32 files to say
   the same thing a different way. */
.bg-label-primary   { background-color: var(--bc-accent-50)  !important; color: var(--bc-accent-700) !important; }
.bg-label-secondary { background-color: var(--bc-neutral-bg) !important; color: var(--bc-neutral-fg) !important; }
.bg-label-success   { background-color: var(--bc-success-bg) !important; color: var(--bc-success-fg) !important; }
.bg-label-danger    { background-color: var(--bc-danger-bg)  !important; color: var(--bc-danger-fg)  !important; }
.bg-label-warning   { background-color: var(--bc-warning-bg) !important; color: var(--bc-warning-fg) !important; }
.bg-label-info      { background-color: var(--bc-info-bg)    !important; color: var(--bc-info-fg)    !important; }
.bg-label-dark      { background-color: var(--bc-brand-50)   !important; color: var(--bc-brand-600)  !important; }

.alert {
  --bs-alert-border-radius: var(--bc-r-card);
  border: 1px solid transparent;
  font-size: var(--bc-fs-sm);
  padding: var(--bc-s-4) var(--bc-s-5);
}
.alert-success { background: var(--bc-success-bg); color: var(--bc-success-fg); border-color: var(--bc-success-bg); }
.alert-warning { background: var(--bc-warning-bg); color: var(--bc-warning-fg); border-color: var(--bc-warning-bg); }
.alert-danger  { background: var(--bc-danger-bg);  color: var(--bc-danger-fg);  border-color: var(--bc-danger-bg); }
.alert-info    { background: var(--bc-info-bg);    color: var(--bc-info-fg);    border-color: var(--bc-info-bg); }
.alert-primary { background: var(--bc-accent-50);  color: var(--bc-accent-700); border-color: var(--bc-accent-100); }
.alert a       { color: inherit; text-decoration: underline; }

.toast { --bs-toast-border-radius: var(--bc-r-card); box-shadow: var(--bc-sh-lg); border-color: var(--bc-border); }


/* ==========================================================================
   8  MODALS AND DROPDOWNS
   Bootstrap's JS drives these; only the surface is BCDF's.
   ========================================================================== */
.modal-content {
  border: 0;
  border-radius: var(--bc-r-lg);
  box-shadow: var(--bc-sh-xl);
}
.modal-header  { border-bottom: 1px solid var(--bc-border-subtle); padding: var(--bc-s-5) var(--bc-s-6); }
.modal-title   { font-family: var(--bc-font-display); font-size: var(--bc-fs-h4); font-weight: var(--bc-fw-semi); color: var(--bc-text-strong); }
.modal-body    { padding: var(--bc-s-6); }
.modal-footer  { border-top: 1px solid var(--bc-border-subtle); padding: var(--bc-s-4) var(--bc-s-6); }
.modal-backdrop.show { opacity: .42; }

.dropdown-menu {
  --bs-dropdown-border-radius: var(--bc-r-card);
  --bs-dropdown-border-color: var(--bc-border);
  --bs-dropdown-link-hover-bg: var(--bc-grey-50);
  --bs-dropdown-link-active-bg: var(--bc-accent-50);
  --bs-dropdown-link-active-color: var(--bc-accent-700);
  --bs-dropdown-font-size: var(--bc-fs-sm);
  box-shadow: var(--bc-sh-lg);
  padding: 6px;
}
.dropdown-item { border-radius: var(--bc-r-xs); padding: 8px 10px; }
.dropdown-header { font-size: var(--bc-fs-xs); font-weight: var(--bc-fw-semi); text-transform: uppercase; letter-spacing: .06em; color: var(--bc-text-muted); }
.dropdown-divider { border-color: var(--bc-border-subtle); }


/* ==========================================================================
   9  TABS, PAGINATION, BREADCRUMB, LIST GROUP, PROGRESS
   ========================================================================== */
.nav-tabs {
  --bs-nav-tabs-border-color: var(--bc-border);
  --bs-nav-tabs-link-active-color: var(--bc-text-strong);
  --bs-nav-tabs-link-active-bg: transparent;
  --bs-nav-tabs-link-active-border-color: transparent transparent var(--bc-accent-500);
  --bs-nav-link-font-size: var(--bc-fs-sm);
  --bs-nav-link-font-weight: var(--bc-fw-medium);
  --bs-nav-link-color: var(--bc-text-muted);
  --bs-nav-link-hover-color: var(--bc-text-strong);
}
.nav-tabs .nav-link { border-width: 0 0 2px; border-radius: 0; padding: 10px 14px; }

.pagination {
  --bs-pagination-border-radius: var(--bc-r-xs);
  --bs-pagination-color: var(--bc-text-body);
  --bs-pagination-border-color: var(--bc-border);
  --bs-pagination-hover-bg: var(--bc-grey-50);
  --bs-pagination-active-bg: var(--bc-accent-500);
  --bs-pagination-active-border-color: var(--bc-accent-500);
  --bs-pagination-active-color: var(--bc-on-accent);
  --bs-pagination-font-size: var(--bc-fs-sm);
}
.breadcrumb { --bs-breadcrumb-font-size: var(--bc-fs-xs); --bs-breadcrumb-item-active-color: var(--bc-text-body); font-size: var(--bc-fs-xs); }
.breadcrumb-item a { color: var(--bc-text-muted); }

.list-group {
  --bs-list-group-border-color: var(--bc-border-subtle);
  --bs-list-group-border-radius: var(--bc-r-card);
  --bs-list-group-action-hover-bg: var(--bc-grey-25);
  --bs-list-group-active-bg: var(--bc-accent-500);
  --bs-list-group-active-border-color: var(--bc-accent-500);
  --bs-list-group-active-color: var(--bc-on-accent);
  font-size: var(--bc-fs-sm);
}
.progress { --bs-progress-bg: var(--bc-grey-100); --bs-progress-border-radius: var(--bc-r-pill); height: 8px; }
.progress-bar { background-color: var(--bc-accent-500); }


/* ==========================================================================
   10  MATERIO CLASS SHIMS
   Classes the views use that belonged to Materio, not Bootstrap. Reimplemented
   in BCDF tokens so no view markup has to change. This is the whole reason the
   re-skin is a styling change and not a 115-file rewrite.
   ========================================================================== */
/* Flex-centred so an icon placed directly inside (dashboard stat tiles, district and
   sports lists) sits in the middle of its tile. Materio centred it; the shim didn't. */
.avatar {
  position: relative; width: 38px; height: 38px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.avatar > i, .avatar > .bx, .avatar > svg { line-height: 1; margin: 0; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-initial {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  font-size: var(--bc-fs-sm); font-weight: var(--bc-fw-semi);
  background: var(--bc-grey-100); color: var(--bc-text-strong);
  text-transform: uppercase; letter-spacing: .01em;
}
.avatar-sm { width: 30px; height: 30px; }
.avatar-sm .avatar-initial { font-size: var(--bc-fs-xs); }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-lg .avatar-initial { font-size: var(--bc-fs-h4); }
.avatar-online::after {
  content: ""; position: absolute; right: 1px; bottom: 1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bc-success); border: 2px solid var(--bc-bg-surface);
}

/* Square icon-only button. Materio sized it off the font; BCDF sizes it off the
   36px minimum touch target the standard sets for mouse-first surfaces. */
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-xs { --bs-btn-padding-y: 3px; --bs-btn-padding-x: 8px; --bs-btn-font-size: var(--bc-fs-2xs); --bs-btn-border-radius: var(--bc-r-xs); }
.btn-text-secondary { --bs-btn-color: var(--bc-text-muted); --bs-btn-hover-color: var(--bc-text-strong); --bs-btn-hover-bg: var(--bc-grey-100); --bs-btn-border-color: transparent; }

.text-large     { font-size: var(--bc-fs-lg); }
.tf-icons       { /* Materio icon-size hook — boxicons already sizes itself */ }
.cursor-pointer { cursor: pointer; }
.border-dashed  { border-style: dashed !important; }
.min-w-0        { min-width: 0 !important; }
.w-px-400       { width: 400px; }
.hide-arrow.dropdown-toggle::after { display: none; }

@media (min-width: 768px) { .w-md-auto { width: auto !important; } }
@media (min-width: 1200px) { .me-xl-6 { margin-right: var(--bc-s-6) !important; } }

/* An element that should disappear when it has nothing in it. Used by the
   advertisement and fee editors for their live preview strips. */
.d-none-empty:empty { display: none !important; }

/* Password reveal control on the login form. */
.form-password-toggle .input-group-text { cursor: pointer; }
.form-password-toggle .input-group-text:hover { color: var(--bc-text-strong); }


/* ==========================================================================
   11  MIS SHELL EXTENSIONS
   Additions to the BCDF .bc-mis shell that this product needs and the
   framework does not yet ship. Per the standard these belong in the framework
   rather than in a page-local <style>, so they live here and should be folded
   back into brookscorp.layouts.css when BCDF next revs.
   ========================================================================== */

/* 11.1 Mobile drawer.
   BCDF hides the MIS sidebar below 1024px with no way to reach it. This MIS is
   used on tablets in corridors, so the sidebar becomes an off-canvas drawer
   driven by one class on <html> — no library, no initialisation order. */
@media (max-width: 1023.98px) {
  .bc-mis { grid-template-columns: 1fr; }
  .bc-mis__aside {
    display: flex;
    position: fixed; inset: 0 auto 0 0;
    width: var(--bc-sidebar-w); z-index: var(--bc-z-drawer);
    transform: translateX(-100%);
    transition: transform var(--bc-transition);
  }
  .bc-mis-open .bc-mis__aside { transform: none; box-shadow: var(--bc-sh-xl); }
  .bc-mis__overlay {
    position: fixed; inset: 0; z-index: calc(var(--bc-z-drawer) - 1);
    background: rgba(6,21,41,.5); opacity: 0; visibility: hidden;
    transition: opacity var(--bc-transition), visibility var(--bc-transition);
  }
  .bc-mis-open .bc-mis__overlay { opacity: 1; visibility: visible; }
}
@media (min-width: 1024px) {
  .bc-mis__overlay, .bc-mis__burger { display: none; }

  /* The sidebar needs a bounded height or its own overflow never engages.
     BCDF gives .bc-mis min-height:100vh — a *minimum* — so the grid row simply
     grows to fit the tallest item, which is the menu, and the whole page scrolls
     instead. A SuperUser's menu is roughly twice a 1080p viewport, so the last
     three sections were only reachable by scrolling the page and losing the
     sidebar. One height, one overflow, nothing depending on a vendor rule. */
  .bc-mis__aside { position: sticky; top: 0; height: 100vh; }
}

/* 11.2 The sidebar is the school's own colour, so everything on it takes its ink
   from --bc-on-brand rather than assuming white.

   BCDF hard-codes rgba(255,255,255,…) throughout the MIS shell, which is correct
   for the framework's navy and wrong for a school whose brand is gold or pale
   blue — the labels simply disappear. SchoolTheme picks white or near-black from
   the brand colour's own luminance, and these rules read that decision. */
.bc-mis__aside              { color: var(--bc-on-brand); }
.bc-mis__brand              { border-bottom-color: rgba(var(--bc-on-brand-rgb), .10); }
.bc-mis__brand-link         { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
/* The text column. A flex item defaults to min-width:auto, so without this it
   refuses to shrink below its content and the name runs off the 248px sidebar
   instead of wrapping — which is what was actually clipping "Paarl Gimnasium High
   School" at the panel edge, with no ellipsis to show it had happened. */
.bc-mis__brand-link > :not(.bc-mis__crest) { min-width: 0; }
.bc-mis__crest {
  width: 40px; height: 40px; flex: none; border-radius: var(--bc-r-ctrl);
  /* A white tile under the crest, always. School crests are drawn for white paper
     and most of them disappear against a saturated background. */
  background: #fff; border: 1px solid rgba(var(--bc-on-brand-rgb), .20);
  display: grid; place-items: center; overflow: hidden;
}
.bc-mis__crest img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
/* The school's own name, in a 248px sidebar.
   Crest (40) + gap (11) + padding (2 x 20) leaves about 157px, which is roughly
   twenty characters at .95rem. "Paarl Gimnasium High School" is twenty-seven, so
   nowrap + ellipsis clipped it to "Paarl Gimnasium High S" — a school reading its
   own console and not seeing its own name.

   Two lines instead of one. The crest is 40px tall and two clamped lines are ~33px,
   so the header does not grow, and the name is the one string in this product that
   should never be abbreviated. Past two lines it still ellipsises, and _Layout adds
   .is-long / .is-verylong for names that need a smaller size to get there — a length
   test in Razor, because CSS cannot measure text. The full name stays in title=. */
.bc-mis__brand-name {
  font-family: var(--bc-font-display); font-size: .95rem; font-weight: var(--bc-fw-semi);
  color: var(--bc-on-brand); letter-spacing: -.015em; line-height: 1.2;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  /* Only bites on a single unbroken word longer than the column — a normal name
     still breaks at its spaces. */
  overflow-wrap: anywhere;
}
.bc-mis__brand-name.is-long     { font-size: .86rem; letter-spacing: -.01em; }
/* A forty-five character name needs a third line even at .78rem. Three lines at
   1.25 is ~39px, still inside the 40px crest, so the header height does not move. */
.bc-mis__brand-name.is-verylong {
  font-size: .78rem; letter-spacing: 0; line-height: 1.25;
  -webkit-line-clamp: 3; line-clamp: 3;
}
/* "SCHOOL PORTAL" is a label, not a brand element. It used the accent, which on a
   coloured sidebar is either invisible or shouting; quiet ink is the right answer. */
.bc-mis__brand-tag {
  /* Block, so it sits under the name because it is told to rather than because the
     name happened to be nowrap and pushed it there. */
  display: block;
  font-size: var(--bc-fs-2xs); font-weight: var(--bc-fw-semi); letter-spacing: .09em;
  text-transform: uppercase; color: rgba(var(--bc-on-brand-rgb), .62); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bc-mis__user               { border-top-color: rgba(var(--bc-on-brand-rgb), .10); }
.bc-mis__user-name          { color: var(--bc-on-brand); }
.bc-mis__user-role          { color: rgba(var(--bc-on-brand-rgb), .55); }
/* The sidebar scrollbar is hidden outright (see .bc-mis__nav in brookscorp.css),
   so there is no thumb left to tint here. */

/* 11.3 Sidebar nav — boxicons rather than the SVG sprite BCDF assumes, because
   560 icon references in the views are already boxicons and two icon systems in
   one product is worse than the one we have. */
.bc-vnav__item i { font-size: 18px; width: 18px; text-align: center; flex: none; opacity: .9; }

/* Nav items take their ink from the brand, like everything else on the sidebar. */
.bc-vnav__item        { color: rgba(var(--bc-on-brand-rgb), .70); }
.bc-vnav__item:hover  { background: rgba(var(--bc-on-brand-rgb), .08); color: var(--bc-on-brand); }
.bc-vnav__group       { color: rgba(var(--bc-on-brand-rgb), .40); }

/* The active pill.
   BCDF hard-codes it as rgba(15,163,154,.16) — Nala teal as a literal, the one
   accent in the shell a theme could not reach. It is not themed to the accent
   either: the sidebar is now the school's primary colour and the accent is their
   secondary, and a maroon wash on a green ground is muddy at 16%. A lift of the
   sidebar's own ink reads as "selected" on any brand colour, and the 3px edge bar
   carries the accent — which is exactly how their crest pairs the two. */
.bc-vnav__item.is-active {
  background: rgba(var(--bc-on-brand-rgb), .13);
  color: var(--bc-on-brand);
}
.bc-vnav__item.is-active i        { color: var(--bc-on-brand); opacity: 1; }
/* The edge bar is the sidebar's own ink, not the accent. Paarl Gimnasium's maroon
   on their green sidebar measures 1.4:1 — a bar nobody can see. Ink is the one
   colour guaranteed to read against whatever the school chose. */
.bc-vnav__item.is-active::before  { background: var(--bc-on-brand); }

/* 11.4 Attribution. An attribution, not a second brand: it must never compete
   with the school's own identity at the top of the same sidebar. */
.bc-mis__poweredby {
  border-top: 1px solid rgba(var(--bc-on-brand-rgb), .10);
  padding: var(--bc-s-4) var(--bc-s-5);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: .85; transition: opacity var(--bc-transition);
}
.bc-mis__poweredby:hover { opacity: 1; }
.bc-mis__poweredby span { font-size: var(--bc-fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: rgba(var(--bc-on-brand-rgb), .7); }
/* The ItCognify mark is dark blue on transparent — on a school's brand colour it
   disappeared. A small white chip keeps it legible on any theme without competing. */
.bc-mis__poweredby img {
  height: 26px; width: auto; box-sizing: content-box;
  background: #fff; border-radius: 8px; padding: 4px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

/* 11.5 Content width. The standard puts the MIS on the wide container.
   Bootstrap's own container padding is deliberately left alone: `.row` uses
   negative margins that the container's padding exists to cancel, and zeroing it
   pushes every top-level row 12px off each edge of the page. The shell's padding
   is trimmed instead. */
.bc-mis__content { padding: var(--bc-s-5) var(--bc-s-4) var(--bc-s-7); }
.bc-mis__content > .container-xxl { max-width: var(--bc-container-wide); padding-inline: var(--bc-s-3); }

/* 11.6 The topbar burger. */
.bc-mis__burger {
  width: 38px; height: 38px; border: 0; background: transparent; border-radius: var(--bc-r-sm);
  color: var(--bc-text-body); font-size: 22px; display: inline-grid; place-items: center; cursor: pointer;
}
.bc-mis__burger:hover { background: var(--bc-grey-100); }

/* Neither the page title nor the school switcher is length-bounded, and flex
   children do not shrink below their content without this. */
.bc-mis__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-mis__topbar .nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
/* The switcher's own label is a school name too. 14rem clipped the longer ones on a
   topbar that had room to spare; it now takes what is available and only gives way
   when the viewport genuinely runs out. */
.bc-mis__topbar .nav-link span { max-width: min(22rem, 30vw); }


/* 11.7 Staff sign-in shell.
   BCDF ships .bc-auth as a single centred card. This MIS uses a two-panel sign-in
   whose left half carries either the school's own branding or the product artwork,
   which is a genuinely different shell rather than a variant — so it lives here as
   an extension rather than being forced into .bc-auth. Class names are unchanged
   from the Materio version so Views/Account/*.cshtml needs no edit. */
.authentication-wrapper { min-height: 100vh; background: var(--bc-bg-surface); }
.authentication-inner   { min-height: 100vh; }
.authentication-bg      { background: var(--bc-bg-surface); }
.auth-cover-panel       { background-color: var(--bc-brand-700); position: relative; overflow: hidden; }
.auth-cover-overlay     { position: absolute; inset: 0; z-index: 0;
                          background: linear-gradient(160deg, rgba(6,21,41,.60) 0%, rgba(6,21,41,.32) 100%); }
.auth-cover-content     { position: relative; z-index: 1; }
.auth-cover-art         { width: 100%; max-width: 560px; height: auto; border-radius: var(--bc-r-lg);
                          box-shadow: var(--bc-sh-xl); }
.school-logo-cover      { max-height: 80px; max-width: 260px; object-fit: contain;
                          filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.school-logo-brand      { height: 36px; width: auto; object-fit: contain; }
.w-px-400               { width: 400px; max-width: 100%; }


/* BCDF's global :focus-visible sets border-radius: 6px, which snaps a focused
   round avatar or a 16px-radius card link to a small square for as long as it has
   focus. Corrected only for the shapes that actually suffer — applied globally it
   outranks .btn and .form-control and squares off every focused control instead,
   which is a worse regression than the one it fixes. */
.avatar:focus-visible,
.rounded-circle:focus-visible,
.rounded-pill:focus-visible,
.bc-vnav__item:focus-visible,
.card a:focus-visible { border-radius: inherit; }


/* ==========================================================================
   13  FLATPICKR
   The date picker every date and datetime field in this MIS is upgraded to by
   site.js — 21 views.

   The vendored stylesheet is Materio's build: its base rules paint the panel
   `transparent` and give it no shadow and no z-index, because all of that lived
   under a `.light-style` ancestor class that went with the template. The result
   was a see-through calendar that also rendered *behind* any Bootstrap modal.
   Restyled here on BCDF tokens rather than by re-adding the Materio hook, which
   would drag the purple palette back in with it.
   ========================================================================== */
.flatpickr-calendar {
  background: var(--bc-bg-surface);
  /* The vendored sheet pins this with !important, so matching it is the only way
     to win — the one !important in this file, and it is answering another. */
  border-radius: var(--bc-r-card) !important;
  box-shadow: var(--bc-sh-lg);
  border: 1px solid var(--bc-border);
  font-family: var(--bc-font-body);
}
/* Above Bootstrap's modal (1055), or a picker inside a dialog opens behind it. */
.flatpickr-calendar.open, .flatpickr-calendar.animate.open { z-index: 1091; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }

.flatpickr-months, .flatpickr-innerContainer, .flatpickr-days,
.dayContainer, .flatpickr-weekdays, .flatpickr-time { background: var(--bc-bg-surface); }
.flatpickr-month, .flatpickr-current-month, .flatpickr-monthDropdown-months,
.numInputWrapper span, .flatpickr-weekday { color: var(--bc-text-strong); fill: var(--bc-text-strong); }
.flatpickr-weekday { font-size: var(--bc-fs-xs); font-weight: var(--bc-fw-semi); color: var(--bc-text-muted); }
.flatpickr-prev-month svg, .flatpickr-next-month svg { fill: var(--bc-text-body); }

.flatpickr-day { color: var(--bc-text-body); border-radius: var(--bc-r-xs); }
.flatpickr-day:hover { background: var(--bc-grey-100); border-color: var(--bc-grey-100); }
.flatpickr-day.today { border-color: var(--bc-accent-300); }
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--bc-accent-500); border-color: var(--bc-accent-500); color: var(--bc-on-accent);
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay,
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: var(--bc-text-subtle); }
.flatpickr-time input, .flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm { color: var(--bc-text-strong); }
.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover { background: var(--bc-grey-100); }


/* ==========================================================================
   12  PRINT
   Roosters and duty rosters are printed and stuck on a wall. That is a real
   output of this product, not an afterthought.
   ========================================================================== */
@media print {
  .bc-mis { display: block; }
  .bc-mis__aside, .bc-mis__topbar, .bc-mis__overlay, .bc-mis__poweredby,
  .btn, .dropdown, .alert-dismissible .btn-close, footer { display: none !important; }
  .bc-mis__content { padding: 0 !important; }
  .card { box-shadow: none !important; border-color: var(--bc-grey-300) !important; }
  a[href]::after { content: none !important; }
}

/* ── 15. "Soon" tag (2026-10-13) ─────────────────────────────────────────
   Marks a feature that is visible but not yet live (EMIS / SA-SAMS).
   currentColor + opacity, so it reads correctly on the themed sidebar
   (--bc-on-brand ink), in dropdowns and on outline buttons alike. */
.bc-soon-tag {
  display: inline-flex; align-items: center; flex: none;
  padding: 2px 7px; border-radius: var(--bc-r-pill, 999px);
  border: 1px solid currentColor; opacity: .72;
  font-size: 10px; font-weight: 600; line-height: 1.3;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.bc-vnav__item .bc-soon-tag { margin-left: auto; }
.dropdown-item .bc-soon-tag { opacity: .6; }

/* ── 16. School brand imagery (2026-10-13) ───────────────────────────────
   Logos arrive in every state — white sheet, transparent, coloured box — so
   they always sit on WHITE, which makes a white-background logo disappear into
   its frame instead of showing as a pasted rectangle. */

/* Upload preview tiles on Schools/Create and Schools/Edit */
.brand-tile {
  width: 88px; height: 88px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--bc-border-subtle, #e4e9f0);
  border-radius: 14px;
  box-shadow: var(--bc-sh-xs, 0 1px 2px rgba(16,24,40,.05));
}
.brand-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-tile > i { font-size: 1.6rem; color: var(--bc-text-subtle, #98a2b3); }

/* App icon: shaped like a home-screen icon (iOS ~22% corner), shown edge to edge */
.brand-tile--icon { padding: 0; border-radius: 22%; box-shadow: var(--bc-sh-sm, 0 2px 6px rgba(16,24,40,.08)); }
.brand-tile--icon img { object-fit: cover; }

/* Schools list card */
.school-card__banner {
  height: 104px; position: relative;
  background-size: cover; background-position: center;
}
.school-card__banner::after {          /* soft fade so the badge edge reads on any photo */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.28) 100%);
}
.school-card__badge {
  position: relative; z-index: 1;
  width: 76px; height: 76px; margin: -38px 0 0 1.25rem;
  display: grid; place-items: center; overflow: hidden;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--school-ring, var(--bc-brand-500));
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(16,24,40,.14);
}
.school-card__badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.school-card__badge span { font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; color: var(--bc-text-strong); }
