﻿:root {
  --navy: #0f2747;
  --navy-2: #173a66;
  --red: #d62235;
  --gold: #c99a2e;
  --gold-soft: #fff4d8;
  --white: #ffffff;
  --ink: #1d2733;
  --muted: #667085;
  --line: #d9e1ea;
  --page: #f4f7fb;
  --danger: #b42318;
  --green: #079455;
  --blue: #2563eb;
  --radius: 8px;
  --shadow: 0 16px 40px rgba(15, 39, 71, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 39, 71, 0.96), rgba(214, 34, 53, 0.86)) top / 100% 320px no-repeat,
    var(--page);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.public-site {
  background: var(--page);
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  color: var(--white);
}

.public-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.public-nav a,
.footer-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.public-nav a {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.public-hero {
  min-height: 520px;
  display: grid;
  align-items: center;
  margin-top: -112px;
  padding: 140px 24px 54px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(15, 39, 71, 0.96), rgba(214, 34, 53, 0.78)),
    linear-gradient(45deg, #0f2747, #d62235);
}

.public-hero-content {
  width: min(860px, 100%);
  margin: 0 auto;
}

.public-hero h2 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.05;
}

.public-hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
}

.public-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.public-actions a {
  text-decoration: none;
}

.public-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px;
}

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

.public-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.public-card h3 {
  margin-top: 0;
  color: var(--navy);
}

.public-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.public-footer {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--navy);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
}

.admin-footer-link {
  color: var(--muted) !important;
  font-size: 0.86rem;
}

body.locked {
  min-height: 100vh;
  background: var(--navy);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(201, 154, 46, 0.22), transparent 34%),
    linear-gradient(135deg, #071832, var(--navy));
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.login-card .eyebrow {
  color: var(--gold);
}

.login-card h1 {
  color: var(--navy);
}

.login-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.login-logo {
  width: 70px;
  height: 70px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: var(--white);
  object-fit: cover;
  object-position: center;
}

.btn-gold {
  color: var(--navy);
  background: linear-gradient(135deg, #d4af37, #f5d76e);
}

.form-message {
  min-height: 22px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.form-message.success {
  color: var(--green);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.logo-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: var(--white);
  object-fit: cover;
  object-position: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.5vw, 2.4rem);
  line-height: 1.15;
}

.header-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 36px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs [hidden],
.tab-panel[hidden] {
  display: none !important;
}

.tab-btn {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 800;
}

.tab-btn.active {
  color: var(--navy);
  background: var(--white);
  border-color: var(--white);
}

.permission-muted,
.is-staff [data-super-only="true"] {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.is-staff button[data-super-only="true"],
.is-staff .tab-btn[data-super-only="true"] {
  cursor: not-allowed;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.toolbar,
.table-section,
.attendance-section,
.settings-section,
.statistics-section,
.belt-dashboard,
.student-dialog form,
.history-panel,
.profile-panel,
.admin-confirm-card {
  background: var(--white);
  border: 1px solid rgba(217, 225, 234, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  border-top: 4px solid var(--navy-2);
}

.metric-total {
  border-top-color: var(--gold);
}

.metric-fee,
.metric-danger {
  border-top-color: var(--red);
}

.metric-present {
  border-top-color: var(--green);
}

.metric-warning {
  border-top-color: var(--gold);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
}

.toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.attendance-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) repeat(4, auto);
}

.shift-choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shift-choice-btn {
  min-height: 42px;
  flex: 1 1 110px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.shift-choice-btn.active {
  color: var(--white);
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 8px 18px rgba(214, 34, 53, 0.22);
}

label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 142px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--navy);
  background: rgba(15, 39, 71, 0.08);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(201, 154, 46, 0.2);
  box-shadow: 0 0 0 3px rgba(201, 154, 46, 0.18);
  outline: none;
}

.password-toggle.is-visible {
  color: var(--red);
  background: rgba(200, 43, 43, 0.12);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 154, 46, 0.18);
}

.btn,
.icon-btn {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.login-home-link,
.home-site-link {
  color: var(--navy);
}

.btn:hover,
.icon-btn:hover,
.status-btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--white);
  background: var(--red);
  box-shadow: 0 8px 18px rgba(214, 34, 53, 0.22);
}

.btn-secondary {
  color: var(--navy);
  background: var(--gold-soft);
  border: 1px solid rgba(201, 154, 46, 0.46);
}

.btn-light {
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
}

.btn-danger {
  color: var(--white);
  background: var(--danger);
}

.btn-present {
  color: var(--white);
  background: var(--green);
}

.table-section,
.attendance-section {
  overflow: hidden;
}

.history-section {
  margin-top: 18px;
}

.belt-dashboard {
  margin-bottom: 18px;
  overflow: hidden;
}

.belt-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.belt-stat-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.belt-stat-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.belt-stat-card strong {
  color: var(--navy);
  font-size: 1.35rem;
}

.settings-section {
  overflow: hidden;
}

.sync-section {
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(217, 225, 234, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sync-card {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.sync-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.sync-actions .btn {
  min-height: 58px;
}

.sync-warning {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(201, 154, 46, 0.36);
  border-radius: 12px;
  color: var(--navy);
  background: var(--gold-soft);
}

.admin-content > .dashboard {
  display: none;
}

.simple-stats-entry {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.students-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(11, 31, 58, 0.08);
}

.students-page-head .eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.students-page-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.12;
}

.students-page-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.add-student-main-btn {
  min-width: 190px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(216, 169, 21, 0.24);
}

.collapsible-stats-card {
  display: grid;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(11, 31, 58, 0.08);
  overflow: hidden;
}

.collapsible-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.collapsible-card-head h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1.12rem;
}

.collapsible-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.collapsible-card-head .btn {
  min-width: 88px;
}

.simple-statistics-panel,
.backup-preview {
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(11, 31, 58, 0.08);
}

.simple-statistics-panel {
  padding: 18px;
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
}

.simple-statistics-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.simple-statistics-heading h2 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: clamp(22px, 2vw, 28px);
}

.simple-statistics-heading p {
  margin: 0;
  color: var(--muted);
}

.simple-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.simple-stat-card {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 14px;
  background: #f8fafc;
}

.simple-stat-card span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.simple-stat-card strong {
  color: var(--navy);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.simple-stats-tables {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.simple-stats-table {
  overflow: hidden;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 14px;
  background: #ffffff;
}

.simple-stats-table h3 {
  margin: 0;
  padding: 12px 14px;
  color: var(--navy);
  background: #f4f7fb;
  font-size: 1rem;
}

.simple-stats-table table {
  width: 100%;
  border-collapse: collapse;
}

.simple-stats-table td {
  padding: 10px 14px;
  border-top: 1px solid rgba(11, 31, 58, 0.08);
  font-size: 0.94rem;
}

.simple-stats-table td:last-child {
  width: 72px;
  color: var(--navy);
  font-weight: 800;
  text-align: right;
}

.backup-preview {
  margin-top: 12px;
  padding: 16px;
}

.backup-preview h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 1.05rem;
}

.backup-preview ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 10px;
  list-style: none;
}

.backup-preview li {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f7fb;
  color: var(--text);
}

.backup-preview p {
  margin: 0;
  color: var(--muted);
}

.monthly-attendance-stats {
  display: grid;
  gap: 18px;
  margin: 18px 0;
}

.statistics-fallback-section {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.statistics-fallback-section:empty {
  display: none;
}

.training-situation-section {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.direct-statistics-filters {
  margin: 14px 0 18px;
}

.monthly-attendance-table td:first-child span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.attendance-stat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 28px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
}

.present-badge {
  color: #075c35;
  background: #dff8ea;
}

.absent-badge {
  color: #384150;
  background: #edf2f7;
}

.leave-badge {
  color: #075985;
  background: #dff3ff;
}

.reschedule-badge {
  color: #7a4c00;
  background: #fff1c2;
}

.unexcused-badge {
  color: #9f1239;
  background: #ffe1e8;
}

.clickable-badge {
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(159, 18, 57, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.clickable-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(159, 18, 57, 0.22);
}

.attendance-ranking-section,
.attendance-alert-section {
  display: grid;
  gap: 12px;
}

.attendance-ranking-card .attendance-ranking-content {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(11, 31, 58, 0.08);
}

.attendance-ranking-section h3,
.attendance-alert-section h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.18rem;
}

.attendance-warning-row {
  background: #fff5f5;
}

.attendance-session-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 14px;
  background: #f8fafc;
}

.attendance-session-filters label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
}

.attendance-session-filters input,
.attendance-session-filters select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.attendance-session-stats-panel {
  margin: 18px 0;
}

.attendance-panel-session-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(11, 31, 58, 0.08);
}

.attendance-panel-session-filters {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.attendance-panel-student-filter {
  min-width: min(100%, 220px);
}

.attendance-panel-alerts {
  padding: 14px;
  border: 1px solid rgba(215, 38, 61, 0.14);
  border-radius: 16px;
  background: #fffafa;
}

.attendance-session-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 16px;
  background: #f8fafc;
}

.attendance-session-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.attendance-session-summary-btn strong {
  color: #fff;
  background: var(--navy);
}

.attendance-session-detail-panel[hidden] {
  display: none;
}

.attendance-alert-list {
  display: grid;
  gap: 12px;
}

.attendance-alert-card,
.unexcused-detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(215, 38, 61, 0.22);
  border-radius: 16px;
  background: #fff7f8;
}

.attendance-alert-card strong,
.unexcused-detail-card strong {
  color: var(--navy);
}

.attendance-alert-card span,
.unexcused-detail-card span {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
}

.attendance-alert-card em {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #9f1239;
  background: #ffe1e8;
  font-style: normal;
  font-weight: 800;
}

.attendance-alert-count {
  color: #9f1239;
}

.late-pill,
.late-badge,
.badge-late {
  color: #8a4b00;
  background: #fff3cd;
}

.reschedule-pill,
.reschedule-badge,
.badge-rescheduled {
  color: #0b4f6c;
  background: #e0f2fe;
}

.mini-contact-btn {
  width: fit-content;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.training-compact-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.attendance-group-block {
  display: grid;
  gap: 10px;
}

.attendance-class-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 16px;
  background: #f8fafc;
}

.attendance-class-detail + .attendance-class-detail {
  margin-top: 12px;
}

.attendance-class-detail summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 800;
}

.attendance-class-detail summary strong {
  color: #9f1239;
}

.class-detail-summary {
  margin-top: 12px;
  background: #fff;
}

.is-clickable-attendance-student {
  cursor: pointer;
}

.is-clickable-attendance-student:hover {
  border-color: rgba(215, 38, 61, 0.26);
  background: #fffafa;
}

.attendance-contact-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(215, 38, 61, 0.18);
  border-radius: 14px;
  background: #fffafa;
}

.attendance-contact-card strong {
  color: var(--navy);
}

.attendance-contact-card span,
.attendance-contact-card p,
.attendance-contact-card li {
  color: var(--muted);
  line-height: 1.55;
}

.attendance-contact-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.attendance-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.unexcused-detail-list {
  display: grid;
  gap: 12px;
}

.unexcused-detail-card {
  grid-template-columns: 1.1fr 1fr 1fr auto;
  align-items: center;
}

.unexcused-detail-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.monthly-tuition-summary {
  display: grid;
  gap: 18px;
  margin: 20px 0;
}

.monthly-tuition-cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.monthly-tuition-summary-table td {
  vertical-align: middle;
}

.tuition-money-paid {
  color: #075c35;
  font-weight: 800;
}

.tuition-money-missing {
  color: #9f1239;
  font-weight: 800;
}

.tuition-summary-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
}

.tuition-summary-status.paid {
  color: #075c35;
  background: #dff8ea;
}

.tuition-summary-status.partial {
  color: #7a4c00;
  background: #fff1c2;
}

.tuition-summary-status.unpaid {
  color: #9f1239;
  background: #ffe1e8;
}

.compact-pill.clickable-badge {
  border: 0;
  cursor: pointer;
}

.statistics-section {
  overflow: hidden;
}

.statistics-overview {
  padding: 0 18px 18px;
}

.statistics-main-content {
  padding: 0 18px 18px;
}

.statistics-main-content:not(:empty) ~ .section-heading,
.statistics-main-content:not(:empty) ~ .training-quick-section,
.statistics-main-content:not(:empty) ~ .statistics-filters,
.statistics-main-content:not(:empty) ~ .statistics-grid {
  display: none;
}

.statistics-direct-page {
  display: grid;
  gap: 16px;
}

.statistics-direct-page h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 3vw, 34px);
}

.statistics-direct-page p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.statistics-overview-block {
  display: grid;
  gap: 14px;
}

.statistics-overview-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.statistics-overview-title h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(20px, 2vw, 26px);
}

.statistics-overview-title p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.statistics-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.statistics-overview-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(11, 31, 58, 0.06);
}

.statistics-overview-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.statistics-overview-card strong {
  color: var(--navy);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
}

.statistics-overview-card.money strong {
  font-size: clamp(20px, 2.3vw, 30px);
}

.statistics-overview-card.warning {
  border-color: rgba(224, 178, 26, 0.42);
  background: #fff9e8;
}

.statistics-overview-card.danger {
  border-color: rgba(215, 38, 61, 0.24);
  background: #fff4f5;
}

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

.statistics-summary-table {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.statistics-summary-table h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 1rem;
}

.statistics-summary-table table {
  width: 100%;
  border-collapse: collapse;
}

.statistics-summary-table th,
.statistics-summary-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
}

.statistics-summary-table th:last-child,
.statistics-summary-table td:last-child {
  width: 110px;
  text-align: right;
  font-weight: 800;
}

.statistics-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.statistics-grid {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.statistics-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
  overflow: hidden;
}

.statistics-card summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.statistics-card summary::-webkit-details-marker {
  display: none;
}

.statistics-card summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stats-panel {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.stats-metric-grid,
.stats-list-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stats-list-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-mini-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.stats-mini-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stats-mini-card strong {
  color: var(--navy);
  font-size: 1.35rem;
}

.stats-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.stats-list h4 {
  margin: 0 0 4px;
  color: var(--navy);
}

.stats-list p {
  margin: 0;
  color: #273444;
}

.tuition-warning-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}

.tuition-warning-normal {
  color: #175b3d;
  background: #e7f8ef;
}

.tuition-warning-yellow {
  color: #92400e;
  background: #fff3cd;
}

.tuition-warning-red {
  color: #9f1239;
  background: #ffe4e8;
}

.tuition-warning-action {
  border: 0;
  cursor: pointer;
}

.tuition-warning-action:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.tuition-warning-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.tuition-warning-table {
  min-width: 760px;
}

.tuition-monthly-section {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.tuition-monthly-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.tuition-monthly-controls label {
  display: grid;
  gap: 5px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.tuition-monthly-table {
  min-width: 1180px;
}

.tuition-monthly-table th,
.tuition-monthly-table td {
  padding: 9px 10px;
  font-size: 14px;
}

.tuition-rate-yellow {
  background: #fff8e1;
}

.tuition-rate-red {
  background: #fff1f2;
}

.compact-pill.tuition-rate-yellow {
  color: #92400e;
  background: #fde68a;
}

.compact-pill.tuition-rate-red {
  color: #9f1239;
  background: #ffe4e8;
}

.tuition-detail-row {
  grid-template-columns: minmax(180px, 1.3fr) repeat(5, minmax(110px, 0.8fr));
}

.tuition-detail-row > p {
  grid-column: 1 / -1;
}

.quick-tuition-dialog {
  width: min(560px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
}

.quick-tuition-dialog::backdrop {
  background: rgba(15, 39, 71, 0.58);
}

.quick-tuition-card {
  display: grid;
  gap: 14px;
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.quick-tuition-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-tuition-info div,
.tuition-history-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.quick-tuition-info span,
.tuition-history-item span,
.tuition-history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.quick-tuition-info strong,
.tuition-history-item strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
}

.quick-tuition-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.quick-tuition-options legend {
  padding: 0 6px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.quick-tuition-options label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.quick-tuition-options input {
  accent-color: var(--gold);
}

.quick-tuition-session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tuition-history-list {
  display: grid;
  gap: 8px;
}

.tuition-module-section {
  display: grid;
  gap: 16px;
}

.tuition-module-content {
  display: grid;
  gap: 16px;
}

.tuition-filter-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(110px, 0.4fr) auto minmax(120px, 0.4fr) minmax(120px, 0.4fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.tuition-filter-panel label,
.tuition-mode-toggle label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--navy);
}

.tuition-filter-panel select,
.tuition-filter-panel input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.tuition-filter-panel .is-hidden {
  display: none;
}

.tuition-segmented,
.tuition-mode-toggle,
.tuition-quick-months {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tuition-segmented button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.tuition-segmented button.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.tuition-module-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tuition-module-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--navy);
  background: #fff;
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.08);
  cursor: pointer;
  text-align: left;
}

.tuition-module-card:hover,
.tuition-module-card:focus-visible,
.tuition-module-card.active {
  border-color: var(--gold);
  outline: 3px solid rgba(212, 175, 55, 0.2);
  transform: translateY(-1px);
}

.tuition-module-card.active {
  background: var(--gold-soft);
}

.tuition-module-card span {
  font-size: 1rem;
  font-weight: 800;
}

.tuition-module-card strong {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: 1rem;
  font-weight: 900;
}

.tuition-module-panel,
.tuition-module-detail {
  display: grid;
  gap: 14px;
}

.compact-heading {
  margin-top: 4px;
}

.tuition-student-list {
  display: grid;
  gap: 12px;
}

.tuition-student-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.is-clickable-tuition-card {
  cursor: pointer;
}

.is-clickable-tuition-card:hover,
.is-clickable-tuition-card:focus-visible,
.tuition-student-option:hover,
.tuition-student-option:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(212, 175, 55, 0.18);
  background: #fffdf3;
}

.tuition-student-card h3 {
  margin: 0 0 4px;
  color: var(--navy);
}

.tuition-student-card p {
  margin: 0;
  color: var(--muted);
}

.tuition-student-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tuition-student-meta strong {
  color: var(--navy);
}

.tuition-collect-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.4fr);
  gap: 16px;
  align-items: start;
}

.tuition-search-box,
.tuition-collect-form,
.tuition-summary-controls {
  display: grid;
  gap: 8px;
}

.tuition-search-box input,
.tuition-collect-form input,
.tuition-collect-form select,
.tuition-collect-form textarea,
.tuition-summary-controls input,
.tuition-summary-controls select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.tuition-search-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.tuition-student-option {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}

.tuition-student-option.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.tuition-student-option span {
  color: var(--muted);
  font-size: 0.88rem;
}

.tuition-collect-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.tuition-single-fields,
.tuition-multi-fields {
  display: grid;
  gap: 10px;
}

.tuition-period-preview {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--navy);
}

.tuition-period-preview span {
  color: var(--muted);
  font-size: 0.9rem;
}

.tuition-summary-controls {
  grid-template-columns: 1fr minmax(150px, 0.35fr) minmax(130px, 0.25fr);
  align-items: end;
}

.tuition-month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tuition-period-breakdown,
.tuition-facility-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.tuition-breakdown-card,
.tuition-facility-totals div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: var(--navy);
  text-align: left;
}

.tuition-breakdown-card {
  cursor: pointer;
}

.tuition-breakdown-card:hover,
.tuition-breakdown-card:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(212, 175, 55, 0.18);
}

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

.level2-locked-panel {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(179, 24, 31, 0.25);
  border-radius: 8px;
  background: #fff8f0;
}

.level2-locked-panel h3 {
  margin: 0 0 4px;
}

.level2-locked-panel p {
  margin: 0;
  color: var(--muted);
}

.level2-lock-btn {
  align-self: end;
}

.student-compact-stats {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.compact-stat-title {
  display: grid;
  gap: 4px;
}

.compact-stat-title h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
}

.compact-stat-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.compact-overview-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 8px;
}

.compact-chip {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.compact-chip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.compact-chip strong {
  color: var(--navy);
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.compact-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.compact-stat-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.compact-stat-table h4 {
  margin: 0;
  padding: 10px 12px;
  color: var(--navy);
  background: #f6f8fc;
  font-size: 15px;
  font-weight: 700;
}

.compact-stat-table table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.compact-stat-table th,
.compact-stat-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.compact-stat-table th {
  color: #344054;
  background: #fbfcfe;
  font-weight: 700;
}

.compact-stat-table td {
  color: #273444;
  font-weight: 500;
}

.compact-stat-table td:last-child,
.compact-stat-table th:last-child {
  width: 92px;
  text-align: right;
}

.compact-stat-table td::before {
  content: none;
}

.compact-empty,
.compact-created-note {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.show-more-years-btn {
  margin: 10px 12px 12px;
}

.training-quick-section {
  display: grid;
  gap: 14px;
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 16px;
  background: #fbfcfe;
}

.training-quick-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.training-quick-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.15rem;
}

.training-quick-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.training-range-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.training-range-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
}

.training-range-btn.active {
  border-color: rgba(216, 169, 21, 0.48);
  background: var(--gold-soft);
  box-shadow: 0 8px 18px rgba(216, 169, 21, 0.14);
}

.export-training-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 999px;
  color: var(--white);
  background: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.export-training-btn:hover {
  background: #12355f;
}

.training-session-list {
  display: grid;
  gap: 12px;
}

.training-session-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.training-session-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.training-session-title h4 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.training-session-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.training-session-metrics span,
.training-summary-card {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 9px;
  border-radius: 11px;
  color: #344054;
  background: #f6f8fc;
  font-size: 0.82rem;
  font-weight: 600;
}

.training-session-metrics strong,
.training-summary-card strong {
  color: var(--navy);
  font-size: 1.12rem;
  line-height: 1.1;
  font-weight: 800;
}

.training-session-metrics .metric-present {
  color: #067647;
  background: #e6f8ef;
}

.training-session-metrics .metric-excused {
  color: #92400e;
  background: #fff7d6;
}

.training-session-metrics .metric-unexcused {
  color: #b42318;
  background: #ffe7e7;
}

.training-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.training-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.training-comparison-panel {
  padding: 0 16px 16px;
}

.compact-range-tabs {
  justify-content: flex-start;
  padding: 0 0 12px;
}

.training-compact-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.training-compact-table {
  min-width: 820px;
  border-collapse: collapse;
}

.training-compact-table th,
.training-compact-table td {
  padding: 10px 11px;
  white-space: nowrap;
}

.training-compact-table th {
  color: #344054;
  background: #f6f8fc;
  font-size: 0.82rem;
}

.training-compact-table td {
  font-size: 0.88rem;
  vertical-align: middle;
}

.training-compact-table td::before {
  content: none;
}

.training-compact-table tbody tr:hover {
  background: #fbfcfe;
}

.training-compact-table .low-attendance-row {
  background: #fff9ed;
}

.compact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.present-pill {
  color: #067647;
  background: #e6f8ef;
}

.excused-pill {
  color: #92400e;
  background: #fff7d6;
}

.unexcused-pill {
  color: #b42318;
  background: #ffe7e7;
}

.rate-pill {
  color: var(--navy);
  background: #eef4ff;
}

.rate-warning-pill {
  color: #b45309;
  background: #fff1d6;
}

.training-compact-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  font-weight: 600;
}

.training-detail-dialog {
  width: min(780px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
}

.training-detail-dialog::backdrop {
  background: rgba(15, 39, 71, 0.58);
}

.training-detail-panel {
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.training-detail-panel .dialog-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.training-detail-list {
  display: grid;
  gap: 10px;
}

.training-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.training-detail-summary div {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 12px;
  background: #f6f8fc;
}

.training-detail-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.training-detail-summary strong {
  color: var(--navy);
  font-size: 1.18rem;
}

.training-unexcused-box {
  padding: 14px;
  border: 1px solid rgba(215, 38, 61, 0.22);
  border-radius: 14px;
  background: #fff5f6;
}

.training-unexcused-box.is-empty {
  border-color: rgba(217, 225, 234, 0.9);
  background: #fbfcfe;
}

.training-unexcused-box h3,
.training-full-attendance h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 1rem;
}

.training-unexcused-box p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.training-unexcused-box ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
}

.training-unexcused-box li {
  color: #8a1024;
  font-weight: 700;
}

.training-unexcused-box li span,
.training-unexcused-box li em {
  display: block;
  margin-top: 2px;
  color: #6b3942;
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 600;
}

.training-full-attendance {
  display: grid;
  gap: 10px;
}

.training-detail-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.training-detail-row div {
  display: grid;
  gap: 2px;
}

.training-detail-row strong {
  color: var(--navy);
}

.training-detail-row span:not(.badge),
.training-detail-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.supplemental-attendance-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
}

.supplemental-attendance-dialog::backdrop {
  background: rgba(15, 39, 71, 0.58);
}

.supplemental-attendance-card {
  display: grid;
  gap: 16px;
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.supplemental-attendance-card .dialog-head {
  margin-bottom: 0;
}

.supplemental-search-field,
.supplemental-note-field {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.supplemental-search-field input,
.supplemental-note-field input {
  width: 100%;
  min-height: 44px;
}

.supplemental-list-block {
  display: grid;
  gap: 8px;
}

.supplemental-label {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.supplemental-student-results {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.supplemental-student-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--white);
  color: #273444;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.supplemental-student-option:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 169, 21, 0.55);
  box-shadow: 0 8px 20px rgba(15, 39, 71, 0.08);
}

.supplemental-student-option input,
.supplemental-type-group input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.supplemental-student-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.supplemental-student-option strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
}

.supplemental-student-option small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.supplemental-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.supplemental-type-group {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.supplemental-type-group legend {
  padding: 0 6px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.supplemental-type-group label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #273444;
  font-size: 15px;
  font-weight: 600;
}

.statistics-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 16px 12px;
}

.elite-stats-list,
.warning-stats-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.elite-student-card,
.absence-warning-card {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1fr) minmax(360px, 1.4fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.elite-student-card.podium-card {
  border-color: rgba(201, 154, 46, 0.48);
  background: linear-gradient(135deg, #fffaf0, #ffffff);
}

.rank-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--navy);
  background: var(--gold-soft);
  font-size: 1.1rem;
  font-weight: 800;
}

.elite-student-main,
.absence-warning-card > div:first-child {
  display: grid;
  gap: 4px;
}

.elite-student-main h4,
.absence-warning-card h4 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
}

.elite-student-main p,
.absence-warning-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.elite-student-main span,
.warning-note {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #795100;
  background: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.elite-student-metrics,
.warning-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.warning-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.elite-student-metrics span,
.warning-metrics span {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 8px;
  border-radius: 10px;
  color: var(--muted);
  background: #f6f8fc;
  font-size: 0.78rem;
  font-weight: 600;
}

.elite-student-metrics strong,
.warning-metrics strong {
  color: var(--navy);
  font-size: 1.1rem;
  line-height: 1.1;
  font-weight: 800;
}

.absence-warning-card {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
}

.absence-warning-card.critical-warning {
  border-color: rgba(215, 38, 61, 0.34);
  background: #fffafa;
}

.critical-warning .warning-note {
  color: #9f1239;
  background: #ffe4e8;
}

.stats-empty {
  margin: 0 16px 16px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fbfcfe;
  text-align: center;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1fr);
  gap: 16px;
  padding: 0 18px 18px;
}

.settings-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.settings-card h3 {
  margin: 0;
  color: var(--navy);
}

.settings-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading {
  padding: 18px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin-bottom: 2px;
  color: var(--navy);
  font-size: 1.2rem;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  position: relative;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.history-section table {
  min-width: 920px;
}

th,
td {
  padding: 13px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  color: var(--navy);
  background: #f8fafc;
  font-size: 0.78rem;
}

td {
  color: #273444;
}

.student-name {
  color: var(--navy);
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-active,
.badge-good,
.badge-present {
  color: #076145;
  background: #dff8ed;
}

.badge-trial,
.badge-soon {
  color: #915f00;
  background: #fff2cc;
}

.badge-paused,
.badge-danger,
.badge-unexcused,
.badge-empty {
  color: #8a1f1f;
  background: #ffe5e8;
}

.badge-fee-ok,
.badge-excused {
  color: #17456f;
  background: #e3f0ff;
}

.badge-fee-due {
  color: var(--danger);
  background: #ffe7e4;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.trial-overview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.trial-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(11, 31, 58, 0.08);
  border-radius: 999px;
  color: var(--navy);
  background: #f8fafc;
  font-size: 0.88rem;
  font-weight: 700;
}

.trial-stat-chip strong {
  color: var(--gold);
  font-size: 1rem;
}

.compact-select,
.compact-note {
  width: min(220px, 100%);
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

.compact-note {
  resize: vertical;
}

.small-btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
}

.small-btn.delete {
  color: var(--danger);
}

.small-btn.promote {
  color: var(--navy);
  background: var(--gold-soft);
  border-color: rgba(201, 154, 46, 0.5);
}

.small-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.action-note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #d4af37, #f5d76e);
  color: #0B1F4D;
  min-height: 38px;
  white-space: nowrap;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.profile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.history-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #0B1F4D, #123B7A);
  color: white;
  min-height: 38px;
  white-space: nowrap;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.history-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11, 31, 77, 0.25);
}

.attendance-history-btn {
  margin: 10px 0 8px;
}

.small-btn.primary {
  color: var(--white);
  border-color: var(--navy);
  background: var(--navy);
}

.empty-state {
  padding: 36px 18px 42px;
  display: grid;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.empty-state strong {
  color: var(--navy);
  font-size: 1.05rem;
}

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

.parent-request-actions .small-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.attendance-request-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 18px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.request-summary-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--navy);
  background: var(--gold-soft);
  font-weight: 800;
  cursor: pointer;
}

.request-summary-btn strong {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--navy);
  background: #fff;
}

.request-summary-btn strong.has-pending {
  color: #fff;
  background: #dc2626;
}

.warning-summary-btn strong {
  color: #fff;
  background: #d97706;
}

.inline-warning-summary {
  width: 100%;
}

.warning-summary-copy {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.attendance-request-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.attendance-quick-search {
  margin: 0 18px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.attendance-quick-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

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

.quick-search-field input {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
}

.quick-search-clear {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--navy);
  background: #e2e8f0;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.parent-requests-dialog,
.unsaved-attendance-dialog,
#attendanceWarningsDialog,
#temporaryPauseDialog {
  width: min(920px, calc(100vw - 28px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
}

.parent-requests-dialog::backdrop,
.unsaved-attendance-dialog::backdrop,
#attendanceWarningsDialog::backdrop,
#temporaryPauseDialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.parent-requests-card,
.unsaved-attendance-card {
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.parent-request-list {
  display: grid;
  gap: 12px;
}

.parent-request-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.attendance-warning-card {
  border-color: rgba(217, 119, 6, 0.26);
}

.attendance-warnings-card {
  max-width: 880px;
}

.parent-request-main h3 {
  margin: 8px 0 4px;
  color: var(--navy);
}

.parent-request-main p,
.parent-request-route {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.parent-request-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.parent-request-detail-grid div {
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.parent-request-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.parent-request-detail-grid strong {
  color: var(--navy);
  font-size: 0.92rem;
}

.badge-withdrawn {
  color: #7f1d1d;
  background: #fee2e2;
}

.temporary-pause-fields {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.compact-form-grid {
  margin-top: 10px;
}

.small-btn.danger {
  color: #991b1b;
  background: #fee2e2;
}

.temporary-pause-card {
  width: min(720px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.attendance-list {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.attendance-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.45fr) minmax(180px, 0.9fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.attendance-quick-card {
  grid-template-columns: 44px minmax(180px, 1.2fr) minmax(140px, 0.8fr) minmax(300px, 1.3fr) minmax(220px, 1fr);
  align-items: center;
}

.attendance-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--gold-soft);
  font-weight: 800;
}

.attendance-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  font-weight: 800;
}

.attendance-student h3 {
  margin-bottom: 3px;
}

.attendance-belt span {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--navy);
  background: #f1f5f9;
  font-size: 0.84rem;
  font-weight: 800;
}

.attendance-card h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1rem;
}

.student-meta,
.stats-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-btn {
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.status-btn.selected {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 39, 71, 0.12);
}

.status-present {
  color: #064e3b;
  background: #dff8ed;
}

.status-present.tuition-locked,
.status-present:disabled {
  color: #9f1239;
  border-color: #fecdd3;
  background: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.72;
}

.tuition-lock-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: #9f1239;
  background: #ffe4e8;
  font-size: 14px;
  font-weight: 700;
}

.status-excused {
  color: #17456f;
  background: #dbeafe;
}

.status-unexcused {
  color: #8a1f1f;
  background: #ffe5e8;
}

.attendance-note {
  display: grid;
  gap: 7px;
}

.attendance-note textarea {
  min-height: 92px;
}

.attendance-summary {
  display: grid;
  gap: 5px;
}

.student-dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.student-dialog::backdrop {
  background: rgba(15, 39, 71, 0.58);
}

.history-dialog {
  width: min(900px, calc(100vw - 24px));
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.admin-confirm-dialog {
  width: min(460px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.admin-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.admin-confirm-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
}

.admin-confirm-card .eyebrow {
  color: var(--red);
}

.history-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.history-panel {
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
}

.profile-dialog {
  width: min(900px, calc(100vw - 24px));
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.profile-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.profile-panel {
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
}

.profile-content {
  display: block;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.profile-tab-btn {
  min-height: 40px;
  padding: 9px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.profile-tab-btn.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  box-shadow: 0 8px 18px rgba(15, 39, 71, 0.18);
}

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

.profile-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.profile-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.profile-attendance-head {
  display: grid;
  gap: 12px;
}

.profile-month-controls {
  max-width: 280px;
}

.profile-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.profile-timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-timeline-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.profile-timeline-item div {
  display: grid;
  gap: 2px;
}

.profile-timeline-item span {
  color: var(--muted);
}

.profile-timeline-item p {
  margin: 0;
  color: #273444;
}

.profile-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fbfcfe;
  text-align: center;
  font-weight: 800;
}

.profile-detail-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.profile-detail-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-detail-row strong,
.profile-highlight {
  color: var(--navy);
  font-weight: 800;
}

.profile-highlight {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
}

.profile-note {
  min-height: 68px;
  padding: 10px;
  border-radius: 8px;
  background: var(--white);
  color: #273444;
}

.profile-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

.student-dialog form {
  padding: 20px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dialog-head .eyebrow {
  color: var(--red);
}

.dialog-head h2 {
  margin-bottom: 0;
  color: var(--navy);
}

.icon-btn {
  width: 42px;
  color: var(--navy);
  background: #f1f5f9;
  font-size: 1.5rem;
}

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

.form-wide {
  grid-column: 1 / -1;
}

.schedule-field {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.registered-schedule-field {
  display: grid;
  gap: 14px;
}

.schedule-field legend {
  padding: 0 6px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.schedule-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.schedule-shift-group {
  display: grid;
  gap: 10px;
}

.schedule-shift-group h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.95rem;
}

.schedule-options label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  font-weight: 700;
}

.schedule-options input {
  width: auto;
  min-height: 0;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 2fr);
  gap: 16px;
}

.student-profile,
.monthly-summary,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.student-profile {
  padding: 14px;
}

.profile-row {
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

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

.profile-row span,
.summary-tile span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-row strong {
  color: var(--navy);
}

.history-detail {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.monthly-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.summary-tile {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 6px;
  background: var(--white);
}

.summary-tile strong {
  color: var(--navy);
  font-size: 1.15rem;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(160px, 0.7fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.timeline-date {
  display: grid;
  gap: 2px;
}

.timeline-date strong {
  color: var(--navy);
}

.timeline-date span,
.timeline-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.history-edit-fields {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(160px, 1fr);
  gap: 8px;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .toolbar,
  .attendance-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .attendance-card {
    grid-template-columns: 1fr;
  }

  .attendance-quick-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .attendance-quick-card .attendance-belt,
  .attendance-quick-card .status-grid,
  .attendance-quick-card .attendance-note {
    grid-column: 1 / -1;
  }

  .history-layout,
  .month-controls,
  .monthly-summary,
  .timeline-item,
  .history-edit-fields,
  .profile-dashboard-grid,
  .profile-summary-row,
  .profile-timeline-item,
  .settings-grid,
  .sync-actions,
  .belt-stats-grid,
  .statistics-overview-title,
  .statistics-overview-grid,
  .statistics-summary-grid,
  .statistics-filters,
  .attendance-session-filters,
  .stats-metric-grid,
  .stats-list-grid,
  .training-session-metrics,
  .training-summary,
  .training-detail-row,
  .elite-student-card,
  .absence-warning-card {
    grid-template-columns: 1fr;
  }

  .elite-student-metrics,
  .warning-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-actions {
    justify-content: flex-start;
  }

  .training-quick-head,
  .training-session-title {
    align-items: stretch;
    flex-direction: column;
  }

  .training-range-tabs {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 100% 420px;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
    padding: 20px 16px 18px;
  }

  .public-header,
  .public-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .public-nav,
  .footer-links,
  .public-actions {
    justify-content: stretch;
  }

  .public-nav a,
  .footer-links a,
  .public-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .public-card-grid {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .dialog-actions {
    width: 100%;
  }

  .header-actions .btn,
  .dialog-actions .btn {
    flex: 1 1 160px;
  }

  .app-shell {
    padding: 0 16px 28px;
  }

  .tabs,
  .dashboard,
  .toolbar,
  .attendance-toolbar,
  .form-grid,
  .schedule-options {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
  }

  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    padding: 14px;
  }

  .metric-card strong {
    font-size: 1.65rem;
  }

  .toolbar .btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    padding: 12px;
    border-top: 1px solid var(--line);
  }

  td {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border: 0;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
  }

  .row-actions,
  .status-grid {
    grid-template-columns: 1fr;
    flex-wrap: wrap;
  }

  .profile-detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .profile-actions .btn,
  .settings-actions .btn,
  .profile-tab-btn,
  .profile-btn,
  .history-btn {
    width: 100%;
  }

  .small-btn {
    flex: 1 1 100px;
  }

  .attendance-list {
    padding: 0 12px 12px;
  }

  .attendance-card {
    padding: 12px;
  }

  .attendance-quick-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }
}

/* Unified typography */
body {
  font-family: 'Be Vietnam Pro', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1 {
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.08;
}

h2,
.section-heading h2,
.dialog-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.22;
}

h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
}

p,
label,
input,
select,
textarea,
td,
.student-meta,
.stats-line {
  font-size: 15px;
  line-height: 1.8;
  font-weight: 500;
}

.btn,
.small-btn,
.tab-btn,
.status-btn,
.profile-btn,
.history-btn,
.shift-choice-btn {
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 700;
}

.metric-label,
.summary-tile span,
.stats-mini-card span,
.badge {
  font-size: 15px;
  font-weight: 500;
}

.metric-card strong,
.summary-tile strong,
.stats-mini-card strong {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
}

th {
  font-size: 15px;
  font-weight: 700;
}

td {
  font-size: 15px;
  font-weight: 500;
}

/* Professional admin dashboard shell */
body:not(.locked) {
  min-height: 100vh;
  background: #f4f7fb;
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  background: #f4f7fb;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 18px;
  color: var(--white);
  background:
    linear-gradient(180deg, #0b1f3a 0%, #102f55 100%);
  box-shadow: 12px 0 32px rgba(11, 31, 58, 0.12);
  z-index: 2;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-brand .logo-mark {
  width: 48px;
  height: 48px;
  border-width: 2px;
  background: #fff7dd;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.sidebar-brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.main-area {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 28px 36px;
}

.admin-content {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.app-header {
  max-width: none;
  min-height: 78px;
  margin: 0;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 39, 71, 0.08);
}

.app-header .brand {
  min-width: 260px;
}

.app-header h1 {
  margin: 0;
  color: #0b1f3a;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.2;
  font-weight: 700;
}

.app-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.tabs {
  display: grid;
  gap: 8px;
  margin: 0;
}

.tab-btn {
  width: 100%;
  min-height: 46px;
  justify-content: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.tab-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
  color: #0b1f3a;
  background: linear-gradient(135deg, #fff8df, #ffffff);
  border-color: rgba(216, 169, 21, 0.5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.dashboard {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}

.metric-card {
  position: relative;
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(217, 225, 234, 0.88);
  border-top: 0;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(15, 39, 71, 0.08);
}

.metric-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #0b1f3a;
  background: #fff4d8;
  font-size: 17px;
}

.metric-label {
  color: #667085;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

.metric-card strong {
  margin: 0;
  color: #0b1f3a;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
}

.toolbar,
.table-section,
.attendance-section,
.settings-section,
.statistics-section,
.sync-section,
.belt-dashboard {
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 39, 71, 0.08);
}

.toolbar {
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(160px, 1fr));
  padding: 16px;
  margin-bottom: 16px;
}

.attendance-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) repeat(4, auto);
}

.section-heading {
  padding: 18px 20px 12px;
}

.section-heading h2 {
  color: #0b1f3a;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
}

.section-heading p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

table {
  min-width: 1060px;
}

th {
  color: #344054;
  background: #f6f8fc;
  font-size: 14px;
  font-weight: 700;
}

td {
  color: #273444;
  font-size: 14px;
  font-weight: 500;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #fbfcfe;
}

.row-actions {
  align-items: center;
  gap: 6px;
}

.small-btn,
.profile-btn,
.history-btn {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.btn {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
}

.btn-primary,
.btn-gold {
  color: #0b1f3a;
  background: linear-gradient(135deg, #d8a915, #f3ce55);
  box-shadow: 0 8px 18px rgba(216, 169, 21, 0.22);
}

.btn-secondary {
  color: #0b1f3a;
  background: #fff4d8;
  border: 1px solid rgba(216, 169, 21, 0.42);
}

.btn-danger {
  background: #d7263d;
}

.filter-group label,
.search-box label,
label {
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  min-height: 40px;
  border-radius: 10px;
  font-size: 15px;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  align-items: stretch;
}

.settings-card,
.statistics-card,
.sync-card,
.stats-mini-card,
.belt-stat-card {
  border-radius: 14px;
}

.danger-settings {
  border-color: rgba(215, 38, 61, 0.24);
  background: #fffafa;
}

.sync-actions .btn {
  min-height: 52px;
}

.visually-hidden[hidden] {
  display: none !important;
}

.protected-view[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .admin-sidebar {
    padding: 18px 12px;
  }

  .sidebar-brand {
    justify-content: center;
    padding-bottom: 12px;
  }

  .sidebar-brand div:not(.logo-mark) {
    display: none;
  }

  .tab-btn {
    justify-content: center;
    padding: 11px;
    font-size: 0;
  }

  .tab-btn span {
    font-size: 18px;
  }

  .main-area {
    padding: 20px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-overview-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-table-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .attendance-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-session-metrics,
  .training-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-detail-row,
  .elite-student-card,
  .absence-warning-card {
    grid-template-columns: 1fr;
  }

  .elite-student-metrics,
  .warning-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    gap: 12px;
    padding: 12px;
    border-radius: 0 0 18px 18px;
  }

  .sidebar-brand {
    justify-content: flex-start;
    padding: 0 2px 10px;
  }

  .sidebar-brand div:not(.logo-mark) {
    display: block;
  }

  .sidebar-brand .logo-mark {
    width: 42px;
    height: 42px;
  }

  .tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .tab-btn {
    width: auto;
    min-width: max-content;
    justify-content: center;
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  .tab-btn span {
    font-size: 16px;
  }

  .main-area {
    padding: 14px 12px 28px;
  }

  .app-header {
    min-height: 0;
    padding: 16px;
    border-radius: 14px;
  }

  .app-header .brand {
    min-width: 0;
  }

  .app-header h1 {
    font-size: clamp(22px, 7vw, 30px);
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .header-actions .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

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

  .metric-card {
    min-height: 108px;
    padding: 13px;
  }

  .toolbar,
  .attendance-toolbar,
  .statistics-filters,
  .sync-actions {
    grid-template-columns: 1fr;
  }

  .training-quick-head,
  .training-session-title {
    align-items: stretch;
    flex-direction: column;
  }

  .training-range-tabs {
    justify-content: flex-start;
  }

  .training-session-metrics,
  .training-summary {
    grid-template-columns: 1fr;
  }

  .training-compact-table {
    display: table;
    min-width: 820px;
  }

  .training-compact-table thead {
    display: table-header-group;
  }

  .training-compact-table tbody {
    display: table-row-group;
  }

  .training-compact-table tr {
    display: table-row;
    padding: 0;
  }

  .training-compact-table th,
  .training-compact-table td {
    display: table-cell;
    padding: 10px 11px;
  }

  .compact-overview-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-stat-table table {
    display: table;
    min-width: 0;
  }

  .compact-stat-table thead {
    display: table-header-group;
  }

  .compact-stat-table tbody {
    display: table-row-group;
  }

  .compact-stat-table tr {
    display: table-row;
    padding: 0;
  }

  .compact-stat-table th,
  .compact-stat-table td {
    display: table-cell;
    padding: 8px 10px;
  }

  .compact-stat-table td::before {
    content: none;
  }

  .section-heading {
    padding: 16px 14px 10px;
  }

  .settings-grid,
  .sync-card,
  .statistics-grid,
  .statistics-filters,
  .attendance-list,
  .training-quick-section,
  .elite-stats-list,
  .warning-stats-list {
    padding-left: 12px;
    padding-right: 12px;
  }

  .statistics-actions {
    justify-content: stretch;
    padding: 0 12px 12px;
  }

  .statistics-actions .btn {
    width: 100%;
    white-space: normal;
  }

  .elite-student-metrics,
  .warning-metrics,
  .training-detail-summary,
  .training-detail-row {
    grid-template-columns: 1fr;
  }

  .quick-tuition-info,
  .quick-tuition-options,
  .quick-tuition-session-grid,
  .tuition-monthly-controls,
  .tuition-detail-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .header-actions,
  .dashboard,
  .compact-overview-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile usability pass for Android, iPhone, and Samsung tablets */
.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 768px) {
  body:not(.locked) {
    font-size: 15px;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 100vh;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    gap: 12px;
    padding: 12px 8px;
    border-radius: 0;
    overflow: visible;
    z-index: 20;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 0 0 10px;
  }

  .sidebar-brand div:not(.logo-mark) {
    display: none;
  }

  .sidebar-brand .logo-mark {
    width: 46px;
    height: 46px;
  }

  .sidebar-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    left: 78px;
    top: 12px;
    color: #0b1f3a;
    background: #f3ce55;
    border-color: rgba(216, 169, 21, 0.7);
    box-shadow: 0 10px 28px rgba(11, 31, 58, 0.22);
    z-index: 45;
  }

  .tabs {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .tab-btn {
    width: 54px;
    min-width: 54px;
    min-height: 52px;
    justify-content: center;
    padding: 0;
    border-radius: 14px;
    font-size: 0;
  }

  .tab-btn span {
    font-size: 21px;
  }

  body.sidebar-open .app-shell {
    grid-template-columns: minmax(240px, 78vw) minmax(0, 1fr);
  }

  body.sidebar-open .admin-sidebar {
    padding: 14px 12px;
    box-shadow: 18px 0 46px rgba(11, 31, 58, 0.26);
  }

  body.sidebar-open .sidebar-brand {
    justify-content: flex-start;
  }

  body.sidebar-open .sidebar-brand div:not(.logo-mark) {
    display: block;
  }

  body.sidebar-open .sidebar-toggle {
    left: min(calc(78vw + 10px), 252px);
  }

  body.sidebar-open .tab-btn {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 13px;
    font-size: 15px;
  }

  .main-area {
    min-width: 0;
    padding: 12px 10px 28px;
  }

  .app-header {
    min-height: 0;
    padding: 14px;
    border-radius: 14px;
  }

  .app-header h1 {
    font-size: clamp(20px, 5.8vw, 28px);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .app-header p,
  .section-heading p,
  .metric-label,
  td,
  th,
  input,
  select,
  textarea,
  .btn,
  .small-btn,
  .profile-btn {
    font-size: max(14px, 0.95rem);
  }

  .header-actions,
  .toolbar,
  .attendance-toolbar,
  .statistics-filters,
  .sync-actions,
  .settings-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .header-actions .btn,
  .toolbar input,
  .toolbar select,
  .toolbar label,
  .filter-group,
  .search-box,
  .btn,
  .small-btn,
  .profile-btn,
  .history-btn,
  .status-btn {
    width: 100%;
    min-height: 44px;
  }

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

  .metric-card {
    min-height: 96px;
    padding: 12px;
    border-radius: 12px;
  }

  .metric-card strong {
    font-size: clamp(24px, 8vw, 34px);
  }

  .table-section {
    overflow: visible;
  }

  .table-wrap {
    overflow: visible;
    padding: 0 10px 12px;
  }

  #studentTableBody {
    display: grid;
    gap: 12px;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    padding: 12px;
    border: 1px solid rgba(217, 225, 234, 0.9);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 39, 71, 0.08);
  }

  .table-wrap td {
    min-height: 32px;
    padding: 7px 0;
    border: 0;
    font-size: 14px;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
  }

  .table-wrap td:nth-child(6),
  .table-wrap td:nth-child(7),
  .table-wrap td:nth-child(8),
  .table-wrap td:nth-child(9) {
    display: none;
  }

  .student-name {
    font-size: 18px;
    line-height: 1.35;
  }

  .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .row-actions .promote,
  .row-actions .delete,
  .row-actions .action-note {
    display: none;
  }

  .attendance-card,
  .attendance-quick-card,
  .student-dialog,
  .student-profile {
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 430px) {
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 90px;
  }

  .row-actions {
    grid-template-columns: 1fr;
  }
}

/* Android/iOS app-style mobile shell */
.mobile-only-tab {
  display: none;
}

@media (max-width: 768px) {
  body:not(.locked) {
    background: #f4f7fb;
    padding: 0;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    padding: 82px 0 calc(86px + env(safe-area-inset-bottom));
    background: #f4f7fb;
  }

  .main-area {
    padding: 10px 12px 20px;
  }

  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    min-height: 72px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-radius: 0 0 22px 22px;
    border-width: 0 0 1px;
    box-shadow: 0 12px 28px rgba(11, 31, 58, 0.14);
  }

  .app-header .brand {
    min-width: 0;
    width: 100%;
  }

  .app-header h1 {
    font-size: clamp(17px, 4.8vw, 22px);
    line-height: 1.22;
  }

  .app-header p {
    display: none;
  }

  .header-actions {
    display: none;
  }

  .admin-sidebar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    top: auto;
    width: auto;
    height: 68px;
    padding: 7px;
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(217, 225, 234, 0.92);
    box-shadow:
      0 18px 42px rgba(11, 31, 58, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    backdrop-filter: blur(18px);
    z-index: 50;
  }

  .sidebar-brand,
  .sidebar-toggle {
    display: none;
  }

  .tabs {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(64px, 1fr));
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0;
  }

  .mobile-only-tab {
    display: none !important;
  }

  .tab-btn[data-tab="trialRegistrationsPanel"],
  .tab-btn[data-tab="syncPanel"] {
    display: flex !important;
  }

  .tab-btn {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 18px;
    color: #637083;
    background: transparent;
    font-size: 11px;
    line-height: 1.1;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
  }

  .tab-btn span {
    font-size: 19px;
    line-height: 1;
  }

  .tab-btn:hover,
  .tab-btn.active {
    color: #0b1f3a;
    background: #fff4d8;
    border-color: rgba(216, 169, 21, 0.45);
    box-shadow: 0 8px 18px rgba(216, 169, 21, 0.2);
  }

  body.sidebar-open .app-shell {
    display: block;
  }

  body.sidebar-open .admin-sidebar {
    padding: 7px;
  }

  body.sidebar-open .sidebar-brand div:not(.logo-mark),
  body.sidebar-open .sidebar-brand,
  body.sidebar-open .sidebar-toggle {
    display: none;
  }

  body.sidebar-open .tab-btn {
    width: 100%;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 11px;
  }

  .dashboard {
    margin-top: 0;
  }

  .statistics-overview {
    padding: 0 12px 14px;
  }

  .statistics-overview-title {
    align-items: stretch;
  }

  .statistics-overview-card {
    min-height: 78px;
    padding: 12px;
  }
}

@media (max-width: 380px) {
  .admin-sidebar {
    left: 6px;
    right: 6px;
    height: 64px;
    border-radius: 20px;
  }

  .tab-btn {
    min-height: 50px;
    height: 50px;
    font-size: 10px;
    border-radius: 15px;
  }

  .tab-btn span {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .students-page-head {
    display: grid;
    gap: 14px;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 16px;
  }

  .students-page-head h2 {
    font-size: 24px;
  }

  .students-page-head span {
    font-size: 0.9rem;
  }

  .add-student-main-btn {
    width: 100%;
    min-height: 54px;
    justify-content: center;
    font-size: 1rem;
  }

  .collapsible-card-head {
    align-items: stretch;
    padding: 14px;
  }

  .collapsible-card-head .btn {
    min-width: 78px;
    min-height: 44px;
  }

  .simple-stats-grid,
  .backup-preview ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-stats-tables {
    grid-template-columns: 1fr;
  }

  .simple-statistics-panel {
    padding: 14px;
  }

  .unexcused-detail-card {
    grid-template-columns: 1fr;
  }

  .unexcused-detail-card .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .simple-stats-grid,
  .backup-preview ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .attendance-request-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-search-field {
    align-items: stretch;
  }

  .parent-request-detail-grid {
    grid-template-columns: 1fr;
  }

  .tuition-module-cards,
  .tuition-student-card,
  .tuition-collect-layout,
  .tuition-summary-controls {
    grid-template-columns: 1fr;
  }
}

