:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --surface-muted: #eef1f4;
  --text: #18212b;
  --text-soft: #56616d;
  --text-faint: #7b8793;
  --border: #dde2e7;
  --border-strong: #cbd2d9;
  --primary: #345a7e;
  --primary-strong: #274763;
  --primary-soft: #eaf1f7;
  --success: #237a55;
  --success-soft: #e9f6ef;
  --warning: #9a6513;
  --warning-soft: #fff5e3;
  --danger: #b33b35;
  --danger-soft: #fff0ef;
  --blue-soft: #edf3fa;
  --rose-soft: #f9eef1;
  --shadow-sm: 0 1px 2px rgba(22, 31, 39, 0.04), 0 5px 18px rgba(22, 31, 39, 0.04);
  --shadow-md: 0 18px 42px rgba(22, 31, 39, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}


* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(52, 90, 126, 0.24);
  outline-offset: 2px;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.app-shell,
.layout {
  min-height: 100vh;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--text-soft);
}

.boot-screen p {
  margin: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-strong);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Authentication */

.auth-page {
  display: grid;
  width: min(100%, 1440px);
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px);
  gap: 28px;
  margin: 0 auto;
  padding: 28px;
}

.auth-hero {
  display: flex;
  min-height: calc(100vh - 56px);
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #d8e1e8;
  border-radius: 18px;
  background: #eaf0f5;
  padding: clamp(28px, 5vw, 68px);
}

.auth-brand,
.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.auth-brand > span {
  font-weight: 750;
}

.auth-copy {
  max-width: 680px;
  padding-block: 7vh;
}

.auth-copy h1 {
  max-width: 650px;
  margin: 22px 0 18px;
  font-size: clamp(2.8rem, 6vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
}

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

.metric-tile {
  min-width: 0;
  border-top: 1px solid rgba(52, 90, 126, 0.22);
  padding-top: 14px;
}

.metric-tile strong,
.metric-tile span {
  display: block;
}

.metric-tile strong {
  font-size: 0.9rem;
}

.metric-tile span {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auth-panel {
  display: flex;
  align-items: center;
}

.auth-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.auth-tabs,
.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 4px;
}

.tab-button,
.segment-button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.tab-button.active,
.segment-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(22, 31, 39, 0.1);
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form h2 {
  margin: 0 0 5px;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.form-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #39434d;
  font-size: 0.81rem;
  font-weight: 700;
}

.field > span .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
}

.field input,
.field select,
.search-box input,
.filter-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 12px;
  color: var(--text);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:hover,
.field select:hover,
.search-box input:hover,
.filter-select:hover {
  border-color: #aeb8c1;
}

.field input:focus,
.field select:focus,
.search-box input:focus,
.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 90, 126, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

.password-field {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  right: 7px;
  bottom: 4px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--surface-muted);
  color: var(--primary);
  outline: 0;
}

.password-toggle .ui-icon {
  width: 17px;
  height: 17px;
}

.form-error,
.notice {
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.form-error {
  border: 1px solid #f0cbc8;
  background: var(--danger-soft);
  color: #8f302b;
}

.notice {
  border: 1px solid #c9e7d6;
  background: var(--success-soft);
  color: #216a4b;
}

.otp-form input[name="otp"] {
  letter-spacing: 0.22em;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 750;
}

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

.auth-step-actions .button {
  flex: 1 1 auto;
}

/* Buttons */

.button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 15px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
}

.button .ui-icon {
  width: 16px;
  height: 16px;
}

.button:not(:disabled):active,
.icon-button:not(:disabled):active {
  transform: translateY(1px);
}

.button.primary,
.button.blue {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover,
.button.blue:hover {
  background: var(--primary-strong);
}

.button.secondary,
.icon-button {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

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

.button.ghost {
  background: transparent;
  color: var(--text-soft);
}

.button.ghost:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.button.soft-primary {
  border-color: #cfdae4;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.button.soft-primary:hover {
  background: #dfeaf3;
}

.button.soft-danger {
  border-color: #efcfcc;
  background: var(--danger-soft);
  color: #9b332e;
}

.button.soft-danger:hover {
  background: #ffe5e3;
}

.compact-button {
  min-height: 38px;
  padding-inline: 12px;
}

/* Application shell */

.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #f8f9fa;
  padding: 18px 14px;
}

.top-brand {
  min-height: 46px;
  padding: 3px 6px;
}

.top-brand > span,
.top-brand strong,
.top-brand small {
  display: block;
  min-width: 0;
}

.top-brand strong {
  font-size: 0.94rem;
}

.top-brand small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 5px;
  margin-top: 30px;
}

.nav::before {
  margin: 0 10px 5px;
  color: var(--text-faint);
  content: "Workspace";
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 0 10px;
  color: var(--text-soft);
  font-size: 0.87rem;
  font-weight: 680;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
}

.nav-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.sidebar-footer {
  margin-top: auto;
}

.user-chip {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--border);
  padding: 14px 6px 0;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.user-chip .avatar {
  width: 34px;
  height: 34px;
}

.user-chip strong,
.user-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 0.78rem;
}

.user-chip span {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.sidebar-scrim {
  display: none;
}

.main {
  min-width: 0;
  padding: 18px 24px 38px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 12px;
  display: flex;
  width: min(100%, 1360px);
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  border: 1px solid rgba(221, 226, 231, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 7px 8px 7px 14px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.topbar-leading,
.topbar-actions,
.admin-label {
  display: flex;
  align-items: center;
}

.topbar-leading,
.topbar-actions {
  gap: 10px;
}

.topbar-context span,
.topbar-context strong {
  display: block;
}

.topbar-context span {
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 650;
}

.topbar-context strong {
  margin-top: 1px;
  font-size: 0.86rem;
}

.admin-label {
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-label .ui-icon {
  width: 15px;
  height: 15px;
}

.mobile-menu {
  display: none;
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.content {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding-top: 34px;
}

/* Shared page structure */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-title h1 {
  margin: 12px 0 8px;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.page-title p {
  max-width: 680px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.91rem;
  line-height: 1.6;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.student-detail-page-head {
  align-items: center;
}

.student-detail-page-head .page-title h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.eyebrow .ui-icon {
  width: 14px;
  height: 14px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.preview-label {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 0 9px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.panel,
.stat-card,
.empty-state,
.access-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0;
}

.panel h2 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header .form-subtitle {
  margin-top: 4px;
  font-size: 0.78rem;
}

.icon-heading,
.modal-title-with-icon,
.subsection-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.heading-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-soft);
}

.heading-icon .ui-icon {
  width: 15px;
  height: 15px;
}

.heading-icon.blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.heading-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.heading-icon.amber {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Home analytics placeholders */

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

.stat-card {
  position: relative;
  min-height: 138px;
  padding: 17px;
}

.stat-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-soft);
}

.stat-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.stat-icon.blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.stat-icon.amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.stat-icon.rose {
  background: var(--rose-soft);
  color: #94546a;
}

.stat-label,
.stat-note {
  display: block;
}

.stat-label {
  max-width: calc(100% - 42px);
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin-top: 15px;
  color: #a4adb6;
  font-size: 2rem;
  letter-spacing: 0.08em;
}

.stat-note {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 12px;
  margin-top: 12px;
}

.placeholder-chart {
  display: flex;
  height: 230px;
  align-items: end;
  gap: 9px;
  border-radius: 9px;
  background: var(--surface-subtle);
  padding: 20px 16px 16px;
}

.bar {
  flex: 1;
  min-width: 8px;
  border-radius: 4px 4px 1px 1px;
  background: #d9e1e8;
  opacity: 0.82;
}

.activity-list,
.detail-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.activity-list li:last-child,
.detail-row:last-child {
  border-bottom: 0;
}

.activity-list strong,
.detail-row strong {
  font-size: 0.8rem;
}

.activity-list span,
.detail-row > span {
  color: var(--text-faint);
  font-size: 0.77rem;
  text-align: right;
}

.detail-row-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.detail-row-label .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
}

/* Payments */

.compact-select-label {
  display: grid;
  min-width: 150px;
  gap: 5px;
}

.compact-select-label span {
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payment-stage {
  display: grid;
  gap: 16px;
}

.cash-ribbon {
  display: grid;
  min-height: 128px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.64fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid #ced7df;
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, #253645, #314b5d 53%, #f7f9fb 53.2%, #ffffff);
  box-shadow: var(--shadow-sm);
}

.cash-ribbon-main {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px 22px;
  color: #fff;
}

.cash-ribbon-main span,
.cash-ribbon-main small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
}

.cash-ribbon-main .ui-icon {
  width: 16px;
  height: 16px;
}

.cash-ribbon-main strong {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.cash-ribbon-metrics {
  display: grid;
  align-content: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.payment-mini-stat {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(221, 226, 231, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(22, 31, 39, 0.08);
}

.payment-mini-stat > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #eaf1f7;
  color: var(--primary);
}

.payment-mini-stat .ui-icon {
  width: 18px;
  height: 18px;
}

.payment-mini-stat small,
.payment-mini-stat strong {
  display: block;
}

.payment-mini-stat small {
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-mini-stat strong {
  margin-top: 3px;
  font-size: 1.25rem;
}

.renewal-agenda {
  display: grid;
  gap: 10px;
}

.renewal-agenda-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.renewal-agenda-date {
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--border);
  background: var(--surface-subtle);
  padding: 14px;
}

.renewal-agenda-date strong,
.renewal-agenda-date span,
.renewal-agenda-date small {
  display: block;
}

.renewal-agenda-date strong {
  color: var(--text);
  font-size: 1rem;
}

.renewal-agenda-date span {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.renewal-agenda-date small {
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 750;
}

.renewal-agenda-group.signal-overdue .renewal-agenda-date,
.renewal-agenda-group.signal-urgent .renewal-agenda-date {
  background: var(--danger-soft);
}

.renewal-agenda-group.signal-soon .renewal-agenda-date {
  background: #e2f2f5;
}

.renewal-agenda-group.signal-steady .renewal-agenda-date {
  background: var(--success-soft);
}

.renewal-agenda-rows {
  display: grid;
}

.renewal-agenda-row {
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.35fr) auto 30px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 120ms ease;
}

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

.renewal-agenda-row:hover,
.renewal-agenda-row:focus {
  background: #f8fafb;
  outline: 0;
}

.renewal-agenda-amount {
  font-size: 0.95rem;
  white-space: nowrap;
}

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

.payment-list-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.payment-panel-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  padding-bottom: 10px;
}

.payment-panel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
}

.payment-dues-search {
  position: relative;
  min-width: min(290px, 100%);
}

.payment-dues-search input {
  min-height: 36px;
  padding-right: 10px;
}

.payment-dues-search .search-icon {
  left: 11px;
}

.renewal-select-label {
  min-width: 138px;
}

.renewal-select-label .filter-select {
  min-height: 36px;
}

.payment-list-panel.due .heading-icon.amber {
  background: #f3f5f7;
  color: #c9821c;
}

.payment-table-wrap {
  box-shadow: none;
}

.payment-table-wrap table {
  min-width: 780px;
}

.payment-table th,
.payment-table td {
  padding-block: 11px;
}

.payment-table tbody tr {
  cursor: pointer;
}

.payment-table .person-cell {
  max-width: 340px;
}

.payment-row td:first-child {
  border-left: 4px solid #8a98a5;
}

.payment-row.signal-medium td:first-child,
.payment-row.signal-soon td:first-child {
  border-left-color: #3d7f8c;
}

.payment-row.signal-high td:first-child,
.payment-row.signal-overdue td:first-child,
.payment-row.signal-urgent td:first-child {
  border-left-color: #b0524b;
}

.payment-row.signal-steady td:first-child {
  border-left-color: #2f7a59;
}

.payment-row.signal-distant td:first-child {
  border-left-color: var(--primary);
}

.payment-plan-name,
.payment-muted {
  display: block;
}

.payment-plan-name {
  font-size: 0.82rem;
}

.payment-muted {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.72rem;
  font-weight: 650;
}

.payment-amount {
  font-size: 0.94rem;
  white-space: nowrap;
}

.payment-row-action {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-faint);
}

.payment-row:hover .payment-row-action,
.payment-row:focus .payment-row-action {
  border-color: var(--border-strong);
  color: var(--primary);
}

.payment-row-action .ui-icon {
  width: 15px;
  height: 15px;
}

.payment-status-chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 0 9px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.payment-status-chip .ui-icon {
  width: 14px;
  height: 14px;
}

.payment-status-chip.signal-medium,
.payment-status-chip.signal-soon {
  background: #e2f2f5;
  color: #357786;
}

.payment-status-chip.signal-high,
.payment-status-chip.signal-overdue,
.payment-status-chip.signal-urgent {
  background: var(--danger-soft);
  color: var(--danger);
}

.payment-status-chip.signal-steady {
  background: var(--success-soft);
  color: var(--success);
}

.payment-status-chip.signal-distant {
  background: var(--primary-soft);
  color: var(--primary);
}

.payment-mobile-list {
  gap: 9px;
}

.payment-mobile-card {
  position: relative;
  overflow: hidden;
}

.payment-mobile-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #8a98a5;
  content: "";
}

.payment-mobile-card.signal-medium::before,
.payment-mobile-card.signal-soon::before {
  background: #3d7f8c;
}

.payment-mobile-card.signal-high::before,
.payment-mobile-card.signal-overdue::before,
.payment-mobile-card.signal-urgent::before {
  background: #b0524b;
}

.payment-mobile-card.signal-steady::before {
  background: #2f7a59;
}

.payment-mobile-card.signal-distant::before {
  background: var(--primary);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e1e6eb;
  padding-top: 12px;
}

.pagination-bar > span {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.pagination-bar > div {
  display: flex;
  gap: 7px;
}

.payment-card-list {
  display: grid;
  min-height: 372px;
  align-content: start;
  gap: 12px;
}

.payment-card {
  position: relative;
  display: grid;
  min-height: 116px;
  grid-template-columns: 92px minmax(0, 1fr) minmax(132px, 0.28fr);
  align-items: center;
  gap: 14px;
  overflow: hidden;
  border: 1px solid #dbe2e8;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.payment-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #c9d2dc;
  content: "";
}

.payment-card:hover,
.payment-card:focus {
  border-color: #b8c3ce;
  box-shadow: 0 8px 24px rgba(22, 31, 39, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.payment-card.due {
  background: linear-gradient(90deg, #fbfcfd, #fff);
}

.payment-card.due::before {
  background: #4f6375;
}

.payment-card.due.signal-low::before {
  background: #6b7b86;
}

.payment-card.due.signal-medium::before {
  background: #3d7f8c;
}

.payment-card.due.signal-high::before {
  background: #b0524b;
}

.payment-card.renewal {
  background: linear-gradient(90deg, #f8fbfd, #fff);
}

.payment-card.renewal::before {
  background: #2f5d83;
}

.payment-card.renewal.signal-overdue::before,
.payment-card.renewal.signal-urgent::before {
  background: #b0524b;
}

.payment-card.renewal.signal-soon::before {
  background: #3d7f8c;
}

.payment-card.renewal.signal-steady::before {
  background: #2f7a59;
}

.payment-card.renewal.signal-distant::before {
  background: #2f5d83;
}

.payment-card-main {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 11px;
}

.payment-card .person-cell {
  grid-template-columns: 42px minmax(0, 1fr);
}

.payment-card .person-cell .avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: #eef4f9;
}

.payment-card .person-cell strong {
  font-size: 0.92rem;
}

.payment-card .person-cell span {
  max-width: 280px;
}

.payment-date-badge,
.payment-due-badge,
.payment-amount-block {
  display: grid;
  min-width: 0;
  place-items: center;
  border-radius: 10px;
  text-align: center;
}

.payment-date-badge {
  min-height: 92px;
  border: 1px solid #c7d9e8;
  background: linear-gradient(180deg, #eef6fc, #dfeaf3);
  color: var(--primary-strong);
  box-shadow: inset 0 -5px 0 rgba(52, 90, 126, 0.12);
}

.payment-date-badge span {
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-date-badge strong {
  font-size: 2.1rem;
  line-height: 1;
}

.payment-date-badge small {
  min-height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px 8px;
  color: var(--primary);
  font-size: 0.66rem;
  font-weight: 850;
}

.payment-date-badge.signal-overdue,
.payment-date-badge.signal-urgent {
  border-color: #e0bbb7;
  background: linear-gradient(180deg, #fff2f1, #f1dedc);
  color: #8f3f39;
  box-shadow: inset 0 -5px 0 rgba(176, 82, 75, 0.14);
}

.payment-date-badge.signal-overdue span,
.payment-date-badge.signal-overdue small,
.payment-date-badge.signal-urgent span,
.payment-date-badge.signal-urgent small {
  color: #9b453f;
}

.payment-date-badge.signal-soon {
  border-color: #abd2d9;
  background: linear-gradient(180deg, #eefbfc, #dceff2);
  color: #2d6571;
  box-shadow: inset 0 -5px 0 rgba(61, 127, 140, 0.13);
}

.payment-date-badge.signal-soon span,
.payment-date-badge.signal-soon small {
  color: #357786;
}

.payment-date-badge.signal-steady {
  border-color: #bddbc9;
  background: linear-gradient(180deg, #eef8f2, #dfeee6);
  color: #286346;
  box-shadow: inset 0 -5px 0 rgba(47, 122, 89, 0.13);
}

.payment-date-badge.signal-steady span,
.payment-date-badge.signal-steady small {
  color: #2f7a59;
}

.payment-due-badge {
  min-height: 92px;
  border: 1px solid #d8dee5;
  background: linear-gradient(180deg, #f8fafb, #eef2f5);
  color: #53616d;
  box-shadow: inset 0 -5px 0 rgba(87, 99, 111, 0.08);
}

.payment-due-badge > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  color: #53616d;
}

.payment-due-badge .ui-icon {
  width: 16px;
  height: 16px;
}

.payment-due-badge strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #dde4ea;
  color: #43515e;
  font-size: 1rem;
  line-height: 1.1;
}

.payment-due-badge strong .ui-icon {
  width: 18px;
  height: 18px;
}

.payment-due-badge small {
  color: #53616d;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.payment-due-badge.signal-medium {
  border-color: #abd2d9;
  background: linear-gradient(180deg, #eefbfc, #dceff2);
  color: #2d6571;
  box-shadow: inset 0 -5px 0 rgba(61, 127, 140, 0.13);
}

.payment-due-badge.signal-medium > span,
.payment-due-badge.signal-medium strong {
  color: #357786;
}

.payment-due-badge.signal-medium strong {
  background: #d1e8ed;
}

.payment-due-badge.signal-high {
  border-color: #dfbbb7;
  background: linear-gradient(180deg, #fff2f1, #f0dddb);
  color: #84423d;
  box-shadow: inset 0 -5px 0 rgba(176, 82, 75, 0.13);
}

.payment-due-badge.signal-high > span,
.payment-due-badge.signal-high strong {
  color: #93443e;
}

.payment-due-badge.signal-high strong {
  background: #ead4d1;
}

.payment-visual-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.payment-mini-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 800;
}

.payment-mini-pill .ui-icon {
  width: 14px;
  height: 14px;
}

.payment-mini-pill.plan {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.payment-mini-pill.active {
  background: #e9f4ee;
  color: #237a55;
}

.payment-mini-pill.due {
  background: #f3f5f7;
  color: var(--text-soft);
}

.payment-mini-pill.due.signal-medium,
.payment-mini-pill.active.signal-soon {
  background: #e2f2f5;
  color: #357786;
}

.payment-mini-pill.due.signal-high,
.payment-mini-pill.active.signal-overdue,
.payment-mini-pill.active.signal-urgent {
  background: #f7e5e3;
  color: #954640;
}

.payment-mini-pill.active.signal-steady {
  background: #e9f4ee;
  color: #237a55;
}

.payment-mini-pill.active.signal-distant {
  background: #eaf1f7;
  color: var(--primary);
}

.payment-amount-block {
  align-content: center;
  border: 1px solid #dce4ea;
  background: #f8fafb;
  padding: 10px;
}

.payment-card.due .payment-amount-block {
  border-color: #cfd8e0;
  background: #f7f9fb;
}

.payment-card.due .payment-amount-block.signal-medium {
  border-color: #abd2d9;
  background: #f2fbfc;
}

.payment-card.due .payment-amount-block.signal-high {
  border-color: #dfbbb7;
  background: #fff7f6;
}

.payment-card.renewal .payment-amount-block.signal-overdue,
.payment-card.renewal .payment-amount-block.signal-urgent {
  border-color: #dfbbb7;
  background: #fff7f6;
}

.payment-card.renewal .payment-amount-block.signal-soon {
  border-color: #abd2d9;
  background: #f2fbfc;
}

.payment-card.renewal .payment-amount-block.signal-steady {
  border-color: #bddbc9;
  background: #f6fcf8;
}

/* Inverted signal treatment: color the ticket, keep inner surfaces calm. */
.payment-card.due.signal-low {
  border-color: #d8e0e7;
  background: linear-gradient(90deg, #f3f6f8, #ffffff 72%);
}

.payment-card.due.signal-medium {
  border-color: #abd2d9;
  background: linear-gradient(90deg, #e3f5f8, #ffffff 72%);
}

.payment-card.due.signal-high {
  border-color: #e0b9b5;
  background: linear-gradient(90deg, #ffe7e4, #ffffff 72%);
}

.payment-card.renewal.signal-overdue,
.payment-card.renewal.signal-urgent {
  border-color: #e0b9b5;
  background: linear-gradient(90deg, #ffe7e4, #ffffff 72%);
}

.payment-card.renewal.signal-soon {
  border-color: #abd2d9;
  background: linear-gradient(90deg, #e3f5f8, #ffffff 72%);
}

.payment-card.renewal.signal-steady {
  border-color: #b9d9c6;
  background: linear-gradient(90deg, #e7f6ed, #ffffff 72%);
}

.payment-card.renewal.signal-distant {
  border-color: #bed4e7;
  background: linear-gradient(90deg, #e7f1fa, #ffffff 72%);
}

.payment-card .payment-date-badge,
.payment-card .payment-due-badge,
.payment-card .payment-amount-block {
  border-color: rgba(203, 213, 222, 0.9);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(22, 31, 39, 0.04);
}

.payment-card .payment-date-badge span,
.payment-card .payment-date-badge small,
.payment-card .payment-due-badge small {
  color: var(--text-soft);
}

.payment-card .payment-due-badge > span,
.payment-card .payment-due-badge strong {
  background: #eef2f5;
  color: #53616d;
}

.payment-card .payment-mini-pill.due,
.payment-card .payment-mini-pill.active,
.payment-card .payment-mini-pill.due.signal-medium,
.payment-card .payment-mini-pill.due.signal-high,
.payment-card .payment-mini-pill.active.signal-overdue,
.payment-card .payment-mini-pill.active.signal-urgent,
.payment-card .payment-mini-pill.active.signal-soon,
.payment-card .payment-mini-pill.active.signal-steady,
.payment-card .payment-mini-pill.active.signal-distant {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text-soft);
  box-shadow: inset 0 0 0 1px rgba(203, 213, 222, 0.68);
}

.payment-amount-block span,
.payment-amount-block small {
  color: var(--text-faint);
  font-weight: 800;
}

.payment-amount-block span {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.payment-amount-block strong {
  margin: 5px 0 2px;
  color: var(--text);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.payment-amount-block small {
  font-size: 0.68rem;
}

.payment-empty {
  display: grid;
  min-height: 220px;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px dashed #c7d0da;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fafc, #fff);
  padding: 24px;
}

.payment-empty > span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text-faint);
  box-shadow: var(--shadow-sm);
}

.payment-empty.renewal > span {
  color: var(--primary);
}

.payment-empty.due > span {
  color: var(--warning);
}

.payment-empty .ui-icon {
  width: 28px;
  height: 28px;
}

.payment-empty h2 {
  margin: 0;
  font-size: 1rem;
}

.payment-empty p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.billing-workspace {
  display: grid;
  gap: 14px;
  transition: opacity 140ms ease;
}

#billingDetailsResult.is-refreshing .billing-workspace {
  opacity: 0.62;
  pointer-events: none;
}

.billing-command-strip {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #d7e0e7;
  border-radius: 16px;
  background:
    linear-gradient(120deg, #ffffff, #f7fbfb 62%, #eef6f4);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.billing-student-card {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.billing-count-badge {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 12px;
  background: #18212b;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 850;
}

.billing-count-badge .ui-icon {
  width: 14px;
  height: 14px;
  opacity: 0.76;
}

.billing-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.billing-status-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 4px;
  border: 1px solid #d5dee6;
  border-radius: 12px;
  background: #eef3f5;
  padding: 4px;
}

.billing-status-option {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 0 10px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.billing-status-option .ui-icon {
  width: 14px;
  height: 14px;
}

.billing-status-option.active {
  background: #fff;
  color: #18212b;
  box-shadow: 0 1px 2px rgba(22, 31, 39, 0.08);
}

.billing-status-option.pending.active {
  background: var(--warning-soft);
  color: var(--warning);
}

.billing-status-option.paid.active {
  background: var(--success-soft);
  color: var(--success);
}

.billing-status-option.overdue.active {
  background: var(--danger-soft);
  color: var(--danger);
}

.billing-status-option.all.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.billing-page-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.billing-page-meter .pagination-bar {
  border-top: 0;
  padding-top: 0;
}

.billing-page-meter .pagination-bar > span {
  display: none;
}

.billing-board {
  min-width: 0;
}

.billing-ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
}

.billing-ticket {
  position: relative;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e1e7;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.billing-ticket::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--warning);
  content: "";
}

.billing-ticket.pending {
  border-color: #dfc07b;
  background: linear-gradient(90deg, #fff9ec, #fff 46%);
}

.billing-ticket.paid::before {
  background: var(--success);
}

.billing-ticket.paid {
  border-color: #b9d9c6;
  background: linear-gradient(90deg, #f1faf4, #fff 46%);
}

.billing-ticket.overdue::before {
  background: var(--danger);
}

.billing-ticket.overdue {
  border-color: #e0b9b5;
  background: linear-gradient(90deg, #fff3f1, #fff 46%);
}

.billing-ticket-date {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 7px;
  background: var(--warning-soft);
  padding: 18px 14px 18px 18px;
  text-align: left;
}

.billing-ticket.paid .billing-ticket-date {
  background: var(--success-soft);
}

.billing-ticket.overdue .billing-ticket-date {
  background: var(--danger-soft);
}

.billing-ticket.pending .billing-ticket-date span,
.billing-ticket.pending .billing-ticket-date small {
  color: var(--warning);
}

.billing-ticket.paid .billing-ticket-date span,
.billing-ticket.paid .billing-ticket-date small {
  color: var(--success);
}

.billing-ticket.overdue .billing-ticket-date span,
.billing-ticket.overdue .billing-ticket-date small {
  color: var(--danger);
}

.billing-ticket-date span {
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-ticket-date strong {
  color: #18212b;
  font-size: 0.95rem;
  line-height: 1.2;
}

.billing-ticket-date i {
  width: 2px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: currentColor;
  color: rgba(86, 97, 109, 0.24);
}

.billing-ticket-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.billing-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-plan-token {
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-interval {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.billing-interval-range {
  display: inline-flex;
  min-height: 34px;
  min-width: min(100%, 300px);
  align-items: center;
  gap: 7px;
  border: 1px solid #d9e2e8;
  border-radius: 999px;
  background: #f8fafb;
  padding: 0 10px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.billing-interval-range .ui-icon {
  width: 14px;
  height: 14px;
}

.billing-interval-range i {
  color: var(--text-faint);
  font-style: normal;
}

.billing-due-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--warning-soft);
  padding: 0 10px;
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.billing-due-chip .ui-icon {
  width: 13px;
  height: 13px;
}

.billing-ticket.paid .billing-due-chip {
  background: var(--success-soft);
  color: var(--success);
}

.billing-ticket.overdue .billing-due-chip {
  background: var(--danger-soft);
  color: var(--danger);
}

.billing-ticket-money {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.billing-ticket-money strong {
  font-size: 2rem;
  line-height: 1;
}

.billing-ticket-money span {
  color: var(--text-faint);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef2;
}

.billing-progress span {
  display: block;
  width: var(--paid);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c5861f, #e0a53c);
}

.billing-ticket.paid .billing-progress span {
  background: linear-gradient(90deg, #2f7a59, #5a9d77);
}

.billing-ticket.overdue .billing-progress span {
  background: linear-gradient(90deg, #b33b35, #d16a63);
}

.billing-ticket-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.billing-ticket-numbers span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: #f4f7f8;
  padding: 0 8px;
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 800;
}

.billing-ticket-numbers .ui-icon {
  width: 13px;
  height: 13px;
}

.billing-ticket-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.billing-ticket-actions .button {
  min-height: 34px;
}

.billing-payment-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid #e2e8ed;
  padding-top: 10px;
}

.billing-payments-label {
  flex: 0 0 100%;
  color: var(--text-faint);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.billing-payment-dot {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #eef3f5;
  padding: 0 9px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 850;
}

.billing-payment-dot .ui-icon {
  width: 14px;
  height: 14px;
}

.billing-payment-dot.paid {
  background: var(--success-soft);
  color: var(--success);
}

.billing-payment-dot.pending,
.billing-payment-dot.muted {
  background: var(--warning-soft);
  color: var(--warning);
}

.billing-payment-dot.overdue,
.billing-payment-dot.failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.billing-ticket-index {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(86, 97, 109, 0.18);
  font-size: 1.4rem;
  font-weight: 850;
  line-height: 1;
}

.billing-quiet-state {
  display: grid;
  min-height: 240px;
  place-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px dashed #cbd8df;
  border-radius: 18px;
  background: #f8fbfb;
  text-align: center;
}

.billing-quiet-state > span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: #e9f4f5;
  color: #357786;
}

.billing-quiet-state .ui-icon {
  width: 26px;
  height: 26px;
}

.billing-quiet-state h2 {
  margin: 0;
  font-size: 1rem;
}

.status-pill.due,
.status-pill.upcoming {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Student directory */

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 140px 155px 155px auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 38px;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  display: grid;
  color: var(--text-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-icon .ui-icon {
  width: 15px;
  height: 15px;
}

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

.table-wrap table {
  min-width: 920px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 13px 15px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-subtle);
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

th .ui-icon {
  width: 13px;
  height: 13px;
  margin-right: 5px;
  vertical-align: -2px;
}

td {
  font-size: 0.84rem;
}

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

tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}

tbody tr:hover,
tbody tr:focus {
  background: #f8fafb;
  outline: 0;
}

.person-cell {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.person-cell .avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.person-cell strong,
.person-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-cell strong {
  font-size: 0.82rem;
}

.person-cell span {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.mobile-card-footer > span,
.mobile-card-footer > strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobile-card-footer .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}

.status-pill,
.category-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill {
  min-height: 25px;
  gap: 6px;
  background: var(--surface-muted);
  padding: 0 9px;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.status-pill::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.paid,
.status-pill.active,
.status-pill.available,
.status-pill.inside {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.unpaid,
.status-pill.pending,
.status-pill.inactive,
.status-pill.occupied {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.overdue,
.status-pill.failed,
.status-pill.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.outside,
.status-pill.unknown,
.status-pill.checking {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.presence-seat-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
}

.presence-seat-state.assigned {
  min-width: 42px;
  padding-right: 10px;
}

.chair-badge {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--success);
}

.chair-badge .ui-icon {
  width: 25px;
  height: 25px;
  color: var(--success);
}

.chair-number {
  position: absolute;
  top: -6px;
  right: -10px;
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--success);
  padding: 0 4px;
  color: #fff;
  font-size: 0.61rem;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(22, 31, 39, 0.16);
}

.presence-seat-empty {
  display: inline-block;
  min-width: 28px;
  color: var(--text-faint);
  font-size: 0.9rem;
  text-align: center;
}

.category-chip {
  min-height: 22px;
  padding: 0 7px;
  font-size: 0.66rem;
}

.category-chip.male {
  background: var(--blue-soft);
  color: #3d6287;
}

.category-chip.female {
  background: var(--rose-soft);
  color: #94546a;
}

.category-chip.other {
  background: var(--success-soft);
  color: #397559;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 1rem;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.loader {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(52, 90, 126, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.mobile-cards {
  display: none;
}

.mobile-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.mobile-card:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(52, 90, 126, 0.14);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mobile-card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--border);
  padding-top: 11px;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.open-record {
  justify-content: flex-end;
}

/* Seat directory */

.seat-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
}

.seat-map-legend > div,
.seat-map-legend span {
  display: inline-flex;
  align-items: center;
}

.seat-map-legend > div {
  flex-wrap: wrap;
  gap: 10px;
}

.seat-map-legend strong {
  margin-right: 2px;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.seat-map-legend span {
  gap: 5px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.category-swatch {
  width: 13px;
  height: 13px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.category-swatch.male {
  border-color: #8fb2d8;
  background: #e7f0fb;
}

.category-swatch.female {
  border-color: #d89aaf;
  background: #fae9ef;
}

.category-swatch.other {
  border-color: #91c2a8;
  background: #e8f4ee;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.available {
  background: #319267;
}

.status-dot.occupied {
  background: #d28a1d;
}

.status-dot.reserved {
  background: #6b7fd7;
}

.status-dot.unavailable {
  background: #8b949e;
}

.seat-map-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.seat-map-note.selecting {
  border-color: rgba(52, 90, 126, 0.28);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}

.seat-map-note > div:first-child {
  display: grid;
  gap: 3px;
}

.seat-map-note strong {
  font-size: 0.86rem;
}

.seat-map-note span {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.seat-map-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8f9fa;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.seat-floor {
  display: flex;
  width: 1168px;
  min-width: 1168px;
  align-items: flex-start;
  margin: 0 auto;
}

.seat-floor.selecting .seat-square {
  cursor: crosshair;
}

.seat-vertical-bank {
  display: grid;
  grid-template-columns: 58px 420px 58px;
  align-items: start;
  gap: 14px;
}

.seat-run-label {
  display: block;
  height: 15px;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-align: center;
}

.seat-layout-column,
.seat-occupant-column {
  display: grid;
  grid-template-rows: repeat(19, 58px);
  row-gap: 14px;
}

.seat-layout-column {
  min-width: 58px;
}

.seat-grid-cell {
  min-width: 0;
}

.seat-tile {
  position: relative;
  width: 58px;
  height: 58px;
}

.seat-tile.selected .seat-square {
  outline: 3px solid rgba(52, 90, 126, 0.22);
  outline-offset: 3px;
}

.seat-tile.selected::after {
  position: absolute;
  z-index: 3;
  right: -8px;
  bottom: -8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  content: "✓";
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 4px 10px rgba(22, 31, 39, 0.18);
}

.seat-square {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--border-strong);
  border-bottom-width: 5px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  box-shadow: 0 2px 5px rgba(22, 31, 39, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.seat-square:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(22, 31, 39, 0.1);
}

.seat-square:focus-visible {
  outline: 3px solid rgba(52, 90, 126, 0.22);
  outline-offset: 3px;
}

.seat-square > span {
  font-size: 0.95rem;
  font-weight: 800;
}

.seat-square > i {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

.seat-square.category-male {
  border-color: #8fb2d8;
  background: #e7f0fb;
  color: #285b91;
}

.seat-square.category-female {
  border-color: #d89aaf;
  background: #fae9ef;
  color: #984461;
}

.seat-square.category-other,
.seat-square.category-unknown {
  border-color: #91c2a8;
  background: #e8f4ee;
  color: #34725a;
}

.seat-square.status-available {
  border-bottom-color: #319267;
}

.seat-square.status-available > i {
  background: #319267;
}

.seat-square.status-occupied {
  border-bottom-color: #d28a1d;
  box-shadow: 0 2px 5px rgba(22, 31, 39, 0.06), 0 0 0 2px rgba(210, 138, 29, 0.12);
}

.seat-square.status-occupied > i {
  background: #d28a1d;
}

.seat-square.status-reserved {
  border-bottom-color: #6b7fd7;
}

.seat-square.status-reserved > i {
  background: #6b7fd7;
}

.seat-square.status-unavailable,
.seat-square.status-inactive,
.seat-square.status-unknown {
  border-color: #aeb6be;
  border-bottom-color: #8b949e;
  background: #eceff2;
  color: #737d87;
  filter: saturate(0.25);
  opacity: 0.72;
}

.seat-square.status-unavailable > i,
.seat-square.status-inactive > i,
.seat-square.status-unknown > i {
  background: #8b949e;
}

.seat-vertical-aisle {
  display: grid;
  grid-template-columns: 190px 18px 190px;
  gap: 7px;
  min-width: 420px;
  margin-top: 21px;
  border-inline: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.58);
  padding-inline: 3px;
}

.seat-occupant-column {
  min-width: 190px;
  align-items: center;
}

.seat-vertical-aisle > .seat-occupant-column:last-child .seat-occupant-detail {
  margin-left: auto;
}

.aisle-divider {
  position: relative;
  width: 18px;
  height: 100%;
  color: var(--text-faint);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.aisle-divider::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border);
  content: "";
}

.aisle-divider span {
  position: sticky;
  top: 110px;
  z-index: 1;
  display: inline-block;
  background: #f8f9fa;
  padding: 7px 0;
  writing-mode: vertical-rl;
}

.seat-occupant-detail {
  display: grid;
  width: 100%;
  height: 58px;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  border: 1px solid #d8dee4;
  border-radius: 7px;
  background: var(--surface);
  padding: 7px 9px;
  color: var(--text);
  text-align: left;
  box-shadow: 0 2px 5px rgba(22, 31, 39, 0.07);
}

.seat-occupant-detail:hover {
  border-color: #aebdca;
  background: var(--primary-soft);
}

.seat-occupant-detail strong,
.seat-occupant-detail span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-occupant-detail strong {
  font-size: 0.72rem;
}

.seat-occupant-detail span {
  color: var(--text-faint);
  font-size: 0.61rem;
}

.seat-occupant-name {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.seat-occupant-name strong {
  min-width: 0;
}

.seat-payment-flag {
  display: inline-grid;
  flex: 0 0 17px;
  width: 17px;
  height: 16px;
  place-items: center;
  border-radius: 2px 2px 2px 0;
  background: #87919b;
  color: #fff;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}

.seat-payment-flag::before {
  content: "₹";
}

.seat-payment-flag.paid {
  background: #4f8b6a;
}

.seat-payment-flag.pending {
  background: #b76868;
}

.seat-payment-flag.failed {
  background: #8f3e4a;
}

.seat-payment-flag.failed::before {
  content: "×";
  font-size: 0.72rem;
}

.seat-payment-flag.unknown::before {
  content: "?";
}

.seat-bank-gap {
  width: 40px;
  flex: 0 0 40px;
}

.other-seats {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.other-seats > h2 {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.other-seat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.other-seat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seat-selection-tray {
  position: fixed;
  z-index: 70;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  width: min(680px, calc(100vw - 36px));
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(52, 90, 126, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  margin-inline: auto;
  padding: 12px 14px;
  box-shadow: 0 18px 45px rgba(22, 31, 39, 0.18);
  backdrop-filter: blur(14px);
}

.seat-selection-tray > div:first-child {
  display: grid;
  gap: 3px;
}

.seat-selection-tray strong {
  font-size: 0.9rem;
}

.seat-selection-tray span {
  color: var(--text-soft);
  font-size: 0.75rem;
}

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

.seat-details-modal {
  width: min(100%, 760px);
}

.seat-record-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.seat-record-hero {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 16px;
}

.seat-record-number {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 2px solid var(--border-strong);
  border-bottom-width: 7px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(22, 31, 39, 0.1);
}

.seat-record-number > span {
  font-size: 1.8rem;
  font-weight: 850;
}

.seat-record-number > i {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}

.seat-record-number.category-male {
  border-color: #8fb2d8;
  background: #e7f0fb;
  color: #285b91;
}

.seat-record-number.category-female {
  border-color: #d89aaf;
  background: #fae9ef;
  color: #984461;
}

.seat-record-number.category-other,
.seat-record-number.category-unknown {
  border-color: #91c2a8;
  background: #e8f4ee;
  color: #34725a;
}

.seat-record-number.status-available {
  border-bottom-color: #319267;
}

.seat-record-number.status-available > i {
  background: #319267;
}

.seat-record-number.status-reserved {
  border-bottom-color: #6b7fd7;
}

.seat-record-number.status-reserved > i {
  background: #6b7fd7;
}

.seat-record-number.status-occupied {
  border-bottom-color: #d28a1d;
}

.seat-record-number.status-occupied > i {
  background: #d28a1d;
}

.seat-record-number.status-unavailable,
.seat-record-number.status-inactive,
.seat-record-number.status-unknown {
  border-color: #aeb6be;
  border-bottom-color: #8b949e;
  background: #eceff2;
  color: #737d87;
}

.seat-record-number.status-unavailable > i,
.seat-record-number.status-inactive > i,
.seat-record-number.status-unknown > i {
  background: #8b949e;
}

.seat-record-hero h2 {
  margin: 6px 0 10px;
  font-size: 1.45rem;
}

.seat-current-user {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-subtle);
  margin-top: 8px;
  padding: 12px;
}

.seat-current-user.active {
  border-color: rgba(31, 132, 91, 0.2);
  background: linear-gradient(135deg, var(--success-soft), var(--surface));
}

.seat-current-user.quiet {
  justify-content: center;
  flex-direction: column;
  min-height: 112px;
  color: var(--text-soft);
  text-align: center;
}

.seat-current-user > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.seat-current-user > div span {
  color: var(--text-soft);
  font-size: 0.74rem;
}

.seat-current-user .button {
  flex: 0 0 auto;
}

.seat-current-avatar,
.seat-empty-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 850;
  box-shadow: 0 1px 3px rgba(22, 31, 39, 0.08);
}

.seat-empty-symbol {
  background: var(--surface-muted);
  color: var(--text-faint);
}

.seat-empty-symbol .ui-icon {
  width: 19px;
  height: 19px;
}

.seat-user-assigner {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--surface-subtle), var(--surface));
  margin-top: 8px;
  padding: 12px;
}

.seat-user-search-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.seat-user-search-head > div {
  display: grid;
  gap: 3px;
}

.seat-user-search-head span:not(.seat-empty-symbol) {
  color: var(--text-soft);
  font-size: 0.74rem;
}

.seat-user-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  padding: 0 11px;
}

.seat-user-search .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}

.seat-user-search input {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.seat-user-results {
  display: grid;
  max-height: 260px;
  gap: 7px;
  overflow-y: auto;
}

.seat-user-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  color: var(--text-faint);
  font-size: 0.76rem;
  font-weight: 700;
}

.seat-user-empty .ui-icon {
  width: 16px;
  height: 16px;
}

.seat-user-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  padding: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.seat-user-result:hover:not(:disabled),
.seat-user-result.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(52, 90, 126, 0.08);
}

.seat-user-result:disabled {
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.62;
}

.seat-user-result .seat-person-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.seat-user-result > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.seat-user-result strong,
.seat-user-result small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-user-result small {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.seat-user-signal {
  display: inline-flex;
  min-width: 32px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-faint);
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 850;
}

.seat-user-signal.present {
  background: var(--success-soft);
}

.seat-user-signal.present i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(31, 132, 91, 0.12);
}

.seat-user-signal.seated {
  background: var(--warning-soft);
  color: var(--warning);
}

.seat-user-signal .ui-icon {
  width: 13px;
  height: 13px;
}

.seat-state-visual {
  display: inline-grid;
  width: 38px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
}

.seat-state-visual i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 5px rgba(119, 130, 141, 0.1);
}

.seat-state-visual.available {
  background: var(--success-soft);
}

.seat-state-visual.available i {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(31, 132, 91, 0.12);
}

.seat-state-visual.reserved {
  background: #eef1ff;
}

.seat-state-visual.reserved i {
  background: #6b7fd7;
  box-shadow: 0 0 0 5px rgba(107, 127, 215, 0.12);
}

.seat-state-visual.occupied {
  background: var(--warning-soft);
}

.seat-state-visual.occupied i {
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(185, 114, 24, 0.12);
}

.seat-state-visual.unavailable,
.seat-state-visual.unknown {
  background: var(--surface-muted);
}

.visual-seat-form {
  border: 0;
  background: transparent;
  padding: 0;
}

.seat-tune-console {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 14%, rgba(52, 90, 126, 0.08), transparent 30%),
    linear-gradient(135deg, #f9fafb, var(--surface));
  padding: 14px;
}

.seat-tune-main {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.seat-number-dial {
  display: grid;
  grid-template-rows: 38px minmax(86px, 1fr) 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.seat-number-dial .icon-button {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 850;
}

.seat-number-dial input {
  width: 100%;
  min-height: 86px;
  border: 0;
  border-radius: 18px;
  background: #e7f0fb;
  color: #285b91;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 -5px 0 #8fb2d8;
}

.seat-number-dial input:focus {
  outline: 3px solid rgba(52, 90, 126, 0.18);
  outline-offset: 2px;
}

.seat-tune-stack {
  display: grid;
  gap: 10px;
}

.seat-tune-strip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.tune-strip-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--text-faint);
}

.tune-strip-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.seat-tune-console .choice-card-grid {
  gap: 7px;
}

.seat-tune-console .choice-card {
  min-height: 72px;
  border-radius: 13px;
  padding: 9px 7px;
}

.seat-tune-console .choice-card small {
  display: none;
}

.seat-tune-console .choice-card strong {
  font-size: 0.78rem;
}

.seat-tune-console .choice-marker {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  font-size: 0.72rem;
}

.seat-tune-console .status-choice-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.seat-tune-console .choice-card:has(input:checked) {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(52, 90, 126, 0.1), 0 8px 18px rgba(22, 31, 39, 0.08);
}

.seat-tune-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}

.seat-number-wheel {
  display: grid;
  gap: 8px;
}

.seat-number-wheel > span,
.visual-choice-group > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #39434d;
  font-size: 0.81rem;
  font-weight: 750;
}

.seat-number-wheel > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.seat-number-wheel input {
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 850;
  text-align: center;
}

.visual-choice-group {
  display: grid;
  gap: 9px;
}

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

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

.choice-card {
  position: relative;
  display: grid;
  min-height: 96px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px rgba(22, 31, 39, 0.08);
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(52, 90, 126, 0.1);
}

.choice-card:has(input:focus-visible) {
  outline: 3px solid rgba(52, 90, 126, 0.2);
  outline-offset: 2px;
}

.choice-marker {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 850;
}

.choice-card.male .choice-marker {
  background: #e7f0fb;
  color: #285b91;
}

.choice-card.female .choice-marker {
  background: #fae9ef;
  color: #984461;
}

.choice-card.other .choice-marker {
  background: #e8f4ee;
  color: #34725a;
}

.choice-card.keep .choice-marker {
  background: #eef1f4;
  color: var(--text-faint);
}

.choice-card .status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.choice-card small {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.seat-page-history {
  display: grid;
  gap: 9px;
}

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

.empty-state.compact {
  min-height: 150px;
}

.seat-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.seat-detail-summary > div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 12px;
}

.seat-detail-summary span,
.seat-history-card span {
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
}

.seat-edit-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.seat-edit-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}

.inline-actions {
  margin-top: 0;
}

.selected-seat-list {
  display: flex;
  max-height: 110px;
  flex-wrap: wrap;
  gap: 7px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  margin-bottom: 14px;
  padding: 10px;
}

.selected-seat-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 8px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.seat-assignment-history {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.seat-assignment-history h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.9rem;
}

.seat-assignment-history h3 .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}

.seat-history-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.65fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(22, 31, 39, 0.04);
}

.seat-history-card.active {
  border-color: rgba(31, 132, 91, 0.2);
  background: linear-gradient(135deg, var(--success-soft), var(--surface));
}

.seat-history-person {
  display: grid;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.seat-person-avatar {
  display: grid !important;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(52, 90, 126, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, #e7f0fb, #f8fafc);
  color: #285b91 !important;
  font-size: 0.82rem !important;
  font-weight: 850 !important;
  box-shadow: inset 0 -3px 0 rgba(143, 178, 216, 0.42), 0 1px 3px rgba(22, 31, 39, 0.06);
}

.seat-history-person > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.seat-history-person strong,
.seat-person-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-person-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
}

.seat-person-link:hover {
  text-decoration: underline;
}

.seat-person-link .ui-icon {
  width: 13px;
  height: 13px;
}

.seat-history-card .seat-history-flow {
  width: 100%;
}

.seat-history-card .seat-history-assignee {
  justify-self: end;
}

.seat-history-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

/* Student record */

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

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

.identity-primary {
  display: grid;
  min-width: 250px;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.identity-primary .avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  font-size: 1rem;
}

.identity-kicker {
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.identity-primary h2 {
  margin: 3px 0 4px;
  font-size: 1.08rem;
}

.profile-email {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.profile-email .ui-icon {
  width: 14px;
  height: 14px;
}

.profile-email span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-facts {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 0;
  margin: 0;
}

.identity-facts > div {
  min-width: 0;
  border-left: 1px solid var(--border);
  padding: 3px 18px;
}

.identity-facts dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
}

.identity-facts dt .ui-icon {
  width: 13px;
  height: 13px;
}

.identity-facts dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 0.79rem;
  font-weight: 650;
}

.student-status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: stretch;
  gap: 12px;
}

.student-status-grid > .panel {
  height: 100%;
}

.current-visit-panel {
  border-color: #cfe2d7;
}

.presence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--border);
  background: var(--surface-subtle);
}

.presence-grid > div {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 6px;
  padding: 13px 14px;
}

.presence-grid > div + div {
  border-left: 1px solid var(--border);
}

.presence-grid > div > span,
.visit-meta > div > span,
.confirmation-context span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 700;
}

.presence-grid > div > span .ui-icon,
.visit-meta > div > span .ui-icon,
.confirmation-context span .ui-icon {
  width: 13px;
  height: 13px;
}

.presence-grid strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.presence-value.with-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.presence-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
}

.attach-plan-panel,
.action-panel {
  display: grid;
  align-content: start;
}

.attach-plan-center,
.empty-action {
  display: grid;
  min-height: 138px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border-radius: 9px;
  background: var(--surface-subtle);
  padding: 18px;
  text-align: center;
}

.attach-plan-center p,
.empty-action p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.attach-plan-symbol,
.action-symbol,
.empty-state-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text-soft);
}

.attach-plan-symbol {
  background: var(--primary-soft);
  color: var(--primary);
}

.attendance-symbol,
.empty-state-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.empty-state-icon.amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.attach-plan-symbol .ui-icon,
.action-symbol .ui-icon,
.empty-state-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.records-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.records-panel {
  padding-bottom: 8px;
}

.record-count {
  display: grid;
  min-width: 26px;
  min-height: 26px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

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

.billing-table {
  min-width: 730px;
}

.billing-table th,
.billing-table td {
  padding-block: 11px;
}

.billing-table th:first-child,
.billing-table td:first-child {
  padding-left: 0;
}

.billing-table th:last-child,
.billing-table td:last-child {
  padding-right: 0;
}

.billing-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.billing-table tbody tr.billing-cycle-row:hover {
  background: var(--surface-subtle);
}

.billing-table tbody tr.billing-cycle-row:focus-visible,
.billing-mobile-row[data-open-billing-details]:focus-visible {
  outline: 3px solid rgba(52, 90, 126, 0.18);
  outline-offset: -3px;
}

.billing-table td strong,
.cell-note {
  display: block;
}

.cell-note {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.billing-mobile-list {
  display: none;
}

.billing-mobile-row {
  border-top: 1px solid var(--border);
  padding: 13px 0;
}

.billing-mobile-row[data-open-billing-details] {
  cursor: pointer;
}

.billing-mobile-row[data-open-billing-details]:hover {
  background: var(--surface-subtle);
}

.billing-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.billing-mobile-row dl {
  display: grid;
  gap: 7px;
  margin: 11px 0 0;
}

.billing-mobile-row dl div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 9px;
}

.billing-mobile-row dt {
  color: var(--text-faint);
  font-size: 0.69rem;
  font-weight: 700;
}

.billing-mobile-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.records-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  border-radius: 9px;
  background: var(--surface-subtle);
  padding: 22px 12px;
  text-align: center;
}

.records-empty strong {
  font-size: 0.84rem;
}

.records-empty p,
.inline-empty {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.visit-record {
  border-top: 1px solid var(--border);
}

.visit-record summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 0.38fr) 52px 20px;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  cursor: pointer;
  list-style: none;
}

.visit-record summary::-webkit-details-marker {
  display: none;
}

.visit-record summary:hover,
.visit-record[open] summary {
  background: var(--surface-subtle);
  box-shadow: 10px 0 var(--surface-subtle), -10px 0 var(--surface-subtle);
}

.visit-date {
  display: grid;
  gap: 3px;
}

.visit-date strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.visit-date strong .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}

.visit-date small,
.visit-duration {
  color: var(--text-faint);
  font-size: 0.69rem;
}

.visit-state {
  display: grid;
  width: 40px;
  height: 28px;
  place-items: center;
  justify-self: end;
  border-radius: 999px;
}

.visit-state.live {
  position: relative;
  background: var(--success-soft);
}

.visit-state.live i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(31, 132, 91, 0.12);
}

.visit-state.live span {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(31, 132, 91, 0.24);
  border-radius: inherit;
}

.visit-state.done {
  background: var(--surface-muted);
  color: var(--text-faint);
}

.visit-state.done .ui-icon {
  width: 15px;
  height: 15px;
}

.visit-chevron {
  color: var(--text-faint);
  transition: transform 140ms ease;
}

.visit-chevron .ui-icon {
  width: 16px;
  height: 16px;
}

.visit-record[open] .visit-chevron {
  transform: rotate(180deg);
}

.visit-body {
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  padding: 15px;
}

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

.visit-meta > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 5px;
}

.visit-meta strong {
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.visit-journey {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) minmax(160px, 1fr) minmax(170px, 0.42fr);
  align-items: center;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.journey-point {
  display: grid;
  min-width: 0;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.journey-point i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-faint);
}

.journey-point i .ui-icon {
  width: 15px;
  height: 15px;
}

.journey-point span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 760;
}

.visit-journey.live .journey-point.entry i {
  background: var(--success-soft);
  color: var(--success);
}

.visit-journey.done .journey-point.exit i {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.visit-journey.live .journey-point.exit i {
  background: #fff7e6;
  color: var(--warning);
}

.journey-line {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.journey-line span {
  display: block;
  width: var(--journey-progress, 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), #7ba0c2);
}

.visit-journey.live .journey-line span {
  background: linear-gradient(90deg, var(--success), #d99a2b);
}

.seat-history {
  margin-top: 15px;
}

.seat-history h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
}

.seat-history h3 span {
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 4px 8px;
  color: var(--text-faint);
  font-size: 0.66rem;
  font-weight: 750;
}

.subsection-heading .ui-icon,
.visual-empty .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}

.visual-empty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seat-history-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.38fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(22, 31, 39, 0.04);
}

.seat-history-seat {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px !important;
}

.seat-history-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 7px 9px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.seat-history-badge .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}

.seat-history-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.seat-history-flow span,
.seat-history-flow strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.seat-history-flow strong {
  color: var(--text);
}

.seat-history-flow i {
  position: relative;
  display: block;
  height: 1px;
  background: var(--border-strong);
}

.seat-history-flow i::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.seat-history-assignee {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 5px;
  border-radius: 999px;
  background: #f3f6f8;
  padding: 6px 9px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.seat-history-assignee .ui-icon {
  width: 13px;
  height: 13px;
  color: var(--text-faint);
}

/* Dialogs */

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 28, 35, 0.48);
  padding: 18px;
  backdrop-filter: blur(3px);
}

.modal-panel {
  width: min(100%, 550px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.modal-panel.seat-modal {
  width: min(100%, 660px);
}

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

.modal-head h2 {
  margin: 8px 0 0;
  font-size: 1.18rem;
}

.modal-head p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.modal-title-with-icon .ui-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.modal-head .icon-button {
  width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0;
}

.modal-head .icon-button .ui-icon {
  width: 17px;
  height: 17px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 14px;
}

.attach-plan-form,
.seat-assignment-form,
.billing-payment-form {
  display: grid;
  gap: 14px;
}

.confirmation-modal {
  width: min(100%, 470px);
}

.confirmation-context {
  display: grid;
  gap: 4px;
  border-radius: 9px;
  background: var(--surface-subtle);
  padding: 13px;
}

.confirmation-context small {
  color: var(--text-faint);
  font-size: 0.7rem;
}

.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin: -5px 0 15px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 650;
}

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

.category-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.category-dot.male {
  background: #5f83a7;
}

.category-dot.female {
  background: #a96b80;
}

.category-dot.other {
  background: #4f8a68;
}

.seat-grid {
  display: grid;
  max-height: 300px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
}

.seat-option {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  padding: 11px;
  cursor: pointer;
}

.seat-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.seat-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(52, 90, 126, 0.1);
}

.seat-option:has(input:focus-visible) {
  outline: 3px solid rgba(52, 90, 126, 0.2);
  outline-offset: 2px;
}

.seat-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seat-option-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-soft);
}

.seat-option-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.seat-option-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.seat-option-copy strong {
  font-size: 0.78rem;
}

.seat-option small {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.seat-picker-state {
  display: grid;
  min-height: 140px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border-radius: 9px;
  background: var(--surface-subtle);
  padding: 18px;
  text-align: center;
}

.seat-picker-state p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

/* Non-admin access */

.access-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.access-card {
  width: min(100%, 520px);
  padding: 28px;
  text-align: center;
}

.access-card .brand-mark {
  margin: 0 auto 18px;
}

.access-card h1 {
  margin: 14px 0 8px;
  font-size: 1.7rem;
}

.access-card p {
  margin: 0 0 20px;
  color: var(--text-soft);
  line-height: 1.6;
}

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

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

  .dashboard-grid,
  .payments-grid,
  .student-status-grid,
  .billing-command-strip {
    grid-template-columns: 1fr;
  }

  .billing-command-actions {
    justify-content: flex-start;
  }

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

  .identity-facts {
    width: 100%;
  }

  .identity-facts > div:first-child {
    border-left: 0;
    padding-left: 0;
  }
}

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

  .auth-hero {
    min-height: 520px;
  }

  .auth-panel {
    align-items: flex-start;
  }

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

  .sidebar {
    position: fixed;
    width: 250px;
    transform: translateX(-105%);
    transition: transform 170ms ease;
    box-shadow: var(--shadow-md);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    visibility: hidden;
    border: 0;
    background: rgba(20, 28, 35, 0.36);
    opacity: 0;
    transition: opacity 170ms ease, visibility 170ms ease;
  }

  .sidebar-scrim.visible {
    visibility: visible;
    opacity: 1;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .main {
    padding-inline: 18px;
  }

  .toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(3, 145px);
  }

  .toolbar-actions {
    grid-column: 1 / -1;
  }

  .seat-history-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .seat-history-assignee {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .auth-page {
    gap: 14px;
    padding: 14px;
  }

  .auth-hero {
    min-height: 430px;
    padding: 28px;
  }

  .auth-copy h1 {
    font-size: clamp(2.45rem, 12vw, 4rem);
  }

  .auth-metrics {
    grid-template-columns: 1fr;
  }

  .metric-tile:nth-child(n + 2) {
    display: none;
  }

  .main {
    padding: 12px 12px 28px;
  }

  .topbar {
    top: 8px;
  }

  .admin-label {
    display: none;
  }

  .content {
    padding-top: 26px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .page-head > .button {
    width: fit-content;
  }

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

  .page-title h1 {
    font-size: 2.2rem;
  }

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

  .cash-ribbon {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, #172532, #243849 52%, #f9fbfc 52.2%, #f9fbfc);
  }

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

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

  .payment-panel-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .billing-command-actions,
  .billing-page-meter {
    align-items: stretch;
    flex-direction: column;
  }

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

  .billing-interval-range,
  .billing-due-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .billing-page-meter .pagination-bar > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .renewal-agenda-group {
    grid-template-columns: 1fr;
  }

  .renewal-agenda-date {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .renewal-agenda-row {
    grid-template-columns: minmax(0, 1fr) auto 30px;
  }

  .renewal-agenda-row .payment-mini-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

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

  .toolbar-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .toolbar-actions .button {
    flex: 1;
  }

  .table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 9px;
  }

  .payment-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .payment-card::before {
    inset: 0 0 auto;
    width: auto;
    height: 5px;
  }

  .payment-amount-block {
    grid-column: 1 / -1;
    min-height: 78px;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-bar > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .identity-card {
    gap: 17px;
  }

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

  .identity-facts > div,
  .identity-facts > div:first-child {
    border-left: 0;
    padding: 0;
  }

  .presence-grid,
  .visit-meta {
    grid-template-columns: 1fr;
  }

  .seat-history-flow {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .seat-history-flow i {
    display: none;
  }

  .presence-grid > div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .billing-table-wrap {
    display: none;
  }

  .billing-mobile-list {
    display: block;
  }

  .visit-record summary {
    grid-template-columns: minmax(0, 1fr) 44px 20px;
    gap: 9px;
  }

  .visit-duration {
    display: none;
  }

  .visit-journey {
    grid-template-columns: 1fr;
  }

  .journey-line {
    height: 36px;
    width: 6px;
    margin-left: 13px;
  }

  .journey-line span {
    width: 100%;
    height: var(--journey-progress, 100%);
    background: linear-gradient(180deg, var(--success), #7ba0c2);
  }

  .visit-journey.live .journey-line span {
    background: linear-gradient(180deg, var(--success), #d99a2b);
  }

  .seat-map-note,
  .seat-selection-tray {
    align-items: stretch;
    flex-direction: column;
  }

  .seat-tray-actions .button {
    width: 100%;
  }

  .seat-tray-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .seat-detail-summary,
  .seat-edit-row,
  .seat-record-grid,
  .seat-history-card {
    grid-template-columns: 1fr;
  }

  .seat-record-hero {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .seat-tune-main {
    grid-template-columns: 1fr;
  }

  .seat-number-dial {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    grid-template-rows: auto;
  }

  .seat-number-dial input {
    min-height: 58px;
    font-size: 2rem;
  }

  .seat-tune-strip {
    grid-template-columns: 1fr;
  }

  .tune-strip-icon {
    display: none;
  }

  .seat-tune-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .seat-tune-actions .button {
    width: 100%;
  }

  .seat-current-user {
    align-items: stretch;
    flex-direction: column;
  }

  .seat-current-user > .button,
  .seat-history-card .seat-history-assignee {
    justify-self: stretch;
    width: 100%;
  }

  .seat-record-number {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .seat-record-number > span {
    font-size: 1.45rem;
  }

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

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

/* Seat detail cleanup: solid surfaces and a new settings-first quick tune form. */

.seat-record-hero,
.seat-quick-update-panel,
.seat-page-history,
.seat-user-assigner,
.seat-tune-console {
  background: #fff;
  background-image: none;
}

.seat-current-user.active {
  border-color: #cbe9dc;
  background: #f1faf5;
  background-image: none;
}

.seat-history-card.active {
  border-color: #cbe9dc;
  background: #f4fbf7;
  background-image: none;
}

.seat-quick-update-panel {
  padding: 22px;
}

.seat-quick-update-panel .panel-header {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.seat-quick-form {
  display: grid;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
}

.seat-quick-form-intro {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1px 2px 4px;
}

.seat-quick-form-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.seat-quick-form-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.seat-quick-form-intro div {
  display: grid;
  gap: 3px;
}

.seat-quick-form-intro strong {
  color: var(--text);
  font-size: 0.84rem;
}

.seat-quick-form-intro span:not(.seat-quick-form-icon) {
  color: var(--text-faint);
  font-size: 0.72rem;
}

.seat-quick-section {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 13px;
}

fieldset.seat-quick-section {
  display: grid;
  gap: 8px;
}

.seat-quick-section legend {
  width: auto;
  margin: 0;
  padding: 0 5px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.seat-quick-section-head > div {
  display: grid;
  gap: 3px;
}

.seat-quick-section-head strong {
  color: var(--text);
  font-size: 0.78rem;
}

.seat-quick-section-head small,
.seat-quick-help {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.7rem;
  line-height: 1.4;
}

.seat-setting-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 0 8px;
  color: var(--text-faint);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seat-number-control {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
}

.step-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
}

.step-button:hover {
  border-color: #bdc9eb;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.seat-number-control input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cdd8ef;
  border-radius: 11px;
  background: #f6f8ff;
  color: var(--primary-strong);
  font-size: 1.55rem;
  font-weight: 850;
  text-align: center;
}

.seat-number-control input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.1);
  outline: 0;
}

.quick-choice-grid {
  display: grid;
  gap: 8px;
}

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

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

.quick-choice-grid .choice-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  justify-items: start;
  gap: 2px 8px;
  border-color: #e0e5f1;
  border-radius: 11px;
  background: #fff;
  padding: 9px;
  text-align: left;
}

.quick-choice-grid .choice-card:hover {
  border-color: #bdc9eb;
  background: #fbfcff;
  box-shadow: none;
  transform: none;
}

.quick-choice-grid .choice-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(49, 87, 213, 0.1);
  transform: none;
}

.quick-choice-grid .choice-marker {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 0.7rem;
}

.quick-choice-grid .choice-marker.status-dot {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.quick-choice-grid .choice-marker.status-dot::after {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.quick-choice-grid .choice-marker.status-dot.available {
  color: var(--success);
  background: var(--success-soft);
}

.quick-choice-grid .choice-marker.status-dot.reserved {
  color: #6476ca;
  background: #eef1ff;
}

.quick-choice-grid .choice-marker.status-dot.occupied {
  color: var(--warning);
  background: var(--warning-soft);
}

.quick-choice-grid .choice-marker.status-dot.unavailable {
  color: #7d8794;
  background: var(--surface-muted);
}

.quick-choice-grid .choice-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.2;
}

.quick-choice-grid .choice-card small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.62rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 14px;
}

@media (max-width: 760px) {
  .seat-quick-update-panel {
    padding: 18px;
  }

  .seat-quick-actions {
    justify-content: stretch;
  }

  .seat-quick-actions .button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .quick-category-grid {
    grid-template-columns: 1fr;
  }

  .quick-status-grid {
    grid-template-columns: 1fr;
  }

  .seat-quick-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .seat-quick-actions .button {
    width: 100%;
  }
}

.payment-status-chip.due.signal-settled {
  color: var(--success);
  background: var(--success-soft);
}

.payment-row.signal-settled td:first-child {
  border-left-color: #cbe9dc;
}

@media (max-width: 520px) {
  .auth-hero {
    min-height: 360px;
    padding: 22px;
  }

  .auth-copy {
    padding-block: 30px;
  }

  .auth-card {
    padding: 15px;
  }

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

  .topbar-context span {
    display: none;
  }

  .topbar .button .ui-icon {
    display: none;
  }

  .page-actions {
    flex-direction: column;
  }

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

  .compact-select-label {
    width: 100%;
  }

  .billing-student-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .billing-ticket {
    grid-template-columns: 1fr;
  }

  .billing-ticket-date {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    gap: 7px;
    padding: 12px 14px;
    text-align: left;
  }

  .billing-ticket-date strong {
    font-size: 0.82rem;
  }

  .billing-ticket-date i {
    width: 18px;
    height: 2px;
    margin-left: 0;
  }

  .billing-interval-range {
    min-width: 0;
    white-space: normal;
  }

  .billing-ticket-index {
    display: none;
  }

  .payment-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .payment-card-list,
  .payment-empty {
    min-height: 0;
  }

  .payment-date-badge,
  .payment-due-badge {
    grid-column: auto;
    min-height: 86px;
  }

  .payment-card-main,
  .payment-amount-block {
    grid-column: auto;
  }

  .payment-empty {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .panel {
    padding: 15px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .placeholder-chart {
    height: 180px;
    gap: 5px;
    padding-inline: 10px;
  }

  .identity-primary {
    min-width: 0;
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .identity-primary .avatar {
    width: 44px;
    height: 44px;
  }

  .presence-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .presence-actions .button,
  .modal-actions .button,
  .page-head > .button {
    width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 8px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100vh - 16px);
    border-radius: 14px;
    padding: 17px;
  }
}

/* Detail-page refinement: calmer pending state and OrderSettlement-style layouts */

:root {
  --pending: #3f6da8;
  --pending-soft: #edf4ff;
  --pending-border: #ccdcf4;
}

/* Pending is intentionally cool and quiet; amber remains reserved for due dates. */
.status-pill.pending,
.status-pill.upcoming,
.payment-status-chip.due.signal-low,
.payment-status-chip.due.signal-medium,
.billing-payment-dot.pending,
.billing-payment-dot.muted,
.billing-status-option.pending.active {
  color: var(--pending);
  background: var(--pending-soft);
}

.status-pill.partial,
.status-pill.partially-paid {
  color: var(--warning);
  background: var(--warning-soft);
}

.billing-command-strip {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: var(--border);
  background: linear-gradient(120deg, #fff, #f8faff 68%, var(--primary-soft));
  padding: 18px;
}

.billing-student-card {
  padding: 2px 4px;
}

.billing-count-badge {
  border: 1px solid #dbe3fa;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.billing-status-switch {
  border-color: var(--border);
  background: #f6f8fc;
}

.billing-status-option.pending.active {
  border: 1px solid var(--pending-border);
}

.billing-board {
  display: grid;
  gap: 14px;
}

.billing-board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 0;
}

.billing-board-head h2 {
  margin: 5px 0 5px;
  color: var(--text);
  font-size: 1.14rem;
  letter-spacing: -0.025em;
}

.billing-board-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.billing-board-count {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 0 11px;
  color: var(--text-faint);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.billing-ticket {
  min-height: 336px;
  border-color: var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.billing-ticket::before {
  width: 4px;
  background: var(--warning);
}

.billing-ticket.pending {
  border-color: var(--pending-border);
  background: linear-gradient(90deg, #f7faff, #fff 46%);
}

.billing-ticket.pending::before {
  background: var(--pending);
}

.billing-ticket.pending .billing-ticket-date {
  background: var(--pending-soft);
}

.billing-ticket.pending .billing-ticket-date span,
.billing-ticket.pending .billing-ticket-date small {
  color: var(--pending);
}

.billing-ticket.paid .billing-ticket-date,
.billing-ticket.overdue .billing-ticket-date {
  border-right-color: transparent;
}

.billing-ticket-date {
  border-right: 1px solid var(--border);
  padding: 20px 16px 20px 20px;
}

.billing-ticket-main {
  gap: 13px;
  padding: 18px;
}

.billing-plan-token {
  color: var(--text-soft);
  letter-spacing: 0.08em;
}

.billing-interval-range {
  border-color: var(--border);
  background: #f8fafc;
}

.billing-ticket-money strong {
  font-size: 2.15rem;
  letter-spacing: -0.045em;
}

.billing-ticket-money span {
  color: var(--text-faint);
}

.billing-progress {
  background: #e8edf5;
}

.billing-progress span {
  background: linear-gradient(90deg, #3157d5, #7b99ee);
}

.billing-ticket-numbers span {
  border: 1px solid #edf0f6;
  background: #fafbfe;
}

.billing-payment-dots {
  border-top-color: var(--border);
}

.billing-payment-dot.pending,
.billing-payment-dot.muted {
  border: 1px solid var(--pending-border);
  background: var(--pending-soft);
  color: var(--pending);
}

/* Seat details use a main record column and a compact editor column, like the reference detail view. */
.seat-record-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(350px, 0.8fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.seat-record-hero,
.seat-quick-update-panel,
.seat-page-history {
  border-color: var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.seat-record-hero {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  min-height: 270px;
  align-content: start;
  padding: 24px;
}

.seat-record-number {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(49, 87, 213, 0.1);
}

.seat-record-number > span {
  font-size: 2.05rem;
}

.seat-record-hero h2 {
  margin: 4px 0 12px;
  font-size: 1.65rem;
  letter-spacing: -0.045em;
}

.seat-record-hero .card-meta {
  gap: 7px;
}

.seat-current-user,
.seat-user-assigner {
  margin-top: 14px;
  border-color: #dbe3fa;
  border-radius: 14px;
  background: #f8faff;
  padding: 14px;
}

.seat-current-user.active {
  border-color: #cbe9dc;
  background: linear-gradient(135deg, var(--success-soft), #fff);
}

.seat-current-avatar,
.seat-empty-symbol {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.seat-current-user > div span {
  color: var(--text-faint);
}

.seat-quick-update-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  padding: 22px;
}

.seat-quick-update-panel .panel-header {
  min-height: 0;
  margin-bottom: 14px;
  padding-bottom: 15px;
}

.seat-tune-console {
  border-color: #dfe5f3;
  border-radius: 14px;
  background: #f8faff;
  padding: 12px;
}

.seat-tune-main {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
}

.seat-number-dial {
  border-color: #dbe3fa;
  border-radius: 14px;
  background: #fff;
  padding: 8px;
}

.seat-number-dial input {
  min-height: 74px;
  border-radius: 14px;
  background: #eaf1ff;
  color: var(--primary-strong);
  font-size: 2.5rem;
  box-shadow: inset 0 -4px 0 #91afea;
}

.seat-tune-strip {
  border-color: #dfe5f3;
  border-radius: 13px;
  background: #fff;
  padding: 9px;
}

.seat-tune-console .choice-card {
  min-height: 68px;
  border-color: #e0e5f1;
  background: #fff;
}

.seat-tune-console .choice-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(49, 87, 213, 0.1);
}

.seat-tune-actions {
  margin-top: 14px;
  padding-top: 14px;
}

.seat-page-history {
  grid-column: 1;
  grid-row: 2;
  gap: 14px;
  margin: 0;
  padding: 22px;
}

.seat-page-history .compact-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.seat-history-card {
  border-color: var(--border);
  border-radius: 13px;
  background: #fff;
  box-shadow: none;
  padding: 12px 14px;
}

.seat-history-card.active {
  border-color: #cbe9dc;
  background: linear-gradient(135deg, var(--success-soft), #fff);
}

@media (max-width: 920px) {
  .billing-ticket-grid {
    grid-template-columns: 1fr;
  }

  .seat-record-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .seat-record-hero,
  .seat-quick-update-panel,
  .seat-page-history {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .billing-command-strip {
    grid-template-columns: 1fr;
  }

  .billing-command-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-status-switch {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .billing-status-option {
    justify-content: center;
    padding-inline: 5px;
  }

  .billing-page-meter {
    justify-content: space-between;
  }

  .billing-board-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .billing-ticket {
    min-height: 0;
  }

  .seat-record-hero {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 0;
    padding: 18px;
  }

  .seat-record-number {
    width: 78px;
    height: 78px;
  }

  .seat-record-number > span {
    font-size: 1.7rem;
  }

  .seat-quick-update-panel,
  .seat-page-history {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* OrderSettlement-inspired ReadingHub visual system */

:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-subtle: #fafbfe;
  --surface-muted: #eef2fb;
  --text: #111936;
  --text-soft: #66708f;
  --text-faint: #8d96b1;
  --border: #e4e8f2;
  --border-strong: #d5dbea;
  --primary: #3157d5;
  --primary-strong: #193ba7;
  --primary-soft: #edf2ff;
  --success: #168b63;
  --success-soft: #eaf8f2;
  --warning: #a96207;
  --warning-soft: #fff6df;
  --danger: #bf3e53;
  --danger-soft: #fff0f2;
  --blue-soft: #edf2ff;
  --rose-soft: #fff0f2;
  --shadow-sm: 0 7px 25px rgba(27, 46, 98, 0.045);
  --shadow-md: 0 22px 70px rgba(18, 32, 81, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
}

html,
body,
.app-shell {
  background: var(--bg);
}

body {
  color: var(--text);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline-color: rgba(49, 87, 213, 0.28);
}

.layout {
  display: block;
  min-height: 100vh;
}

.main {
  min-width: 0;
  padding: 0 4vw 72px;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 26px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  padding: 0 4vw;
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.top-brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.top-brand > span,
.top-brand strong,
.top-brand small {
  display: block;
}

.top-brand small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(49, 87, 213, 0.22);
}

.topnav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.topnav .nav-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  padding: 0 11px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.topnav .nav-link .ui-icon {
  width: 15px;
  height: 15px;
}

.topnav .nav-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.topnav .nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

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

.topbar-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.topbar-user > div:last-child {
  min-width: 0;
}

.topbar-user strong,
.topbar-user span {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user strong {
  color: var(--text);
  font-size: 0.76rem;
}

.topbar-user span {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.64rem;
}

.topbar-user .avatar,
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e9eeff;
  color: var(--primary-strong);
  font-size: 0.74rem;
}

.topbar .icon-button {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text-soft);
}

.topbar .icon-button:hover {
  border-color: #bdc9eb;
  background: var(--primary-soft);
  color: var(--primary);
}

.content {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding-top: 48px;
}

.page-head {
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 30px;
}

.page-title h1 {
  margin: 5px 0 7px;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -0.055em;
}

.page-title p {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.page-actions,
.heading-actions {
  gap: 10px;
}

.button,
.icon-button {
  border-radius: 10px;
  font-weight: 720;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button {
  min-height: 42px;
  padding-inline: 16px;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(49, 87, 213, 0.18);
}

.button.primary:hover {
  border-color: #284bc2;
  background: #284bc2;
  box-shadow: 0 11px 22px rgba(49, 87, 213, 0.22);
  transform: translateY(-1px);
}

.button.secondary,
.icon-button {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover,
.icon-button:hover {
  border-color: #c5cce0;
  background: #fbfcff;
}

.button.ghost {
  color: var(--text-soft);
}

.button.ghost:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.button.soft-primary {
  border-color: #dbe2fa;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.button.soft-primary:hover {
  border-color: #c2cff7;
  background: #e2e9ff;
}

.panel,
.stat-card,
.empty-state,
.access-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 25px rgba(27, 46, 98, 0.035);
}

.panel {
  padding: 20px;
}

.panel-header {
  min-height: 50px;
  align-items: center;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 13px;
}

.panel-header .form-subtitle {
  color: var(--text-faint);
}

.icon-heading {
  gap: 9px;
}

.heading-icon {
  width: 31px;
  height: 31px;
  border-radius: 10px;
}

.heading-icon.blue,
.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--primary);
}

.heading-icon.green,
.stat-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.heading-icon.amber,
.stat-icon.amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.heading-icon.rose,
.stat-icon.rose {
  background: var(--rose-soft);
  color: #94546a;
}

.stats-grid {
  gap: 16px;
}

.stat-card {
  min-height: 140px;
  padding: 23px;
}

.stat-label {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.stat-value {
  margin-top: 18px;
  color: var(--text);
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.stat-note {
  color: var(--text-faint);
}

.dashboard-grid {
  gap: 16px;
  margin-top: 20px;
}

.placeholder-chart {
  height: 230px;
  background: var(--surface-subtle);
}

.bar {
  background: #dbe4ff;
}

.activity-list li,
.detail-row {
  padding: 14px 0;
  border-color: #edf0f6;
}

/* Design tokens and application shell */

.toolbar {
  gap: 9px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 25px rgba(27, 46, 98, 0.035);
}

.search-box input,
.filter-select,
.field input,
.field select {
  min-height: 42px;
  border-color: #dce1ed;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
}

.search-box input:focus,
.filter-select:focus,
.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.1);
}

.table-wrap,
.table-card,
.payment-table-wrap {
  border-color: var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 25px rgba(27, 46, 98, 0.035);
}

table {
  border-collapse: collapse;
}

th {
  border-color: #edf0f6;
  background: #fafbfe;
  color: var(--text-faint);
  font-size: 0.67rem;
  letter-spacing: 0.06em;
}

td {
  border-color: #edf0f6;
  color: #303853;
  font-size: 0.78rem;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr[data-student-id]:hover,
.payment-table tbody tr:hover {
  background: #fafbff;
}

.person-cell strong,
.payment-plan-name {
  color: var(--text);
}

.person-cell span,
.payment-muted,
.cell-note {
  color: var(--text-faint);
}

.status-pill {
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 740;
}

.status-pill::before {
  width: 6px;
  height: 6px;
}

.status-pill.paid,
.status-pill.active,
.status-pill.inside,
.status-paid {
  color: var(--success);
  background: var(--success-soft);
}

.status-pill.pending,
.status-pill.partial,
.status-pill.partially-paid,
.status-pill.upcoming,
.status-pill.due {
  color: #7059c2;
  background: #f1edff;
}

.status-pill.failed,
.status-pill.overdue,
.status-pill.unpaid,
.status-pill.outside {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-pill.not-set,
.status-pill.unknown,
.status-pill.no-plan {
  color: var(--text-soft);
  background: var(--surface-muted);
}

.payment-stage {
  gap: 20px;
}

.cash-ribbon {
  min-height: 150px;
  border-color: #dbe1f0;
  border-radius: 16px;
  background: linear-gradient(105deg, #253d9e, #3157d5 53%, #f7f9ff 53.2%, #fff);
  box-shadow: var(--shadow-sm);
}

.payment-list-panel {
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.payment-panel-header {
  padding-bottom: 13px;
}

.payment-panel-tools {
  gap: 10px;
}

.payment-list-panel .payment-table-wrap {
  border: 0;
  box-shadow: none;
}

.payment-row td:first-child {
  border-left-color: #dbe3fa;
}

.payment-row.signal-high td:first-child,
.payment-row.signal-overdue td:first-child,
.payment-row.signal-urgent td:first-child {
  border-left-color: #e2b7bf;
}

.payment-amount {
  color: var(--text);
  font-weight: 760;
}

.payment-status-chip {
  border-radius: 999px;
}

.payment-status-chip.due.signal-high,
.payment-status-chip.due.signal-urgent,
.payment-status-chip.renewal.signal-overdue,
.payment-status-chip.renewal.signal-urgent {
  color: var(--danger);
  background: var(--danger-soft);
}

.payment-status-chip.due.signal-low,
.payment-status-chip.due.signal-medium {
  color: #7059c2;
  background: #f1edff;
}

.billing-workspace,
.billing-board,
.billing-ticket-grid {
  gap: 16px;
}

.billing-command-strip,
.billing-ticket {
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.billing-command-strip {
  background: linear-gradient(120deg, #fff, #f7f9ff 62%, #eef2ff);
}

.billing-ticket {
  background: #fff;
}

.billing-ticket-main {
  gap: 12px;
}

.billing-ticket-money strong {
  color: var(--text);
}

.billing-progress span {
  background: linear-gradient(90deg, #3157d5, #6d8cf0);
}

.billing-ticket.paid .billing-progress span {
  background: linear-gradient(90deg, #168b63, #5ab78e);
}

.billing-payment-dot.paid {
  background: var(--success-soft);
  color: var(--success);
}

.billing-payment-dot.pending,
.billing-payment-dot.muted {
  background: #f1edff;
  color: #7059c2;
}

.billing-payment-dot.failed,
.billing-payment-dot.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-backdrop {
  background: rgba(11, 20, 54, 0.48);
  backdrop-filter: blur(4px);
}

.modal-panel {
  border-color: var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.modal-head {
  border-color: var(--border);
}

.form-error {
  border-color: #f5cbd2;
  background: var(--danger-soft);
  color: var(--danger);
}

.notice {
  border-color: #cbead9;
  background: var(--success-soft);
  color: #216a4b;
}

/* Auth surfaces */

.auth-page {
  width: 100%;
  max-width: 1480px;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, 0.85fr);
  gap: 24px;
  padding: 24px;
  background: #fff;
}

.auth-hero {
  position: relative;
  min-height: calc(100vh - 48px);
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  background: radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.26), transparent 22%), linear-gradient(150deg, #4168e7 0%, #284cc8 46%, #17349a 100%);
  color: #fff;
  padding: 34px 44px;
}

.auth-hero::before,
.auth-hero::after {
  position: absolute;
  width: 610px;
  height: 610px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 47% 53% 64% 36%;
  content: "";
  pointer-events: none;
  transform: rotate(29deg);
}

.auth-hero::before {
  top: -190px;
  left: -330px;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.035), 0 0 0 44px rgba(255, 255, 255, 0.035), 0 0 0 66px rgba(255, 255, 255, 0.035), 0 0 0 88px rgba(255, 255, 255, 0.035);
}

.auth-hero::after {
  right: -370px;
  bottom: -320px;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.035), 0 0 0 44px rgba(255, 255, 255, 0.035), 0 0 0 66px rgba(255, 255, 255, 0.035);
}

.auth-hero .auth-brand,
.auth-hero .auth-copy,
.auth-hero .auth-metrics {
  position: relative;
  z-index: 1;
}

.auth-hero .auth-brand {
  color: #fff;
}

.auth-hero .brand-mark {
  background: #fff;
  color: var(--primary);
  box-shadow: none;
}

.auth-copy {
  max-width: 680px;
  padding-block: 7vh;
}

.auth-copy h1 {
  max-width: 640px;
  margin: 22px 0 18px;
  color: #fff;
  font-size: clamp(2.8rem, 5vw, 4.65rem);
  letter-spacing: -0.06em;
}

.auth-copy p {
  max-width: 560px;
  color: #dce4ff;
  font-size: 1rem;
  line-height: 1.65;
}

.auth-hero .eyebrow {
  color: #c9d5ff;
}

.auth-metrics {
  gap: 32px;
  border-top-color: rgba(255, 255, 255, 0.19);
  padding-top: 24px;
}

.metric-tile {
  border-top: 0;
  padding-top: 0;
}

.metric-tile strong {
  margin-bottom: 5px;
  color: #fff;
  font-size: 0.95rem;
}

.metric-tile span {
  color: #c8d4ff;
}

.auth-panel {
  display: grid;
  place-items: center;
  background: #fff;
  padding: 44px clamp(12px, 4vw, 78px);
}

.auth-card {
  width: min(100%, 430px);
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 0;
  box-shadow: none;
}

.auth-tabs {
  margin-bottom: 28px;
  border-radius: 12px;
}

.tab-button.active {
  color: var(--primary-strong);
  background: #fff;
  box-shadow: 0 3px 12px rgba(31, 45, 90, 0.08);
}

.form h2 {
  color: var(--text);
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.form-subtitle {
  color: var(--text-soft);
}

.field > span,
.field label {
  color: var(--text);
}

.field input,
.field select {
  min-height: 48px;
}

/* Seats retain their map behavior but use the lighter reference surfaces. */

.seat-map-scroll,
.other-seats,
.seat-selection-tray,
.seat-page-history,
.seat-quick-update-panel,
.seat-record-hero {
  border-color: var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.seat-map-scroll {
  background: #fafbfe;
}

.seat-square {
  border-color: #dce1ed;
  box-shadow: 0 3px 9px rgba(27, 46, 98, 0.06);
}

.seat-square.category-male {
  border-color: #aabce9;
  background: #edf2ff;
  color: #3157a7;
}

.seat-square.category-female {
  border-color: #e2b6c4;
  background: #fff0f4;
  color: #9c4b68;
}

.seat-square.category-other,
.seat-square.category-unknown {
  border-color: #afd2c1;
  background: #eaf8f2;
  color: #28775d;
}

.seat-occupant-detail {
  border-color: #dce1ed;
  border-radius: 10px;
  box-shadow: 0 3px 9px rgba(27, 46, 98, 0.06);
}

.seat-occupant-detail:hover {
  border-color: #bdc9eb;
  background: #fafbff;
}

.seat-record-number {
  border-radius: 18px;
}

/* Responsive shell */

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0;
    padding-block: 10px;
  }

  .top-brand {
    margin-right: auto;
  }

  .mobile-menu {
    display: inline-flex;
    margin-left: 10px;
  }

  .topnav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
    padding-top: 10px;
  }

  .topnav.open {
    display: flex;
  }

  .topnav .nav-link {
    justify-content: flex-start;
  }

  .main {
    padding-inline: 18px;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 0 14px 42px;
  }

  .content {
    padding-top: 32px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .topbar-user > div:last-child {
    display: none;
  }

  .topbar-user {
    border-left: 0;
    padding-left: 0;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .page-title h1 {
    font-size: 2.3rem;
  }

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

  .page-actions .button {
    width: fit-content;
  }

  .auth-page {
    gap: 14px;
    padding: 14px;
  }

  .auth-hero {
    min-height: 430px;
    border-radius: 22px;
    padding: 28px;
  }

  .auth-copy h1 {
    font-size: clamp(2.45rem, 12vw, 4rem);
  }

  .auth-metrics {
    grid-template-columns: 1fr;
  }

  .metric-tile:nth-child(n + 2) {
    display: none;
  }

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

  .toolbar-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .toolbar-actions .button {
    flex: 1;
  }

  .table-wrap,
  .payment-table-wrap {
    display: none;
  }

  .mobile-cards,
  .payment-mobile-list {
    display: grid;
    gap: 10px;
  }

  .payment-list-panel {
    padding: 16px;
  }

  .payment-panel-tools {
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
  }

  .payment-dues-search {
    width: 100%;
  }

  .billing-table-wrap {
    display: none;
  }

  .billing-mobile-list {
    display: block;
  }
}

@media (max-width: 520px) {
  .top-brand {
    font-size: 1.05rem;
  }

  .top-brand small {
    display: none;
  }

  .topbar .icon-button .ui-icon {
    width: 16px;
    height: 16px;
  }

  .content {
    padding-top: 28px;
  }

  .page-title h1 {
    font-size: 2.05rem;
  }

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

  .page-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-page {
    display: block;
    min-height: 100vh;
  }

  .auth-hero {
    min-height: 360px;
    padding: 22px;
  }

  .auth-copy {
    padding-block: 30px;
  }

  .auth-panel {
    padding: 36px 8px 14px;
  }

  .auth-card {
    max-width: 430px;
  }

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

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

  .cash-ribbon {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, #253d9e, #3157d5 52%, #f7f9ff 52.2%, #fff);
  }

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

  .panel,
  .stat-card {
    padding: 16px;
  }
}

/* Final seat-detail surface overrides must remain last in the cascade. */
.seat-current-user.active,
.seat-history-card.active {
  background: #f3fbf7;
  background-image: none;
}

.seat-tune-console,
.seat-record-hero,
.seat-quick-update-panel,
.seat-page-history,
.seat-user-assigner {
  background-image: none;
}

/* Collection cards: settlement summary and OrderSettlement-style payment history. */
.billing-ticket {
  min-height: 410px;
}

.billing-ticket-main {
  gap: 12px;
}

.billing-settlement-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.billing-settlement-heading > div {
  display: grid;
  gap: 3px;
}

.billing-settlement-heading span:first-child {
  color: var(--text-faint);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.billing-settlement-heading strong {
  color: var(--text);
  font-size: 2rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

.billing-paid-percent {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid #dbe3fa;
  border-radius: 999px;
  background: var(--primary-soft);
  padding: 0 9px;
  color: var(--primary-strong);
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.billing-settlement-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid #edf0f6;
  border-radius: 11px;
  background: var(--surface-subtle);
  padding: 9px;
}

.billing-settlement-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.billing-settlement-summary > div + div {
  border-left: 1px solid #e6eaf2;
  padding-left: 9px;
}

.billing-settlement-summary span {
  color: var(--text-faint);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
}

.billing-settlement-summary strong {
  color: var(--text);
  font-size: 0.78rem;
}

.billing-settlement-summary .paid strong {
  color: var(--success);
}

.billing-settlement-summary .due strong {
  color: var(--pending);
}

.billing-payment-history {
  display: grid;
  min-width: 0;
  max-height: 174px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 9px;
}

.billing-payment-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.billing-payment-history-head span {
  color: var(--text-faint);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.billing-payment-history-head strong {
  color: var(--text-faint);
  font-size: 0.65rem;
  font-weight: 700;
}

.billing-payment-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border-bottom: 1px solid #edf0f6;
  padding: 9px 0;
}

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

.billing-payment-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--success-soft);
  color: var(--success);
}

.billing-payment-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.billing-payment-row:not(.paid) .billing-payment-icon {
  background: var(--pending-soft);
  color: var(--pending);
}

.billing-payment-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.billing-payment-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-payment-copy small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-payment-amount {
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.billing-no-payments {
  padding: 14px 0 4px;
  color: var(--text-faint);
  font-size: 0.7rem;
}

.billing-ticket-actions {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Add payment: make the outstanding balance visible before the form starts. */
.payment-modal {
  width: min(100%, 560px);
  border-radius: 18px;
  padding: 22px;
}

.payment-modal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #dbe3fa;
  border-radius: 12px;
  background: var(--primary-soft);
  margin-bottom: 18px;
  padding: 12px 14px;
}

.payment-modal-summary > div {
  display: grid;
  gap: 3px;
}

.payment-modal-summary span {
  color: var(--primary-strong);
  font-size: 0.68rem;
  font-weight: 750;
}

.payment-modal-summary strong {
  color: var(--text);
  font-size: 1.3rem;
  letter-spacing: -0.035em;
}

.payment-modal-summary > span {
  color: var(--primary-strong);
  font-size: 0.68rem;
  text-align: right;
}

.payment-amount-field input {
  min-height: 52px;
  font-size: 1.08rem;
}

.payment-amount-field > small {
  color: var(--text-faint);
  font-size: 0.67rem;
}

@media (max-width: 760px) {
  .billing-ticket {
    min-height: 0;
  }

  .payment-modal-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-modal-summary > span {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .billing-settlement-summary {
    gap: 5px;
    padding: 8px;
  }

  .billing-settlement-summary > div + div {
    padding-left: 6px;
  }

  .billing-settlement-summary strong {
    font-size: 0.7rem;
  }

  .payment-modal {
    padding: 17px;
  }
}

/* Persistent site footer and admin-created student flow. */
.app-shell,
.auth-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.auth-shell {
  flex: 1;
}

.auth-page {
  flex: 1;
}

.site-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 4vw;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  opacity: 0.72;
  transition: opacity 150ms ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  opacity: 1;
}

.site-footer img {
  display: block;
  max-width: 100%;
  border: 0;
}

.create-student-modal {
  width: min(100%, 620px);
}

.create-student-form {
  gap: 17px;
}

.create-student-form .field > span small {
  color: var(--text-faint);
  font-size: 0.63rem;
  font-weight: 650;
}

.student-profile-fields {
  grid-template-columns: minmax(120px, 0.45fr) minmax(180px, 1fr);
}

.student-contact-fields {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.52fr);
}

.form-helper {
  margin: -2px 0 0;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--text-soft);
  padding: 10px 12px;
  font-size: 0.7rem;
  line-height: 1.55;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 0.68rem;
  line-height: 1.4;
}

.login-method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -10px;
}

.login-method-row-end {
  justify-content: flex-end;
}

.auth-method-switch {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 4px 0;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.auth-method-switch:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.auth-method-switch:focus-visible {
  outline: 3px solid rgba(52, 90, 126, 0.2);
  outline-offset: 3px;
}

@media (max-width: 420px) {
  .login-method-row {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
  }
}

.directory-notice {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: -12px 0 18px;
}

.directory-notice .ui-icon {
  width: 15px;
  height: 15px;
}

@media (max-width: 520px) {
  .student-profile-fields,
  .student-contact-fields {
    grid-template-columns: 1fr;
  }

  .create-student-modal {
    padding: 17px;
  }
}

/* Membership plans: OrderSettlement-style catalog and creation flow. */
.plan-page-notice {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: -12px 0 22px;
}

.plan-page-notice .ui-icon {
  width: 15px;
  height: 15px;
}

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

.plan-overview-metric {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
}

.plan-overview-metric > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

.plan-overview-metric > span .ui-icon {
  width: 17px;
  height: 17px;
}

.plan-overview-metric > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.plan-overview-metric small {
  color: var(--text-faint);
  font-size: 0.65rem;
  font-weight: 700;
}

.plan-overview-metric strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-catalog-heading {
  margin-bottom: 16px;
}

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

.plan-catalog-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 300px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.plan-catalog-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  content: "";
}

.plan-catalog-card.inactive::before {
  background: var(--text-faint);
}

.plan-catalog-card:hover {
  border-color: #cbd5f1;
  box-shadow: 0 15px 38px rgba(26, 46, 103, 0.08);
  transform: translateY(-2px);
}

.plan-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.plan-card-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.plan-catalog-card .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.64rem;
  font-weight: 800;
}

.plan-catalog-card .status-pill .ui-icon {
  width: 12px;
  height: 12px;
}

.plan-catalog-card .status-active {
  background: var(--success-soft);
  color: var(--success);
}

.plan-catalog-card .status-inactive {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.plan-card-title {
  display: grid;
  gap: 5px;
  margin-top: 25px;
}

.plan-card-title > span {
  color: var(--text-faint);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-card-title h2 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 16px;
}

.plan-card-price strong {
  color: var(--primary-strong);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.055em;
}

.plan-card-price span {
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 650;
}

.plan-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.plan-card-meta > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.plan-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
  font-size: 0.61rem;
  font-weight: 700;
}

.plan-card-meta span .ui-icon {
  width: 12px;
  height: 12px;
}

.plan-card-meta strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #cbd5ee;
  border-radius: 18px;
  background: var(--surface);
  padding: 40px 20px;
  text-align: center;
}

.plan-empty-state > span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--primary);
}

.plan-empty-state h2,
.plan-empty-state p {
  margin: 0;
}

.plan-empty-state p {
  max-width: 430px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.plan-empty-state .button {
  margin-top: 8px;
}

.create-plan-modal {
  width: min(100%, 610px);
}

.create-plan-form {
  gap: 17px;
}

.create-plan-form .field > span small {
  color: var(--text-faint);
  font-size: 0.63rem;
}

.create-plan-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.create-plan-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix input {
  padding-right: 54px;
}

.input-with-suffix > span {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
}

/* Notifications workspace */
.notification-toolbar {
  align-items: end;
  justify-content: flex-start;
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 750;
}

.notification-table-panel {
  overflow: hidden;
  padding: 0;
}

.notification-table-panel .pagination-bar,
.student-pagination {
  margin: 0;
  padding: 14px 20px 20px;
}

.student-pagination {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 25px rgba(27, 46, 98, 0.035);
}

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

.notification-table {
  min-width: 1120px;
}

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

.notification-table th:first-child,
.notification-table td:first-child {
  min-width: 230px;
}

.notification-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-recipient > div:last-child {
  display: grid;
  gap: 2px;
}

.notification-recipient small {
  color: var(--text-faint);
  font-size: .68rem;
}

.notification-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: .74rem;
  font-weight: 700;
}

.notification-channel .ui-icon,
.notification-resend .ui-icon {
  width: 15px;
  height: 15px;
}

.notification-time {
  color: var(--text-soft);
  font-size: .7rem;
}

.notification-muted {
  color: var(--text-faint);
}

.notification-type-name {
  color: var(--text);
  font-size: .74rem;
}

.notification-resend {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.notification-resend .loader {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.notification-types-panel {
  margin-top: 20px;
}

.notification-types-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.notification-type-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-subtle);
  padding: 12px;
}

.notification-type-icon,
.notification-summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.notification-type-icon .ui-icon,
.notification-summary-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.notification-type-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.notification-type-item strong,
.notification-type-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-type-item strong {
  font-size: .78rem;
}

.notification-type-item span,
.notification-types-empty {
  color: var(--text-faint);
  font-size: .7rem;
}

.notification-types-empty {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.notification-type-modal {
  width: min(100%, 540px);
}

@media (max-width: 850px) {
  .notification-types-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .notification-types-list {
    grid-template-columns: 1fr;
  }

  .field-inline {
    width: 100%;
    justify-content: space-between;
  }
}

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

@media (max-width: 680px) {
  .plan-overview,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-catalog-card {
    min-height: 280px;
  }
}

@media (max-width: 520px) {
  .create-plan-modal {
    padding: 17px;
  }

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

/* Student home */

.student-home-app {
  min-height: 100vh;
  background: #090b20;
  color: #f8faff;
}

.student-home-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 4% 8%, rgba(34, 211, 238, 0.18), transparent 30rem),
    radial-gradient(circle at 95% 12%, rgba(139, 92, 246, 0.3), transparent 32rem),
    linear-gradient(145deg, #090b20 0%, #12103a 50%, #071a2e 100%);
}

.student-home-orb {
  position: fixed;
  z-index: -1;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  opacity: 0.42;
  filter: blur(65px);
  pointer-events: none;
}

.student-home-orb.orb-one {
  top: 20%;
  left: -10rem;
  background: #22d3ee;
}

.student-home-orb.orb-two {
  right: -10rem;
  bottom: 3%;
  background: #8b5cf6;
}

.student-home-header {
  display: flex;
  width: min(100%, 1180px);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 18px 18px 8px;
}

.student-home-brand,
.student-home-user,
.student-card-heading,
.student-card-topline,
.student-attendance-focus,
.student-seat-panel,
.student-plan-row {
  display: flex;
  align-items: center;
}

.student-home-brand {
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.student-brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 13px;
  background: linear-gradient(135deg, #7c3aed, #0891b2);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.14);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.student-home-brand > span:last-child,
.student-home-user-copy {
  display: none;
}

.student-home-brand strong,
.student-home-brand small,
.student-home-user-copy strong,
.student-home-user-copy small {
  display: block;
}

.student-home-brand strong {
  font-size: 0.9rem;
}

.student-home-brand small,
.student-home-user-copy small {
  margin-top: 2px;
  color: #aeb9d8;
  font-size: 0.67rem;
}

.student-home-user {
  gap: 9px;
}

.student-home-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e9eaff;
  font-size: 0.72rem;
  font-weight: 800;
}

.student-home-user-copy strong {
  max-width: 180px;
  overflow: hidden;
  color: #f8faff;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-logout-button,
.student-retry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f3f6ff;
  cursor: pointer;
  font-weight: 750;
}

.student-logout-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.student-logout-button span {
  display: none;
}

.student-logout-button:hover,
.student-retry-button:hover {
  border-color: rgba(103, 232, 249, 0.55);
  background: rgba(34, 211, 238, 0.12);
}

.student-home-app button:focus-visible,
.student-home-app a:focus-visible {
  outline: 3px solid rgba(103, 232, 249, 0.55);
  outline-offset: 3px;
}

.student-home-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 34px 18px 56px;
}

.student-welcome {
  max-width: 720px;
}

.student-welcome-pill,
.student-status-badge,
.student-payment-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 750;
}

.student-welcome-pill {
  gap: 7px;
  border: 1px solid rgba(165, 180, 252, 0.22);
  background: rgba(99, 102, 241, 0.13);
  padding: 7px 11px;
  color: #c7d2fe;
  font-size: 0.7rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.student-welcome-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 14px #22d3ee;
}

.student-welcome h1 {
  margin: 18px 0 10px;
  background: linear-gradient(110deg, #fff 10%, #c4b5fd 55%, #67e8f9 100%);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.25rem, 10vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.student-welcome p {
  max-width: 560px;
  margin: 0;
  color: #aeb9d8;
  font-size: 0.92rem;
  line-height: 1.65;
}

.student-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.student-summary-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(196, 181, 253, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(10, 12, 38, 0.68);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 20px;
  backdrop-filter: blur(22px);
}

.student-summary-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.55), transparent);
  content: '';
}

.student-card-topline {
  justify-content: space-between;
  gap: 12px;
}

.student-card-heading {
  gap: 10px;
  color: #dce3f9;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.student-card-icon,
.student-focus-icon,
.student-seat-icon,
.student-plan-icon {
  display: grid;
  place-items: center;
  color: #a5b4fc;
}

.student-card-icon {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(165, 180, 252, 0.2);
  border-radius: 11px;
  background: rgba(99, 102, 241, 0.15);
}

.student-status-badge,
.student-payment-status {
  gap: 7px;
  border: 1px solid transparent;
  padding: 6px 9px;
  font-size: 0.66rem;
}

.student-status-badge.present,
.student-payment-status.paid {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.student-status-badge.away,
.student-payment-status.neutral {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.student-payment-status.due,
.student-payment-status.partial {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.student-payment-status.overdue {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(244, 63, 94, 0.13);
  color: #fda4af;
}

.student-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.student-attendance-focus {
  gap: 13px;
  margin-top: 30px;
}

.student-presence-stage {
  display: grid;
  min-height: 250px;
  place-content: center;
  justify-items: center;
  padding: 24px 0 8px;
  text-align: center;
}

.student-live-time {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 5px 7px;
  margin-bottom: 18px;
  color: #aeb9d8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.student-live-time strong {
  grid-column: 1 / -1;
  color: #f8faff;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.student-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.9);
}

.student-seat-visual {
  position: relative;
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.34);
  border-radius: 38px;
  background:
    radial-gradient(circle at 50% 35%, rgba(103, 232, 249, 0.24), transparent 60%),
    linear-gradient(145deg, rgba(99, 102, 241, 0.3), rgba(8, 145, 178, 0.18));
  box-shadow: 0 20px 55px rgba(34, 211, 238, 0.13), inset 0 1px rgba(255, 255, 255, 0.16);
  color: #67e8f9;
}

.student-seat-visual::after {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(165, 180, 252, 0.13);
  border-radius: 45px;
  content: '';
}

.student-seat-visual .ui-icon {
  width: 80px;
  height: 80px;
  opacity: 0.62;
  stroke-width: 1.4;
}

.student-seat-visual strong,
.student-seat-waiting {
  position: absolute;
  top: 48%;
  left: 50%;
  color: #fff;
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1;
  text-shadow: 0 3px 18px rgba(5, 8, 28, 0.9);
  transform: translate(-50%, -50%);
}

.student-seat-visual.awaiting {
  border-style: dashed;
  color: #a5b4fc;
  filter: saturate(0.7);
}

.student-seat-visual.away {
  width: 104px;
  height: 104px;
  border-color: rgba(148, 163, 184, 0.17);
  background: rgba(148, 163, 184, 0.07);
  box-shadow: none;
  color: #8490ad;
}

.student-seat-visual.away .ui-icon {
  width: 62px;
  height: 62px;
}

.student-seat-caption,
.student-seat-category {
  display: block;
}

.student-seat-caption {
  max-width: 260px;
  margin-top: 19px;
  color: #dce3f9;
  font-size: 0.76rem;
  font-weight: 750;
}

.student-seat-category {
  margin-top: 5px;
  color: #929dbc;
  font-size: 0.68rem;
}

.student-away-title {
  margin-top: 19px;
  color: #f3f5ff;
  font-size: 1rem;
}

.student-focus-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
}

.student-attendance-focus.present .student-focus-icon {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.24), rgba(34, 211, 238, 0.12));
  color: #6ee7b7;
}

.student-attendance-focus.away .student-focus-icon {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.student-focus-icon .ui-icon {
  width: 24px;
  height: 24px;
}

.student-kicker,
.student-seat-panel span,
.student-plan-row span,
.student-payment-amount span {
  display: block;
  color: #929dbc;
  font-size: 0.7rem;
  font-weight: 650;
}

.student-attendance-focus strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 1.2rem;
}

.student-seat-panel,
.student-plan-row {
  gap: 13px;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.student-seat-panel.awaiting {
  border-style: dashed;
}

.student-seat-icon,
.student-plan-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.11);
  color: #67e8f9;
}

.student-seat-panel strong,
.student-plan-row strong {
  display: block;
  margin-top: 3px;
  color: #f6f7ff;
  font-size: 0.92rem;
}

.student-seat-panel small {
  display: block;
  margin-top: 3px;
  color: #aeb9d8;
  font-size: 0.68rem;
}

.student-payment-amount {
  margin-top: 32px;
}

.student-payment-amount strong {
  display: block;
  margin-top: 6px;
  background: linear-gradient(100deg, #fff, #67e8f9);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.25rem, 13vw, 3.65rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.student-card-footnote {
  margin: 18px 0 0;
  color: #929dbc;
  font-size: 0.7rem;
  line-height: 1.5;
}

.student-card-error {
  display: grid;
  min-height: 235px;
  place-content: center;
  justify-items: start;
  gap: 8px;
}

.student-card-error strong {
  color: #fff;
  font-size: 1rem;
}

.student-card-error p {
  max-width: 340px;
  margin: 0;
  color: #aeb9d8;
  font-size: 0.78rem;
  line-height: 1.5;
}

.student-retry-button {
  gap: 7px;
  margin-top: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  padding: 9px 13px;
  font-size: 0.74rem;
}

.student-retry-button .ui-icon {
  width: 15px;
  height: 15px;
}

.student-summary-card.is-loading {
  display: grid;
  align-content: start;
  gap: 19px;
}

.student-skeleton {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.055));
  background-size: 220% 100%;
  animation: student-shimmer 1.4s ease-in-out infinite;
}

.student-skeleton-short {
  width: 34%;
  margin-top: 28px;
}

.student-skeleton-large {
  width: 68%;
  height: 44px;
}

@keyframes student-shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (min-width: 700px) {
  .student-home-brand > span:last-child,
  .student-home-user-copy {
    display: block;
  }

  .student-home-header,
  .student-home-main {
    padding-right: 28px;
    padding-left: 28px;
  }

  .student-summary-card {
    padding: 24px;
  }
}

@media (min-width: 760px) {
  .student-home-header {
    padding-top: 24px;
  }

  .student-home-main {
    padding-top: 64px;
  }

  .student-summary-card {
    padding: 28px;
  }

  .student-logout-button {
    width: auto;
    gap: 7px;
    padding: 0 13px;
  }

  .student-logout-button span {
    display: inline;
  }
}

@media (min-width: 900px) {
  .student-welcome h1 {
    font-size: clamp(3.5rem, 6vw, 4.8rem);
  }

  .student-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 52px;
  }

  .student-summary-card {
    min-height: 390px;
  }
}

@media (max-width: 380px) {
  .student-home-header,
  .student-home-main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .student-summary-card {
    border-radius: 20px;
    padding: 17px;
  }

  .student-card-heading {
    font-size: 0.68rem;
  }

  .student-card-icon {
    width: 31px;
    height: 31px;
  }

  .student-payment-status,
  .student-status-badge {
    padding: 5px 7px;
    font-size: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-skeleton {
    animation: none;
  }
}
