:root {
  color-scheme: light;
  --chrome: #0e1424;
  --chrome-deep: #0a1020;
  --chrome-ink: #f7f8ff;
  --chrome-muted: #aab5cc;
  --chrome-border: #27334c;
  --chrome-hover: #1b2941;
  --accent-purple: #7048d7;
  --accent-gradient: linear-gradient(115deg, #2555df 0%, #4b55df 58%, #7048d7 100%);
  --surface-rgb: 255, 255, 255;
  --on-accent: #ffffff;
  --focus-ring: rgba(37, 99, 235, 0.14);
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-hover: #e2e8f0;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --section-ink: #273d7d;
  --field-label-ink: #374f89;
  --support-ink: #52647d;
  --table-heading-ink: #405989;
  --review-ink: #895002;
  --border: #ccd7e7;
  --border-strong: #aabed7;
  --teal: #315de8;
  --teal-dark: #244bd4;
  --mint: #eff6ff;
  --mint-ink: #1e40af;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-ink: #92400e;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-ink: #b91c1c;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-ink: #065f46;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-ink: #1e40af;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.07);
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --attendance-present-bg: #ecfdf5;
  --attendance-present-ink: #065f46;
  --attendance-absent-bg: #fef2f2;
  --attendance-absent-ink: #b91c1c;
  --attendance-late-bg: #fffbeb;
  --attendance-late-ink: #92400e;
  --attendance-excused-bg: #eff6ff;
  --attendance-excused-ink: #1e40af;
  --attendance-present-button: #065f46;
  --attendance-absent-button: #b91c1c;
  --attendance-late-button: #92400e;
  --attendance-excused-button: #1e40af;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #121d2e;
  --surface-rgb: 18, 29, 46;
  --surface-subtle: #1b2a3f;
  --surface-hover: #24364e;
  --ink: #f3f7fd;
  --ink-secondary: #d2deef;
  --muted: #adbed2;
  --section-ink: #d0d5ff;
  --field-label-ink: #bfcaff;
  --support-ink: #bbcae0;
  --table-heading-ink: #b6c9f2;
  --review-ink: #ffd28c;
  --border: #3a4d68;
  --border-strong: #577192;
  --teal: #9bc2ff;
  --teal-dark: #b4d1ff;
  --on-accent: #ffffff;
  --focus-ring: rgba(155, 194, 255, 0.25);
  --mint: #1c3153;
  --mint-ink: #c5dcff;
  --warning-bg: #3e301c;
  --warning-border: #765c31;
  --warning-ink: #ffe1a3;
  --danger-bg: #41252e;
  --danger-border: #824858;
  --danger-ink: #ffb8c6;
  --success-bg: #183a35;
  --success-border: #3b7168;
  --success-ink: #b2f4df;
  --info-bg: #1d3150;
  --info-border: #45668e;
  --info-ink: #bfd9ff;
  --attendance-present-bg: #183a35;
  --attendance-present-ink: #b2f4df;
  --attendance-absent-bg: #41252e;
  --attendance-absent-ink: #ffb8c6;
  --attendance-late-bg: #3e301c;
  --attendance-late-ink: #ffe1a3;
  --attendance-excused-bg: #1d3150;
  --attendance-excused-ink: #bfd9ff;
  --attendance-present-button: #08654e;
  --attendance-absent-button: #aa3448;
  --attendance-late-button: #85611d;
  --attendance-excused-button: #315da5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--teal);
  scrollbar-color: var(--border-strong) transparent;
}

::selection {
  background: var(--mint);
  color: var(--mint-ink);
}

a {
  color: var(--teal);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

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

button, a, input, select, summary {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

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

h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 6px;
}

h2 {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 12px;
}

h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

p {
  margin-bottom: 12px;
}

small, .help {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

small {
  display: block;
}

code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

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

.break-word {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.skip {
  position: absolute;
  left: -9999px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  background: #244bd4;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Sidebar & Navigation */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  display: grid;
  place-items: center;
  flex: none;
  background: var(--teal);
  color: var(--on-accent);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.brand-cobrand {
  align-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 0.96rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.brand-text small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}

.mobile-current-section { display: none; }
.mobile-account-menu { display: none; }

.sidebar nav {
  display: grid;
  gap: 2px;
  margin-top: 18px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sidebar nav a svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.82;
}

.sidebar nav a:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  text-decoration: none;
}

.sidebar nav a[aria-current] {
  background: var(--mint);
  color: var(--mint-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--teal);
}

.sidebar nav a[aria-current] svg {
  opacity: 1;
  color: var(--teal);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8125rem;
}

.sidebar-footer p {
  margin: 6px 0 8px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.sidebar-footer a {
  font-weight: 600;
  font-size: 0.8125rem;
}

/* Main Shell & Topbar */
.shell {
  margin-left: 248px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell.standalone {
  margin-left: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  background: rgba(var(--surface-rgb), 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.875rem;
  color: var(--muted);
  gap: 16px;
}

.topbar-brand strong {
  color: var(--ink);
  font-weight: 650;
}

.topbar-brand small {
  display: inline;
  margin-left: 4px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.user-menu small {
  display: inline;
}

.user-menu a {
  color: var(--ink-secondary);
  font-weight: 500;
}

.user-menu a:hover {
  color: var(--teal);
}

.theme-toggle {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-secondary);
  padding: 6px 10px;
  min-height: 36px;
  font-size: .8125rem;
  font-weight: 600;
}

.theme-toggle:hover { background: var(--surface-subtle); color: var(--ink); }
.portal-context { color: var(--muted); font-weight: 600; }

main {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 32px 48px;
  flex: 1;
}

.standalone main {
  max-width: 1040px;
}

.page-footer {
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--surface);
}

/* Headings & Actions */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading > div:first-child {
  min-width: 0;
  max-width: 62ch;
}

.page-heading .actions {
  flex: none;
}

.page-heading p:last-child {
  margin-bottom: 0;
}

.section-heading, .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading h2, .panel-heading p, .section-heading h2 {
  margin-bottom: 0;
}

.panel-heading a, .section-heading a {
  font-size: 0.84rem;
  font-weight: 600;
}

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

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  background: var(--teal);
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.button:hover {
  background: var(--teal-dark);
  text-decoration: none;
}

.button.secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--surface-subtle);
  border-color: var(--muted);
}

.button.full {
  width: 100%;
}

.text-button {
  background: none;
  border: 0;
  color: var(--teal);
  padding: 10px 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

.text-button:hover {
  text-decoration: underline;
}

.text-button.danger {
  color: var(--danger-ink);
}

.subtle-link {
  font-size: 0.84rem;
  font-weight: 600;
}

/* Panels & Unified Segmented Metric Strip */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  min-width: 0;
}

.spaced {
  margin-top: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.stat {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.stat:last-child {
  border-right: 0;
}

.stat > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
}

.stat > strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 4px 0 3px;
  color: var(--ink);
}

.stat em {
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
}

.stat small {
  font-size: 0.76rem;
}

.stat.accent > strong {
  color: var(--teal);
}

/* Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

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

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

.card-grid > .empty {
  grid-column: 1 / -1;
}

.money strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}

/* Badges & Notices */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-ink);
}

.badge.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-ink);
}

.badge.neutral {
  background: var(--surface-subtle);
  color: var(--muted);
}

.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.notice.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-ink);
}

.notice.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-ink);
}

.notice.error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-ink);
}

.notice.info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-ink);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel > .table-wrap {
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th.num, td.num {
  text-align: right;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--bg);
}

.empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
}

.empty p {
  max-width: 420px;
  margin: 0 auto 14px;
}

.empty p:last-child {
  margin-bottom: 0;
}

/* Attendance History & Share Panel */
.history-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.history-summary > div {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}

.history-summary > div:last-child {
  border-right: 0;
}

.history-summary strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.history-summary span {
  font-size: 0.78rem;
  color: var(--muted);
}

.history-note {
  margin-top: 8px;
  font-size: 0.8125rem;
}

.history-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.history-mark.present { background: var(--success-bg); color: var(--success-ink); }
.history-mark.late { background: var(--warning-bg); color: var(--warning-ink); }
.history-mark.absent { background: var(--danger-bg); color: var(--danger-ink); }
.history-mark.excused { background: var(--info-bg); color: var(--info-ink); }

.share-panel {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.payment-qr {
  width: 196px;
  height: 196px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  flex: none;
}

/* Rows & Details */
.session-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.session-row:first-of-type {
  border-top: 0;
}

.session-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.date-tile {
  background: var(--mint);
  color: var(--mint-ink);
  border-radius: var(--radius-sm);
  min-width: 46px;
  padding: 6px;
  text-align: center;
}

.date-tile strong {
  font-size: 1.05rem;
  display: block;
  line-height: 1.1;
}

.date-tile span {
  font-size: 0.72rem;
  font-weight: 600;
}

.grow { flex: 1; min-width: 0; }
.align-right { text-align: right; }

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.compact-row:first-of-type {
  border-top: 0;
}

a.compact-row:hover {
  text-decoration: none;
  color: var(--teal);
}

.details {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
  font-variant-numeric: tabular-nums;
}

.details > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

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

.details dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.details .total {
  border-bottom: 0;
  padding-top: 12px;
  font-size: 1rem;
}

.details .total dt,
.details .total dd {
  color: var(--ink);
  font-weight: 700;
}

/* Progress Bar */
.progress-track {
  height: 7px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 12px;
}

.progress-track span,
.progress-fill {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}

/* Forms & Filters */
.form-panel {
  max-width: 680px;
}

.field {
  margin-bottom: 16px;
}

.field label,
.choice-field legend {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="tel"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  min-height: 42px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="search"] {
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px 16px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.875rem;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  vertical-align: middle;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger-ink);
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  color: var(--danger-ink);
  font-size: 0.8125rem;
  font-weight: 500;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.filters > div {
  flex: 2 1 240px;
}

.filters > div:has(select) {
  flex: 1 1 180px;
}

.filters label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.status-history summary {
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  margin-top: 4px;
}

.schedule-teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

/* Choice Toggle Lists (Person & Batch Forms) */
.choice-field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-subtle);
}

.choice-filter {
  margin-bottom: 8px;
  background: var(--surface);
}

.choice-list {
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.choice-field .choice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  margin: 0;
}

.choice-field .choice-row input { flex: none; margin: 0; }
.choice-field .choice-row:has(input:checked) { background: var(--mint); color: var(--mint-ink); }
.choice-field .choice-row:hover {
  background: var(--surface-subtle);
}

.checkbox-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 0 10px;
}
.checkbox-field input[type="checkbox"] { margin: 0; }
.checkbox-field label { margin: 0; min-height: 44px; display: flex; align-items: center; }
.checkbox-field .help, .checkbox-field .errorlist { grid-column: 1 / -1; }

.choice-empty {
  margin: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Auth & Workspace Switcher */
.auth-card {
  max-width: 440px;
  margin: 28px auto;
  padding: 28px;
}

.workspace-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.workspace-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--mint-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* Fees, Student Profiles & Gateway */
.fee-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.batch-fee-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.batch-fee-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.batch-fee-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.batch-fee-metrics strong {
  font-size: 0.95rem;
}

.student-result-list {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.student-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.student-result:last-child { border-bottom: 0; }

.student-result:hover {
  border-color: var(--teal);
  background: var(--surface-subtle);
  text-decoration: none;
}

.student-result > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.student-result-photo,
.student-result .photo-placeholder,
.photo-placeholder {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
  background: var(--mint);
  color: var(--mint-ink);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.student-profile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.student-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.student-identity img {
  border-radius: 10px;
  object-fit: cover;
}

.fee-totals {
  display: flex;
  gap: 24px;
  font-variant-numeric: tabular-nums;
}

.fee-totals span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.fee-totals strong {
  font-size: 1.35rem;
}

.fee-history-item {
  margin-bottom: 12px;
}

.fee-history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.fee-history-amounts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.sandbox-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.sandbox-box p {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 4px 0 10px;
}

.student-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.online-status {
  text-align: center;
}

.online-status .fee-totals {
  text-align: left;
  justify-content: center;
}

.online-status .notice {
  margin: 16px 0;
}

.online-qr {
  width: min(240px, 100%);
  height: auto;
}

.gateway-provider-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.gateway-provider-list > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.receipt {
  max-width: 680px;
}

/* Attendance */
.attendance-display-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.attendance-view-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.attendance-view-switch legend {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-right: 4px;
  float: left;
}

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

.attendance-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.attendance-tools > div:first-child {
  flex: 1;
  max-width: 320px;
}

.attendance-roster {
  display: grid;
  gap: 8px;
}

.attendance-roster[data-layout="grid"] {
  grid-template-columns: repeat(var(--attendance-columns, 3), minmax(0, 1fr));
  gap: 12px;
}

.attendance-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.attendance-person[data-status="present"] { background: var(--attendance-present-bg); border-color: var(--success-border); }
.attendance-person[data-status="absent"] { background: var(--attendance-absent-bg); border-color: var(--danger-border); }
.attendance-person[data-status="late"] { background: var(--attendance-late-bg); border-color: var(--warning-border); }
.attendance-person[data-status="excused"] { background: var(--attendance-excused-bg); border-color: var(--info-border); }

.attendance-person-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.attendance-person-photo {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mint);
  color: var(--mint-ink);
  font-weight: 700;
}

.attendance-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attendance-person-info {
  min-width: 0;
}

.attendance-person-info h3 {
  font-size: 0.95rem;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}

.attendance-person-details {
  display: flex;
  gap: 3px 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.attendance-roster[data-show-photo="false"] .attendance-person-photo,
.attendance-roster[data-show-code="false"] .attendance-detail--code,
.attendance-roster[data-show-kind="false"] .attendance-detail--kind,
.attendance-roster[data-show-school-roll="false"] .attendance-detail--school-roll,
.attendance-roster[data-show-guardian="false"] .attendance-detail--guardian,
.attendance-roster[data-show-phone="false"] .attendance-detail--phone {
  display: none;
}

.attendance-person-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  min-width: 300px;
}

.attendance-person-actions button {
  min-height: 38px;
  padding: 5px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.attendance-person-actions button[aria-pressed="true"][data-status-choice="present"] { background: var(--attendance-present-button); border-color: var(--attendance-present-button); color: #fff; }
.attendance-person-actions button[aria-pressed="true"][data-status-choice="absent"] { background: var(--attendance-absent-button); border-color: var(--attendance-absent-button); color: #fff; }
.attendance-person-actions button[aria-pressed="true"][data-status-choice="late"] { background: var(--attendance-late-button); border-color: var(--attendance-late-button); color: #fff; }
.attendance-person-actions button[aria-pressed="true"][data-status-choice="excused"] { background: var(--attendance-excused-button); border-color: var(--attendance-excused-button); color: #fff; }

.attendance-person:not([data-dirty="true"]) .attendance-person-clear {
  display: none;
}

.attendance-roster[data-layout="grid"] .attendance-person {
  align-items: stretch;
  flex-direction: column;
}

.attendance-roster[data-layout="grid"] .attendance-person-actions {
  min-width: 0;
  width: 100%;
}

.attendance-save {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 5;
}

.attendance-complete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
  background: var(--attendance-present-bg);
}
.attendance-complete-copy { display: flex; align-items: center; gap: 12px; min-width: 0; }
.attendance-complete-copy strong { display: block; font-size: 1rem; }
.attendance-complete-copy p { margin: 3px 0 0; color: var(--ink-secondary); font-size: .875rem; }
.attendance-complete-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--attendance-present-button); color: #fff; font-weight: 700; }
.attendance-summary-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.attendance-summary-counts span { display: inline-flex; gap: 6px; align-items: baseline; padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: .8125rem; }
.attendance-summary-counts strong { color: var(--ink); font-size: 1rem; font-variant-numeric: tabular-nums; }
.attendance-saved-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.attendance-saved-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.attendance-saved-row:last-child { border-bottom: 0; }
.attendance-saved-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.attendance-saved-row strong { font-size: .875rem; }
.attendance-saved-row small { color: var(--muted); }
.attendance-saved-status { min-width: 74px; text-align: center; padding: 5px 9px; border-radius: 6px; font-size: .75rem; font-weight: 700; }
.attendance-saved-status[data-status="present"] { background: var(--attendance-present-bg); color: var(--attendance-present-ink); }
.attendance-saved-status[data-status="absent"] { background: var(--attendance-absent-bg); color: var(--attendance-absent-ink); }
.attendance-saved-status[data-status="late"] { background: var(--attendance-late-bg); color: var(--attendance-late-ink); }
.attendance-saved-status[data-status="excused"] { background: var(--attendance-excused-bg); color: var(--attendance-excused-ink); }

.activity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.activity-toolbar p { margin: 0; }
.activity-prompt { display: flex; align-items: center; gap: 16px; padding: 24px 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border); }
.activity-prompt-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--mint); color: var(--mint-ink); font-size: 1.5rem; }
.activity-prompt-icon svg { width: 20px; height: 20px; }
.activity-prompt h2 { margin: 0 0 4px; font-size: 1.05rem; }
.activity-prompt p { margin: 0; font-size: .875rem; }
.activity-prompt .button { margin-left: auto; white-space: nowrap; }

/* Data-first workspace surfaces: one containing border, quiet internal rows. */
.workspace-section {
  min-width: 0;
  border-top: 1px solid var(--border-strong);
  padding-top: 20px;
}

.workspace-section > h2 { margin-bottom: 16px; }
.workspace-section .table-wrap { box-shadow: none; }

section[aria-labelledby="fee-periods"] {
  border-top: 1px solid var(--border-strong);
  padding-top: 20px;
}

section[aria-labelledby="fee-periods"] > .fee-history-item {
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

section[aria-labelledby="fee-periods"] > .fee-history-item:last-child { border-bottom: 0; }

.fee-batch-list,
.batch-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.fee-batch-list > *,
.batch-list > * {
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.fee-batch-list > *:last-child,
.batch-list > *:last-child { border-bottom: 0; }

.fee-batch-list .batch-fee-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(100px, .7fr) minmax(320px, 1.5fr);
  align-items: center;
  column-gap: 20px;
  padding: 16px 20px;
  color: var(--ink);
  border: 0;
}

.fee-batch-list .batch-fee-card:hover,
.batch-list .batch-card:hover {
  background: var(--surface-subtle);
  box-shadow: none;
  text-decoration: none;
}

.fee-batch-list .panel-heading { margin: 0; }
.fee-batch-list .panel-heading > .badge { display: inline-flex; }
.fee-batch-list .progress-track { margin: 0; }
.fee-batch-list .batch-fee-metrics { margin: 0; }
.fee-batch-list .batch-fee-card > small { grid-column: 1 / -1; margin-top: 6px; }
.fee-batch-list .batch-fee-metrics small { display: block; }

.batch-list .batch-card { padding: 20px 22px; border: 0; }
.batch-list .batch-card h2 { margin-bottom: 2px; }
.batch-list .batch-card h3 { margin-top: 16px; }

.dashboard-grid .panel,
.finance-grid .panel {
  box-shadow: none;
}

.finance-grid {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.finance-grid > .panel {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.finance-grid > .panel:last-child { border-right: 0; }
.finance-grid .money strong { font-size: clamp(1.5rem, 2vw, 2rem); letter-spacing: -.035em; }
.stats[aria-label="Fee summary"] .stat:nth-child(2) strong { color: var(--success-ink); }
.stats[aria-label="Fee summary"] .stat:nth-child(3) strong { color: var(--warning-ink); }

table a { font-weight: 600; }
tbody tr { transition: background-color .14s ease; }
th, td { line-height: 1.45; }
td small { color: var(--muted); }
td .button { min-height: 36px; padding: 6px 12px; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }

.empty h3 { color: var(--ink); }
.empty .button { margin-top: 4px; }

@media (max-width: 1240px) {
  .fee-batch-list .batch-fee-card { grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.3fr); }
  .fee-batch-list .progress-track { display: none; }
}

/* Responsive Breakpoints (Tablet & Mobile) */
@media (max-width: 1360px) {
  .fee-page-heading { flex-direction: column; align-items: stretch; }
  .fee-page-heading .actions { justify-content: flex-start; }
}

/* Compact records keep the primary action and identity in view on narrow screens. */
.compact-records { display: none; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.compact-record { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.compact-record:last-child { border-bottom: 0; }
.compact-record-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.compact-record-heading strong { display: block; font-size: .9375rem; }
.compact-record-heading small { margin-top: 3px; }
.compact-record-heading .badge, .compact-record-heading time { flex: none; }
.compact-record-heading time { color: var(--ink-secondary); font-size: .8125rem; font-weight: 600; }
.compact-record-meta { color: var(--muted); font-size: .8125rem; margin: 8px 0 0; }
.compact-record details { margin-top: 8px; }
.compact-record summary { color: var(--teal); font-size: .8125rem; font-weight: 600; cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.compact-record details[open] summary { margin-bottom: 10px; }
.compact-record dl { margin: 0 0 12px; }
.compact-record dl > div { display: grid; grid-template-columns: minmax(90px, 35%) minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.compact-record dt { color: var(--muted); }
.compact-record dd { margin: 0; overflow-wrap: anywhere; }
.compact-record-history { display: grid; gap: 3px; margin-bottom: 12px; font-size: .8125rem; }
.compact-record .actions { margin-top: 12px; }
.compact-record .empty { border: 0; }
@media (max-width: 900px) {
  .people-table, .schedule-table { display: none; }
  .people-compact, .schedule-compact { display: block; }
}

@media (max-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    width: 100%;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .brand {
    flex: none;
    padding: 2px 4px;
  }

  .sidebar nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 0;
    flex: 1;
  }

  .sidebar nav a {
    padding: 8px 11px;
    font-size: 0.8125rem;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar-brand {
    display: none;
  }

  .shell {
    margin-left: 0;
  }

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

  .stats .stat {
    border-bottom: 1px solid var(--border);
  }

  .stats .stat:nth-child(even) {
    border-right: 0;
  }

  .stats .stat:nth-last-child(-n+2) {
    border-bottom: 0;
  }

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

  .history-summary > div {
    border-bottom: 1px solid var(--border);
  }

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

  .attendance-roster[data-layout="grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .attendance-view-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .attendance-view-actions .button, .attendance-view-actions .text-button { justify-content: center; text-align: center; min-height: 44px; white-space: normal; }
  .attendance-view-actions #attendance-view-feedback { grid-column: 1 / -1; }
  .shell.standalone .topbar { flex-wrap: nowrap; }
  .shell.standalone .topbar .portal-context { display: none; }
  .shell.standalone .topbar .brand { white-space: nowrap; }
  .shell.standalone .topbar .user-menu { flex: none; }
  .shell:not(.standalone) .topbar { display: none; }
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 112px) 44px;
    grid-template-areas: "brand current account" "nav nav nav";
    gap: 8px 12px;
    padding: 9px 12px 0;
    overflow: visible;
  }
  .sidebar .brand { grid-area: brand; min-width: 0; padding: 0; }
  .sidebar .brand-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-current-section { grid-area: current; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; max-width: 155px; min-width: 0; line-height: 1.2; }
  .mobile-current-section small { color: var(--muted); font-size: .625rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
  .mobile-current-section strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--teal); font-size: .8125rem; }
  .mobile-account-menu { grid-area: account; display: block; position: relative; }
  .mobile-account-menu summary { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; list-style: none; }
  .mobile-account-menu summary::-webkit-details-marker { display: none; }
  .mobile-account-menu[open] summary { background: var(--mint); border-color: var(--teal); color: var(--teal); }
  .mobile-account-menu summary svg { width: 22px; height: 22px; }
  .mobile-account-panel { position: absolute; z-index: 40; top: 50px; right: 0; width: min(270px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); }
  .mobile-account-identity { display: flex; flex-direction: column; padding: 9px 11px 11px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: .875rem; }
  .mobile-account-identity small { color: var(--muted); }
  .mobile-account-panel a, .mobile-account-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; font-size: .875rem; font-weight: 550; }
  .mobile-account-panel a:hover, .mobile-account-panel button:hover { background: var(--surface-subtle); text-decoration: none; }
  .sidebar nav { grid-area: nav; width: 100%; min-width: 0; overflow-x: auto; padding: 1px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { min-height: 44px; }
  .sidebar nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--teal); }
  .attendance-complete { flex-direction: column; align-items: stretch; padding: 14px; }
  .attendance-complete .button { align-self: stretch; text-align: center; }
  .attendance-summary-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-toolbar, .activity-prompt { align-items: stretch; flex-direction: column; }
  .activity-prompt .button { margin-left: 0; text-align: center; }
  .fee-page-heading .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .fee-page-heading .actions .button { white-space: normal; text-align: center; }
  .fee-page-heading .actions .button:nth-child(3) { grid-column: 1 / -1; }
  .fee-page-heading .actions .button:last-child { grid-column: 1 / -1; }

  .fee-batch-list .batch-fee-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .fee-batch-list .batch-fee-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fee-batch-list .batch-fee-card > small { margin-top: 0; }
  .finance-grid > .panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .finance-grid > .panel:last-child { border-bottom: 0; }
  .student-result { flex-wrap: wrap; }
  .student-result .badge { margin-left: 56px; }

  .topbar {
    padding: 10px 16px;
  }

  main {
    padding: 18px 16px 36px;
  }

  .page-footer {
    padding: 14px 16px;
  }

  h1 {
    font-size: 1.375rem;
  }

  .page-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-heading .actions,
  .page-heading .button {
    width: 100%;
  }

  .panel {
    padding: 16px;
  }

  input:not([type]),
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .button {
    min-height: 44px;
  }

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

  .attendance-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-tools > div:first-child {
    max-width: none;
  }

  .attendance-roster[data-layout="grid"] {
    grid-template-columns: 1fr;
  }

  .attendance-person {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-person-actions {
    min-width: 0;
    width: 100%;
  }

  .attendance-save {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 420px) {
  .stats,
  .history-summary {
    grid-template-columns: 1fr;
  }

  .stats .stat,
  .history-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .stats .stat:last-child,
  .history-summary > div:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  html[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-subtle: #f5f5f5; --ink: #111; --ink-secondary: #333; --muted: #555; --border: #ddd; --border-strong: #bbb; --teal: #1d4ed8; --teal-dark: #1e40af; --on-accent: #fff; --mint: #eff6ff; --mint-ink: #1e40af; --warning-bg: #fffbeb; --warning-ink: #92400e; --danger-bg: #fef2f2; --danger-ink: #b91c1c; --success-bg: #ecfdf5; --success-ink: #065f46; --info-bg: #eff6ff; --info-ink: #1e40af; }
  .sidebar, .topbar, .no-print, .page-footer {
    display: none !important;
  }
  .shell {
    margin-left: 0 !important;
  }
  main {
    padding: 0 !important;
  }
  .panel {
    border: 0 !important;
    box-shadow: none !important;
  }
}

/* CentreDesk identity: dark navigation, calm work surface, focused accent. */
.sidebar,
.topbar {
  background: var(--chrome);
  border-color: var(--chrome-border);
  color: var(--chrome-muted);
}

.sidebar { background: linear-gradient(180deg, var(--chrome) 0%, var(--chrome-deep) 100%); }
.sidebar .brand,
.topbar .brand,
.sidebar .brand-text strong,
.topbar-brand strong { color: var(--chrome-ink); }
.sidebar .brand-text small,
.topbar-brand small { color: var(--chrome-muted); }
.brand-icon { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 12px rgba(70, 78, 220, .28); }

.sidebar nav a { color: var(--chrome-muted); }
.sidebar nav a svg { opacity: .9; }
.sidebar nav a:hover { background: var(--chrome-hover); color: var(--chrome-ink); }
.sidebar nav a[aria-current] {
  background: linear-gradient(105deg, rgba(50, 89, 225, .26), rgba(111, 72, 215, .19));
  color: var(--chrome-ink);
  box-shadow: inset 3px 0 0 #8195ff;
}
.sidebar nav a[aria-current] svg { color: #a4b4ff; }
.sidebar-footer { background: rgba(255, 255, 255, .055); border-color: var(--chrome-border); }
.sidebar-footer p { color: var(--chrome-ink); }
.sidebar-footer a { color: #bdcaff; }

.topbar { background: rgba(14, 20, 36, .96); }
.topbar .user-menu { color: var(--chrome-muted); }
.topbar .user-menu a { color: var(--chrome-ink); }
.topbar .user-menu a:hover { color: #b9c9ff; }
.topbar .user-menu .text-button { color: #b9c9ff; }
.topbar .theme-toggle { background: #1b2941; border-color: #3c4e72; color: var(--chrome-ink); }
.topbar .theme-toggle:hover { background: #293a59; color: #fff; }
.topbar .portal-context { color: var(--chrome-muted); }

.page-heading:not(.dashboard-hero) h1::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: .8em;
  margin-right: 12px;
  border-radius: 99px;
  background: var(--accent-gradient);
  vertical-align: -.04em;
}
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(1.5rem, 2.3vw, 2rem); letter-spacing: -.04em; }
.page-heading p { max-width: 70ch; }
.section-heading h2 { font-size: 1.13rem; letter-spacing: -.025em; }
.section-heading h2::before { content: ""; display: inline-block; width: 21px; height: 21px; margin-right: 10px; border-radius: 7px; background: var(--accent-gradient); vertical-align: -.23em; box-shadow: 0 3px 9px rgba(55, 75, 190, .18); }

.button:not(.secondary) { background: var(--accent-gradient); color: #fff; box-shadow: 0 3px 9px rgba(49, 82, 210, .15); }
.button:not(.secondary):hover { background: linear-gradient(115deg, #1d48c6, #5b3dbf); color: #fff; box-shadow: 0 7px 17px rgba(49, 82, 210, .2); transform: translateY(-1px); }
.button:not(.secondary):active { transform: translateY(0); box-shadow: none; }
.button.secondary:hover { transform: translateY(-1px); }
.button:disabled, .text-button:disabled { opacity: .55; transform: none; box-shadow: none; cursor: not-allowed; }

.panel, .stats, .finance-grid, .batch-list, .fee-batch-list, .compact-records { border-color: var(--border); }
.panel { box-shadow: 0 2px 9px rgba(18, 28, 55, .035); }
.stats { box-shadow: 0 6px 20px rgba(18, 28, 55, .045); }
.stats .stat.accent { background: linear-gradient(140deg, var(--mint), var(--surface)); }
.stats .stat.accent > strong { color: var(--mint-ink); }
.dashboard-grid .panel { box-shadow: 0 3px 12px rgba(18, 28, 55, .045); }
.student-result:hover, .compact-record:hover, tbody tr:hover { background: var(--surface-subtle); }
.compact-record, .student-result { transition: background-color .16s ease; }

.dashboard-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  min-height: 170px;
  padding: 27px 32px;
  border-radius: 18px;
  background: radial-gradient(circle at 85% 16%, rgba(132, 99, 244, .29), transparent 31%), linear-gradient(115deg, #101b3b 0%, #14234e 58%, #22245a 100%);
  box-shadow: 0 12px 28px rgba(13, 25, 68, .15);
  color: #fff;
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -95px;
  width: 245px;
  height: 245px;
  border: 1px solid rgba(188, 197, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(188, 197, 255, .04), 0 0 0 76px rgba(188, 197, 255, .035);
  pointer-events: none;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero .dashboard-eyebrow { display: block; margin-bottom: 10px; color: #b8caff; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dashboard-hero h1 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.dashboard-hero .muted { color: #d8e2ff; }
.dashboard-hero .button { background: #fff; color: #14234e; box-shadow: 0 8px 18px rgba(6, 12, 39, .2); }
.dashboard-hero .button:hover { background: #e9edff; color: #0c1b46; }

@media (max-width: 1024px) {
  .sidebar { background: var(--chrome); }
}
@media (max-width: 760px) {
  .sidebar .mobile-current-section small { color: var(--chrome-muted); }
  .sidebar .mobile-current-section strong { color: #c7d3ff; }
  .sidebar .mobile-account-menu summary { background: var(--chrome-hover); border-color: #3c4e72; color: var(--chrome-ink); }
  .sidebar .mobile-account-menu[open] summary { background: #304575; color: #fff; }
  .sidebar nav a[aria-current] { box-shadow: inset 0 -3px 0 #8195ff; }
  .dashboard-hero { min-height: 0; padding: 24px 20px; border-radius: 14px; }
  .dashboard-hero::after { opacity: .5; }
  .dashboard-hero .button { width: 100%; }
  .page-heading h1 { font-size: 1.55rem; }
}

@media (max-width: 900px) {
  [aria-labelledby="batch-fees-heading"] > .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Clearer records and mobile financial scanning. */
.panel, .table-wrap, .compact-records, .fee-batch-list, .batch-list {
  box-shadow: 0 4px 16px rgba(20, 38, 78, .045);
}
.compact-record, .fee-batch-list > *, .batch-list > *, tbody tr:not(:last-child) td {
  border-bottom-color: var(--border-strong);
}
.compact-record:hover, tbody tr:hover { background: var(--mint); }
.people-compact .badge.success { border-color: var(--success-border); box-shadow: 0 0 0 3px rgba(19, 150, 112, .07); }
.compact-record-batches { display: block; margin-top: 8px; color: var(--ink-secondary); font-size: .8rem; line-height: 1.45; }
.compact-record-batches > span { color: var(--teal-dark); font-weight: 700; }
.person-code-kind { color: var(--muted); }
.schedule-compact .compact-record-heading small { display: inline-block; width: fit-content; margin-top: 7px; padding: 4px 8px; border: 1px solid var(--info-border); border-radius: 7px; background: var(--info-bg); color: var(--info-ink); font-weight: 600; }
.schedule-compact .compact-record-heading time { padding: 4px 7px; border-radius: 7px; background: var(--surface-subtle); color: var(--ink-secondary); }
.schedule-compact .compact-record-meta { padding-left: 9px; border-left: 3px solid var(--accent-purple); color: var(--ink-secondary); }
.fee-batch-list .batch-fee-card { position: relative; border-bottom: 1px solid var(--border-strong); transition: background-color .17s ease, box-shadow .17s ease; }
.fee-batch-list .batch-fee-card::before { content: ""; position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-gradient); opacity: .55; transition: opacity .17s ease, width .17s ease; }
.fee-batch-list .batch-fee-card:hover, .fee-batch-list .batch-fee-card:focus-visible { background: var(--mint); box-shadow: inset 0 0 0 1px var(--border-strong); }
.fee-batch-list .batch-fee-card:hover::before, .fee-batch-list .batch-fee-card:focus-visible::before { opacity: 1; width: 5px; }
.fee-batch-list .batch-fee-card:last-child { border-bottom: 0; }
.attendance-panel { border-color: var(--border-strong); border-top: 3px solid #525ce2; }
.attendance-filters { padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-subtle); }
.attendance-display-form { border-color: var(--info-border); background: var(--mint); }
.attendance-heading h2 { color: var(--ink); }
.attendance-roster .attendance-person { border-color: var(--border-strong); }
.invoice-student-name { color: var(--ink); }
.invoice-student-name:hover { color: var(--teal-dark); }
.invoice-mobile-list { display: none; }
.batch-delete-panel { border-color: var(--danger-border); max-width: 760px; }
.batch-delete-panel h2 { color: var(--danger-ink); }
.button.danger:not(.secondary) { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-ink); box-shadow: none; }
.button.danger:not(.secondary):hover { background: var(--danger-border); color: var(--danger-ink); }

@media (max-width: 900px) {
  .invoice-table { display: none; }
  .invoice-mobile-list { display: block; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
  .invoice-mobile-row { padding: 16px; border-bottom: 1px solid var(--border-strong); }
  .invoice-mobile-row:last-child { border-bottom: 0; }
  .invoice-mobile-row:hover { background: var(--mint); }
  .invoice-mobile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .invoice-mobile-head strong { color: var(--ink); font-size: .96rem; }
  .invoice-mobile-head small { display: block; margin-top: 4px; color: var(--muted); }
  .invoice-mobile-description { margin: 8px 0 12px; color: var(--muted); font-size: .8rem; }
  .invoice-mobile-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; }
  .invoice-mobile-bottom small { display: block; color: var(--muted); font-size: .72rem; }
  .invoice-mobile-bottom strong { display: block; font-size: .84rem; font-variant-numeric: tabular-nums; }
  .invoice-mobile-bottom .button { min-height: 40px; }
  .invoice-mobile-row details { margin-top: 10px; font-size: .78rem; color: var(--muted); }
  .invoice-mobile-row details summary { width: fit-content; min-height: 34px; display: flex; align-items: center; color: var(--teal-dark); font-weight: 650; cursor: pointer; }
  .invoice-mobile-row details > div { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
}
@media (max-width: 420px) {
  .invoice-mobile-bottom { grid-template-columns: 1fr auto; }
  .invoice-mobile-bottom > span:nth-child(2) { grid-column: 1; }
  .invoice-mobile-bottom .button { grid-column: 2; grid-row: 1 / span 2; }
}

@media print {
  .dashboard-hero { background: #fff !important; color: #111 !important; box-shadow: none !important; padding: 0 !important; }
  .dashboard-hero h1, .dashboard-hero .muted { color: #111 !important; }
}

/* Distinct, restrained signals for the three financial questions on Overview. */
.finance-grid > .panel { position: relative; padding-top: 22px; }
.finance-grid > .panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--finance-line); }
.finance-collected { --finance-line: #159875; background: linear-gradient(180deg, var(--success-bg), var(--surface) 64%); }
.finance-outstanding { --finance-line: #cc8b16; background: linear-gradient(180deg, var(--warning-bg), var(--surface) 64%); }
.finance-overdue { --finance-line: #d24b68; background: linear-gradient(180deg, var(--danger-bg), var(--surface) 64%); }
.finance-collected .finance-label, .finance-collected.money strong { color: var(--success-ink); }
.finance-outstanding .finance-label, .finance-outstanding.money strong { color: var(--warning-ink); }
.finance-overdue .finance-label { color: var(--danger-ink); }
.finance-label { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.finance-icon { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; font-size: 1rem; font-weight: 800; background: currentColor; }
.finance-collected .finance-icon { color: var(--success-ink); background: var(--success-border); }
.finance-outstanding .finance-icon { color: var(--warning-ink); background: var(--warning-border); }
.finance-overdue .finance-icon { color: var(--danger-ink); background: var(--danger-border); }
.finance-grid .compact-row:hover { background: var(--danger-bg); }

/* Section accents carry through the shared navigation on every institute page. */
.sidebar nav a svg { opacity: 1; color: var(--nav-icon, #a4b4ff); }
.sidebar nav a[aria-current] svg { color: var(--nav-icon, #a4b4ff); }
.nav-overview { --nav-icon: #a9b9ff; }
.nav-people, .nav-team { --nav-icon: #82d7d1; }
.nav-batches, .nav-schedule { --nav-icon: #c6a6fa; }
.nav-attendance, .nav-messaging { --nav-icon: #91dcae; }
.nav-fees, .nav-subscription { --nav-icon: #f1bf78; }
.nav-audit { --nav-icon: #b6c6df; }
.sidebar nav a:hover svg, .sidebar nav a[aria-current] svg { filter: drop-shadow(0 0 5px currentColor); }

/* Put identity, status and action in view without horizontal scrolling on phones. */
.batch-fee-mobile-details { display: none; }
.student-fees-table th:nth-child(2), .student-fees-table th:nth-child(3) { color: var(--ink); }
.student-fees-table td:nth-child(3) .actions { flex-wrap: wrap; }
@media (max-width: 900px) {
  .student-fees-table table { table-layout: fixed; min-width: 0; }
  .student-fees-table th:nth-child(n+4), .student-fees-table td:nth-child(n+4) { display: none; }
  .student-fees-table th:first-child { width: 43%; }
  .student-fees-table th:nth-child(2) { width: 23%; }
  .student-fees-table th:nth-child(3) { width: 34%; }
  .student-fees-table td { padding: 13px 10px; vertical-align: top; }
  .student-fees-table td:first-child { overflow-wrap: anywhere; }
  .student-fees-table .badge { padding: 4px 6px; font-size: .72rem; white-space: normal; overflow-wrap: normal; word-break: keep-all; text-align: center; }
  .student-fees-table td:nth-child(3) .actions { display: grid; gap: 6px; }
  .student-fees-table td:nth-child(3) .button { min-height: 36px; padding: 7px 9px; font-size: .78rem; text-align: center; }
  .batch-fee-mobile-details { display: grid; gap: 3px; margin-top: 9px; color: var(--muted); font-size: .72rem; line-height: 1.4; }
  .batch-fee-mobile-details strong { color: var(--ink); font-weight: 700; }
}
@media (max-width: 480px) {
  .student-fees-table table { font-size: .75rem; }
  .student-fees-table .badge { font-size: .68rem; }
  .student-fees-table .badge.warning { max-width: 100%; }
  .student-fees-table { border-left: 0; border-right: 0; border-radius: 0; }
  .student-fees-table th, .student-fees-table td { padding-left: 7px; padding-right: 7px; }
  .student-fees-table th:first-child { width: 42%; }
  .student-fees-table th:nth-child(2) { width: 25%; }
  .student-fees-table th:nth-child(3) { width: 33%; }
}

/* Delayed progress feedback prevents a flash during quick local searches. */
.loading-indicator { display: flex; align-items: center; gap: 9px; width: fit-content; margin: 12px; padding: 8px 12px; border: 1px solid var(--info-border); border-radius: 9px; background: var(--info-bg); color: var(--info-ink); font-size: .8rem; font-weight: 650; }
.loading-indicator::before { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: loading-turn .7s linear infinite; }
@keyframes loading-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-indicator::before { animation: none; border-right-color: currentColor; } }

/* Type hierarchy shared by records, forms and financial pages. Color supports size and weight. */
main .section-heading h2,
main .panel-heading h2,
main .panel > h2 { color: var(--section-ink); }
main .page-heading:not(.dashboard-hero) p { color: var(--support-ink); }
main .field > label,
main .choice-field > legend,
main .filters label,
main .attendance-tools label,
main .attendance-customize-body > label { color: var(--field-label-ink); }
main th { color: var(--table-heading-ink); }
main .stat > span { color: var(--field-label-ink); }
main .stat small,
main .panel-heading > .muted,
main .compact-record-meta { color: var(--support-ink); }
main .attendance-heading h2 { color: var(--section-ink); }
main .attendance-heading .muted { color: var(--support-ink); }
.attendance-count { font-weight: 700; }
.attendance-count.needs-review { color: var(--review-ink); }
.attendance-count.complete { color: var(--success-ink); }
.attendance-view-switch legend { color: var(--field-label-ink); }
.attendance-customize > summary { color: var(--section-ink); font-weight: 700; }
.attendance-view-switch input:checked + span { color: var(--section-ink); font-weight: 700; }
.attendance-view-actions #attendance-view-feedback { color: var(--support-ink); }
@media print { html[data-theme="dark"] { --section-ink: #273d7d; --field-label-ink: #374f89; --support-ink: #52647d; --table-heading-ink: #405989; --review-ink: #895002; } }

/* Batches are independent records, with the same clear boundary on phone and desktop. */
.batch-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; gap: 18px; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.batch-list > .batch-card { position: relative; padding: 20px 22px; border: 1px solid var(--border-strong); border-top: 3px solid var(--teal); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .16s ease, box-shadow .16s ease; }
.batch-list > .batch-card:nth-child(2n) { border-top-color: var(--accent-purple); }
.batch-list > .batch-card:hover { border-color: var(--teal); background: var(--surface); box-shadow: var(--shadow-md); }
.batch-list > .batch-card h2 { margin-top: 8px; }
.batch-list > .batch-card h3 { margin-top: 18px; }
.batch-card .panel-heading { margin-bottom: 12px; }
.batch-card .panel-heading > a { font-weight: 700; }
.batch-card .badge { gap: 6px; }
.batch-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-ink); }
.badge.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-ink); }
.batch-subheading, .batch-history-link { display: flex; align-items: center; gap: 10px; }
.batch-subheading { color: var(--field-label-ink); }
.batch-section-icon { display: inline-grid; place-items: center; flex: none; width: 29px; height: 29px; border: 1px solid; border-radius: 9px; }
.batch-section-icon svg { width: 16px; height: 16px; }
.batch-section-icon.teachers { color: var(--section-ink); background: var(--mint); border-color: var(--info-border); }
.batch-section-icon.students { color: var(--success-ink); background: var(--success-bg); border-color: var(--success-border); }
.batch-section-icon.fees { color: var(--warning-ink); background: var(--warning-bg); border-color: var(--warning-border); }
.batch-section-icon.history { color: var(--info-ink); background: var(--info-bg); border-color: var(--info-border); }
.batch-disclosure { border-top: 1px solid var(--border); padding-top: 10px; }
.batch-disclosure > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; list-style: none; cursor: pointer; color: var(--field-label-ink); font-weight: 700; }
.batch-disclosure > summary::-webkit-details-marker { display: none; }
.batch-disclosure > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .16s ease; }
.batch-disclosure[open] > summary::after { transform: rotate(225deg); }
.batch-disclosure > summary:hover { color: var(--teal-dark); }
.batch-history-link { width: fit-content; min-height: 44px; margin-top: 12px; }
@media (max-width: 760px) {
  .batch-list > .batch-card { border: 1px solid var(--border-strong) !important; border-top: 3px solid var(--teal) !important; box-shadow: var(--shadow-sm) !important; }
  .batch-list > .batch-card:nth-child(2n) { border-top-color: var(--accent-purple) !important; }
}
@media print { .batch-list > .batch-card { border: 0 !important; box-shadow: none !important; break-inside: avoid; } }

/* Semantic color hierarchy: identity, context, outcome and action stay distinct. */
:root {
  --violet-ink: #6033b3;
  --violet-soft: #f5f0ff;
  --violet-border: #d8c6ff;
}
html[data-theme="dark"] {
  --violet-ink: #d2bdff;
  --violet-soft: #30234b;
  --violet-border: #7854ac;
}

/* The same metric grammar appears on the overview, fees and batch fee pages. */
.stats .stat { border-top: 3px solid transparent; }
.stats .stat:nth-child(1) { border-top-color: var(--teal); }
.stats .stat:nth-child(2) { border-top-color: var(--accent-purple); background: linear-gradient(180deg, var(--violet-soft), var(--surface) 82%); }
.stats .stat:nth-child(3) { border-top-color: var(--warning-ink); }
.stats .stat:nth-child(4) { border-top-color: var(--success-ink); }
.stats .stat:nth-child(1) > strong { color: var(--section-ink); }
.stats .stat:nth-child(2) > strong { color: var(--violet-ink); }
.stats .stat:nth-child(3) > strong { color: var(--warning-ink); }
.stats .stat:nth-child(4) > strong { color: var(--success-ink); }
.stats[aria-label="Fee summary"] .stat:nth-child(2) { border-top-color: var(--success-ink); background: linear-gradient(180deg, var(--success-bg), var(--surface) 82%); }
.stats[aria-label="Fee summary"] .stat:nth-child(2) > strong { color: var(--success-ink); }
.stats[aria-label="Fee summary"] .stat:nth-child(4) { border-top-color: var(--violet-ink); }
.stats[aria-label="Fee summary"] .stat:nth-child(4) > strong { color: var(--violet-ink); }
.stats[aria-label="Batch fee totals"] .stat:nth-child(2) { border-top-color: var(--success-ink); background: linear-gradient(180deg, var(--success-bg), var(--surface) 82%); }
.stats[aria-label="Batch fee totals"] .stat:nth-child(2) > strong { color: var(--success-ink); }
.stats[aria-label="Batch fee totals"] .stat:nth-child(4) { border-top-color: var(--violet-ink); }
.stats[aria-label="Batch fee totals"] .stat:nth-child(4) > strong { color: var(--violet-ink); }
.stats .stat > small { color: var(--support-ink); }

.dashboard-sessions { border-top: 3px solid var(--violet-ink); }
.dashboard-attendance { border-top: 3px solid var(--success-ink); }
.dashboard-sessions .session-row .grow > strong { color: var(--section-ink); }
.dashboard-sessions .session-row .align-right > strong { color: var(--violet-ink); }
.dashboard-attendance > p:first-of-type { color: var(--review-ink); font-weight: 650; }
.dashboard-attendance > h2 { color: var(--success-ink); }

/* Records use one accent for identity and another for status or money. */
.compact-record-heading > div > strong,
.student-result strong,
.fee-history-head > div > strong,
.session-row .grow > strong { color: var(--section-ink); }
.compact-record-heading time { color: var(--violet-ink); }
.compact-record-meta { color: var(--support-ink); }
.student-result small:first-of-type,
.fee-history-head small { color: var(--support-ink); }
.student-result .badge { font-weight: 700; }
.fee-batch-list .panel-heading strong { color: var(--section-ink); }
.fee-batch-list .batch-fee-metrics > div:nth-child(3) strong { color: var(--success-ink); }
.fee-batch-list .batch-fee-metrics > div:nth-child(4) strong { color: var(--warning-ink); }
.fee-batch-list .batch-fee-metrics small { color: var(--field-label-ink); }
.fee-totals > div { padding: 8px 12px; border-radius: 9px; background: var(--surface-subtle); }
.fee-totals > div:first-child { background: var(--warning-bg); }
.fee-totals > div:first-child strong { color: var(--warning-ink); }
.fee-totals > div:nth-child(2) { background: var(--success-bg); }
.fee-totals > div:nth-child(2) strong { color: var(--success-ink); }
.fee-totals span { color: var(--field-label-ink); font-weight: 650; }
.fee-history-amounts > :nth-child(1) { color: var(--support-ink); }
.fee-history-amounts > :nth-child(2) { color: var(--success-ink); font-weight: 700; }
.fee-history-amounts > :nth-child(3) { color: var(--warning-ink); font-weight: 700; }
.details dt { color: var(--field-label-ink); font-weight: 600; }
.details dd { color: var(--ink); font-weight: 650; }
.details .total { padding: 12px; margin-top: 7px; border-radius: 9px; background: var(--warning-bg); }
.details .total dt, .details .total dd { color: var(--warning-ink); }
.receipt .details .total { background: var(--success-bg); }
.receipt .details .total dt, .receipt .details .total dd { color: var(--success-ink); }

/* Setup panels carry a different cue from the records they govern. */
.team-access-panel { border-top: 3px solid var(--violet-ink); }
.team-login-panel { border-top: 3px solid var(--teal); }
.team-access-panel .compact-row strong { color: var(--section-ink); }
.team-access-panel .compact-row small { color: var(--support-ink); }
.team-access-panel .sandbox-box { border-color: var(--violet-border); background: var(--violet-soft); }
.team-access-panel .sandbox-box h3,
.team-access-panel .sandbox-box p > strong { color: var(--violet-ink); }
.team-access-panel .sandbox-box p { color: var(--ink-secondary); }
.team-access-panel > h2 { color: var(--violet-ink); }
.team-login-panel > h2 { color: var(--section-ink); }
.whatsapp-connection-panel { border-top: 3px solid var(--success-ink); }
.whatsapp-draft-panel { border-top: 3px solid var(--violet-ink); }
.whatsapp-permission-panel { border-top: 3px solid var(--warning-ink); }
.whatsapp-connection-panel > h2 { color: var(--success-ink); }
.whatsapp-draft-panel > h2 { color: var(--violet-ink); }
.whatsapp-permission-panel > h2 { color: var(--warning-ink); }
.gateway-choice-panel { border-top: 3px solid var(--violet-ink); }
.gateway-setup-panel { border-top: 3px solid var(--teal); }
.gateway-choice-panel > h2 { color: var(--violet-ink); }
.gateway-setup-panel > h2 { color: var(--section-ink); }
.gateway-provider-list > div { border-top: 3px solid var(--border-strong); background: var(--surface-subtle); }
.gateway-provider-list > div:first-child { border-top-color: var(--teal); background: var(--info-bg); }
.gateway-provider-list > div:first-child strong { color: var(--info-ink); }
.gateway-provider-list > div:not(:first-child) strong { color: var(--support-ink); }
.gateway-provider-list p { color: var(--ink-secondary); font-size: .875rem; }
.gateway-provider-list a { font-weight: 700; }
.subscription-plan { border-top: 3px solid var(--teal); }
.subscription-plan:nth-child(2) { border-top-color: var(--violet-ink); background: linear-gradient(180deg, var(--violet-soft), var(--surface) 75%); }
.subscription-plan:nth-child(3) { border-top-color: var(--success-ink); }
.subscription-plan h2 { color: var(--section-ink); }
.subscription-plan:nth-child(2) h2 { color: var(--violet-ink); }
.subscription-plan:nth-child(3) h2 { color: var(--success-ink); }
.subscription-plan p { color: var(--support-ink); }
.current-plan-panel { border-top: 3px solid var(--violet-ink); }
.current-plan-panel > h2 { color: var(--violet-ink); }
.current-plan-panel .details > div:first-child dd { color: var(--violet-ink); }
.billing-terms-panel { border-top: 3px solid var(--teal); }
.joining-concession-panel { border-top: 3px solid var(--warning-ink); }
.invoice-summary-panel { border-top: 3px solid var(--violet-ink); }
.invoice-collect-panel { border-top: 3px solid var(--success-ink); }
.billing-terms-panel > h2, .invoice-summary-panel h2 { color: var(--section-ink); }
.joining-concession-panel > h2:first-child { color: var(--warning-ink); }
.joining-concession-panel > h2.spaced, .invoice-collect-panel > h2 { color: var(--success-ink); }

.attendance-filters { background: linear-gradient(135deg, var(--info-bg), var(--surface-subtle) 65%); }
.attendance-filters .field:nth-child(2) > label { color: var(--violet-ink); }
.attendance-filters .field:nth-child(3) > label { color: var(--success-ink); }
.attendance-view-switch { border-color: var(--info-border); }
.attendance-heading h2 { color: var(--section-ink); }
.attendance-summary-counts span:nth-child(1) strong { color: var(--success-ink); }
.attendance-summary-counts span:nth-child(2) strong { color: var(--danger-ink); }
.attendance-summary-counts span:nth-child(3) strong { color: var(--warning-ink); }
.attendance-summary-counts span:nth-child(4) strong { color: var(--info-ink); }
.history-summary > div:nth-child(2) strong { color: var(--success-ink); }
.history-summary > div:nth-child(3) strong { color: var(--warning-ink); }
.history-summary > div:nth-child(4) strong { color: var(--danger-ink); }
.history-summary > div:nth-child(5) strong { color: var(--info-ink); }
.history-summary span { color: var(--support-ink); font-weight: 600; }

.empty { background: linear-gradient(120deg, var(--info-bg), var(--surface)); border-color: var(--info-border); }
.empty h3 { color: var(--section-ink); }
.empty p { color: var(--support-ink); }

@media (max-width: 760px) {
  .panel.team-access-panel, .panel.team-login-panel, .panel.whatsapp-connection-panel,
  .panel.whatsapp-draft-panel, .panel.whatsapp-permission-panel, .panel.gateway-choice-panel,
  .panel.gateway-setup-panel, .panel.subscription-plan, .panel.current-plan-panel,
  .panel.billing-terms-panel, .panel.joining-concession-panel, .panel.invoice-summary-panel,
  .panel.invoice-collect-panel, .panel.dashboard-sessions, .panel.dashboard-attendance {
    border: 1px solid var(--border) !important;
    border-top: 3px solid var(--teal) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .panel.team-access-panel, .panel.whatsapp-draft-panel, .panel.gateway-choice-panel,
  .panel.current-plan-panel, .panel.invoice-summary-panel { border-top-color: var(--violet-ink) !important; }
  .panel.whatsapp-permission-panel, .panel.joining-concession-panel { border-top-color: var(--warning-ink) !important; }
  .panel.whatsapp-connection-panel, .panel.subscription-plan:nth-child(3),
  .panel.invoice-collect-panel, .panel.dashboard-attendance { border-top-color: var(--success-ink) !important; }
  .panel.subscription-plan:nth-child(2) { border-top-color: var(--violet-ink) !important; }
}
@media print {
  .panel, .stats .stat { border-top-color: var(--border) !important; }
  .empty, .subscription-plan, .fee-totals > div, .details .total { background: #fff !important; }
}

/* Platform operator: public content and institute work stay easy to scan. */
.platform-quick-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.platform-quick-nav a { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-content: center; column-gap: 11px; min-height: 78px; padding: 13px; border: 1px solid var(--border); border-top: 3px solid var(--teal); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.platform-quick-nav a:nth-child(2) { border-top-color: var(--violet-ink); }
.platform-quick-nav a:nth-child(3) { border-top-color: var(--success-ink); }
.platform-quick-nav a:nth-child(4) { border-top-color: var(--warning-ink); }
.platform-quick-nav a:hover { border-color: var(--teal); box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-2px); }
.platform-quick-nav a > span { grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--info-bg); color: var(--info-ink); font-size: 1.2rem; }
.platform-quick-nav a:nth-child(2) > span { background: var(--violet-soft); color: var(--violet-ink); }
.platform-quick-nav a:nth-child(3) > span { background: var(--success-bg); color: var(--success-ink); }
.platform-quick-nav a:nth-child(4) > span { background: var(--warning-bg); color: var(--warning-ink); }
.platform-quick-nav strong { font-size: .875rem; line-height: 1.3; }
.platform-quick-nav small { color: var(--support-ink); }
.platform-operator-forms { margin-top: 20px; }
.platform-provision-panel { border-top: 3px solid var(--success-ink); }
.platform-password-panel { border-top: 3px solid var(--warning-ink); }
.platform-provision-panel > h2 { color: var(--success-ink); }
.platform-password-panel > h2 { color: var(--warning-ink); }
.platform-institutes { border-top: 3px solid var(--teal); }
.platform-institutes > h2 { color: var(--section-ink); }
.platform-institute-mobile { display: none; }
.platform-institute-record { padding: 15px 0; border-top: 1px solid var(--border-strong); }
.platform-institute-record:first-child { border-top: 0; }
.platform-institute-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.platform-institute-head strong { display: block; color: var(--section-ink); }
.platform-institute-record p { margin: 10px 0 2px; color: var(--support-ink); font-size: .875rem; }
.platform-institute-record p strong { color: var(--ink); }
.platform-institute-record .actions { margin-top: 12px; }
.platform-institute-record .actions details { flex: 1; }
.platform-institute-record .actions summary { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--teal); font-size: .875rem; font-weight: 700; cursor: pointer; list-style: none; }
.platform-institute-record .actions summary::-webkit-details-marker { display: none; }
.platform-institute-record .actions form { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.platform-institute-record .actions label { color: var(--field-label-ink); font-size: .8rem; font-weight: 700; }
.platform-institute-record .actions .button { flex: 1; }

.platform-page-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.platform-page-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) auto; align-items: center; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--border-strong); }
.platform-page-row:last-child { border-bottom: 0; }
.platform-page-row:hover { background: var(--surface-subtle); }
.platform-page-identity strong { display: block; color: var(--section-ink); }
.platform-page-identity small { margin-top: 4px; font-family: var(--font-mono); }
.platform-page-state small { margin-top: 5px; color: var(--support-ink); }
.platform-page-row .actions { justify-content: flex-end; }
.platform-editor-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, .8fr); align-items: start; gap: 18px; }
.platform-editor-panel { border-top: 3px solid var(--violet-ink); }
.platform-editor-panel textarea { min-height: 260px; line-height: 1.6; resize: vertical; }
.platform-editor-help { border-top: 3px solid var(--teal); }
.platform-editor-help p { color: var(--support-ink); font-size: .875rem; }
.platform-editor-help a { font-weight: 700; }
.platform-subscription-panel { border-top: 3px solid var(--violet-ink); }
.platform-integration-panel { border-top: 3px solid var(--teal); }
.platform-team-panel { border-top: 3px solid var(--success-ink); }
.platform-activity-panel { border-top: 3px solid var(--warning-ink); }
.platform-team-mobile, .platform-activity-mobile { display: none; }
.platform-team-record, .platform-activity-mobile article { padding: 14px 0; border-top: 1px solid var(--border-strong); }
.platform-team-record:first-child, .platform-activity-mobile article:first-child { border-top: 0; }
.platform-team-record > small { margin: 8px 0; color: var(--support-ink); }
.platform-team-record details { margin-top: 8px; }
.platform-team-record summary { width: fit-content; min-height: 44px; display: flex; align-items: center; color: var(--teal); font-weight: 700; cursor: pointer; }
.platform-team-record form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.platform-team-record label { color: var(--field-label-ink); font-size: .8rem; font-weight: 700; }
.platform-activity-mobile strong { display: block; color: var(--section-ink); }
.platform-activity-mobile small { color: var(--support-ink); }
.platform-activity-mobile span { color: var(--ink-secondary); font-size: .8rem; }
.standalone-account-menu { display: none; }

@media (max-width: 900px) {
  .platform-quick-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-page-row { grid-template-columns: minmax(0, 1fr) auto; }
  .platform-page-state { grid-column: 1; }
  .platform-page-row .actions { grid-column: 2; grid-row: 1 / span 2; }
  .platform-editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .standalone .standalone-user-menu { display: none; }
  .standalone-account-menu { position: relative; display: block; flex: none; }
  .standalone-account-menu > summary { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--chrome-border); border-radius: 9px; background: var(--chrome-hover); color: var(--chrome-ink); cursor: pointer; list-style: none; }
  .standalone-account-menu > summary::-webkit-details-marker { display: none; }
  .standalone-account-menu > summary svg { width: 22px; height: 22px; }
  .standalone-account-panel { position: absolute; z-index: 40; top: 50px; right: 0; width: min(250px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); }
  .standalone-account-panel > strong { display: block; padding: 8px 11px; border-bottom: 1px solid var(--border); color: var(--section-ink); font-size: .875rem; }
  .standalone-account-panel a, .standalone-account-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; font-size: .875rem; font-weight: 600; }
  .standalone-account-panel a:hover, .standalone-account-panel button:hover { background: var(--surface-subtle); text-decoration: none; }
  .standalone-account-panel form { margin: 0; }
  .platform-quick-nav { gap: 8px; }
  .platform-quick-nav a { min-height: 72px; padding: 10px; }
  .platform-quick-nav small { font-size: .7rem; }
  .platform-institutes > .table-wrap { display: none; }
  .platform-institute-mobile { display: block; }
  .platform-detail-table { display: none; }
  .platform-team-mobile, .platform-activity-mobile { display: block; }
  .platform-page-row { grid-template-columns: 1fr; gap: 8px; padding: 15px; }
  .platform-page-state, .platform-page-row .actions { grid-column: 1; grid-row: auto; }
  .platform-page-row .actions { justify-content: flex-start; }
  .platform-page-row .button { min-height: 44px; }
  .platform-editor-panel, .platform-editor-help, .platform-institutes,
  .platform-provision-panel, .platform-password-panel, .platform-subscription-panel,
  .platform-integration-panel, .platform-team-panel, .platform-activity-panel {
    border: 1px solid var(--border) !important;
    border-top: 3px solid var(--teal) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .platform-editor-panel, .platform-subscription-panel { border-top-color: var(--violet-ink) !important; }
  .platform-provision-panel, .platform-team-panel { border-top-color: var(--success-ink) !important; }
  .platform-password-panel, .platform-activity-panel { border-top-color: var(--warning-ink) !important; }
}
@media (prefers-reduced-motion: reduce) { .platform-quick-nav a { transition: none; } }

.student-result-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.student-result-main { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 0; color: inherit; text-decoration: none; }
.student-result-main > span:not(.photo-placeholder):not(.badge) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.student-result-actions { flex-shrink: 0; }
.due-queue-list { display: grid; gap: 8px; }
.due-queue-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.due-queue-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.due-queue-row small { color: var(--muted); }
.fee-settings-drawer summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.fee-settings-drawer summary::-webkit-details-marker { display: none; }
.fee-settings-body { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .student-result-actions, .due-queue-row .actions { width: 100%; justify-content: flex-start; }
}
.multi-collect-list { display: grid; gap: 8px; }
.multi-collect-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.multi-collect-row.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.multi-collect-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.multi-collect-info { display: grid; gap: 2px; min-width: 0; }
.multi-collect-info small { color: var(--muted); }
.multi-collect-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.multi-collect-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; align-items: end; }
.multi-collect-hold { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.multi-collect-hold input { width: auto; margin: 0; }
.waive-bill-details summary { cursor: pointer; font-size: .875rem; color: var(--muted); }
.waive-bill-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.waive-bill-form input[type="text"] { flex: 1 1 220px; }
@media (max-width: 600px) {
  .multi-collect-row { grid-template-columns: auto 1fr; }
  .multi-collect-amount { justify-self: end; }
}

.stack-form { display: grid; gap: 14px; }
.stack-form .field { display: grid; gap: 6px; }
.batch-invoices-mobile,
.history-batch-mobile,
.audit-mobile,
.pending-conf-mobile { display: none; }
.gateway-provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.gateway-provider-card { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; text-decoration: none; }
.gateway-provider-card:hover { border-color: var(--accent); text-decoration: none; }
.gateway-provider-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
.history-grid th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; }
@media (max-width: 760px) {
  .batch-invoices-table,
  .history-batch-table,
  .audit-table,
  .pending-conf-table { display: none; }
  .batch-invoices-mobile,
  .history-batch-mobile,
  .audit-mobile,
  .pending-conf-mobile { display: grid; gap: 10px; }
  .attendance-roster { max-height: none !important; overflow: visible !important; }
  .attendance-save { position: static !important; }
  .attendance-person-actions button { min-height: 44px; }
  .batch-card .actions a { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; }
  .page-footer .actions a { min-height: 36px; display: inline-flex; align-items: center; }
}

/* Official Public Landing Page + 3D Stage + Motion Demo Cinema */
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 36px; align-items: center; padding: 16px 0 8px; }
.landing-hero-copy { display: grid; gap: 14px; }
.landing-hero-copy h1 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); line-height: 1.12; letter-spacing: -.025em; margin: 0; }
.landing-lead { font-size: 1.05rem; line-height: 1.55; max-width: 58ch; }
.landing-offer-pill { justify-self: start; }
.landing-trust-row { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.landing-stage-3d { position: relative; min-height: 320px; display: grid; place-items: center; perspective: 1200px; }
.stage-desktop-card { width: 100%; max-width: 440px; padding: 16px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 50px -18px rgba(15, 23, 42, .25); transform: rotateY(-10deg) rotateX(6deg); transition: transform .5s ease; }
.landing-stage-3d:hover .stage-desktop-card { transform: rotateY(-3deg) rotateX(2deg); }
.stage-chrome { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.stage-chrome span { width: 9px; height: 9px; border-radius: 999px; background: var(--border-strong); }
.stage-chrome small { margin-left: auto; color: var(--muted); font-size: .75rem; }
.stage-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stage-kpis > div { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.stage-kpis small { display: block; color: var(--muted); font-size: .72rem; }
.stage-kpis strong { font-size: 1rem; }
.stage-green { color: var(--success-ink); }
.stage-bars { display: grid; gap: 8px; font-size: .8rem; }
.stage-track { height: 7px; border-radius: 999px; background: var(--surface-subtle); overflow: hidden; margin-top: 4px; }
.stage-track > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.stage-phone-card { position: absolute; right: -4px; bottom: -10px; width: 205px; padding: 14px; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .32); transform: translateZ(36px) rotateY(-6deg); animation: floatPhone 5s ease-in-out infinite; }
.stage-phone-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .8rem; margin-bottom: 6px; }
.stage-phone-card p { margin: 0; font-size: .78rem; color: var(--muted); }
.stage-phone-amount { font-size: 1.25rem; font-weight: 700; margin: 6px 0 8px; }
.stage-phone-qr { padding: 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); text-align: center; font-size: .78rem; font-weight: 600; }
@keyframes floatPhone { 0%, 100% { transform: translateY(0) rotateY(-6deg); } 50% { transform: translateY(-7px) rotateY(-4deg); } }

.demo-viewport { position: relative; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-subtle); padding: 20px; min-height: 230px; }
.demo-progress-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border); }
.demo-progress-bar > span { display: block; height: 100%; width: 0%; background: var(--accent); }
.demo-scene { display: none; animation: demoFadeIn .35s ease; }
.demo-scene.is-active { display: grid; gap: 12px; }
.demo-scene-badge { display: inline-block; justify-self: start; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.demo-scene h3 { margin: 0; font-size: 1.2rem; }
.demo-mock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.demo-mock-card, .demo-mock-row { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: grid; gap: 4px; }
.demo-mock-list { display: grid; gap: 8px; }
.demo-mock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.demo-mock-row small { display: block; color: var(--muted); }
.demo-mock-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.demo-chapters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.demo-chapter { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 600; text-align: left; cursor: pointer; }
.demo-chapter.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
@keyframes demoFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.landing-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.landing-feature-grid .panel { display: grid; gap: 8px; align-content: start; }
.landing-feature-grid .badge { justify-self: start; }
.landing-cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-color: var(--accent); }
.landing-faq { display: grid; gap: 10px; }
.landing-faq summary { cursor: pointer; min-height: 28px; }
.landing-faq p { margin: 10px 0 0; }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; gap: 22px; }
  .stage-desktop-card { transform: none; }
  .stage-phone-card { position: static; width: 100%; margin-top: 10px; transform: none; animation: none; }
}
.landing-announcement { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); font-size: .875rem; font-weight: 600; margin-bottom: 12px; }
.landing-metrics-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.landing-metrics-strip > div { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: grid; gap: 2px; }
.landing-metrics-strip strong { font-size: 1.35rem; color: var(--accent); }
.landing-metrics-strip span { font-size: .82rem; color: var(--muted); }
.stage-app-shell { display: grid; grid-template-columns: 102px 1fr; gap: 12px; }
.stage-sidebar { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: #0f172a; color: #cbd5e1; font-size: .74rem; align-content: start; }
.stage-brand { display: flex; align-items: center; gap: 6px; color: #fff; margin-bottom: 4px; }
.stage-brand span { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .72rem; }
.stage-sidebar > span { padding: 4px 7px; border-radius: 6px; }
.stage-sidebar > span.is-on { background: rgba(59, 130, 246, .22); color: #fff; font-weight: 600; }
.demo-video-embed video { width: 100%; border-radius: 10px; border: 1px solid var(--border); max-height: 420px; background: #000; }
.demo-browser-frame { position: relative; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.demo-browser-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.demo-dots { display: flex; gap: 6px; }
.demo-dots span { width: 9px; height: 9px; border-radius: 999px; background: var(--border-strong); }
.demo-url-pill { font-size: .78rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, monospace; }
.demo-app-body { display: grid; grid-template-columns: 190px 1fr; min-height: 270px; }
.demo-mini-sidebar { display: grid; gap: 6px; padding: 14px; background: #0f172a; color: #cbd5e1; align-content: start; }
.demo-mini-brand { display: flex; align-items: center; gap: 8px; color: #fff; margin-bottom: 8px; }
.demo-mini-brand span { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; font-weight: 700; }
.demo-mini-brand small { display: block; color: #94a3b8; font-size: .72rem; }
.demo-nav-item { min-height: 40px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #cbd5e1; text-align: left; font-weight: 600; cursor: pointer; }
.demo-nav-item.is-active { background: rgba(59, 130, 246, .25); color: #fff; }
.demo-mini-main { padding: 18px; background: var(--surface-subtle); }
.demo-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.demo-mini-head h3 { margin: 0; font-size: 1.1rem; }
.demo-att-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-att-pills button { min-height: 36px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: .8rem; font-weight: 600; cursor: pointer; }
.demo-att-pills button.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.demo-check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.demo-check-label input { width: 17px; height: 17px; margin: 0; }
@media (max-width: 760px) {
  .demo-app-body { grid-template-columns: 1fr; }
  .demo-mini-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-mini-brand { grid-column: 1 / -1; margin-bottom: 2px; }
  .stage-app-shell { grid-template-columns: 1fr; }
  .stage-sidebar { display: none; }
}
