/* =============================================================================
   MXL — THE LEADERS PANEL LOOK

   The staff shell (sidebar, top bar, page, cards, tables, forms) drawn the way
   the Macoss leaders panel draws its own: a soft cool page, white bordered
   cards with generous radius, a flat white sidebar with an account card, quiet
   uppercase headings, pill buttons in the top bar and a plain table.

   VISUAL ONLY. No markup, route, menu entry or API call changed because of this
   file; it is loaded last by public/index.php and every rule starts at
   body.has-sb2, the school staff shell. The platform console and the portal
   never carry that class.

   THE TEACHER WORKSPACE. The shell is shared, so the shell (sidebar, top bar,
   page tone) changes for everybody. The CONTENT rules (cards, tables, forms,
   page headings) are written against body:not([data-area="workspace"]) —
   app.js sets data-area to the first path segment on every navigation — so the
   workspace screens keep whatever look their own file gives them.

   Sections: 1 tokens · 2 sidebar · 3 top bar · 4 page · 5 cards and stat tiles
   · 6 tables · 7 forms and buttons · 8 tabs and chips · 9 attendance analytics
   · 10 phone
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
body.has-sb2 {
  --mxl-bg: #f4f6fa;
  --mxl-surface: #ffffff;
  --mxl-surface-2: #f8f9fc;
  --mxl-border: #e6e9ef;
  --mxl-border-strong: #d5dae3;
  --mxl-text: #1d2433;
  --mxl-muted: #5f6b7d;
  --mxl-subtle: #8a94a6;
  --mxl-radius: 14px;
  --mxl-radius-sm: 10px;
  --mxl-radius-xs: 7px;
  --mxl-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --mxl-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --mxl-topbar-bg: rgba(255, 255, 255, .88);
  --mxl-topbar-h: 4rem;

  /* The theme's own names, so everything that already reads them follows. */
  --bg-color: var(--mxl-bg);
  --border-color: var(--mxl-border);
  --text-primary-light: var(--mxl-text);
  --text-secondary-light: var(--mxl-muted);
  --shadow-1: var(--mxl-shadow);
  background-color: var(--mxl-bg);
  color: var(--mxl-muted);
  font-size: .875rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] body.has-sb2 {
  --mxl-bg: #1b2431;
  --mxl-surface: #273142;
  --mxl-surface-2: #2d3849;
  --mxl-border: rgba(255, 255, 255, .09);
  --mxl-border-strong: rgba(255, 255, 255, .16);
  --mxl-text: #eef0f4;
  --mxl-muted: #b6bfcd;
  --mxl-subtle: #8c97a8;
  --mxl-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
  --mxl-shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  --mxl-topbar-bg: rgba(39, 49, 66, .9);
  --bg-color: #1b2431;
  --border-color: var(--mxl-border);
  --text-primary-light: var(--mxl-text);
  --text-secondary-light: var(--mxl-muted);
}

/* 2. Sidebar --------------------------------------------------------------- */
body.has-sb2 .sidebar.sb2 {
  background: var(--white);
  border-inline-end: 1px solid var(--mxl-border);
  box-shadow: none;
}
/* The rail and the panel read as ONE flat white sidebar with a quiet divider. */
body.has-sb2 .sb2 .sb-rail {
  background: var(--white);
  border-inline-end: 1px solid var(--mxl-border);
  padding-block: 12px;
}
body.has-sb2 .sb2 .sb-rail__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--mxl-border);
  box-shadow: none;
  margin-bottom: 6px;
}
body.has-sb2 .sb2 .sb-rail__btn { width: 44px; height: 44px; border-radius: var(--mxl-radius-sm); font-size: 1.3125rem; color: var(--mxl-subtle); }
body.has-sb2 .sb2 .sb-rail__btn:hover { background: var(--mxl-surface-2); color: var(--mxl-text); }
body.has-sb2 .sb2 .sb-rail__btn.is-active { background: var(--primary-50); color: var(--primary-600); box-shadow: none; }
body.has-sb2 .sb2 .sb-rail__sep { background: var(--mxl-border); }

body.has-sb2 .sb2 .sb-panel { background: var(--white); border-inline-end: 0; }
body.has-sb2 .sb2 .sb-panel__head { padding: 0; }
/* The school's name, in a header as tall as the top bar so the two line up. */
body.has-sb2 .sb2 .sb-panel__school {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--mxl-topbar-h);
  margin: 0;
  padding: 8px 20px;
  border-bottom: 1px solid var(--mxl-border);
  text-align: start;
}
body.has-sb2 .sb2 .sb-panel__school .school-name {
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--mxl-text);
  -webkit-line-clamp: 2;
}
body.has-sb2 .sb2 .sb-panel__school .school-motto { font-size: .6875rem; color: var(--mxl-subtle); opacity: 1; }

/* The signed-in person, as a card under the school's name. */
.sb-me {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 16px 4px;
  padding: 10px 12px;
  border: 1px solid var(--mxl-border);
  border-radius: var(--mxl-radius-sm);
  background: var(--mxl-surface-2);
}
.sb-me__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: .8125rem;
  font-weight: 700;
}
.sb-me__text { min-width: 0; line-height: 1.25; }
.sb-me__name {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--mxl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-me__role { display: block; font-size: .75rem; color: var(--mxl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The module's name acts as the nav's first heading: small, uppercase. */
body.has-sb2 .sb2 .sb-panel__title {
  padding: 16px 20px 2px;
  font-size: .6875rem !important;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mxl-subtle);
}
body.has-sb2 .sb2 .sidebar-menu-area { padding: 6px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--mxl-border-strong) transparent; }

body.has-sb2 .sidebar.sb2 .sidebar-menu li a {
  height: 40px;
  border-radius: var(--mxl-radius-xs);
  font-size: .875rem;
  font-weight: 500;
  color: var(--mxl-muted);
}
body.has-sb2 .sidebar.sb2 .sidebar-menu li a i { width: 20px; font-size: 1.125rem; color: var(--mxl-subtle); }
body.has-sb2 .sidebar.sb2 .sidebar-menu li a:hover { background: var(--mxl-surface-2); color: var(--mxl-text); }
body.has-sb2 .sidebar.sb2 .sidebar-menu li > a.active-page,
body.has-sb2 .sidebar.sb2 .sidebar-menu li.dropdown.open > a,
body.has-sb2 .sidebar.sb2 .sidebar-menu li.dropdown.dropdown-open > a { color: var(--primary-600); font-weight: 600; }
body.has-sb2 .sidebar.sb2 .sidebar-menu > li > a.active-page,
body.has-sb2 .sidebar.sb2 .sidebar-menu .sidebar-submenu li.active-page a { background: var(--primary-50) !important; }
body.has-sb2 .sidebar.sb2 .sidebar-menu .sidebar-submenu li a { height: 36px; font-size: .8125rem; }
body.has-sb2 .sidebar.sb2 .sidebar-menu .sidebar-submenu { margin-inline-start: 21px; padding-inline-start: 10px; border-inline-start: 1px solid var(--mxl-border); }
body.has-sb2 .sidebar.sb2 .sidebar-submenu::before { display: none; }
body.has-sb2 .sidebar.sb2 .sidebar-menu .sidebar-menu-group-title { color: var(--mxl-subtle); }

/* Sign out, at the foot of the panel. */
.sb-panel__foot { flex: 0 0 auto; padding: 12px 16px 16px; border-top: 1px solid var(--mxl-border); }
.sb-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  border-radius: var(--mxl-radius-xs);
  background: var(--danger-50);
  color: var(--danger-600);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sb-logout:hover,
.sb-logout:focus-visible { background: var(--danger-600); color: #fff; }
[data-theme="dark"] .sb-logout { background: rgba(240, 122, 110, .14); color: #f07a6e; }
[data-theme="dark"] .sb-logout:hover { background: #d9534f; color: #fff; }

/* 3. Top bar --------------------------------------------------------------- */
body.has-sb2 .navbar-header {
  height: var(--mxl-topbar-h);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  background: var(--mxl-topbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--mxl-border);
  box-shadow: none;
  z-index: 30;
}
body.has-sb2 .navbar-header > .row { width: 100%; margin: 0; }
body.has-sb2 .navbar-header > .row > .col-auto { padding: 0; }

/* The search, the term chip: bordered pills on the white bar. */
body.has-sb2 #studentSearch {
  height: 2.5rem;
  border-radius: 999px;
  padding-inline-start: 2.5rem !important;
  border: 1px solid var(--mxl-border);
  background: var(--mxl-surface-2);
  font-size: .875rem;
}
body.has-sb2 #studentSearch:focus { background: var(--white); border-color: var(--primary-600) !important; box-shadow: 0 0 0 3px var(--primary-100); }
body.has-sb2 #topbarTerm { height: 2.5rem; border-radius: 999px; border-color: var(--mxl-border) !important; background: var(--white); font-weight: 600; color: var(--mxl-muted); }

/* Bell, theme, sign out and the account: one family of 40px pills. */
body.has-sb2 #bellButton,
body.has-sb2 .navbar-header [data-theme-toggle] {
  background: var(--white) !important;
  border: 1px solid var(--mxl-border);
  color: var(--mxl-muted);
  transition: background .15s, border-color .15s, color .15s;
}
body.has-sb2 #bellButton:hover,
body.has-sb2 .navbar-header [data-theme-toggle]:hover { background: var(--mxl-surface-2) !important; border-color: var(--mxl-border-strong); color: var(--mxl-text); }
/* The theme switch says what a click turns it into, as the leaders panel's does. */
/* The theme draws its icon in ::after and hides the button's own text with
   font-size:0; here the icon moves to ::before and ::after carries the word. */
@media (min-width: 768px) {
  body.has-sb2 .navbar-header [data-theme-toggle] {
    width: auto !important;
    padding-inline: 14px;
    border-radius: 999px !important;
    gap: 7px;
    /* font-size stays 0 (the theme's): that hides the button's own text, and
       the two pseudo-elements below set their own sizes. */
  }
  body.has-sb2 .navbar-header [data-theme-toggle]::before {
    content: "\f1bf";
    font-family: remixicon;
    font-style: normal;
    font-size: 1.0625rem;
    line-height: 1;
  }
  body.has-sb2 .navbar-header [data-theme-toggle][aria-label="dark"]::before { content: "\ef6f"; color: #f0a35a; }
  body.has-sb2 .navbar-header [data-theme-toggle]::after {
    position: static;
    content: "Dark";
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    color: inherit;
  }
  body.has-sb2 .navbar-header [data-theme-toggle][aria-label="dark"]::after { content: "Light"; color: inherit; }
}

.mxl-top-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border: 1px solid var(--danger-600);
  border-radius: 999px;
  background: var(--white);
  color: var(--danger-600);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mxl-top-logout:hover,
.mxl-top-logout:focus-visible { background: var(--danger-600); color: #fff; }
.mxl-top-logout i { font-size: 1rem; }
[data-theme="dark"] .mxl-top-logout { border-color: #f07a6e; color: #f07a6e; }
[data-theme="dark"] .mxl-top-logout:hover { background: #d9534f; border-color: #d9534f; color: #fff; }

/* The account button: photo, first name, caret. */
body.has-sb2 .navbar-header .dropdown > button.rounded-circle {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--mxl-border);
  border-radius: 999px !important;
  background: var(--white);
  color: var(--mxl-text);
  font-weight: 600;
}
body.has-sb2 .navbar-header .dropdown > button.rounded-circle:hover { border-color: var(--mxl-border-strong); background: var(--mxl-surface-2); }
body.has-sb2 #userAvatar { width: 32px !important; height: 32px !important; }
.mxl-user-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
.mxl-user-caret { font-size: 1rem; color: var(--mxl-subtle); }
body.has-sb2 .navbar-header .dropdown-menu { border-radius: var(--mxl-radius-sm); border-color: var(--mxl-border); box-shadow: var(--mxl-shadow-lg); }

/* 4. The page ---------------------------------------------------------------
   Cool grey ground, a readable column, a footer that is only a footnote. */
body.has-sb2 .dashboard-main-body { padding: 1.5rem 1.75rem 2.5rem; width: 100%; }
body.has-sb2 .d-footer {
  padding: 1rem 1.75rem 1.5rem;
  background: transparent;
  text-align: center;
  font-size: .75rem;
  color: var(--mxl-subtle);
}
body.has-sb2 .d-footer .row { justify-content: center !important; gap: 4px 16px; }
body.has-sb2 .d-footer p { color: var(--mxl-subtle); }

/* Page headings: title with the trail beneath, as in the leaders panel. */
body.has-sb2:not([data-area="workspace"]) .breadcrumb { margin-bottom: 1.25rem !important; }
body.has-sb2:not([data-area="workspace"]) .breadcrumb h1 {
  margin-bottom: 2px !important;
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--mxl-text) !important;
}
body.has-sb2:not([data-area="workspace"]) .breadcrumb > div > div { font-size: .75rem; color: var(--mxl-subtle); }
body.has-sb2:not([data-area="workspace"]) .breadcrumb a { color: var(--mxl-muted); }
body.has-sb2:not([data-area="workspace"]) .breadcrumb a:hover { color: var(--primary-600); }

/* 5. Cards and stat tiles -------------------------------------------------- */
body.has-sb2:not([data-area="workspace"]):not(.report-tab) .card {
  background: var(--white);
  border: 1px solid var(--mxl-border);
  border-radius: var(--mxl-radius);
  box-shadow: var(--mxl-shadow);
}
body.has-sb2:not([data-area="workspace"]) .card .card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--mxl-border);
  border-radius: var(--mxl-radius) var(--mxl-radius) 0 0;
  background: transparent;
}
body.has-sb2:not([data-area="workspace"]) .card .card-body { padding: 1.125rem 1.25rem; }
body.has-sb2:not([data-area="workspace"]) .card h6,
body.has-sb2:not([data-area="workspace"]) .card .h6 { color: var(--mxl-text); }

/* The dashboard's stat tiles: flat white, a big plain number. The coloured
   gradient wash the theme gives them is dropped; the coloured dot stays as the
   one accent. */
body.has-sb2:not([data-area="workspace"]) .card[class*="gradient-bg-end-"] { background: var(--white); }
body.has-sb2:not([data-area="workspace"]) .card[class*="gradient-bg-end-"] .card-body { padding: 1rem 1.125rem; }
body.has-sb2:not([data-area="workspace"]) .card[class*="gradient-bg-end-"] h6 {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--mxl-text);
}
body.has-sb2:not([data-area="workspace"]) .card[class*="gradient-bg-end-"] h6 a { color: inherit; }
body.has-sb2:not([data-area="workspace"]) .card[class*="gradient-bg-end-"] p { color: var(--mxl-muted); }
body.has-sb2:not([data-area="workspace"]) .card[class*="gradient-bg-end-"] .rounded-circle { width: 2.25rem !important; height: 2.25rem !important; border-radius: var(--mxl-radius-xs) !important; }

/* The dashboard's module shortcuts: bordered tiles that lift on hover. */
body.has-sb2:not([data-area="workspace"]) .card.bg-neutral-50 { background: var(--white) !important; border: 1px solid var(--mxl-border) !important; box-shadow: var(--mxl-shadow) !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
body.has-sb2:not([data-area="workspace"]) a:hover > .card.bg-neutral-50 { border-color: var(--primary-200) !important; box-shadow: var(--mxl-shadow-lg) !important; transform: translateY(-2px); }
body.has-sb2:not([data-area="workspace"]) .card.bg-neutral-50 > .card-body > i:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--mxl-radius-sm);
  background: var(--primary-50);
  font-size: 1.25rem !important;
}

/* 6. Tables ---------------------------------------------------------------- */
body.has-sb2:not([data-area="workspace"]):not(.report-tab) .table { font-size: .875rem; color: var(--mxl-text); margin-bottom: 0; }
body.has-sb2:not([data-area="workspace"]):not(.report-tab) .table > thead > tr > th {
  padding: .75rem 1rem;
  background: var(--mxl-surface-2);
  border-bottom: 1px solid var(--mxl-border);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--mxl-text);
  white-space: nowrap;
}
body.has-sb2:not([data-area="workspace"]):not(.report-tab) .table > tbody > tr > td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--mxl-border);
  vertical-align: middle;
}
body.has-sb2:not([data-area="workspace"]):not(.report-tab) .table > tbody > tr:last-child > td { border-bottom: 0; }
body.has-sb2:not([data-area="workspace"]):not(.report-tab) .table > tbody > tr:hover > td { background: var(--mxl-surface-2); }
/* A table inside a card sits flush, and the card's corners clip it. */
body.has-sb2:not([data-area="workspace"]) .card > .table-responsive,
body.has-sb2:not([data-area="workspace"]) .card-body > .table-responsive { border-radius: var(--mxl-radius-sm); }
body.has-sb2:not([data-area="workspace"]) .table-responsive { scrollbar-width: thin; }

/* 7. Forms and buttons ----------------------------------------------------- */
body.has-sb2:not([data-area="workspace"]) .form-control,
body.has-sb2:not([data-area="workspace"]) .form-select,
body.has-sb2:not([data-area="workspace"]) textarea.form-control {
  border: 1px solid var(--mxl-border-strong);
  border-radius: var(--mxl-radius-xs);
  font-size: .875rem;
  background-color: var(--white);
}
body.has-sb2:not([data-area="workspace"]) .form-control:not(textarea),
body.has-sb2:not([data-area="workspace"]) .form-select { height: 2.5rem; padding-block: 0; }
body.has-sb2:not([data-area="workspace"]) .form-control::placeholder { font-size: .875rem !important; color: var(--mxl-subtle); }
body.has-sb2:not([data-area="workspace"]) .form-control:focus,
body.has-sb2:not([data-area="workspace"]) .form-select:focus { border-color: var(--primary-600) !important; box-shadow: 0 0 0 3px var(--primary-100); background-color: var(--white); }
body.has-sb2:not([data-area="workspace"]) label.form-label,
body.has-sb2:not([data-area="workspace"]) .form-label { font-size: .8125rem; font-weight: 600; color: var(--mxl-text); }

body.has-sb2:not([data-area="workspace"]) .btn {
  border-radius: var(--mxl-radius-xs);
  font-size: .875rem;
  font-weight: 600;
}
body.has-sb2:not([data-area="workspace"]) .btn.btn-sm { font-size: .8125rem; }
body.has-sb2:not([data-area="workspace"]) .btn-primary-600 { box-shadow: none; }

/* 8. Tabs and chips -------------------------------------------------------- */
body.has-sb2:not([data-area="workspace"]) .badge { border-radius: 999px; font-weight: 600; }
body.has-sb2:not([data-area="workspace"]) .nav-tabs { border-bottom: 1px solid var(--mxl-border); }
body.has-sb2:not([data-area="workspace"]) .nav-tabs .nav-link { font-weight: 600; color: var(--mxl-muted); }
body.has-sb2:not([data-area="workspace"]) .nav-tabs .nav-link.active { color: var(--primary-600); }

/* 9. Attendance analytics (the admin dashboard's Attendance page) ----------- */
.mxl-an { margin: 0 0 1.5rem; }
.mxl-an__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.mxl-an__head h2 { margin: 0; font-size: 1rem !important; font-weight: 700; color: var(--mxl-text); line-height: 1.3; }
.mxl-an__head p { margin: 2px 0 0; font-size: .8125rem; color: var(--mxl-muted); }
.mxl-an__links { display: flex; flex-wrap: wrap; gap: 8px; }
.mxl-an__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--mxl-border);
  border-radius: 999px;
  background: var(--white);
  font-size: .8125rem;
  font-weight: 600;
  color: var(--mxl-muted);
  transition: border-color .15s, color .15s, background .15s;
}
.mxl-an__link:hover { border-color: var(--primary-600); color: var(--primary-600); background: var(--primary-50); }
.mxl-an__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); gap: 16px; }
.mxl-an__card { background: var(--white); border: 1px solid var(--mxl-border); border-radius: var(--mxl-radius); box-shadow: var(--mxl-shadow); min-width: 0; }
.mxl-an__card--wide { grid-column: 1 / -1; }
.mxl-an__card h3 { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--mxl-border); font-size: .9375rem !important; font-weight: 700; color: var(--mxl-text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mxl-an__card h3 small { font-size: .75rem; font-weight: 500; color: var(--mxl-subtle); }
.mxl-an__body { padding: 14px 18px 16px; }
.mxl-an__note { margin: 10px 0 0; font-size: .75rem; color: var(--mxl-subtle); }
.mxl-an__empty { padding: 18px; font-size: .8125rem; color: var(--mxl-muted); text-align: center; }
.mxl-bar { display: grid; grid-template-columns: minmax(4rem, 8rem) 1fr 3.25rem; align-items: center; gap: 10px; padding: 5px 0; font-size: .8125rem; }
.mxl-bar__label { color: var(--mxl-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mxl-bar__track { height: 8px; border-radius: 99px; background: var(--mxl-surface-2); border: 1px solid var(--mxl-border); overflow: hidden; }
.mxl-bar__fill { display: block; height: 100%; border-radius: 99px; background: var(--primary-600); }
.mxl-bar__fill.is-warn { background: var(--warning-600); }
.mxl-bar__fill.is-bad { background: var(--danger-600); }
.mxl-bar__value { text-align: right; font-weight: 700; color: var(--mxl-text); font-variant-numeric: tabular-nums; }
.mxl-heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .75rem; }
.mxl-heat th { padding: 4px 6px; font-weight: 600; color: var(--mxl-subtle); text-align: center; white-space: nowrap; }
.mxl-heat th:first-child, .mxl-heat td:first-child { text-align: left; padding-left: 0; white-space: nowrap; color: var(--mxl-text); font-weight: 600; }
.mxl-heat td { padding: 6px 4px; border-radius: 6px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.mxl-heat td.is-good { background: rgba(18, 128, 92, .14); color: #12805c; }
.mxl-heat td.is-ok { background: rgba(180, 83, 9, .12); color: #b45309; }
.mxl-heat td.is-bad { background: rgba(192, 54, 44, .14); color: #c0362c; }
.mxl-heat td.is-none { background: var(--mxl-surface-2); color: var(--mxl-subtle); font-weight: 500; }
[data-theme="dark"] .mxl-heat td.is-good { color: #4cc79a; }
[data-theme="dark"] .mxl-heat td.is-ok { color: #f0a35a; }
[data-theme="dark"] .mxl-heat td.is-bad { color: #f07a6e; }
.mxl-list { list-style: none; margin: 0; padding: 0; }
.mxl-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--mxl-border); font-size: .8125rem; }
.mxl-list li:last-child { border-bottom: 0; }
.mxl-list__name { min-width: 0; color: var(--mxl-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mxl-list__meta { flex: 0 0 auto; color: var(--mxl-muted); font-variant-numeric: tabular-nums; }
.mxl-scroll { overflow-x: auto; }
.mxl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: 14px; }
.mxl-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--mxl-border);
  border-radius: var(--mxl-radius);
  box-shadow: var(--mxl-shadow);
  color: var(--mxl-text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mxl-tile:hover { border-color: var(--primary-200); box-shadow: var(--mxl-shadow-lg); transform: translateY(-2px); color: var(--mxl-text); }
.mxl-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--mxl-radius-sm);
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 1.125rem;
}
.mxl-tile__text { min-width: 0; line-height: 1.35; }
.mxl-tile__text strong { display: block; font-size: .875rem; font-weight: 700; }
.mxl-tile__text small { display: block; margin-top: 2px; font-size: .75rem; color: var(--mxl-muted); }
.mxl-tile:focus-visible, .mxl-an__link:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 2px; }

/* 10. Tablet and phone ------------------------------------------------------ */
@media (max-width: 1199.98px) {
  body.has-sb2 .navbar-header { padding-inline: 1rem; }
  body.has-sb2 .dashboard-main-body { padding: 1.25rem 1rem 2rem; }
}
@media (max-width: 767.98px) {
  body.has-sb2 .navbar-header { height: auto; min-height: var(--mxl-topbar-h); padding: 8px 12px; }
  body.has-sb2 .dashboard-main-body { padding: 1rem .75rem 2rem; }
  .mxl-top-logout { padding: 0; width: 40px; }
  .mxl-top-logout span { display: none; }
  .mxl-user-name, .mxl-user-caret { display: none; }
  body.has-sb2 .navbar-header .dropdown > button.rounded-circle { padding: 0 3px; }
  body.has-sb2:not([data-area="workspace"]) .breadcrumb h1 { font-size: 1.1875rem; }
  .mxl-bar { grid-template-columns: minmax(3.5rem, 6rem) 1fr 3rem; }
  .sb-me { margin-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body.has-sb2:not([data-area="workspace"]) .card.bg-neutral-50,
  .mxl-an__link, .mxl-tile { transition: none; }
}

/* 11. The leaders panel (/leaders/*) ---------------------------------------
   While it is open app.js puts body.mxl-leaders-mode on <body>: the module rail
   goes, the sidebar is one slim panel, and the pages below draw with .ldr-*.
   The ordinary .card and .table styling above applies inside it. */
.mxl-mode-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--primary-600);
  border-radius: 999px;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.mxl-mode-link:hover { background: var(--primary-600); color: #fff; }
.mxl-mode-link i { font-size: 1rem; }
.mxl-mode-link.d-none { display: none !important; }

body.mxl-leaders-mode .sb2 .sb-rail { display: none; }
body.mxl-leaders-mode .sidebar.sb2 { --sb-rail: 0px; }
body.mxl-leaders-mode #moduleSwitcher { display: none; }
@media (min-width: 1200px) {
  body.has-sb2.mxl-leaders-mode .dashboard-main { margin-inline-start: 16.875rem; }
  body.has-sb2.mxl-leaders-mode .sidebar.sb2 { width: 16.875rem; }
}
@media (min-width: 1650px) {
  body.has-sb2.mxl-leaders-mode .dashboard-main { margin-inline-start: 18.125rem; }
  body.has-sb2.mxl-leaders-mode .sidebar.sb2 { width: 18.125rem; }
}
/* Below 1200px the panel is a drawer behind the menu button, as on a phone. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  body.has-sb2.mxl-leaders-mode .sidebar.sb2 {
    inset-inline-start: -100%;
    width: min(21.5rem, 92vw);
    overflow: hidden;
    visibility: hidden;
    transition: inset-inline-start .25s ease, visibility 0s linear .25s;
  }
  body.has-sb2.mxl-leaders-mode .sidebar.sb2.sidebar-open {
    inset-inline-start: 0;
    visibility: visible;
    box-shadow: 0 0 40px rgba(16, 24, 40, .25);
    transition: inset-inline-start .25s ease, visibility 0s;
  }
  body.has-sb2.mxl-leaders-mode .sidebar.sb2 .sb-panel {
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
  }
  body.has-sb2.mxl-leaders-mode .dashboard-main { margin-inline-start: 0; }
  body.has-sb2.mxl-leaders-mode .sidebar-mobile-toggle { display: inline-block; }
}
body.mxl-leaders-mode .sb-panel__title { display: none; }
body.mxl-leaders-mode .sidebar.sb2 .sidebar-menu .sidebar-menu-group-title {
  margin: 16px 12px 4px;
  font-size: .6875rem;
  letter-spacing: .07em;
}

.ldr-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 1.25rem; }
.ldr-head h1, .ldr-head h2 { margin: 0; font-size: 1.375rem !important; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--mxl-text); }
.ldr-head--sub { margin: 1.5rem 0 .75rem; }
.ldr-head--sub h2 { font-size: 1.125rem !important; }
.ldr-head p { margin: 2px 0 0; font-size: .8125rem; color: var(--mxl-muted); }
.ldr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ldr-section { margin: 1.5rem 0 .75rem; font-size: .9375rem !important; font-weight: 700; color: var(--mxl-text); line-height: 1.3; }

.ldr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.ldr-stats:empty { display: none; }
.ldr-stat {
  display: block;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--mxl-border);
  border-radius: var(--mxl-radius);
  box-shadow: var(--mxl-shadow);
  color: var(--mxl-muted);
}
a.ldr-stat:hover { border-color: var(--primary-200); color: var(--mxl-muted); }
.ldr-stat strong { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--mxl-text); font-variant-numeric: tabular-nums; }
.ldr-stat span { display: block; margin-top: 2px; font-size: .75rem; }
.ldr-stat.is-warn strong { color: var(--warning-700); }
/* A figure still loading (SkoolsOS.leaders.statsLoading): the same box, grey bars where the number and label go. */
.ldr-stat--sk .sk-num { height: 1.8rem; width: 55%; margin: 0; }
.ldr-stat--sk .sk-label { height: .75rem; width: 80%; margin-top: 6px; }

.ldr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 14px; margin-bottom: 1.5rem; }
.ldr-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--mxl-border);
  border-radius: var(--mxl-radius);
  box-shadow: var(--mxl-shadow);
  color: var(--mxl-text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ldr-tile:hover { border-color: var(--primary-200); box-shadow: var(--mxl-shadow-lg); transform: translateY(-2px); color: var(--mxl-text); }
.ldr-tile__icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--mxl-radius-sm); background: var(--primary-50); color: var(--primary-600); font-size: 1.125rem; }
.ldr-tile__text { min-width: 0; line-height: 1.35; }
.ldr-tile__text strong { display: block; font-size: .875rem; font-weight: 700; }
.ldr-tile__text small { display: block; margin-top: 2px; font-size: .75rem; color: var(--mxl-muted); }

.ldr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.ldr-chips a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--mxl-border); border-radius: 999px; background: var(--white); font-size: .8125rem; font-weight: 600; color: var(--mxl-muted); }
.ldr-chips a:hover { border-color: var(--primary-600); color: var(--primary-600); }
.ldr-chips a.is-active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }

.ldr-card { margin-bottom: 1.25rem; }
.ldr-card .card-header h2 { margin: 0; font-size: .9375rem !important; font-weight: 700; color: var(--mxl-text); line-height: 1.3; }
.ldr-card tfoot td { padding: .75rem 1rem; font-weight: 700; color: var(--mxl-text); border-top: 1px solid var(--mxl-border); background: var(--mxl-surface-2); }
.ldr-row-on > td { background: var(--primary-50) !important; }
.ldr-empty { padding: 2.5rem 1rem; text-align: center; color: var(--mxl-muted); background: var(--white); border: 1px dashed var(--mxl-border-strong); border-radius: var(--mxl-radius); }
.ldr-empty i { display: block; margin-bottom: 8px; font-size: 1.75rem; color: var(--mxl-subtle); }

.ldr-find-box { max-width: 28rem; margin-bottom: 1.25rem; }
.ldr-card .ldr-find-box { max-width: none; }
.ldr-find { display: block; position: relative; margin: 0; }
.ldr-find > span, .ldr-form label > span { display: block; margin-bottom: 4px; font-size: .75rem; font-weight: 600; color: var(--mxl-muted); }
.ldr-find__list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 20rem; overflow: auto; padding: 6px; background: var(--white); border: 1px solid var(--mxl-border); border-radius: var(--mxl-radius-sm); box-shadow: var(--mxl-shadow-lg); }
.ldr-find__list[hidden] { display: none; }
.ldr-find__list button { display: block; width: 100%; padding: 8px 10px; border-radius: var(--mxl-radius-xs); text-align: left; cursor: pointer; color: var(--mxl-text); }
.ldr-find__list button:hover, .ldr-find__list button:focus-visible { background: var(--mxl-surface-2); }
.ldr-find__list strong, .ldr-find__list small { display: block; }
.ldr-find__list small { font-size: .75rem; color: var(--mxl-muted); }
.ldr-find__list p { margin: 0; padding: 10px; font-size: .8125rem; color: var(--mxl-muted); }
.ldr-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ldr-form label { flex: 1 1 14rem; margin: 0; }

.ldr-batches { display: flex; flex-direction: column; }
.ldr-batch { display: grid; grid-template-columns: minmax(8rem, 1.4fr) 2fr 7.5rem auto; align-items: center; gap: 6px 14px; padding: 9px 0; border-bottom: 1px solid var(--mxl-border); font-size: .8125rem; }
.ldr-batch:last-child { border-bottom: 0; }
.ldr-batch__name strong, .ldr-batch__name small { display: block; }
.ldr-batch__name small { font-size: .6875rem; color: var(--mxl-subtle); }
.ldr-batch__num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ldr-batch__num small { color: var(--mxl-subtle); }
.ldr-batch__go { white-space: nowrap; font-size: .75rem; }
.ldr-card b.is-good { color: var(--success-700); }
.ldr-card b.is-ok { color: var(--warning-700); }
.ldr-card b.is-bad { color: var(--danger-600); }

@media (max-width: 767.98px) {
  .ldr-head h1 { font-size: 1.1875rem !important; }
  .ldr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ldr-stat strong { font-size: 1.25rem; }
  .ldr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ldr-tile { flex-direction: column; gap: 10px; padding: 12px; }
  .ldr-batch { grid-template-columns: 1fr auto; }
  .ldr-batch .mxl-bar__track { grid-column: 1 / -1; order: 3; }
  .ldr-batch__go { grid-column: 1 / -1; order: 4; }
  .mxl-mode-link { padding: 0; width: 40px; justify-content: center; }
  .mxl-mode-link span { display: none; }
}
@media print { .ldr-noprint { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ldr-tile { transition: none; } }

/* The panel's menu is flat: no chevrons, so long names keep their room. */
body.mxl-leaders-mode .sidebar.sb2 .sidebar-menu > li > a { padding-inline-end: 12px; }
body.mxl-leaders-mode .sidebar.sb2 .sidebar-menu > li > a::after { display: none; }
body.has-sb2 .ldr-card td a[data-nav],
body.has-sb2 .ldr-card td a[target="_blank"],
body.has-sb2 .ldr-batch__go a { color: var(--primary-600); font-weight: 600; }
body.has-sb2 .ldr-card td a[data-nav]:hover,
body.has-sb2 .ldr-batch__go a:hover { text-decoration: underline; }
