/* ============================================================
   MDMS DESIGN SYSTEM v2  (v77)
   ============================================================
   A restrained, enterprise look: royal blue on white and cool
   grey, one icon set (Bootstrap Icons), one type family (Inter,
   with a system fallback so a school server with no internet
   still looks right), two elevation levels, and motion that is
   fast enough not to be noticed.

   It is a LAYER over Bootstrap 5.3, so every existing page picks
   it up without being edited. Delete this file and the system
   returns to plain Bootstrap.

   Dark mode: <html data-theme="dark"> (also sets data-bs-theme,
   so Bootstrap's own components follow).
   ============================================================ */

:root {
  /* Royal blue. A school that has set its own brand colour (Settings
     > Branding) overrides --ds-brand from header.php. */
  --ds-brand:        #2451c8;
  --ds-brand-dark:   #1b3fa3;
  --ds-brand-soft:   #eaf0fd;
  --ds-brand-ring:   rgba(36, 81, 200, .22);

  --ds-ink:     #0f1a2e;
  --ds-body:    #334155;
  --ds-muted:   #64748b;
  --ds-line:    #e3e8ef;
  --ds-surface: #f5f7fb;
  --ds-card:    #ffffff;
  --ds-raised:  #ffffff;
  --ds-hover:   #f1f5f9;

  --ds-ok:   #15803d;  --ds-ok-soft:   #e7f6ec;
  --ds-warn: #b45309;  --ds-warn-soft: #fdf3dc;
  --ds-bad:  #b91c1c;  --ds-bad-soft:  #fdeaea;
  --ds-info: #0e7490;  --ds-info-soft: #e3f4f8;

  --ds-side-bg:     #ffffff;
  --ds-side-text:   #475569;
  --ds-side-muted:  #94a3b8;
  --ds-side-hover:  #f1f5f9;
  --ds-side-active: #eaf0fd;

  --ds-radius-sm: 8px;
  --ds-radius:    12px;
  --ds-radius-lg: 16px;

  --ds-shadow:    0 1px 2px rgba(15, 26, 46, .05), 0 1px 3px rgba(15, 26, 46, .04);
  --ds-shadow-md: 0 8px 24px rgba(15, 26, 46, .09);

  --ds-sidebar-w: 268px;
  --ds-sidebar-collapsed: 72px;
  --ds-header-h: 62px;

  --ds-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ds-ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --ds-brand:        #6b93ff;
  --ds-brand-dark:   #8fadff;
  --ds-brand-soft:   #1b2745;
  --ds-brand-ring:   rgba(107, 147, 255, .28);

  --ds-ink:     #eef2f9;
  --ds-body:    #c5cede;
  --ds-muted:   #8b98ad;
  --ds-line:    #263145;
  --ds-surface: #0e1524;
  --ds-card:    #151e30;
  --ds-raised:  #1a2438;
  --ds-hover:   #1c2740;

  --ds-ok-soft:   #12291b;
  --ds-warn-soft: #33270f;
  --ds-bad-soft:  #341616;
  --ds-info-soft: #0f2a31;

  --ds-side-bg:     #111a2b;
  --ds-side-text:   #b3bfd2;
  --ds-side-muted:  #6f7d94;
  --ds-side-hover:  #1a2439;
  --ds-side-active: #1d2b4d;

  --ds-shadow:    0 1px 2px rgba(0, 0, 0, .35);
  --ds-shadow-md: 0 10px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ============================================================
   1. FOUNDATION
   ============================================================ */
html { scroll-behavior: smooth; }
body {
  font-family: var(--ds-font);
  background: var(--ds-surface);
  color: var(--ds-body);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { color: var(--ds-ink); font-weight: 650; letter-spacing: -.012em; line-height: 1.3; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.22rem; }
h4 { font-size: 1.06rem; } h5 { font-size: .98rem; } h6 { font-size: .88rem; }
a { color: var(--ds-brand); text-decoration: none; transition: color .15s var(--ds-ease); }
a:hover { color: var(--ds-brand-dark); }
.text-muted { color: var(--ds-muted) !important; }
::selection { background: var(--ds-brand-ring); }
:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; }
hr { border-color: var(--ds-line); opacity: 1; }
.bg-white, .bg-light { background-color: var(--ds-card) !important; }
.border, .border-top, .border-bottom { border-color: var(--ds-line) !important; }

/* ============================================================
   2. SHELL
   ============================================================ */
.ds-shell { display: flex; min-height: 100vh; }

.ds-sidebar {
  width: var(--ds-sidebar-w); flex: 0 0 var(--ds-sidebar-w);
  background: var(--ds-side-bg); color: var(--ds-side-text);
  border-right: 1px solid var(--ds-line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 1040;
  transition: width .22s var(--ds-ease), flex-basis .22s var(--ds-ease), transform .22s var(--ds-ease);
}
.ds-sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .4rem .65rem 1.2rem; scrollbar-width: thin; scrollbar-color: var(--ds-line) transparent; }

.ds-brand {
  display: flex; align-items: center; gap: .7rem; padding: 0 1rem;
  height: var(--ds-header-h); flex: 0 0 var(--ds-header-h);
  border-bottom: 1px solid var(--ds-line); color: var(--ds-ink);
}
.ds-brand:hover { color: var(--ds-ink); }
.ds-brand-logo {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px; object-fit: contain;
  background: var(--ds-brand-soft); padding: 4px; border: 1px solid var(--ds-line);
}
.ds-brand-text { min-width: 0; line-height: 1.2; }
.ds-brand-text b { display: block; font-size: .92rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-brand-text span { display: block; font-size: .72rem; color: var(--ds-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ds-nav-search { position: relative; padding: .75rem .65rem .35rem; }
.ds-nav-search i { position: absolute; left: 1.35rem; top: 50%; transform: translateY(-30%); color: var(--ds-side-muted); font-size: .85rem; pointer-events: none; }
.ds-nav-search input {
  width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--ds-line);
  background: var(--ds-surface); color: var(--ds-ink); font-size: .84rem; padding: 0 .7rem 0 2rem;
}
.ds-nav-search input:focus { outline: none; border-color: var(--ds-brand); box-shadow: 0 0 0 3px var(--ds-brand-ring); background: var(--ds-card); }

.ds-group { margin-top: .35rem; }
.ds-group-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; color: var(--ds-side-muted);
  font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: .7rem .6rem .3rem; cursor: pointer; text-align: left;
}
.ds-group-head:hover { color: var(--ds-ink); }
.ds-group-head .chev { font-size: .7rem; transition: transform .2s var(--ds-ease); }
.ds-group.closed .ds-group-head .chev { transform: rotate(-90deg); }
.ds-group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s var(--ds-ease); }
.ds-group-body > div { overflow: hidden; }
.ds-group.closed .ds-group-body { grid-template-rows: 0fr; }

.ds-link {
  position: relative; display: flex; align-items: center; gap: .72rem;
  padding: .5rem .7rem; margin: 1px 0; border-radius: 9px;
  color: var(--ds-side-text); font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background .14s var(--ds-ease), color .14s var(--ds-ease), transform .14s var(--ds-ease);
}
.ds-link i { font-size: 1.05rem; width: 20px; text-align: center; flex: 0 0 20px; color: var(--ds-side-muted); transition: color .14s; }
.ds-link:hover { background: var(--ds-side-hover); color: var(--ds-ink); transform: translateX(2px); }
.ds-link:hover i { color: var(--ds-brand); }
.ds-link.active { background: var(--ds-side-active); color: var(--ds-brand); font-weight: 650; }
.ds-link.active i { color: var(--ds-brand); }
.ds-link.active::before {
  content: ""; position: absolute; left: -.65rem; top: 22%; bottom: 22%; width: 4px;
  background: var(--ds-brand); border-radius: 0 4px 4px 0;
}
.ds-link .ds-link-text { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ds-link .badge { margin-left: auto; }
.ds-link.hidden-by-search, .ds-group.hidden-by-search { display: none; }

.ds-side-foot { padding: .7rem .65rem; border-top: 1px solid var(--ds-line); display: flex; gap: .5rem; align-items: center; }
.ds-side-foot .ds-link { flex: 1; margin: 0; }
.ds-collapse-btn { width: 34px; height: 34px; flex: 0 0 34px; }

[data-theme="dark"] .ds-brand-logo, [data-theme="dark"] .ds-topbar-school img { background: #fff; border-radius: 9px; padding: 3px; }

/* Compact mode: icons only, labels appear as tooltips */
.ds-shell.collapsed .ds-sidebar { width: var(--ds-sidebar-collapsed); flex-basis: var(--ds-sidebar-collapsed); }
.ds-shell.collapsed .ds-brand-text, .ds-shell.collapsed .ds-link-text, .ds-shell.collapsed .ds-nav-search,
.ds-shell.collapsed .ds-group-head span, .ds-shell.collapsed .ds-group-head .chev,
.ds-shell.collapsed .ds-link .badge { display: none; }
.ds-shell.collapsed .ds-brand { justify-content: center; padding: 0; }
.ds-shell.collapsed .ds-link { justify-content: center; padding: .6rem 0; }
.ds-shell.collapsed .ds-group-head { height: 1px; padding: 0; margin: .5rem .8rem; background: var(--ds-line); }
.ds-shell.collapsed .ds-group.closed .ds-group-body { grid-template-rows: 1fr; }
.ds-shell.collapsed .ds-link[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--ds-ink); color: var(--ds-card); font-size: .78rem; padding: .3rem .6rem; border-radius: 7px; z-index: 5; pointer-events: none;
}
.ds-shell.collapsed .ds-sidebar-scroll { overflow: visible; }

.ds-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Top bar */
.ds-topbar {
  height: var(--ds-header-h); background: var(--ds-card); border-bottom: 1px solid var(--ds-line);
  display: flex; align-items: center; gap: .6rem; padding: 0 1.1rem;
  position: sticky; top: 0; z-index: 1030;
}
.ds-topbar-title { font-size: 1.02rem; font-weight: 650; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 28ch; }
.ds-topbar-school { display: flex; align-items: center; gap: .55rem; margin-right: .3rem; min-width: 0; flex: 0 1 auto; }
.ds-topbar-school img { height: 30px; width: 30px; object-fit: contain; }
.ds-topbar-school b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
@media (max-width: 1399.98px) { .ds-topbar-title { display: none; } }

.ds-search { position: relative; flex: 1 1 320px; max-width: 460px; margin: 0 auto 0 .6rem; }
.ds-search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--ds-line); background: var(--ds-surface);
  padding: 0 3.4rem 0 2.2rem; font-size: .87rem; color: var(--ds-ink);
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.ds-search input:focus { outline: none; border-color: var(--ds-brand); background: var(--ds-card); box-shadow: 0 0 0 3px var(--ds-brand-ring); }
.ds-search > i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--ds-muted); }
.ds-search kbd { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font-size: .68rem; background: var(--ds-card); color: var(--ds-muted); border: 1px solid var(--ds-line); border-radius: 5px; padding: .05rem .35rem; }
.ds-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--ds-raised); border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-md); z-index: 1060; overflow: hidden; display: none; max-height: 60vh; overflow-y: auto;
}
.ds-search-results.open { display: block; animation: dsPop .14s var(--ds-ease); }
.ds-search-results a { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; color: var(--ds-body); }
.ds-search-results a:hover, .ds-search-results a.sel { background: var(--ds-hover); text-decoration: none; }
.ds-search-results .grp { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-muted); padding: .55rem .9rem .2rem; }
.ds-search-results small { color: var(--ds-muted); }

.ds-icon-btn {
  position: relative; background: transparent; border: 1px solid transparent; width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ds-body); font-size: 1.08rem; cursor: pointer;
  transition: background .14s, color .14s, transform .1s;
}
.ds-icon-btn:hover { background: var(--ds-hover); color: var(--ds-ink); }
.ds-icon-btn:active { transform: scale(.94); }
.ds-icon-btn .dot {
  position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #dc2626; color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ds-card); line-height: 1;
}
.ds-year-pill {
  display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .75rem; border-radius: 999px;
  border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-ink); font-size: .8rem; font-weight: 600; cursor: pointer;
}
.ds-year-pill:hover { background: var(--ds-hover); }
.ds-year-pill.archive { background: var(--ds-warn-soft); border-color: transparent; color: var(--ds-warn); }
.ds-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ds-brand); color: #fff; font-weight: 650; font-size: .8rem;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; object-fit: cover; letter-spacing: .02em;
}
.ds-avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.ds-user-btn { display: flex; align-items: center; gap: .55rem; background: none; border: 0; padding: .2rem .35rem .2rem .2rem; border-radius: 999px; cursor: pointer; }
.ds-user-btn:hover { background: var(--ds-hover); }
.ds-user-btn .who { text-align: left; line-height: 1.15; }
.ds-user-btn .who b { display: block; font-size: .8rem; color: var(--ds-ink); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-user-btn .who span { font-size: .68rem; color: var(--ds-muted); }

.ds-archive-banner {
  background: var(--ds-warn-soft); color: var(--ds-warn); border-bottom: 1px solid var(--ds-line);
  padding: .5rem 1.1rem; font-size: .85rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.ds-archive-banner a { font-weight: 650; color: inherit; text-decoration: underline; }

.ds-content { padding: 1.5rem 1.4rem 2.5rem; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }
.ds-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem; margin-bottom: 1.4rem; }
.ds-page-head h1, .ds-page-head h2 { margin: 0 0 .15rem; }
.ds-page-head .sub { color: var(--ds-muted); font-size: .9rem; }

.ds-shell-bare { min-height: 100vh; }

/* Mobile: the sidebar slides over the page */
@media (max-width: 991.98px) {
  .ds-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-102%); box-shadow: var(--ds-shadow-md); }
  .ds-shell.mobile-open .ds-sidebar { transform: none; }
  .ds-scrim { position: fixed; inset: 0; background: rgba(9, 14, 26, .5); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .ds-shell.mobile-open .ds-scrim { opacity: 1; pointer-events: auto; }
  .ds-shell.collapsed .ds-sidebar { width: var(--ds-sidebar-w); flex-basis: var(--ds-sidebar-w); }
  .ds-shell.collapsed .ds-brand-text, .ds-shell.collapsed .ds-link-text, .ds-shell.collapsed .ds-nav-search { display: block; }
  .ds-shell.collapsed .ds-link { justify-content: flex-start; padding: .5rem .7rem; }
  .ds-topbar-school { display: flex; }
  .ds-topbar-title { display: none; }
  .ds-user-btn .who { display: none; }
  .ds-content { padding: 1.1rem .85rem 2rem; }
}
@media (max-width: 575.98px) {
  .ds-search { display: none; }
  .ds-search.mobile-open { display: block; position: absolute; left: .6rem; right: .6rem; top: calc(var(--ds-header-h) - 8px); max-width: none; z-index: 1050; }
  .ds-hide-xs { display: none !important; }
  .ds-topbar { padding: 0 .6rem; gap: .25rem; }
  .ds-topbar .ms-auto { margin-left: auto; }
}
@media (min-width: 576px) { .ds-search-toggle { display: none; } }

/* ============================================================
   3. CARDS
   ============================================================ */
.card {
  background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow); color: var(--ds-body);
}
.card.shadow-sm { box-shadow: var(--ds-shadow) !important; }
.card-header {
  background: transparent; border-bottom: 1px solid var(--ds-line); font-weight: 650; color: var(--ds-ink);
  padding: .9rem 1.15rem; border-radius: var(--ds-radius-lg) var(--ds-radius-lg) 0 0 !important;
}
.card-body { padding: 1.15rem; }
.card-footer { background: var(--ds-surface); border-top: 1px solid var(--ds-line); padding: .75rem 1.15rem; border-radius: 0 0 var(--ds-radius-lg) var(--ds-radius-lg) !important; }
a.card, .ds-card-hover { transition: transform .18s var(--ds-ease), box-shadow .18s var(--ds-ease), border-color .18s; }
a.card:hover, .ds-card-hover:hover { transform: translateY(-3px); box-shadow: var(--ds-shadow-md); border-color: var(--ds-brand-ring); text-decoration: none; }

.ds-stat { display: flex; align-items: flex-start; gap: .95rem; }
.ds-stat-icon {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; background: var(--ds-brand-soft); color: var(--ds-brand);
}
.ds-stat-icon.ok { background: var(--ds-ok-soft); color: var(--ds-ok); }
.ds-stat-icon.warn { background: var(--ds-warn-soft); color: var(--ds-warn); }
.ds-stat-icon.bad { background: var(--ds-bad-soft); color: var(--ds-bad); }
.ds-stat-icon.info { background: var(--ds-info-soft); color: var(--ds-info); }
.ds-stat-body { min-width: 0; flex: 1; }
.ds-stat-title { font-size: .74rem; color: var(--ds-muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.ds-stat-value { font-size: 1.9rem; font-weight: 700; color: var(--ds-ink); line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ds-stat-note { font-size: .8rem; color: var(--ds-muted); }
.ds-trend { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; font-weight: 650; padding: .1rem .45rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; }
.ds-trend.up { background: var(--ds-ok-soft); color: var(--ds-ok); }
.ds-trend.down { background: var(--ds-bad-soft); color: var(--ds-bad); }
.ds-trend.flat { background: var(--ds-hover); color: var(--ds-muted); }

.ds-welcome {
  border-radius: var(--ds-radius-lg); padding: 1.5rem 1.6rem; background: var(--ds-brand); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; position: relative; overflow: hidden;
}
.ds-welcome::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.ds-welcome h2 { color: #fff; margin: 0 0 .2rem; font-size: 1.4rem; }
.ds-welcome p { margin: 0; color: rgba(255,255,255,.82); }
.ds-welcome .badge { background: rgba(255,255,255,.18) !important; color: #fff !important; }
[data-theme="dark"] .ds-welcome { background: #24407f; }

.ds-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .7rem; }
.ds-quick a, .mdms-action {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: 1rem .5rem;
  border: 1px solid var(--ds-line); border-radius: var(--ds-radius); background: var(--ds-card); color: var(--ds-body);
  font-size: .82rem; font-weight: 550; transition: transform .16s var(--ds-ease), box-shadow .16s, border-color .16s;
}
.ds-quick a:hover, .mdms-action:hover { transform: translateY(-2px); box-shadow: var(--ds-shadow-md); border-color: var(--ds-brand-ring); color: var(--ds-brand); text-decoration: none; }
.ds-quick a i, .mdms-action i { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--ds-brand-soft); color: var(--ds-brand); font-size: 1.15rem; margin: 0; }
.mdms-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .7rem; }

.ds-feed { list-style: none; margin: 0; padding: 0; }
.ds-feed li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--ds-line); }
.ds-feed li:last-child { border-bottom: 0; }
.ds-feed .ico { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--ds-brand-soft); color: var(--ds-brand); display: flex; align-items: center; justify-content: center; }
.ds-feed .txt { min-width: 0; flex: 1; font-size: .86rem; color: var(--ds-ink); }
.ds-feed .when { font-size: .74rem; color: var(--ds-muted); }

.ds-timeline { position: relative; padding-left: 1.6rem; margin: 0; list-style: none; }
.ds-timeline::before { content: ""; position: absolute; left: .55rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--ds-line); }
.ds-timeline li { position: relative; padding: 0 0 1.15rem; }
.ds-timeline li::before { content: ""; position: absolute; left: -1.38rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--ds-card); border: 3px solid var(--ds-brand); }
.ds-timeline li.ok::before { border-color: var(--ds-ok); } .ds-timeline li.warn::before { border-color: var(--ds-warn); } .ds-timeline li.bad::before { border-color: var(--ds-bad); }
.ds-timeline .t { font-weight: 650; color: var(--ds-ink); font-size: .9rem; } .ds-timeline .d { font-size: .78rem; color: var(--ds-muted); }

/* ============================================================
   4. TABLES
   ============================================================ */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ds-body); --bs-table-striped-bg: var(--ds-surface); --bs-table-hover-bg: var(--ds-brand-soft); --bs-table-border-color: var(--ds-line); color: var(--ds-body); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--ds-line); background-color: var(--bs-table-bg); }
.table thead th {
  background: var(--ds-surface) !important; color: var(--ds-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; border-bottom: 1px solid var(--ds-line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover > * { background-color: var(--ds-brand-soft) !important; }
.table td { vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--ds-surface); }
.table-light, .table-light > th, .table-light > td { --bs-table-bg: var(--ds-surface); --bs-table-color: var(--ds-muted); }
.table-responsive { border-radius: var(--ds-radius); }
.ds-table-wrap {
  border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); background: var(--ds-card); box-shadow: var(--ds-shadow); overflow: hidden; margin-bottom: 1rem;
}
.ds-table-scroll { overflow: auto; max-height: 72vh; }
.ds-table-scroll .table thead th { position: sticky; top: 0; }
.ds-table-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--ds-line); }
.ds-table-bar .ds-tsearch { position: relative; flex: 1 1 220px; max-width: 320px; }
.ds-table-bar .ds-tsearch i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ds-muted); font-size: .85rem; }
.ds-table-bar .ds-tsearch input { padding-left: 2rem; height: 36px; min-height: 36px; font-size: .85rem; }
.ds-table-bar .form-select { min-width: 150px; }
.ds-table-bar .count { margin-left: auto; font-size: .8rem; color: var(--ds-muted); }
.ds-table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .9rem; border-top: 1px solid var(--ds-line); font-size: .82rem; color: var(--ds-muted); }
th.ds-sortable { cursor: pointer; user-select: none; }
th.ds-sortable::after { content: "\F127"; font-family: "bootstrap-icons"; font-size: .62rem; margin-left: .4rem; opacity: .35; }
th.ds-sortable.asc::after { content: "\F235"; opacity: 1; color: var(--ds-brand); }
th.ds-sortable.desc::after { content: "\F229"; opacity: 1; color: var(--ds-brand); }
.ds-actions { display: inline-flex; gap: .3rem; flex-wrap: nowrap; }
.ds-actions .btn { padding: .25rem .55rem; }

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
  position: relative; overflow: hidden; border-radius: 10px; font-weight: 550; font-size: .875rem; padding: .48rem 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; line-height: 1.35;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s, color .15s;
}
.btn:not(.btn-sm):not(.btn-link):not(.btn-lg) { min-height: 40px; }
.btn-sm { font-size: .8rem; padding: .3rem .7rem; border-radius: 8px; }
.btn-lg { font-size: 1rem; padding: .65rem 1.3rem; border-radius: 12px; min-height: 48px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .55; }
.btn + .btn { margin-left: 0; }
.btn-primary { background-color: var(--ds-brand); border-color: var(--ds-brand); --bs-btn-bg: var(--ds-brand); --bs-btn-border-color: var(--ds-brand); --bs-btn-hover-bg: var(--ds-brand-dark); --bs-btn-hover-border-color: var(--ds-brand-dark); --bs-btn-active-bg: var(--ds-brand-dark); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; box-shadow: 0 1px 2px rgba(36,81,200,.25); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background-color: var(--ds-brand-dark); border-color: var(--ds-brand-dark); }
.btn-outline-primary { color: var(--ds-brand); border-color: var(--ds-brand-ring); background: transparent; }
.btn-outline-primary:hover { background-color: var(--ds-brand-soft); color: var(--ds-brand-dark); border-color: var(--ds-brand); }
[data-theme="dark"] .btn-primary { --bs-btn-color: #0b1220; --bs-btn-hover-color: #0b1220; }
.btn-outline-primary { --bs-btn-color: var(--ds-brand); --bs-btn-border-color: var(--ds-brand-ring); --bs-btn-hover-bg: var(--ds-brand-soft); --bs-btn-hover-color: var(--ds-brand-dark); --bs-btn-hover-border-color: var(--ds-brand); --bs-btn-active-bg: var(--ds-brand-soft); --bs-btn-active-color: var(--ds-brand-dark); }
.btn-secondary { --bs-btn-bg: #475569; --bs-btn-border-color: #475569; --bs-btn-hover-bg: #334155; --bs-btn-hover-border-color: #334155; }
.btn-outline-secondary { --bs-btn-color: var(--ds-body); --bs-btn-border-color: var(--ds-line); --bs-btn-hover-bg: var(--ds-hover); --bs-btn-hover-color: var(--ds-ink); --bs-btn-hover-border-color: var(--ds-muted); --bs-btn-active-bg: var(--ds-hover); --bs-btn-active-color: var(--ds-ink); }
.btn-success { --bs-btn-bg: var(--ds-ok); --bs-btn-border-color: var(--ds-ok); --bs-btn-hover-bg: #166534; --bs-btn-hover-border-color: #166534; }
.btn-warning { --bs-btn-bg: #d97706; --bs-btn-border-color: #d97706; --bs-btn-color: #fff; --bs-btn-hover-bg: #b45309; --bs-btn-hover-border-color: #b45309; --bs-btn-hover-color: #fff; }
.btn-danger { --bs-btn-bg: #dc2626; --bs-btn-border-color: #dc2626; --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; }
.btn-outline-danger, .btn-outline-success, .btn-outline-warning { --bs-btn-border-color: var(--ds-line); }
.ds-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.4); transform: scale(0); animation: dsRipple .5s ease-out; pointer-events: none; }
.btn-outline-primary .ds-ripple, .btn-outline-secondary .ds-ripple, .btn-light .ds-ripple { background: var(--ds-brand-ring); }
@keyframes dsRipple { to { transform: scale(3); opacity: 0; } }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after { content: ""; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: dsSpin .6s linear infinite; }
@keyframes dsSpin { to { transform: rotate(360deg); } }

/* ============================================================
   6. FORMS
   ============================================================ */
.form-label { font-weight: 550; font-size: .84rem; color: var(--ds-ink); margin-bottom: .32rem; }
.form-label.is-required::after, label.is-required::after { content: " *"; color: #dc2626; font-weight: 700; }
.form-control, .form-select {
  background-color: var(--ds-card); color: var(--ds-ink); border: 1px solid var(--ds-line); border-radius: 10px;
  font-size: .9rem; padding: .5rem .8rem; min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
.form-control-sm, .form-select-sm { min-height: 34px; font-size: .84rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { background-color: var(--ds-card); color: var(--ds-ink); border-color: var(--ds-brand); box-shadow: 0 0 0 3px var(--ds-brand-ring); }
.form-control::placeholder { color: #94a3b8; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--ds-surface); opacity: .8; }
.form-text { font-size: .78rem; color: var(--ds-muted); }
.form-check-input:checked { background-color: var(--ds-brand); border-color: var(--ds-brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--ds-brand-ring); border-color: var(--ds-brand); }
.form-floating > label { color: var(--ds-muted); }
.input-group-text { background: var(--ds-surface); border-color: var(--ds-line); color: var(--ds-muted); border-radius: 10px; }
.is-invalid, .was-validated :invalid { border-color: #dc2626 !important; }
.ds-field-error { color: #dc2626; font-size: .78rem; margin-top: .25rem; display: flex; align-items: center; gap: .3rem; animation: dsPop .15s var(--ds-ease); }
.ds-form-section { padding: 1.1rem 0; border-top: 1px solid var(--ds-line); }
.ds-form-section:first-child { border-top: 0; padding-top: 0; }
.ds-form-section h6 { text-transform: uppercase; letter-spacing: .07em; font-size: .72rem; color: var(--ds-muted); margin-bottom: .8rem; }

.ds-steps { display: flex; gap: .5rem; margin-bottom: 1.3rem; counter-reset: st; flex-wrap: wrap; }
.ds-steps .st { flex: 1 1 130px; display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 12px; border: 1px solid var(--ds-line); background: var(--ds-card); font-size: .84rem; font-weight: 600; color: var(--ds-muted); }
.ds-steps .st::before { counter-increment: st; content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--ds-hover); color: var(--ds-muted); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; flex: 0 0 26px; }
.ds-steps .st.active { color: var(--ds-brand); border-color: var(--ds-brand); background: var(--ds-brand-soft); }
.ds-steps .st.active::before { background: var(--ds-brand); color: #fff; }
.ds-steps .st.done::before { content: "\F26A"; font-family: "bootstrap-icons"; background: var(--ds-ok); color: #fff; }
.ds-step-pane { display: none; animation: dsFade .2s var(--ds-ease); } .ds-step-pane.active { display: block; }

/* ============================================================
   7. BADGES, ALERTS, TABS, PAGINATION, MODALS, DROPDOWNS
   ============================================================ */
.badge { font-weight: 650; font-size: .72rem; padding: .36em .65em; border-radius: 7px; letter-spacing: .01em; }
.badge.bg-primary { background: var(--ds-brand) !important; }
.badge.bg-success { background: var(--ds-ok-soft) !important; color: var(--ds-ok) !important; }
.badge.bg-warning { background: var(--ds-warn-soft) !important; color: var(--ds-warn) !important; }
.badge.bg-danger  { background: var(--ds-bad-soft) !important; color: var(--ds-bad) !important; }
.badge.bg-info    { background: var(--ds-info-soft) !important; color: var(--ds-info) !important; }
.badge.bg-secondary { background: var(--ds-hover) !important; color: var(--ds-muted) !important; }
.badge.bg-light { background: var(--ds-hover) !important; color: var(--ds-body) !important; }
.badge.bg-dark { background: var(--ds-ink) !important; color: var(--ds-card) !important; }
.badge.text-dark { color: inherit !important; }
.ds-link .badge.bg-danger { background: #dc2626 !important; color: #fff !important; }

.alert { border: 1px solid var(--ds-line); border-left-width: 4px; border-radius: var(--ds-radius); padding: .85rem 1.1rem; font-size: .9rem; animation: dsFade .25s var(--ds-ease); }
.alert-success { border-left-color: var(--ds-ok); background: var(--ds-ok-soft); color: var(--ds-ok); }
.alert-warning { border-left-color: #d97706; background: var(--ds-warn-soft); color: var(--ds-warn); }
.alert-danger  { border-left-color: #dc2626; background: var(--ds-bad-soft); color: var(--ds-bad); }
.alert-info    { border-left-color: var(--ds-info); background: var(--ds-info-soft); color: var(--ds-info); }
.alert-secondary, .alert-light { background: var(--ds-surface); color: var(--ds-body); border-left-color: var(--ds-muted); }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

.nav-tabs { border-bottom: 1px solid var(--ds-line); gap: .2rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ds-muted); font-weight: 600; font-size: .88rem; padding: .6rem .95rem; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--ds-ink); border-bottom-color: var(--ds-line); }
.nav-tabs .nav-link.active { color: var(--ds-brand); background: transparent; border-bottom-color: var(--ds-brand); }
.nav-pills .nav-link { border-radius: 999px; color: var(--ds-body); font-weight: 600; font-size: .85rem; }
.nav-pills .nav-link.active { background: var(--ds-brand); color: #fff; }

.pagination { --bs-pagination-color: var(--ds-body); --bs-pagination-bg: var(--ds-card); --bs-pagination-border-color: var(--ds-line); --bs-pagination-hover-bg: var(--ds-hover); --bs-pagination-hover-color: var(--ds-ink); --bs-pagination-hover-border-color: var(--ds-line); --bs-pagination-active-bg: var(--ds-brand); --bs-pagination-active-border-color: var(--ds-brand); --bs-pagination-disabled-bg: var(--ds-surface); --bs-pagination-disabled-border-color: var(--ds-line); --bs-pagination-border-radius: 9px; gap: .25rem; }
.page-link { border-radius: 9px !important; }

.modal-content { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-md); }
.modal-header, .modal-footer { border-color: var(--ds-line); }
.modal.fade .modal-dialog { transform: translateY(12px) scale(.98); transition: transform .2s var(--ds-ease), opacity .2s; }
.modal.show .modal-dialog { transform: none; }
.dropdown-menu { background: var(--ds-raised); border: 1px solid var(--ds-line); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-md); padding: .4rem; animation: dsPop .14s var(--ds-ease); color: var(--ds-body); }
.dropdown-item { border-radius: 8px; padding: .5rem .8rem; font-size: .87rem; color: var(--ds-body); display: flex; align-items: center; gap: .6rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--ds-hover); color: var(--ds-ink); }
.dropdown-item i { color: var(--ds-muted); width: 18px; text-align: center; }
.dropdown-divider { border-color: var(--ds-line); }
.dropdown-header { color: var(--ds-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; }
.tooltip { --bs-tooltip-bg: var(--ds-ink); --bs-tooltip-color: var(--ds-card); font-size: .78rem; }
.progress { height: 8px; border-radius: 999px; background: var(--ds-hover); }
.progress-bar { background: var(--ds-brand); border-radius: 999px; }
.list-group-item { background: transparent; border-color: var(--ds-line); color: var(--ds-body); }
.text-primary { color: var(--ds-brand) !important; }
.text-success { color: var(--ds-ok) !important; } .text-danger { color: var(--ds-bad) !important; } .text-warning { color: var(--ds-warn) !important; }
.border-primary { border-color: var(--ds-brand-ring) !important; }
.bg-primary.bg-opacity-10 { background: var(--ds-brand-soft) !important; }
kbd { background: var(--ds-surface); color: var(--ds-body); border: 1px solid var(--ds-line); }

/* ============================================================
   8. EMPTY STATES, SKELETONS, TOASTS
   ============================================================ */
.mdms-empty, .ds-empty { text-align: center; padding: 2.8rem 1rem; color: var(--ds-muted); }
.mdms-empty i, .ds-empty i {
  font-size: 1.9rem; width: 74px; height: 74px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ds-brand-soft); color: var(--ds-brand); margin: 0 auto 1rem;
}
.mdms-empty h6, .ds-empty h5 { color: var(--ds-ink); font-size: 1.02rem; margin-bottom: .3rem; }
.mdms-empty p, .ds-empty p { max-width: 420px; margin: 0 auto 1.1rem; font-size: .88rem; }
.ds-skeleton { background: linear-gradient(90deg, var(--ds-hover) 25%, var(--ds-line) 37%, var(--ds-hover) 63%); background-size: 400% 100%; animation: dsShimmer 1.3s ease infinite; border-radius: 8px; min-height: 1em; }
@keyframes dsShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.ds-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.ds-toast { background: var(--ds-ink); color: var(--ds-card); border-radius: 12px; padding: .7rem 1rem; font-size: .86rem; box-shadow: var(--ds-shadow-md); animation: dsPop .2s var(--ds-ease); display: flex; gap: .6rem; align-items: center; max-width: 360px; }
.ds-page-loader { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--ds-brand); z-index: 3000; transition: width .3s var(--ds-ease), opacity .3s; }
.ds-avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.pill-m { background: #dbeafe; color: #1d4ed8; } .pill-f { background: #fce7f3; color: #be185d; }

/* ============================================================
   9. MOTION - fast, and off for anyone who asks for less
   ============================================================ */
@keyframes dsFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes dsPop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .ds-content > * { animation: dsFade .28s var(--ds-ease) both; }
  .ds-content > *:nth-child(2) { animation-delay: .03s; } .ds-content > *:nth-child(3) { animation-delay: .06s; }
  .ds-content > *:nth-child(4) { animation-delay: .09s; } .ds-content > *:nth-child(n+5) { animation-delay: .12s; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================================================
   10. AUTH SCREENS (login)
   ============================================================ */
.ds-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--ds-surface); }
.ds-auth-art { position: relative; background: #0f2a63; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.ds-auth-art .brand { display: flex; align-items: center; gap: .7rem; font-weight: 700; font-size: 1.05rem; color: #fff; }
.ds-auth-art .brand img { height: 38px; background: #fff; border-radius: 10px; padding: 4px; }
.ds-auth-art h1 { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.4rem); font-weight: 750; line-height: 1.15; max-width: 16ch; margin-bottom: .9rem; }
.ds-auth-art p { color: #c3d3f5; max-width: 42ch; line-height: 1.6; }
.ds-auth-art svg.ill { position: absolute; right: -30px; bottom: -20px; width: 78%; max-width: 560px; opacity: .95; pointer-events: none; }
.ds-auth-art .pts { display: grid; gap: .6rem; margin-top: 1.4rem; font-size: .9rem; color: #dce7ff; position: relative; z-index: 1; }
.ds-auth-art .pts div { display: flex; gap: .6rem; align-items: center; } .ds-auth-art .pts i { color: #8fb0ff; }
.ds-auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.ds-auth-card { width: 100%; max-width: 420px; animation: dsFade .4s var(--ds-ease); }
.ds-auth-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.ds-auth-card .form-control { min-height: 46px; }
.ds-auth-card .btn-primary { min-height: 48px; }
.ds-auth-top { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 900px) { .ds-auth { grid-template-columns: 1fr; } .ds-auth-art { display: none; } .ds-auth-mobile-logo { display: block !important; } }
.ds-auth-mobile-logo { display: none; text-align: center; margin-bottom: 1.4rem; } .ds-auth-mobile-logo img { height: 56px; }

/* ============================================================
   11. RESPONSIVE SAFETY - no horizontal scrolling on the page
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
.ds-content .table-responsive, .ds-table-scroll { -webkit-overflow-scrolling: touch; }
@media (max-width: 575.98px) {
  .ds-page-head { align-items: stretch; }
  .ds-stat-value { font-size: 1.55rem; }
  .btn-lg { width: 100%; }
}

/* ============================================================
   12. PRINT
   ============================================================ */
@media print {
  .ds-sidebar, .ds-topbar, .no-print, .ds-scrim, .ds-archive-banner, .ds-toasts, .ds-table-bar, .ds-table-foot, .ds-page-loader { display: none !important; }
  .ds-shell { display: block; } .ds-content { padding: 0; max-width: none; animation: none; }
  .ds-content > * { animation: none !important; }
  html, body { background: #fff !important; color: #000; font-size: 11pt; overflow: visible; }
  .card, .ds-table-wrap { border: 0; box-shadow: none; background: #fff; }
  .ds-table-scroll { max-height: none !important; overflow: visible !important; }
  table tr { page-break-inside: avoid; break-inside: avoid; } table thead { display: table-header-group; }
  .table thead th { position: static; }
}

/* ============================================================
   v90: loading bar and smooth page changes (assets/js/mdms-live.js)
   ============================================================ */
.mdms-loadbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000;
  background: var(--ds-brand, #2451c8); box-shadow: 0 0 8px var(--ds-brand-ring, rgba(36,81,200,.35));
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.mdms-loadbar.on { opacity: 1; animation: mdms-load 2.4s cubic-bezier(.1,.7,.3,1) forwards; }
@keyframes mdms-load { from { width: 0; } to { width: 88%; } }
#dsContent[aria-busy="true"] { cursor: progress; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) {
  .mdms-loadbar.on { animation: none; width: 88%; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* =====================================================================
   v93: event greetings, Login Notification Centre, teacher subject pages,
   subject analytics and the Education Office school search
   ===================================================================== */
.ds-greet { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 16px; margin-bottom: 1rem; color: #fff;
  background: linear-gradient(120deg, var(--g1, #132f7d), var(--g2, #2451c8)); box-shadow: var(--ds-shadow-md, 0 8px 24px rgba(15,26,46,.12)); transition: opacity .35s, transform .35s; }
.ds-greet.out { opacity: 0; transform: translateY(-8px); }
.ds-greet .ic { flex: none; width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.4rem; }
.ds-greet .tx { flex: 1; min-width: 0; display: grid; } .ds-greet .tx b { font-size: 1.02rem; } .ds-greet .tx span { opacity: .93; font-size: .92rem; }
.ds-greet .x { flex: none; border: 0; background: rgba(255,255,255,.16); color: #fff; width: 32px; height: 32px; border-radius: 10px; }
.ds-greet .x:hover { background: rgba(255,255,255,.3); }
.ds-greet.tone-green { --g1: #14532d; --g2: #15803d; } .ds-greet.tone-gold { --g1: #92400e; --g2: #d97706; } .ds-greet.tone-rose { --g1: #9f1239; --g2: #e11d48; }
.ds-greet.tone-violet { --g1: #4c1d95; --g2: #7c3aed; }

/* --- notification centre --- */
.nc-modal .modal-content { border: 0; border-radius: 20px; overflow: hidden; }
.nc-modal .modal-header { background: linear-gradient(120deg, #132f7d, #2451c8); color: #fff; border: 0; padding: 1rem 1.2rem; }
.nc-modal .modal-header h5 { color: #fff; margin: 0; } .nc-modal .modal-header small { opacity: .9; display: block; }
.nc-modal .modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.nc-modal .modal-body { padding: .9rem 1rem; background: var(--ds-surface); max-height: min(68vh, 640px); }
.nc-item { background: var(--ds-card); border: 1px solid var(--ds-line); border-left: 5px solid var(--ds-muted); border-radius: 14px; padding: .85rem 1rem; margin-bottom: .7rem; transition: opacity .25s, transform .25s; }
.nc-item.p-critical { border-left-color: #dc2626; } .nc-item.p-high { border-left-color: #d97706; } .nc-item.p-normal { border-left-color: var(--ds-brand); }
.nc-item.done { opacity: .5; transform: scale(.985); }
.nc-item .nc-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .3rem; }
.nc-item .nc-top .badge { font-weight: 600; } .nc-item h6 { margin: 0 0 .15rem; font-size: 1.02rem; }
.nc-item .nc-from { font-size: .82rem; color: var(--ds-muted); margin-bottom: .45rem; }
.nc-item .nc-body { font-size: .93rem; white-space: pre-line; overflow-wrap: anywhere; }
.nc-item .nc-att { display: inline-flex; align-items: center; gap: .45rem; margin-top: .6rem; padding: .4rem .7rem; border-radius: 10px; background: var(--ds-brand-soft); color: var(--ds-brand); font-weight: 600; font-size: .88rem; text-decoration: none; }
.nc-item .nc-acts { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
.nc-unread { box-shadow: 0 0 0 2px var(--ds-brand-ring, rgba(36,81,200,.2)); }
.nc-strip { display: flex; gap: .7rem; align-items: center; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 12px; padding: .55rem .9rem; margin-bottom: 1rem; font-size: .92rem; }
:root[data-theme="dark"] .nc-strip { background: #3b1414; border-color: #7f1d1d; color: #fecaca; }
.nc-strip a { color: inherit; font-weight: 700; }

/* --- teacher subject pages and analytics --- */
.ts-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.ts-card { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: 16px; padding: 1rem 1.1rem; display: grid; gap: .6rem; border-top: 4px solid var(--ds-brand); }
.ts-card h5 { margin: 0; } .ts-card .meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.ts-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 600; color: var(--ds-ink); text-decoration: none; }
a.ts-chip:hover { border-color: var(--ds-brand); color: var(--ds-brand); }
.ts-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; text-align: center; }
.ts-kpis div { background: var(--ds-surface); border-radius: 10px; padding: .45rem .2rem; } .ts-kpis b { display: block; font-size: 1.15rem; color: var(--ds-ink); } .ts-kpis span { font-size: .72rem; color: var(--ds-muted); }
.ts-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ts-tabs a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--ds-line); background: var(--ds-card); color: var(--ds-ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.ts-tabs a.on { background: var(--ds-brand); border-color: var(--ds-brand); color: #fff; }
.sa-cat { border: 1px solid var(--ds-line); border-radius: 14px; background: var(--ds-card); padding: .8rem .95rem; height: 100%; border-left: 5px solid var(--c, var(--ds-brand)); }
.sa-cat h6 { margin: 0 0 .1rem; display: flex; justify-content: space-between; gap: .5rem; } .sa-cat .n { font-size: 1.3rem; font-weight: 800; color: var(--c, var(--ds-brand)); }
.sa-cat p { font-size: .8rem; color: var(--ds-muted); margin: 0 0 .4rem; } .sa-cat ul { list-style: none; margin: 0; padding: 0; font-size: .88rem; max-height: 190px; overflow: auto; }
.sa-cat li { display: flex; justify-content: space-between; gap: .5rem; padding: .18rem 0; border-top: 1px dashed var(--ds-line); } .sa-cat li:first-child { border-top: 0; }
.sa-tip { border-left: 4px solid #d97706; background: color-mix(in srgb, #d97706 9%, var(--ds-card)); border-radius: 0 12px 12px 0; padding: .7rem .9rem; margin-bottom: .6rem; }
.sa-tip b { display: block; } .sa-tip ul { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .92rem; }

/* --- school search --- */
.ss-box { position: relative; } .ss-box .form-control { padding-left: 2.6rem; height: 3.1rem; font-size: 1.05rem; border-radius: 14px; }
.ss-box > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ds-muted); font-size: 1.1rem; }
.ss-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: 14px; box-shadow: var(--ds-shadow-md, 0 8px 24px rgba(15,26,46,.12)); overflow: hidden; }
.ss-suggest a { display: flex; justify-content: space-between; gap: .8rem; padding: .55rem .9rem; text-decoration: none; color: var(--ds-ink); border-top: 1px solid var(--ds-line); }
.ss-suggest a:first-child { border-top: 0; } .ss-suggest a:hover, .ss-suggest a.on { background: var(--ds-brand-soft); } .ss-suggest small { color: var(--ds-muted); white-space: nowrap; }
.ss-recent { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ss-hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; background: linear-gradient(120deg, #132f7d, #2451c8); color: #fff; border-radius: 18px; padding: 1.1rem 1.3rem; margin-bottom: 1.2rem; }
.ss-hero h4 { color: #fff; margin: 0; } .ss-hero p { margin: 0; opacity: .9; font-size: .92rem; } .ss-hero form { flex: 1 1 320px; display: flex; gap: .5rem; }
.ss-hero .form-control { height: 3rem; border-radius: 12px; border: 0; } .ss-hero .btn { border-radius: 12px; font-weight: 700; white-space: nowrap; }
@media (max-width: 575px) { .ts-kpis b { font-size: 1rem; } .nc-modal .modal-body { max-height: 72vh; } }
@media print { .ds-greet, .nc-strip { display: none !important; } }
/* v93: the quick-match list must sit above the cards that follow the search bar */
.ss-hero { position: relative; z-index: 6; } .ss-box { z-index: 6; }
.ss-suggest a { color: var(--ds-ink) !important; } .ss-suggest a span { min-width: 0; } .ss-suggest small { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
@media (max-width: 575.98px) { .ss-suggest a { flex-direction: column; gap: 0; } .ss-hero form { flex-basis: 100%; } }
.ss-go { flex: 0 0 auto; width: auto !important; }
