@charset "UTF-8";
/*************************************************
 * ATTENDNG — BASE STYLES (SCSS)
 *************************************************/
/* =========================================
   Every inline style="..." across the app
   uses var(--border), var(--primary), etc. —
   this maps each SCSS variable to a matching
   CSS custom property so those actually
   resolve, instead of silently falling back
   to nothing.
========================================= */
:root {
  --primary: #0f766e;
  --primary-dark: #0b5c56;
  --primary-subtle: #f0fdf4;
  --info-blue: #2563eb;
  --indigo: #4f46e5;
  --indigo-subtle: #eef2ff;
  --amber: #d97706;
  --amber-subtle: #fef3c7;
  --success-green: #16a34a;
  --success-bg: #ecfdf5;
  --success-text: #16a34a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3af;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --page-bg: #f1f5f9;
  --warning-bg: #fff7e6;
  --warning-text: #92650b;
  --stat-label: #64748b;
  --stat-value: #0f172a;
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
  background: #f1f5f9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =========================================
   BUTTON — fallback for any plain <button>
   with no specific class. More specific
   classes (.btn-primary, .btn-light, etc.)
   still win via source order below.
========================================= */
button {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
button:hover {
  background: #f8fafc;
  border-color: rgb(199.1090909091, 210.6727272727, 226.0909090909);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
button:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.btn-primary {
  background: #0f766e;
  color: #fff;
  border: 1px solid #0f766e;
  box-shadow: 0 1px 2px rgba(11, 92, 86, 0.2);
}
.btn-primary:hover {
  background: #0b5c56;
  border-color: #0b5c56;
  box-shadow: 0 3px 8px rgba(15, 118, 110, 0.25);
  color: #fff;
}

.btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: rgb(199.1090909091, 210.6727272727, 226.0909090909);
  color: #0f172a;
}

.btn-add-student {
  background: #16a34a;
  color: #fff;
  border: 1px solid #16a34a;
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.2);
}
.btn-add-student:hover {
  background: #15803d;
  border-color: #15803d;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.25);
  color: #fff;
}

.btn-template {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.btn-template:hover {
  background: #fde68a;
  border-color: #fcd34d;
  color: #78350f;
}

.btn-import {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.btn-import:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #3730a3;
}

.btn-back {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.btn-back:hover {
  background: #f8fafc;
  border-color: rgb(192.3863636364, 205.3409090909, 222.6136363636);
  color: #0f172a;
}

.btn-reports {
  background: #0f766e;
  color: #fff;
  border: 1px solid #0f766e;
}
.btn-reports:hover {
  background: #0b5c56;
  border-color: #0b5c56;
  box-shadow: 0 3px 8px rgba(15, 118, 110, 0.25);
  color: #fff;
}

.btn-analytics {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
}
.btn-analytics:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
  color: #fff;
}

.btn-manage-students {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.btn-manage-students:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e40af;
}

.btn-finalize-action {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.btn-finalize-action:hover {
  background: #fde68a;
  border-color: #fcd34d;
  color: #78350f;
}

.btn-unlock-action {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #86efac;
}
.btn-unlock-action:hover {
  background: #bbf7d0;
  border-color: #4ade80;
  color: #14532d;
}

.btn-delete-class {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.btn-delete-class:hover {
  background: #fecaca;
  border-color: #f87171;
  color: #7f1d1d;
}

/* =========================================
   SELECT — styled globally so every dropdown
   in the app (week, term, gender, teacher
   assign, move-to, etc.) looks consistent
   instead of the browser default.
========================================= */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding: 8px 30px 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
  cursor: pointer;
}
select:hover {
  border-color: rgb(185.6636363636, 200.0090909091, 219.1363636364);
}
select:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
}
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

select::-ms-expand {
  display: none;
}

/* =========================================
   GENERIC TABLE SCROLL + STICKY COLUMNS
   Applied automatically by auth.js to every
   table on every page — not just Attendance.
   Left offsets are set inline by JS, since
   each table's first-column width differs.
========================================= */
.table-scroll-wrapper {
  overflow-x: auto;
}

.sticky-col {
  position: sticky;
  background: #ffffff;
  z-index: 2;
}

.sticky-col-shadow {
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

thead .sticky-col {
  z-index: 3;
}

/* =========================================
   LOGIN PAGE
========================================= */
.login-body {
  height: 100vh;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  width: 340px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 0.5rem;
}
.login-brand p {
  margin: 0;
  font-size: 13px;
  color: #475569;
}

.login-logo {
  height: 56px;
  width: auto;
  margin: 0 auto 8px;
  display: block;
}

.login-card label {
  font-size: 13px;
  color: #475569;
}
.login-card input {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.login-card input:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
}
.login-card button:not(.password-toggle) {
  margin-top: 0.5rem;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
}
.login-card button:not(.password-toggle):hover:not(:disabled) {
  background: #0b5c56;
}
.login-card button:not(.password-toggle):disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.password-field {
  position: relative;
  display: flex;
}
.password-field input {
  width: 100%;
  padding-right: 34px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3af;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
}
.password-toggle:hover {
  color: #475569;
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0;
}

.login-hint {
  text-align: center;
  font-size: 12px;
  color: #94a3af;
  margin: 0.5rem 0 0;
}

/* =========================================
   APP SHELL
========================================= */
.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 236px;
  background: linear-gradient(180deg, #0f766e 0%, #0b5c56 100%);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0 0.85rem;
}
.sidebar li {
  margin-bottom: 4px;
}
.sidebar li a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.sidebar li a i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.sidebar li a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateX(2px);
}
.sidebar li a:hover i {
  opacity: 1;
}
.sidebar li.active > a {
  background: #ffffff;
  color: #0f766e;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.sidebar li.active > a i {
  color: #0f766e;
  opacity: 1;
}
.sidebar .submenu {
  list-style: none;
  padding-left: 20px;
  margin: 3px 0 0;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  margin-left: 18px;
  display: none;
}
.sidebar .submenu li a {
  padding: 7px 10px;
  font-size: 12.5px;
}
.sidebar li.has-submenu.open > .submenu {
  display: block;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.25rem 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}
.sidebar-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  -o-object-fit: cover;
     object-fit: cover;
  background: #fff;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.sidebar-brand h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section-label {
  padding: 14px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.submenu-caret {
  margin-left: auto;
  font-size: 11px;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.25rem;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.top-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: #0b5c56;
  letter-spacing: -0.02em;
}
.top-header p {
  margin: 0;
  font-size: 13px;
  color: #475569;
}

/* =========================================
   REPORT HEADER CONTROLS (weekly/term report)
   Week select + action buttons grouped so they
   wrap tidily instead of one long overflowing
   row on narrow screens.
========================================= */
.report-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-week-select {
  min-width: 110px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================
   HEADER ACTIONS (generic)
   A wrapping row of buttons in a page header —
   e.g. Roster's Back/View Reports/View Analytics —
   so they sit tidily instead of stacking full-width.
========================================= */
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================
   CARDS / SUMMARY GRID
========================================= */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.4rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.25rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 1.75rem;
}

.summary-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgb(199.1090909091, 210.6727272727, 226.0909090909);
}
.summary-card:nth-child(1) .summary-card-icon {
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.2);
}
.summary-card:nth-child(2) .summary-card-icon {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
}
.summary-card:nth-child(3) .summary-card-icon {
  background: rgba(217, 119, 6, 0.08);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.2);
}
.summary-card:nth-child(4) .summary-card-icon {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  border-color: rgba(79, 70, 229, 0.2);
}
.summary-card h3 {
  font-size: 12.5px;
  color: #64748b;
  margin: 0 0 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.summary-card p {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  font-feature-settings: "tnum";
}

.summary-card-body {
  min-width: 0;
}

.summary-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(15, 118, 110, 0.15);
}

/* =========================================
   HYBRID RESPONSIVE DATA COMPONENTS
   Card list view for mobile rosters & lists +
   Smooth horizontal scroll for multi-column tables.
========================================= */
.table-responsive-hybrid {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.table-responsive-hybrid::-webkit-scrollbar {
  height: 6px;
}
.table-responsive-hybrid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.table-responsive-hybrid::-webkit-scrollbar-track {
  background: transparent;
}

.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.mobile-data-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mobile-data-card:active {
  background: #f8fafc;
}
.mobile-data-card .card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mobile-data-card .card-avatar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mobile-data-card .card-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.mobile-data-card .card-primary-info {
  min-width: 0;
}
.mobile-data-card .card-primary-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-data-card .card-primary-info span {
  font-size: 12px;
  color: #475569;
}
.mobile-data-card .card-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.mobile-data-card .card-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.mobile-data-card .card-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.mobile-data-card .card-actions-row button {
  flex: 1;
  height: 36px;
  font-size: 12.5px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

canvas {
  max-width: 100%;
}

/* =========================================
   BUTTONS
========================================= */
.btn-primary,
button.btn-primary {
  background: #0f766e;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover,
button.btn-primary:hover {
  background: #0b5c56;
}

.btn-light {
  background: #dcfce7;
  color: #166534;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btn-light:hover {
  background: #bbf7d0;
}
.btn-light:disabled {
  background: #f8fafc;
  color: #94a3af;
  cursor: not-allowed;
}
.btn-light:disabled:hover {
  background: #f8fafc;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btn-danger:hover {
  background: rgb(187.0333333333, 30.1666666667, 30.1666666667);
}

.btn-info {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btn-info:hover {
  background: #1d4ed8;
}

.btn-success {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.icon-btn-edit {
  background: #dcfce7;
  color: #166534;
}
.icon-btn-edit:hover {
  background: #bbf7d0;
}

.icon-btn-delete {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.icon-btn-delete:hover {
  background: rgba(220, 38, 38, 0.18);
}

/* =========================================
   GENERAL MODAL (add student, etc. — distinct
   from .confirm-modal's fixed small-dialog use)
========================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 1050;
}
.modal.show {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 28px);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}
.modal-header button {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #94a3af;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-header button:hover {
  color: #0f172a;
  background: #f8fafc;
}

.form-group {
  margin-bottom: 0.9rem;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus,
.form-group select:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  outline: none;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

/* =========================================
   TOAST
========================================= */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.attendng-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100vw - 32px);
  pointer-events: none;
}

.attendng-toast {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: inherit;
}
.attendng-toast.attendng-toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.attendng-toast.attendng-toast-hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
}
.attendng-toast .attendng-toast-icon {
  font-size: 18px;
  line-height: 1.3;
  flex-shrink: 0;
  margin-top: 1px;
}
.attendng-toast .attendng-toast-body {
  flex: 1;
  min-width: 0;
}
.attendng-toast .attendng-toast-message {
  font-size: 13.5px;
  line-height: 1.45;
  color: #e2e8f0;
  word-break: break-word;
}
.attendng-toast .attendng-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  margin-top: -2px;
  transition: color 0.15s;
}
.attendng-toast .attendng-toast-close:hover {
  color: #ffffff;
}
.attendng-toast.attendng-toast-success {
  border-left: 4px solid #10b981;
}
.attendng-toast.attendng-toast-success .attendng-toast-icon {
  color: #10b981;
}
.attendng-toast.attendng-toast-success .attendng-toast-progress-bar {
  background: #10b981;
}
.attendng-toast.attendng-toast-error {
  border-left: 4px solid #ef4444;
}
.attendng-toast.attendng-toast-error .attendng-toast-icon {
  color: #ef4444;
}
.attendng-toast.attendng-toast-error .attendng-toast-progress-bar {
  background: #ef4444;
}
.attendng-toast.attendng-toast-warning {
  border-left: 4px solid #f59e0b;
}
.attendng-toast.attendng-toast-warning .attendng-toast-icon {
  color: #f59e0b;
}
.attendng-toast.attendng-toast-warning .attendng-toast-progress-bar {
  background: #f59e0b;
}
.attendng-toast.attendng-toast-info {
  border-left: 4px solid #0d9488;
}
.attendng-toast.attendng-toast-info .attendng-toast-icon {
  color: #14b8a6;
}
.attendng-toast.attendng-toast-info .attendng-toast-progress-bar {
  background: #14b8a6;
}
.attendng-toast .attendng-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}
.attendng-toast .attendng-toast-progress-bar {
  height: 100%;
  width: 100%;
  background: rgba(255, 255, 255, 0.3);
  animation: attendng-toast-shrink linear forwards;
  transform-origin: left;
}

@keyframes attendng-toast-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
@media (max-width: 600px) {
  .attendng-toast-container {
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
  }
}
/* =========================================
   AUTOSAVE SYNC INDICATOR
========================================= */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.sync-indicator .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.2s ease;
}
.sync-indicator {
  /* Saved state */
}
.sync-indicator.sync-saved {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.sync-indicator.sync-saved .sync-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.sync-indicator {
  /* Saving in progress */
}
.sync-indicator.sync-saving {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.sync-indicator.sync-saving .sync-dot {
  background: #3b82f6;
  animation: sync-pulse 1s infinite;
}
.sync-indicator {
  /* Changes pending (debouncing) */
}
.sync-indicator.sync-pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.sync-indicator.sync-pending .sync-dot {
  background: #f59e0b;
}
.sync-indicator {
  /* Offline or error */
}
.sync-indicator.sync-error, .sync-indicator.sync-offline {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  cursor: pointer;
}
.sync-indicator.sync-error .sync-dot, .sync-indicator.sync-offline .sync-dot {
  background: #ef4444;
}
.sync-indicator.sync-error:hover, .sync-indicator.sync-offline:hover {
  background: #fee2e2;
}

@keyframes sync-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0.6;
  }
}
.ca-input.is-invalid, .exam-input.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}

/* =========================================
   STUDENT PAGE HELPERS
========================================= */
.student-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.student-actions input[type=text] {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  min-width: 200px;
}

.student-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 13px;
  color: #475569;
}

/* =========================================
   IMPORT SUMMARY MODAL
========================================= */
.import-summary-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.import-summary-modal.show {
  display: flex;
}

.import-summary-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 380px;
}

.import-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  position: relative;
}
.import-summary-header h2 {
  margin: 0;
  font-size: 16px;
}
.import-summary-header .import-summary-icon {
  color: #0f766e;
  font-size: 18px;
}
.import-summary-header .import-summary-close {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3af;
}

.import-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}
.import-summary-item strong {
  display: block;
  font-size: 16px;
}
.import-summary-item span {
  color: #475569;
  font-size: 12px;
}
.import-summary-item.success i {
  color: #0f766e;
}
.import-summary-item.warning i {
  color: #92650b;
}
.import-summary-item.danger i {
  color: #dc2626;
}
.import-summary-item.neutral i {
  color: #94a3af;
}

.duplicate-details {
  font-size: 12px;
  color: #475569;
  margin-top: 6px;
  max-height: 100px;
  overflow-y: auto;
}

.import-summary-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

/* =========================================
   ATTENDANCE MARK BOX
========================================= */
.attendance-cell {
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  text-align: center;
  padding: 8px 6px;
  transition: background-color 0.15s ease;
}

.attendance-cell:hover {
  background-color: #F1F5F9;
}

.mark-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mark-box.present {
  background: #10B981;
  color: #fff;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.35);
}

.mark-box.absent {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
}

.attendance-cell:active .mark-box {
  transform: scale(0.9);
}

/* =========================================
   STICKY S/N + NAME COLUMNS
   Scoped to explicit classes only (not
   nth-child position) — with a rowspan="2"
   header, position-based selectors mis-hit
   the second header row's M/A subheaders.
========================================= */
.sticky-sn {
  position: sticky;
  left: 0;
  width: 44px;
  background: #ffffff;
  z-index: 2;
}

.sticky-name {
  position: sticky;
  left: 44px;
  min-width: 150px;
  background: #ffffff;
  z-index: 2;
  box-shadow: 3px 0 6px rgba(0, 0, 0, 0.05);
}

thead .sticky-sn,
thead .sticky-name {
  z-index: 3;
  background: #0F766E;
  color: #FFFFFF;
}

/* =========================================
   GENERIC SCROLLABLE TABLE
   Wrap any table in a plain <div class="table-scroll">
   (no border-radius on the scroll container itself —
   rounding lives on the outer .card instead, to avoid
   sticky content visually escaping a rounded corner).
   Add "sticky-col1"/"sticky-col2" to the first two
   th/td of EVERY row (thead and tbody) — explicit
   classes, not nth-child, since rowspan headers can
   shift column position in a second header row.
========================================= */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sticky-col1 {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
}

.sticky-col2 {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

thead .sticky-col1,
thead .sticky-col2 {
  z-index: 3;
}

.row-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.row-toggle-btn i {
  transition: transform 0.2s ease;
}

.row-toggle-btn:hover {
  background: #bbf7d0;
}

.row-toggle-btn.is-open i {
  transform: rotate(180deg);
}

/* =========================================
   MOBILE CARD LAYOUT (teachers page)
   On small screens the table is replaced by
   a stack of cards, one per teacher. Each
   card header carries a ^ chevron toggle
   (.row-toggle-btn, shared style with the
   table version) that expands a row of
   action buttons underneath.
========================================= */
.teacher-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.teacher-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.teacher-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.teacher-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.teacher-card-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.teacher-card-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.teacher-card-body code {
  display: inline;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
}

.teacher-card-label {
  color: var(--text-muted);
  margin-right: 4px;
}

.teacher-card-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 768px) {
  .desktop-actions-cell {
    display: none;
  }
  .teacher-table-scroll {
    display: none;
  }
  .teacher-cards {
    display: flex;
  }
}
.teacher-table .sticky-col1 {
  min-width: 180px;
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
}

.teacher-table .sticky-col2 {
  min-width: 180px;
  max-width: 220px;
  left: 180px !important;
  white-space: normal;
  word-break: break-word;
}

.teacher-table .sticky-col2 code {
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* =========================================
   REPORT TABLE (weekly/term)
   Solid teal header band with white text,
   instead of the plain muted-text header used
   by other tables in the app.
========================================= */
.report-table thead th {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left;
  border-bottom: none;
  white-space: nowrap;
}

.report-table thead .sticky-col1,
.report-table thead .sticky-col2 {
  background: var(--primary);
}

.report-table .sticky-col1 {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  white-space: nowrap;
}

.report-table .sticky-col2 {
  left: 56px !important;
  min-width: 160px;
  max-width: none;
}

/* =========================================
   ROSTER TABLE
   Plain muted header (not the teal report
   style) — only the S/N column is sticky here,
   Surname scrolls with the rest of the row.
========================================= */
.roster-table thead tr {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.roster-table .sticky-col1 {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  white-space: nowrap;
}

/* =========================================
   CLASSES TABLE
   Only Class is sticky here — Teacher scrolls
   with the rest of the row.
========================================= */
.classes-table .sticky-col1 {
  min-width: 140px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .teacher-table .sticky-col1,
  .teacher-table .sticky-col2 {
    min-width: 0;
    width: 130px;
    max-width: 130px;
    white-space: normal;
    word-break: break-word;
  }
  .teacher-table .sticky-col2 {
    left: 130px !important;
  }
}
/* =========================================
   PRINT
========================================= */
@media print {
  .sidebar,
  .mobile-topbar,
  #printBtn,
  #exportBtn,
  #reportWeek,
  #reportTerm {
    display: none !important;
  }
  #printHeader {
    display: block !important;
  }
  .main-content {
    padding: 0;
  }
}
/* =========================================
   MODAL (logout, and general confirm dialogs)
========================================= */
.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 320px;
}

.confirm-header h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.confirm-body p {
  margin: 0;
  font-size: 13px;
  color: #475569;
}

.confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1.25rem;
}

/* =========================================
   BADGES
========================================= */
.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}

.badge-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-muted {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.badge-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* =========================================
   SCORES & RESULTS TABLE
========================================= */
.scores-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.scores-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  flex-wrap: wrap;
}
.scores-toolbar .scores-hint {
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}
.scores-toolbar .scores-hint i {
  color: #0f766e;
  font-size: 14px;
}
.scores-toolbar .scores-search {
  position: relative;
  min-width: 200px;
  max-width: 280px;
  width: 100%;
}
.scores-toolbar .scores-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.scores-toolbar .scores-search input:focus {
  background: #fff;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  outline: none;
}
.scores-toolbar .scores-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3af;
  font-size: 13px;
  pointer-events: none;
}

.scores-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 14px;
}
.scores-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}
.scores-table th {
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  text-align: left;
  white-space: nowrap;
}
.scores-table th.th-center,
.scores-table td.td-center {
  text-align: center;
}
.scores-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.15s ease;
}
.scores-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.02);
}
.scores-table tbody tr:last-child {
  border-bottom: none;
}
.scores-table td {
  padding: 10px 14px;
  vertical-align: middle;
}
.scores-table .sticky-student-col {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}
.scores-table tbody tr:hover .sticky-student-col {
  background: #fafbfa;
}

.score-input {
  width: 76px;
  height: 38px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.score-input:hover:not(:disabled) {
  border-color: #94a3af;
}
.score-input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
  outline: none;
  background: #f0fdf4;
}
.score-input:disabled {
  background: #f1f5f9;
  color: #94a3af;
  border-color: #e2e8f0;
  cursor: not-allowed;
}
.score-input.is-invalid {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.total-cell {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  font-feature-settings: "tnum";
}

.grade-cell {
  text-align: center;
}

/* =========================================
   ATTENDANCE PAGE
========================================= */
.attendance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.summary-cards {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}
.summary-cards span {
  display: block;
  color: #475569;
  font-size: 13px;
  margin-bottom: 6px;
}
.summary-cards h3 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.attendance-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin: 20px 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 200px 150px;
  gap: 24px;
  align-items: end;
}

.attendance-summary-box {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.summary-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 380px;
}
.summary-table th {
  background: #0f766e;
  color: #fff;
}
.summary-table td,
.summary-table th {
  border: 1px solid #e2e8f0;
  padding: 8px;
  text-align: center;
  font-size: 13px;
}

.total-row {
  font-weight: 700;
  background: #f8fafc;
}

.weekly-percentage {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  min-width: 200px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}
.weekly-percentage span {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: #16a34a;
}

.attendance-table-section {
  margin-top: 28px;
}

.attendance-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}
.attendance-table th {
  background: #0f766e;
  color: #fff;
  padding: 10px;
  text-align: center;
  font-size: 13px;
}
.attendance-table td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}
.attendance-table td,
.attendance-table th {
  border: 1px solid #e2e8f0;
}

.morning-col {
  border-right: 2px solid rgb(175.5795454545, 192.0113636364, 213.9204545455) !important;
}

.attendance-table tbody tr:hover {
  background: #f8fafc;
}

.student-name {
  text-align: left !important;
  font-weight: 500;
}

.weekly-total {
  font-weight: 700;
  color: #0f766e;
}

.present,
.absent {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.present {
  background: #16a34a;
  color: #fff;
}

.absent {
  background: #fff;
  border: 2px solid #cbd5e1;
}

/* =========================================
   ATTENDANCE — MOBILE COMPACT VIEW & DAY TABS
========================================= */
.attendance-desktop-view {
  display: block;
}

.attendance-mobile-view {
  display: none;
}

.attendance-day-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  margin-bottom: 12px;
}
.attendance-day-tabs .day-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 4px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: inherit;
}
.attendance-day-tabs .day-tab:hover {
  color: #0f172a;
}
.attendance-day-tabs .day-tab.active {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.28);
}

.attendance-mobile-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.attendance-mobile-controls .attendance-mobile-search {
  position: relative;
  flex: 1;
}
.attendance-mobile-controls .attendance-mobile-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 12px;
  pointer-events: none;
}
.attendance-mobile-controls .attendance-mobile-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  background: #ffffff;
  box-sizing: border-box;
  font-family: inherit;
}
.attendance-mobile-controls .attendance-mobile-search input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}
.attendance-mobile-controls .btn-mark-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  background: #0f766e;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}
.attendance-mobile-controls .btn-mark-all:hover {
  background: #0b5c56;
}
.attendance-mobile-controls .btn-mark-all:active {
  transform: scale(0.97);
}

.attendance-mobile-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}
.attendance-mobile-stats .active-day-label {
  font-weight: 700;
  color: #0f766e;
  text-transform: capitalize;
}
.attendance-mobile-stats .active-day-count {
  font-weight: 600;
  color: #334155;
}

.attendance-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attendance-mobile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-height: 48px;
  box-sizing: border-box;
  transition: background 0.1s ease;
}
.attendance-mobile-row:hover {
  background: #fafafa;
}
.attendance-mobile-row .student-info-col {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.attendance-mobile-row .student-info-col .sn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.attendance-mobile-row .student-info-col .student-name-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attendance-mobile-row .session-toggles-col {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-family: inherit;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.session-pill .check-icon {
  display: none;
  font-size: 11px;
}
.session-pill.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}
.session-pill.active .check-icon {
  display: inline-block;
}
.session-pill:active {
  transform: scale(0.94);
}

/* Modal styling for Mark All */
.attendance-mark-modal {
  background: #ffffff;
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-topbar {
  display: none;
}

@media (min-width: 1025px) {
  .sidebar li a {
    padding: 8px 16px;
  }
}
@media (max-width: 768px) {
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .sidebar-brand {
    display: none;
  }
  .sidebar ul {
    margin-top: 56px;
  }
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 56px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  }
  body:has(.mobile-topbar) {
    padding-top: 56px;
  }
  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    color: #0f172a;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .mobile-menu-btn:active {
    background: #f8fafc;
  }
  .mobile-topbar-logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    -o-object-fit: cover;
       object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  }
  .mobile-topbar-title {
    font-weight: 600;
    font-size: 14.5px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 175px;
  }
  .mobile-topbar-user {
    display: flex;
    align-items: center;
  }
  .mobile-user-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #0f766e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 1px solid rgba(15, 118, 110, 0.2);
  }
  .container {
    flex-direction: column;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 256px;
    max-width: 82vw;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  .main-content {
    padding: 1rem;
  }
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
  }
  .top-header h1 {
    font-size: 19px;
  }
  .report-controls {
    width: 100%;
    justify-content: flex-start;
  }
  .report-week-select {
    width: 100%;
  }
  .report-actions {
    width: 100%;
  }
  .report-actions .btn-sm {
    flex: 1 1 auto;
    min-width: 100px;
    justify-content: center;
  }
  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .header-actions .btn-back {
    grid-column: 1/-1;
    width: 100%;
    justify-content: center;
  }
  .header-actions .btn-reports,
  .header-actions .btn-analytics {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
  .header-actions .btn-sm {
    justify-content: center;
  }
  .student-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .student-actions input[type=text]#searchStudent,
  .student-actions input[type=text] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 9px 12px;
    font-size: 14px;
  }
  .student-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }
  .student-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    font-size: 13px;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
    min-width: 0;
    box-sizing: border-box;
  }
  .student-buttons .btn i {
    font-size: 13px;
    flex-shrink: 0;
  }
  .student-buttons .btn span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .student-buttons .btn-add-student {
    order: 1;
    grid-column: 1/-1;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 600;
  }
  .student-buttons .btn-import {
    order: 2;
    grid-column: 1/-1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
  }
  .student-buttons .btn-template {
    order: 3;
    font-size: 12px;
    padding: 8px 6px;
  }
  .roster-table {
    min-width: 620px;
  }
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .modal-content,
  .import-summary-card,
  .confirm-card {
    width: 100% !important;
    max-width: calc(100vw - 28px) !important;
    box-sizing: border-box;
  }
  .two-col-grid {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .summary-card {
    padding: 1rem 1.15rem;
  }
  .summary-card p {
    font-size: 24px;
  }
  .sticky-name {
    position: sticky;
    left: 36px;
    max-width: 130px;
    background: #ffffff;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
    white-space: normal;
    overflow-wrap: break-word;
  }
  /* Hybrid Data Mode Toggle */
  .has-mobile-cards .mobile-card-list {
    display: flex;
  }
  .has-mobile-cards .desktop-only-table {
    display: none !important;
  }
  /* Attendance Responsive Switch */
  .attendance-desktop-view {
    display: none !important;
  }
  .attendance-mobile-view {
    display: block;
  }
  .scores-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .scores-toolbar .scores-search {
    max-width: 100%;
  }
  .scores-table {
    min-width: 480px;
  }
  .scores-table th, .scores-table td {
    padding: 8px 10px;
  }
  .scores-table .sticky-student-col {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .scores-table .score-input {
    width: 66px;
    height: 38px;
    font-size: 14.5px;
  }
}
/* =========================================
   TEACHERS PAGE — BUTTON STYLING
   Scoped to body.page-teachers so the global
   .btn-* classes keep their current look on
   every other page. Delete stays solid red.
========================================= */
.page-teachers .btn-primary,
.page-teachers .btn-light,
.page-teachers .btn-danger,
.page-teachers .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border-width: 1px;
  border-style: solid;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.page-teachers .btn-primary:active:not(:disabled),
.page-teachers .btn-light:active:not(:disabled),
.page-teachers .btn-danger:active:not(:disabled),
.page-teachers .btn-secondary:active:not(:disabled) {
  transform: translateY(1px);
}
.page-teachers .btn-primary:focus-visible,
.page-teachers .btn-light:focus-visible,
.page-teachers .btn-danger:focus-visible,
.page-teachers .btn-secondary:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
.page-teachers .btn-primary:disabled,
.page-teachers .btn-light:disabled,
.page-teachers .btn-danger:disabled,
.page-teachers .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.page-teachers .btn-primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 92, 86, 0.25);
}
.page-teachers .btn-primary:hover:not(:disabled) {
  background: #0b5c56;
  border-color: #0b5c56;
  box-shadow: 0 3px 8px rgba(15, 118, 110, 0.28);
}
.page-teachers .btn-light {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.22);
  color: #0b5c56;
}
.page-teachers .btn-light:hover:not(:disabled) {
  background: rgba(15, 118, 110, 0.15);
  border-color: rgba(15, 118, 110, 0.4);
}
.page-teachers .btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.page-teachers .btn-danger:hover:not(:disabled) {
  background: rgb(187.0333333333, 30.1666666667, 30.1666666667);
  border-color: rgb(187.0333333333, 30.1666666667, 30.1666666667);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.28);
}
.page-teachers .btn-danger:focus-visible {
  outline-color: #dc2626;
}
.page-teachers .btn-secondary {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}
.page-teachers .btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: rgb(199.1090909091, 210.6727272727, 226.0909090909);
}
.page-teachers .top-header .btn-primary {
  padding: 9px 18px;
  font-size: 14px;
}
.page-teachers .confirm-footer button {
  min-width: 92px;
  padding: 9px 18px;
  font-size: 14px;
}
.page-teachers .row-toggle-btn {
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #0b5c56;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.page-teachers .row-toggle-btn:hover {
  background: rgba(15, 118, 110, 0.15);
  border-color: rgba(15, 118, 110, 0.4);
}
.page-teachers .row-toggle-btn:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
.page-teachers .row-toggle-btn.is-open {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

@media (max-width: 768px) {
  .page-teachers .teacher-card-actions button {
    flex: 1 1 calc(50% - 6px);
    min-height: 40px;
    padding: 9px 12px;
  }
  .page-teachers .top-header .btn-primary {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .page-teachers .btn-primary,
  .page-teachers .btn-light,
  .page-teachers .btn-danger,
  .page-teachers .btn-secondary,
  .page-teachers .row-toggle-btn {
    transition: none;
  }
}
/* =========================================
   SIDEBAR NAV GROUPS
========================================= */
.sidebar li.nav-group > .submenu-toggle {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.sidebar li.nav-group.has-active > .submenu-toggle {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar li.nav-group > .submenu-toggle .submenu-caret {
  transition: transform 0.2s ease;
}

.sidebar li.nav-group.open > .submenu-toggle .submenu-caret {
  transform: rotate(180deg);
}

.sidebar .submenu li:last-child {
  margin-bottom: 0;
}

.sidebar li.sidebar-divider {
  height: 1px;
  margin: 10px 12px;
  background: rgba(255, 255, 255, 0.14);
}

/* =========================================
   PLATFORM (SUPERADMIN) SIDEBAR
========================================= */
.sidebar.sidebar-platform,
.platform-ui .sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar.sidebar-platform li.active > a,
.platform-ui .sidebar li.active > a {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.45);
}

.sidebar.sidebar-platform li.active > a i,
.platform-ui .sidebar li.active > a i {
  color: #ffffff;
}

.sidebar.sidebar-platform li a:hover,
.platform-ui .sidebar li a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar.sidebar-platform li.active > a:hover,
.platform-ui .sidebar li.active > a:hover {
  background: #0f766e;
}

.sidebar.sidebar-platform .sidebar-brand,
.platform-ui .sidebar .sidebar-brand {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.9rem;
}

.sidebar-brand-text {
  min-width: 0;
}

.platform-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 8px;
  border-radius: 9999px;
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.sidebar li.active > a .nav-badge {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-search {
  position: relative;
  margin: 0 0.85rem 0.5rem;
}

.sidebar-search > i {
  position: absolute;
  left: 12px;
  top: 11px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px 8px 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 13px;
}

.sidebar-search input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-search input:focus {
  outline: none;
  border-color: #2dd4bf;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-search-results {
  margin-top: 4px;
}

.sidebar-search-results button,
.sidebar-search-empty {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-search-results button {
  cursor: pointer;
}

.sidebar-search-results button:hover,
.sidebar-search-results button:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  outline: none;
}

.sidebar-search-empty {
  color: rgba(255, 255, 255, 0.5);
}

/* =========================================
   TABLE HEADERS + ROW HOVER
   Low specificity on purpose: named tables
   (.scores-table, .attendance-table, sticky
   columns...) keep their own styling.
========================================= */
table thead th {
  background: #f1f5f9;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

.card table tbody tr:hover {
  background: #f8fafc;
}

/* =========================================
   PLATFORM: SCHOOL CARDS, TOOLBAR, ONBOARD DIALOG
========================================= */
.school-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.school-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.school-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #94a3af;
  pointer-events: none;
}

.school-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px 9px 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
}

.school-search input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.school-sort {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
}

.view-toggle {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.view-toggle button {
  border: none;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  width: 40px;
  height: 38px;
  padding: 0;
  cursor: pointer;
}

.view-toggle button.on {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.school-grid.list {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.school-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1rem 1.1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.school-card:hover,
.school-card:focus-visible {
  border-color: #0f766e;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  outline: none;
}

.school-avatar {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.1);
  color: #0b5c56;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-main {
  flex: 1;
  min-width: 0;
}

.school-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.school-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 5px;
  font-size: 12.5px;
  color: #64748b;
}

.school-meta i {
  margin-right: 3px;
  font-size: 11px;
}

.school-user {
  background: #f1f5f9;
  color: #334155;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
}

.school-chevron {
  color: #94a3af;
  font-size: 13px;
}

.school-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
}

.school-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #0f172a;
}

.school-empty p {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 14px;
}

.credential-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.25rem 1rem;
}

.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.7rem 0;
}

.credential-row + .credential-row {
  border-top: 1px solid #e2e8f0;
}

.credential-label {
  display: block;
  font-size: 11px;
  color: #94a3af;
  margin-bottom: 2px;
}

.credential-row code {
  font-size: 14px;
  word-break: break-all;
}

.credential-copy {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: #0f766e;
  cursor: pointer;
  white-space: nowrap;
}

.credential-copy:hover {
  border-color: #0f766e;
}

@media (max-width: 720px) {
  .school-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .school-search {
    min-width: 100%;
  }
  .school-added {
    display: none;
  }
}
/* =========================================
   SCHOOL CARDS: LOGOS + LONG NAMES ON PHONES
========================================= */
.school-avatar {
  overflow: hidden;
}

.school-avatar.has-logo {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 3px;
  box-sizing: border-box;
}

.school-avatar.has-logo img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
}

.school-meta > * {
  min-width: 0;
}

.school-user {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .school-card {
    padding: 0.85rem 0.9rem;
    gap: 12px;
  }
  .school-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }
  .school-user {
    flex: 1 1 100%;
    display: block;
  }
}
/* =========================================
   PLATFORM SETTINGS
========================================= */
.set-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.25rem;
}

.set-avatar {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.12);
  color: #0b5c56;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.set-profile-text {
  min-width: 0;
}

.set-profile-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.set-role {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(15, 118, 110, 0.1);
  color: #0b5c56;
  font-size: 12px;
  font-weight: 500;
  vertical-align: 2px;
}

.set-profile-email {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: #64748b;
  overflow-wrap: anywhere;
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.set-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.set-sub {
  margin: 0 0 1.1rem;
  font-size: 13px;
  color: #64748b;
}

.set-hint {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: #94a3af;
}

.set-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.set-meter span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background 0.2s ease;
}

.set-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0.25rem 0 1rem;
  font-size: 13px;
  color: #64748b;
}

.set-rules i {
  margin-right: 5px;
  color: #94a3af;
}

.set-rules .ok,
.set-rules .ok i {
  color: #0f766e;
}

@media (max-width: 860px) {
  .set-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  .set-profile {
    gap: 12px;
  }
  .set-role {
    display: table;
    margin: 6px 0 0;
  }
}
/* =========================================
   ATTENDANCE: WEEKLY SETTINGS CARD
========================================= */
.weekly-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.weekly-title {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}

.weekly-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.weekly-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.weekly-controls .form-group label {
  white-space: nowrap;
}

.weekly-controls select {
  min-width: 130px;
}

.weekly-controls input[type=number] {
  width: 150px;
}

.weekly-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.weekly-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.weekly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.weekly-table th {
  background: #0f766e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: center;
}

.weekly-table td {
  padding: 10px 12px;
  text-align: center;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
}

.weekly-table th:first-child,
.weekly-table td:first-child {
  text-align: left;
}

.weekly-table td:first-child {
  color: #64748b;
}

.weekly-table td.is-zero {
  color: #cbd5e1;
}

.weekly-table .weekly-total td {
  background: #f1f5f9;
  font-weight: 700;
}

.weekly-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}

.weekly-summary-label {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.weekly-big {
  margin: 4px 0 10px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  color: #475569;
  font-feature-settings: "tnum";
}

.weekly-track {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.weekly-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: #94a3af;
  transition: width 0.3s ease, background 0.2s ease;
}

.weekly-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3af;
}

.weekly-status {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 11px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.weekly-summary[data-tier=good] .weekly-big {
  color: #15803d;
}

.weekly-summary[data-tier=good] .weekly-fill {
  background: #16a34a;
}

.weekly-summary[data-tier=good] .weekly-status {
  background: #dcfce7;
  color: #166534;
}

.weekly-summary[data-tier=mid] .weekly-big {
  color: #b45309;
}

.weekly-summary[data-tier=mid] .weekly-fill {
  background: #d97706;
}

.weekly-summary[data-tier=mid] .weekly-status {
  background: #fef3c7;
  color: #92400e;
}

.weekly-summary[data-tier=low] .weekly-big {
  color: #b91c1c;
}

.weekly-summary[data-tier=low] .weekly-fill {
  background: #dc2626;
}

.weekly-summary[data-tier=low] .weekly-status {
  background: #fee2e2;
  color: #991b1b;
}

.weekly-facts {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.weekly-facts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
}

.weekly-facts b {
  color: #0f172a;
  font-weight: 600;
}

.weekly-help-btn {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  color: #0f766e;
  font-size: 12.5px;
  cursor: pointer;
}

.weekly-help-btn:hover {
  text-decoration: underline;
}

.weekly-help {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #475569;
}

.weekly-help[hidden] {
  display: none;
}

.weekly-math {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: #0f172a;
}

@media (max-width: 720px) {
  .weekly-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .weekly-summary {
    order: -1;
  }
  .weekly-controls {
    width: 100%;
  }
  .weekly-controls .form-group {
    flex: 1;
    min-width: 0;
  }
  .weekly-controls select,
  .weekly-controls input[type=number] {
    width: 100%;
    min-width: 0;
  }
}
/* =========================================
   ADMIN SCHOOL SETTINGS
========================================= */
.sset-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sset-logo {
  position: relative;
  width: 96px;
  height: 96px;
  flex: none;
}

.sset-logo-box {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.1);
  color: #0b5c56;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  overflow: hidden;
}

.sset-logo-box img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  background: #ffffff;
}

.sset-cam {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0f766e;
  color: #ffffff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sset-cam:hover {
  background: #0b5c56;
}

.sset-profile-main {
  flex: 1;
  min-width: 220px;
}

.sset-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #94a3af;
}

.sset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.sset-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.sset-sub {
  margin: 0 0 1.1rem;
  font-size: 13px;
  color: #64748b;
}

.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  resize: vertical;
}

.form-group textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  outline: none;
}

.sset-prev {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  background: #f8fafc;
}

.sset-prev-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.1);
  color: #0b5c56;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sset-prev-logo.has-logo {
  background: transparent;
}

.sset-prev-logo img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

.sset-prev-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.sset-prev-line {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748b;
  overflow-wrap: anywhere;
}

.sset-prev-rule {
  height: 1px;
  background: #cbd5e1;
  margin: 12px 0 8px;
}

.sset-prev-title {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3af;
}

.sset-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.sset-bar[hidden] {
  display: none;
}

.sset-bar-actions {
  display: flex;
  gap: 8px;
}

.set-info-row {
  margin-bottom: 10px;
}

.rt-key summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.rt-key-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.rt-key-row:last-child {
  border-bottom: 0;
}

.rt-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- list ---------- */
.rt-progress-bar {
  height: 8px;
  background: #e5ece9;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 14px;
}

.rt-progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.25s;
}

.rt-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 10px;
}

.rt-student {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.rt-student:hover {
  background: #f5faf9;
}

.rt-student .rt-n {
  width: 28px;
  color: var(--text-muted);
  font-size: 12px;
}

.rt-student .rt-name {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
}

.rt-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.rt-status.done {
  background: #dcf3ea;
  color: #0b6b4b;
}

.rt-status.part {
  background: #fdf0d5;
  color: #8a5a00;
}

.rt-status.none {
  background: #eef1f0;
  color: #6b7280;
}

/* ---------- editor ---------- */
.rt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rt-student-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
}

.rt-setall {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.rt-group {
  margin-top: 18px;
}

.rt-group h3 {
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-dark);
}

.rt-trait {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.rt-trait:last-child {
  border-bottom: 0;
}

.rt-trait .rt-label {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.rt-trait .rt-note {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--primary);
  margin-top: 2px;
}

.rt-btns {
  display: flex;
  gap: 6px;
}

.rt-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.8px solid #c9d7d4;
  background: #fff;
  color: #4b5a57;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}

.rt-btn:hover {
  border-color: var(--primary);
}

/* Attendance: worked out from the register, can't be clicked */
.rt-btn.locked,
.rt-btn.locked:hover {
  cursor: not-allowed;
  pointer-events: none;
  border-color: #d8e1df;
  color: #9aa8a5;
  background: #f3f6f5;
}

.rt-btn.locked.on {
  background: #6f9f9a;
  border-color: #6f9f9a;
  color: #fff;
}

.rt-btn.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.rt-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 0 4px;
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rt-footer button {
  flex: 1;
  min-width: 120px;
}

@media (max-width: 560px) {
  .rt-trait {
    flex-direction: column;
    align-items: flex-start;
  }
  .rt-btns {
    width: 100%;
    justify-content: space-between;
  }
  .rt-btn {
    width: 52px;
    height: 46px;
    border-radius: 12px;
  }
}
@media (max-width: 480px) {
  .rt-trait {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .rt-btns {
    width: 100% !important;
    justify-content: space-between !important;
  }
}
@media (max-width: 860px) {
  .sset-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  .sset-profile {
    flex-direction: column;
    align-items: flex-start;
  }
  .sset-profile-main {
    width: 100%;
    min-width: 0;
  }
}
/* =========================================
   TEACHERS PAGE — CARD GRID (pictorial view)
   Summary tiles, search/filter bar, and one
   avatar card per staff member. Replaces the
   old table + mobile-only card layout.
========================================= */
.tm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.tm-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.tm-stat strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-main);
}

.tm-stat span:not(.tm-stat-icon) {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tm-stat-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 17px;
}

/* shared colour tones (avatars + stat icons) */
.tm-tone-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.tm-tone-indigo {
  background: #e0e7ff;
  color: #4338ca;
}

.tm-tone-amber {
  background: #fef3c7;
  color: #b45309;
}

.tm-tone-green {
  background: #dcfce7;
  color: #15803d;
}

.tm-tone-rose {
  background: #ffe4e6;
  color: #be123c;
}

.tm-tone-sky {
  background: #e0f2fe;
  color: #0369a1;
}

/* ---------- toolbar ---------- */
.tm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tm-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
  display: block;
}

.tm-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.tm-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.tm-filters {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.page-teachers .tm-chip {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
}

.page-teachers .tm-chip:hover {
  background: var(--surface-alt);
}

.page-teachers .tm-chip.is-active {
  background: var(--primary);
  color: #fff;
}

/* ---------- card grid ---------- */
.tm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  align-items: start;
}

.tm-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  min-width: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.tm-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.3);
}

.tm-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.tm-avatar {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.tm-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.tm-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.tm-you {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--text-secondary);
  background: var(--border-light);
  border-radius: var(--radius-full);
}

.tm-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.tm-role-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.tm-role-indigo {
  background: #e0e7ff;
  color: #4338ca;
}

.tm-role-gold {
  background: #fef3c7;
  color: #92400e;
}

.tm-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.tm-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-muted);
}

.tm-user code {
  flex: 1;
  min-width: 0;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.page-teachers .tm-copy {
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.page-teachers .tm-copy:hover {
  color: var(--primary);
  border-color: rgba(15, 118, 110, 0.4);
}

.tm-class {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--success-green);
}

.tm-class.is-empty {
  font-weight: 400;
  color: var(--text-muted);
}

.tm-go {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.tm-card {
  cursor: pointer;
}

.tm-card:hover .tm-go {
  color: var(--primary);
  transform: translateX(3px);
}

.tm-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tm-class.tm-teach {
  color: var(--indigo);
}

/* ---------- detail sheet ---------- */
body.tm-sheet-open {
  overflow: hidden;
}

.tm-sheet {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
  animation: tm-fade 0.15s ease;
}

.tm-sheet[hidden] {
  display: none;
}

.tm-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: tm-pop 0.2s ease;
}

.page-teachers .tm-sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-secondary);
  border-radius: 50%;
}

.tm-sheet-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 36px;
  margin-bottom: 16px;
}

.tm-avatar-lg {
  width: 68px;
  height: 68px;
  font-size: 23px;
}

.tm-sheet-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.tm-sheet-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-radius: var(--radius-md);
}

.tm-sheet-user code {
  flex: 1;
  min-width: 0;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.tm-sheet-section {
  margin-top: 20px;
}

.tm-sheet-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.tm-sheet-section h3 i {
  color: var(--primary);
}

.tm-sheet-empty {
  margin: 0;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.tm-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--indigo);
  background: var(--indigo-subtle);
  border-radius: var(--radius-full);
}

.tm-pill-class {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--success-green);
  background: var(--success-bg);
}

.tm-pill-class span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.tm-teach-row {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.tm-teach-row:last-child {
  margin-bottom: 0;
}

.tm-teach-class {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.tm-teach-class i {
  color: var(--amber);
}

.tm-teach-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-teachers .tm-sheet-actions button {
  width: 100%;
  min-height: 42px;
}

.tm-sheet-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

@keyframes tm-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes tm-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes tm-rise {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
@media (max-width: 560px) {
  .tm-sheet {
    align-items: flex-end;
    padding: 0;
  }
  .tm-sheet-panel {
    max-width: none;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: tm-rise 0.25s ease;
  }
}
.tm-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
}

.tm-empty i {
  font-size: 34px;
  margin-bottom: 10px;
}

.tm-empty p {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .tm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .tm-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tm-search {
    max-width: none;
  }
  .tm-filters {
    width: 100%;
  }
  .page-teachers .tm-chip {
    flex: 1;
  }
  .tm-stat {
    padding: 12px;
  }
  .tm-stat-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tm-card,
  .tm-go,
  .tm-sheet,
  .tm-sheet-panel {
    transition: none;
    animation: none;
  }
  .tm-card:hover {
    transform: none;
  }
}
/* =========================================
   CLASSES PAGE — extras on top of the shared
   card grid / detail sheet (tm-*) styles.
========================================= */
.tm-role-green {
  background: #dcfce7;
  color: #15803d;
}

.cm-tile {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.cm-tile-lg {
  width: 68px;
  height: 68px;
  border-radius: 18px;
}

.tm-class.tm-plain {
  color: var(--text-secondary);
}

.cm-teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 500;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.cm-mini-avatar {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
}

.cm-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
}

.cm-line strong {
  font-size: 18px;
  color: var(--text-main);
}

.cm-subjects {
  margin-bottom: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.cm-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.cm-subject-row:last-child {
  border-bottom: none;
}

.cm-subject-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-main);
}

.cm-subject-name i {
  color: var(--indigo);
  font-size: 12px;
}

.cm-subject-teacher {
  text-align: right;
  color: var(--text-secondary);
}

.cm-subject-teacher.is-empty {
  color: var(--text-muted);
}

.page-teachers .cm-wide {
  width: 100%;
  min-height: 40px;
}

/* =========================================
   CLASS SUBJECTS PAGE — extras on top of the
   shared card grid (tm-*) and class (cm-*)
   styles.
========================================= */
.cs-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cs-card,
.cs-card:hover {
  cursor: default;
  transform: none;
}

.cs-tile i {
  font-size: 22px;
}

.page-teachers .cs-remove {
  width: 34px;
  height: 34px;
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.page-teachers .cs-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(220, 38, 38, 0.35);
}

.page-teachers .cs-remove:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.cs-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .cs-header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .cs-header-actions .btn {
    justify-content: center;
  }
}
/* =========================================
   TEACHER DROPDOWN (teacher-dropdown.js)
   Avatar trigger + floating list on desktop,
   bottom sheet on phones.
========================================= */
.dd {
  position: relative;
}

.dd-trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 7px 10px 7px 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dd-trigger:hover:not(:disabled) {
  background: var(--surface);
  border-color: rgba(15, 118, 110, 0.45);
}

.dd-trigger:focus-visible,
.dd-trigger.is-open {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.dd-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dd-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-label.is-placeholder {
  font-weight: 400;
  color: var(--text-muted);
}

.dd-av {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}

.dd-av-empty {
  color: var(--text-muted);
  background: var(--surface);
  border: 1.5px dashed #cbd5e1;
}

.dd-chev-wrap {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  background: var(--surface-alt);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.dd-trigger.is-open .dd-chev-wrap {
  transform: rotate(180deg);
  color: var(--primary);
  background: rgba(15, 118, 110, 0.12);
}

.dd-backdrop {
  display: none;
}

.dd-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px -8px rgba(15, 23, 42, 0.22), 0 4px 10px -4px rgba(15, 23, 42, 0.08);
  animation: tm-pop 0.15s ease;
}

.dd-panel[hidden] {
  display: none;
}

.dd.dd-up .dd-panel {
  top: auto;
  bottom: calc(100% + 8px);
}

.dd-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 9px 11px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.dd-search:focus-within {
  border-color: var(--primary);
}

.dd-search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
}

.dd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 230px;
  overflow-y: auto;
}

.dd-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  font-size: 14px;
  color: var(--text-main);
  border-radius: 10px;
  cursor: pointer;
}

.dd-opt:hover,
.dd-opt.is-active {
  background: var(--surface-alt);
}

.dd-opt.is-selected {
  background: rgba(15, 118, 110, 0.09);
}

.dd-opt.is-selected .dd-opt-name {
  font-weight: 600;
  color: var(--primary-dark);
}

.dd-opt-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dd-opt-name.is-muted {
  color: var(--text-secondary);
}

.dd-check {
  width: 18px;
  display: inline-flex;
  flex-shrink: 0;
  color: var(--primary);
}

.dd-empty {
  padding: 16px 10px;
  font-size: 13px;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .dd.is-open .dd-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.45);
  }
  .dd-panel,
  .dd.dd-up .dd-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 960;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    padding: 18px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border: none;
    border-radius: 18px 18px 0 0;
    animation: tm-rise 0.22s ease;
  }
  .dd-panel[hidden] {
    display: none;
  }
  .dd-panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    background: #cbd5e1;
    border-radius: 2px;
  }
  .dd-list {
    flex: 1;
    max-height: none;
  }
  .dd-opt {
    padding: 10px 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dd-panel {
    animation: none;
  }
  .dd-trigger,
  .dd-chev-wrap {
    transition: none;
  }
}
/* =========================================
   SUBJECTS PAGE — compact subject cards on
   top of the shared card grid (tm-*) styles.
========================================= */
.tm-role-grey {
  background: #f1f5f9;
  color: #64748b;
}

.sj-grid {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.sj-card {
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  cursor: default;
}

.sj-card:hover {
  transform: none;
}

.sj-card .tm-card-top {
  gap: 10px;
}

.sj-card .tm-id {
  gap: 4px;
}

.sj-card .tm-name {
  font-size: 14px;
  line-height: 1.25;
}

.sj-card .tm-role {
  padding: 2px 9px;
  font-size: 11px;
}

.cm-tile.sj-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 17px;
}

.sj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sj-chip {
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--indigo);
  background: var(--indigo-subtle);
  border-radius: var(--radius-full);
}

.sj-chip.sj-more {
  color: var(--text-secondary);
  background: #e2e8f0;
  cursor: help;
}

.sj-none {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.sj-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.page-teachers .sj-actions button {
  flex: 1;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 12.5px;
}

.page-teachers .sj-del {
  color: var(--danger);
}

.page-teachers .sj-del:hover {
  background: var(--danger-bg);
  border-color: rgba(220, 38, 38, 0.35);
}

@media (max-width: 560px) {
  .sj-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* =========================================
   RESULTS PAGE (teacher score entry)
   Everything here is prefixed rs- so it can't
   touch any other page.
========================================= */
.rs-header {
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-start;
}

.rs-autosave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.rs-autosave i {
  color: var(--primary);
  font-size: 15px;
}

.rs-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.rs-picker-section {
  margin-bottom: 16px;
}

/* ---------- class & subject cards ---------- */
.rs-picker {
  position: relative;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 4px 10px;
  margin: -4px -4px 0;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

button.rs-pick {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 215px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
  text-align: left;
  scroll-snap-align: start;
}

button.rs-pick:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
}

button.rs-pick:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button.rs-pick.is-selected,
button.rs-pick.is-selected:hover {
  background: rgba(15, 118, 110, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.rs-pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rs-pick-text strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.rs-pick-text span {
  font-size: 12px;
  color: var(--text-muted);
}

.rs-tick {
  display: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  align-items: center;
  justify-content: center;
}

button.rs-pick.is-selected .rs-tick {
  display: inline-flex;
}

/* ---------- class tile + tones ---------- */
.rs-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 46px;
  max-width: 88px;
  height: 40px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-tone-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.rs-tone-indigo {
  background: #e0e7ff;
  color: #4338ca;
}

.rs-tone-amber {
  background: #fef3c7;
  color: #b45309;
}

/* ---------- overview card ---------- */
.rs-overview {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.rs-ov-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rs-ov-head .rs-tile {
  min-width: 64px;
  height: 56px;
  border-radius: 14px;
  font-size: 15px;
}

.rs-ov-title {
  flex: 1;
  min-width: 0;
}

.rs-ov-title h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.rs-ov-meta {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.rs-final {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 9999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12.5px;
  font-weight: 600;
}

.rs-final[hidden] {
  display: none;
}

.rs-progress {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 12px;
  background: var(--surface-alt);
  border-radius: 14px;
}

.rs-ring-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
}

.rs-ring {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rs-ring circle {
  fill: none;
  stroke-width: 5;
}

.rs-ring-track {
  stroke: #e2e8f0;
}

.rs-ring-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dasharray 0.35s ease;
}

.rs-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.rs-progress-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.rs-progress-text strong {
  font-size: 18px;
  font-weight: 700;
}

.rs-progress-text span {
  font-size: 13px;
  color: var(--text-secondary);
}

button.rs-stats-toggle {
  display: none;
}

.rs-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.rs-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: 14px;
}

.rs-stat-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 15px;
}

.rs-i-indigo {
  background: #e0e7ff;
  color: #4338ca;
}

.rs-i-green {
  background: #dcfce7;
  color: #15803d;
}

.rs-i-red {
  background: #fee2e2;
  color: #dc2626;
}

.rs-i-amber {
  background: #fef3c7;
  color: #d97706;
}

.rs-stat strong {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.rs-stat-label {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-secondary);
}

.rs-spread {
  margin-top: 18px;
}

.rs-spread-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.rs-spread-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.rs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.rs-legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rs-legend b {
  font-weight: 700;
  color: var(--text-main);
}

.rs-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.rs-spread-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.rs-spread-bar span {
  min-width: 4px;
  transition: flex-grow 0.3s ease;
}

/* ---------- grade colours (circle, dot, bars) ---------- */
.g-A {
  background: #15803d;
}

.g-B {
  background: #22c55e;
}

.g-C {
  background: #86efac;
}

.g-P {
  background: #f59e0b;
}

.g-F {
  background: #ef4444;
}

/* ---------- search + filter ---------- */
.rs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rs-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 440px;
}

.rs-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.rs-search input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text-main);
}

.rs-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.rs-filters {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
}

button.rs-filter {
  padding: 7px 16px;
  background: transparent;
  border: 0;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

button.rs-filter:hover {
  background: var(--surface-alt);
}

button.rs-filter:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

button.rs-filter.is-active,
button.rs-filter.is-active:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- student list ---------- */
.rs-list {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.rs-cols {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 128px 128px 110px 150px;
  -moz-column-gap: 12px;
       column-gap: 12px;
  align-items: center;
  padding-left: 20px;
  padding-right: 20px;
}

.rs-list-head {
  padding-top: 12px;
  padding-bottom: 12px;
  background: var(--surface-alt);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.rs-row {
  grid-template-areas: "student ca exam total grade";
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

.rs-row:hover {
  background: rgba(15, 118, 110, 0.02);
}

.rs-row[hidden] {
  display: none;
}

.rs-student {
  grid-area: student;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.rs-ca {
  grid-area: ca;
}

.rs-exam {
  grid-area: exam;
}

.rs-total {
  grid-area: total;
}

.rs-grade {
  grid-area: grade;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rs-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border-light);
  font-size: 13px;
  font-weight: 700;
}

.rs-av-0 {
  background: #dcfce7;
  color: #15803d;
}

.rs-av-1 {
  background: #fef3c7;
  color: #b45309;
}

.rs-av-2 {
  background: #ffe4e6;
  color: #be123c;
}

.rs-av-3 {
  background: #e0e7ff;
  color: #4338ca;
}

.rs-av-4 {
  background: #ccfbf1;
  color: #0f766e;
}

.rs-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.rs-cell-label {
  display: none;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rs-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rs-field input {
  box-sizing: border-box;
  width: 64px;
  height: 42px;
  padding: 0 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  -moz-appearance: textfield;
  -webkit-appearance: textfield;
          appearance: textfield;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rs-field input::-webkit-outer-spin-button,
.rs-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.rs-field input::-moz-placeholder {
  font-weight: 500;
  color: #cbd5e1;
}

.rs-field input::placeholder {
  font-weight: 500;
  color: #cbd5e1;
}

.rs-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.rs-field input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.rs-max {
  font-size: 13px;
  color: var(--text-muted);
}

.total-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.rs-total.is-empty .total-num {
  font-weight: 500;
  color: #cbd5e1;
}

.rs-bar {
  display: block;
  width: 100%;
  max-width: 100px;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.rs-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.rs-gcircle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.rs-gcircle.g-C {
  color: #14532d;
}

.rs-gcircle.g-none {
  background: #e2e8f0;
  color: #94a3b8;
}

.rs-remark {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.rs-note {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.rs-note[hidden] {
  display: none;
}

.rs-list-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.rs-body.rs-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* ---------- tablets and phones ---------- */
@media (max-width: 1000px) {
  .rs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rs-list-head {
    display: none;
  }
  .rs-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "student student grade" "ca exam total";
    row-gap: 14px;
    -moz-column-gap: 10px;
         column-gap: 10px;
    padding: 16px;
  }
  .rs-cell-label {
    display: block;
  }
  .rs-remark {
    display: none;
  }
  .rs-grade {
    justify-content: flex-end;
  }
  .rs-field input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 76px;
  }
  .rs-list-foot {
    flex-direction: column;
    padding: 14px 16px;
  }
}
@media (max-width: 768px) {
  .rs-header {
    flex-direction: column;
    gap: 10px;
  }
  button.rs-pick {
    min-width: 190px;
  }
  .rs-overview {
    padding: 16px;
  }
  .rs-ov-head {
    gap: 12px;
  }
  .rs-ov-head .rs-tile {
    min-width: 52px;
    height: 52px;
    font-size: 13px;
  }
  .rs-ov-title h2 {
    font-size: 18px;
  }
  .rs-meta-term,
  .rs-progress-text {
    display: none;
  }
  .rs-progress {
    padding: 0;
    background: none;
  }
  button.rs-stats-toggle {
    display: inline-flex;
    margin-top: 14px;
    padding: 7px 16px;
    border-radius: 9999px;
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.25);
    color: var(--primary-dark);
    font-size: 13.5px;
  }
  button.rs-stats-toggle:hover {
    background: rgba(15, 118, 110, 0.14);
  }
  button.rs-stats-toggle i {
    font-size: 11px;
    transition: transform 0.2s ease;
  }
  .rs-overview.is-open button.rs-stats-toggle i {
    transform: rotate(180deg);
  }
  .rs-ov-body {
    display: none;
  }
  .rs-overview.is-open .rs-ov-body {
    display: block;
  }
  .rs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }
  .rs-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .rs-search {
    flex: 0 0 auto;
    max-width: none;
  }
  .rs-filters {
    display: flex;
  }
  button.rs-filter {
    flex: 1;
    padding-left: 8px;
    padding-right: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rs-ring-fill,
  .rs-spread-bar span,
  .rs-bar i,
  .rs-stats-toggle i,
  .rs-field input {
    transition: none;
  }
}
/* =========================================
   ROSTER + STUDENTS PAGES
   Prefixed st- (the tile, avatar, search and
   filter styles above are shared with Results).
========================================= */
.st-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.st-title-row .rs-tile {
  min-width: 64px;
  height: 52px;
  border-radius: 14px;
  font-size: 15px;
}

.st-title-row h1 {
  margin-bottom: 4px;
}

.st-header {
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.st-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

a.st-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

a.st-back:hover {
  color: var(--primary);
}

.st-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
}

.st-pill-open {
  background: #dcfce7;
  color: #166534;
}

.st-pill-locked {
  background: #fef3c7;
  color: #92400e;
}

.st-pill-view {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
}

/* ---------- summary tiles ---------- */
.st-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.st-metric {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
}

.st-metric-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
}

.st-metric strong {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
}

.st-metric-note {
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.st-split {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13.5px;
  color: var(--text-main);
}

.st-split span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.st-split b {
  font-weight: 700;
}

.st-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.st-dot-male,
.st-bar-male {
  background: #378add;
}

.st-dot-female,
.st-bar-female {
  background: #d4537e;
}

.st-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.st-bar span {
  transition: flex-grow 0.3s ease;
}

/* ---------- toolbar + buttons ---------- */
.st-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.st-toolbar .rs-search {
  flex: 1 1 240px;
  max-width: 380px;
}

.st-toolbar-spacer {
  flex: 1 1 0;
}

.st-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

button.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
}

button.st-btn:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
}

button.st-btn:focus-visible,
button.st-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button.st-btn-primary,
button.st-btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.st-btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.st-dropdown {
  position: relative;
}

.st-menu {
  position: absolute;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.st-dropdown > .st-menu {
  top: calc(100% + 6px);
  right: 0;
}

.st-menu[hidden] {
  display: none;
}

.st-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
  color: var(--text-main);
}

.st-menu button i {
  width: 16px;
  color: var(--text-secondary);
  text-align: center;
}

.st-menu button:hover {
  background: var(--surface-alt);
}

.st-menu button.is-danger,
.st-menu button.is-danger i {
  color: var(--danger);
}

.st-menu-title {
  padding: 6px 12px 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.st-menu-empty {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- student rows ---------- */
.st-cols {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 140px 92px 124px;
  -moz-column-gap: 12px;
       column-gap: 12px;
  align-items: center;
  padding-left: 20px;
  padding-right: 20px;
}

.st-cols-ro {
  grid-template-columns: 44px minmax(0, 1fr) 140px 92px 24px;
}

.st-list-head {
  padding-top: 12px;
  padding-bottom: 12px;
  background: var(--surface-alt);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.st-item {
  border-top: 1px solid var(--border-light);
}

.st-item[hidden] {
  display: none;
}

.st-row {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
  transition: background 0.15s ease;
}

.st-row:hover {
  background: rgba(15, 118, 110, 0.03);
}

.st-num {
  font-size: 13px;
  color: var(--text-muted);
}

.st-student {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.st-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.st-name {
  font-size: 14.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.st-name b {
  font-weight: 600;
}

.st-meta {
  display: none;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.st-adm {
  font-size: 13.5px;
  color: var(--text-main);
}

.st-adm .st-unset {
  color: var(--text-muted);
}

button.st-link-warn {
  padding: 0;
  background: none;
  border: 0;
  font-size: 13px;
  color: #b45309;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.st-link-warn:hover {
  background: none;
  color: #92400e;
}

.st-gender {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.st-male {
  background: #e6f1fb;
  color: #0c447c;
}

.st-female {
  background: #fbeaf0;
  color: #72243e;
}

.st-unspecified {
  background: #f1f5f9;
  color: #64748b;
}

.st-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

button.st-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

button.st-icon:hover {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
}

button.st-icon.is-danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

button.st-more {
  display: none;
}

.st-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.st-item.is-open .st-chevron {
  transform: rotate(180deg);
}

.st-row[role=button] {
  cursor: pointer;
}

.st-row[role=button]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.st-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 16px;
  padding: 12px 20px 16px 76px;
  background: var(--surface-alt);
  font-size: 13.5px;
  color: var(--text-main);
}

.st-detail[hidden] {
  display: none;
}

.st-detail small {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- tablets and phones ---------- */
@media (max-width: 1000px) {
  .st-list-head {
    display: none;
  }
  .st-cols,
  .st-cols-ro {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 16px;
    padding-right: 12px;
  }
  .st-num,
  .st-adm,
  .st-gender-cell,
  .st-actions {
    display: none;
  }
  .st-meta {
    display: block;
  }
  button.st-more {
    display: inline-flex;
  }
  .st-detail {
    padding: 12px 16px 16px;
  }
  .st-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .st-metrics .st-metric:last-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 768px) {
  .st-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .st-title-row .rs-tile {
    min-width: 52px;
    height: 46px;
    font-size: 13px;
  }
  .st-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .st-toolbar .rs-search {
    flex: 0 0 auto;
    max-width: none;
  }
  .st-toolbar-spacer {
    display: none;
  }
  .st-toolbar .st-dropdown,
  .st-toolbar button.st-btn {
    flex: 1;
  }
  .st-toolbar .st-dropdown button.st-btn {
    width: 100%;
  }
  .st-toolbar-buttons {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .st-bar span,
  .st-chevron,
  .st-row {
    transition: none;
  }
}
/* =========================================
   SESSIONS PAGE (se-*)
========================================= */
button.st-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.se-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1100px;
}

.se-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.se-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.se-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 20px;
}

.se-head-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 120px;
}

.se-eyebrow {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.se-head-text strong {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.se-steps {
  display: flex;
  gap: 6px;
  margin: 16px 0 18px;
}

.se-steps span {
  flex: 1;
  height: 6px;
  border-radius: 9999px;
  background: #e2e8f0;
  transition: background 0.25s ease;
}

.se-steps span.is-on {
  background: var(--primary);
}

.se-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.se-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.se-spaced {
  margin-top: 14px;
}

.se-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.se-autosave {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.se-autosave i {
  color: var(--primary);
}

.se-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.se-empty strong {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text-main);
}

/* ---------- styled term dropdown ---------- */
.se-dd {
  position: relative;
}

.se-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

button.se-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: var(--text-main);
}

button.se-trigger:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
}

button.se-trigger[aria-expanded=true],
button.se-trigger:focus-visible {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button.se-trigger > i:first-child {
  color: var(--text-muted);
}

.se-value {
  flex: 1;
}

.se-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

button.se-trigger[aria-expanded=true] .se-chevron {
  transform: rotate(180deg);
}

.se-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.se-menu[hidden] {
  display: none;
}

button.se-opt {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
  color: var(--text-main);
}

button.se-opt:hover,
button.se-opt:focus-visible {
  outline: none;
  background: var(--surface-alt);
}

button.se-opt.is-selected {
  background: rgba(15, 118, 110, 0.1);
}

.se-opt b {
  display: block;
  font-weight: 600;
}

.se-opt small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.se-opt .se-check {
  margin-left: auto;
  color: var(--primary);
  visibility: hidden;
}

button.se-opt.is-selected .se-check {
  visibility: visible;
}

/* ---------- date + text inputs ---------- */
.se-input-wrap {
  position: relative;
}

.se-input-wrap i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.se-input-wrap input,
.se-input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--text-main);
}

.se-input-wrap input {
  padding-left: 38px;
}

.se-input-wrap input:focus,
.se-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

/* ---------- new session card ---------- */
.se-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

button.se-fold {
  display: none;
}

.se-note {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef3c7;
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
}

.se-note i {
  flex: 0 0 auto;
  margin-top: 3px;
}

button.se-go {
  width: 100%;
  height: 44px;
  margin-top: 16px;
}

@media (max-width: 1000px) {
  .se-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 768px) {
  .se-card {
    padding: 16px;
  }
  .se-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .se-title {
    display: none;
  }
  button.se-fold {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
  }
  button.se-fold:hover {
    background: none;
  }
  button.se-fold i {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
  }
  .se-card.is-open button.se-fold i {
    transform: rotate(180deg);
  }
  .se-body {
    display: none;
    margin-top: 14px;
  }
  .se-card.is-open .se-body {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  .se-steps span,
  .se-chevron,
  button.se-fold i {
    transition: none;
  }
}
/* =========================================
   SETUP PANEL (Broadsheet + Report Card)
   Drawn by setup-panel.js; the real selects stay in
   the page, hidden, and still do the work.
========================================= */
.sp {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.sp-open {
  padding: 20px;
}

.sp.is-folded .sp-open {
  display: none;
}

.sp-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.sp-step-class {
  flex: 1.5 1 320px;
  min-width: 0;
}

.sp-step-term {
  flex: 1 1 260px;
  min-width: 0;
}

.sp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  font-size: 11px;
  letter-spacing: 0;
  color: #fff;
}

.sp-classes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

button.sp-cls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
}

button.sp-cls:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
}

button.sp-cls:focus-visible,
button.sp-seg-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button.sp-cls .rs-tile {
  min-width: 40px;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
}

button.sp-cls .sp-tick {
  display: none;
  margin-left: 2px;
  color: var(--primary);
}

button.sp-cls.is-on,
button.sp-cls.is-on:hover {
  background: rgba(15, 118, 110, 0.08);
  border-color: var(--primary);
}

button.sp-cls.is-on .sp-tick {
  display: inline;
}

button.sp-cls:disabled {
  cursor: default;
  opacity: 1;
}

.sp-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
}

button.sp-seg-btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

button.sp-seg-btn:hover {
  background: var(--surface);
}

button.sp-seg-btn.is-on,
button.sp-seg-btn.is-on:hover {
  background: var(--primary);
  color: #fff;
}

.sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
}

button.sp-seg-btn.is-on .sp-dot {
  background: #bbf7d0;
}

.sp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sp-summary {
  flex: 1 1 200px;
  font-size: 13px;
  color: var(--text-secondary);
}

button.sp-go {
  height: 42px;
  padding: 0 20px;
}

/* ---------- folded: one line once a result is showing ---------- */
.sp-folded {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.sp.is-folded .sp-folded {
  display: flex;
}

.sp-folded .rs-tile {
  min-width: 52px;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
}

.sp-folded-text {
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  min-width: 0;
}

.sp-folded-text strong {
  font-size: 14.5px;
  font-weight: 600;
}

.sp-folded-text span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.sp-show {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-show label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

select.sp-select {
  max-width: 240px;
  height: 38px;
  padding: 0 34px 0 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2394a3af' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-main);
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
}

select.sp-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

/* ---------- empty preview ---------- */
.sp-placeholder {
  margin-bottom: 16px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  text-align: center;
}

.sp-placeholder[hidden] {
  display: none;
}

.sp-placeholder strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
  color: var(--text-main);
}

.sp-placeholder > span {
  font-size: 13px;
  color: var(--text-secondary);
}

.sp-skeleton {
  margin-top: 16px;
  opacity: 0.55;
}

.sp-sk-row {
  display: grid;
  grid-template-columns: 1.6fr repeat(5, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border-light);
}

.sp-sk-row:first-child {
  border-top: 0;
}

.sp-sk-row i {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: #e2e8f0;
}

@media (max-width: 768px) {
  .sp-open {
    padding: 16px;
  }
  .sp-steps {
    gap: 16px;
  }
  .sp-bar {
    flex-direction: column;
    align-items: stretch;
  }
  button.sp-go {
    width: 100%;
  }
  .sp-folded {
    padding: 12px;
  }
  .sp-show {
    flex: 1 1 100%;
  }
  select.sp-select {
    flex: 1;
    max-width: none;
  }
  .sp-sk-row {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
  .sp-sk-row i:nth-child(n+5) {
    display: none;
  }
}
/* ---------- "Show" student dropdown (Report Card) ---------- */
.sp-show-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sp-student-dd {
  width: 260px;
}

button.sp-student-trigger {
  height: 38px;
  font-size: 13.5px;
}

.sp-student-trigger .se-value,
.sp-opt-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-menu.sp-student-menu {
  left: auto;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 8px;
}

.sp-search {
  position: relative;
  margin-bottom: 6px;
}

.sp-search i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.sp-search input {
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-main);
}

.sp-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.sp-options {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sp-options button.se-opt {
  padding: 7px 8px;
}

.sp-options button.se-opt[hidden],
.sp-sep[hidden] {
  display: none;
}

.sp-opt-av {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.sp-opt-all {
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary);
  font-size: 13px;
}

.sp-opt-name {
  flex: 1;
}

.sp-opt-name b {
  display: inline;
  font-weight: 600;
}

.sp-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-light);
}

.se-menu-empty {
  margin: 0;
  padding: 14px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .sp-student-dd {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .se-menu.sp-student-menu {
    left: 0;
    width: auto;
  }
}/*# sourceMappingURL=sytle.css.map */