:root {
  --red: #e91925;
  --red-dark: #c90f19;
  --red-soft: #fff0f1;
  --dark: #24272b;
  --muted: #767d86;
  --line: #e3e6eb;
  --surface: #ffffff;
  --canvas: #f4f5f7;
  --soft: #eef0f4;
  --sidebar-bg: #1e2126;
  --sidebar-border: #2d3239;
  --green: #166534;
  --green-bg: #ecfdf3;
  --orange: #b45309;
  --orange-bg: #fff7e6;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --sidebar-width: 260px;
  --font: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font);
  color: var(--dark);
  background: var(--canvas);
}

.is-hidden { display: none !important; }
.muted { color: var(--muted); margin: 0; line-height: 1.5; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--canvas);
}

button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  text-shadow: none;
}

button:focus,
button:active,
button:focus-visible {
  box-shadow: none;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  border-right: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.sidebar-close {
  flex: none;
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.menu-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(36, 39, 43, .32);
  cursor: pointer;
}

body.menu-open .menu-scrim {
  display: block;
}

.brand-logo {
  display: block;
  width: auto;
  height: 44px;
  max-width: 180px;
  object-fit: contain;
  flex: none;
}

.brand-text { display: none; }


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

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #aeb6c4;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: rgba(233, 25, 37, 0.18); color: #fff; }
.nav-item.active .nav-icon { color: #ff8a8f; }
.nav-icon {
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 15px;
}

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

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

.topbar h1 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.25px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 12px; }

.topbar-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  max-width: min(280px, 36vw);
}

.topbar-profile-logo,
.topbar-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
}

.topbar-profile-logo {
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.topbar-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
}

.topbar-profile-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}

.topbar-profile-text strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-profile-text span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0;
}

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

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

.stat-card, .recipient-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--red);
  font-size: 18px;
  flex: none;
}
.stat-icon i, .nav-icon i, .icon-button i { line-height: 1; }
.phone-signal { color: var(--muted); font-size: 12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 8px; }
.stat-card strong, .recipient-summary strong { display: block; font-size: 24px; line-height: 1.1; font-weight: 700; }
.stat-card span:not(.stat-icon), .recipient-summary span:not(.stat-icon) { color: var(--muted); font-size: 14px; }

.content-grid { display: grid; gap: 16px; }
.content-grid.two { grid-template-columns: 1fr 1fr; }
.create-grid { grid-template-columns: minmax(0, 1.1fr) 420px; align-items: start; }
.students-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.panel-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.students-import-actions .segmented { margin-left: auto; }
.students-import-hint { margin: 0 0 14px; font-size: 13px; }
.import-errors { max-height: 240px; overflow: auto; margin-top: 12px; }
.import-errors ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.import-errors li + li { margin-top: 6px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-header h2, .panel-header h3 { margin: 3px 0 0; font-weight: 700; }
.panel-header h2 { font-size: 22px; }
.panel-header h3 { font-size: 18px; }

.primary-button, .ghost-button, .icon-button, .claim-preview, .segmented button, .credit-pack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
  white-space: nowrap;
  box-shadow: none !important;
  text-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

button:hover,
button:focus,
button:active,
.primary-button:hover,
.primary-button:focus,
.primary-button:active,
.ghost-button:hover,
.ghost-button:focus,
.ghost-button:active,
.icon-button:hover,
.icon-button:focus,
.icon-button:active,
.claim-preview:hover,
.claim-preview:focus,
.claim-preview:active,
.segmented button:hover,
.segmented button:focus,
.segmented button:active,
.nav-item:hover,
.nav-item:focus,
.nav-item:active {
  box-shadow: none !important;
}

.primary-button { background: var(--red); color: white; border: 1px solid var(--red); }
.primary-button:hover { background: var(--red-dark); border-color: var(--red-dark); }
.primary-button.success { background: var(--green); border-color: var(--green); color: #fff; }
.primary-button.success:hover { background: #14532d; border-color: #14532d; }
.primary-button.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.ghost-button.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.ghost-button.danger { color: var(--red); border-color: #fecaca; }
.ghost-button.danger:hover { background: var(--red-soft); color: var(--red-dark); }

.icon-button-danger {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: #b8bec8;
  border-radius: var(--radius-md);
  flex: none;
}

.icon-button-danger:hover {
  color: var(--red);
  background: var(--red-soft);
}

.icon-button-danger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 39, 43, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 40px rgba(36, 39, 43, 0.12);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--text);
  border-color: var(--text);
  outline: none;
}

.modal-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--red-soft);
  color: var(--red);
  font-size: 18px;
  margin-bottom: 14px;
}

.claim-notify-icon {
  background: #ecfdf3;
  color: #059669;
}

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.modal-text {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.ghost-button, .icon-button, .credit-pack-btn { background: var(--surface); color: var(--dark); border: 1px solid var(--line); }
.ghost-button:hover, .icon-button:hover, .credit-pack-btn:hover { background: var(--soft); }
.credit-pack-btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.claim-preview { width: 100%; background: var(--red); color: white; border: 1px solid var(--red); padding: 10px 16px; min-height: 40px; }
.mobile-only { display: none; }

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  text-align: center;
  padding: 20px;
}

.lesson-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.lesson-card.reserved {
  border-color: #fecaca;
  border-left: 4px solid var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 1px rgba(233, 25, 37, 0.08);
}
.lesson-card.reserved .claim-info {
  margin: 0;
  color: var(--red-dark);
  font-weight: 700;
}
.claim-student-box {
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fff;
}
.claim-info-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--red-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.claim-student-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.claim-student-grid span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.claim-student-grid strong {
  font-size: 15px;
  color: var(--dark);
  word-break: break-word;
}
@media (max-width: 650px) {
  .claim-student-grid { grid-template-columns: 1fr; }
}
.lesson-card.filled {
  border-color: #bbf7d0;
  border-left: 4px solid var(--green);
  background: var(--green-bg);
  box-shadow: 0 0 0 1px rgba(22, 101, 52, 0.08);
}
.lesson-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lesson-title strong { font-size: 18px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--dark);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: #fee2e2; color: var(--red); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.meta-row span { background: var(--soft); padding: 4px 8px; border-radius: var(--radius-sm); }

.activity-list, .cards-list { display: grid; gap: 8px; }
.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.activity-item strong { display: block; margin-bottom: 4px; }
.activity-item p { margin: 0; color: var(--muted); line-height: 1.45; }

.form-panel { display: grid; gap: 16px; }
.form-panel.compact { gap: 14px; }
.form-row { display: grid; gap: 8px; }
.form-row.inline { grid-template-columns: 1fr 1fr; gap: 14px; }

.time-24 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-24 select {
  flex: 1;
  min-width: 0;
}

.time-24 span {
  color: var(--muted);
  font-weight: 700;
}

.time-24 select:disabled,
.time-24 option:disabled {
  color: #c4c8cf;
}
.form-row label { font-weight: 700; font-size: 14px; }
.form-row input, .form-row select, .form-row textarea, .search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
  color: var(--dark);
  outline: none;
  transition: border-color .15s ease;
}
.form-row textarea { resize: vertical; min-height: 100px; line-height: 1.55; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus, .search-input:focus { border-color: var(--red); }
.form-row small { color: var(--muted); }
#charCount.sms-warn { color: #dc2626; font-weight: 600; }
.switch-row { background: var(--soft); padding: 12px; border-radius: var(--radius-sm); }
.switch-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-top: 6px;
  margin-bottom: 4px;
  background: var(--soft);
  border-radius: var(--radius-md);
}
.switch-group .switch-row {
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.switch-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-label input { width: 18px; height: 18px; accent-color: var(--red); }
.switch-label input:disabled { cursor: not-allowed; opacity: .55; }
.switch-label:has(input:disabled) { cursor: not-allowed; opacity: .75; }
.alert-channel-box {
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}
.alert-channel-title {
  margin: 0 0 10px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--dark);
}
.alert-channel-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
}
.phone-card.is-muted {
  opacity: .45;
  filter: grayscale(.25);
}
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }

.preview-panel { position: sticky; top: 24px; }
.phone-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
  min-height: 420px;
}
.phone-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 48px; color: var(--muted); }
.message-card {
  border-radius: var(--radius-md);
  background: var(--soft);
  padding: 14px;
  margin-top: 12px;
}
.message-sender { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.message-sender img { width: 22px; height: 22px; }
.logo-mark {
  width: 22px;
  height: 22px;
  object-fit: cover;
  object-position: left center;
  border-radius: 50%;
  flex: none;
}
.message-sender span { margin-left: auto; color: var(--muted); font-weight: 700; }
.message-card p { line-height: 1.55; margin: 0 0 10px; }
.sms-preview-link {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
}
.sms-preview-note {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .message-card p { text-align: center; }
}
.recipient-summary { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.recipient-summary strong { font-size: 20px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { background: var(--soft); color: #525962; border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px; font-weight: 700; }

.segmented { display: flex; background: var(--soft); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented button { border: 0; border-radius: 6px; padding: 7px 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; }
.segmented button.active { background: var(--surface); color: var(--red); border: 1px solid var(--line); }
.search-input { margin-bottom: 14px; }

.alerts-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.alerts-filter-tabs { width: fit-content; max-width: 100%; flex-wrap: wrap; }

.alerts-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 10px;
}

.filter-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font: inherit;
  background: var(--surface);
  color: var(--dark);
}

.filter-input:focus { border-color: var(--red); outline: none; }

.filter-time .time-24 select {
  min-height: 42px;
  padding: 0 10px;
}

.filter-time .time-24 {
  width: 100%;
}

.filter-summary {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.revenue-intro {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.revenue-hero {
  display: grid;
  gap: 6px;
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ecfdf3 0%, #f0fdf4 100%);
}

.revenue-hero strong {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1;
  color: var(--green);
}

.revenue-hero span {
  font-size: 14px;
  color: #166534;
  font-weight: 700;
}

.revenue-stats { margin-bottom: 24px; }

.revenue-section-title {
  margin: 0 0 12px;
  font-size: 16px;
}

.revenue-months {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.revenue-month-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto;
  gap: 12px;
  align-items: center;
}

.revenue-month-label {
  display: grid;
  gap: 2px;
}

.revenue-month-label span {
  font-size: 12px;
  color: var(--muted);
}

.revenue-month-bar-wrap {
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.revenue-month-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #16a34a);
}

.revenue-month-amount {
  font-size: 14px;
  white-space: nowrap;
}

.revenue-item { border-color: #d1fae5; }

@media (max-width: 760px) {
  .revenue-month-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .alerts-filter-row { grid-template-columns: 1fr; }
  .alerts-filter-tabs { width: 100%; }
  .alerts-filter-tabs button { flex: 1 1 auto; }
}
.student-list { display: grid; gap: 8px; }
.students-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}
.student-select-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ghost-button-danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
}
.ghost-button-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: rgba(185, 28, 28, 0.35);
}
.ghost-button-danger:disabled {
  opacity: 0.55;
  cursor: default;
}
.student-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
}
.student-card.is-selected {
  border-color: rgba(233, 25, 37, 0.35);
  background: #fff8f8;
}
.student-select {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.student-select input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}
.avatar {
  width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--soft); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--dark); flex: none;
}
.student-main { min-width: 0; text-align: left; }
.student-main > div { min-width: 0; }
.student-main strong, .student-main span { display: block; text-align: left; }
.student-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-main span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.status-stack { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.green { background: var(--green); }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }

.settings-layout { grid-template-columns: 1fr; gap: 16px; }
.panel-wide { grid-column: 1 / -1; }

.settings-blocks {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.settings-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}

.settings-block-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.settings-block-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 16px;
  flex: none;
}

.settings-block-copy { min-width: 0; flex: 1; }

.settings-block-copy h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.settings-block-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.settings-block-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.settings-block-title-row h3 { margin: 0; }

.settings-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.settings-badge--ok {
  background: #ecfdf5;
  color: #047857;
}

.settings-badge--muted {
  background: #f3f4f6;
  color: #6b7280;
}

.settings-block-action {
  margin-top: 14px;
  width: 100%;
  max-width: 320px;
}

.settings-footnote {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.settings-block--logout {
  display: flex;
  justify-content: flex-start;
  background: transparent;
  border-style: dashed;
}

.settings-block--logout .ghost-button { min-width: 140px; }

@media (min-width: 720px) {
  .settings-blocks {
    grid-template-columns: 1fr 1fr;
  }

  .settings-block--logout {
    grid-column: 1 / -1;
  }
}

.service-areas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
  min-height: 36px;
}

.service-area-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.service-area-tag button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  min-width: 20px;
  min-height: 20px;
  font-size: 16px;
  line-height: 1;
}

.service-area-tag button:hover { color: var(--red); }

.service-area-form {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.district-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.district-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 14px;
  cursor: pointer;
}

.district-check span { flex: 1; }

.district-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.district-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.district-edit:hover {
  color: var(--red);
  background: var(--red-soft);
}

.add-district-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-district-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.modal-card .field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.modal-card .field input {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.modal-card-wide {
  width: min(560px, calc(100vw - 32px));
}

.modal-form .form-row.inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-form .modal-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  gap: 12px;
}

.form-panel .switch-group {
  margin-bottom: 18px;
}

.form-panel .switch-group + .primary-button {
  margin-top: 4px;
}

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

.field-label {
  font-size: 13px;
  font-weight: 700;
}

.empty-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.form-row small.muted { display: block; margin-top: 6px; font-size: 12px; }

.account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.account-stat {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.account-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.account-stat strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.account-profile {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.account-profile .avatar {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.account-profile strong { display: block; font-size: 16px; }
.account-profile .muted { font-size: 13px; margin-top: 2px; }

.settings-actions { margin-top: 4px; }

.branding-form { margin-top: 8px; }
.branding-preview {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 20px;
  align-items: start;
}
.branding-logo-preview,
.branding-logo-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}
.branding-logo-preview {
  object-fit: contain;
  padding: 8px;
}
.branding-logo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.branding-fields { min-width: 0; }

@media (max-width: 720px) {
  .branding-preview { grid-template-columns: 1fr; }
}
.credit-packs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.billing-page {
  display: grid;
  gap: 20px;
  max-width: 1080px;
}

.billing-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 52rem;
}

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

.billing-plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.billing-plan--current {
  border-color: #cbd5e1;
  background: var(--soft);
}

.billing-plan--active {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.billing-plan-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.billing-plan-tag--sub {
  background: rgba(233, 25, 37, 0.1);
  color: var(--red);
}

.billing-plan h3 {
  margin: 0;
  font-size: 17px;
}

.billing-plan-price {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.billing-plan-price small {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.billing-plan-subline {
  margin: -4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.billing-plan-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--dark);
  line-height: 1.45;
  flex: 1;
}

.billing-plan-list li + li { margin-top: 4px; }

.billing-plan-cta {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.billing-plan-you {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.billing-plan-you--active {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.billing-compare {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  background: var(--soft);
  font-size: 14px;
  line-height: 1.5;
  color: var(--dark);
}

.billing-compare p { margin: 0; }

.billing-pack-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 900px) {
  .billing-plans-grid { grid-template-columns: 1fr; }
}

.billing-promo-card {
  border-radius: var(--radius-lg);
  border: 2px solid var(--red);
  background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
  box-shadow: 0 16px 40px rgba(233, 25, 37, 0.08);
  overflow: hidden;
}

.billing-promo-card:has(.billing-promo--active) {
  border-color: #86efac;
  background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
  box-shadow: 0 16px 40px rgba(22, 163, 74, 0.08);
}

.billing-promo-card .billing-promo {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.billing-promo-cta {
  width: calc(100% - 60px);
  margin: 0 30px 28px;
  min-height: 48px;
  font-size: 16px;
  justify-content: center;
}

.billing-promo-cta.is-hidden {
  display: none;
}

.billing-promo--active {
  background: transparent;
}

.billing-promo {
  padding: 28px 30px 20px;
}

.billing-promo-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(233, 25, 37, 0.1);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.billing-promo-badge--active {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.billing-promo-title {
  margin: 0 0 10px;
  font-size: 22px;
}

.billing-promo-price {
  margin: 0 0 6px;
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.billing-promo-price small {
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
}

.billing-promo-renewal {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--dark);
}

.billing-promo-renewal strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.billing-promo-renewal small {
  color: var(--muted);
  font-weight: 400;
}

.billing-promo-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.billing-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.billing-stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.billing-stat-value {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.billing-stat-value.is-active {
  color: #166534;
}

.billing-stat-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.billing-packs-section {
  display: grid;
  gap: 8px;
}

.billing-packs-section h2 {
  margin: 0;
  font-size: 22px;
}

.billing-packs-section--locked .billing-packs-intro {
  color: var(--muted);
}

.billing-packs-mount {
  margin-top: 4px;
}

.billing-packs-panel {
  position: relative;
}

.billing-packs-panel--locked .billing-pack-grid--dimmed {
  opacity: 0.42;
  filter: grayscale(0.35);
  pointer-events: none;
  user-select: none;
}

.billing-packs-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
}

.billing-packs-overlay p {
  margin: 0;
  max-width: 28rem;
  color: var(--dark);
  line-height: 1.45;
}

.billing-pack-card--dimmed {
  cursor: default;
}

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

.billing-pack-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.billing-pack-card:hover {
  border-color: rgba(233, 25, 37, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.billing-pack-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}

.billing-pack-price {
  font-size: 24px;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.billing-pack-meta {
  font-size: 14px;
  color: var(--muted);
}

.billing-packs-intro {
  margin: -4px 0 14px;
}

.billing-credits-info {
  margin-top: 18px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: #c4141e;
}

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

@media (max-width: 820px) {
  .billing-status-grid {
    grid-template-columns: 1fr;
  }
}

.credits-info {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 14px;
}
.credits-info-title { margin: 0 0 8px; font-weight: 600; color: var(--dark); }
.credits-info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.credits-info-list li + li { margin-top: 4px; }
.mollie-status { margin-top: 12px; font-size: 14px; }

.brand-preview-card { border-radius: var(--radius-md); background: var(--soft); padding: 16px; border: 1px solid var(--line); }
.brand-preview-card img { width: 100%; height: auto; display: block; }
.brand-preview-card p { color: var(--muted); line-height: 1.6; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  background: var(--dark);
  color: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: .2s ease;
  z-index: 20;
  max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(88vw, 320px); z-index: 30; transform: translateX(-105%); transition: transform .2s ease; border-right: 1px solid var(--sidebar-border); }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-only { display: inline-flex; }
  .main { padding: 18px; }
  .content-grid.two, .create-grid, .students-grid, .settings-grid { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
}

@media (max-width: 700px) {
  .topbar { align-items: flex-start; border-bottom: 0; padding-bottom: 0; }
  .top-actions { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row.inline { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .phone-card { min-height: 320px; }
}

@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr; }
  .student-card { grid-template-columns: 1fr; }
  .student-card, .panel-header { align-items: flex-start; }
  .status-stack { justify-content: flex-start; }
}
