:root {
  --bg: #f8faf4;
  --panel: #ffffff;
  --line: #e6eaf2;
  --line-soft: #f0f3f8;
  --text: #101a37;
  --muted: #66708a;
  --blue: #176b3a;
  --blue-soft: #edf7e8;
  --green: #238447;
  --green-soft: #e8f6e7;
  --red: #e92d54;
  --red-soft: #ffe7ed;
  --amber: #a98200;
  --amber-soft: #fff6c9;
  --cyan: #20a8bd;
  --cyan-soft: #e5f9fc;
  --shadow: 0 14px 34px rgba(21, 34, 69, 0.08);
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0d1712;
  --panel: #14221b;
  --line: #2a4035;
  --line-soft: #1b2d24;
  --text: #f0f7f3;
  --muted: #a8bdb1;
  --blue: #35b96b;
  --blue-soft: rgba(53, 185, 107, 0.17);
  --green: #45cf78;
  --green-soft: rgba(69, 207, 120, 0.16);
  --red: #ff5d7c;
  --red-soft: rgba(255, 93, 124, 0.15);
  --amber: #ffd166;
  --amber-soft: rgba(255, 209, 102, 0.15);
  --cyan: #58c9c1;
  --cyan-soft: rgba(88, 201, 193, 0.14);
  --surface: #14221b;
  --table-head: #1b2d24;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.btn.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.ui-icon {
  display: inline-block;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.app-shell.sidebar-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 18px 24px;
  transition: padding 180ms ease;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.brand + .nav-group {
  margin-top: 8px;
}

.sidebar-role {
  display: grid;
  gap: 5px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.sidebar-role span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-role strong {
  color: var(--text);
  font-size: 14px;
}

.sidebar-role a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.school-logo {
  color: #050505;
  width: 300px;
  max-width: 100%;
  display: grid;
  place-items: center;
}

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

.school-logo.compact {
  width: 68px;
  min-width: 68px;
  height: 78px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.school-logo.compact img {
  max-height: 76px;
  border-radius: 0;
  filter: drop-shadow(0 5px 10px rgba(10, 48, 27, .22));
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5ec6d0;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark span:first-child {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4263e6, #5ed0d3);
  color: #fff;
  font-size: 22px;
}

.brand small {
  display: block;
  color: var(--blue);
  font-size: 9px;
  letter-spacing: 0.08em;
  margin-top: 1px;
}

.hamburger {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.nav-group {
  margin: 18px 0;
}

.nav-title {
  color: #7b849b;
  font-size: 12px;
  margin: 0 0 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 10px 10px;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
  background: var(--blue);
  color: #fff;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.main {
  min-width: 0;
}

.sidebar-collapsed .sidebar {
  padding: 18px 14px 24px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .hamburger {
  position: static;
  width: 46px;
  height: 46px;
}

.sidebar-collapsed .school-logo.compact {
  display: none;
}

.sidebar-collapsed .sidebar-role,
.sidebar-collapsed .nav-title,
.sidebar-collapsed .nav-link span:not(.nav-icon) {
  display: none;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

.sidebar-collapsed .nav-icon {
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.search {
  position: relative;
  max-width: 330px;
  width: 100%;
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 46px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.shortcut {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--line-soft);
  color: var(--muted);
  border: 1px solid var(--line-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.directory-search {
  min-width: 220px;
}

.notification-wrap {
  position: relative;
}

.notification-trigger {
  position: relative;
}

.notification-trigger > span {
  position: absolute;
  top: -5px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.notification-dropdown {
  display: none;
  position: absolute;
  z-index: 50;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.16);
}

.notification-dropdown.open {
  display: block;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.notification-head a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.notification-list {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.notification-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 10px;
  border-radius: 7px;
}

.notification-row:hover {
  background: #f5f7fc;
}

.notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--blue);
}

.notification-row.success .notification-dot {
  background: var(--green);
}

.notification-row.warning .notification-dot {
  background: var(--amber);
}

.notification-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.notification-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.notification-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.pill,
.icon-btn,
.btn,
.select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 13px;
}

.icon-btn {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
}

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

.btn.ghost {
  background: var(--line-soft);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #11b4c8, #f3ad3b);
}

.avatar.small {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 11px;
}

.content {
  padding: 28px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.content.is-entering {
  opacity: 0.35;
  transform: translateY(4px);
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-title h1 {
  font-size: 24px;
  margin: 0 0 6px;
}

.crumbs {
  color: var(--muted);
  font-size: 12px;
}

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

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: #e6fbe5;
  color: #09a214;
  margin-bottom: 22px;
}

.toast-stack {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 200;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  position: relative;
  padding: 16px 42px 16px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--red); }

.toast strong,
.toast p {
  display: block;
  margin: 0;
}

.toast p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.toast button {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.hero {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 28px;
  margin-bottom: 26px;
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(circle at 48% 110%, transparent 0 36px, rgba(77, 99, 230, 0.82) 37px 47px, transparent 48px),
    radial-gradient(circle at 62% 12%, transparent 0 15px, #2278de 16px 20px, transparent 21px),
    radial-gradient(circle at 28% 0, transparent 0 11px, #e9b700 12px 15px, transparent 16px),
    #130f23;
}

.hero h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.hero p {
  margin: 0;
  color: #fff;
}

.school-hero,
.finance-overview,
.role-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel), #f7faff);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .school-hero,
:root[data-theme="dark"] .finance-overview,
:root[data-theme="dark"] .role-overview {
  background: linear-gradient(135deg, #151c2d, #1d2638);
}

.school-hero h2,
.finance-overview h2,
.role-overview h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.school-hero p,
.finance-overview p,
.role-overview p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.school-hero > span,
.finance-overview > strong,
.role-overview > strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.admissions-overview {
  background: linear-gradient(135deg, var(--panel), #f4fff6);
}

.exams-overview {
  background: linear-gradient(135deg, var(--panel), #f6f8ff);
}

:root[data-theme="dark"] .admissions-overview,
:root[data-theme="dark"] .exams-overview {
  background: linear-gradient(135deg, #151c2d, #1d2638);
}

.compact-form {
  margin-bottom: 24px;
}

.record-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  padding: 18px 22px 22px;
}

.record-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.record-form .wide-field {
  grid-column: span 2;
}

.record-form input,
.record-form select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.student-search-field {
  position: relative;
}

.student-search-field input[type="search"] {
  padding-right: 40px;
}

.student-search-results {
  display: none;
  position: absolute;
  z-index: 20;
  top: 69px;
  left: 0;
  right: 0;
  max-height: 248px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.student-search-results.open {
  display: grid;
  gap: 6px;
}

.student-search-results button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.student-search-results button:hover,
.student-search-results button:focus {
  outline: none;
  background: var(--blue-soft);
}

.student-search-results span,
.student-search-results p,
.student-search-hint {
  color: var(--muted);
  font-size: 12px;
}

.student-search-results p {
  margin: 0;
  padding: 10px;
}

.record-form .btn {
  align-self: end;
  min-height: 42px;
}

.teacher-welcome {
  min-height: 138px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
  padding: 26px 28px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(66, 99, 230, 0.96), rgba(17, 107, 205, 0.96)),
    #1769d2;
  overflow: hidden;
}

.teacher-welcome h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.teacher-welcome p {
  margin: 0;
  color: #eef4ff;
}

.finance-strip {
  grid-template-columns: 280px minmax(520px, 1fr) minmax(620px, 0.95fr);
  align-items: stretch;
}

.finance-trend-card {
  grid-column: auto;
}

.teacher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.95fr);
  gap: 24px;
}

.teacher-main,
.teacher-side {
  display: grid;
  gap: 24px;
  align-content: start;
}

.teacher-profile {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.13) 0 34px, transparent 35px),
    radial-gradient(circle at 38% 0, transparent 0 16px, #2278de 17px 22px, transparent 23px),
    linear-gradient(135deg, #171129, #111b3e 58%, #0a5261),
    #130f23;
}

.teacher-profile::after {
  content: "";
  position: absolute;
  right: 110px;
  bottom: -56px;
  width: 190px;
  height: 190px;
  border: 24px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.teacher-profile > * {
  position: relative;
  z-index: 1;
}

.teacher-profile .btn {
  margin-left: auto;
}

.teacher-profile h2 {
  margin: 8px 0 4px;
}

.teacher-photo {
  width: 82px;
  height: 82px;
  flex-basis: 82px;
  border: 3px solid #fff;
  background: linear-gradient(135deg, #3457db, #20a8bd);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.teacher-illustration {
  display: grid;
  place-items: center;
  width: 112px;
  height: 92px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 22px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.info-card strong,
.info-card span {
  display: block;
}

.info-card span {
  color: #46516b;
}

.soft-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  line-height: 0;
}

.soft-icon .ui-icon {
  display: block;
  margin: auto;
  vertical-align: middle;
  transform: translateY(5px);
}

.soft-icon.green { background: var(--green-soft); color: var(--green); }
.soft-icon.red { background: var(--red-soft); color: var(--red); }
.soft-icon.amber { background: var(--amber-soft); color: var(--amber); }
.soft-icon.cyan { background: var(--cyan-soft); color: var(--cyan); }
.soft-icon.purple { background: #f1e7ff; color: #a05cff; }

.class-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 16px;
  padding: 20px 22px;
}

.class-chip {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: #f6f7fb;
}

.class-chip small {
  color: var(--muted);
}

.syllabus-card {
  display: flex;
  align-items: center;
  gap: 26px;
}

.syllabus-card .ring {
  width: 110px;
  height: 110px;
  flex-basis: 110px;
  font-size: 20px;
}

.attendance-box {
  padding: 22px;
}

.week-row {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}

.week-row span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.week-row span.absent {
  background: var(--red);
}

.week-row span.off {
  background: #f6f7fb;
  color: var(--muted);
  border: 1px solid var(--line);
}

.attendance-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.attendance-stats span {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 14px 8px;
  background: var(--panel);
}

.performance-list {
  display: grid;
  gap: 18px;
  padding: 20px 22px;
}

.performance-list p {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
}

.grid {
  display: grid;
  gap: 22px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr);
}

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 22px;
}

.card-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.card-head h2,
.card-head h3 {
  font-size: 18px;
  margin: 0;
}

.metric {
  padding: 22px;
}

.metric-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  font-size: 30px;
  background: var(--blue-soft);
}

.finance-card-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

.metric h3 {
  font-size: 28px;
  margin: 0 0 4px;
}

.metric p {
  margin: 0;
  color: #3e4965;
}

.metric-foot {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 18px;
  color: #3e4965;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.vline {
  background: var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.red {
  background: var(--red-soft);
  color: var(--red);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chart {
  height: 290px;
  padding: 20px 22px 12px;
}

.chart.compact {
  height: 248px;
  padding: 14px 20px 12px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-marker {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 0 1px rgba(66, 99, 230, .08);
}

.legend-marker.soft {
  background: #e5eaf3;
}

.legend-marker.blue {
  background: var(--blue);
}

.legend-marker.green {
  background: var(--green);
}

.legend-marker.amber {
  background: var(--amber);
}

.bars {
  height: 236px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 45px, var(--line-soft) 46px);
}

.chart.compact .bars {
  height: 182px;
}

.bars.paired {
  gap: 16px;
}

.bar-group {
  position: relative;
  display: block;
  height: 100%;
}

.bar {
  background: var(--green);
  border-radius: 5px 5px 0 0;
  min-height: 30px;
}

.bar-group .bar {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.bar-group .bar.total {
  width: 58%;
  background: #e7ecf5;
  min-height: 22px;
}

.bar-group .bar.collected {
  width: 50%;
  background: linear-gradient(180deg, #2f9655 0%, #176b3a 100%);
  min-height: 18px;
  box-shadow: 0 6px 12px rgba(23, 107, 58, .16);
}

.bar-group .bar.admitted { width: 50%; }

.months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: #45506c;
  text-align: center;
}

.request-list,
.event-list {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
}

.request-item,
.event-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.person-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-line strong {
  display: block;
}

.muted {
  color: var(--muted);
}

.mini-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.mini-actions button {
  width: 24px;
  height: 24px;
  border: 0;
  color: #fff;
  border-radius: 5px;
}

.calendar {
  padding: 18px 22px 22px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  text-align: center;
}

.calendar-grid b,
.calendar-grid span {
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}

.calendar-grid .active {
  background: var(--blue);
  color: #fff;
}

.calendar-key {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-key i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.date-filter input {
  width: 126px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.report-panel { overflow: hidden; }
.report-panel .table-wrap { overflow-x: auto; }
.report-panel .report-table { min-width: 0; table-layout: fixed; font-size: 12px; }
.report-panel .report-table th,
.report-panel .report-table td { padding: 10px 8px; overflow: hidden; text-overflow: ellipsis; }

.results-breakdown { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  color: #41506d;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: #064fff;
  border-bottom-color: var(--blue);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 22px;
}

.quick {
  min-height: 98px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.quick span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
}

.section-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.section-toolbar h2 {
  margin: 0;
  font-size: 20px;
}

@media (min-width: 961px) {
  .section-panel > .section-toolbar:first-child .filters {
    flex-wrap: nowrap;
  }

  .section-panel > .section-toolbar:first-child .search {
    flex: 0 1 230px;
    width: 230px;
    min-width: 170px;
  }
}

.section-body {
  padding: 22px;
}

.directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 24px;
}

.directory.parents {
  grid-template-columns: repeat(3, minmax(270px, 1fr));
}

/* Keep the high-volume student and guardian directories aligned. */
.directory.students,
.directory.parents {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.directory.students .profile-id,
.directory.parents .profile-id {
  min-height: 42px;
  padding: 0 14px;
  font-size: 13px;
}

.directory.students .profile-main,
.directory.parents .profile-main {
  margin: 12px;
  padding: 10px;
  gap: 9px;
}

.directory.students .profile-main .avatar,
.directory.parents .profile-main .avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 12px;
}

.directory.students .profile-main > div,
.directory.parents .profile-main > div,
.directory.students .profile-fields > div,
.directory.parents .profile-fields > div {
  min-width: 0;
}

.directory.students .profile-main > div > strong,
.directory.parents .profile-main > div > strong,
.directory.students .profile-main > div > span,
.directory.parents .profile-main > div > span,
.directory.students .profile-fields > div,
.directory.parents .profile-fields > div {
  overflow: hidden;
  text-overflow: ellipsis;
}

.directory.students .profile-main > div > strong,
.directory.parents .profile-main > div > strong,
.directory.students .profile-main > div > span {
  display: block;
  white-space: nowrap;
}

.directory.students .profile-fields,
.directory.parents .profile-fields {
  gap: 9px;
  padding: 0 14px 12px;
  font-size: 12px;
}

.directory.students .profile-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory.parents .profile-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory.students .field-label,
.directory.parents .field-label {
  margin-bottom: 2px;
  font-size: 11px;
}

.directory.students .card-foot,
.directory.parents .card-foot {
  min-height: 46px;
  padding: 0 14px;
  font-size: 12px;
}

.directory.students .tiny-btn {
  min-width: 30px;
  height: 30px;
}

.student-joined {
  display: grid;
  gap: 1px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.student-joined small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.student-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.directory.parents .card-foot > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory.parents .card-foot .btn {
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
}

.profile-card {
  overflow: hidden;
}

.profile-id {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  color: #064fff;
}

.profile-main {
  margin: 22px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8f9fb;
  border-radius: var(--radius);
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 0 22px 20px;
}

.parents .profile-fields,
.teachers .profile-fields {
  grid-template-columns: repeat(2, 1fr);
}

.field-label {
  color: #66708a;
  margin-bottom: 4px;
}

.card-foot {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
}

.tiny-btn {
  min-width: 38px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 26px 0 6px;
}

.stats-strip {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px 280px;
  gap: 24px;
  margin-bottom: 24px;
}

.stats-strip.finance-strip {
  grid-template-columns: 280px minmax(520px, 1fr) minmax(620px, 0.95fr);
  width: 100%;
  min-width: 100%;
  overflow: hidden;
}

.fees-summary-strip {
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr) minmax(380px, .9fr);
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.fees-summary-strip > * { min-width: 0; }
.fees-progress-grid { min-width: 0; }
.fees-progress-grid .progress-card { min-width: 0; overflow: hidden; }
.fees-progress-grid .progress-card p,
.fees-progress-grid .progress-card strong { overflow-wrap: anywhere; }

/* Compatibility for an already-open tab still rendering the previous four-column markup. */
.fees-summary-strip:has(> .grid) {
  grid-template-columns: minmax(190px, 240px) minmax(300px, 1fr) repeat(2, minmax(160px, .42fr));
}
.fees-summary-strip > .grid { min-width: 0; gap: 12px !important; }
.fees-summary-strip > .grid .progress-card { min-width: 0; overflow: hidden; padding: 14px; }
.fees-summary-strip > .grid .progress-card p,
.fees-summary-strip > .grid .progress-card strong { overflow-wrap: anywhere; font-size: 12px; }

.money-stack {
  display: grid;
  gap: 16px;
}

.money-card {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 90px;
  padding: 16px 18px;
}

.money-card h3 {
  font-size: 24px;
  margin: 0 0 6px;
}

.line-chart {
  height: 255px;
  position: relative;
  padding: 20px;
  background:
    repeating-linear-gradient(to right, transparent 0 115px, var(--line-soft) 116px),
    repeating-linear-gradient(to top, transparent 0 54px, var(--line-soft) 55px);
}

.line-chart.compact {
  height: 178px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  top: 82px;
  left: 46%;
  display: grid;
  gap: 4px;
  min-width: 104px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--blue);
  font-weight: 800;
  text-align: center;
}

.chart-tooltip.red {
  color: var(--red);
}

.chart-tooltip small {
  color: var(--text);
  font-weight: 500;
}

.progress-card {
  min-height: 112px;
  padding: 18px 20px;
}

.finance-progress-grid {
  display: grid;
  grid-column: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.finance-strip .trend-card {
  min-height: 286px;
}

.finance-strip .finance-progress-grid {
  min-height: 286px;
}

.finance-strip .trend-card {
  overflow: hidden;
}

.finance-strip .trend-card .card-head {
  min-height: 54px;
}

.finance-strip .line-chart {
  border-top: 0;
}

.finance-strip .progress-card {
  display: grid;
  align-content: space-between;
  min-height: 135px;
  box-shadow: 0 8px 20px rgba(14, 23, 50, 0.05);
}

.collection-activity-card strong {
  font-size: 19px;
}

.collection-activity-card .muted {
  font-size: 12px;
}

.activity-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.activity-summary { display:flex; align-items:center; gap:12px; }
.activity-pie { width:54px; aspect-ratio:1; border-radius:50%; background:radial-gradient(circle,var(--panel) 0 47%,transparent 49%),conic-gradient(var(--green) 0 48%,var(--blue) 48% 80%,var(--amber) 80% 100%); }
.results-overview { display:flex; align-items:center; justify-content:center; gap:16px; margin:22px 0; }
.results-overview strong { font-size:26px; }.results-overview small { display:block; color:var(--muted); font-size:12px; }.results-pie { width:110px; aspect-ratio:1; border-radius:50%; background:radial-gradient(circle,var(--panel) 0 55%,transparent 57%),conic-gradient(var(--green) 0 76%,var(--amber) 76% 90%,var(--red) 90% 100%); }.results-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }.results-list div { display:grid; grid-template-columns:1fr auto; gap:5px 10px; font-size:13px; }.results-list i { grid-column:1/-1; height:6px; border-radius:99px; background:var(--line-soft); }.results-list i i { display:block; background:var(--blue); }

.finance-strip .progress-row {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.finance-strip .progress-row span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.finance-strip .progress-row span:last-child {
  flex: 0 0 auto;
}

.finance-strip .progress-card p {
  margin: 14px 0 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.finance-strip .progress-card .track {
  margin-top: 14px;
}

.finance-strip .progress-card .track {
  height: 8px;
  background: #edf0f5;
}

.track.cyan .fill,
.progress-card.cyan .fill {
  background: linear-gradient(90deg, #47cbd9, var(--cyan));
}

.track.blue .fill,
.track.progress .fill,
.track.in-progress .fill,
.progress-card.blue .fill {
  background: linear-gradient(90deg, #4367f0, var(--blue));
}

.track.amber .fill,
.track.pending .fill,
.track.review .fill,
.track.draft .fill,
.track.watch .fill,
.progress-card.amber .fill {
  background: linear-gradient(90deg, #f3b600, var(--amber));
}

.track.green .fill,
.track.active .fill,
.track.paid .fill,
.track.cleared .fill,
.track.completed .fill,
.progress-card.green .fill {
  background: linear-gradient(90deg, #20c34e, var(--green));
}

.track.red .fill,
.track.overdue .fill,
.track.hold .fill,
.track.critical .fill,
.track.risk .fill,
.progress-card.red .fill {
  background: linear-gradient(90deg, #ff4d72, var(--red));
}

.finance-command-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1fr) minmax(360px, .78fr);
  gap: 24px;
  margin: 24px 0;
}

.finance-board {
  overflow: hidden;
}

.finance-notices {
  display: grid;
}

.finance-notices {
  padding: 16px 18px;
  gap: 10px;
}

.finance-notices article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.finance-notices strong {
  display: block;
  margin-bottom: 4px;
}

.finance-notices small {
  color: var(--muted);
}

.due-pill {
  min-width: 70px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.finance-activity {
  overflow: hidden;
}

.finance-pie-panel {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 22px;
}

.finance-pie {
  width: 190px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 42%, transparent 43%),
    conic-gradient(var(--green) 0 48%, var(--blue) 48% 76%, var(--amber) 76% 91%, var(--red) 91% 100%);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px rgba(16, 24, 40, 0.08);
}

.finance-pie-legend {
  display: grid;
  gap: 10px;
}

.finance-pie-legend article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.finance-pie-legend strong,
.finance-pie-legend small {
  display: block;
}

.finance-pie-legend small {
  margin-top: 3px;
  color: var(--muted);
}

.finance-pie-legend b {
  font-size: 13px;
}

.fees-summary-strip .progress-card {
  padding: 24px 22px;
  min-height: 142px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 26px;
}

.assessment-board {
  display: grid;
  gap: 24px;
}

.assessment-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 18px;
}

.assessment-toolbar {
  align-items: end;
}

.assessment-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.assessment-filter .select {
  min-width: 160px;
}

.assessment-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 20px 0;
  border-top: 1px solid var(--line);
}

.assessment-tabs .tab {
  border: 0;
  background: transparent;
}

.assessment-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 12px;
}

.assessment-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.blue {
  background: var(--blue);
}

.legend-dot.amber {
  background: var(--amber);
}

.legend-dot.red {
  background: var(--red);
}

.assessment-score {
  display: inline-grid;
  grid-template-columns: 46px 220px;
  align-items: center;
  gap: 10px;
}

.assessment-progress {
  width: 220px;
  display: inline-block;
  vertical-align: middle;
}

.track {
  height: 8px;
  background: #edf0f5;
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4e6dff, var(--blue));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f0f2f7;
  font-weight: 800;
}

.row-tools {
  display: flex;
  gap: 12px;
  color: var(--text);
}

.cell-stack {
  display: grid;
  gap: 3px;
}

.cell-stack strong {
  font-size: 13px;
}

.cell-stack small {
  color: var(--muted);
  font-size: 11px;
}

.icon-mini {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.icon-mini:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.timetable-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
}

.timetable-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 16px;
}

.day h3 {
  font-size: 15px;
  margin: 0 0 14px;
}

.lesson {
  min-height: 150px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  padding: 14px;
  background: var(--blue-soft);
}

.lesson p {
  margin: 6px 0;
}

.teacher-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 100%;
  background: rgba(255, 255, 255, 0.86);
  padding: 8px;
  border-radius: 5px;
  margin: 8px 0;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.curriculum-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 24px;
}

.lesson-plan {
  padding: 20px;
}

.class-tag {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 800;
  margin-bottom: 18px;
}

.lesson-plan h3 {
  min-height: 44px;
  margin: 14px 0 22px;
  font-size: 17px;
}

.lesson-actions {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
  color: var(--blue);
}

.inventory-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.inventory-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 140px;
  gap: 24px;
  align-items: center;
  min-height: 96px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

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

.inline-person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.small-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.table-progress {
  display: inline-block;
  width: min(360px, 70%);
  vertical-align: middle;
}

.table-footer {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
}

.table-pagination {
  justify-content: flex-end;
  min-height: 48px;
  padding-block: 8px;
}

.table-footer b {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  margin: 0 8px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
}

.table-footer a {
  color: #064fff;
  margin-left: 14px;
}

.messaging-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: calc(100vh - 285px);
}

.chat-list {
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: none;
  overflow: hidden;
}

.chat-list-head,
.chat-top {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}

.chat-search {
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
}

.chat-search input {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  background: #f5f6fb;
  color: var(--text);
}

.chat-contact {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.chat-contact.soft {
  background: var(--line-soft);
}

.chat-contact p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.chat-window {
  display: grid;
  grid-template-rows: 64px minmax(320px, 58vh) 60px;
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: none;
  overflow: hidden;
}

.chat-body {
  padding: 18px 22px 28px;
  overflow-y: auto;
  background: var(--bg);
}

.chat-date {
  margin: 0 0 26px;
  color: #a6afc7;
  text-align: center;
}

.bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 320px;
  margin-bottom: 18px;
}

.bubble-row.out {
  margin-left: auto;
  align-items: flex-end;
}

.bubble-row.in {
  align-items: flex-start;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: 0 22px 22px 22px;
  background: var(--blue-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.bubble-row.out .chat-bubble {
  border-radius: 22px 0 22px 22px;
  background: var(--blue);
  color: #fff;
}

.chat-time {
  margin-top: 6px;
  color: #a6afc7;
}

.voice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.play {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-size: 11px;
}

.bubble-row.out .play {
  background: #fff;
}

.wave {
  flex: 1;
  height: 22px;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px);
  opacity: 0.9;
  mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%);
}

.chat-input {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-input input {
  height: 44px;
  border: 0;
  outline: 0;
  color: var(--text);
}

.send-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 28px;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.analytics-kpi {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 90px;
  padding: 18px 22px;
}

.analytics-kpi h2,
.analytics-kpi p {
  margin: 0;
}

.analytics-kpi h2 {
  font-size: 26px;
}

.analytics-kpi .btn {
  min-width: 116px;
}

.analytics-premium-grid {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.45fr);
  gap: 24px;
  margin-bottom: 24px;
}

.analytics-money {
  gap: 24px;
}

.money-line-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 22px;
}

.money-line-card .soft-icon {
  position: absolute;
  top: 22px;
  right: 22px;
}

.money-line-card p,
.money-line-card h2 {
  margin: 0;
}

.money-line-card p {
  color: var(--muted);
  font-weight: 700;
}

.money-line-card h2 {
  margin-top: 4px;
  font-size: 27px;
}

.money-line-card .line-chart {
  margin: 18px -22px -22px;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
}

.analytics-enrollment .chart.compact {
  height: 305px;
}

.analytics-enrollment .chart.compact .bars {
  height: 230px;
}

.analytics-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, .85fr);
  gap: 24px;
  margin-bottom: 24px;
}

.notice-list {
  padding: 20px 22px;
}

.notice-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.notice-list article:last-child {
  border-bottom: 0;
}

.notice-list strong,
.notice-list small {
  display: block;
}

.notice-list small {
  margin-top: 4px;
  color: var(--muted);
}

.analytics-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.shortcut-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.shortcut-tile span,
.shortcut-tile i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  color: #fff;
}

.shortcut-tile i {
  width: 28px;
  height: 28px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
}

.shortcut-tile.amber { background: #fff8e7; border-color: #ffe6a8; }
.shortcut-tile.green { background: var(--green-soft); border-color: #c8f2d2; }
.shortcut-tile.cyan { background: var(--cyan-soft); border-color: #beeef6; }
.shortcut-tile.blue { background: var(--blue-soft); border-color: #d8e2ff; }
.shortcut-tile.amber span { background: var(--amber); }
.shortcut-tile.green span { background: var(--green); }
.shortcut-tile.cyan span { background: var(--cyan); }
.shortcut-tile.blue span { background: var(--blue); }

.circle-metric {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}

.circle-metric h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.15;
}

.circle-metric p {
  margin: 0;
  font-size: 12px;
}

.ring {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  border: 7px solid var(--blue);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
}

.ring.green {
  border-color: var(--green);
}

.ring.blue {
  border-color: #0f73d7;
}

.ring.amber {
  border-color: var(--amber);
}

.ring.cyan {
  border-color: #13b9df;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, 0.92fr);
  background: var(--bg);
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #fff;
  background: #174f31;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  background: url("/erp/assets/excel-login-bg-cropped.webp") center / cover no-repeat;
  opacity: 0.72;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(100deg, rgba(19, 75, 43, .94), rgba(19, 75, 43, .7) 52%, rgba(244, 207, 69, .22));
  pointer-events: none;
}

.login-brand,
.login-copy,
.login-stats {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.login-logo-tile {
  width: 176px;
  max-height: 184px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.login-logo-tile .school-logo img {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .32));
  opacity: 1;
  max-height: 182px;
  border-radius: 0;
}

.login-mark {
  color: #fff;
}

.login-mark small {
  color: #9be9ef;
}

.login-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 16px;
  color: #9be9ef;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 5vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-copy p:last-child {
  max-width: 560px;
  margin: 0;
  color: #d7defa;
  font-size: 18px;
  line-height: 1.7;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 620px;
}

.login-stats div {
  min-height: 96px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.login-stats strong,
.login-stats span {
  display: block;
}

.login-stats strong {
  font-size: 26px;
  margin-bottom: 6px;
}

.login-stats span {
  color: #d7defa;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 42px;
}

.login-card {
  width: min(100%, 450px);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(21, 34, 69, 0.12);
}

.login-card-head {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 20px;
}

.login-card-logo {
  width: 108px;
  margin-bottom: 4px;
}

.login-card-logo .school-logo {
  width: 100%;
}

.login-card-logo .school-logo img {
  max-height: 104px;
  border-radius: 0;
}

.login-card-head h2 {
  margin: 0;
  font-size: 26px;
}

.login-card-head p {
  margin: 0;
}

.form-field {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 700;
}

.form-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--text);
  background: var(--bg);
}

.form-field input:focus {
  outline: 3px solid rgba(66, 99, 230, 0.16);
  border-color: var(--blue);
  background: var(--panel);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 22px;
  color: #4b5570;
}

.login-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-options a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}

.login-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12px;
}

.access-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.access-card h2 {
  margin: 0 0 8px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.role-grid span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.role-grid span.selected,
.role-grid span:hover {
  background: var(--blue);
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(6, 10, 22, 0.52);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.modal-card.wide {
  width: min(960px, 100%);
}

.modal-card.receipt-modal {
  width: min(560px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--red);
  border-color: var(--red);
}

.modal-body {
  padding: 22px;
}

.modal-form {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  padding: 0;
}

.modal-form .wide-field,
.modal-form .form-note {
  grid-column: 1 / -1;
}

.form-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--muted);
  line-height: 1.5;
}

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

.modal-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.modal-grid select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.choice-card,
.notice-row,
.detail-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-align: left;
}

.choice-card {
  display: grid;
}

.choice-card span,
.notice-row p {
  color: var(--muted);
  margin: 0;
}

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

.receipt-card {
  display: grid;
  gap: 18px;
}

.receipt-card .school-logo {
  width: 220px;
  margin: 0 auto;
}

.receipt-card h2 {
  text-align: center;
  margin: 0;
}

.receipt-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.receipt-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-card dt {
  color: var(--muted);
}

.receipt-card dd {
  margin: 0;
  font-weight: 800;
}

@media (max-width: 1600px) and (min-width: 961px) {
  .app-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .content { padding: 22px; }

  .grid { gap: 16px; }
  .grid.metrics { gap: 14px; }
  .metric { padding: 16px; }
  .metric-main { gap: 10px; }
  .metric-icon { width: 48px; height: 48px; font-size: 23px; flex: 0 0 48px; }
  .metric h3 { font-size: 22px; line-height: 1.12; }
  .metric p { font-size: 13px; }
  .metric .badge { padding-inline: 6px; font-size: 10px; }
  .metric-foot { gap: 10px; margin-top: 12px; padding-top: 12px; font-size: 12px; }

  .stats-strip.finance-strip {
    grid-template-columns: 200px minmax(0, 1fr) minmax(0, 420px);
    gap: 16px;
    min-width: 0;
    max-width: 100%;
  }
  .sidebar-collapsed .stats-strip.finance-strip {
    grid-template-columns: 230px minmax(0, 1fr) minmax(0, 520px);
  }
  .finance-strip > * { min-width: 0; }
  .finance-strip .finance-progress-grid {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }
  .money-stack { gap: 12px; }
  .money-card { min-height: 78px; padding: 13px 14px; }
  .money-card h3 { font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
  .finance-card-icon { width: 44px; height: 44px; }
  .finance-progress-grid { gap: 12px; }
  .finance-strip .progress-card { min-height: 116px; padding: 14px; }
  .finance-strip .progress-card { min-width: 0; overflow: hidden; }
  .finance-strip .progress-row { gap: 6px; }
  .finance-strip .progress-row span:first-child { font-size: 12px; }
  .finance-strip .progress-row span:last-child { font-size: 12px; }
  .progress-card p { font-size: 12px; overflow-wrap: anywhere; }
  .finance-strip .progress-card strong { font-size: 12px; }
  .fees-summary-strip {
    grid-template-columns: 200px minmax(0, 1fr) minmax(0, 420px);
    gap: 16px;
  }
  .sidebar-collapsed .fees-summary-strip {
    grid-template-columns: 230px minmax(0, 1fr) minmax(0, 520px);
  }
  .app-shell:not(.sidebar-collapsed) .fees-summary-strip:has(> .grid) {
    grid-template-columns: 190px minmax(280px, 1fr) repeat(2, minmax(150px, 190px));
  }
  .sidebar-collapsed .fees-summary-strip:has(> .grid) {
    grid-template-columns: 220px minmax(340px, 1fr) repeat(2, minmax(180px, 230px));
  }
  .fees-progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fees-progress-grid .progress-card { min-height: 116px; padding: 14px; }
  .fees-progress-grid .progress-row,
  .fees-progress-grid .progress-card p { font-size: 12px; }

  .director-chart-card .chart { height: 224px; padding-block: 12px 8px; }
  .director-chart-card .bars { height: 158px; }
  .director-chart-card .months { margin-top: 6px; font-size: 10px; }
  .director-calendar .calendar { padding: 10px 18px 12px; }
  .director-calendar .calendar-grid { gap: 3px 7px; }
  .director-calendar .calendar-grid span { min-height: 24px; font-size: 12px; }
  .director-calendar .calendar-key { margin-top: 6px; }

  .admissions-dashboard-grid { align-items: stretch; }
  .admissions-dashboard-grid > .card { height: 310px; overflow: hidden; }
  .admissions-chart-card .chart { height: 250px; padding: 10px 18px 8px; }
  .admissions-chart-card .bars { height: 184px; }
  .admissions-chart-card .months { margin-top: 5px; font-size: 10px; }
  .admissions-queue-card .request-list { gap: 8px; padding: 12px 16px; }
  .admissions-queue-card .request-item { padding: 9px 10px; }
  .admissions-queue-card .person-line { gap: 8px; }
  .admissions-queue-card .person-line strong,
  .admissions-queue-card .person-line .muted { font-size: 12px; }

  .fees-table,
  .balance-table { min-width: 900px; font-size: 12px; }
  .fees-table th,
  .fees-table td,
  .balance-table th,
  .balance-table td { padding: 11px 9px; }
  .balance-table .row-tools { gap: 6px; }
}

@media (max-width: 1380px) {
  .grid.metrics,
  .directory,
  .curriculum-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-strip,
  .timetable-page,
  .messaging-layout,
  .teacher-layout,
  .finance-strip,
  .analytics-premium-grid,
  .analytics-lower-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip.finance-strip { grid-template-columns: 1fr; }
  .finance-strip .money-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .report-metrics,
  .analytics-kpi-grid,
  .analytics-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-list,
  .chat-window {
    border-radius: var(--radius);
  }

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

  .record-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .finance-progress-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .finance-command-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 520px;
    padding: 28px;
  }

  .login-brand-panel::before {
    width: 80vw;
    opacity: 0.5;
  }

  .login-form-panel {
    padding: 24px;
  }

  .login-stats,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 420px;
  }

  .topbar,
  .page-head,
  .section-toolbar,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.metrics,
  .grid.two,
  .grid.three,
    .grid.four,
    .finance-progress-grid,
    .finance-command-grid,
    .directory,
  .directory.parents,
  .curriculum-cards,
  .quick-grid,
  .report-metrics,
  .analytics-kpi-grid,
  .analytics-shortcuts {
    grid-template-columns: 1fr;
  }

  .finance-notices article,
  .finance-pie-panel {
    grid-template-columns: 1fr;
  }

  .finance-pie {
    margin: 0 auto;
  }

  .analytics-kpi {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .analytics-kpi .btn {
    grid-column: 1 / -1;
  }

  .bars.paired,
  .months {
    gap: 8px;
  }

  .content {
    padding: 18px;
  }

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

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

  .inventory-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 18px;
  }

  .chat-window {
    grid-template-rows: 74px minmax(520px, 1fr) 66px;
  }

  .voice {
    min-width: 260px;
  }

  .bubble-row {
    max-width: 92%;
  }

  .teacher-profile,
  .teacher-welcome,
  .syllabus-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-profile .btn {
    margin-left: 0;
  }

  .info-grid,
  .class-strip,
  .attendance-stats,
  .record-form {
    grid-template-columns: 1fr;
  }

  .school-hero,
  .finance-overview,
  .role-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-grid,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    top: 14px;
    right: 14px;
  }
}

@media (max-width: 720px) {
  .top-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .app-shell.sidebar-collapsed,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-collapsed .sidebar {
    max-height: 82px;
    overflow: hidden;
  }

  .messaging-layout {
    grid-template-columns: 1fr;
  }

  .chat-list {
    max-height: 360px;
    overflow: auto;
  }

  .voice {
    min-width: 210px;
  }
}

.recent-trend { height:190px; display:grid; grid-template-rows:1fr auto auto; gap:10px; padding:12px 18px; }
.trend-bars { display:grid; grid-template-columns:repeat(7,1fr); align-items:end; gap:16px; border-bottom:1px solid var(--line); background:repeating-linear-gradient(to bottom,transparent 0 44px,var(--line-soft) 45px); }
.trend-bars i { display:block; max-width:38px; width:100%; justify-self:center; border-radius:6px 6px 0 0; background:var(--blue); }.trend-dates { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; color:var(--muted); font-size:11px; }.recent-trend p { margin:0; color:var(--muted); font-size:12px; }
.collection-report header { display:flex; justify-content:space-between; padding-bottom:16px; border-bottom:2px solid var(--blue); }.collection-report header strong,.collection-report header span { display:block; }.collection-report header span,.report-summary small { color:var(--muted); }.report-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:18px 0; }.report-summary span { padding:12px; border-radius:8px; background:var(--line-soft); }.report-summary small,.report-summary strong { display:block; }.report-summary strong { margin-top:5px; font-size:17px; }

.fees-filters { flex-wrap: nowrap; }.fee-search { width:185px; }.fee-search input { min-width:0; width:100%; }.collection-report { overflow:hidden; }.collection-report table { width:100%; min-width:0; table-layout:fixed; font-size:12px; }.collection-report th,.collection-report td { padding:8px 6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.collection-report th:last-child,.collection-report td:last-child { text-align:right; white-space:nowrap; }
@keyframes loginFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes softRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.login-card-logo { animation: loginFloat 4s ease-in-out infinite; }
.login-card { animation: softRise .55s ease-out both; }
.progress-card[role="button"] { cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.progress-card[role="button"]:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(22, 69, 41, .14); }
.modal-card { animation: softRise .25s ease-out both; }
.fees-table { width: 100%; table-layout: fixed; font-size: 13px; }
.fees-table th, .fees-table td { padding-left: 8px; padding-right: 8px; overflow-wrap: anywhere; }
.fees-table th:nth-child(1) { width: 13%; }
.fees-table th:nth-child(2) { width: 14%; }
.fees-table th:nth-child(3) { width: 12%; }
.fees-table th:nth-child(4) { width: 9%; }
.fees-table th:nth-child(5) { width: 10%; }
.fees-table th:nth-child(6) { width: 10%; }
.fees-table th:nth-child(7) { width: 10%; }
.fees-table th:nth-child(8) { width: 11%; text-align: center; }
.fees-table th:nth-child(9) { width: 14%; text-align: center; }
.fees-table th:nth-last-child(2), .fees-table td:nth-last-child(2) { min-width: 0; }
.fees-table td:nth-last-child(2) { text-align: center; }
.fees-table td:nth-last-child(2) .badge { display: inline-flex; margin-inline: auto; white-space: nowrap; max-width: none; }
.fees-table tr[data-status="Pending Approval"] td:nth-last-child(2) .badge { width: 76px; min-height: 44px; white-space: normal; line-height: 1.05; text-align: center; justify-content: center; align-items: center; }
.fees-table th:last-child, .fees-table td:last-child { position: static; min-width: 0; background: var(--surface, #fff); box-shadow: none; }
.fees-table th:last-child { background: var(--table-head, #f0f2f7); }
.fees-table .row-tools { display: flex; flex-wrap: nowrap; gap: 5px; align-items: center; justify-content: center; }
.approve-payment-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; height: 34px; padding: 0; overflow: hidden; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: #fff; font-size: 0; cursor: pointer; }
.approve-payment-btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
@media (max-width: 1400px) { .fees-table { font-size: 12px; } .fees-table th, .fees-table td { padding-left: 6px; padding-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .login-card-logo, .login-card, .modal-card { animation: none; } .progress-card[role="button"] { transition: none; } }
.payment-history-wrap {
  overflow-x: hidden;
  width: 100%;
}

.payment-history-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.payment-history-table th,
.payment-history-table td {
  padding: 14px 12px;
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: normal;
}

.payment-history-table th:nth-child(1) { width: 20%; }
.payment-history-table th:nth-child(2) { width: 20%; }
.payment-history-table th:nth-child(3) { width: 14%; }
.payment-history-table th:nth-child(4) { width: 16%; }
.payment-history-table th:nth-child(5) { width: 18%; }
.payment-history-table th:nth-child(6) { width: 12%; }

.payment-history-table th:last-child,
.payment-history-table td:last-child {
  text-align: center;
}

.payment-history-table td:first-child,
.payment-history-table td:nth-child(3),
.payment-history-table td:nth-child(4) {
  white-space: nowrap;
}

.payment-history-table .row-tools {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
}

.modal-card.payment-history-modal {
  width: min(1080px, calc(100vw - 32px));
}

.director-dashboard .page-head {
  margin-bottom: 14px;
}

.director-dashboard .grid.metrics {
  gap: 16px;
  margin-bottom: 16px;
}

.director-dashboard .metric {
  padding: 16px;
}

.director-dashboard .metric-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
}

.director-dashboard .metric-foot {
  margin-top: 10px;
  padding-top: 10px;
}

.director-dashboard .grid.two {
  gap: 16px;
}

.director-dashboard .director-chart-card .chart {
  height: 220px;
  padding: 12px 20px 8px;
}

.director-dashboard .director-chart-card .bars {
  height: 150px;
}

.director-dashboard .director-chart-card .months {
  margin-top: 5px;
  font-size: 10px;
}

.director-dashboard .director-calendar .calendar {
  padding: 10px 18px 12px;
}

.director-dashboard .director-calendar .calendar-grid {
  gap: 3px 7px;
}

.director-dashboard .director-calendar .calendar-grid span,
.director-dashboard .director-calendar .calendar-grid b {
  min-height: 23px;
  font-size: 12px;
}

.director-dashboard .director-calendar .calendar-key {
  margin-top: 5px;
}

.director-dashboard .director-fees-table {
  margin-top: 14px;
}

/* Dark mode follows the school's green identity and preserves readable contrast. */
:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .content,
:root[data-theme="dark"] .main-area {
  background: var(--bg);
}

:root[data-theme="dark"] .metric p,
:root[data-theme="dark"] .metric-foot,
:root[data-theme="dark"] .months,
:root[data-theme="dark"] .crumbs,
:root[data-theme="dark"] .muted {
  color: var(--muted);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] .fees-table th:last-child {
  background: var(--table-head);
  color: var(--text);
}

:root[data-theme="dark"] td,
:root[data-theme="dark"] .fees-table td:last-child {
  background: var(--panel);
  color: var(--text);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .select,
:root[data-theme="dark"] .pill,
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .icon-mini,
:root[data-theme="dark"] .btn.ghost {
  border-color: var(--line);
  background: #17271f;
  color: var(--text);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #82988c;
  opacity: 1;
}

:root[data-theme="dark"] .shortcut,
:root[data-theme="dark"] .date-filter {
  background: var(--line-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .bar-group .bar.total {
  background: #3a5045;
}

:root[data-theme="dark"] .bars {
  border-color: var(--line);
  background: repeating-linear-gradient(to top, transparent 0 45px, rgba(78, 111, 93, 0.2) 46px);
}

:root[data-theme="dark"] .sidebar-role {
  border-color: rgba(69, 207, 120, 0.25);
  background: rgba(53, 185, 107, 0.12);
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .section-panel,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .table-wrap {
  border-color: var(--line);
  background: var(--panel);
}

:root[data-theme="dark"] .card-head,
:root[data-theme="dark"] .section-toolbar,
:root[data-theme="dark"] .modal-head {
  border-color: var(--line);
}

:root[data-theme="dark"] .calendar-grid .active {
  background: var(--green);
  color: #07120c;
}

:root[data-theme="dark"] .calendar-key i {
  background: var(--green);
}

.student-record-actions {
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding-top: 2px;
}

.student-results-btn {
  min-height: 42px;
  padding-inline: 18px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(35, 132, 71, 0.2);
}

.student-results-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.receipt-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.receipt-table th,
.receipt-table td {
  padding: 13px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-table th:nth-child(1) { width: 11%; }
.receipt-table th:nth-child(2) { width: 14%; }
.receipt-table th:nth-child(3) { width: 17%; }
.receipt-table th:nth-child(4) { width: 12%; }
.receipt-table th:nth-child(5) { width: 12%; }
.receipt-table th:nth-child(6) { width: 16%; }
.receipt-table th:nth-child(7) { width: 10%; text-align: center; }
.receipt-table th:nth-child(8) { width: 8%; text-align: center; }

.receipt-table td:nth-child(7),
.receipt-table td:nth-child(8) {
  text-align: center;
}

.receipt-table tr[data-status="Pending Approval"] td:nth-child(7) .badge {
  width: 76px;
  min-height: 42px;
  padding: 5px 7px;
  white-space: normal;
  text-align: center;
  justify-content: center;
  line-height: 1.05;
}

.receipt-table .row-tools {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% 0%, rgba(49, 176, 134, 0.1), transparent 30%),
    radial-gradient(circle at 18% 92%, rgba(214, 169, 58, 0.055), transparent 28%),
    var(--bg);
}

:root[data-theme="dark"] .content {
  background: transparent;
}

:root[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #10231a 0%, #0d1913 100%);
  border-right-color: #294b3a;
}

:root[data-theme="dark"] .topbar {
  background: linear-gradient(90deg, rgba(15, 35, 25, 0.98), rgba(18, 43, 31, 0.98));
  border-bottom-color: #294b3a;
}

:root[data-theme="dark"] .card:not(.profile-card),
:root[data-theme="dark"] .section-panel {
  background: linear-gradient(145deg, #14251c 0%, #112019 100%);
  border-color: #2b4a3a;
  box-shadow: 0 16px 36px rgba(2, 10, 6, 0.24);
}

:root[data-theme="dark"] .director-dashboard .metric {
  background: linear-gradient(145deg, #162a20 0%, #11231a 100%);
  border-color: #2b4a3a;
  border-top: 2px solid #49c77a;
}

:root[data-theme="dark"] .profile-card {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .profile-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .profile-id {
  color: var(--blue);
  background: transparent;
}

:root[data-theme="dark"] .profile-main {
  border: 1px solid var(--line);
  background: var(--line-soft);
}

:root[data-theme="dark"] .profile-main strong,
:root[data-theme="dark"] .profile-fields,
:root[data-theme="dark"] .student-joined {
  color: #f2f8f4;
}

:root[data-theme="dark"] .profile-main span,
:root[data-theme="dark"] .field-label,
:root[data-theme="dark"] .student-joined small {
  color: #a9c0b3;
}

:root[data-theme="dark"] .tiny-btn:hover,
:root[data-theme="dark"] .icon-mini:hover,
:root[data-theme="dark"] .icon-btn:hover {
  border-color: var(--green);
  background: rgba(69, 207, 120, 0.15);
  color: #68dc94;
}

.payment-history-modal .modal-body {
  min-width: 0;
}

/* Academic period controls and full-width, accessible class registers. */
.period-control { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.period-control select { padding: 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--panel); }
.top-actions { flex-wrap: wrap; }
.period-notice { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.section-note { padding: 18px 22px; line-height: 1.6; }
.modal-card.class-register-modal { width: min(1480px, calc(100vw - 44px)); max-width: calc(100vw - 44px); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.class-register-modal .modal-head { flex-shrink: 0; }
.class-register-modal .modal-body { min-width: 0; overflow-y: auto; padding: 16px; }
.class-table-scroll { width: 100%; max-height: 65vh; overflow: auto; scrollbar-gutter: stable; }
.class-student-table { width: 100%; min-width: 1120px; table-layout: auto; font-size: 12px; }
.class-student-table th, .class-student-table td { padding: 11px 12px; }
.class-student-table th { position: sticky; top: 0; z-index: 2; }
.class-student-table th:first-child, .class-student-table td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; box-shadow: 1px 0 var(--line); }
.class-student-table th:first-child { z-index: 3; }
.class-modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 14px; }
.class-modal-actions span { font-size: 12px; color: var(--muted); }
.classes-table { min-width: 570px; }
.student-fee-register { font-size: 12px; }
.text-link { border: 0; background: transparent; padding: 0; color: var(--green); text-align: left; cursor: pointer; font: inherit; }
.fees-filters { flex-wrap: wrap; }
.fees-table { table-layout: auto; }
.fees-table th, .fees-table td { white-space: normal; }
@media (max-width: 720px) {
  .modal-backdrop { padding: 8px; }
  .modal-card.class-register-modal { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
  .class-register-modal .modal-body { padding: 8px; }
  .modal-head h2 { font-size: 16px; }
}

/* Retain the established dashboard layout and align the academic action with the toolbar. */
.promotion-nav-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 12px; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; }
.promotion-nav-button.is-active { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.promotion-nav-button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.roster-toolbar { flex-wrap: wrap; gap: 12px; }
.roster-toolbar .filters { display: flex; flex-wrap: wrap; gap: 10px; }
.roster-filter-note { margin: 0; padding: 0 22px 14px; font-size: 12px; }
.student-register-panel { margin-top: 24px; }
.period-collection-chart .bars.paired, .period-collection-chart .months { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.period-collection-chart .months { white-space: normal; }
.promotion-roster tr[hidden], .student-fee-register tr[hidden] { display: none; }

.period-collection-chart.compact .months { font-size:10px; gap:2px; }
.period-collection-chart.compact .months span { overflow-wrap:anywhere; }
.activity-summary > div { min-width:0; }
.activity-summary strong, .activity-summary .muted { display:block; }
.activity-pie { flex:0 0 40px; }
.director-dashboard .metric-top .badge { white-space:nowrap; }

.register-toolbar { flex-wrap:wrap; gap:16px; }
.register-toolbar > .filters { margin-left:auto; display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.class-modal-actions { justify-content:space-between; flex-wrap:wrap; gap:12px; }
.class-modal-actions .filters { display:flex; gap:8px; }
.chart-date-note { font-size:11px; padding:0 20px; margin:0; }
.loading-placeholder { display:grid; grid-template-columns:repeat(3,minmax(0,1fr));gap:20px; }
.loading-placeholder div { height:140px; background:var(--panel);border:1px solid var(--line);border-radius:8px; }

.approval-notice-link { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;color:var(--green);font-weight:600;text-decoration:none;border-bottom:1px solid var(--line); }

/* Keep the six student-record fee columns inside the popup. */
.student-record-fees {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}
.student-record-fees th,
.student-record-fees td {
  padding: 10px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.student-record-fees th:first-child { width: 22%; }
.student-record-fees th:nth-child(2) { width: 12%; }
.student-record-fees th:last-child { width: 15%; }
.student-record-fees .badge { max-width: 100%; white-space: normal; }
@media (max-width: 600px) {
  .student-record-fees th, .student-record-fees td { padding: 8px 4px; font-size: 11px; }
  .student-record-fees .badge { padding: 4px; font-size: 10px; }
}

.change-preview-table { min-width:0;table-layout:fixed;width:100%; }
.change-preview-table th,.change-preview-table td { padding:10px 8px;white-space:normal;overflow-wrap:anywhere; }

.promotion-action-row { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.promotion-primary-action { flex:0 1 auto; }
.promotion-inline-filters.section-toolbar { padding:0; border:0; margin-left:auto; min-width:0; }
.promotion-inline-filters .filters { gap:6px; justify-content:flex-end; width:auto; }
.promotion-inline-filters .search { width:190px; min-width:0; }
.promotion-inline-filters .search input { width:100%; min-width:0; }
.promotion-inline-filters input,.promotion-inline-filters select,.promotion-inline-filters .pill { min-height:40px; height:40px; padding:10px 12px; font-size:13px; }
.promotion-inline-filters select { width:auto; max-width:135px; }
.promotion-inline-filters .pill { white-space:nowrap; }
.promotion-filter-summary { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:0 22px 10px; color:var(--muted); font-size:11px; }
#promotion-error:empty { display:none; }
@media(max-width:700px) {
  .promotion-inline-filters.section-toolbar { margin-left:0; width:100%; }
  .promotion-inline-filters .filters { justify-content:flex-start; }
}

.promotion-primary-action > .btn { min-height:40px; height:40px; }
.promotion-inline-filters select { max-width:155px; }

.fee-account-filters > .filters { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; }
.fee-account-filters > .filters > .search { margin-right: auto; min-width: 260px; }
@media (max-width: 700px) { .fee-account-filters > .filters > .search { width: 100%; min-width: 0; } }

/* Compact collection details */
.collection-detail-modal .modal-head { padding:12px 18px; }
.collection-detail-modal .modal-head h2 { font-size:18px; }
.collection-detail-modal .modal-body { padding:12px 18px 18px; min-width:0; }
.collection-modal-meta { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; font-size:12px; }
.collection-range-filters { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:10px 0; }
.collection-range-filters label { display:flex; flex-direction:column; gap:4px; font-size:11px; font-weight:600; }
.collection-detail-modal .select,.collection-detail-modal .btn { min-height:30px; padding:6px 9px; font-size:12px; }
.collection-class-total { display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--green-soft); color:var(--text); padding:9px 12px; border-radius:6px; margin:8px 0; font-size:12px; }
.collection-class-total strong { font-size:17px; }
.collection-month-summary { margin:4px 0 8px; }
.collection-month-summary summary { cursor:pointer; font-weight:600; padding:5px 0; font-size:12px; }
.collection-detail-modal table { width:100%; min-width:0; table-layout:fixed; font-size:12px; }
.collection-detail-modal th,.collection-detail-modal td { padding:9px 8px; white-space:normal; overflow-wrap:anywhere; }
.collection-detail-modal th:last-child,.collection-detail-modal td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.collection-entry-table th:last-child,.collection-entry-table td:last-child { white-space:nowrap; }
.compact-receipt { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--muted); }
.compact-receipt:focus { white-space:normal; overflow-wrap:anywhere; outline:1px solid var(--line); }
@media(max-width:600px) {
  .collection-detail-modal .modal-body { padding:10px; }
  .collection-detail-modal th,.collection-detail-modal td { padding:7px 4px; font-size:11px; }
  .collection-entry-table th:last-child,.collection-entry-table td:last-child { white-space:normal; }
}

.collection-export-tools,.collection-total-actions,.collection-summary-actions { display:inline-flex; align-items:center; gap:8px; }
.collection-export-tools { flex-shrink:0; }
.collection-export-tools .icon-mini { width:30px; height:30px; background:var(--panel); color:var(--muted); }
.collection-export-tools .icon-mini:hover,.collection-export-tools .icon-mini:focus-visible { color:var(--green); border-color:var(--green); }
.collection-summary-actions { flex-wrap:wrap; justify-content:flex-end; gap:12px; }
.collection-month-actions { display:flex; justify-content:flex-end; margin:0 0 6px; }
.collection-total-actions { gap:14px; }

/* Phone and tablet layouts: navigation is a drawer, not a page section. */
.mobile-menu-button, .mobile-menu-backdrop { display: none; }
@media (max-width: 960px) {
  .login-page { min-height: 100dvh; display: flex; flex-direction: column; }
  .login-brand-panel { min-height: 0; padding: 20px 24px; gap: 12px; }
  .login-brand, .login-stats, .login-copy h1, .login-copy > p:last-child { display: none; }
  .login-copy .eyebrow { margin: 0; color: white; font-size: 12px; text-align: center; }
  .login-form-panel { flex: 1; padding: 20px 16px max(24px, env(safe-area-inset-bottom)); align-content: start; }
  .login-card { width: 100%; max-width: 440px; padding: 24px; }
  .login-card-logo { margin-bottom: 12px; }
  .login-card-logo .school-logo img { max-height: 88px; width: auto; }
  .login-card-head h2 { font-size: 25px; }
  .login-card-head { margin-bottom: 20px; }
  .login-options { flex-wrap: wrap; gap: 12px; }
  .app-shell, .app-shell.sidebar-collapsed { display: block; min-height: 100dvh; }
  .app-shell .sidebar, .app-shell.sidebar-collapsed .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw);
    height: 100dvh; max-height: none; padding: max(18px, env(safe-area-inset-top)) 18px 24px;
    z-index: 1001; overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s;
  }
  .mobile-menu-open .app-shell .sidebar { transform: translateX(0); visibility: visible; }
  body.mobile-menu-open { overflow: hidden; }
  .mobile-menu-open .mobile-menu-backdrop { display: block; position: fixed; inset: 0; width: 100%; height: 100dvh; border: 0; background: #081b2e80; z-index: 1000; }
  .mobile-menu-button { display: inline-flex; }
  .main, .content, .section-panel, .grid > *, .director-dashboard { min-width: 0; max-width: 100%; }
  .topbar { padding: 10px 12px; top: 0; z-index: 50; }
  .top-actions { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; padding: 0; width: 100%; }
  .top-actions > .pill { margin-right: auto; }
  .top-actions > .avatar { display: none; }
  .top-actions .period-control { order: 10; flex: 1; min-width: 0; }
  .period-control select { width: 100%; min-height: 40px; }
  .content { padding: 16px 12px; }
  .page-head { gap: 12px; }
  .page-head h1 { font-size: 23px; overflow-wrap: anywhere; }
  .page-actions, .section-toolbar .filters { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; min-width: 0; }
  .section-toolbar .filters > * { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .section-toolbar .search { width: 100%; }
  .section-toolbar { padding: 16px; gap: 12px; }
  .table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 620px; }
  .table-wrap .class-student-table { min-width: 850px; }
  .table-footer { gap: 12px; }
  .period-collection-chart { overflow-x: auto; }
  .period-collection-chart .bars, .period-collection-chart .months { min-width: 480px; }
  .notification-dropdown { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 90px); overflow-y: auto; }
  .modal-backdrop { padding: 10px; align-items: center; }
  .modal-card, .modal-card.payment-history-modal, .modal-card.class-register-modal { width: 100%; max-width: 100%; max-height: calc(100dvh - 20px); min-width: 0; }
  .modal-body { min-width: 0; overflow: auto; padding: 16px; }
  .modal-form, .modal-grid, .record-form { grid-template-columns: minmax(0, 1fr); }
  .modal-form > *, .modal-grid > *, .record-form > * { min-width: 0; }
  input, select, textarea { font-size: 16px !important; max-width: 100%; }
  .btn, .icon-btn, .hamburger, .modal-close, .nav-link { min-height: 44px; }
  .icon-btn, .hamburger, .modal-close { min-width: 44px; }
  .footer { padding: 16px 12px max(16px, env(safe-area-inset-bottom)); gap: 6px; font-size: 12px; }
  .toast-stack { width: calc(100% - 24px); max-width: 400px; right: 12px; }
}
@media (max-width: 380px) {
  .login-card { padding: 20px 16px; }
  .top-actions { gap: 5px; }
  .top-actions > .pill { padding-inline: 8px; font-size: 12px; }
  .top-actions .icon-btn { min-width: 40px; width: 40px; }
}
@media (prefers-reduced-motion: reduce) { .app-shell .sidebar { transition: none; } }
.login-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.view-switch { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 960px) {
  .top-actions .period-control { flex: 1 0 calc(50% - 8px); }
  .login-stats { display: grid; gap: 12px; max-width: 440px; width: 100%; margin: 0 auto; }
  .login-stats div { min-height: 0; padding: 8px 12px; }
  .login-stats strong { font-size: 20px; margin-bottom: 2px; }
  .login-stats span { font-size: 12px; }
  .login-brand-panel { padding-block: 14px; }
  .view-switch .btn { flex: 1; }
  .directory-list table { min-width: 560px; }
}

/* Phone workspace: persistent navigation, compact overview and readable records. */
.mobile-brand, .mobile-bottom-nav, .mobile-dashboard-tabs, .mobile-collection-bars { display: none; }
@media screen and (max-width: 960px) {
  .app-shell { background: var(--bg); padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar { background: #12643c; color: white; padding: 16px 16px 12px; border: 0; border-radius: 0 0 24px 24px; box-shadow: 0 6px 18px #073c2520; position: relative; }
  .mobile-brand { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
  .mobile-brand > span:first-child { font-size:22px; font-weight:850; letter-spacing:1px; }
  .mobile-brand small { display:block; font-size:9px; letter-spacing:2px; }
  .mobile-brand-caption { font-size:11px; color:#d2e9d9; }
  .topbar .icon-btn, .topbar .pill, .topbar select { color:white; background:#ffffff12; border-color:#ffffff30; border-radius:12px; }
  .topbar select option { color:#172c22; background:white; }
  .topbar .period-control { flex:1 0 calc(50% - 8px); }
  .topbar .period-control select { width:100%; min-height:38px; font-size:13px!important; }
  .topbar .top-actions { gap:6px; }
  .topbar .pill { font-size:12px; padding:8px; }
  .topbar .notification-dropdown { color:var(--text); }
  .mobile-bottom-nav { display:flex; position:fixed; bottom:0; left:0; right:0; z-index:90; background:var(--panel); border-top:1px solid var(--line); box-shadow:0 -4px 24px #1338230c; padding:7px 10px calc(7px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav a,.mobile-bottom-nav button { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:var(--muted); background:none; border:0; border-radius:14px; text-decoration:none; font:inherit; font-size:11px; min-height:52px; }
  .mobile-bottom-nav [aria-current="page"] { background:#e6f3e9; color:#12643c; font-weight:750; }
  .mobile-menu-open .mobile-bottom-nav { visibility:hidden; }
  .content { padding:20px 14px; }
  .page-head h1 { font-size:22px; letter-spacing:-.7px; }
  .card,.section-panel { border-radius:18px; box-shadow:0 3px 12px #173f2410; }
  .director-dashboard .grid.metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .director-dashboard .metric { padding:13px 11px; border-radius:18px; }
  .director-dashboard .metric-main { flex-wrap:wrap; gap:7px; align-items:flex-start; }
  .director-dashboard .metric-main > div { flex:1 1 100%; min-width:0; }
  .director-dashboard .metric-icon { width:30px; height:30px; }
  .director-dashboard .metric-main h3 { font-size:clamp(17px,4.5vw,24px); line-height:1.2; overflow-wrap:normal; margin:0 0 4px; }
  .director-dashboard .metric-main p { font-size:12px; }
  .director-dashboard .metric-main > .badge { display:none; }
  .director-dashboard .metric-foot { display:block; font-size:10px; line-height:1.5; margin-top:9px; padding-top:8px; }
  .director-dashboard .metric-foot span { display:block; overflow-wrap:normal; }
  .director-dashboard .metric-foot .vline { display:none; }
  .mobile-dashboard-tabs { display:flex; gap:4px; background:var(--line); border-radius:14px; padding:4px; margin:18px 0 12px; }
  .mobile-dashboard-tabs button { min-height:44px; flex:1; background:none; border:0; border-radius:11px; color:var(--muted); font:inherit; font-size:12px; font-weight:700; }
  .mobile-dashboard-tabs [aria-selected="true"] { background:var(--panel); color:var(--green); box-shadow:0 2px 6px #0000000d; }
  .director-dashboard .director-calendar,.director-dashboard .director-fees-table { display:none; }
  .director-dashboard[data-mobile-section="1"] .grid.two { display:none; }
  .director-dashboard[data-mobile-section="1"] .director-fees-table { display:block; }
  .director-dashboard[data-mobile-section="2"] .director-chart-card { display:none; }
  .director-dashboard[data-mobile-section="2"] .director-calendar { display:block; }
  .period-collection-chart { display:none; }
  .mobile-collection-bars { display:grid; gap:12px; padding:14px 18px 20px; }
  .mobile-collection-bars > div { display:grid; grid-template-columns:1fr auto; gap:5px; font-size:11px; }
  .mobile-collection-bars span { font-size:10px; color:var(--muted); }
  .mobile-collection-bars i { grid-column:1/-1; height:5px; border-radius:5px; background:var(--line); overflow:hidden; }
  .mobile-collection-bars b { display:block; height:100%; background:var(--green); border-radius:5px; }
  .table-wrap { overflow:visible!important; }
  table.responsive-records { display:block; width:100%!important; min-width:0!important; max-width:100%; table-layout:auto; }
  .responsive-records thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .responsive-records tbody,.responsive-records tfoot { display:block; width:100%; }
  .responsive-records tbody tr,.responsive-records tfoot tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; padding:16px; margin:10px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
  .responsive-records tr[hidden],.responsive-records td[hidden] { display:none!important; }
  .responsive-records tbody td,.responsive-records tfoot td { display:block; width:auto!important; min-width:0!important; max-width:100%; border:0; padding:0!important; white-space:normal!important; overflow-wrap:anywhere; word-break:normal; font-size:13px; text-align:left; }
  .responsive-records td::before { content:attr(data-label); display:block; margin-bottom:5px; font-size:10px; font-weight:600; letter-spacing:.3px; color:var(--muted); }
  .responsive-records td:first-child,.responsive-records .record-wide { grid-column:1/-1; }
  .responsive-records td:first-child { border-bottom:1px solid var(--line); padding-bottom:9px!important; }
  .responsive-records td button,.responsive-records td a { max-width:100%; white-space:normal; }
  .responsive-records .row-tools { display:flex; flex-wrap:wrap; gap:6px; }
  .login-brand-panel { border-radius:0 0 32px 32px; padding:24px 20px 32px; }
  .login-copy .eyebrow { font-size:11px; letter-spacing:1px; }
  .login-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .login-stats > div { padding:10px 5px; text-align:center; border-radius:12px; }
  .login-stats strong { font-size:22px; }
  .login-stats span { font-size:10px; }
  .login-form-panel { padding:0 16px 24px; margin-top:-12px; z-index:1; }
  .login-card { border-radius:24px; padding:24px; }
  .login-card .login-submit { border-radius:14px; min-height:50px; }
  .login-card input { border-radius:12px; }
  .footer { font-size:10px; padding:12px; }
}

@media screen and (max-width: 960px) {
  .section-body:has(> .directory.students) { padding:12px; }
  .directory.students { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .students .profile-card { border-radius:20px; position:relative; border:1px solid var(--line); box-shadow:0 4px 12px #1643290a; }
  .students .profile-id { min-height:32px; padding:8px 10px; background:#e8f4ec; color:#12643c; font-size:10px; overflow-wrap:anywhere; }
  .students .profile-id > strong { display:none; }
  .students .profile-main { flex-direction:column; align-items:flex-start; gap:10px; margin:0; padding:14px 12px 10px; background:transparent; }
  .students .profile-main .avatar { width:44px; height:44px; border-radius:15px; background:#dceee3; color:#12643c; font-size:16px; box-shadow:none; }
  .students .profile-card:nth-child(3n+2) .avatar { background:#fff0d1; color:#805c13; }
  .students .profile-card:nth-child(3n) .avatar { background:#e3ebff; color:#344f8d; }
  .students .profile-main > div { min-width:0; width:100%; }
  .students .profile-main strong { display:block; font-size:14px; line-height:1.3; overflow-wrap:anywhere; }
  .students .profile-main br { display:none; }
  .students .profile-main div > span { display:inline-block; font-size:11px; margin-top:6px; color:var(--muted); }
  .students .profile-fields { grid-template-columns:1fr; gap:8px; padding:0 12px 12px; font-size:11px; overflow-wrap:anywhere; }
  .students .field-label { font-size:9px; margin-bottom:2px; text-transform:uppercase; letter-spacing:.4px; }
  .students .card-foot { flex-direction:column; align-items:stretch; gap:8px; padding:10px; }
  .students .student-joined { font-size:10px; display:flex; flex-wrap:wrap; gap:4px; color:var(--muted); }
  .students .student-actions { display:flex; gap:6px; margin:0; width:100%; }
  .students .tiny-btn { flex:1; min-width:0; height:44px; border-radius:12px; }
  .students .tiny-btn:first-child { color:#12643c; background:#e8f4ec; border-color:transparent; }
}

/* Balanced sign-in and compact phone controls. */
.login-stats { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; }
.login-stats > div { display:flex; flex-direction:column; justify-content:center; }
@media screen and (max-width:960px) {
 .login-brand-panel { padding:20px 16px 28px; }
 .login-stats strong { line-height:1.2; }
 .login-stats span { min-height:26px; display:flex; align-items:center; justify-content:center; }
 .login-form-panel { padding:0 18px 24px; }
 .login-card { padding:22px 20px; width:100%; max-width:400px; }
 .login-card-logo { width:64px; height:64px; margin:auto; }
 .login-card-logo img { width:100%; height:100%; object-fit:contain; }
 .login-card-head h2 { font-size:24px; margin:12px 0 6px; }
 .mobile-brand-caption img { width:38px!important; height:38px!important; object-fit:contain; }
 .mobile-brand-caption { display:flex; align-items:center; justify-content:center; width:42px; height:42px; }
 .mobile-menu-button { display:inline-flex; align-items:center; justify-content:center; padding:0!important; }
 .section-toolbar { padding:14px; gap:10px; }
 .section-toolbar .filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:10px; background:var(--bg); border-radius:16px; }
 .section-toolbar .filters > * { width:100%; min-width:0; margin:0; }
 .section-toolbar .filters .search { grid-column:1/-1; }
 .section-toolbar .filters input,.section-toolbar .filters select,.section-toolbar .filters button { border-radius:11px; min-height:42px; max-width:100%; }
 .section-toolbar .filters .search input { width:100%; }
 .modal-backdrop { padding:24px 18px!important; display:flex; align-items:center; justify-content:center; }
 .modal-card,.modal-card.payment-history-modal,.modal-card.class-register-modal { width:100%; max-width:480px!important; max-height:78dvh!important; border-radius:22px; display:flex; flex-direction:column; }
 .modal-head { padding:14px 16px; flex-shrink:0; }
 .modal-head h2 { font-size:18px; }
 .modal-body { overflow:auto; padding:16px; }
 .modal-body input,.modal-body select { max-width:100%; min-width:0; box-sizing:border-box; }
 .notification-dropdown { top:110px!important; left:18px!important; right:18px!important; width:auto!important; max-width:420px; margin:auto; max-height:55dvh!important; overflow:auto; border-radius:18px; }
 .notification-row { padding:12px!important; gap:9px!important; }
 .notification-row strong { font-size:13px; }
 .notification-row p,.notification-row small { font-size:12px; line-height:1.4; }
 .fees-table.responsive-records tbody tr,.balance-table.responsive-records tbody tr { grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; border:0; border-bottom:1px solid var(--line); border-radius:0; margin:0 12px; padding:14px 0; box-shadow:none; }
 .fees-table.responsive-records tbody td,.balance-table.responsive-records tbody td { display:none; }
 .fees-table.responsive-records tbody td:nth-child(2),.fees-table.responsive-records tbody td:nth-child(4),.fees-table.responsive-records tbody td:nth-child(8),.fees-table.responsive-records tbody td:last-child,
 .balance-table.responsive-records tbody td:nth-child(2),.balance-table.responsive-records tbody td:nth-child(3),.balance-table.responsive-records tbody td:nth-child(7),.balance-table.responsive-records tbody td:last-child { display:block; }
 .fees-table.responsive-records td::before,.balance-table.responsive-records td::before { display:none; }
 .fees-table.responsive-records td:nth-child(2),.balance-table.responsive-records td:nth-child(2) { font-weight:700; grid-column:1; grid-row:1; }
 .fees-table.responsive-records td:nth-child(4),.balance-table.responsive-records td:nth-child(7) { grid-column:2; grid-row:1; font-weight:700; text-align:right; }
 .fees-table.responsive-records td:last-child,.balance-table.responsive-records td:last-child { grid-column:2; grid-row:2; }
 .fees-table .icon-mini,.balance-table .icon-mini { min-width:34px; min-height:36px; border-radius:10px; }
 .students .profile-main { flex-direction:row; flex-wrap:wrap; padding:12px; }
 .students .profile-fields { display:none; }
 .students .student-joined { display:none; }
 .students .profile-id { min-height:26px; font-size:9px; }
 .students .card-foot { border:0; padding-top:0; }
 .finance-strip .money-stack { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
 .finance-strip .money-stack > * { min-width:0; padding:10px; }
 .finance-strip .money-stack h3 { font-size:16px; overflow-wrap:anywhere; }
}

@media screen and (max-width:960px) {
 .finance-strip,.fees-summary-strip { display:grid; grid-template-columns:minmax(0,1fr)!important; min-width:0!important; width:100%; gap:14px; }
 .finance-strip .money-stack,.fees-summary-strip .money-stack { display:grid; grid-template-columns:minmax(0,1fr)!important; gap:8px; }
 .finance-strip .money-card,.fees-summary-strip .money-card { display:flex; min-height:76px; padding:14px; gap:12px; }
 .money-card > div { min-width:0; }
 .finance-strip .money-card h3,.fees-summary-strip .money-card h3 { font-size:21px; overflow-wrap:normal; }
 .finance-progress-grid,.fees-progress-grid { display:grid; grid-template-columns:minmax(0,1fr)!important; gap:8px; min-width:0; }
 .finance-progress-grid .progress-card { padding:14px; border-radius:14px; min-width:0; }
 .progress-card p { margin-top:10px!important; font-size:12px; overflow-wrap:anywhere; }
 .progress-row { gap:12px; font-size:13px; }
 .finance-trend-card .chart,.finance-trend-card .line-chart { height:170px; }
}

/* Collections first: optional analysis never pushes transactions off-screen. */
.finance-insights { margin:16px 0; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.finance-insights > summary { cursor:pointer; padding:14px 16px; font-weight:700; color:var(--green); }
.finance-insights > .stats-strip { padding:12px; margin:0; }
@media screen and (max-width:960px) {
 .finance-insights .money-stack { gap:0; }
 .finance-insights .money-card { border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; min-height:0; padding:10px 4px; }
 .finance-insights .money-card .metric-icon { display:none; }
 .finance-insights .money-card > div { display:flex; flex-direction:row-reverse; align-items:center; justify-content:space-between; width:100%; gap:10px; }
 .finance-insights .money-card h3 { font-size:15px; margin:0; }
 .finance-insights .money-card .muted { font-size:12px; }
 .finance-progress-grid .progress-card { min-height:0!important; height:auto!important; padding:12px!important; border-radius:0; border:0; border-bottom:1px solid var(--line); box-shadow:none; }
 .finance-progress-grid .progress-card .track { height:4px; margin-top:8px; }
 .finance-progress-grid .progress-card p { margin:6px 0 0!important; }
}

.manager-workspace { display:flex; flex-direction:column; gap:14px; }
@media screen and (min-width:961px) {
 .manager-workspace > .page-head { order:0; }
 .manager-workspace > .manager-insights { order:1; border:0; margin:0; background:none; }
 .manager-workspace > .section-panel { order:2; }
 .manager-insights > summary { display:none; }
 .manager-insights > .stats-strip { padding:0; }
}
@media screen and (max-width:960px) {
 .finance-insights .money-stack { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; }
 .finance-insights .money-card { display:block; border:1px solid var(--line); border-radius:14px; padding:12px; }
 .finance-insights .money-card .metric-icon { display:inline-flex; width:28px; height:28px; margin-bottom:8px; }
 .finance-insights .money-card .metric-icon svg { width:18px; height:18px; }
 .finance-insights .money-card > div { display:block; }
 .finance-insights .money-card h3 { font-size:15px; margin-bottom:4px; overflow-wrap:anywhere; }
 .finance-insights .finance-progress-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px; }
 .finance-insights .progress-card { border:1px solid var(--line); border-radius:14px; padding:10px!important; }
 .finance-insights .progress-row { font-size:12px; gap:4px; flex-wrap:wrap; }
 .finance-insights .progress-card p { font-size:10px; }
}
