.payment-finance-warning {
  padding: 10px 14px;
  background: #fff4ce;
  color: #6d4910;
  border: 1px solid #dcc276;
  border-radius: 6px;
}
.payment-row-actions {
  min-width: 205px;
}
.payment-row-actions button {
  margin: 2px 3px 2px 0;
}
.dialog.payment-edit-dialog {
  width: min(770px, calc(100vw - 32px));
}
.payment-edit-dialog h3 {
  margin: 16px 0 8px;
}
.payment-edit-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 12px;
  min-width: 0;
  padding: 10px 12px 12px;
}
.payment-edit-line:disabled {
  background: var(--paper);
  color: var(--muted);
}
.payment-edit-line:disabled :is(input, select) {
  background: var(--paper);
  color: var(--muted);
}
.payment-edit-dialog label[hidden] {
  display: none;
}
.payment-edit-dialog [role="alert"]:empty {
  display: none;
}
@media print {
  .payment-related-link { display: none !important; }
}

:root {
  --ink: #24313a;
  --muted: #687984;
  --line: #dce5e7;
  --paper: #f7faf9;
  --white: #ffffff;
  --teal: #167d7f;
  --teal-dark: #0d5f62;
  --coral: #d95d4f;
  --gold: #b98221;
  --leaf: #5e8d47;
  --shadow: 0 18px 45px rgba(34, 49, 58, .12);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.auth-locked {
  overflow: hidden;
}

button, input, select { font: inherit; }

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(247, 250, 249, .94);
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.login-brand span,
.login-card p,
.login-demo-list,
.login-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
}

.login-message.error {
  color: var(--coral);
}

.login-demo-list {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 8px;
  background: #f7faf9;
}

.login-demo-list strong {
  color: var(--ink);
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #15333a;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f1c15c;
  color: #15333a;
  font-size: 26px;
  font-weight: 800;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  flex: 0 0 auto;
}

.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; }
.brand span { color: #b9ced0; font-size: 12px; margin-top: 3px; }

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.growth-workbench-link {
  border: 0;
  color: #d5e4e5;
  background: transparent;
  min-height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.nav-item span, .growth-workbench-link span { width: 22px; text-align: center; }
.nav-item:hover, .nav-item.active, .growth-workbench-link:hover { background: rgba(255,255,255,.12); color: #fff; }

.shell {
  min-width: 0;
  padding: 26px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal, #147e80);
  font-size: 13px;
  font-weight: 700;
}

h1, h2, p { margin-top: 0; }
.dialog.payment-corrections-dialog { width: min(1120px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.payment-corrections-dialog > .dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.payment-correction-review-entry { display: flex; justify-content: flex-end; margin-bottom: 12px; }
#paymentCorrectionsWorkspace { min-width: 0; padding: 16px 20px 20px; }
#paymentCorrectionsWorkspace [role="alert"]:empty, #paymentCorrectionsWorkspace [role="status"]:empty { display: none; }
#paymentCorrectionsWorkspace > .hr-actions { margin: 14px 0; }
#paymentCorrectionsWorkspace input, #paymentCorrectionsWorkspace select { max-width: 100%; min-width: 0; }
#paymentCorrectionsWorkspace table { width: 100%; }
#paymentCorrectionsWorkspace .hr-table-wrap { max-width: 100%; overflow: auto; }
#paymentCorrectionsWorkspace .hr-table-wrap > table { min-width: 740px; }
#paymentCorrectionsWorkspace th, #paymentCorrectionsWorkspace td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
#paymentCorrectionsWorkspace .hr-table-wrap > table > :is(thead, tbody) > tr > :first-child { min-width: 100px; }
#paymentCorrectionsWorkspace .hr-table-wrap > table > :is(thead, tbody) > tr > :nth-child(3) { min-width: 84px; }
#paymentCorrectionsWorkspace .hr-table-wrap > table > :is(thead, tbody) > tr > :last-child { min-width: 72px; }
#paymentCorrectionsWorkspace td .hr-history { margin: 0; padding: 0; border: 0; }
#paymentCorrectionsWorkspace .hr-history table { min-width: 440px; }
@media (max-width: 600px) {
  .payment-corrections-dialog > .dialog-head { padding: 14px 12px; }
  #paymentCorrectionsWorkspace { padding: 12px; }
}
h1 { margin-bottom: 0; font-size: 28px; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 18px; }

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

.prototype-sync-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(35, 139, 126, 0.22);
  border-radius: 8px;
  padding: 0 12px;
  background: #eefaf6;
  color: #236f63;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.prototype-sync-status.warning {
  border-color: rgba(187, 122, 23, 0.35);
  background: #fff7e6;
  color: #8a5a0b;
}

.prototype-sync-status.pending {
  border-color: rgba(90, 109, 122, 0.24);
  background: #f4f7f8;
  color: var(--muted);
}

.role-switcher {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  flex: 0 0 auto;
}

.role-switcher select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.role-switcher select:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.account-switcher select {
  min-width: 160px;
}

.role-display {
  background: #f6f8f7;
}

.search {
  width: min(360px, 34vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  flex: 1 1 260px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary { background: var(--teal, #147e80); color: #fff; }
.primary:hover { background: var(--teal-dark); }
.secondary { background: #edf4f3; color: var(--teal-dark); border-color: #cfe0df; }
.ghost { background: transparent; color: var(--teal, #147e80); padding-inline: 8px; }
.warning { background: #fff3df; color: #8a570d; border-color: #f0cf95; }
.icon-btn { width: 36px; padding: 0; background: #edf4f3; color: var(--ink); }

.view { display: none; }
.view.active { display: block; }

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

.metrics article, .panel, .student-card, .teacher-card, .package-card, .lesson-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(36, 49, 58, .03);
}

.metrics article {
  padding: 18px;
  min-height: 126px;
}

.metrics span, .metrics small {
  display: block;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 34px;
}

.analytics-panel {
  margin-bottom: 16px;
}

.analytics-toggle {
  flex: 0 0 auto;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 16px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.analytics-summary div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

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

.analytics-summary span,
.analytics-detail span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.analytics-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.analytics-chart {
  min-height: 280px;
  overflow-x: auto;
  padding: 4px 0;
}

.analytics-chart svg {
  width: 100%;
  min-width: 640px;
  height: auto;
  display: block;
}

.chart-grid {
  stroke: #dce5e7;
  stroke-width: 1;
}

.chart-axis-line {
  stroke: #b8c8ca;
  stroke-width: 1;
}

.chart-axis,
.chart-label,
.chart-legend,
.chart-value {
  fill: var(--muted);
  font-size: 12px;
}

.chart-value {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.analytics-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.analytics-detail strong {
  color: var(--coral);
  font-size: 13px;
}

.hq-panel {
  margin-top: 16px;
}

.care-panel {
  margin-bottom: 16px;
}

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

.operating-focus-section {
  min-width: 0;
}

/* 今日待办沿用首页栅格；跟进表单在事项内展开，保持上下文。 */
.todo-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#operatingFocusPanel .care-item { grid-template-columns: minmax(0, 1fr); border-left-width: 1px; }
#operatingFocusPanel .care-actions { flex-wrap: wrap; justify-content: flex-start; }
#operatingFocusPanel .care-main { overflow-wrap: anywhere; }
.todo-explanation { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.todo-followup { border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; }
.todo-followup summary { cursor: pointer; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.todo-followup form { display: grid; gap: 10px; margin-top: 12px; }
.todo-followup label { display: grid; gap: 6px; font-size: 13px; }
.todo-followup select, .todo-followup input, .todo-followup textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.todo-followup textarea { resize: vertical; min-height: 64px; }
.todo-followup [role="status"] { margin: 0; font-size: 13px; line-height: 1.6; }
.todo-followup summary:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; }

.management-review-panel {
  margin: 16px 0;
}

.management-review-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.management-review-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.management-review-summary span,
.management-review-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.management-review-summary strong {
  display: block;
  margin: 5px 0;
  font-size: 22px;
}

.management-review-advice {
  display: grid;
  gap: 8px;
}

.management-review-advice article {
  padding: 10px 12px;
  border-left: 4px solid var(--teal, #147e80);
  border-radius: 8px;
  background: #f4f8f7;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.care-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.care-summary div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f4f8f7;
}

.care-summary span,
.care-summary strong {
  display: block;
}

.care-summary span {
  color: var(--muted);
  font-size: 12px;
}

.care-summary strong {
  margin-top: 4px;
  font-size: 24px;
}

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

.care-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--leaf);
  border-radius: 8px;
  background: #fbfdfc;
}

.care-item.yellow {
  border-left-color: var(--gold);
  background: #fffaf0;
}

.care-item.red {
  border-left-color: var(--coral);
  background: #fff4f1;
}

.care-main {
  min-width: 0;
}

.care-main strong,
.care-main span,
.care-main p {
  display: block;
}

.care-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.care-main p {
  margin-top: 8px;
  color: var(--ink);
  line-height: 1.6;
}

.care-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.care-tags em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f3ec;
  color: #326a3f;
  font-size: 12px;
  font-style: normal;
}

.care-tags em.yellow {
  background: #fff1d2;
  color: #8a5e18;
}

.care-tags em.red {
  background: #ffe0d9;
  color: #a04435;
}

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

.hq-campus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.hq-campus-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal, #147e80);
  border-radius: 8px;
  background: #fbfdfc;
}

.hq-campus-card.warning {
  border-left-color: var(--coral);
}

.hq-campus-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hq-campus-head strong,
.hq-campus-head span {
  display: block;
}

.hq-campus-head span,
.hq-campus-card p,
.hq-campus-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.hq-campus-head em {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7f6;
  color: var(--teal-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.hq-campus-card.warning .hq-campus-head em {
  background: #fff0eb;
  color: var(--coral);
}

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

.hq-campus-metrics div {
  min-width: 0;
  padding: 9px;
  border-radius: 8px;
  background: #f4f8f7;
}

.hq-campus-metrics strong,
.hq-campus-metrics span {
  display: block;
}

.hq-campus-metrics strong {
  margin-top: 4px;
  font-size: 18px;
}

.hq-campus-card p {
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel-head, .toolbar, .dialog-head, .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-list, .renewal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.lesson-card {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
}

.time {
  color: var(--teal, #147e80);
  font-weight: 800;
}

.lesson-main strong, .lesson-main span, .lesson-main small { display: block; }
.lesson-main span { color: var(--muted); margin-top: 3px; }
.lesson-main small { color: var(--muted); margin-top: 4px; }

.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.status.done { background: #eaf4e5; color: var(--leaf); }
.status.no-show { background: #f8e9e5; color: var(--coral); }
.status.cancelled { background: #fff3df; color: var(--gold); }
.status.deducted { background: #dff2e7; color: #246b49; font-weight: 800; }

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

.pending-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.pending-select-all input,
.pending-deduction-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal, #147e80);
}

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

.pending-deduction-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.pending-deduction-summary span,
.pending-deduction-summary strong {
  display: block;
}

.pending-deduction-summary span {
  color: var(--muted);
  font-size: 12px;
}

.pending-deduction-summary strong {
  margin-top: 4px;
  font-size: 22px;
}

.pending-deduction-list {
  display: grid;
  gap: 8px;
}

.pending-deduction-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pending-deduction-table th,.pending-deduction-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #e3e8ee; vertical-align: middle; }
.pending-deduction-table th { background: #f3f6fa; white-space: nowrap; }
.pending-deduction-table td small { display: block; color: #657187; }
.pending-deduction-table .pending-shortage,.student-package-shortage { color: #b42318; font-weight: 600; }
.pending-deduction-actions { flex-wrap: wrap; }
.schedule-student-upcoming-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.timeline-slot-preview { position:absolute; z-index:12; top:4px; bottom:4px; width:var(--minor-slot-width); min-width:4px; border:1.5px solid #146c60; border-radius:4px; background:#e8f4f1cc; pointer-events:none; }
.timeline-slot-preview span,.schedule-drag-ghost[data-snap-label]::before { position:absolute; display:block; white-space:nowrap; width:max-content; background:#e8f4f1; color:#146c60; padding:2px 7px; border-radius:999px; font-size:12px; font-weight:650; }
.timeline-slot-preview span { left:calc(100% + 3px); bottom:calc(100% + 3px); }

.pending-deduction-notice {
  display: none;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.pending-deduction-notice.success,
.pending-deduction-notice.warning,
.pending-deduction-notice.info {
  display: block;
}

.pending-deduction-notice.success {
  background: #e9f7ef;
  color: var(--leaf);
}

.pending-deduction-notice.warning {
  background: #fff3df;
  color: #8a570d;
}

.pending-deduction-notice.info {
  background: #edf4f3;
  color: var(--teal-dark);
}

.pending-deduction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.pending-deduction-row.not-ready {
  background: #fffaf2;
}

.pending-deduction-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.pending-deduction-row strong,
.pending-deduction-row span,
.pending-deduction-row small {
  display: block;
}

.pending-deduction-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pending-deduction-row small {
  margin-top: 4px;
  color: #8a5b00;
  font-size: 12px;
}

.locked-lesson-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: #e9f7ef;
  color: #246b49;
}

.locked-lesson-note.pending {
  background: #fff7df;
  color: #8a5b00;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #c8d6d7;
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 13px;
}

.student-empty-state {
  display: grid;
  gap: 6px;
}

.student-empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.student-empty-state span {
  color: var(--muted);
}

.student-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.student-profile-tags span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #eef5f4;
  color: var(--teal-dark);
  font-size: 12px;
}

.student-profile-summary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.student-profile-summary span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #eef5f4;
  color: var(--teal-dark);
  font-size: 12px;
  line-height: 1.4;
}

.student-profile-summary strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
}

.student-profile-summary .warning {
  background: #fff7e8;
  color: #8a5c13;
}

.student-profile-summary .danger {
  background: #fff0ed;
  color: var(--coral);
}

.student-archive-records {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.student-archive-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.student-archive-row small {
  color: var(--muted);
  line-height: 1.5;
}

.student-archive-row strong {
  color: var(--teal-dark);
  font-size: 12px;
}

.student-archive-row.warning strong {
  color: var(--coral);
}

.student-archive-row.empty {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}

.renewal-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.renewal-item strong, .renewal-item span { display: block; }
.renewal-item span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.danger { color: var(--coral); font-weight: 800; }

.toolbar {
  margin-bottom: 14px;
}

.toolbar-title {
  display: grid;
  gap: 4px;
  min-width: 220px;
  margin-right: auto;
}

.toolbar-title strong {
  font-size: 16px;
}

.toolbar-title span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar-title .success {
  color: var(--leaf);
  font-weight: 700;
}

.toolbar-title .warning {
  color: var(--coral);
  font-weight: 700;
}

.payroll-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.payroll-toggle {
  flex: 0 0 auto;
}

.payroll-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr);
  gap: 16px;
  margin-top: 16px;
}

.payroll-section {
  min-width: 0;
}

.payroll-section .panel-head {
  margin-bottom: 10px;
}

.payroll-teacher-setting-panel .data-table {
  min-width: 1080px;
}

.payroll-teacher-setting-panel select,
.payroll-teacher-setting-panel input {
  width: 100%;
  min-width: 150px;
}

.payroll-teacher-setting-panel td:nth-child(3) {
  min-width: 230px;
}

.payroll-audit-panel {
  margin-top: 14px;
}

.payroll-automation-health {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #dbe6e5;
  border-radius: 8px;
  background: #fbfdfc;
}

.payroll-automation-health:empty {
  display: none;
}

.payroll-automation-health-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.payroll-automation-health-head strong {
  color: var(--ink);
  font-size: 14px;
}

.payroll-automation-health-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.payroll-automation-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.payroll-automation-health-grid article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-automation-health-grid article.warning {
  border-color: #f0d8a6;
  background: #fffaf0;
}

.payroll-automation-health-grid span,
.payroll-automation-health-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.payroll-automation-health-grid strong {
  color: var(--teal, #147e80);
  font-size: 20px;
  line-height: 1.2;
}

.payroll-automation-health-grid article.warning strong {
  color: #8a5e18;
}

.payroll-audit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.payroll-audit-summary article,
.payroll-audit-rows article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.payroll-audit-summary span,
.payroll-audit-summary small,
.payroll-audit-rows span,
.payroll-audit-rows small {
  color: var(--muted);
  font-size: 12px;
}

.payroll-audit-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
}

.payroll-audit-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payroll-audit-rows article.warning {
  border-color: rgba(217, 104, 86, 0.3);
  background: #fff8f6;
}

.payroll-audit-rows article.info {
  border-color: rgba(35, 139, 126, 0.22);
  background: #f4fbf8;
}

.payroll-audit-rows article div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.payroll-audit-rows strong {
  color: var(--teal, #147e80);
  font-size: 13px;
}

.payroll-audit-rows article.warning strong {
  color: var(--coral);
}

.payroll-audit-rows p {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.payroll-audit-rows small {
  display: block;
  line-height: 1.45;
}

.monthly-close-overview {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.monthly-close-overview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.monthly-close-overview-summary article,
.monthly-close-overview-rows article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.monthly-close-overview-summary span,
.monthly-close-overview-summary small,
.monthly-close-overview-rows span,
.monthly-close-overview-rows p {
  color: var(--muted);
  font-size: 12px;
}

.monthly-close-overview-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
}

.monthly-close-overview-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.monthly-close-overview-rows article.warning {
  border-color: rgba(217, 104, 86, 0.3);
  background: #fff8f6;
}

.monthly-close-overview-rows article.info {
  border-color: rgba(196, 143, 34, 0.28);
  background: #fffaf0;
}

.monthly-close-overview-rows article.ok {
  border-color: rgba(35, 139, 126, 0.24);
  background: #f4fbf8;
}

.monthly-close-overview-rows article div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.monthly-close-overview-rows strong {
  color: var(--ink);
}

.monthly-close-overview-rows p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.monthly-close-overview-rows em {
  display: inline-block;
  margin-right: 6px;
  color: var(--teal, #147e80);
  font-style: normal;
  font-weight: 800;
}

.compact-table {
  min-width: 720px;
}

.detail-table {
  min-width: 980px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 8px;
  background: #e9f0ef;
}

.segmented button {
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}

.segmented .selected {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(36, 49, 58, .08);
}

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

.schedule-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.schedule-readonly-mode .schedule-workbench {
  grid-template-columns: 1fr;
}

.schedule-form-panel,
.schedule-main {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.schedule-readonly-note {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #cfe0df;
  border-radius: 8px;
  background: #edf7f6;
  color: var(--teal-dark);
  font-size: 13px;
  line-height: 1.6;
}

.schedule-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.schedule-form .schedule-student-field {
  grid-column: span 2;
}

.schedule-form .schedule-hint {
  grid-column: span 2;
}

.schedule-form > .primary {
  align-self: end;
  min-height: 40px;
}

.schedule-form label,
.compact-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.schedule-form input,
.schedule-form select,
.compact-filter select,
.compact-filter input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
}

.schedule-form select[multiple],
.form-grid select[multiple] {
  height: auto;
  min-height: 118px;
  padding: 7px 8px;
}

.schedule-form select[multiple] option,
.form-grid select[multiple] option {
  padding: 5px 6px;
  border-radius: 4px;
}

.schedule-student-field {
  min-width: 0;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.schedule-hint {
  min-height: 92px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f8f7;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.schedule-hint strong {
  color: var(--ink);
}

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

.schedule-hint-grid > div {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(31, 52, 51, 0.08);
}

.schedule-hint-grid > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.schedule-hint-grid span {
  display: block;
}

.hint-warning {
  display: block;
  margin-top: 4px;
  color: var(--coral);
  font-weight: 700;
}

.hint-danger {
  display: block;
  margin-top: 4px;
  color: #b42318;
  font-weight: 700;
}

.hint-ok {
  display: block;
  margin-top: 4px;
  color: var(--teal, #147e80);
  font-weight: 700;
}

.compact-filter {
  grid-template-columns: auto 160px;
  align-items: center;
}

.schedule-timeline {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.timeline-top-scroll {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 22px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #edf4f3;
  cursor: ew-resize;
  touch-action: pan-y;
}

.timeline-top-scroll[hidden] { display: none; }
.timeline-top-scroll::-webkit-slider-runnable-track { height: 16px; }
.timeline-top-scroll::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--scroll-thumb-width, 80px);
  height: 16px;
  background: #659a9b;
  border: 2px solid #edf4f3;
  border-radius: 4px;
}
.timeline-top-scroll::-moz-range-thumb {
  width: var(--scroll-thumb-width, 80px);
  height: 12px;
  background: #659a9b;
  border: 2px solid #edf4f3;
  border-radius: 4px;
}
.timeline-top-scroll:focus-visible {
  outline: 2px solid var(--teal, #147e80);
  outline-offset: 2px;
}

.timeline-board-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  max-height: calc(100vh - 230px);
  min-height: 640px;
}

.timeline-board {
  width: max-content;
  min-width: 100%;
}

.timeline-header-row,
.timeline-row-board {
  display: grid;
  grid-template-columns: 116px auto;
  width: max-content;
  min-width: 100%;
}

.timeline-header-row {
  position: sticky;
  top: 0;
  z-index: 5;
}

.timeline-resource {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 116px;
  min-height: 88px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #edf4f3;
  color: var(--ink);
}

.timeline-resource-head {
  min-height: 52px;
  display: grid;
  place-items: center start;
  color: var(--teal-dark);
  font-weight: 800;
}

.timeline-resource strong,
.timeline-resource span {
  display: block;
}

.timeline-resource span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.timeline-time-axis {
  position: relative;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to right, rgba(36, 49, 58, .13) 1px, transparent 1px),
    linear-gradient(to right, rgba(36, 49, 58, .055) 1px, transparent 1px),
    #edf4f3;
  background-size: var(--slot-width) 100%, var(--minor-slot-width) 100%, auto;
}

.timeline-time-axis span {
  position: absolute;
  top: 15px;
  padding-left: 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.timeline-track {
  position: relative;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to right, rgba(36, 49, 58, .09) 1px, transparent 1px),
    linear-gradient(to right, rgba(36, 49, 58, .04) 1px, transparent 1px),
    var(--white);
  background-size: var(--slot-width) 100%, var(--minor-slot-width) 100%, auto;
  cursor: pointer;
}

.timeline-track.drag-over {
  outline: 2px solid #91bfbd;
  outline-offset: -3px;
  background:
    linear-gradient(to right, rgba(36, 49, 58, .09) 1px, transparent 1px),
    linear-gradient(to right, rgba(36, 49, 58, .04) 1px, transparent 1px),
    #edf7f6;
  background-size: var(--slot-width) 100%, var(--minor-slot-width) 100%, auto;
}

.timeline-slot-guide {
  position: absolute;
  inset-block: 0;
  z-index: 0;
  pointer-events: none;
}

.timeline-action-banner {
  padding: 11px 12px;
  border: 1px solid #cfe0df;
  border-radius: 8px;
  background: #edf7f6;
  color: var(--teal-dark);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-action-banner.warning {
  border-color: #f0cf95;
  background: #fff8e8;
  color: #8a570d;
}

.calendar-board-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  max-height: 720px;
}

.calendar-board {
  display: grid;
  min-width: 760px;
}

.calendar-head,
.calendar-time,
.calendar-slot {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 58px;
  padding: 10px;
  background: #edf4f3;
  color: var(--ink);
}

.calendar-head strong,
.calendar-head span {
  display: block;
}

.calendar-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.time-head {
  left: 0;
  z-index: 3;
}

.calendar-time {
  position: sticky;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: start center;
  min-height: 82px;
  padding-top: 12px;
  background: #f2f7f6;
  color: var(--teal-dark);
  font-weight: 800;
}

.calendar-slot {
  min-height: 82px;
  padding: 6px;
  background: var(--white);
  position: relative;
}

.calendar-slot.drag-over {
  outline: 2px solid #91bfbd;
  outline-offset: -3px;
  background: #edf7f6;
}

.calendar-slot.conflict {
  background: #fff7f5;
}

.calendar-card {
  position: absolute;
  top: 7px;
  z-index: 3;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 4px;
  min-height: 74px;
  margin: 0;
  padding: 7px 8px 8px 22px;
  border: 1px solid #cfe0df;
  border-left: 5px solid var(--card-border, var(--teal, #147e80));
  border-radius: 8px;
  background: var(--card-bg, #fbfdfc);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(36, 49, 58, .12);
}

.calendar-card::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0f2025;
  transform: translateY(-50%);
}

.calendar-card.draggable {
  cursor: grab;
}

.calendar-card.deducted-locked {
  border-left-color: #2f8a61;
  background: #f4faf6;
  cursor: default;
  box-shadow: none;
}

.calendar-card.deducted-locked::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  background: #2f8a61;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.calendar-card.dragging {
  opacity: .5;
}

.schedule-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: .92;
  transform: rotate(-1deg);
}

.schedule-drag-ghost.snap-preview {
  opacity: .96;
  transform: none;
  outline: 2px solid #167d7f;
  outline-offset: 2px;
}
.schedule-drag-ghost[data-snap-label] { overflow:visible; }
.schedule-drag-ghost[data-snap-label]::before { content:attr(data-snap-label); left:0; bottom:calc(100% + 5px); z-index:1; }

.calendar-card.done { border-left-color: var(--card-border, var(--leaf)); }
.calendar-card.no-show { border-left-color: var(--coral); }
.calendar-card.cancelled { border-left-color: var(--gold); opacity: .76; }
.calendar-card.grouped {
  border-color: #b9d8d5;
  box-shadow: 0 8px 18px rgba(36, 49, 58, .15);
}

.calendar-card.mixed-status {
  border-top-color: var(--coral);
}

.calendar-card strong,
.calendar-card span,
.calendar-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-card strong,
.calendar-card small,
.calendar-card-time {
  white-space: nowrap;
}

.calendar-card-time,
.calendar-card span,
.calendar-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.calendar-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.calendar-card-time {
  font-weight: 800;
  color: var(--teal-dark);
}

.calendar-deducted-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dff2e7;
  color: #246b49 !important;
  font-size: 11px !important;
  font-weight: 900;
}

.calendar-group-badge {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  min-width: auto !important;
  padding: 1px 5px;
  border: 1px solid #9fc7c3;
  border-radius: 4px;
  background: #f2fbfa;
  color: var(--teal-dark) !important;
  font-size: 11px !important;
  font-weight: 800;
}

.calendar-coteach-badge {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  min-width: auto !important;
  padding: 1px 5px;
  border: 1px solid #b6c5f2;
  border-radius: 4px;
  background: #eef2ff;
  color: #364fc7 !important;
  font-size: 11px !important;
  font-weight: 800;
}

.calendar-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 4px;
  margin-top: 1px;
}

.calendar-single-group-badge {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  min-width: auto !important;
  padding: 1px 5px;
  border: 1px solid #f0b45b;
  border-radius: 4px;
  background: #fff4dd;
  color: #9a5200 !important;
  font-size: 10.5px !important;
  font-weight: 900;
  line-height: 1.3;
}

.calendar-leave-count-badge {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  min-width: auto !important;
  padding: 1px 5px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f2f4f7;
  color: #667085 !important;
  font-size: 10.5px !important;
  font-weight: 700;
  line-height: 1.3;
}

.calendar-card.single-group-warn {
  border-left: 4px solid #d97706 !important;
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.32), 0 4px 10px rgba(217, 119, 6, 0.12);
}

.calendar-card-students span.calendar-student-leave {
  border-style: dashed;
  border-color: #cbd5e1;
  background: rgba(241, 245, 249, 0.88);
  color: #64748b !important;
  font-weight: 600;
  text-decoration: line-through;
}

.schedule-list-leave-student {
  color: #64748b;
  font-size: 12px;
  text-decoration: line-through;
}

.p40-single-group-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f3c474;
  border-left: 4px solid #d97706;
  border-radius: 8px;
  background: #fff8eb;
  color: #7c4200;
  font-size: 13px;
  line-height: 1.5;
}

.p40-leave-section {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.p40-leave-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #475467;
}

.p40-leave-student .student-drawer-link {
  color: #64748b;
  text-decoration: line-through;
}

.p40-leave-student small {
  color: #667085;
}

.calendar-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.calendar-card-students {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 4px;
  max-height: 68px;
  overflow: hidden;
}

.calendar-card-students span {
  display: inline-flex !important;
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 1px 5px;
  border: 1px solid rgba(22, 125, 127, .18);
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink) !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
}

.calendar-card-students.single {
  display: block;
  max-height: 22px;
}

.calendar-card-students.single span {
  display: block !important;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-card-course {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  line-height: 1.25;
  max-height: 2.5em;
  color: var(--ink) !important;
  font-weight: 700;
}

.slot-add-btn {
  width: 100%;
  min-height: 58px;
  border: 1px dashed #bfd0d1;
  border-radius: 8px;
  background: #f7faf9;
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 800;
}

.slot-add-btn:hover {
  border-color: #91bfbd;
  background: #edf7f6;
}

.audit-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.audit-filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.audit-keyword {
  min-width: min(260px, 100%);
  flex: 1 1 240px;
}

.audit-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.audit-row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.audit-row strong,
.audit-row span,
.audit-row small {
  display: block;
}

.audit-row span,
.audit-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: stretch;
}

.timeline-time {
  display: grid;
  place-items: center;
  min-height: 76px;
  border-radius: 8px;
  background: #edf4f3;
  color: var(--teal-dark);
  font-weight: 800;
}

.timeline-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

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

.timeline-card span,
.timeline-card small {
  color: var(--muted);
  margin-top: 4px;
}

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

.students-toolbar,
.teachers-toolbar {
  margin-bottom: 14px;
}

.student-subnav {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.student-subnav button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.student-subnav button.selected {
  background: #dff0ed;
  color: var(--teal-dark);
  font-weight: 700;
}

.student-archive-workspace {
  display: grid;
  gap: 14px;
}

.student-archive-toolbar,
.student-archive-head,
.student-archive-assessment-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.student-archive-toolbar label {
  display: grid;
  min-width: min(100%, 360px);
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.student-archive-toolbar select,
.student-archive-toolbar input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.student-archive-profile,
.student-archive-grid {
  display: grid;
  gap: 14px;
}

.student-archive-profile {
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
}

.student-archive-grid {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.student-archive-summary,
.student-archive-assessment,
.student-archive-process {
  padding: 16px;
}

.student-archive-summary h2,
.student-archive-assessment h2,
.student-archive-process h2 {
  margin: 0;
  font-size: 16px;
}

.student-archive-summary p,
.student-archive-assessment p,
.student-archive-process p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.student-archive-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.student-archive-meta span,
.student-assessment-row,
.student-process-row {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfc;
}

.student-archive-meta strong,
.student-assessment-row strong,
.student-process-row strong,
.student-assessment-row small,
.student-process-row small {
  display: block;
}

.student-archive-meta small,
.student-assessment-row small,
.student-process-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.student-assessment-list,
.student-process-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.student-archive-metrics article {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfc;
}

.student-archive-metrics span,
.student-archive-metrics strong {
  display: block;
}

.student-archive-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.student-archive-metrics strong {
  margin-top: 5px;
  font-size: 18px;
}

.student-card, .teacher-card, .package-card {
  padding: 16px;
  min-height: 170px;
}

.student-name-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  border-radius: 8px;
  padding: 5px 10px;
  color: #1f2d34;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.student-name-chip.tone-0 { background: #dff4ee; }
.student-name-chip.tone-1 { background: #fff0b8; }
.student-name-chip.tone-2 { background: #e7efff; }
.student-name-chip.tone-3 { background: #ffe3d8; }
.student-name-chip.tone-4 { background: #eadffc; }
.student-name-chip.tone-5 { background: #dff3ff; }

.student-card.inactive,
.teacher-card.inactive,
.package-card.inactive {
  background: #f6f8f8;
}

.student-priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.student-priority-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--leaf);
  border-radius: 8px;
  background: #fbfdfc;
}

.student-priority-card.yellow {
  border-left-color: var(--gold);
  background: #fffaf0;
}

.student-priority-card.red {
  border-left-color: var(--coral);
  background: #fff4f1;
}

.student-priority-card span,
.student-priority-card strong,
.student-priority-card small {
  display: block;
}

.student-priority-card span,
.student-priority-card small {
  color: var(--muted);
  font-size: 12px;
}

.student-priority-card strong {
  margin: 4px 0;
  font-size: 18px;
}

.student-risk-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f4f8f7;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.student-risk-note.yellow {
  background: #fff7e7;
  color: #8a5e18;
}

.student-risk-note.red {
  background: #fff0ec;
  color: #a04435;
}

.student-detail-sections {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.student-detail-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.student-detail-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.student-detail-section-head strong {
  color: var(--ink);
  font-size: 14px;
}

.student-detail-section-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.student-overdue-list {
  display: grid;
  gap: 8px;
}

.student-overdue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfdfd;
}

.student-overdue-row.is-current {
  padding-inline-start: 9px;
  border-color: #a8d4cf;
  border-inline-start: 4px solid var(--teal, #147779);
  background: #eff8f7;
}

.student-overdue-heading,
.student-overdue-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.student-overdue-meta {
  display: grid;
  gap: 3px;
  color: var(--muted);
}

.student-overdue-meta strong {
  color: var(--ink);
}

.student-overdue-meta .student-overdue-short {
  color: #9b4423;
}

.student-overdue-actions {
  align-self: end;
  justify-content: flex-end;
}

.student-overdue-origin,
.student-overdue-status {
  justify-self: end;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: var(--student-secondary, 12px);
  font-weight: 600;
  white-space: nowrap;
}

.student-overdue-origin,
.student-overdue-status.ready {
  background: #dff2ed;
  color: #145f50;
}

.student-overdue-status.shortage,
.student-overdue-status.check {
  background: #fff1df;
  color: #865413;
}

@media (max-width: 540px) {
  .student-overdue-meta,
  .student-overdue-actions {
    grid-column: 1 / -1;
  }

  .student-overdue-actions {
    justify-content: flex-start;
  }
}

.student-process-overview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6e5;
  border-radius: 8px;
  background: #fbfdfc;
}

.student-process-overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.student-process-overview-head strong {
  color: var(--ink);
  font-size: 14px;
}

.student-process-overview-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.student-process-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.student-process-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.student-process-metric span,
.student-process-metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.student-process-metric strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.student-process-metric.green {
  border-color: #cdebd8;
  background: #f3fbf6;
}

.student-process-metric.yellow {
  border-color: #f0d8a6;
  background: #fffaf0;
}

.student-process-metric.red {
  border-color: #efc4bd;
  background: #fff4f1;
}

.student-process-metric.green strong {
  color: #2d7a4f;
}

.student-process-metric.yellow strong {
  color: #8a5e18;
}

.student-process-metric.red strong {
  color: #a04435;
}

.student-profile-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-consumption-list {
  display: grid;
  gap: 6px;
}

.student-consumption-summary,
.student-package-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.student-consumption-summary span,
.student-package-audit span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.student-package-audit span.green {
  background: #eaf7ef;
  color: #2d7a4f;
}

.student-package-audit span.yellow,
.student-consumption-row strong.yellow {
  background: #fff7e7;
  color: #8a5e18;
}

.student-package-audit span.red {
  background: #fff0ec;
  color: #a04435;
}

.student-consumption-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
}

.student-consumption-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.student-consumption-row strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.student-consumption-row strong.green {
  color: #2d7a4f;
}

.student-consumption-row strong.muted {
  color: var(--muted);
}

.student-consumption-row small {
  color: var(--muted);
  line-height: 1.5;
}

.student-consumption-row.empty {
  color: var(--muted);
}

.student-process-signals {
  display: grid;
  gap: 7px;
}

.student-process-signals article {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #dbe6e5;
  border-radius: 8px;
  background: #fbfdfc;
}

.student-process-signals article.warning {
  border-color: #f1dcc0;
  background: #fffaf1;
}

.student-process-signals span {
  color: var(--muted);
  font-size: 12px;
}

.student-process-signals p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.student-process-timeline {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.student-process-timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.student-process-timeline-head strong {
  color: var(--ink);
}

.student-process-timeline article {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.student-process-timeline time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.student-process-timeline strong,
.student-process-timeline p {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.student-process-timeline p,
.student-process-empty {
  color: var(--muted);
}

.student-payment-records {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.student-package-records {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dbe6e5;
  border-radius: 8px;
  background: #f7faf9;
}

.student-followup-records {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e4dfd0;
  border-radius: 8px;
  background: #fffaf0;
}

.student-followup-latest {
  display: grid;
  gap: 4px;
  padding-top: 7px;
  border-top: 1px dashed #e5d6ae;
}

.student-followup-latest span,
.student-followup-latest small,
.student-followup-list {
  color: var(--muted);
  font-size: 12px;
}

.student-followup-latest p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.student-followup-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.student-followup-records button {
  justify-self: start;
}

.followup-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef7f5;
  color: var(--teal, #147e80);
  font-weight: 800;
}

.followup-status.overdue {
  background: #fff0ec;
  color: var(--coral);
}

.followup-status.done {
  background: #eef7ea;
  color: var(--leaf);
}

.student-payment-head,
.student-payment-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.student-payment-head strong,
.student-payment-row strong,
.student-payment-head span,
.student-payment-row span {
  display: block;
}

.student-payment-head span,
.student-payment-row span {
  color: var(--muted);
  font-size: 12px;
}

.student-payment-row {
  align-items: center;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.student-package-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.student-package-row > span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-package-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.student-package-row button {
  min-height: 30px;
  padding: 0 10px;
}

.student-payment-row > span {
  min-width: 0;
  line-height: 1.45;
}

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

.student-payment-row strong {
  flex: 0 0 auto;
  text-align: right;
}

.student-payment-row button {
  min-height: 30px;
  padding: 0 10px;
}

.student-payment-row.empty {
  color: var(--muted);
  font-size: 12px;
}

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

.transfer-preview div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f4f8f7;
}

.transfer-preview span,
.transfer-preview strong {
  display: block;
}

.transfer-preview span {
  color: var(--muted);
  font-size: 12px;
}

.transfer-preview strong {
  margin-top: 4px;
  font-size: 18px;
}

.transfer-preview p {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.6;
}

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

.status-stack {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.active {
  background: #e7f3ec;
  color: #326a3f;
}

.status-badge.inactive {
  background: #eef1f1;
  color: var(--muted);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f2f1;
  color: var(--teal-dark);
  font-weight: 800;
}

.card-title strong, .card-title span { display: block; }
.card-title span, .meta { color: var(--muted); font-size: 13px; }
.meta { margin-top: 12px; line-height: 1.8; }

.teacher-schedule-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.teacher-schedule-summary div,
.teacher-next-lesson,
.teacher-mini-lessons div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-schedule-summary div {
  padding: 10px;
}

.teacher-schedule-summary span,
.teacher-next-lesson span,
.teacher-next-lesson small,
.teacher-mini-lessons span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.teacher-schedule-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.teacher-next-lesson {
  margin-top: 10px;
  padding: 11px 12px;
  border-left: 4px solid var(--teal, #147e80);
}

.teacher-next-lesson strong,
.teacher-next-lesson small {
  display: block;
  margin-top: 5px;
}

.teacher-mini-lessons {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.teacher-mini-lessons div {
  padding: 9px 10px;
}

.teacher-mini-lessons strong,
.teacher-mini-lessons span {
  display: block;
}

.teacher-mini-lessons span {
  margin-top: 3px;
}

.teacher-profile-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-profile-strip strong,
.teacher-profile-strip span {
  display: block;
}

.teacher-profile-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.teacher-photo,
.teacher-photo-preview-img,
.portal-teacher-photo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f2f1;
}

.teacher-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  font-weight: 800;
}

.teacher-photo-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.teacher-radar-wrap {
  margin-top: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-radar {
  width: 100%;
  max-width: 150px;
  display: block;
}

.radar-grid {
  fill: none;
  stroke: #dce5e7;
  stroke-width: 1;
}

.radar-axis {
  stroke: #c5d3d5;
  stroke-width: 1;
}

.radar-label {
  fill: var(--muted);
  font-size: 11px;
}

.radar-shape {
  fill: rgba(48, 125, 122, 0.22);
  stroke: var(--teal, #147e80);
  stroke-width: 2;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e9f0ef;
  overflow: hidden;
  margin-top: 14px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--teal, #147e80);
}

.dialog {
  width: min(640px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.payment-duplicate-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#paymentDuplicateList { padding: 0; list-style: none; }
#paymentDuplicateList li { display: grid; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#paymentDuplicateMore:empty { display: none; }

.dialog::backdrop { background: rgba(14, 31, 37, .35); }
.dialog form { padding: 18px; }
.dialog-body { margin: 16px 0; color: var(--muted); line-height: 1.8; }
.dialog-body strong { color: var(--ink); }

.receipt-dialog {
  width: min(860px, calc(100vw - 28px));
}

.receipt-dialog > .dialog-head,
.receipt-dialog > .dialog-actions {
  padding: 16px 18px;
}

.payment-receipt {
  padding: 0 18px 18px;
}

.receipt-paper {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.receipt-paper + .receipt-paper {
  margin-top: 18px;
}

.receipt-brand,
.receipt-title,
.receipt-total,
.receipt-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.receipt-brand {
  justify-content: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.receipt-brand img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.receipt-brand strong,
.receipt-brand span,
.receipt-info-grid span,
.receipt-info-grid strong,
.receipt-note strong,
.receipt-note span {
  display: block;
}

.receipt-brand strong { font-size: 18px; }
.receipt-brand span,
.receipt-info-grid span,
.receipt-note strong,
.receipt-safe-note { color: var(--muted); font-size: 12px; }

.receipt-title {
  margin: 16px 0;
}

.receipt-title h3 {
  margin: 0;
  font-size: 22px;
}

.receipt-title span {
  color: var(--teal, #147e80);
  font-weight: 800;
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.receipt-info-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 13px;
}

.receipt-table th,
.receipt-table td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.receipt-table th {
  background: #f4f8f7;
  color: var(--muted);
  font-size: 12px;
}

.receipt-total {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.receipt-total strong {
  font-size: 22px;
  color: var(--teal, #147e80);
}

.receipt-note {
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 14px;
}

.receipt-safe-note {
  margin: 14px 0 0;
  line-height: 1.7;
}

.receipt-empty {
  padding: 24px;
  color: var(--muted);
}

.detail-audit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-audit strong,
.detail-audit span {
  display: block;
}

.detail-audit span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.student-growth-fields {
  display: contents;
}

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

.form-section {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.form-section strong,
.teacher-grade-group > strong {
  color: var(--ink);
  font-size: 14px;
}

.form-section span {
  color: var(--muted);
  font-size: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input, .form-grid select, .form-grid textarea {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
}

.form-grid textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
  line-height: 1.5;
}

.purchase-package-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f7faf9;
}

.purchase-package-head,
.purchase-package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.purchase-package-head strong {
  color: var(--ink);
}

.purchase-package-head span,
.purchase-package-row small {
  color: var(--muted);
}

.purchase-package-items {
  display: grid;
  gap: 8px;
}

.purchase-package-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--white);
}

.purchase-package-row > span {
  display: grid;
  gap: 3px;
}

.purchase-package-row strong {
  color: var(--ink);
}

.teacher-grade-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-grade-group > strong {
  grid-column: 1 / -1;
}

.form-grid input[type="range"] {
  padding: 0;
}

.form-grid input[readonly] {
  background: #f0f5f4;
  color: var(--muted);
}


.schedule-combobox {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.billing-student-picker {
  flex: 1 1 240px;
  max-width: 100%;
}
#addBillingBtn {
  white-space: nowrap;
}
.schedule-combobox input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}
.schedule-combobox input[aria-autocomplete="none"] {
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}
.schedule-combobox-options {
  position: absolute;
  top: 100%;
  z-index: 4;
  width: 100%;
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px #193a3326;
}
.schedule-combobox-options.opens-up { top: auto; bottom: 100%; }
.schedule-combobox-options[hidden] { display: none; }
.schedule-combobox-options > div { padding: 10px 12px; overflow-wrap: anywhere; }
.schedule-combobox-options [role="option"] { cursor: pointer; }
.schedule-combobox-options [role="option"]:hover,
.schedule-combobox-options [role="option"].is-active { background: #e6f4f1; }
.schedule-combobox-options small { margin-inline-start: 8px; color: var(--muted); }
.schedule-combobox-empty { color: var(--muted); }

.schedule-coteach-field {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #cde2df;
  border-radius: 8px;
  background: #f4faf9;
  cursor: pointer;
}
.schedule-coteach-field[hidden] { display: none; }
.schedule-coteach-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}
.schedule-coteach-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  padding: 0;
  margin: 0;
  accent-color: var(--teal);
  flex: 0 0 auto;
  cursor: pointer;
}
.schedule-coteach-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.schedule-coteach-suggest {
  display: block;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff7e6;
  border: 1px solid #f0cf85;
  color: #8a5600;
  font-size: 12px;
  line-height: 1.45;
}
.schedule-coteach-suggest[hidden] { display: none; }

.schedule-selection-note {
  grid-column: 1 / -1;
  margin-top: -6px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-student-packages {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 38px;
  padding: 10px;
  border: 1px solid #d8e6e2;
  border-radius: 8px;
  background: #f7fbfa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.schedule-package-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e6e2;
  border-radius: 8px;
  background: var(--white);
}

.schedule-package-card > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 8px;
}
.schedule-package-card > div > span { grid-column: 1 / -1; }
.schedule-card-remove {
  padding: 3px 6px;
  background: transparent;
  color: var(--teal-dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

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

.schedule-package-card strong {
  color: var(--ink);
  font-size: 13px;
}

.schedule-package-card em {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e7f3ec;
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 800;
}

.schedule-package-card.warning em {
  background: #fff4d7;
  color: #8a5b00;
}

.schedule-package-card.danger em {
  background: #ffe7e2;
  color: #9b2f1c;
}

.schedule-package-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-package-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid #edf2f0;
}

.helper-text {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

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

.finance-grid span {
  display: block;
  padding: 8px;
  border-radius: 8px;
  background: #f4f8f7;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.finance-summary article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.finance-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.finance-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.finance-data-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.finance-data-head {
  align-items: flex-start;
}

.finance-data-head .helper-text {
  margin: 4px 0 0;
}

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

.receipt-print-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.receipt-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.finance-data-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.finance-data-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.finance-data-toolbar input,
.finance-data-toolbar select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
}

.finance-data-summary {
  margin-top: 0;
}

.finance-sync-note {
  min-height: 38px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid #cfe0df;
  border-radius: 8px;
  background: #edf7f6;
  color: var(--teal-dark);
  font-size: 13px;
}

.finance-data-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

.finance-table-section {
  min-width: 0;
}

.finance-table-section.wide {
  grid-column: 1 / -1;
}

.finance-ledger-section {
  margin-top: 16px;
}

.finance-scroll-wrap {
  max-height: 420px;
  overflow: auto;
}

.finance-ledger-section .finance-scroll-wrap {
  max-height: 460px;
}

.finance-scroll-wrap .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.finance-ledger-table {
  min-width: 1420px;
}

.finance-scroll-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.finance-scroll-wrap::-webkit-scrollbar-thumb {
  border: 2px solid var(--white);
  border-radius: 999px;
  background: #b8cbc8;
}

.finance-scroll-wrap::-webkit-scrollbar-track {
  background: #edf4f3;
}

.inventory-panel {
  display: grid;
  gap: 16px;
}

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

.inventory-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.inventory-summary span,
.inventory-summary small,
.inventory-card-list span,
.inventory-card-list small {
  display: block;
  color: var(--muted);
}

.inventory-summary strong {
  display: block;
  margin: 4px 0;
  font-size: 24px;
}

.inventory-role-guide {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-soft);
}

.inventory-role-guide div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.inventory-role-guide span,
.inventory-role-guide small {
  color: var(--muted);
}

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

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

.inventory-alert.danger {
  border-color: #f0b5a7;
  background: #fff4f0;
}

.inventory-alert.warning {
  border-color: #ecd69e;
  background: #fff9e8;
}

.inventory-alert.ok {
  border-color: #cbe3da;
  background: #f3fbf8;
}

.inventory-alert strong,
.inventory-alert span {
  display: block;
}

.inventory-alert span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-alert button {
  flex: 0 0 auto;
}

.inventory-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inventory-actions article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.inventory-actions span,
.inventory-actions small {
  color: var(--muted);
}

.inventory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.inventory-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.inventory-section.wide {
  grid-row: span 2;
}

#inventory [data-inventory-panel="stock"],
#inventory [data-inventory-panel="transfer"] {
  grid-column: 1 / -1;
  min-width: 0;
}

#inventory .inventory-tabs button { white-space: nowrap; }
#inventory .table-wrap { max-width: 100%; }
#inventory .table-wrap table { min-width: 700px; }
.inventory-transfer-line { padding: 14px 0; border-top: 1px solid var(--line); }

@media (max-width: 600px) {
  #inventory .panel-head { flex-direction: column; align-items: stretch; gap: 10px; }
  #inventory .inventory-tabs { display: flex; overflow-x: auto; }
  #inventory .inventory-tabs button { flex: 1 0 auto; }
  #inventory .compact-head h3 { white-space: nowrap; }
  #inventoryStatus { overflow-wrap: anywhere; }
  #inventoryTransferDialog .form-grid { grid-template-columns: minmax(0, 1fr); }
}

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

.inventory-tab-action article {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.inventory-tab-action span {
  color: var(--muted);
}

.compact-inventory-close {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.compact-inventory-close button {
  grid-column: 1 / -1;
}

.inventory-close-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.inventory-close-summary article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-close-summary span,
.inventory-close-summary strong,
.inventory-close-summary small {
  display: block;
}

.inventory-close-summary span,
.inventory-close-summary small {
  color: var(--muted);
  font-size: 12px;
}

.inventory-close-summary strong {
  margin: 5px 0;
  font-size: 18px;
}

.compact-head h3 {
  margin: 0;
  font-size: 16px;
}

.inventory-card-list {
  display: grid;
  gap: 10px;
}

.inventory-card-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.product-sale-field {
  display: none;
}

.manual-cash-field {
  display: none;
}

.manual-cash-mode .manual-cash-field {
  display: grid;
}

.manual-cash-mode label:has([name="discountRate"]) {
  display: none;
}
.manual-cash-mode label:has([name="discountedPrice"]) { display: none; }

.product-sale-mode .product-sale-field {
  display: grid;
}

.product-sale-mode .product-serial-field {
  display: none;
}

.product-sale-mode.product-serial-required .product-serial-field {
  display: grid;
}

.product-sale-mode .course-sale-field,
.product-sale-mode label:has([name="packageSearch"]),
.product-sale-mode label:has([name="packageName"]),
.product-sale-mode label:has([name="total"]),
.product-sale-mode label:has([name="remain"]) {
  display: none;
}

.procurement-billing-mode #purchaseForm label:has([name="chargeType"]),
.procurement-billing-mode #purchaseForm label:has([name="studentChargeKind"]),
.procurement-billing-mode #purchaseForm label:has([name="balanceBefore"]),
.procurement-billing-mode #purchaseForm label:has([name="balanceUse"]) {
  display: none;
}

@media (max-width: 980px) {
  .inventory-summary,
  .inventory-alerts,
  .inventory-actions,
  .inventory-grid,
  .inventory-tab-action {
    grid-template-columns: 1fr;
  }
}

.finance-table-section .panel-head {
  margin-bottom: 10px;
}

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

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: #f2f7f6;
  font-size: 13px;
  font-weight: 700;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table strong,
.data-table span {
  display: block;
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.data-table span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.settings-card {
  min-height: 320px;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.account-form {
  border-bottom: 0;
  padding-bottom: 0;
  gap: 12px 14px;
}

.account-teacher-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #115e59;
  font-size: 13px;
  line-height: 1.5;
}

.account-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.account-form-actions button {
  min-width: 112px;
}

.package-campus-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.package-campus-picker {
  position: relative;
  min-width: 0;
}

.package-campus-picker-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.package-campus-picker-button:focus-visible,
.package-campus-picker-button[aria-expanded="true"] {
  border-color: var(--teal, #147e80);
  outline: 2px solid rgba(22, 125, 127, .14);
  outline-offset: 1px;
}

.package-campus-picker-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 18px;
  transition: transform .16s ease;
}

.package-campus-picker-button[aria-expanded="true"] .package-campus-picker-chevron {
  transform: rotate(180deg);
}

.package-campus-picker-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(34, 49, 58, .16);
}

.package-campus-picker-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
}

.package-campus-picker-option:hover {
  background: #edf6f3;
}

.package-campus-picker-option:first-child {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
}

.settings-form .package-campus-picker-option input {
  flex: 0 0 16px;
  min-width: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: var(--teal, #147e80);
}

.package-campus-picker-option small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.package-campus-pricing-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  overflow: hidden;
}

.package-campus-pricing-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #edf6f3;
}

.package-campus-pricing-head strong,
.package-campus-pricing-head span {
  display: block;
}

.package-campus-pricing-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.package-campus-pricing-rows {
  display: grid;
}

.package-campus-pricing-row {
  display: grid;
  grid-template-columns: minmax(104px, 1.1fr) minmax(80px, .9fr) minmax(80px, .9fr) minmax(100px, 1fr) minmax(120px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.package-campus-pricing-row:last-child {
  border-bottom: 0;
}

.package-campus-pricing-campus,
.package-campus-pricing-summary {
  align-self: center;
  min-width: 0;
}

.package-campus-pricing-campus strong,
.package-campus-pricing-campus span,
.package-campus-pricing-summary strong,
.package-campus-pricing-summary span {
  display: block;
}

.package-campus-pricing-campus span,
.package-campus-pricing-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.package-campus-pricing-row label {
  min-width: 0;
}

.package-campus-pricing-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.package-campus-pricing-tools p { margin: 0; }
.package-campus-pricing-tools label { min-width: min(100%, 190px); }

.package-settings-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.package-settings-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 8px;
}

.package-settings-tabs button[aria-pressed="true"] {
  border-color: var(--teal, #147e80);
  background: #e3f2ef;
  color: var(--teal, #147e80);
  font-weight: 700;
}

.package-editor-dialog {
  inset: 0 0 0 auto;
  width: min(860px, 100%);
  height: 100dvh;
  max-width: 100%;
  max-height: none;
  overflow: hidden;
  margin: 0;
  border-radius: 0;
}

.package-editor-dialog .package-editor-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

.package-editor-header,
.package-editor-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  background: var(--white);
}

.package-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.package-editor-header h2 { margin: 0; overflow-wrap: anywhere; }
.package-editor-footer { border-top: 1px solid var(--line); }
.package-editor-footer .dialog-actions { margin: 0; }

.package-editor-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  grid-auto-rows: max-content;
  align-content: start;
  overscroll-behavior: contain;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 0;
}

.package-save-error,
.package-save-summary {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.package-save-error { color: #b42318; }

.package-save-summary {
  padding: 10px 12px;
  border-radius: 8px;
  background: #e3f2ef;
  color: var(--ink);
}

.package-save-error:empty,
.package-save-summary:empty { display: none; }

@media (max-width: 620px) {
  .package-settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .package-editor-body, .package-editor-header, .package-editor-footer { padding-inline: 14px; }
}

.settings-form input,
.settings-form select {
  min-width: 0;
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
}

.settings-form .check-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-form .check-field input {
  width: 16px;
  height: 16px;
}

.role-editor-card {
  align-items: flex-start;
}

.role-permission-editor {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.role-permission-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.role-permission-editor input[type="text"],
.role-permission-editor input:not([type]) {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--white);
}

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

.role-permission-grid .check-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.role-permission-grid .check-field input {
  width: 16px;
  height: 16px;
}

.settings-form button {
  align-self: end;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.data-summary-grid div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f4f8f7;
}

.data-summary-grid span,
.data-summary-grid strong {
  display: block;
}

.data-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.data-summary-grid strong {
  margin-top: 4px;
  font-size: 22px;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.import-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.import-file input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.system-health {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.system-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.system-health-head strong,
.system-health-head span {
  display: block;
}

.system-health-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.health-counts {
  display: flex;
  gap: 6px;
}

.health-counts em {
  min-width: 30px;
  padding: 4px 7px;
  border-radius: 6px;
  text-align: center;
  font-style: normal;
  font-weight: 800;
}

.health-counts .error {
  background: #fff0ec;
  color: #a04435;
}

.health-counts .warning {
  background: #fff7e7;
  color: #8a5e18;
}

.health-counts .pass {
  background: #edf7f0;
  color: #2f7b55;
}

.system-health-list {
  display: grid;
  gap: 8px;
}

.health-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #b8c8c7;
  border-radius: 8px;
  background: var(--white);
}

.health-row.error {
  border-left-color: var(--coral);
}

.health-row.warning {
  border-left-color: var(--gold);
}

.health-row.pass {
  border-left-color: var(--leaf);
}

.health-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.health-row strong,
.health-row small {
  display: block;
}

.health-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.health-more {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f8f7;
  color: var(--muted);
  font-size: 13px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.settings-row strong,
.settings-row span {
  display: block;
}

.settings-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.inline-status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  margin-left: 6px;
}

.inline-status.active {
  background: #e7f3ec;
  color: #326a3f;
}

.inline-status.inactive {
  background: #eef1f1;
  color: var(--muted);
}

.settings-row button:disabled {
  cursor: not-allowed;
  opacity: .56;
}

.package-category-groups {
  display: grid;
  gap: 12px;
}

.package-association-overview {
  margin: 16px 0 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.package-association-overview h3 { margin: 0 0 12px; font-size: 16px; }
#packageAssociationCount { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
#packageAssociationNotice { color: var(--brand, #147c80); overflow-wrap: anywhere; }
#packageAssociationNotice:empty, #generalPackageSaveNotice:empty { display: none; }
#generalPackageSaveNotice { color: #b42318; overflow-wrap: anywhere; }
.package-association-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.package-association-row small, .package-association-row strong, .package-association-row span {
  display: block;
  overflow-wrap: anywhere;
}
.package-association-row small { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.package-association-row button { white-space: nowrap; }
#generalPackageAssociationRows .package-association-picker { flex: 1; }
#generalPackageAssociationRows button { flex-shrink: 0; }
.package-association-picker .schedule-combobox-options [role="option"]:has(small) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.package-association-picker .schedule-combobox-options small { flex: 0 0 auto; margin-inline-start: 0; }
@media (max-width: 600px) {
  .package-association-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .package-association-row button { justify-self: start; }
}

.package-category-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  overflow: hidden;
}

.package-category-group.inactive {
  background: #f5f7f7;
}

.package-category-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #edf6f3;
}

.package-category-group-head strong,
.package-category-group-head span {
  display: block;
}

.package-category-group-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.package-category-package-list {
  padding: 10px;
}

.package-category-package-list .settings-row {
  background: #fff;
}

.package-empty-row {
  border-style: dashed;
  background: transparent;
}

.portal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.teacher-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.portal-picker,
.teacher-picker,
.phone-frame {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.portal-picker,
.teacher-picker {
  padding: 16px;
  min-width: 0;
}

.portal-picker label,
.teacher-picker label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.portal-picker select,
.teacher-picker select,
.teacher-picker input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
}

.portal-mini {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}

.portal-links {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.portal-links h2 {
  font-size: 15px;
  margin-bottom: 10px;
}

.portal-link {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 8px;
  background: #fbfdfc;
}

.portal-link.active {
  border-color: #91bfbd;
  background: #edf7f6;
}

.portal-link strong,
.portal-link span {
  display: block;
}

.portal-link span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.portal-sync-card {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
  min-width: 0;
}

.portal-sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-sync-head span {
  color: var(--teal, #147e80);
  font-size: 12px;
  font-weight: 800;
}

.portal-sync-list {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.portal-sync-row {
  display: grid;
  grid-template-columns: 72px 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  min-width: 0;
}

.portal-sync-row span,
.portal-sync-row small,
.portal-sync-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.portal-sync-row strong {
  color: var(--teal, #147e80);
  font-size: 12px;
}

.portal-sync-row small {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-sync-row.warning strong {
  color: var(--coral);
}

.portal-sync-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.external-sync-panel {
  display: grid;
  gap: 14px;
}

.external-sync-health,
.external-sync-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.external-sync-health article,
.external-sync-summary article,
.external-sync-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.external-sync-health article.warning {
  border-color: #f3ca78;
  background: #fff8e8;
}

.external-sync-health span,
.external-sync-summary span,
.external-sync-item span,
.external-sync-item small {
  color: var(--muted);
  font-size: 12px;
}

.external-sync-health strong,
.external-sync-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
}

.external-sync-health small,
.external-sync-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.external-sync-center {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.external-sync-item {
  display: grid;
  gap: 8px;
  min-height: 132px;
}

.external-sync-item div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.external-sync-item strong {
  color: var(--teal, #147e80);
  font-size: 24px;
  line-height: 1;
}

.external-sync-item.warning strong {
  color: var(--coral);
}

.external-sync-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.external-sync-item small {
  line-height: 1.45;
}

.external-sync-followups {
  display: grid;
  gap: 10px;
}

.external-sync-followup-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.external-sync-followup-list article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.external-sync-followup-list article.pending {
  border-color: rgba(217, 104, 86, 0.28);
  background: #fff8f6;
}

.external-sync-followup-list article.done {
  border-color: rgba(35, 139, 126, 0.24);
  background: #f4fbf8;
}

.external-sync-followup-list article div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.external-sync-followup-list strong {
  color: var(--ink);
  font-size: 13px;
}

.external-sync-followup-list span {
  flex: 0 0 auto;
  color: var(--teal, #147e80);
  font-size: 12px;
  font-weight: 800;
}

.external-sync-followup-list article.pending span {
  color: var(--coral);
}

.external-sync-followup-list small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.portal-screen {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(420px, 100%);
  min-height: 720px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.teacher-screen {
  display: flex;
  justify-content: center;
}

.teacher-phone {
  width: min(720px, 100%);
  min-height: 720px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.portal-only {
  display: block;
  background: #edf4f3;
}

.teacher-only {
  display: block;
  background: #edf4f3;
}

.portal-only .sidebar,
.portal-only .topbar,
.portal-only .portal-picker,
.teacher-only .sidebar,
.teacher-only .topbar,
.teacher-only .teacher-picker {
  display: none;
}

.portal-only .shell,
.teacher-only .shell {
  padding: 10px;
}

.portal-only .view,
.teacher-only .view {
  display: none;
}

.portal-only #portal {
  display: block;
}

.teacher-only #teacherPortal {
  display: block;
}

.portal-only .portal-layout,
.teacher-only .teacher-layout {
  display: block;
}

.portal-only .portal-screen,
.teacher-only .teacher-screen {
  display: block;
}

.portal-only .phone-frame,
.teacher-only .teacher-phone {
  width: 100%;
  min-height: 100vh;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.teacher-hero {
  padding: 18px;
  border-radius: 8px;
  background: #15333a;
  color: #fff;
}

.teacher-schedule-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #15333a;
  color: #fff;
}

.teacher-schedule-head span,
.teacher-schedule-head small,
.teacher-day-count span {
  display: block;
  color: #bdd2d4;
}

.teacher-schedule-head strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.teacher-schedule-head small {
  margin-top: 6px;
}

.teacher-day-count {
  display: grid;
  place-items: center;
  min-width: 96px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  text-align: center;
}

.teacher-day-count strong {
  margin: 0;
  font-size: 30px;
}

.teacher-day-count span {
  margin-top: 2px;
  font-size: 12px;
}

.teacher-hero span,
.teacher-hero small {
  display: block;
  color: #bdd2d4;
}

.teacher-hero strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.teacher-hero small {
  margin-top: 6px;
}

.teacher-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.teacher-stats article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

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

.teacher-stats span {
  color: var(--muted);
  font-size: 12px;
}

.teacher-stats strong {
  margin-top: 6px;
  font-size: 22px;
}

.teacher-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
}

.teacher-week-day {
  min-width: 86px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  text-align: left;
}

.teacher-week-day.selected {
  border-color: #91bfbd;
  background: #edf7f6;
  box-shadow: inset 0 0 0 1px #91bfbd;
}

.teacher-week-day strong,
.teacher-week-day span,
.teacher-week-day small {
  display: block;
}

.teacher-week-day strong {
  white-space: pre-line;
  font-size: 13px;
}

.teacher-week-day span {
  margin-top: 8px;
  color: var(--teal-dark);
  font-weight: 800;
}

.teacher-week-day small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-day-panel {
  margin-top: 12px;
}

.teacher-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.teacher-section-title strong,
.teacher-section-title span {
  display: block;
}

.teacher-section-title span {
  color: var(--muted);
  font-size: 13px;
}

.teacher-day-list {
  display: grid;
  gap: 10px;
}

.teacher-week-overview {
  margin-top: 18px;
}

.teacher-week-overview-list {
  display: grid;
  gap: 10px;
}

.teacher-week-overview-day {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-week-overview-day header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink);
}

.teacher-week-overview-day header span {
  color: var(--muted);
  font-size: 13px;
}

.teacher-week-overview-lesson {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 6px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.teacher-week-overview-lesson time {
  color: var(--teal-dark);
  font-weight: 800;
}

.teacher-week-overview-lesson span,
.teacher-week-overview-lesson small {
  min-width: 0;
}

.teacher-week-overview-lesson small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.teacher-week-overview-empty {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.teacher-lesson-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--leaf);
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-lesson-card.no-show {
  border-left-color: var(--coral);
}

.teacher-lesson-card.cancelled {
  border-left-color: var(--gold);
  opacity: .78;
}

.teacher-lesson-time {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 8px;
  background: #edf4f3;
  color: var(--teal-dark);
}

.teacher-lesson-time strong,
.teacher-lesson-time span,
.teacher-lesson-main strong,
.teacher-lesson-main span,
.teacher-lesson-main small {
  display: block;
}

.teacher-lesson-time span,
.teacher-lesson-main span,
.teacher-lesson-main small {
  color: var(--muted);
  font-size: 13px;
}

.teacher-lesson-main {
  min-width: 0;
  align-self: center;
}

.teacher-lesson-main span,
.teacher-lesson-main small {
  margin-top: 5px;
}

.teacher-feedback-line {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.teacher-feedback-btn {
  margin-top: 10px;
  width: fit-content;
}

.teacher-sync-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbe6e5;
  border-radius: 8px;
  background: #fbfdfc;
}

.teacher-sync-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.teacher-sync-summary-head strong {
  color: var(--ink);
  font-size: 14px;
}

.teacher-sync-summary-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.teacher-sync-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.teacher-sync-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.teacher-sync-metric span,
.teacher-sync-metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.teacher-sync-metric strong {
  color: var(--teal, #147e80);
  font-size: 16px;
  line-height: 1.2;
}

.teacher-sync-metric.warning {
  border-color: #f0d8a6;
  background: #fffaf0;
}

.teacher-sync-metric.warning strong {
  color: #8a5e18;
}

.portal-hero {
  padding: 18px;
  border-radius: 8px;
  background: #15333a;
  color: #fff;
}

.portal-hero span,
.portal-hero small {
  display: block;
  color: #bdd2d4;
}

.portal-hero strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.portal-hero small {
  margin-top: 6px;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.portal-stats article,
.portal-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.portal-stats article {
  padding: 12px;
}

.portal-stats span,
.portal-section span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.portal-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.portal-tabbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.portal-tabbar button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.portal-tabbar button.selected {
  background: #dff0ed;
  color: var(--teal-dark);
  font-weight: 700;
}

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

.teacher-payroll-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.teacher-payroll-totals article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.teacher-payroll-totals span,
.teacher-payroll-totals strong {
  display: block;
}

.teacher-payroll-totals span {
  color: var(--muted);
  font-size: 12px;
}

.teacher-payroll-totals strong {
  margin-top: 5px;
  color: var(--teal-dark);
  font-size: 20px;
}

.portal-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.portal-risk-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--leaf);
  border-radius: 8px;
  background: #fbfdfc;
}

.portal-risk-card.yellow {
  border-left-color: var(--gold);
  background: #fffaf0;
}

.portal-risk-card.red {
  border-left-color: var(--coral);
  background: #fff4f1;
}

.portal-risk-card span,
.portal-risk-card strong,
.portal-risk-card small {
  display: block;
}

.portal-risk-card span,
.portal-risk-card small {
  color: var(--muted);
  font-size: 12px;
}

.portal-risk-card strong {
  margin: 5px 0;
  font-size: 18px;
}

.portal-section {
  padding: 14px;
  margin-top: 12px;
}

.portal-section h2 {
  font-size: 16px;
  margin-bottom: 0;
}

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

.portal-section-head span {
  text-align: right;
  line-height: 1.5;
}

.portal-match-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

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

.portal-match-form select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--white);
  color: var(--ink);
}

.portal-teacher-list {
  display: grid;
  gap: 10px;
}

.portal-teacher-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.portal-teacher-main {
  min-width: 0;
}

.portal-teacher-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.portal-teacher-head strong,
.portal-teacher-main p,
.portal-teacher-main small {
  display: block;
}

.portal-teacher-main p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.portal-teacher-resume {
  margin-bottom: 4px;
  line-height: 1.5;
}

.portal-teacher-main small {
  color: var(--teal-dark);
  line-height: 1.5;
}

.portal-account-grid,
.portal-payment-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portal-account-grid div,
.portal-payment-card div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
}

.portal-account-grid strong,
.portal-payment-card strong,
.portal-account-grid span,
.portal-payment-card span {
  display: block;
}

.portal-account-grid strong,
.portal-payment-card strong {
  margin-top: 5px;
  font-size: 15px;
}

.portal-lesson {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.portal-lesson:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.portal-lesson strong,
.portal-lesson small {
  display: block;
}

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

.portal-lesson-card,
.portal-consumption-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.portal-lesson-card {
  grid-template-columns: 78px 1fr;
  align-items: center;
  padding: 10px;
  margin-top: 8px;
}

.portal-lesson-card.no-show,
.portal-consumption-row.no-show {
  border-color: #efc5bf;
  background: #fff7f5;
}

.portal-lesson-card.cancelled,
.portal-consumption-row.cancelled {
  border-color: #f0cf95;
  background: #fff8e8;
}

.portal-lesson-date {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  background: #edf4f3;
  color: var(--teal-dark);
}

.portal-lesson-date strong,
.portal-lesson-date span,
.portal-lesson-card strong,
.portal-lesson-card small,
.portal-consumption-row strong,
.portal-consumption-row span {
  display: block;
}

.portal-lesson-date span,
.portal-lesson-card small,
.portal-consumption-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.portal-consumption-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px;
  margin-top: 8px;
}

.portal-consumption-row div:last-child {
  text-align: right;
}

.portal-note {
  color: var(--muted);
  line-height: 1.7;
}

.portal-interview-form {
  display: grid;
  gap: 10px;
}

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

.portal-interview-form select,
.portal-interview-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.portal-interview-form select {
  height: 40px;
}

.portal-survey-status {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.portal-survey-status span {
  color: var(--muted);
  font-size: 12px;
}

.portal-survey-status strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

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

.portal-interview-result div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.portal-interview-result strong,
.portal-interview-result span {
  display: block;
}

.portal-interview-result strong {
  margin-top: 4px;
  font-size: 13px;
}

.portal-interview-result p {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    overflow-x: hidden;
  }
  .sidebar {
    min-height: auto;
    min-width: 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px;
  }
  .brand { display: none; }
  .nav { display: flex; min-width: 0; width: 100%; overflow-x: auto; gap: 10px; }
  .nav-item, .growth-workbench-link { min-width: 108px; justify-content: center; min-height: 50px; font-size: 15px; }
  .shell { min-width: 0; width: 100%; padding: 18px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { width: 100%; }
  .search { width: 100%; }
  .metrics, .split, .card-grid, .finance-summary, .portal-layout, .teacher-layout, .schedule-workbench, .settings-grid, .payroll-detail-grid, .finance-data-toolbar, .finance-data-grid, .hq-campus-grid, .care-item, .operating-focus-grid { grid-template-columns: 1fr; }
  .student-archive-profile, .student-archive-grid { grid-template-columns: 1fr; }
  .management-review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-form .schedule-student-field,
  .schedule-form .schedule-hint { grid-column: 1 / -1; }
  .analytics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-summary div:nth-child(2) { border-right: 0; }
  .analytics-summary div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .portal-screen { justify-content: stretch; }
  .teacher-screen { justify-content: stretch; }
  .phone-frame { width: 100%; min-height: auto; box-shadow: none; }
  .teacher-phone { width: 100%; min-height: auto; box-shadow: none; }
  .lesson-card { grid-template-columns: 70px 1fr; }
  .lesson-card .status { grid-column: 2; width: fit-content; }
}

@media (max-width: 560px) {
  .top-actions, .toolbar, .dialog-actions { flex-wrap: wrap; }
  .primary, .secondary, .warning { flex: 1 1 auto; }
  .form-grid, .settings-form, .schedule-form { grid-template-columns: 1fr; }
  #purchaseForm .form-grid { grid-template-columns: minmax(0, 1fr); }
  #purchaseForm .form-grid :is(input, select) { min-width: 0; max-width: 100%; }
  .package-campus-pricing-row { grid-template-columns: 1fr 1fr; }
  .package-campus-pricing-campus,
  .package-campus-pricing-summary { grid-column: 1 / -1; }
  .teacher-grade-group { grid-template-columns: 1fr; }
  .student-profile-summary span { align-items: flex-start; flex-direction: column; gap: 4px; }
  .student-subnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .student-subnav button { width: 100%; }
  .student-archive-toolbar, .student-archive-head, .student-archive-assessment-head { align-items: stretch; flex-direction: column; }
  .student-archive-toolbar label { min-width: 0; width: 100%; }
  .student-archive-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-fields, .timeline-row { grid-template-columns: 1fr; }
  .teacher-stats { grid-template-columns: 1fr; }
  .analytics-summary { grid-template-columns: 1fr; }
  .data-summary-grid { grid-template-columns: 1fr; }
  .care-summary { grid-template-columns: 1fr; }
  .management-review-summary { grid-template-columns: 1fr; }
  .pending-deduction-summary { grid-template-columns: 1fr; }
  .pending-deduction-row { align-items: stretch; flex-direction: column; }
  .analytics-summary div,
  .analytics-summary div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .analytics-summary div:last-child { border-bottom: 0; }
  .analytics-detail { grid-template-columns: 1fr; }
  .compact-filter { grid-template-columns: 1fr; width: 100%; }
  .timeline-card { align-items: flex-start; flex-direction: column; }
  .settings-row { align-items: stretch; flex-direction: column; }
  .export-actions { justify-content: stretch; }
  .export-actions button,
  .finance-data-toolbar button { width: 100%; }
  .student-priority-grid,
  .student-process-metric-grid,
  .student-package-row,
  .schedule-student-packages,
  .transfer-preview,
  .portal-account-grid,
  .portal-payment-card,
  .portal-interview-result,
  .portal-risk-grid,
  .portal-lesson-card,
  .portal-consumption-row { grid-template-columns: 1fr; }
  .teacher-schedule-head { flex-direction: column; }
  .teacher-day-count {
    min-width: 0;
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .teacher-lesson-card { grid-template-columns: 1fr; }
  .portal-section-head { align-items: stretch; flex-direction: column; }
  .portal-section-head span,
  .portal-consumption-row div:last-child { text-align: left; }
}

.course-package-import-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.course-package-import-dialog > .dialog-head,
.course-package-import-dialog > .course-package-import-step,
.course-package-import-dialog > .course-package-import-actions {
  padding: 16px 20px;
}

.course-package-import-dialog > .dialog-head {
  border-bottom: 1px solid var(--line);
}

.course-package-import-dialog .dialog-head h2,
.course-package-import-dialog .dialog-head p,
.course-package-import-history-head h3 {
  margin: 0;
}

.course-package-import-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
  background: #f5f8f7;
}

.course-package-import-steps li {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.course-package-import-steps li span {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.course-package-import-steps li.active {
  color: var(--teal, #147e80);
  background: #e9f4f2;
}

.course-package-import-steps li.active span {
  border-color: var(--teal, #147e80);
  color: #fff;
  background: var(--teal, #147e80);
}

.course-package-import-upload,
.course-package-import-toolbar,
.course-package-import-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.course-package-import-file {
  flex: 1;
  min-width: 260px;
}

.course-package-import-file input {
  margin-top: 7px;
}

.course-package-import-history,
.course-package-import-preview-rows {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.course-package-import-history-row,
.course-package-import-preview-row,
.course-package-import-confirmation,
.course-package-import-result {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.course-package-import-history-row,
.course-package-import-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.course-package-import-history-row strong,
.course-package-import-history-row span,
.course-package-import-preview-row strong,
.course-package-import-preview-row span {
  display: block;
}

.course-package-import-history-row span,
.course-package-import-preview-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.course-package-import-preview-row.error {
  border-color: #e5a39d;
  background: #fff7f5;
}

.course-package-import-preview-row.duplicate {
  border-color: #e6c77d;
  background: #fffaf0;
}

.course-package-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.course-package-import-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.course-package-import-summary span,
.course-package-import-summary strong {
  display: block;
}

.course-package-import-summary strong {
  margin-top: 4px;
  font-size: 24px;
}

.course-package-import-setup-errors {
  margin-top: 12px;
  color: #a34339;
}

.course-package-import-confirmation ul,
.course-package-import-result ul {
  margin: 12px 0 0;
  padding-left: 22px;
  line-height: 1.8;
}

.course-package-import-actions {
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .course-package-import-steps li {
    min-height: 50px;
    font-size: 12px;
    text-align: center;
  }
  .course-package-import-steps li span { display: none; }
  .course-package-import-upload,
  .course-package-import-toolbar,
  .course-package-import-history-row,
  .course-package-import-preview-row {
    align-items: stretch;
    flex-direction: column;
  }
  .course-package-import-file { min-width: 0; }
  .course-package-import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  body.printing-receipt {
    display: block;
    margin: 0;
    min-height: 0;
    overflow: visible;
    background: #fff;
  }

  body.printing-receipt > :not(#paymentReceiptDialog),
  body.printing-receipt #paymentReceiptDialog > :not(#paymentReceiptContent) {
    display: none !important;
  }

  body.printing-receipt #paymentReceiptDialog {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.printing-receipt #paymentReceiptDialog::backdrop {
    display: none;
    background: transparent;
  }

  body.printing-receipt #paymentReceiptContent {
    position: static;
    padding: 0;
    background: #fff;
  }

  body.printing-receipt .receipt-paper {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-receipt .receipt-paper + .receipt-paper {
    break-before: page;
    page-break-before: always;
  }
}
.local-cleanup-rows details { border-bottom: 1px solid #dce5e8; padding: 12px 0; }
.local-cleanup-rows summary { cursor: pointer; font-weight: 600; }
.local-cleanup-rows ul { max-height: 280px; overflow: auto; padding-left: 24px; }
.local-cleanup-rows li { margin: 8px 0; overflow-wrap: anywhere; }
#localDemoCleanupControls { display: grid; justify-items: start; gap: 14px; padding-top: 16px; }
#localDemoCleanupControls .import-file { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; background: #edf5f5; }
#localDemoCleanupControls .check-field { display: flex; align-items: start; gap: 8px; margin: 0; overflow-wrap: anywhere; }
#localDemoCleanupControls .check-field input { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 3px; }
#localDemoCleanupSection[hidden], #localDemoCleanupControls[hidden] { display: none; }
/* HR settings use separate views and a bounded editor, not stacked forms. */
#legacyPayrollWorkspace[hidden] { display: none !important; }
#legacyClosingWorkspace[hidden] { display: none !important; }
#closingWorkspace { min-width: 0; }
.closing-workspace .hr-filters select { max-width: 100%; }
.closing-workspace .hr-filters { align-items: end; }
#hrWorkspace { min-width: 0; }
.hr-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid #d9e2e5; padding: 0 0 12px; }
.hr-tabs button { flex: 0 0 auto; background: transparent; color: #465e64; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 16px; white-space: nowrap; }
.hr-tabs button[aria-selected="true"] { color: #106c70; border-color: #167d80; background: #edf6f5; }
.hr-filters, .hr-section-head, .hr-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.hr-filters { margin: 18px 0 8px; }
.hr-filters label { display: grid; gap: 5px; font-size: 14px; color: #486067; min-width: 160px; }
.hr-filters input, .hr-filters select, .hr-dialog input, .hr-dialog select, .hr-dialog textarea { min-height: 42px; padding: 9px 12px; font: inherit; color: #273c42; background: #fff; border: 1px solid #cbd9dd; border-radius: 6px; }
.hr-section-head { justify-content: space-between; margin: 20px 0 14px; }
.hr-section-head h2, .hr-dialog h2 { margin: 0; font-size: 20px; }
.hr-section-head small { font-size: 14px; color: #667980; }
.hr-table-scroll { max-width: 100%; overflow-x: auto; border-top: 1px solid #d9e2e5; }
.hr-table-scroll table { min-width: 720px; }
.hr-table-scroll td { white-space: normal; overflow-wrap: anywhere; max-width: 340px; }
.hr-empty { padding: 32px 16px !important; color: #667980; }
.hr-error { color: #b63732; overflow-wrap: anywhere; }
.hr-notice { color: #486067; min-height: 22px; margin: 8px 0; overflow-wrap: anywhere; }
.hr-history { margin-top: 24px; padding-top: 16px; border-top: 1px solid #d9e2e5; }
.hr-history summary { cursor: pointer; color: #486067; }
.hr-subheading { font-size: 17px; margin-top: 28px; }
.hr-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px 0; }
.hr-total strong { font-size: 24px; }
dialog.hr-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #cbd9dd; border-radius: 8px; box-sizing: border-box; overflow-y: auto; box-shadow: 0 16px 48px #16343b33; background: #fff; color: #273c42; }
.hr-dialog form { display: block; min-width: 0; }
.hr-dialog header, .hr-dialog footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hr-dialog header { margin-bottom: 20px; }
.hr-dialog header button { width: 40px; height: 40px; flex: 0 0 40px; padding: 0; }
.hr-dialog footer { justify-content: flex-end; margin-top: 24px; }
.hr-dialog label { display: grid; gap: 8px; margin-bottom: 16px; min-width: 0; }
.hr-dialog textarea { min-height: 88px; resize: vertical; }
.hr-dialog input, .hr-dialog select, .hr-dialog textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.hr-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.hr-sync-campuses { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #cbd9dd; border-radius: 6px; min-width: 0; }
.hr-sync-campuses legend { padding: 0 6px; font-weight: 600; }
#hrSyncCampusOptions { display: flex; flex-wrap: wrap; column-gap: 18px; }
.hr-sync-campuses label { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; }
.hr-sync-campuses input[type="checkbox"] { width: 16px; min-height: 16px; padding: 0; margin: 0; }
.hr-sync-preview:not(:empty) { margin-top: 8px; padding-top: 8px; border-top: 1px solid #d9e2e5; }
.hr-sync-preview ul { margin: 6px 0 0; padding-left: 20px; }
.hr-sync-preview li + li { margin-top: 6px; }
.hr-sync-preview small { display: block; color: #486067; }
.hr-tier-heading, .hr-tier-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 12px; margin: 10px 0; align-items: center; }
.hr-tier-heading { font-size: 13px; color: #486067; }
.hr-tier-row button { width: 44px; padding: 10px; }
@media (max-width: 600px) {
  .hr-form-grid { grid-template-columns: minmax(0, 1fr); }
  .hr-tabs button { padding: 10px 12px; }
  .hr-filters label { flex: 1; min-width: 120px; }
  dialog.hr-dialog { padding: 16px; }
}

.academic-attendance-dialog { width: min(620px, calc(100vw - 32px)); }

.account-security-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#accountResetDialog { padding: 18px; box-sizing: border-box; }
.account-security-dialog form { display: grid; gap: 12px; }
.account-security-dialog label { display: grid; gap: 6px; }
.account-security-dialog input { width: 100%; min-width: 0; }
#accountTemporaryPassword { display: block; margin: 12px 0; overflow-wrap: anywhere; user-select: all; }
.academic-attendance-note, #academicAttendanceStatus { line-height: 1.65; overflow-wrap: anywhere; }
.academic-attendance-note { color: var(--muted, #617479); }
.academic-attendance-month, .academic-attendance-values label { display: grid; gap: 8px; }
.academic-attendance-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.academic-attendance-values input, .academic-attendance-month input { width: 100%; min-width: 0; box-sizing: border-box; }
.academic-attendance-review { display: flex; gap: 10px; align-items: flex-start; }
.academic-attendance-review input { width: auto; flex: 0 0 auto; margin-top: 4px; }
.academic-attendance-revision { color: #a65c18; white-space: pre-wrap; overflow-wrap: anywhere; }
.academic-attendance-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 520px) { .academic-attendance-values { grid-template-columns: 1fr; } .academic-attendance-actions button { flex: 1 1 auto; } }

#teacherCredentialDialog { width: min(36rem, calc(100vw - 2rem)); padding: 1.5rem; border: 1px solid #d9e4e7; border-radius: 1rem; }
#teacherCredentialDialog::backdrop { background: #102d3766; }
#teacherCredentialDialog p { line-height: 1.65; overflow-wrap: anywhere; }
#teacherCredentialCode { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; }

/* Retail forms remain independent from school admission and course enrollment. */
#retailSaleDialog, #retailConfigurationDialog { width: min(760px, calc(100vw - 32px)); }
#retailSaleForm [hidden], #retailConfigurationForm [hidden] { display: none !important; }
#retailSaleForm .form-grid, #retailConfigurationForm .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#retailSaleAmount { padding: 12px; background: #edf6f4; border-radius: 8px; font-weight: 600; }
@media (max-width: 560px) { #retailSaleForm .form-grid, #retailConfigurationForm .form-grid { grid-template-columns: 1fr; } }

/* Student lookups remain within the currently authorized data scope. */
.schedule-student-filter { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.schedule-student-filter > .schedule-combobox { flex: 0 1 420px; }
.schedule-main { min-width: 0; }
.schedule-main > .toolbar { flex-wrap: wrap; }
.schedule-main .schedule-mode-toggle { white-space: nowrap; }
#scheduleTimeline { isolation: isolate; }
#scheduleNowBtn { white-space:nowrap; }
#scheduleNowBtn[hidden] { display:none; }
.student-upcoming { border:1px solid var(--line, #dce5e5); border-radius:12px; padding:16px; margin:12px 0; }
.student-upcoming-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:8px; max-height:340px; overflow:auto; }
.student-upcoming-row { display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:4px; padding:12px; }
.student-upcoming-row span { color:var(--muted,#637575); }

.schedule-student-chips { display:flex; flex-wrap:wrap; gap:8px; }
.schedule-student-chip { display:inline-flex; align-items:center; border-radius:20px; background:#eaf4f3; padding:4px 10px; gap:8px; }
.schedule-student-chip button { padding:0 6px; border:0; background:transparent; }
#scheduleStudentPicker { display:grid; gap:12px; }
#scheduleStudentPicker[hidden] { display:none; }

.schedule-list-range { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.schedule-list-range label { display:grid; gap:6px; }
.schedule-batch-actions { position:sticky; bottom:0; display:flex; flex-wrap:wrap; align-items:center; gap:12px; background:var(--white); border:1px solid var(--line); border-radius:10px; padding:14px; z-index:8; box-shadow:0 -4px 16px #153e4810; }
.schedule-batch-actions label { display:flex; align-items:center; gap:8px; }
.schedule-batch-actions input[type=date] { width:auto; }
.schedule-list-past { background:#fff8df; }
.schedule-list-table details { min-width:180px; }
.schedule-list-table summary { cursor:pointer; font-weight:600; }
.schedule-list-table input[type=checkbox], #scheduleCancelStudents input[type=checkbox] { width:auto; flex:0 0 auto; }
.data-report-cancel-toggle { display:flex; align-items:center; gap:8px; margin:12px 0; }
.data-report-cancel-toggle input { width:auto; }
.is-busy::before { content:""; display:inline-block; width:12px; height:12px; margin-right:6px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:schedule-batch-spin 0.8s linear infinite; }
@keyframes schedule-batch-spin { to { transform:rotate(360deg); } }

/* Student-page typography and density stay scoped to this workspace. */
.shell:has(#students.active), #students {
  --student-title:24px; --student-name:22px; --student-section:16px; --student-tab:16px;
  --student-body:14px; --student-secondary:13px; --student-reminder:12px;
}
.shell:has(#students.active) .page-title-row{display:flex;align-items:center;gap:24px}
.shell:has(#students.active) .page-title-row h1{margin-bottom:0;white-space:nowrap}
.page-title-row #addStudentBtn{display:none;white-space:nowrap}
.shell:has(#students.active) #pageTitle{font-size:var(--student-title)}
.shell:has(#students.active) .page-title-row #addStudentBtn:not([hidden]){display:inline-block}
/* Page-local search replaces the inactive global input across views. */
.topbar .search{display:none}
.students-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.students-toolbar .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.students-toolbar .student-search-filter{flex:1 1 260px;min-width:220px}
.students-toolbar .student-search-filter input{width:100%;min-width:0;font-family:inherit;font-size:var(--student-body);padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink)}
.students-toolbar .compact-filter{display:flex;align-items:center;gap:6px;white-space:nowrap;flex:0 1 155px;font-size:var(--student-secondary);min-width:0}
.students-toolbar .compact-filter select{min-width:0;width:100%;font-size:var(--student-secondary);padding:10px 8px}
.student-workspace{display:grid;grid-template-columns:360px minmax(0,1fr);gap:18px;align-items:start}
.student-list-pane{max-height:calc(100dvh - 250px);min-height:320px;overflow:auto;padding:3px;scrollbar-gutter:stable;contain:layout style}
#studentGrid.student-compact-list{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-content:start}
#studentGrid .student-compact-card{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:64px;padding:8px 10px;border:1px solid #dce5e8;border-left:3px solid transparent;border-radius:8px;box-shadow:none;cursor:pointer;min-width:0;font-size:var(--student-secondary);content-visibility:auto;contain-intrinsic-size:auto 66px}
.student-compact-card:hover{background:#f6faf9}.student-compact-card:focus-visible{outline:2px solid #187d80;outline-offset:1px}
#studentGrid .student-compact-card.is-selected{background:#edf6f5;border-left-color:#187d80}
.student-compact-main{min-width:0;flex:1}.student-compact-card .card-top{display:flex;align-items:baseline;flex-wrap:wrap;justify-content:flex-start;gap:2px 5px;margin:0}
.student-compact-card .card-top strong{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.student-compact-card .student-namesake{font-size:10px;color:var(--muted);line-height:1.3}
.student-compact-card .status-badge{font-size:11px;padding:1px 4px;background:#eef1f1;color:#63747a}
.student-compact-card .student-name-chip{background:transparent;padding:0;border-radius:0}
.student-compact-meta{color:#687d85;margin:4px 0 0;line-height:1.4;font-size:var(--student-secondary);overflow-wrap:anywhere}
.student-compact-bottom{display:flex;flex-direction:column;align-items:flex-end;gap:3px;flex-shrink:0}
.student-remaining{font-weight:700;font-size:15px;line-height:1.3}
.student-remaining.red,.student-overview-metrics .red{color:#b3261e}.student-remaining.yellow,.student-overview-metrics .yellow{color:#896400}.student-remaining.neutral,.student-overview-metrics .neutral{color:#71828b}
.student-reminder{font-size:var(--student-reminder);color:#7d6955;line-height:1.3}
.student-drawer{container-type:inline-size;background:#fff;border:1px solid #dce5e8;border-radius:12px;display:flex;flex-direction:column;height:calc(100dvh - 250px);max-height:calc(100dvh - 250px);min-height:320px;min-width:0;position:sticky;top:12px;box-shadow:0 4px 20px #16383e0d;font-size:var(--student-body)}
.student-drawer[hidden]{display:none!important}
.student-drawer-empty{align-items:center;justify-content:center;padding:32px;text-align:center;box-sizing:border-box}
.student-drawer-empty h2{margin:0;font-size:var(--student-section);font-weight:600;color:#536e78}
.student-drawer-empty p{margin:12px 0 0;font-size:var(--student-secondary);color:#687d85;line-height:1.8}
.student-drawer-header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px 12px;align-items:center;padding:18px 20px 14px;flex-shrink:0}
.student-drawer-header h2{margin:0;font-size:var(--student-name);overflow-wrap:anywhere}
.student-drawer-title,.student-drawer-badges{display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px;min-width:0}
.student-drawer-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;font-size:12px;border-radius:999px;background:#eef3f2;color:#34565b}
.student-drawer-badge[data-bound]::before{content:"";height:7px;width:7px;border-radius:50%;background:#85939b}
.student-drawer-badge[data-bound="true"]::before{background:#18745d}
.student-drawer-badges button,.student-batch-line button{padding:3px 9px;font-size:12px}
.student-batch-line{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 8px;border-bottom:1px solid var(--line);font-size:13px}
.student-batch-line button{flex-shrink:0}
.student-drawer-header p{grid-column:1/-1;margin:0;font-size:var(--student-secondary);color:#647b84;line-height:1.6;overflow-wrap:anywhere}
.student-drawer-actions{display:flex;gap:6px;align-items:center}.student-drawer-actions button{font-size:var(--student-body);padding:8px 10px;white-space:nowrap}
.student-drawer-header .icon-btn{padding:4px 8px;align-self:start;font-size:22px}
.student-drawer-more{position:relative}.student-drawer-more summary{cursor:pointer;list-style:none;padding:5px 10px;border:1px solid #dce5e8;border-radius:6px;font-size:20px;line-height:1.4}
.student-drawer-more summary::-webkit-details-marker{display:none}.student-drawer-more>div{position:absolute;right:0;top:100%;z-index:2;background:white;padding:6px;border:1px solid #dce5e8;border-radius:8px;box-shadow:0 4px 12px #143a4020}
.student-drawer-tabs{display:flex;gap:10px;overflow-x:auto;padding:0 20px;border-bottom:1px solid #e0e9eb;flex-shrink:0;min-height:44px;scroll-padding-inline:14px}
.student-drawer-tabs.can-scroll-left{--student-tab-fade-left:14px}
.student-drawer-tabs.can-scroll-right{--student-tab-fade-right:14px}
.student-drawer-tabs:is(.can-scroll-left,.can-scroll-right){
  background:
    linear-gradient(to right,#cbdfe1,transparent) left center / var(--student-tab-fade-left,0px) 100% no-repeat,
    linear-gradient(to left,#cbdfe1,transparent) right center / var(--student-tab-fade-right,0px) 100% no-repeat;
}
.student-drawer-tabs button{background:transparent;border:0;border-radius:0;white-space:nowrap;font-size:var(--student-tab);padding:10px 8px;border-bottom:3px solid transparent}
.student-drawer-tabs button.selected{color:#116d72;border-bottom-color:#187d80;font-weight:700}
.student-drawer-content{overflow:auto;padding:18px 20px;min-height:0;overscroll-behavior:contain}
.student-drawer-content .student-detail-sections{margin:0;gap:14px}.student-drawer-content .student-detail-section{font-size:var(--student-body)}
.student-drawer-content .student-detail-section-head strong,.student-drawer-content .student-section-title,.student-drawer-content .student-detail-section h3,.student-drawer-content .student-detail-section>summary{font-size:var(--student-section)}
.student-drawer-content .student-detail-section-head span,.student-drawer-content small,.student-drawer-content .student-detail-meta{font-size:var(--student-secondary)}
.student-drawer-content .student-package-row,.student-drawer-content .student-payment-row{flex-wrap:wrap}
.student-drawer-content :is(.student-profile-lines,.student-consumption-row,.student-process-signals p,.student-process-timeline strong,.student-process-timeline p,.student-payment-row span,.student-package-row>span,.student-followup-latest p,.student-followup-list){font-size:var(--student-body)}
.student-drawer-content :is(.student-process-signals span,.student-process-timeline-head,.student-process-timeline time,.student-followup-latest span,.student-followup-latest small,.student-consumption-summary span,.student-package-audit span){font-size:var(--student-secondary)}
.student-drawer-content .student-package-row strong{font-size:var(--student-section)}
.student-drawer-content .student-package-row>span:nth-child(2),.student-drawer-content .student-payment-row strong{font-size:20px}

.student-overview-reminders{display:grid;gap:6px}.student-overview-reminders .student-risk-note{margin:0;padding:8px 12px;font-size:var(--student-secondary)}
.student-overview-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.student-overview-metrics article{background:#f5f8f8;border:1px solid #e5eded;border-radius:8px;padding:14px 12px;min-width:0}
.student-overview-metrics span{display:block;color:#687d85;font-size:var(--student-secondary);margin-bottom:6px}
.student-overview-metrics strong{font-size:22px;line-height:1.3}
.student-drawer-link{background:none;border:0;border-radius:0;color:#14777c;padding:0;font:inherit;text-align:left;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
@media(max-width:1100px){.student-drawer-header{grid-template-columns:minmax(0,1fr) auto}.student-drawer-actions{grid-column:1/-1;grid-row:3;flex-wrap:wrap}.student-drawer-header .icon-btn{grid-column:2;grid-row:1}}
@media(max-width:900px){
 .student-workspace{grid-template-columns:minmax(0,1fr)}
 .student-drawer-empty{display:none}
 .student-drawer{position:fixed;inset:0;z-index:90;border-radius:0;max-height:none;height:100dvh;box-sizing:border-box}
 .student-drawer-content{flex:1;min-height:0;padding:16px 16px calc(20px + env(safe-area-inset-bottom))}
 .student-drawer-header{padding:calc(16px + env(safe-area-inset-top)) 16px 12px}
 .student-drawer-tabs{padding:0 8px;gap:2px}.student-drawer-tabs button{padding:10px 7px}
 .student-list-pane{max-height:calc(100dvh - 200px)}
 .student-overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .students-toolbar .compact-filter{flex:1 1 145px}.students-toolbar .student-search-filter{flex-basis:100%}
}

@container(max-width:600px){.student-overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}

:is(#transferForm[data-batch-transfer="true"], #batchClearForm) .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
:is(#transferForm[data-batch-transfer="true"], #batchClearForm) :is(label, input, select) {
  min-width: 0;
}
:is(#transferForm[data-batch-transfer="true"], #batchClearForm) .transfer-preview {
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  :is(#transferForm[data-batch-transfer="true"], #batchClearForm) .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.batch-purchase-mode .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.batch-purchase-mode :is(label, input, select, .purchase-package-panel, .purchase-package-items, .purchase-package-row > span) {
  min-width: 0;
}
.batch-purchase-mode :is(.purchase-package-row, #batchPurchasePreview),
.receipt-batch-paper {
  overflow-wrap: anywhere;
}
.receipt-batch-table {
  table-layout: fixed;
}
.receipt-batch-table th:first-child {
  width: 43%;
}
@media (max-width: 560px) {
  .batch-purchase-mode .form-grid { grid-template-columns: minmax(0, 1fr); }
  .receipt-batch-paper { padding: 12px; }
  .receipt-batch-table :is(th, td) { padding: 6px; }
}
.batch-purchase-mode .product-sale-field { display: none; }

#activityWorkspaceBtn[hidden] { display: none; }
.activity-dialog { width: min(720px, calc(100% - 24px)); }
.activity-body { display: grid; gap: 12px; padding: 16px; }
.activity-card { padding: 12px; border: 1px solid #d9e2e4; border-radius: 10px; }
.activity-card h3, .activity-card p { margin: 0 0 8px; overflow-wrap: anywhere; }
.activity-form { display: grid; gap: 8px; margin: 10px 0; }
.activity-form label { display: grid; gap: 4px; }
.activity-form input, .activity-form select { width: 100%; box-sizing: border-box; }
.activity-form button { justify-self: start; }
.activity-notice:empty { display: none; }

.finance-student-picker { min-width: 0; flex: 1 1 240px; }
.finance-student-picker input { width: 100%; min-width: 0; }
.finance-student-picker .schedule-combobox-options { max-height: 240px; overflow: auto; overflow-wrap: anywhere; }
.cross-campus-transfer-line {
  margin: 12px 0;
  padding: 12px;
  min-width: 0;
  border: 1px solid #d6e1df;
  border-radius: 8px;
}
.cross-campus-transfer-line legend {
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.cross-campus-ledger-table {
  width: 100%;
  min-width: 1040px;
  table-layout: auto;
  border-collapse: collapse;
}
.cross-campus-ledger-table th,
.cross-campus-ledger-table td {
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.cross-campus-ledger-table th { white-space: nowrap; background: var(--paper); }
.cross-campus-ledger-table td:first-child { min-width: 130px; }
.cross-campus-ledger-table td span { display: block; color: var(--muted); overflow-wrap: anywhere; }
#transferForm[data-cross-campus-transfer="true"] .dialog-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 1;
  padding: 10px 0;
}

body.auth-locked > aside.sidebar,
body.auth-locked > main.shell,
.settings-tab-hidden { display: none !important; }

.settings-tabs, .account-filters, .account-pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px;
}
.settings-tabs button {
  background: var(--panel, white); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 14px; cursor: pointer;
}
.settings-tabs button[aria-pressed="true"] { background: var(--teal, #147e80); color: white; }
[data-settings-group="accounts"] { min-width: 0; min-height: 0; }
[data-settings-group="accounts"] summary { cursor: pointer; font-weight: 600; }
.account-filters label { display: grid; gap: 4px; }
.account-filters :is(select,input) { padding: 6px; border: 1px solid var(--line); border-radius: 4px; }
.account-table-wrap { overflow-x: auto; }
.account-table { width: 100%; border-collapse: collapse; }
.account-table .settings-row { display: table-row; }
.account-table :is(th,td) { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.account-table th { white-space: nowrap; }
.account-table .settings-actions { min-width: 140px; }
.account-pager { justify-content: flex-end; margin: 12px 0 0; }
#accountModalTitle { margin: 18px 18px 0; }
#accountFormModal { max-height: 90dvh; overflow: auto; }
#financeAccountCampusField {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid #dbe3e5;
  border-radius: 10px;
  padding: 10px 12px;
}
#financeAccountCampusChoices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}
#financeAccountCampusChoices label {
  display: flex;
  align-items: center;
  gap: 6px;
}
#financeAccountCampusChoices input { width: auto; }
#transferRequestsDialog .panel { margin: 8px 0; }

.student-list-load-more{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;margin-top:4px;border:1px dashed #cbd8dc;border-radius:8px;background:#f8fbfb;color:#526971;font-size:12px}
.student-list-load-more button{padding:5px 10px;font-size:12px}

/* Billing pickers reserve space so the next filter remains reachable. */
#billing .schedule-combobox-options {
  position: static;
  width: 100%;
  max-height: 220px;
}
#billing .billing-toolbar { align-items: flex-start; }
.list-pager { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:10px 0; }
.list-pager span { color:var(--muted); font-size:13px; }
.schedule-combobox-controls { position: relative; }
.schedule-combobox .schedule-combobox-controls input { padding-right: 4.85rem; }
.schedule-combobox-clear, .schedule-combobox-toggle { position: absolute; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; padding: 0; border: 0; background: transparent; color: #52666c; }
.schedule-combobox-clear { right: 2.45rem; }
.schedule-combobox-toggle { right: .4rem; }
.schedule-combobox-clear:hover, .schedule-combobox-toggle:hover:not(:disabled) { background: #e7f0ef; }
.schedule-combobox-controls input:disabled { background: #edf1f2; color: #657479; }
.schedule-combobox-toggle:disabled { opacity: .45; cursor: default; }
.schedule-combobox-lock { color: var(--muted); line-height: 1.3; }
.schedule-combobox-clear[hidden] { display: none; }
.schedule-combobox-group { padding: .35rem .65rem; color: #52666c; background: #eef4f3; font-size: .8rem; font-weight: 600; }

/* #22: compact catalog and member-specific group lesson editor. */
.p22-package-toolbar,.p22-package-groups{display:grid;gap:12px}
.p22-package-filters,.p22-package-search-box{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.p22-package-filter{padding:6px 12px;border-radius:999px}
.p22-package-filter.is-selected{background:var(--teal, #147e80);color:white;border-color:var(--teal, #147e80)}
.p22-package-filter-count{font-variant-numeric:tabular-nums;opacity:.8;margin-left:4px}
.p22-package-search-label,.p22-package-count,.p22-package-category-note,.p22-package-meta{color:var(--muted);font-size:13px}
.p22-package-search-box input{min-width:180px;flex:1;max-width:420px}
.p22-package-group{border:1px solid var(--line);border-radius:10px;background:white;overflow:hidden}
.p22-package-category-toggle{display:flex;align-items:center;gap:10px;padding:13px 16px;background:#edf6f3;cursor:pointer}
.p22-package-category-count,.p22-package-status{flex:none;font-size:12px}
.p22-package-category-note{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.p22-package-list{padding:0 12px;overflow-x:auto}
.p22-package-row+.p22-package-row{border-top:1px solid var(--line)}
.p22-package-row-head{display:flex;align-items:center;gap:12px}
.p22-package-row .p30-package-handle { min-width: 32px; flex-shrink: 0; touch-action: none; }
.p22-package-row .p30-package-handle:active { cursor: grabbing; }
.p22-package-row.p35-order-dragging { opacity: .58; outline: 2px solid #198b89; }
.p22-package-row.p35-order-before { box-shadow: 0 -4px 0 #198b89; }
.p22-package-row.p35-order-after { box-shadow: 0 4px 0 #198b89; }
.p35-order-position, .p35-order-editor { flex-shrink: 0; }
.p35-order-position { min-width: 42px; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.p35-order-editor { display: inline-flex; align-items: center; gap: 4px; }
.p35-order-editor input { width: 3.9rem; min-width: 0; padding: 4px; }
.p35-order-editor button { padding: 4px 6px; }
.p22-package-summary{display:flex;align-items:center;gap:9px;flex:1;min-width:0;padding:14px 0;cursor:pointer}
.p22-package-name{min-width:0;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.p22-package-meta{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.p22-package-actions{display:flex;gap:6px;flex:none;white-space:nowrap;background:white}
.p22-package-action{padding:7px 10px;font-size:13px}
.p22-package-chevron{display:inline-block;flex:none;transition:transform .18s ease}
[aria-expanded=true]>.p22-package-chevron{transform:rotate(90deg)}
.p22-package-status{padding:2px 7px;border-radius:999px;font-style:normal}
.p22-package-status.is-active{color:#347040;background:#edf7ed}
.p22-package-status.is-inactive{color:var(--muted);background:#eef1f2}
.p22-package-collapse{display:grid;grid-template-rows:0fr;transition:grid-template-rows .18s ease}
.p22-package-collapse.is-open{grid-template-rows:1fr}
.p22-package-collapse-inner{min-height:0;overflow:hidden}
.p22-package-detail-content{padding:0 18px 14px 26px;color:var(--muted);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.p22-package-detail-content p{margin:4px 0}
.p22-package-empty{padding:18px;color:var(--muted)}
.p22-package-summary:focus-visible,.p22-package-category-toggle:focus-visible{outline:2px solid var(--teal, #147e80);outline-offset:-2px;border-radius:6px}
.schedule-package-card > .p22-member-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:10px 0;border-top:1px solid var(--line);grid-column:1/-1}
.p22-member-editor label{display:grid;gap:4px;min-width:0}
.p22-member-editor > strong,.p22-member-editor > span{grid-column:1/-1}
.p22-member-editor select{width:100%;min-width:0}
.p22-member-locked{color:#8b5d23;flex-basis:100%}
@media(max-width:760px){.p22-package-row-head{min-width:690px}.p22-package-actions{position:sticky;right:0;padding-left:8px}.p22-package-category-note{display:none}}
@media(prefers-reduced-motion:reduce){.p22-package-collapse,.p22-package-chevron{transition:none}}

/* #24 Common onboarding actions stay visible; maintenance is opt-in. */
.guardian-status-card { padding: 16px; background: var(--soft, #edf5f4); border-radius: 12px; margin: 16px 0; }
.guardian-status-card strong { display: block; font-size: 1.15rem; margin-bottom: 8px; }
.guardian-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.guardian-more, .guardian-add { margin: 16px 0; }
.guardian-more summary, .credential-more summary { cursor: pointer; padding: 8px; }
.credential-more-actions { display: grid; gap: 8px; padding: 8px; max-width: 260px; }
.account-phone { display: block; margin-top: 6px; }
.teacher-mini-status { flex-basis: 100%; font-size: .9rem; }

/* #25: on-demand operation records stay within the dialog. */
#scheduleRecordsDialog { width: min(1080px, calc(100vw - 32px)); max-height: 90vh; }
#scheduleRecordsDialog .dialog-body { overflow: auto; max-height: 76vh; }
#scheduleRecordsDialog .audit-panel { margin: 0; padding: 0; border: 0; }
#lessonAuditDetails > summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
#lessonAuditList .audit-row { margin-top: 10px; }

.calendar-card.calendar-hold { --card-bg:#eef1ff; --card-border:#9b9bd4; background:#eef1ff; border-color:#9b9bd4; color:#353a65; }
.calendar-card.calendar-hold-care { background:#eaf5f0; border-color:#83b5a2; }
.calendar-card.calendar-hold-room { background:#f4eef7; border-color:#b69ac6; }
#addLessonForm [name="scheduleMode"] { font-weight:700; }
#p26HoldAudit summary { cursor:pointer; font-weight:700; padding:12px 0; }

/* A pending move is a calendar-only display, never a second drag preview. */
.calendar-card.schedule-saving { opacity:.72; cursor:progress; pointer-events:none; transition:opacity 120ms ease; }
.schedule-save-badge { position:absolute; right:5px; bottom:4px; padding:2px 6px; border-radius:8px; font-size:11px; line-height:1.25; background:#f4faf8; color:#37645e; border:1px solid #abc8c1; }

.refund-approval-section{margin:24px 0;padding:20px;border:1px solid #d9e6e8;border-radius:12px;background:#fff}.refund-pending-badge{background:#b63636;color:#fff;border-radius:20px;padding:3px 9px;font-size:14px}.refund-filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:16px 0}.refund-table-scroll{overflow:auto}.refund-table-scroll td{min-width:100px;vertical-align:top}.refund-table-scroll button{margin:3px}.refund-preview{padding:14px;background:#eef8f7;border-radius:8px;margin:14px 0}.refund-pages{display:flex;align-items:center;justify-content:end;gap:12px;margin-top:14px}.refund-receipt{background:white;color:#213437;padding:28px;max-width:720px;margin:auto}.refund-receipt h1{text-align:center;margin-bottom:24px}.refund-receipt dl{display:grid;grid-template-columns:130px 1fr;border-top:1px solid #aebebf}.refund-receipt dt,.refund-receipt dd{padding:12px;margin:0;border-bottom:1px solid #c4d2d3;white-space:pre-wrap;overflow-wrap:anywhere}.refund-signatures{display:grid;grid-template-columns:1fr 1fr;margin-top:40px;gap:50px}#refundFormError{color:#b33636}#refundReceiptDialog{width:min(800px,95vw)}
@media print{body:has(#refundReceiptDialog[open])>*{display:none!important}body:has(#refundReceiptDialog[open])>#refundReceiptDialog{display:block!important;position:static;border:0;max-height:none;width:100%;max-width:none;margin:0;padding:0}#refundReceiptDialog .refund-print-actions{display:none!important}}

.refund-filters label{display:flex;flex-direction:column;gap:6px;min-width:140px}.refund-filters select{font:inherit;min-height:40px;padding:8px 12px;border:1px solid #cddfe1;border-radius:8px;background:white}

/* P30: compact group detail, explicit session preview, accessible order controls. */
.p30-group-meta{padding:12px;background:#f2f7f7;border-radius:10px;line-height:1.8}.p30-group-students{list-style:none;padding:0;margin:8px 0 16px}.p30-group-student{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #e5eeee}.p30-lesson-status{font-size:12px;color:#637879}.p30-group-batches{padding:12px;background:#f7fafb;border-radius:8px}.p30-role-preview-banner{padding:10px 18px;margin:0 0 16px;border:1px solid #e5ca82;background:#fff8e7;border-radius:10px;color:#6b531c}.p30-role-preview-banner[hidden]{display:none}.p30-campus-choices{display:grid;gap:12px;margin:20px 0}.p30-package-handle{cursor:grab;padding:7px;border:0;background:transparent;color:#6c8384}.p30-package-order{display:flex;gap:3px}.p30-package-order button{padding:5px}.p30-order-target{box-shadow:0 -3px 0 #198b89}.p30-order-saving{opacity:.6;pointer-events:none}

.p30-package-handle{touch-action:none;user-select:none}

.p30-group-student .hint-danger{color:#b42318}

/* P31: lightweight list filters and permission-rendered bulk assignments. */
.students-toolbar { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:10px; padding:12px 14px; background:#f8fbfb; border:1px solid #e1ebec; border-radius:10px; }
.students-toolbar-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; width:100%; }
.students-toolbar-primary { justify-content:space-between; }
.students-toolbar-primary .student-search-filter { flex:1 1 300px; max-width:460px; min-width:220px; }
.students-toolbar-primary .student-search-filter input { width:100%; }
.students-toolbar-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-left:auto; }
.students-toolbar-actions button { white-space:nowrap; }
.students-toolbar-filters { justify-content:flex-start; padding-top:8px; border-top:1px dashed #e2ecec; }
.students-toolbar-filters .compact-filter { flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:13px; color:#526669; }
.students-toolbar-filters .compact-filter select { width:auto; min-width:108px; max-width:200px; padding-right:26px; }
.students-toolbar-filters .students-sort-filter { margin-left:auto; }
@media (max-width: 960px) {
  .students-toolbar-primary .student-search-filter { max-width:none; }
  .students-toolbar-actions { margin-left:0; }
  .students-toolbar-filters .students-sort-filter { margin-left:0; }
}
.student-binding-summary,.student-bulk-controls,.student-bulk-action-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:10px 0; }
.student-binding-summary { color:var(--muted,#596d70); font-size:14px; }
.student-binding-summary .student-bound-count { color:#28745b; }
.student-unbound-count { background:#fff3e6; color:#92541d; border:1px solid #ebd1ad; padding:6px 12px; border-radius:20px; }
.student-bulk-action-bar { background:#edf7f6; padding:10px 14px; border-radius:10px; }
.student-select-all,.student-row-selection { display:flex; align-items:center; gap:8px; }
.student-select-all input,.student-row-selection input { width:18px; height:18px; margin:0; }
.student-row-selection { align-self:start; padding:8px; cursor:pointer; }
.student-compact-card:has(.student-row-selection) { grid-template-columns:auto minmax(0,1fr) auto; }
.student-list-relationships { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; }
.student-binding-badge { display:inline-block; border-radius:14px; padding:3px 8px; white-space:nowrap; }
.student-binding-badge.bound { background:#e4f3e9; color:#28724f; }
.student-binding-badge.unbound { background:#fff0df; color:#91551e; }
.student-binding-badge.visitor { background:#eef1f4; color:#66737c; }
.student-assignment-meta .muted { color:#8a969b; }
#studentBulkAssignDialog { width:min(620px,94vw); }
#studentBulkAssignForm { display:grid; gap:12px; }
#studentBulkAssignForm fieldset { display:flex; gap:12px; flex-wrap:wrap; border:1px solid #d9e4e5; border-radius:8px; }
#studentBulkAssignForm fieldset label { display:flex; gap:6px; align-items:center; }
#studentBulkAssignForm fieldset input { width:18px; height:18px; }
.student-bulk-confirm { background:#edf7f6; padding:12px; border-radius:8px; line-height:1.6; }
#studentBulkNotice { color:#9c3935; }
@media(max-width:650px) { .student-compact-card:has(.student-row-selection) { grid-template-columns:auto minmax(0,1fr); } .student-compact-card:has(.student-row-selection) .student-compact-bottom { grid-column:2; } .students-toolbar .compact-filter { max-width:100%; } }


/* P36 payroll ledgers and raise preview. Existing HR/closing tables are unchanged. */
#hrWorkspace,
dialog.p36-read-dialog,
.p36-timeline,
.p36-raise-preview {
  --p36-ink: #1f2d2b;
  --p36-muted: #617573;
  --p36-teal: #1d6b5f;
  --p36-teal-light: #eef6f4;
  --p36-line: #e3eae8;
  --p36-blue: #2a62a8;
  --p36-orange: #8a4a0b;
  --p36-orange-light: #fff3e0;
}

.p36-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  margin: 0 0 14px;
  color: var(--p36-muted);
}
.p36-toolbar > label { min-width: 0; }
.p36-toolbar select,
.p36-search :is(input, select),
input.p36-search {
  box-sizing: border-box;
  min-height: 36px;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid #cfd8d6;
  border-radius: 6px;
  background: #fff;
  color: var(--p36-ink);
  font-size: 13px;
}
.p36-toolbar .p36-search { flex: 0 1 266px; min-width: 0; }
.p36-search input { width: 100%; }
.p36-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.p36-chips + .p36-chips { padding-left: 10px; border-left: 1px solid var(--p36-line); }
.p36-chip,
.p36-chip.small-btn {
  min-height: 32px;
  padding: 3px 10px;
  border: 1px solid #d5e2df;
  border-radius: 999px;
  background: #fff;
  color: #3d5450;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.p36-chip:not(:disabled):hover { background: var(--p36-teal-light); }
.p36-chip[aria-pressed="true"],
.p36-chip[aria-pressed="true"]:not(:disabled):hover {
  border-color: var(--p36-teal);
  background: var(--p36-teal);
  color: #fff;
}

.p36-ledger-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--p36-line);
  border-radius: 8px;
  background: #fff;
}
.p36-ledger {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  color: var(--p36-ink);
  font-size: 13px;
}
.p36-ledger th,
.p36-ledger td {
  padding: 8px;
  border-bottom: 1px solid #edf2f0;
  text-align: left;
  vertical-align: middle;
}
.p36-ledger th {
  background: #f3f7f6;
  color: #50635f;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.p36-ledger td:first-child { min-width: 150px; overflow-wrap: anywhere; }
.p36-ledger tbody:last-child tr:last-child td { border-bottom: 0; }
.p36-ledger th.p36-number,
.p36-ledger td.p36-number {
  width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.p36-ledger th.p36-number { color: var(--p36-teal); }
.p36-ledger td.p36-number { font-size: 13px; }
.p36-equal { color: #647775; }
.p36-higher { color: var(--p36-ink); font-weight: 700; }
.p36-none { color: #687976; }
.p36-ledger td:has(> .p36-flat) { text-align: center; }
.p36-flat {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--p36-teal-light);
  color: var(--p36-teal);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.p36-sub { display: block; margin-top: 2px; color: var(--p36-muted); font-size: 12px; line-height: 1.45; }
.p36-group td,
.p36-ledger th.p36-group {
  padding: 6px 8px;
  background: #f7faf9;
  color: var(--p36-teal);
  font-size: 13px;
  font-weight: 700;
}
.p36-group :is(span, small) { display: inline; margin-left: 6px; color: var(--p36-muted); font-size: 12px; font-weight: 400; }

.p36-tag,
.p36-category,
.p36-campus,
.p36-state,
.p36-warn-pill {
  display: inline-block;
  max-width: 100%;
  padding: 1px 7px;
  line-height: 1.5;
  vertical-align: baseline;
  font-size: 11.5px;
}
.p36-tag,
.p36-category { margin: 1px 0 1px 5px; border-radius: 4px; background: #eef3ff; color: var(--p36-blue); }
.p36-tag.is-regular { background: #e6f2ff; }
.p36-tag.is-trial,
.p36-tag[data-tone="orange"] { background: var(--p36-orange-light); color: var(--p36-orange); }
.p36-tag.is-special,
.p36-tag:is(.is-category-other, [data-tone="violet"]),
.p36-category:is(.is-category-other, [data-tone="violet"]) { background: #f1e9ff; color: #6941b1; }
.p36-tag:is(.is-category-piano, [data-tone="pink"]),
.p36-category:is(.is-category-piano, [data-tone="pink"]) { background: #fdeef3; color: #9c3057; }
.p36-tag:is(.is-category-vocal, [data-tone="green"]),
.p36-category:is(.is-category-vocal, [data-tone="green"]) { background: #e7f5ec; color: #21693a; }
.p36-tag:is(.is-category-literacy, [data-tone="orange"]),
.p36-category:is(.is-category-literacy, [data-tone="orange"]) { background: var(--p36-orange-light); color: var(--p36-orange); }
.p36-state { border-radius: 999px; background: #e7f5ec; color: #21693a; white-space: nowrap; }
.p36-state.is-off { background: #f0f2f2; color: #5b6b67; }
.p36-state.is-future,
.p36-warn-pill { border-radius: 999px; background: var(--p36-orange-light); color: var(--p36-orange); }
.p36-campus { margin: 1px 3px 1px 0; border: 1px solid #d9e5e2; border-radius: 999px; color: #3d5450; white-space: nowrap; }

.p36-link,
.p36-link.small-btn {
  display: inline;
  inline-size: auto;
  min-height: 28px;
  padding: 2px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--p36-blue);
  font-size: inherit;
  font-weight: 500;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: normal;
  cursor: pointer;
}
.p36-link:not(:disabled):hover { background: #e6f2ff; color: #184f91; }
.p36-ops { white-space: nowrap; }
.p36-ops > .hr-actions { flex-wrap: nowrap; gap: 3px; }
.p36-ops .small-btn {
  min-height: 30px;
  padding: 3px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--p36-teal);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.p36-ops .small-btn:not(:disabled):hover { background: var(--p36-teal-light); }
.p36-ops .small-btn:is(.warning, .warn, .is-warning, .is-warn, .danger, [data-hr-action="binding.stop"], [data-hr-action="type.archive"], [data-hr-action="type.delete"]) { color: var(--p36-orange); }
.p36-ops .small-btn:is(.warning, .warn, .is-warning, .is-warn, .danger, [data-hr-action="binding.stop"], [data-hr-action="type.archive"], [data-hr-action="type.delete"]):not(:disabled):hover { background: var(--p36-orange-light); }
.p36-ledger-scroll:focus-visible,
.p36-toolbar :focus-visible,
.p36-card :focus-visible,
.p36-ledger :focus-visible,
.p36-read-dialog :focus-visible {
  outline: 2px solid var(--p36-blue);
  outline-offset: -2px;
}

.p36-card { min-width: 0; margin: 0 0 14px; border: 1px solid var(--p36-line); border-radius: 10px; background: #fff; }
.p36-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 9px 9px 0 0;
  background: #f3f7f6;
}
.p36-card-title { flex: 1 1 145px; min-width: 0; margin: 0; color: var(--p36-ink); font-size: 15px; overflow-wrap: anywhere; }
.p36-card-title :is(h3, h4) { margin: 0; font-size: inherit; }
.p36-avatar {
  display: inline-grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--p36-teal);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.p36-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-inline-start: auto; }
.p36-card-actions .small-btn { padding: 5px 10px; font-size: 12px; }
.p36-card .p36-ledger-scroll { border: 0; border-radius: 0 0 9px 9px; }
.p36-card .p36-ledger { min-width: 1080px; }
.p36-card .p36-ledger th { background: #fff; }
.p36-dates { font-variant-numeric: tabular-nums; white-space: nowrap; }
.p36-dates .p36-sub { white-space: nowrap; }
.p36-dates.is-future,
td.p36-future,
.p36-future td:first-child,
.p36-future .p36-dates { color: var(--p36-orange); }
.p36-future td,
.p36-alert td { background: #fffaf2; border-top: 1px dashed #efdab8; }
.p36-alert,
.p36-alert .p36-link { color: var(--p36-orange); }
.p36-alert .p36-link:not(:disabled):hover { background: var(--p36-orange-light); color: var(--p36-orange); }
.p36-overflow-row td { background: #f7faf9; color: var(--p36-muted); font-variant-numeric: tabular-nums; }
.p36-overflow-row ul { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; }
.p36-highlight td,
.p36-highlight:first-child { background: #f0f7ff; }
.p36-history { margin-top: 3px; color: var(--p36-muted); font-size: 12px; }
.p36-history summary { padding: 3px 0; color: var(--p36-teal); cursor: pointer; }
.p36-history ul { margin: 3px 0; padding-inline-start: 18px; }
.p36-history li + li { margin-top: 4px; }
.p36-legend { margin: 10px 0 0; color: var(--p36-muted); font-size: 12.5px; line-height: 1.75; }
.p36-legend b,
.p36-legend strong { color: var(--p36-ink); }

dialog.p36-read-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); border-color: #d5e2df; border-radius: 12px; }
.p36-read-dialog .p36-ledger { min-width: 480px; }
.p36-read-dialog .p36-ledger td:first-child { min-width: 0; }
.p36-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  overflow: hidden;
  margin: 6px 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
}
.p36-segment {
  flex: 1 1 145px;
  min-width: 0;
  padding: 8px 10px;
  background: #eef2f1;
  color: #455b56;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.p36-segment:is(.is-new, .new, [data-segment="new"]) { background: #e6f2ff; color: var(--p36-blue); }
.p36-segment:is(.is-additional, .additional, [data-segment="additional"], .is-future, .future) { background: var(--p36-orange-light); color: var(--p36-orange); }
.p36-segment :is(strong, small) { display: block; }
.p36-raise-preview { padding: 9px 12px; border-radius: 8px; background: #f4f8f7; color: var(--p36-ink); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.p36-raise-preview:empty,
.p36-timeline:empty { display: none; }
.p36-raise-preview p { margin: 4px 0; }
.p36-timeline:has(.p36-timeline-package) { display: block; }
.p36-timeline h3,.p36-raise-preview h3 { margin: 0 0 7px; font-size: 14px; }
.p36-timeline-package { margin-top: 10px; }
.p36-timeline-campus-name { display: block; margin: 4px 0; color: var(--p36-muted); }
.p36-timeline-campus ol { display: flex; gap: 2px; flex-wrap: wrap; list-style: none; margin: 3px 0 12px; padding: 0; border-radius: 8px; overflow: hidden; }
.p36-raise-current { padding: 8px 10px; background: #f3f7f6; border-radius: 6px; font-size: 14px; }
.p36-raise-campuses,.p36-raise-bulk { margin: 8px 0; border: 1px solid #d9e5e2; border-radius: 6px; padding: 7px 10px; }
.p36-raise-campuses label,.p36-raise-bulk label { display: inline-flex; gap: 5px; align-items:center; margin-right: 10px; }
.p36-raise-campuses input,.p36-raise-bulk input,.p36-toolbar input[type="checkbox"] { accent-color: #1d6b5f; width: auto; }
.p41-pkg-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.p41-pkg-actions { display: flex; gap: 6px; }
.p41-mini-btn { padding: 2px 8px; border: 1px solid #bfd2ce; border-radius: 5px; background: #fff; color: #1d6b5f; font-size: 12px; font-weight: 600; cursor: pointer; }
.p41-mini-btn:hover:not(:disabled) { background: #eef6f4; }
.p41-mini-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.p41-pkg-groups { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; padding-right: 2px; }
.p41-pkg-group { border: 1px solid #e3eae8; border-radius: 6px; background: #f9fbfb; padding: 7px 9px; }
.p41-pkg-group-head { display: flex !important; align-items: center; gap: 6px; margin: 0 0 6px !important; font-size: 13px; color: #1f2d2b; cursor: pointer; }
.p41-pkg-group-count { margin-left: auto; font-size: 11.5px; color: #617573; background: #eaf2f0; padding: 1px 6px; border-radius: 999px; }
.p41-pkg-chips { display: flex; flex-wrap: wrap; gap: 5px 8px; padding-left: 20px; }
.p41-pkg-chip { display: inline-flex !important; align-items: center; gap: 4px; margin: 0 !important; padding: 2px 7px; border: 1px solid #dbe6e3; border-radius: 5px; background: #fff; font-size: 12px; color: #2b3c39; cursor: pointer; }
.p41-pkg-chip:has(input:checked) { border-color: #1d6b5f; background: #eef6f4; color: #154e45; font-weight: 600; }
.p41-mixed-warn { margin: 8px 0; padding: 9px 12px; border: 1px solid #f0b45b; border-left: 4px solid #d97706; border-radius: 6px; background: #fff8eb; color: #7c4200; font-size: 12.5px; line-height: 1.55; }
.schedule-trial-pay-hint { margin: 0; padding: 8px 10px; border: 1px solid #b9ddd6; border-left: 4px solid #1d6b5f; border-radius: 6px; background: #eef7f5; color: #154e45; font-size: 12.5px; line-height: 1.5; }
.p46-transfer-sheet { grid-column: 1 / -1; border: 1px solid #d5e3e0; border-radius: 10px; background: #fbfdfd; overflow: hidden; }
.p46-sheet-title { padding: 7px 12px; background: #eef5f4; color: #1a4f47; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; border-bottom: 1px solid #dce8e6; }
.p46-sheet-title-in { border-top: 1px solid #dce8e6; background: #edf6f3; }
.p46-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.p46-table th { padding: 6px 10px; font-weight: 600; color: #647674; background: #f8fbfa; border-bottom: 1px solid #e6efed; text-align: left; white-space: nowrap; }
.p46-table td { padding: 7px 10px; color: #1f2d2b; border-bottom: 1px solid #eef4f3; vertical-align: middle; }
.p46-table tbody tr:last-child td { border-bottom: none; }
.p46-table tfoot td { padding: 7px 10px; background: #f6faf9; border-top: 1px solid #dce8e6; font-weight: 600; color: #2b3f3d; }
.p46-table .p46-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p46-table .p46-total { color: #155e53; font-size: 13.5px; font-weight: 700; }
.p46-table .p46-surplus { color: #b45309; font-weight: 700; }
.p46-sub { display: block; font-size: 11px; font-weight: 400; color: #6c7f7d; margin-top: 1px; }
.p46-formula { padding: 8px 12px; background: #f4f8f7; border-top: 1px solid #dce8e6; font-size: 12px; color: #3a524f; font-variant-numeric: tabular-nums; display: grid; gap: 4px; }
.p46-formula > div { padding: 0 !important; background: transparent !important; border-radius: 0 !important; }
.p46-wallet { color: #164e46; }
.p46-wallet b { color: #0f5132; font-weight: 700; }

@media (max-width: 600px) {
  .p36-toolbar .p36-search { flex-basis: 100%; }
  .p36-chips + .p36-chips { padding-left: 0; border-left: 0; }
  .p36-card-actions { flex-basis: 100%; margin-inline-start: 0; }
  .p36-card-head { padding: 9px 10px; }
  .p36-timeline { flex-direction: column; }
  .p36-timeline-campus ol { flex-direction: column; }
  .p36-segment { flex-basis: auto; }
}
