:root {
  --ink: #0f1c2a;
  --muted: #5b6b7c;
  --paper: #eef2f6;
  --panel: #ffffff;
  --line: #d7dee8;
  --brand: #12365a;
  --brand-deep: #0b243d;
  --brand-soft: #1b4f72;
  --accent: #0f6d6a;
  --warn: #b86a2b;
  --danger: #9b2c2c;
  --shadow: 0 12px 28px rgba(15, 28, 42, 0.08);
  --radius: 14px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "IBM Plex Serif", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

/* Login styles: wwwroot/css/login.css */

.btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 10px;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.alert-error,
.banner-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

/* ---------- App shell ---------- */
.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #e8eef5 0%, var(--paper) 220px);
}

.app-body.has-erp-shell {
  display: block;
  background: #e6ecf3;
}

/* ---- Modern ERP shell ---- */
.erp-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #0b243d 0%, #12365a 48%, #0f3d4d 100%);
  color: #e8eef5;
  box-shadow: 8px 0 28px rgba(11, 36, 61, 0.18);
}

.erp-sidebar-brand {
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.7rem 0.55rem;
}

.erp-brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.erp-brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b6b7c;
  font-weight: 600;
}

.erp-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.7rem 1rem;
}

.erp-nav-label {
  margin: 0.75rem 0.55rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 238, 245, 0.45);
}

.erp-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  margin-bottom: 0.28rem;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(232, 238, 245, 0.88);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.erp-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.erp-nav-item.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}

.erp-nav-item.is-disabled:hover {
  background: transparent;
  color: rgba(232, 238, 245, 0.88);
}

.erp-nav-item.is-active {
  background: rgba(15, 109, 106, 0.28);
  border-color: rgba(125, 211, 196, 0.35);
  color: #fff;
  box-shadow: inset 3px 0 0 #2dd4bf;
}

.erp-nav-ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #c8d8e8;
}

.erp-nav-item.is-active .erp-nav-ico {
  background: rgba(45, 212, 191, 0.18);
  color: #99f6e4;
}

.erp-nav-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  padding-top: 0.05rem;
}

.erp-nav-text strong {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.25;
}

.erp-nav-text em {
  font-style: normal;
  font-size: 0.72rem;
  color: rgba(232, 238, 245, 0.55);
  line-height: 1.3;
}

.erp-nav-item.is-active .erp-nav-text em {
  color: rgba(204, 251, 241, 0.72);
}

/* Collapsible nav group (School Desk) */
.erp-nav-group {
  margin-bottom: 0.28rem;
}

.erp-nav-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  padding-right: 2rem;
}

.erp-nav-toggle .erp-nav-text {
  flex: 1;
}

.erp-nav-chevron {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(232, 238, 245, 0.45);
  transition: transform 0.2s ease;
}

.erp-nav-group.is-open .erp-nav-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.erp-nav-group.has-active-child > .erp-nav-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(125, 211, 196, 0.2);
}

.erp-nav-sub {
  display: none;
  margin: 0.15rem 0 0.35rem 0.45rem;
  padding-left: 0.55rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.erp-nav-group.is-open .erp-nav-sub {
  display: block;
}

.erp-nav-sub-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.15rem;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(232, 238, 245, 0.78);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.erp-nav-sub-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.erp-nav-sub-item.is-active {
  background: rgba(15, 109, 106, 0.22);
  border-color: rgba(125, 211, 196, 0.28);
  color: #fff;
}

.erp-nav-sub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 0.45rem;
  background: rgba(232, 238, 245, 0.35);
  flex-shrink: 0;
}

.erp-nav-sub-item.is-active .erp-nav-sub-dot {
  background: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.erp-nav-sub-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.erp-nav-sub-text strong {
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
}

.erp-nav-sub-text em {
  font-style: normal;
  font-size: 0.68rem;
  color: rgba(232, 238, 245, 0.48);
  line-height: 1.25;
}

.erp-nav-sub-item.is-active .erp-nav-sub-text em {
  color: rgba(204, 251, 241, 0.65);
}

.erp-sidebar-foot {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-sidebar-foot-text {
  font-size: 0.72rem;
  color: rgba(232, 238, 245, 0.4);
}

.erp-frame {
  margin-left: 268px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.15rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(18, 54, 90, 0.03);
}

.erp-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.erp-menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  place-items: center;
  cursor: pointer;
  color: var(--brand-deep);
}

.erp-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.erp-topbar-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.erp-topbar-title strong {
  font-size: 0.98rem;
  color: var(--brand-deep);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.erp-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.erp-user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: #f3f7fb;
  border: 1px solid var(--line);
}

.erp-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.erp-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  padding-right: 0.25rem;
}

.erp-user-meta strong {
  font-size: 0.8rem;
  color: var(--ink);
}

.erp-user-meta em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--muted);
}

.erp-logout {
  font-size: 0.8rem;
  font-weight: 700;
  color: #9b2c2c;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}

.erp-logout:hover {
  background: #fef2f2;
}

.erp-main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.2rem 1.25rem 2.2rem;
}

.erp-footer {
  max-width: none;
  margin: 0;
}

.erp-backdrop {
  display: none;
}

@media (max-width: 980px) {
  .erp-sidebar {
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.erp-nav-open .erp-sidebar {
    transform: translateX(0);
  }

  .erp-frame {
    margin-left: 0;
  }

  .erp-menu-btn {
    display: grid;
  }

  .erp-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(11, 36, 61, 0.42);
  }

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

  .erp-user-meta {
    display: none;
  }
}

.app-header {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(18, 54, 90, 0.04);
}

.app-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-decoration: none;
  line-height: 1.1;
}

.brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(260px, 55vw);
  object-fit: contain;
  background: transparent;
  image-rendering: auto;
}

.login-logo {
  display: block;
  margin: 0 auto 0.85rem;
  height: clamp(56px, 9vw, 72px);
  width: auto;
  max-width: min(360px, 90vw);
  object-fit: contain;
  image-rendering: auto;
}

.brand-mark-sm {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--brand-deep);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.68rem;
  color: #5b6b7c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-user {
  color: #5b6b7c;
  font-size: 0.86rem;
}

.nav-link {
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.84rem;
}

.nav-logout { color: #9b2c2c; }

.module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  flex: 1;
  justify-content: center;
}

.module-nav .nav-link {
  font-size: 0.78rem;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
}

.module-nav .nav-link:hover {
  background: rgba(18, 54, 90, 0.06);
  color: var(--brand-deep);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  width: min(1440px, 100%);
  margin: 0 auto;
  flex: 1;
}

.side-nav {
  padding: 1.25rem 0.9rem 2rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.side-title {
  font-family: var(--display);
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--brand-deep);
}

.side-nav a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.48rem 0.55rem;
  border-radius: 8px;
  margin-bottom: 0.12rem;
}

.side-nav a:hover {
  background: rgba(18, 54, 90, 0.08);
  color: var(--brand);
}

.side-hint {
  margin-top: 1rem;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}

.app-main {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 1.35rem 1.2rem 2.4rem;
}

.app-footer {
  border-top: 1px solid var(--line);
  padding: 0.9rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  background: #fff;
}

/* ---------- Home hero ---------- */
.home-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.4rem;
  padding: 1.4rem 1.35rem;
  border-radius: 16px;
  color: #eef5fb;
  background:
    linear-gradient(135deg, #0b243d 0%, #12365a 55%, #0f6d6a 130%);
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}

.home-hero h1 {
  font-family: var(--display);
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.55rem);
}

.hero-lead {
  margin: 0.55rem 0 0;
  max-width: 46ch;
  color: #d4e2f0;
  line-height: 1.5;
}

.hero-meta {
  margin: 0.7rem 0 0;
  color: #9db4cb;
  font-size: 0.86rem;
}

.home-hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.home-hero-stats div {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.home-hero-stats span {
  display: block;
  color: #9db4cb;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-hero-stats strong {
  font-family: var(--display);
  font-size: 1.55rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.module-grid-one {
  grid-template-columns: repeat(2, minmax(260px, 420px));
}

.module-tile-primary {
  border-color: rgba(18, 54, 90, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
}

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

.home-hero-compact {
  grid-template-columns: 1fr;
  margin-bottom: 1.2rem;
}

.storage-note {
  background: #f5f8fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.storage-note strong {
  display: block;
  color: var(--brand-deep);
  margin-bottom: 0.35rem;
}

.storage-note p { margin: 0.2rem 0; }

.storage-note code {
  background: rgba(18, 54, 90, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.82rem;
  word-break: break-all;
}

.readonly-value {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #f5f8fb;
  font-weight: 600;
  color: var(--brand-deep);
}

.upload-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.15rem 1.25rem;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.upload-grid .field-span { grid-column: 1 / -1; }

.upload-panel select,
.upload-panel input[type="text"],
.upload-panel input[type="file"],
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar input[type="number"],
.filter-bar input:not([type]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
  color: var(--text, #1e293b);
  min-height: 2.65rem;
  box-sizing: border-box;
}

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--brand, #1d4f91);
  box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: end;
  margin-bottom: 0.9rem;
}

.filter-bar .field {
  margin: 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-bar .field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0;
}

.filter-bar .field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
  max-width: 16rem;
  line-height: 1.35;
}

.filter-bar .btn-primary,
.filter-bar .btn-secondary {
  align-self: end;
  margin-bottom: 1px;
}

.btn-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-deep);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.row-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.link-action {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.link-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 860px) {
  .upload-grid { grid-template-columns: 1fr; }
}

.module-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 0.95rem 1.05rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.module-tile:hover {
  transform: translateY(-2px);
  border-color: #9db4cb;
}

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #e8eef5;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.module-tile strong {
  display: block;
  font-size: 1rem;
  color: var(--brand-deep);
}

.module-tile em {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Dashboard blocks ---------- */
.dash-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: #8eb0d0;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.home-hero .eyebrow { color: #8eb0d0; }

.scope { margin: 0.35rem 0 0; color: var(--muted); }
.as-of { color: var(--muted); font-size: 0.85rem; }

.section-block { margin-bottom: 2rem; }

.section-title { margin-bottom: 0.9rem; }

.section-title h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
  color: var(--brand-deep);
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.kpi-grid-6 { grid-template-columns: repeat(6, 1fr); }

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.kpi-note {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.kpi-fee {
  border-color: rgba(18, 54, 90, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
}

.kpi-warn {
  border-color: rgba(184, 106, 43, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #fff8f1 100%);
}

.fee-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fee-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.fee-chip-btn {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.fee-chip-btn:hover,
.fee-chip-btn:focus-visible {
  border-color: rgba(18, 54, 90, 0.35);
  box-shadow: 0 4px 14px rgba(18, 54, 90, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.fee-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.fee-chip strong {
  font-family: var(--display);
  font-size: 1.2rem;
}

.fee-chip.danger {
  border-color: rgba(155, 44, 44, 0.25);
  background: #fff7f7;
}

.fee-chip.danger strong { color: var(--danger); }

.fee-chip-modal[hidden] { display: none !important; }

.fee-chip-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fee-chip-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.fee-chip-modal-box {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.fee-chip-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.fee-chip-modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink, #12365a);
}

.fee-chip-modal-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.fee-chip-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.fee-chip-modal-actions .btn-secondary[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.fee-chip-modal-body {
  padding: 0.75rem 1rem 1.1rem;
  overflow: auto;
}

.fee-chip-table-wrap {
  max-height: min(60vh, 560px);
  overflow: auto;
}

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

.charts-grid .panel-wide:first-child {
  grid-column: 1 / -1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-family: var(--display);
  font-size: 1.1rem;
  margin: 0 0 0.85rem;
  color: var(--brand-deep);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.panel-head p { margin: 0; color: var(--muted); font-size: 0.9rem; }

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.data-table tr.is-active { background: rgba(18, 54, 90, 0.06); }

.empty { text-align: center; color: var(--muted); padding: 1.5rem !important; }

.meter-block { display: grid; gap: 1rem; padding-top: 0.5rem; }
.meter-row { display: grid; gap: 0.35rem; }
.meter-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: #e4ebf3;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
  border-radius: inherit;
}

.meter.female i {
  background: linear-gradient(90deg, var(--accent), #2a9d99);
}

.att-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.att-pill {
  min-width: 120px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  background: #f5f8fb;
}

.att-pill span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.att-pill strong {
  font-family: var(--display);
  font-size: 1.35rem;
}

.att-pill.present { border-color: rgba(18, 54, 90, 0.28); }
.att-pill.absent { border-color: rgba(155, 44, 44, 0.25); background: #fff7f7; }
.att-pill.leave { border-color: rgba(184, 106, 43, 0.25); background: #fff8f1; }

.sso-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.4rem 1.75rem;
  max-width: 760px;
}

.sso-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.sso-meta div {
  background: #f5f8fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.sso-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.sso-steps {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: #fff8f1;
  border: 1px solid rgba(184, 106, 43, 0.2);
}

.sso-steps h2 {
  font-family: var(--display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.sso-steps pre {
  background: #0b243d;
  color: #e8f2ec;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.8rem;
}

.sso-steps code {
  background: rgba(18, 54, 90, 0.1);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  .kpi-grid,
  .kpi-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .fee-strip { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
  }
  .side-title,
  .side-hint { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .charts-grid { grid-template-columns: 1fr; }
  .kpi-grid,
  .kpi-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .charts-grid .panel-wide:first-child { grid-column: auto; }
  .panel-head { flex-direction: column; }
  .sso-meta { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .kpi-grid,
  .kpi-grid-6,
  .fee-strip,
  .module-grid { grid-template-columns: 1fr; }
}

/* ---------- School Analytics (EMIS-style) ---------- */
.sa-breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.sa-breadcrumb span + span::before {
  content: " ";
}

.sa-branch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.sa-branch-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 0.35rem;
  color: var(--brand-deep);
}

.sa-branch-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sa-report-btn {
  width: auto !important;
  padding: 0.65rem 1.1rem !important;
  font-size: 0.88rem !important;
  white-space: nowrap;
}

.sa-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.25rem;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.sa-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sa-filter-wide {
  min-width: 13.5rem;
  flex: 0 1 15rem;
}

.sa-filter-med {
  min-width: 9.5rem;
  flex: 0 1 11rem;
}

.sa-filter-wide .sa-select,
.sa-filter-wide .ss-wrap,
.sa-filter-med .sa-select,
.sa-filter-med .ss-wrap {
  min-width: 100%;
}

.sa-filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sa-select,
.sa-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  min-width: 160px;
  background: #fff;
}

.sa-apply-btn {
  width: auto !important;
  padding: 0.6rem 1.25rem !important;
}

.sa-hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.sa-hero-kpi {
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(11, 36, 61, 0.12);
}

.sa-hero-kpi span {
  display: block;
  font-size: 0.82rem;
  opacity: 0.92;
  margin-bottom: 0.35rem;
}

.sa-hero-kpi strong {
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1;
}

.sa-kpi-green { background: linear-gradient(135deg, #1a7a4a, #0f5c38); }
.sa-kpi-purple { background: linear-gradient(135deg, #6b4c9a, #52387a); }
.sa-kpi-orange { background: linear-gradient(135deg, #d97706, #b45309); }
.sa-kpi-red { background: linear-gradient(135deg, #c53030, #9b2c2c); }

.sa-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.sa-detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.sa-detail-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--brand-deep);
}

.sa-detail-total {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.sa-detail-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.sa-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sa-chart-panel .sa-donut-wrap {
  max-width: 280px;
  margin: 0 auto;
}

.sa-notes-panel h2 {
  margin-bottom: 0.75rem;
}

.sa-notes {
  margin: 0 0 0.85rem;
  line-height: 1.55;
  color: var(--ink);
}

.sa-notes-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.sa-notes-list li {
  margin-bottom: 0.35rem;
}

.sa-finance-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.sa-finance-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.sa-finance-card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.sa-finance-card strong {
  font-size: 1.15rem;
  color: var(--brand-deep);
}

.sa-finance-card.sa-finance-profit strong {
  color: #0f6d6a;
}

.sa-finance-period {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
}

.sa-tb-panel .table-wrap {
  overflow-x: auto;
}

.sa-tb-table {
  font-size: 0.82rem;
}

.sa-tb-table th,
.sa-tb-table td {
  white-space: nowrap;
}

.sa-tb-table .tb-indent,
.tb-sheet .tb-indent {
  padding-left: 1.1rem !important;
  white-space: normal;
}

.tb-sheet .tb-group-row td {
  background: #f3f4f6;
  font-weight: 700;
}

.tb-sheet .tb-total-row td {
  background: #e8eef6;
  border-top: 2px solid #222;
}

.tb-sheet thead th {
  text-align: center;
  background: #e8eef6;
}

.tb-col-code { width: 12%; }
.tb-col-title { width: 52%; }
.tb-col-amt { width: 18%; text-align: right; }

.tb-report .bs-account-link {
  font-weight: 600;
}

.ad-report .ad-account-title {
  margin: 0;
  text-align: center;
  font-size: 1.15rem;
  text-transform: uppercase;
}

.ad-report .ad-account-sub {
  margin: 0.35rem 0 0.75rem;
  text-align: center;
  color: #444;
  font-size: 0.92rem;
}

.ad-sheet .ad-date { font-style: italic; }
.ad-opening-row td { background: #fafafa; }
.ad-opening-text { font-style: italic; }

.acc-report-settings {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.9rem 0.85rem;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.acc-report-settings-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.acc-report-settings .sa-filters {
  margin-bottom: 0;
}

.gl-report {
  background: #fff;
  border: 1px solid #222;
  padding: 0.85rem 1rem 1.1rem;
  margin-top: 0.75rem;
}

.gl-report-head {
  text-align: center;
  margin-bottom: 0.85rem;
}

.gl-report-head h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.gl-report-range {
  margin: 0.35rem 0 0.15rem;
  font-weight: 600;
}

.gl-report-meta {
  margin: 0;
  font-size: 0.88rem;
  color: #444;
}

.gl-account-block {
  margin: 0 0 1.1rem;
  page-break-inside: avoid;
}

.gl-account-bar {
  background: #c5dff0;
  border: 1px solid #222;
  border-bottom: none;
  padding: 0.4rem 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.gl-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.gl-sheet th,
.gl-sheet td {
  border: 1px solid #222;
  padding: 0.28rem 0.45rem;
  vertical-align: top;
}

.gl-sheet thead th {
  background: #e8e8e8;
  font-weight: 700;
  text-align: left;
}

.gl-sheet .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gl-opening td { background: #fafafa; }
.gl-total td {
  font-weight: 700;
  background: #f3f3f3;
}

.exp-report {
  background: #fff;
  border: 1px solid #222;
  padding: 0.85rem 1rem 1.1rem;
  margin-top: 0.75rem;
}

.exp-report-head {
  text-align: center;
  margin-bottom: 0.75rem;
}

.exp-report-head h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.exp-report-head h2 {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: underline;
}

.exp-category-bar {
  background: #d0d0d0;
  border: 1px solid #222;
  padding: 0.35rem 0.55rem;
  font-weight: 700;
  text-align: left;
}

.exp-report-range {
  margin: 0.45rem 0 0;
  font-weight: 600;
  text-align: left;
}

.exp-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.exp-sheet th,
.exp-sheet td {
  border: 1px solid #222;
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}

.exp-sheet thead th {
  font-weight: 700;
  background: #f5f5f5;
}

.exp-sheet .num,
.exp-sheet tfoot .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.exp-sr { width: 3.5rem; }
.exp-particulars { white-space: pre-wrap; }

.fee-register-scroll {
  overflow: auto;
  max-height: min(70vh, 900px);
  border: 1px solid #222;
  margin-top: 0.75rem;
  background: #fff;
}

.fee-register-table {
  width: max-content;
  min-width: 100%;
  font-size: 0.8rem;
}

.fee-register-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.fee-register-table .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

.fee-register-table thead .sticky-col {
  z-index: 3;
  background: #f5f5f5;
}

.fee-register-table .sticky-col-2 {
  left: 3.5rem;
}

@media print {
  .fee-register-scroll {
    max-height: none;
    overflow: visible;
    border: none;
  }
}

.sd-report {
  background: #fff;
  border: 1px solid #222;
  padding: 0.85rem 1rem 1.2rem;
  margin-top: 0.75rem;
  max-width: 920px;
}

.sd-report-head {
  text-align: center;
  margin-bottom: 0.85rem;
}

.sd-report-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.sd-branch {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #12365a;
}

.sd-report-head h1 {
  margin: 0 0 0.55rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sd-date-box {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #222;
  padding: 0.4rem 0.65rem;
  font-weight: 600;
}

.sd-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.sd-sheet th,
.sd-sheet td {
  border-bottom: 1px solid #333;
  padding: 0.35rem 0.45rem;
  vertical-align: top;
}

.sd-sheet thead th {
  border-bottom: 2px solid #222;
  text-align: left;
}

.sd-sheet .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 18%;
}

.sd-indent { padding-left: 1.5rem !important; }

.sd-section-row td {
  border-top: 2px solid #222;
  padding-top: 0.55rem;
}

.sd-total-row td,
.sd-net-row td {
  border-top: 1px solid #222;
  border-bottom: 2px solid #222;
  background: #fafafa;
}

@media print {
  .gl-report,
  .exp-report,
  .sd-report {
    border: none;
    padding: 0;
    max-width: none;
  }

  .gl-account-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .exp-category-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.vd-report {
  background: #fff;
  border: 1px solid #222;
  padding: 1rem 1.1rem 1.4rem;
  margin-top: 0.75rem;
  max-width: 960px;
}

.vd-report-head { text-align: center; margin-bottom: 0.85rem; }

.vd-report-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin-bottom: 0.35rem;
}

.vd-report-brand em {
  font-style: normal;
  font-weight: 600;
  font-size: 0.9rem;
}

.vd-report-org { margin: 0; font-weight: 700; }

.vd-report-head h1 {
  margin: 0.4rem 0;
  font-size: 1.35rem;
}

.vd-report-school { margin: 0 0 0.65rem; font-size: 0.95rem; }

.vd-report-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  font-size: 0.92rem;
}

.vd-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.vd-sheet th,
.vd-sheet td {
  border: 1px solid #555;
  padding: 0.35rem 0.45rem;
  vertical-align: top;
}

.vd-sheet thead th,
.vd-sheet tfoot th {
  background: #e8eef6;
  text-align: left;
}

.vd-sheet .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vd-sign-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  text-align: center;
  font-weight: 600;
}

@media print {
  .vd-report { border: none; margin: 0; max-width: none; }
}

@media (max-width: 1100px) {
  .sa-hero-kpis,
  .sa-detail-grid,
  .sa-finance-strip { grid-template-columns: repeat(2, 1fr); }
  .sa-mid-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sa-hero-kpis,
  .sa-detail-grid,
  .sa-finance-strip { grid-template-columns: 1fr; }
  .sa-filters { flex-direction: column; align-items: stretch; }
  .sa-select, .sa-input { min-width: 0; width: 100%; }
}

.sa-branch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.sa-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0.55rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(18, 54, 90, 0.06);
}

.sa-cat-link {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--brand-deep);
  text-decoration: none;
  border: 1px solid transparent;
}

.sa-cat-link:hover {
  background: rgba(18, 54, 90, 0.06);
}

.sa-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  position: sticky;
  top: 0.4rem;
  z-index: 25;
  box-shadow: 0 4px 16px rgba(18, 54, 90, 0.06);
}

.sa-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--brand-deep);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.sa-tab:hover { background: rgba(18, 54, 90, 0.06); }

.sa-tab.is-active {
  background: var(--brand-deep);
  color: #fff;
}

.sa-tab-panel {
  display: none;
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.15rem 1.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow);
}

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

.sa-chart-box {
  position: relative;
  width: 100%;
  height: 220px;
}

.sa-chart-box-tall { height: 280px; }

.sa-chart-box-donut {
  height: 240px;
  max-width: 280px;
  margin: 0 auto;
}

.sa-chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.sa-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  line-height: 1.45;
}

.sa-alert-danger {
  background: #fff5f5;
  border-color: rgba(155, 44, 44, 0.25);
  color: #7a1f1f;
}

.sa-alert-warn {
  background: #fff8f0;
  border-color: rgba(184, 106, 43, 0.28);
  color: #7a4a18;
}

.sa-alert-ok {
  background: #f3faf7;
  border-color: rgba(15, 109, 106, 0.22);
  color: #0f4f4d;
}

.sa-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.sa-pill-danger { background: #fde8e8; color: #9b2c2c; }
.sa-pill-warn { background: #fff0e0; color: #b86a2b; }
.sa-pill-muted { background: rgba(18, 54, 90, 0.08); color: #12365a; }

.sa-row-danger { background: #fff7f7; }
.sa-row-warn { background: #fffaf4; }

.sa-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sa-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(18, 54, 90, 0.15);
  border-top-color: var(--brand-deep);
  border-radius: 50%;
  animation: sa-spin 0.7s linear infinite;
}

@keyframes sa-spin { to { transform: rotate(360deg); } }

.sa-category {
  margin-bottom: 2rem;
  padding: 1.15rem 1.15rem 1.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow);
  scroll-margin-top: 4rem;
}

.sa-cat-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.sa-cat-badge {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-deep), #1a4d7a);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sa-cat-badge-students { background: linear-gradient(135deg, #d97706, #b45309); }
.sa-cat-badge-hr { background: linear-gradient(135deg, #1a7a4a, #0f5c38); }
.sa-cat-badge-finance { background: linear-gradient(135deg, #0f6d6a, #0b5552); }
.sa-cat-badge-fees { background: linear-gradient(135deg, #b86a2b, #8f4f1a); }

.sa-cat-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-deep);
  font-family: var(--font-serif, "IBM Plex Serif", Georgia, serif);
}

.sa-cat-sub {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.sa-cat-subhead {
  margin: 1.25rem 0 0.65rem;
}

.sa-cat-subhead h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--brand-deep);
}

.sa-cat-subhead p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.mom-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.mom-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.mom-head .btn-primary,
.mom-head .btn-secondary {
  width: auto;
  margin-top: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mom-add-btn { white-space: nowrap; }

.mom-hint {
  background: #eff8f3;
  border: 1px solid #cce8d8;
  color: #14532d;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.mom-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.mom-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.mom-tab.is-active {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.mom-filters { margin-bottom: 0.85rem; }

.mom-panel { margin-bottom: 0.85rem; }

.mom-panel-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.mom-panel-title {
  margin: 0;
  padding: 0.85rem 1rem 0;
  font-size: 1rem;
  font-weight: 650;
}

.mom-chip {
  display: inline-flex;
  align-items: center;
  background: #eff4ff;
  color: #3538cd;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.mom-scope-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.mom-table { font-size: 0.84rem; }

.mom-link {
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration: none;
}

.mom-link:hover { text-decoration: underline; }

.mom-back {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--brand-deep);
  text-decoration: none;
}

.mom-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem 1rem;
  font-size: 0.84rem;
}

@media (min-width: 768px) {
  .mom-meta-grid { grid-template-columns: repeat(3, 1fr); }
}

.mom-meta-grid dt {
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
}

.mom-meta-grid dd {
  margin: 0 0 0.35rem;
}

.mom-description {
  padding: 0 1rem 1rem;
  font-size: 0.84rem;
}

.mom-description p {
  white-space: pre-wrap;
  margin: 0.35rem 0 0;
}

.mom-pre {
  white-space: pre-wrap;
  font-size: 0.84rem;
}

.mom-empty {
  padding: 0.85rem 1rem 1rem;
  color: var(--text-muted);
  margin: 0;
}

.mom-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0.85rem 1rem 1rem;
}

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

.mom-agenda-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin: 0 1rem 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.mom-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .mom-form-grid { grid-template-columns: 1fr; }
}

/* MoM create form — professional layout */
.mom-create-shell {
  max-width: 920px;
  margin: 0 auto 1.5rem;
}

.mom-create-hero {
  margin-bottom: 1.1rem;
}

.mom-create-title {
  font-family: var(--font-serif, "IBM Plex Serif", Georgia, serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin: 0.35rem 0 0.45rem;
}

.mom-create-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.mom-school-badge {
  display: inline-block;
  background: rgba(18, 54, 90, 0.08);
  color: var(--brand-deep);
  font-weight: 650;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}

.mom-create-section {
  background: var(--panel, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

.mom-section-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.mom-section-num {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-deep), #1a4d7a);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mom-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--brand-deep);
}

.mom-section-head p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.mom-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.mom-field-span2 { grid-column: span 2; }

.mom-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.mom-field .req { color: #c53030; }

.mom-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

.mom-required {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #b00020;
}

.acc-class-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.acc-class-row select,
.acc-class-row input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
}

.acc-add-class {
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.acc-class-modal .acc-class-modal-box {
  min-width: min(720px, 94vw);
  max-width: 94vw;
  max-height: 90vh;
  overflow: auto;
  text-align: left;
  padding: 1.1rem 1.25rem 1.2rem;
}

.acc-class-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.acc-class-modal-head h3 {
  margin: 0;
}

.acc-class-modal-head .acad-modal-close {
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
}

.acc-class-modal-form {
  margin: 0;
}

.acc-class-list-wrap {
  margin-top: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.acc-class-list-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.acc-class-table {
  width: 100%;
  font-size: 0.85rem;
}

.acc-class-table th,
.acc-class-table td {
  padding: 0.4rem 0.45rem;
  vertical-align: top;
}

.mom-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.72rem 0.82rem;
  font: inherit;
  background: #fff;
  color: var(--text, #1e293b);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mom-control:focus {
  outline: none;
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 3px rgba(18, 54, 90, 0.12);
}

textarea.mom-control { resize: vertical; min-height: 2.5rem; }

.mom-agenda-list {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.mom-agenda-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fafbfd;
}

.mom-agenda-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.mom-remove-row {
  border: none;
  background: transparent;
  color: #c53030;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
}

.mom-add-agenda { margin-top: 0.15rem; }

.mom-dropzone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.mom-dropzone.is-dragover {
  border-color: var(--brand-deep);
  background: #eff6ff;
}

.mom-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.mom-dropzone-inner {
  pointer-events: none;
  text-align: center;
  padding: 1.5rem 1rem;
}

.mom-dropzone-icon { font-size: 1.6rem; margin-bottom: 0.35rem; }

.mom-dropzone-title {
  margin: 0;
  font-weight: 650;
  color: var(--brand-deep);
  font-size: 0.95rem;
}

.mom-dropzone-hint {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.mom-file-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.mom-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: #fff;
  font-size: 0.84rem;
}

.mom-file-name { font-weight: 600; color: var(--brand-deep); }

.mom-file-size { color: var(--muted); white-space: nowrap; }

.mom-create-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0.25rem 0 0.5rem;
}

.mom-save-btn {
  min-width: 9rem;
  padding: 0.78rem 1.25rem;
}

.mom-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 1rem 1rem;
  display: grid;
  gap: 0.55rem;
}

.mom-attachment-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  background: #fafbfd;
}

.mom-attachment-name {
  display: block;
  font-weight: 650;
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.mom-attachment-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.mom-download-btn {
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
}

.btn-danger {
  border: 1px solid #c53030;
  background: #fff5f5;
  color: #c53030;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mom-delete-btn { margin-left: auto; }

.mom-staff-quick {
  margin-bottom: 0.85rem;
}

.mom-staff-quick label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.mom-staff-quick-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.mom-attendee-table-wrap { margin-bottom: 0.65rem; }

.mom-attendee-table { font-size: 0.84rem; }

.mom-attendee-table .mom-control {
  padding: 0.55rem 0.65rem;
  font-size: 0.84rem;
}

.mom-row-action { width: 5.5rem; text-align: right; white-space: nowrap; }

.mom-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}

.mom-status-badge.is-draft {
  background: #fff7ed;
  color: #c2410c;
}

.mom-status-badge.is-submitted {
  background: #ecfdf5;
  color: #047857;
}

.mom-status-draft {
  color: #c2410c;
  font-weight: 650;
}

.mom-inline-form { display: inline; }

@media (max-width: 820px) {
  .mom-create-grid { grid-template-columns: 1fr 1fr; }
  .mom-field-span2 { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .mom-create-grid { grid-template-columns: 1fr; }
  .mom-field-span2 { grid-column: auto; }
}

/* ---------- Academics / Student Management ---------- */
.acad-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 1.25rem;
  align-items: start;
}

.acad-section {
  margin-bottom: 1.35rem;
}

.acad-section h2 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--brand-deep);
}

.acad-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.65rem;
}

.acad-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.5rem 0.75rem;
  min-height: 112px;
  cursor: pointer;
  font: inherit;
  width: 100%;
  box-shadow: 0 1px 0 rgba(18, 54, 90, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.acad-tile:hover {
  border-color: #9eb4cc;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.acad-tile em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.acad-tile-legacy {
  opacity: 0.95;
}

.acad-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e8eef5, #d5e0ec);
  position: relative;
}

.acad-icon-new::after,
.acad-icon-search::after,
.acad-icon-shift::after,
.acad-icon-doc::after,
.acad-icon-report::after,
.acad-icon-users::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 3px;
  background: var(--brand-soft);
  opacity: 0.85;
}

.acad-icon-new { background: linear-gradient(145deg, #d8f3e4, #b7e4cb); }
.acad-icon-new::after { border-radius: 50%; }
.acad-icon-report { background: linear-gradient(145deg, #fde8d2, #f5d0a8); }
.acad-icon-users { background: linear-gradient(145deg, #dde8f7, #c2d4ef); }

.acad-hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.pa-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.pa-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.pa-kpi-warn {
  border-color: #e2b56b;
}

.pa-kpi-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.pa-kpi-value {
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
  font-family: var(--display);
  color: #111;
}

.pa-kpi-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

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

.pa-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  box-shadow: var(--shadow);
}

.pa-panel h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--display);
}

.pa-panel-meta {
  margin: 0.25rem 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.pa-section {
  margin: 1.35rem 0 1.75rem;
}

.pa-section-title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-family: var(--display);
  color: #111;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.pa-subhead {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}

.pa-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pa-tag.is-fail {
  background: #fde8e8;
  color: #b00020;
}

.pa-tag.is-warn {
  background: #fff4e0;
  color: #8a5a00;
}

.pa-row-fail td {
  background: #fff7f7;
}

.pa-row-warn td {
  background: #fffaf0;
}

.pa-row-outlier td {
  background: #f3f7ff;
  font-weight: 600;
}

.pa-delta-down { color: #b00020; font-weight: 700; }
.pa-delta-up { color: #0b6b3a; font-weight: 700; }

@media (max-width: 960px) {
  .pa-kpis,
  .pa-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .pa-kpis,
  .pa-grid {
    break-inside: avoid;
  }

  .pa-kpi,
  .pa-panel {
    box-shadow: none;
  }
}

.acc-report-print-head {
  margin: 0 0 0.85rem;
  text-align: center;
}

.acc-report-print-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #12365a;
}

.acc-report-print-head p {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.bs-report {
  background: #fff;
  border: 1px solid #222;
  padding: 0.85rem 1rem 1.1rem;
  margin-top: 0.75rem;
}

.bs-report-head {
  margin-bottom: 0.65rem;
}

.bs-report-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.bs-report-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.bs-report-school {
  font-style: normal;
  font-size: 1rem;
  color: #12365a;
  font-weight: 700;
  text-align: center;
}

.bs-report-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.bs-report-title-row h2 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.bs-report-title-row time {
  font-size: 0.92rem;
  white-space: nowrap;
}

.bs-report-asof {
  margin-top: 0.55rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #222;
  font-weight: 700;
  text-align: center;
}

.bs-report-branch {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.bs-report-scroll {
  overflow-x: auto;
}

.bs-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.bs-sheet td {
  border: 1px solid #222;
  padding: 0.28rem 0.45rem;
  vertical-align: top;
}

.bs-col-desc { width: 52%; }
.bs-col-amt { width: 16%; }

.bs-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bs-indent {
  padding-left: 1.25rem !important;
}

.bs-section-row td,
.bs-group-row td {
  background: #f7f7f7;
}

.bs-section-total-row td,
.bs-group-total-row td {
  background: #fafafa;
}

.bs-account-link {
  color: #0b57d0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bs-account-link:hover {
  color: #0842a0;
}

@media print {
  .acc-report-print-head {
    margin-bottom: 0.75rem;
  }

  .acc-report-print-head p {
    color: #333;
  }

  .bs-report {
    border: none;
    padding: 0;
  }

  .bs-account-link {
    color: #000 !important;
    text-decoration: none;
  }
}

.acad-side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: var(--shadow);
}

.acad-side h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
}

.acad-side-meta,
.acad-empty {
  margin: 0.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.acad-chart-wrap {
  height: 280px;
  position: relative;
}

.acad-filters {
  margin-bottom: 0.75rem;
}

.acad-filters-alt {
  background: #f7fafc;
}

.acad-filter-grow {
  flex: 1 1 240px;
  min-width: 200px;
}

.sa-filter-actions {
  align-self: flex-end;
}

.sa-apply-alt {
  background: linear-gradient(135deg, #8b3a3a, #6b2a2a);
}

.acad-result-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.acad-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
}

.acad-status.is-on {
  background: #ecfdf5;
  color: #047857;
}

.acad-status.is-off {
  background: #fef2f2;
  color: #b91c1c;
}

.acad-actions {
  white-space: nowrap;
}

.acad-link {
  color: var(--brand-soft);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  margin-right: 0.45rem;
}

.acad-link:hover { text-decoration: underline; }

/* ---- Modern sticky student grid ---- */
.stu-grid-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stu-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}

.stu-grid-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.stu-grid-scroll {
  overflow-x: auto;
  max-height: min(68vh, 780px);
  overflow-y: auto;
  position: relative;
  background:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), #fff 70%) 100% 0,
    linear-gradient(to right, rgba(15, 28, 42, 0.08), transparent 40%),
    linear-gradient(to left, rgba(15, 28, 42, 0.1), transparent 40%) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 18px 100%, 22px 100%;
  background-attachment: local, local, scroll, scroll;
}

.stu-grid {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.stu-grid th,
.stu-grid td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  background: #fff;
}

.stu-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef3f8;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--line);
}

.stu-grid tbody tr:hover td {
  background: #f5f9fc;
}

.stu-col-status {
  width: 7.5rem;
  position: sticky;
  left: 0;
  z-index: 2;
}

.stu-grid thead .stu-col-status { z-index: 4; }

.stu-col-name {
  min-width: 12rem;
  position: sticky;
  left: 7.5rem;
  z-index: 2;
  box-shadow: 4px 0 10px -8px rgba(15, 28, 42, 0.35);
}

.stu-grid thead .stu-col-name { z-index: 4; }

.stu-col-actions {
  width: 8.5rem;
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -6px 0 12px -8px rgba(15, 28, 42, 0.4);
  text-align: right;
}

.stu-grid thead .stu-col-actions {
  z-index: 4;
  text-align: right;
}

.stu-grid tbody .stu-col-status,
.stu-grid tbody .stu-col-name,
.stu-grid tbody .stu-col-actions {
  background: #fff;
}

.stu-grid tbody tr:hover .stu-col-status,
.stu-grid tbody tr:hover .stu-col-name,
.stu-grid tbody tr:hover .stu-col-actions {
  background: #f5f9fc;
}

.stu-name {
  font-weight: 700;
  color: var(--brand-deep);
  line-height: 1.3;
}

.stu-meta,
.stu-contact,
.stu-ids,
.stu-class {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stu-meta span,
.stu-contact em,
.stu-ids span,
.stu-class span {
  font-size: 0.74rem;
  color: var(--muted);
  font-style: normal;
}

.stu-class strong {
  color: var(--ink);
  font-weight: 650;
}

.stu-muted { color: var(--muted); font-size: 0.78rem; }

.stu-ids kbd {
  display: inline-block;
  min-width: 1rem;
  font: 700 0.62rem/1 var(--font);
  color: #fff;
  background: var(--brand-soft);
  border-radius: 3px;
  padding: 0.12rem 0.28rem;
  margin-right: 0.2rem;
}

.stu-orphan-pill {
  display: inline-block;
  margin-top: 0.28rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #9a3412;
  background: #ffedd5;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

.stu-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}

.stu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-deep);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.stu-btn:hover {
  border-color: #9eb4cc;
  background: #f3f7fb;
}

.stu-btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-color: transparent;
  color: #fff;
}

.stu-btn-primary:hover {
  filter: brightness(1.06);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
}

.stu-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem !important;
}

@media (max-width: 720px) {
  .stu-col-status,
  .stu-col-name {
    position: static;
    box-shadow: none;
    left: auto;
  }

  .stu-col-actions {
    /* keep Edit pinned on mobile horizontal scroll */
    min-width: 5.5rem;
  }

  .stu-grid { min-width: 720px; }
}

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

.acad-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}

.acad-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 42, 0.45);
}

.acad-modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 1.35rem 1.5rem 1.1rem;
  min-width: min(320px, 92vw);
  text-align: center;
  box-shadow: 0 18px 40px rgba(15, 28, 42, 0.22);
}

.acad-modal-box h3 {
  margin: 0 0 1rem;
  font-family: var(--display);
}

.acad-modal-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.acad-modal-btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.acad-modal-orphan { background: #2f8f4e; }
.acad-modal-nonorphan { background: #1f6fb2; }
.acad-modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

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

/* ---------- Admission forms / orphan wizard ---------- */
.adm-wizard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.adm-info-banner {
  background: linear-gradient(135deg, rgba(18, 54, 90, 0.08), rgba(15, 109, 106, 0.1));
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand-deep);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.adm-steps {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.25rem 0.6rem;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.4rem;
  overflow-x: auto;
}

.adm-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--muted);
  position: relative;
  min-width: 4.5rem;
}

.adm-step-num {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.adm-step-label {
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
}

.adm-step.is-active {
  color: var(--brand);
}

.adm-step.is-active .adm-step-num {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(18, 54, 90, 0.25);
}

.adm-step.is-done {
  color: var(--accent);
}

.adm-step.is-done .adm-step-num {
  border-color: var(--accent);
  background: rgba(15, 109, 106, 0.12);
  color: var(--accent);
}

.adm-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem 1.1rem;
}

.adm-section-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--brand-deep);
}

.adm-panel .adm-section-title + .adm-section-title,
.adm-panel .adm-form-grid + .adm-section-title {
  margin-top: 1.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.adm-hint {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.adm-subsection {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.adm-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.adm-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.adm-field .req {
  color: var(--danger);
}

.adm-field .sa-input,
.adm-field .sa-select {
  width: 100%;
  min-width: 0;
}

.adm-field-span2 {
  grid-column: 1 / -1;
}

.adm-check label,
label.adm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}

.adm-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.adm-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.adm-form-actions .btn-primary,
.adm-form-actions .btn-secondary {
  width: auto;
  margin-top: 0;
  min-width: 8.5rem;
  text-decoration: none;
}

.adm-step-panel.is-hidden {
  display: none;
}

.is-hidden-cond {
  display: none !important;
}

.adm-success-badge {
  display: inline-block;
  background: rgba(15, 109, 106, 0.12);
  color: var(--accent);
  border: 1px solid rgba(15, 109, 106, 0.28);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.adm-success-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0 0 0.5rem;
}

.adm-success-meta dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.adm-success-meta dd {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-deep);
}

@media (max-width: 900px) {
  .adm-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .adm-form-grid {
    grid-template-columns: 1fr;
  }

  .adm-field-span2 {
    grid-column: auto;
  }

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

  .adm-form-actions {
    justify-content: stretch;
  }

  .adm-form-actions .btn-primary,
  .adm-form-actions .btn-secondary {
    flex: 1 1 auto;
    text-align: center;
  }

  .adm-success-meta {
    grid-template-columns: 1fr;
  }
}

/* Student edit page */
.banner-success {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 109, 106, 0.35);
  background: rgba(15, 109, 106, 0.08);
  color: var(--brand-deep);
}

.stu-edit-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.stu-edit-badge-orphan {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(180, 120, 20, 0.15);
  color: #8a5a00;
}

.stu-edit-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.stu-edit-photo {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--shadow);
}

.stu-edit-photo-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-muted);
}

.stu-edit-photo-form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.45rem;
}

.stu-edit-photo-label input[type="file"] {
  display: block;
  width: 100%;
  font-size: 0.78rem;
}

.stu-edit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.stu-edit-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.stu-edit-tab.active,
.stu-edit-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(15, 109, 106, 0.08);
}

.stu-edit-panel {
  margin-top: 0;
}

.stu-edit-muted {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.stu-edit-sessions {
  min-width: 640px;
}

.stu-edit-admit-row {
  margin-top: 0.75rem;
}

.stu-edit-login-grid {
  margin-bottom: 0.5rem;
}

.stu-edit-login-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.stu-edit-session-form {
  padding: 0.35rem 0;
}

.stu-edit-session-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.stu-edit-session-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.stu-edit-session-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stu-edit-row-editing td {
  background: rgba(15, 109, 106, 0.06);
}

.stu-edit-sessions .stu-col-actions {
  position: sticky;
  right: 0;
  background: var(--panel);
  white-space: nowrap;
}

.stu-edit-sessions thead .stu-col-actions {
  z-index: 2;
}

.adm-form-actions-inline {
  margin: 0 0 1rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .stu-edit-layout {
    grid-template-columns: 1fr;
  }

  .stu-edit-photo {
    max-width: 180px;
  }
}

.stu-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Searchable selects (portal-wide) */
.ss-wrap {
  position: relative;
  width: 100%;
}

.ss-native {
  position: absolute !important;
  left: 0;
  bottom: 0;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.ss-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ss-trigger:focus {
  outline: 2px solid rgba(15, 109, 106, 0.35);
  outline-offset: 1px;
}

.ss-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-trigger-label.is-placeholder {
  color: var(--muted);
}

.ss-chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
}

.ss-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  min-width: 100%;
  width: max-content;
  max-width: min(18rem, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
}

.ss-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  margin-bottom: 0.35rem;
}

.ss-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.ss-option {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.ss-option:hover,
.ss-option.is-active {
  background: rgba(15, 109, 106, 0.1);
}

.ss-option.is-selected {
  font-weight: 600;
  color: var(--accent);
}

.ss-empty {
  padding: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---- Fee module ---- */
.fee-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.fee-create-grid .stu-grid-scroll {
  overflow-x: visible;
  max-height: none;
  background: none;
}

.fee-create-grid .fee-student-scroll {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
}

.fee-create-grid .stu-grid {
  min-width: 0;
  width: 100%;
}

.fee-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.fee-check-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.fee-col-check { width: 2.5rem; text-align: center; }

.fee-student-scroll { max-height: 420px; }

.fee-duration-panel { margin-bottom: 1.5rem; }

.fee-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.fee-detail-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fee-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fee-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.fee-summary-item span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fee-summary-item strong {
  font-size: 0.95rem;
  color: var(--brand-deep);
}

.fee-summary-highlight {
  background: rgba(15, 109, 106, 0.08);
  border-color: rgba(15, 109, 106, 0.25);
}

.fee-breakdown-total td {
  border-top: 2px solid var(--line);
  padding-top: 0.65rem;
}

.fee-add-line {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.fee-add-line-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.fee-add-line-form .adm-field {
  flex: 1 1 160px;
  min-width: 140px;
}

.stu-btn-danger {
  color: #b00020;
  border-color: rgba(176, 0, 32, 0.35);
}

.stu-btn-danger:hover {
  background: rgba(176, 0, 32, 0.08);
}

.fee-summary-edit {
  grid-column: 1 / -1;
}

.fee-discount-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.fee-discount-edit-form .sa-input {
  max-width: 12rem;
}

.fee-discount-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.fee-discount-edit-actions .btn-primary,
.fee-discount-edit-actions .btn-secondary {
  width: auto;
  margin-top: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.86rem;
}

.fee-quick-steps {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .fee-create-grid,
  .fee-detail-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Fee voucher print ---------- */
.print-body {
  margin: 0;
  background: #e8ecf1;
  color: var(--ink);
}

.print-toolbar {
  max-width: 920px;
  margin: 1rem auto;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.print-note-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.print-note-form textarea {
  width: 100%;
  min-height: 4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
}

.print-toolbar-actions,
.fee-print-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.fee-print-toolbar-actions .btn-primary,
.fee-print-toolbar-actions .btn-secondary,
.print-toolbar-actions .btn-primary,
.print-toolbar-actions .btn-secondary {
  width: auto;
  margin-top: 0;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}

.fee-print-batch {
  max-width: 297mm;
  margin: 0 auto 1rem;
}

.fee-print-page {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  page-break-after: always;
  break-after: page;
}

.fee-print-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

.fee-print-copies {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
  min-height: 0;
}

.fee-print-watermark {
  position: absolute;
  inset: 18% 4% 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(15, 61, 145, 0.10);
  transform: rotate(-28deg);
  pointer-events: none;
  z-index: 0;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.02em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.fee-print-copy > *:not(.fee-print-watermark) {
  position: relative;
  z-index: 1;
}

.fee-print-history-panel {
  gap: 0.35rem;
}

.fee-print-history-empty {
  margin: 0.5rem 0 0;
  font-size: 0.65rem;
  color: #555;
  font-weight: 600;
}

.fee-print-history-student {
  font-size: 0.58rem;
  width: 100%;
}

.fee-print-history-student th {
  background: #e8eef8;
  font-weight: 700;
  text-align: left;
  padding: 0.15rem 0.2rem;
  color: #111;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.fee-print-history-student th.fee-print-num,
.fee-print-history-student td.fee-print-num {
  text-align: right;
}

.fee-print-history-student td {
  padding: 0.12rem 0.2rem;
  line-height: 1.2;
  color: #111;
  font-weight: 600;
}

.fee-print-copy-wrap {
  min-width: 0;
  padding: 0 0.3rem;
}

.fee-print-copy-wrap:first-child {
  padding-left: 0;
}

.fee-print-copy-wrap:last-child {
  padding-right: 0;
}

.fee-print-cut-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 1.15rem;
  align-self: stretch;
  min-height: 120mm;
  padding: 0.35rem 0;
  margin: 0 0.1rem;
  border-left: 2px dashed #0b3d91;
  border-right: 2px dashed #0b3d91;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 5px,
      rgba(11, 61, 145, 0.08) 5px,
      rgba(11, 61, 145, 0.08) 6px
    );
  color: #0b3d91;
  font-size: 0.72rem;
  font-weight: 800;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.fee-print-cut-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.fee-print-cut-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.18em;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fee-print-copy {
  position: relative;
  overflow: hidden;
  padding: 0.15rem 0.1rem;
  color: #111;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.fee-print-copy-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  border-bottom: 1.5px solid #0b3d91;
  padding-bottom: 0.3rem;
}

.fee-print-logo-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.fee-print-logo {
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.fee-print-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.fee-print-brand-text {
  min-width: 0;
}

.fee-print-brand-text strong {
  display: block;
  font-size: 0.78rem;
  color: #0b3d91;
  font-weight: 700;
  line-height: 1.2;
}

.fee-print-brand-text span {
  color: #222;
  font-size: 0.62rem;
  font-weight: 600;
}

.fee-print-brand-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.fee-print-brand-inline strong {
  display: block;
  font-size: 0.78rem;
  color: #0b3d91;
  font-weight: 700;
  line-height: 1.2;
}

.fee-print-brand-inline span {
  color: #222;
  font-size: 0.62rem;
  font-weight: 600;
}

.fee-print-copy-label {
  font-weight: 800;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0b3d91;
  text-align: center;
  white-space: nowrap;
  padding: 0.18rem 0.4rem;
  border: 1.5px solid #0b3d91;
  border-radius: 4px;
  flex-shrink: 0;
}

.fee-print-voucher-no {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.28rem 0.2rem;
  background: #f3f7fc;
  border: 1.5px solid #0b3d91;
  border-radius: 4px;
  text-align: center;
}

.fee-print-voucher-no span {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #0b3d91;
}

.fee-print-voucher-no b {
  font-size: 1.15rem;
  line-height: 1.15;
  font-weight: 800;
  color: #000;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.fee-print-bank-inline {
  font-size: 0.62rem;
  color: #111;
  font-weight: 600;
  line-height: 1.25;
}

.fee-print-bank-inline span {
  display: block;
  color: #111;
}

.fee-print-scan {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.4rem;
  border: 1.5px dashed #0b3d91;
  border-radius: 4px;
  background: #fff;
}

.fee-print-qr {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  padding: 4px;
  background: #fff;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fee-print-scan-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  font-size: 0.62rem;
  line-height: 1.25;
  color: #111;
  font-weight: 600;
}

.fee-print-scan-text strong {
  color: #0b3d91;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fee-print-meta-grid,
.fee-print-student-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 0.45rem;
  font-size: 0.68rem;
  color: #111;
}

.fee-print-meta-grid span,
.fee-print-student-grid span {
  display: block;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  font-weight: 700;
}

.fee-print-meta-grid b,
.fee-print-student-grid b {
  color: #000;
  font-weight: 800;
  word-break: break-word;
}

.fee-print-student-name {
  grid-column: 1 / -1;
}

.fee-print-fees {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  margin-top: auto;
}

.fee-print-table-compact {
  width: 100%;
}

.fee-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  color: #111;
}

.fee-print-table th,
.fee-print-table td {
  border: 1px solid #555;
  padding: 0.22rem 0.35rem;
  color: #111;
  font-weight: 600;
}

.fee-print-num {
  text-align: right;
  white-space: nowrap;
  color: #000;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fee-print-total td {
  background: #e8eef8;
  color: #000;
  font-weight: 800;
}

.fee-print-default {
  font-size: 0.68rem;
  color: #b00020;
  font-weight: 700;
  text-align: center;
}

.fee-print-shared {
  margin-top: 0.55rem;
  padding-top: 0.4rem;
  border-top: 1px solid #555;
  color: #111;
}

.fee-print-shared-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fee-print-history-inline {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: #111;
}

.fee-print-history-inline th {
  background: #e8eef8;
  text-align: center;
  font-weight: 700;
  color: #111;
  padding: 0.18rem 0.28rem;
}

.fee-print-history-inline td {
  text-align: center;
  padding: 0.18rem 0.28rem;
  color: #111;
  font-weight: 600;
}

.fee-print-history-inline .fee-print-hist-label {
  text-align: left;
  font-weight: 700;
  background: #f3f6fb;
  white-space: nowrap;
  padding-left: 0.35rem;
}

.fee-print-hist-totals {
  margin-top: 0.15rem;
  font-size: 0.58rem;
  font-weight: 600;
  color: #111;
}

.fee-print-note-inline {
  font-size: 0.72rem;
  padding: 0.25rem 0;
  color: #111;
  font-weight: 600;
}

.fee-print-page-foot {
  margin-top: 0.35rem;
  font-size: 0.62rem;
  color: #222;
  font-weight: 600;
  text-align: center;
}

@media print {
  .no-print,
  .print-toolbar {
    display: none !important;
  }

  html, body, .print-body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .fee-print-copy,
  .fee-print-bank-inline,
  .fee-print-bank-inline span,
  .fee-print-brand-inline span,
  .fee-print-scan-text,
  .fee-print-table,
  .fee-print-table td,
  .fee-print-table th,
  .fee-print-shared,
  .fee-print-shared-label,
  .fee-print-page-foot,
  .fee-print-note-inline,
  .fee-print-meta-grid,
  .fee-print-student-grid {
    color: #111 !important;
  }

  .fee-print-brand-inline strong,
  .fee-print-copy-label,
  .fee-print-scan-text strong {
    color: #0b3d91 !important;
  }

  .fee-print-num,
  .fee-print-total td,
  .fee-print-meta-grid b,
  .fee-print-student-grid b {
    color: #000 !important;
  }

  .fee-print-default {
    color: #b00020 !important;
  }

  .fee-print-batch {
    margin: 0;
    max-width: none;
  }

  .fee-print-page {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    gap: 1.5mm;
  }

  .fee-print-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .fee-print-copies {
    flex: 1 1 auto;
    min-height: 185mm;
    align-items: stretch;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  }

  .fee-print-copy-wrap {
    display: flex;
    flex-direction: column;
    min-height: 185mm;
  }

  .fee-print-copy {
    flex: 1 1 auto;
    min-height: 185mm;
    gap: 1.2mm;
  }

  .fee-print-cut-v {
    align-self: stretch;
    min-height: 185mm;
    width: 4.2mm;
    padding: 2mm 0;
  }

  .fee-print-cut-text {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
  }

  .fee-print-watermark {
    font-size: 0.95rem;
    color: rgba(15, 61, 145, 0.12) !important;
  }

  .fee-print-fees {
    flex: 0 0 auto;
  }

  .fee-print-history-student {
    font-size: 0.52rem;
  }

  .fee-print-history-student th,
  .fee-print-history-student td {
    padding: 0.4mm 0.7mm;
    border-width: 0.4px;
    line-height: 1.15;
  }

  .fee-print-qr {
    width: 64px;
    height: 64px;
  }

  .fee-print-logo {
    height: 28px;
  }

  .fee-print-copy-wrap {
    padding: 0 1.5mm;
  }

  .fee-print-cut-v {
    width: 4mm;
    border-left-width: 0.6px;
    font-size: 0.55rem;
  }

  .fee-print-copy {
    gap: 1.6mm;
    padding: 0;
  }

  .fee-print-copy-head {
    padding-bottom: 1mm;
    gap: 1mm;
  }

  .fee-print-logo {
    height: 28px !important;
    width: auto !important;
  }

  .fee-print-voucher-no {
    padding: 1.2mm 1mm;
  }

  .fee-print-voucher-no span {
    font-size: 0.5rem;
  }

  .fee-print-voucher-no b {
    font-size: 1.05rem !important;
    line-height: 1.1;
  }

  .fee-print-brand-text strong,
  .fee-print-brand-inline strong {
    font-size: 0.7rem;
    line-height: 1.15;
  }

  .fee-print-brand-text span,
  .fee-print-brand-inline span,
  .fee-print-bank-inline {
    font-size: 0.58rem;
    line-height: 1.2;
  }

  .fee-print-copy-label {
    font-size: 0.58rem;
    padding: 0.12rem 0.3rem;
  }

  .fee-print-scan {
    gap: 1.5mm;
    padding: 1.5mm;
  }

  .fee-print-qr {
    width: 72px !important;
    height: 72px !important;
    padding: 2px !important;
    background: #fff !important;
  }

  .fee-print-scan-text {
    font-size: 0.55rem;
    line-height: 1.2;
  }

  .fee-print-scan-text strong {
    font-size: 0.58rem;
  }

  .fee-print-meta-grid,
  .fee-print-student-grid {
    font-size: 0.62rem;
    gap: 0.8mm 1.5mm;
  }

  .fee-print-meta-grid span,
  .fee-print-student-grid span {
    font-size: 0.48rem;
  }

  .fee-print-table,
  .fee-print-table-compact {
    font-size: 0.62rem;
  }

  .fee-print-table th,
  .fee-print-table td {
    padding: 0.8mm 1.2mm;
    border-width: 0.5px;
    line-height: 1.2;
  }

  .fee-print-default {
    font-size: 0.58rem;
  }

  .fee-print-shared,
  .fee-print-page-foot {
    flex: 0 0 auto;
  }

  .fee-print-shared {
    margin-top: 0;
    padding-top: 1.5mm;
  }

  .fee-print-shared-label {
    font-size: 0.58rem;
    letter-spacing: 0.03em;
  }

  .fee-print-history-inline {
    font-size: 0.55rem;
    margin-top: 1mm;
    table-layout: fixed;
    width: 100%;
  }

  .fee-print-history-inline th,
  .fee-print-history-inline td {
    padding: 0.6mm 0.8mm;
    border-width: 0.4px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: clip;
  }

  .fee-print-history-inline .fee-print-hist-label {
    padding-left: 1mm;
    width: 12mm;
  }

  .fee-print-note-inline {
    font-size: 0.58rem;
    padding: 0.8mm 0;
  }

  .fee-print-page-foot {
    margin-top: 0;
    font-size: 0.52rem;
  }

  @page {
    size: A4 portrait;
    margin: 8mm;
  }
}

/* ---------- Exams ---------- */
.exam-scheme-form {
  max-width: 960px;
}

.exam-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin-top: 0.45rem;
}

.exam-table input.exam-marks {
  width: 5.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.exam-comp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.exam-comp-max {
  color: var(--muted);
  font-size: 0.8rem;
}

.exam-center { text-align: center; }

.exam-filter {
  align-items: flex-end;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.exam-result-filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.exam-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem 0.9rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .exam-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 480px) {
  .exam-filter-grid {
    grid-template-columns: 1fr;
  }
}

.exam-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 0.9rem;
}

.exam-filter .field {
  min-width: 0;
  max-width: none;
  flex: unset;
  width: 100%;
  margin: 0;
}

.exam-filter .field-subject,
.exam-filter .field-wide {
  min-width: 0;
  max-width: none;
  flex: unset;
}

.exam-filter .field-date {
  min-width: 0;
  max-width: none;
  flex: unset;
}

.exam-filter .field label {
  min-height: 1.15rem;
  display: block;
}

.exam-filter .field-hint-soft {
  color: var(--muted);
}

.exam-filter-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.exam-filter-actions {
  display: flex;
  align-items: end;
  gap: 0.55rem;
  min-height: 100%;
  padding-top: 1.15rem;
}

.exam-filter-actions .btn-primary {
  width: auto;
  padding: 0.75rem 1.35rem;
  margin: 0;
}

.exam-filter input[type="date"] {
  min-width: 0;
  color-scheme: light;
}

.exam-track-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #c5d4e8;
  background: #f4f8fc;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #334155;
}

.exam-track-callout strong {
  color: #143a6b;
  font-weight: 700;
}

.exam-track-callout.is-ocs {
  border-color: #9db8a3;
  background: #f3faf4;
}

.exam-track-callout.is-ocs strong {
  color: #1b5e20;
}

.exam-track-callout.is-warn {
  border-color: #e2b6b6;
  background: #fff5f5;
}

.exam-track-callout.is-warn strong {
  color: #9b1c1c;
}

.exam-ocs-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 0.82rem;
  font-weight: 600;
}

.btn-link-danger {
  background: none;
  border: 0;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

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

/* Exam result cards / reports */
.exam-report-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.print-body .exam-report-stack {
  margin: 0 auto;
  padding: 0.5rem 0 1rem;
  background: transparent;
}

.print-body.print-exam-cards {
  background: #fff;
}

.print-body.print-exam-cards .print-toolbar {
  max-width: 210mm;
  margin: 0.75rem auto;
}

.print-body.print-exam-cards .exam-report-stack {
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.print-body.print-exam-cards .exam-card {
  max-width: none;
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}

.exam-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 210mm;
  margin-left: auto;
  margin-right: auto;
}

.exam-card-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  font-family: var(--display), "IBM Plex Sans", Georgia, serif;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: rgba(18, 54, 90, 0.07);
  transform: rotate(-28deg);
  user-select: none;
  padding: 1rem;
  line-height: 1.2;
}

.exam-card-head,
.exam-card-student,
.exam-card-table,
.exam-card-note,
.exam-insights {
  position: relative;
  z-index: 1;
}

.exam-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
  border-bottom: 1.5px solid #12365a;
  padding-bottom: 0.85rem;
}

.exam-card-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.exam-card-logo {
  display: block;
  width: 240px;
  max-width: 72%;
  height: auto;
  object-fit: contain;
}

.exam-card-school {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #12365a;
  letter-spacing: 0.01em;
  max-width: 36rem;
}

.exam-card-title {
  margin: 0.15rem 0 0;
  text-align: center;
  font-family: var(--display), Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.exam-card-student {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 0.45rem 1.35rem;
  margin-bottom: 0.95rem;
  font-size: 0.95rem;
  line-height: 1.45;
  align-items: start;
}

.exam-card-student-photo {
  width: 84px;
}

.exam-card-student-photo img {
  width: 84px;
  height: 100px;
  object-fit: cover;
  border: 1px solid #94a3b8;
  background: #fff;
  display: block;
}

.exam-card-photo-placeholder {
  width: 84px;
  height: 100px;
  border: 1px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem;
  background: #f8fafc;
}

.exam-card-student span {
  color: #475569;
  margin-right: 0.35rem;
  font-weight: 500;
}

.exam-card-student strong {
  color: #0f172a;
  font-weight: 700;
}

.exam-card-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.35;
}

.exam-card-table th,
.exam-card-table td {
  border: 1px solid #64748b;
  padding: 0.4rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  color: #0f172a;
}

.exam-card-table th {
  background: #e8eef6;
  font-weight: 700;
  text-align: center;
}

/* 9th–12th: subject names left-aligned (Theory/Oral cards). */
.exam-card.is-highschool .exam-card-table th.exam-card-subject,
.exam-card.is-highschool .exam-card-table td.exam-card-subject,
.exam-card.is-highschool .exam-card-table tbody td:nth-child(2) {
  text-align: left;
  padding-left: 0.55rem;
}

.exam-card-table-combined thead th[colspan] {
  text-align: center;
}

.exam-card-table .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.exam-card-table tfoot th {
  background: #dbe5f2;
  font-weight: 800;
  text-align: center;
}

.exam-card-table tr.is-fail td,
.exam-summary-table tr.is-fail td,
.exam-award-standing-table tr.is-fail td { color: var(--danger); font-weight: 700; }
.exam-summary-table td.is-fail { color: var(--danger); font-weight: 700; }

.exam-card-note {
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  color: var(--accent);
}

.exam-card-note.is-fail { color: var(--danger); }

.exam-insights {
  margin-top: 0.95rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid #c5d4e8;
  border-left: 4px solid var(--brand, #1d4f91);
  border-radius: 8px;
  background: #f4f8fc;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.exam-insights-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-deep, #143a6b);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}

.exam-insights-head {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  text-align: center;
}

.exam-insights-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #334155;
}

.exam-insights-list li { margin-bottom: 0.35rem; }
.exam-insights-list li:last-child { margin-bottom: 0; }

.exam-insights-foot {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

@media print {
  .no-print,
  .print-toolbar { display: none !important; }

  .print-body.print-exam-cards {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .exam-report-stack.is-print {
    display: block;
    gap: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    align-items: stretch;
  }

  /* Individual student result cards only (not class summary sheets) */
  .print-exam-cards .exam-card,
  .exam-report-stack .exam-card {
    box-shadow: none !important;
    border-radius: 0;
    border: 1px solid #333;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-before: auto;
    padding: 6mm 8mm;
    max-width: none !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    box-sizing: border-box;
    overflow: visible;
  }

  .print-exam-cards .exam-card:first-child,
  .exam-report-stack .exam-card:first-child {
    page-break-before: avoid;
    break-before: avoid;
  }

  .print-exam-cards .exam-card:last-child,
  .exam-report-stack .exam-card:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .exam-card-watermark {
    font-size: 2.2rem;
    color: rgba(18, 54, 90, 0.09);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-exam-cards .exam-card-logo,
  .exam-report-stack .exam-card-logo {
    width: 200px;
    max-width: 48%;
  }

  .print-exam-cards .exam-card-school,
  .exam-report-stack .exam-card-school {
    font-size: 12pt;
    color: #12365a !important;
  }

  .print-exam-cards .exam-card-title,
  .exam-report-stack .exam-card-title {
    font-size: 13pt;
    color: #0f172a !important;
  }

  .print-exam-cards .exam-card-head,
  .exam-report-stack .exam-card-head {
    margin-bottom: 0.6rem;
    padding-bottom: 0.55rem;
    gap: 0.3rem;
  }

  .print-exam-cards .exam-card-student,
  .exam-report-stack .exam-card-student {
    font-size: 10pt;
    margin-bottom: 0.65rem;
    gap: 0.35rem 1rem;
  }

  .print-exam-cards .exam-card-table,
  .exam-report-stack .exam-card-table {
    font-size: 9.5pt;
    width: 100%;
  }

  .print-exam-cards .exam-card-table th,
  .print-exam-cards .exam-card-table td,
  .exam-report-stack .exam-card-table th,
  .exam-report-stack .exam-card-table td {
    border-color: #444;
    padding: 0.28rem 0.35rem;
  }

  .print-exam-cards .exam-card-table th,
  .print-exam-cards .exam-card-table tfoot th,
  .exam-report-stack .exam-card-table th,
  .exam-report-stack .exam-card-table tfoot th {
    background: #e8eef6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-exam-cards .exam-card-note,
  .exam-report-stack .exam-card-note {
    font-size: 10pt;
    margin-top: 0.55rem;
  }

  .print-exam-cards .exam-insights,
  .exam-report-stack .exam-insights {
    margin-top: 0.65rem;
    padding: 0.55rem 0.7rem;
    background: #f4f8fc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-exam-cards .exam-insights-title,
  .print-exam-cards .exam-insights-head,
  .print-exam-cards .exam-insights-list,
  .exam-report-stack .exam-insights-title,
  .exam-report-stack .exam-insights-head,
  .exam-report-stack .exam-insights-list {
    font-size: 9.5pt;
  }
}

.exam-award-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.5rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  text-align: center;
  justify-items: center;
}

.exam-award-meta span { color: var(--muted); margin-right: 0.35rem; }

.exam-award-table td.exam-award-blank {
  min-height: 1.4rem;
  height: 1.6rem;
}

.exam-award-foot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
  justify-items: center;
}

.exam-award-foot span { color: var(--muted); margin-right: 0.35rem; }
.exam-award-foot em { font-style: normal; }

@media print {
  .exam-award-list.is-print {
    box-shadow: none;
    border: 0;
    border-radius: 0;
  }
}

/* ---------- Result Summary (class mark sheet) ---------- */
.exam-result-summary .exam-summary-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.exam-summary-table {
  min-width: 720px;
  font-size: 0.82rem;
}

.exam-summary-table th,
.exam-summary-table td,
.exam-summary-table .num {
  white-space: nowrap;
  padding: 0.35rem 0.45rem;
  text-align: center;
  vertical-align: middle;
}

.exam-summary-table th.sticky-col,
.exam-summary-table td.sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 3.2rem;
}

.exam-summary-table th.sticky-col-2,
.exam-summary-table td.sticky-col-2 {
  position: sticky;
  left: 3.2rem;
  background: #fff;
  z-index: 1;
  min-width: 8rem;
  max-width: 12rem;
  white-space: normal;
}

.exam-summary-table thead th.sticky-col,
.exam-summary-table thead th.sticky-col-2 {
  background: #f1f5f9;
  z-index: 2;
}

@media print {
  .print-body.print-exam-summary {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .exam-result-summary.is-print,
  .exam-award-standing.is-print {
    box-shadow: none !important;
    border: 1px solid #333;
    border-radius: 0;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4mm 5mm !important;
    overflow: visible !important;
    page-break-inside: auto;
    break-inside: auto;
    page-break-after: auto;
  }

  .exam-result-summary.is-print .exam-card-head,
  .exam-award-standing.is-print .exam-card-head {
    margin-bottom: 0.45rem;
    padding-bottom: 0.4rem;
  }

  .exam-result-summary.is-print .exam-card-brand img,
  .exam-award-standing.is-print .exam-card-brand img {
    width: 160px;
    max-width: 40%;
    height: auto;
  }

  .exam-result-summary.is-print .exam-card-title,
  .exam-award-standing.is-print .exam-card-title {
    font-size: 12pt;
  }

  .exam-result-summary.is-print .exam-award-meta,
  .exam-award-standing.is-print .exam-award-meta {
    font-size: 9pt;
    margin-bottom: 0.45rem;
    gap: 0.25rem 1rem;
  }

  .exam-result-summary .exam-summary-scroll {
    overflow: visible !important;
    width: 100%;
  }

  .exam-result-summary.is-print .exam-summary-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed;
    font-size: 7.5pt;
    line-height: 1.25;
  }

  .exam-result-summary.is-print .exam-summary-table th,
  .exam-result-summary.is-print .exam-summary-table td {
    padding: 0.15rem 0.18rem;
    border-color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center !important;
    vertical-align: middle;
  }

  .exam-result-summary.is-print .exam-summary-table tr.is-fail td,
  .exam-result-summary.is-print .exam-summary-table td.is-fail,
  .exam-award-standing.is-print .exam-award-standing-table tr.is-fail td {
    color: #b42318 !important;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .exam-result-summary.is-print .exam-summary-table th.sticky-col,
  .exam-result-summary.is-print .exam-summary-table td.sticky-col,
  .exam-result-summary.is-print .exam-summary-table th.sticky-col-2,
  .exam-result-summary.is-print .exam-summary-table td.sticky-col-2 {
    position: static;
    left: auto;
    background: inherit;
  }

  .exam-result-summary.is-print .exam-summary-table th.sticky-col,
  .exam-result-summary.is-print .exam-summary-table td.sticky-col {
    width: 4%;
    min-width: 0;
  }

  .exam-result-summary.is-print .exam-summary-table th.sticky-col-2,
  .exam-result-summary.is-print .exam-summary-table td.sticky-col-2,
  .exam-result-summary.is-print .exam-summary-table td:nth-child(3),
  .exam-result-summary.is-print .exam-summary-table th:nth-child(3) {
    width: 11%;
    max-width: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  .exam-result-summary.is-print .exam-summary-table th,
  .exam-result-summary.is-print .exam-summary-table tfoot th {
    background: #e8eef6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .exam-result-summary.is-print .exam-award-foot,
  .exam-award-standing.is-print .exam-award-foot {
    font-size: 9pt;
    margin-top: 0.5rem;
  }

  .exam-award-standing.is-print .exam-award-standing-table {
    width: 100%;
    table-layout: fixed;
    font-size: 9pt;
  }

  .exam-award-standing.is-print .exam-award-standing-table th,
  .exam-award-standing.is-print .exam-award-standing-table td {
    padding: 0.25rem 0.3rem;
    border-color: #555;
    text-align: center !important;
    vertical-align: middle;
  }
}

.print-body.print-exam-summary {
  background: #fff;
}

.print-body.print-exam-summary .exam-result-summary,
.print-body.print-exam-summary .exam-award-standing {
  max-width: none;
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  overflow: visible;
}

.print-body.print-exam-summary .exam-school-summary {
  max-width: none;
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  overflow: visible;
}

/* ---------- School Result Summary (grade-wise) ---------- */
.exam-school-summary-meta {
  grid-template-columns: repeat(3, 1fr);
}

.exam-school-summary-table {
  width: 100%;
  font-size: 0.92rem;
}

.exam-school-summary-table th,
.exam-school-summary-table td {
  text-align: center;
  vertical-align: middle;
}

.exam-school-summary-table tfoot th {
  font-weight: 800;
  background: #dbe5f2;
}

@media print {
  .exam-school-summary.is-print {
    box-shadow: none !important;
    border: 1px solid #333;
    border-radius: 0;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 6mm 8mm !important;
    overflow: visible !important;
  }

  .exam-school-summary.is-print .exam-school-summary-table {
    font-size: 10pt;
    width: 100%;
  }

  .exam-school-summary.is-print .exam-school-summary-table th,
  .exam-school-summary.is-print .exam-school-summary-table td {
    padding: 0.28rem 0.35rem;
    text-align: center !important;
    vertical-align: middle;
  }
}

/* ---------- Award List (class standing) ---------- */
.exam-award-standing-table th,
.exam-award-standing-table td {
  padding: 0.4rem 0.55rem;
}

.emp-subjects-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  cursor: pointer;
}

.emp-subjects-table td:first-child {
  text-align: left;
}

/* ---------- Date sheet ---------- */
.ds-edit-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.25rem;
}

.ds-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem 1.1rem;
  align-items: start;
}

.ds-edit-grid .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
}

.ds-edit-grid .field label {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.ds-edit-grid input,
.ds-edit-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
  min-height: 2.65rem;
  box-sizing: border-box;
}

.ds-edit-grid input:focus,
.ds-edit-grid select:focus {
  outline: none;
  border-color: var(--brand, #1d4f91);
  box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

.ds-edit-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.ds-empty {
  padding: 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #f8fafc;
}

.ds-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ds-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ds-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(180deg, #f0f5fb, #e8eef7);
  border-bottom: 1px solid var(--line);
}

.ds-day-head strong {
  font-size: 1rem;
  color: var(--brand-deep, #143a6b);
}

.ds-day-head span { color: var(--text, #1e293b); font-weight: 600; }
.ds-day-head em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
}

.ds-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ds-item {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.ds-item:last-child { border-bottom: 0; }
.ds-item.is-editing { background: #fff8e8; }

.ds-item-time {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--brand-deep, #143a6b);
  font-size: 0.9rem;
}

.ds-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.ds-item-main strong { font-size: 0.98rem; }
.ds-item-main span { color: var(--muted); font-size: 0.88rem; }

.ds-room {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #eef3f9;
  color: var(--brand-deep, #143a6b) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
}

.ds-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .ds-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .ds-edit-grid {
    grid-template-columns: 1fr;
  }
  .ds-day-head em { margin-left: 0; }
}

@media (min-width: 721px) and (max-width: 980px) {
  .ds-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.exam-filter .ds-instr-field {
  flex: 1 1 100%;
  max-width: none;
  min-width: 100%;
}

.ds-instr-input {
  width: 100%;
  min-height: 8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
  box-sizing: border-box;
}

.ds-instr-input:focus {
  outline: none;
  border-color: var(--brand, #1d4f91);
  box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

.ds-report-session {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  width: 100%;
}

.ds-report-meta {
  margin-top: 0.25rem;
}

.ds-report-table td,
.ds-report-table th {
  vertical-align: middle;
}

.ds-report-instr {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.ds-report-instr h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--brand-deep, #143a6b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ds-report-instr ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #334155;
}

.ds-report-instr li { margin-bottom: 0.35rem; }
.ds-report-instr li:last-child { margin-bottom: 0; }

.ds-report-sign {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.ds-report-sign div {
  border-top: 1px solid #94a3b8;
  padding-top: 0.4rem;
  margin: 0 0.75rem;
}

@media print {
  .ds-report.is-print,
  .ds-report {
    box-shadow: none;
    border: 0;
    border-radius: 0;
  }

  .ds-report-instr {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sa-breadcrumb,
  .mom-head,
  .section-block:has(#dsReportForm),
  .section-block:has(#rollSlipForm),
  .banner-error,
  .banner-success {
    display: none !important;
  }
}

/* ---------- Roll no. slip ---------- */
.roll-slip-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.roll-slip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.1rem;
  page-break-after: always;
  break-after: page;
}

.roll-slip:last-child {
  page-break-after: auto;
  break-after: auto;
}

.roll-slip-head {
  text-align: center;
  margin-bottom: 0.85rem;
}

.roll-slip-logo {
  display: block;
  margin: 0 auto 0.35rem;
  height: 28px;
  width: auto;
}

.roll-slip-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: underline;
  color: var(--brand-deep, #143a6b);
}

.roll-slip-term {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.roll-slip-info {
  display: grid;
  grid-template-columns: 1fr 1fr 5.5rem;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
  align-items: start;
}

.roll-slip-line {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 0.2rem;
}

.roll-slip-line span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.roll-slip-line strong {
  font-weight: 650;
  color: var(--text, #1e293b);
}

.roll-slip-photo {
  width: 5.5rem;
  height: 6.5rem;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
}

.roll-slip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roll-slip-photo em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
}

.roll-slip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.roll-slip-table th,
.roll-slip-table td {
  border: 1px solid #94a3b8;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.roll-slip-table th {
  background: #e2e8f0;
  font-weight: 700;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.roll-slip-paper {
  color: var(--muted);
  font-size: 0.82rem;
}

.roll-slip-instr h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  text-decoration: underline;
  color: var(--brand-deep, #143a6b);
}

.roll-slip-instr ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #334155;
}

.roll-slip-instr li { margin-bottom: 0.25rem; }

.roll-slip-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1.25rem;
  font-size: 0.88rem;
}

.roll-slip-sign {
  text-align: center;
  min-width: 11rem;
}

.roll-slip-sign em {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  font-weight: 650;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .roll-slip-info {
    grid-template-columns: 1fr;
  }
  .roll-slip-photo {
    width: 5rem;
    height: 6rem;
  }
}

@media print {
  .roll-slip-stack {
    gap: 0;
  }
  .roll-slip {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
}

/* Global loading overlay */
.sms-loading[hidden] { display: none !important; }

.sms-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}

.sms-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 42, 0.42);
}

.sms-loading-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.75rem 1.15rem;
  min-width: 168px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(15, 28, 42, 0.22);
}

.sms-loading-figure {
  display: block;
  width: 56px;
  height: auto;
  margin: 0 auto 0.85rem;
  animation: sms-figure-bounce 0.9s ease-in-out infinite;
  transform-origin: center bottom;
}

.sms-loading-text {
  margin: 0;
  font-weight: 600;
  color: #12365a;
  font-size: 0.95rem;
}

@keyframes sms-figure-bounce {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-8px) scale(1.06); opacity: 0.88; }
}

@keyframes sms-spin {
  to { transform: rotate(360deg); }
}

/* —— Audit observations (School Desk / TMT) —— */
.ao-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.ao-date-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(280px, 100%);
}

.ao-date-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ao-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.ao-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.ao-card span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.ao-card strong {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  color: #12365a;
  line-height: 1.1;
}

.ao-panel {
  padding: 0;
  overflow: hidden;
}

.ao-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.ao-panel-head strong {
  color: #12365a;
  margin-right: 0.45rem;
}

.ao-panel-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.ao-risk-legend {
  font-size: 0.86rem;
  color: var(--muted);
}

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

.ao-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ao-table th,
.ao-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.ao-table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: #fff;
}

.ao-table td.ao-area {
  font-weight: 500;
  color: #12365a;
  white-space: normal;
  min-width: 12rem;
}

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

.ao-table tfoot td {
  font-weight: 600;
  border-bottom: none;
  background: #f8fafc;
}

.ao-risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.ao-risk-h { color: #c53030; }
.ao-risk-m { color: #d97706; }
.ao-risk-l { color: #0d9488; }
.ao-risk-none { color: #94a3b8; }

.ao-diff-neg {
  color: #c53030;
  font-weight: 600;
}

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

@media (max-width: 560px) {
  .ao-summary {
    grid-template-columns: 1fr;
  }
}

/* —— Student ID cards (Academics report) —— */
.sid-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.sid-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  break-inside: avoid;
  page-break-inside: avoid;
}

.sid-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(135deg, #7a1218 0%, #c41e2a 55%, #e23b45 100%);
  color: #fff;
}

.sid-card-logo {
  height: 28px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  object-fit: contain;
}

.sid-card-org {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sid-card-org strong {
  font-size: 0.92rem;
  line-height: 1.15;
}

.sid-card-org em {
  font-style: normal;
  font-size: 0.78rem;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sid-card-body {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem 0.9rem;
}

.sid-card-photo {
  width: 96px;
  height: 118px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f1f5f9;
}

.sid-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sid-card-photo-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  padding: 0.4rem;
}

.sid-card-fields {
  margin: 0;
  display: grid;
  gap: 0.28rem;
}

.sid-card-fields > div {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: baseline;
}

.sid-card-fields dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.sid-card-fields dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #12365a;
  word-break: break-word;
}

.sid-card-foot {
  padding: 0.45rem 0.9rem 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
  background: #f8fafc;
}

.print-body.print-student-id-cards .sid-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8mm;
}

.print-body.print-student-id-cards .sid-card {
  box-shadow: none;
  border: 1px solid #cbd5e1;
}

@media print {
  .print-body.print-student-id-cards .print-toolbar { display: none !important; }
  .print-body.print-student-id-cards .sid-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
  }
  .print-body.print-student-id-cards .sid-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}


.ao-risk-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.ao-risk-count {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ao-risk-count:hover,
.ao-risk-count.is-active {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(11, 36, 61, 0.1);
}

.ao-risk-count-h:hover,
.ao-risk-count-h.is-active { border-color: #f1a3a3; }
.ao-risk-count-m:hover,
.ao-risk-count-m.is-active { border-color: #f0c48a; }
.ao-risk-count-l:hover,
.ao-risk-count-l.is-active { border-color: #7dd3c7; }

.ao-risk-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.ao-risk-count-h .ao-risk-count-badge { background: #fde8e8; color: #c53030; }
.ao-risk-count-m .ao-risk-count-badge { background: #fff4e5; color: #d97706; }
.ao-risk-count-l .ao-risk-count-badge { background: #e6fffa; color: #0d9488; }

.ao-risk-count em {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ao-risk-count strong {
  display: block;
  font-size: 1.55rem;
  color: #12365a;
  line-height: 1.1;
}

.ao-risk-count-hint {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.ao-detail-panel {
  margin-bottom: 1.1rem;
  padding: 0;
  overflow: hidden;
}

.ao-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.ao-detail-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  color: #12365a;
}

.ao-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ao-detail-empty {
  padding: 1.25rem 1.15rem;
  color: var(--muted);
}

.ao-detail-list {
  display: flex;
  flex-direction: column;
}

.ao-detail-item {
  padding: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.ao-detail-item:last-child {
  border-bottom: none;
}

.ao-detail-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.ao-detail-item-top strong {
  margin-left: 0.45rem;
  color: #12365a;
  font-size: 1.05rem;
}

.ao-detail-scores {
  font-size: 0.9rem;
  color: var(--muted);
}

.ao-detail-scores b { color: #12365a; }

.ao-detail-remarks {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: #334155;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.ao-detail-remarks span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.ao-school-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.ao-school-field label {
  display: block;
  font-weight: 700;
  color: #12365a;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.ao-school-help {
  margin: 0 0 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.ao-school-field textarea,
.ao-school-field input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
  color: #12365a;
}

.ao-school-field textarea:focus,
.ao-school-field input[type="date"]:focus {
  outline: 2px solid rgba(18, 54, 90, 0.2);
  border-color: #12365a;
}

.ao-school-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

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

.ao-resp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ao-resp-table th,
.ao-resp-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ao-resp-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: #f8fafc;
  white-space: nowrap;
}

.ao-resp-area {
  display: inline;
  margin-left: 0.35rem;
  color: #12365a;
}

.ao-resp-text {
  max-width: 22rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
}

.ao-resp-score {
  white-space: nowrap;
  font-weight: 600;
  color: #12365a;
}

.ao-resp-actions {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ao-inline-form {
  display: inline;
  margin: 0;
}

.ao-btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.82rem !important;
  width: auto !important;
  line-height: 1.2;
}

.ao-btn-danger {
  color: #c53030 !important;
  border-color: #f1a3a3 !important;
}

.ao-btn-danger:hover {
  background: #fde8e8 !important;
}

.ao-muted {
  color: var(--muted);
  font-style: italic;
}

.ao-resp-saved {
  background: #f8fffb;
}

.ao-resp-editing,
.ao-resp-edit-row {
  background: #fffbeb;
}

.ao-resp-edit-row td {
  border-bottom: 2px solid #f0c48a;
  padding-bottom: 1rem;
}

.ao-detail-remarks-inline {
  margin-top: 0.45rem;
  margin-bottom: 0;
}

.ao-table td.ao-area a,
.ao-table .ao-risk {
  text-decoration: none;
}

.ao-table td.ao-area a,
.ao-table .ao-risk {
  text-decoration: none;
}

.ao-table td.ao-area a:hover {
  text-decoration: underline;
}

.ao-row-focus {
  background: #fffbeb;
}

@media (max-width: 900px) {
  .ao-risk-counts {
    grid-template-columns: 1fr;
  }
  .ao-school-grid {
    grid-template-columns: 1fr;
  }
  .ao-risk-count-hint {
    display: none;
  }
}







