@import url('/css/mobile-base.css');

:root {
  --bg: #050b1c;
  --bg-secondary: #071027;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --surface-glow: rgba(124, 92, 255, 0.2);
  --text: #f4f7ff;
  --text-muted: #9aa4bd;
  --accent: #7c5cff;
  --accent-2: #2ad4d4;
  --danger: #ff6b6b;
  --warning: #f7b731;
  --radius: 16px;
  --shadow: 0 24px 50px rgba(4, 10, 35, 0.55);
  --shadow-soft: 0 12px 30px rgba(5, 12, 32, 0.38);
  --transition: 0.18s ease;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(60, 90, 200, 0.22), transparent 60%), var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 28px;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.mobile-menu-toggle {
  display: none;
  border: none;
  background: transparent;
  color: inherit;
}

.sidebar-backdrop {
  display: none;
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(41, 52, 95, 0.08));
  box-shadow: var(--shadow);
}

.legal-footnote {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.legal-footnote a {
  color: var(--accent);
  text-decoration: underline;
}

.legal-footnote a:hover {
  text-decoration: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 18px;
}

.product-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.product-role {
  margin-top: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.scrollable {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
}

.scrollable::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.school-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(7, 16, 36, 0.55);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.school-tile:hover {
  background: rgba(7, 16, 36, 0.75);
  border-color: rgba(124, 92, 255, 0.4);
  transform: translateX(4px);
}

.school-tile.active {
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.35), rgba(42, 212, 212, 0.2));
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: var(--shadow-soft);
}

.sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.sidebar-link:hover {
  background: rgba(7, 16, 36, 0.65);
  color: var(--text);
}

.btn,
.btn-secondary,
.btn-danger,
.btn-icon,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(124, 92, 255, 0.35);
}

.btn-secondary {
  background: rgba(7, 16, 36, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(7, 16, 36, 0.9);
}

.btn-danger {
  background: linear-gradient(130deg, rgba(255, 107, 107, 0.88), rgba(255, 86, 100, 0.8));
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(255, 107, 107, 0.32);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  color: var(--text-muted);
}

.btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.btn-ghost {
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: transparent;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(7, 16, 36, 0.85);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.2), rgba(42, 212, 212, 0.14));
  box-shadow: var(--shadow-soft);
}

.impersonation-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.impersonation-meta {
  font-weight: 600;
}

.banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workspace-header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

.subtitle {
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions .spacer {
  flex: 1;
}

.input {
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 16, 36, 0.92);
  color: var(--text);
  min-width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.28);
  background: rgba(7, 16, 36, 0.98);
}

.content {
  flex: 1;
}

.content-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.workspace-tab {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.workspace-tab.active {
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.35), rgba(42, 212, 212, 0.25));
  border-color: rgba(124, 92, 255, 0.7);
  color: #fff;
}

.workspace-tab:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.6);
  outline-offset: 2px;
}

.workspace-panels {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workspace-panel[hidden] {
  display: none;
}

.practice-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.practice-hero {
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(42, 212, 212, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-soft);
}

.practice-badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 10px;
}

.practice-hero h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.practice-lead {
  margin: 0;
  font-size: 1rem;
  color: #dee4ff;
  max-width: 700px;
}

.practice-tip {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.practice-card {
  background: rgba(5, 12, 28, 0.92);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.tool-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.responsive-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.form-row input,
.form-row select,
.form-row textarea {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  color: inherit;
}

.form-row textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row input[type='range'] {
  padding: 0;
  background: transparent;
  accent-color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metronome-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.beat-display {
  display: inline-flex;
  gap: 6px;
}

.beat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background var(--transition), transform var(--transition);
}

.beat-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

.tempo-value {
  font-size: 1.8rem;
  font-weight: 600;
}

.timer-display {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-entry {
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tap-tempo-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.generator-output {
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 80px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.tuner-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 640px) {
  .tuner-display {
    flex-direction: row;
    align-items: center;
  }
}

.tuner-needle {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(7, 16, 36, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.tuner-needle__indicator {
  width: 4px;
  height: 70px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.5);
  transform-origin: center bottom;
  transform: rotate(var(--needle-rotation, 0deg));
  transition: transform 80ms ease-out;
}

.tuner-scale {
  position: absolute;
  bottom: 12px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tuner-readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tuner-note {
  font-size: 2.6rem;
  font-weight: 700;
}

.tuner-frequency {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.tuner-cents {
  font-size: 1rem;
}

.empty-state {
  padding: 64px 24px;
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.empty-icon {
  margin-bottom: 12px;
  font-size: 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(5, 12, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(124, 92, 255, 0.45);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.billing-list {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.billing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.billing-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.billing-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.billing-charges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.billing-charges-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.charge-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.charge-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 12px;
  align-items: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.charge-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
}

.charge-row .btn-ghost {
  justify-self: end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.16);
  color: #dcdcff;
  font-size: 0.8rem;
}

.section {
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(7, 16, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-head > * {
  flex: 1 1 240px;
  min-width: 0;
}

.section-head > .inline-actions,
.section-head > .actions {
  display: flex;
  justify-content: flex-end;
}

.section-title-large {
  margin: 0;
  font-size: 1.1rem;
}

.tab-bar {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(7, 16, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-button {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.active {
  background: rgba(124, 92, 255, 0.25);
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.table thead th {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 8px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.table tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 8px;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.storage-tracker {
  margin: 12px 0 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storage-tracker__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.storage-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.storage-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.storage-progress__bar.danger {
  background: linear-gradient(120deg, var(--danger), #f39595);
}

.storage-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.storage-tracker__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-progress {
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.upload-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-progress__status {
  font-weight: 600;
  color: var(--text);
}

.upload-progress__bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.upload-progress__bar-inner {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s ease;
}

.upload-progress__error {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--danger);
}

.feature-list {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.feature-list li {
  margin-bottom: 6px;
}

.workspace-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

.upload-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-form .btn-primary {
  align-self: flex-start;
}

.error-text {
  color: var(--danger);
}

.tag-warning {
  color: var(--warning);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
}

.toast-host {
  position: fixed;
  right: 32px;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(7, 16, 36, 0.94);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-soft);
  min-width: 260px;
}

.toast.success {
  border-color: var(--accent-2);
}

.toast.error {
  border-color: var(--danger);
}

.toast button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 680px);
  border-radius: 18px;
  padding: 26px;
  background: rgba(9, 16, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.modal-header {
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-row input,
.form-row textarea,
.form-row select {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(7, 16, 36, 0.9);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}

.form-row textarea {
  min-height: 120px;
  resize: vertical;
}

.week-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(7, 16, 36, 0.9);
}

.week-picker-display {
  flex: 1;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.week-picker button {
  padding: 6px 12px;
  min-width: 0;
}

.week-picker button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-actions .muted {
  font-size: 0.8rem;
}

.inline-actions > * {
  flex: 0 1 auto;
}

.settings-grid {
  display: grid;
  gap: 16px;
  margin-top: 1.25rem;
}

@media (min-width: 960px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.settings-card {
  background: rgba(5, 12, 28, 0.92);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 38px -24px rgba(15, 23, 42, 0.65);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.settings-card p.muted {
  margin: 0;
}

.settings-card .inline-actions {
  margin-top: 0.35rem;
  gap: 0.75rem;
}

.settings-meta {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.settings-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.settings-meta dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  gap: 16px;
  margin: 0 0 24px;
}

@media (min-width: 600px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.summary-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.summary-card .label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.summary-card .value {
  font-size: 1.65rem;
  font-weight: 600;
}

.summary-card .meta {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

.children-grid,
.cards-grid {
  display: grid;
  gap: 18px;
}
  .tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 11, 28, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
  }
  .tutorial-overlay.is-visible {
    display: flex;
  }
  .tutorial-card {
    max-width: 520px;
    width: 100%;
    padding: 32px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(9, 16, 36, 0.95), rgba(20, 30, 60, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px rgba(4, 10, 35, 0.65);
  }
  .tutorial-progress {
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  .tutorial-card h2 {
    margin: 0 0 12px;
  }
  .tutorial-card p {
    margin: 0 0 24px;
    color: var(--text-muted);
    line-height: 1.6;
  }
  .tutorial-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }

@media (min-width: 960px) {
  .children-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.child-card,
.surface-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  box-shadow: 0 18px 40px -24px rgba(13, 21, 49, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.card-actions .btn-secondary {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.card-actions > * {
  flex: 0 1 auto;
}

.child-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.child-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.16);
  color: rgba(34, 211, 238, 0.92);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill.danger {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.list-table th,
.list-table td {
  padding: 0.65rem 0.5rem;
  text-align: left;
}

.list-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.list-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.empty-state-inline {
  padding: 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge.success {
  color: var(--accent-2);
}

.badge.danger {
  color: var(--danger);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(5, 12, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color var(--transition), background var(--transition);
}

.list-item:hover {
  background: rgba(5, 12, 28, 0.96);
  border-color: rgba(124, 92, 255, 0.35);
}

.list-item .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-item .meta span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tag.accent {
  background: rgba(124, 92, 255, 0.18);
  color: #d6d2ff;
}

.tag.outline {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.density-tight {
  display: grid;
  gap: 14px;
}

.callout {
  padding: 18px;
  border-radius: 16px;
  background: rgba(42, 212, 212, 0.14);
  color: #e4feff;
  border: 1px solid rgba(42, 212, 212, 0.35);
}

.callout.warning {
  background: rgba(247, 183, 49, 0.14);
  border-color: rgba(247, 183, 49, 0.45);
  color: #fff3d6;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  min-height: 80px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.fade-in {
  animation: fadeIn 0.24s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* Mobile & Tablet Responsive Design */
@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 72px 16px 20px;
    gap: 20px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: clamp(280px, 75vw, 360px);
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 2000;
    max-height: 100vh;
    overflow-y: auto;
  }

  .sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: -24px;
    width: 24px;
    height: 100%;
    background: linear-gradient(90deg, rgba(5, 11, 28, 0.9), transparent);
    pointer-events: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Add backdrop when sidebar is open */
  .sidebar.open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.7);
    z-index: -1;
    backdrop-filter: blur(4px);
  }

  .workspace {
    margin-left: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
    display: block;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Add hamburger menu button */
  .mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1999;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(7, 16, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-soft);
  }

  .mobile-menu-toggle:hover {
    background: rgba(7, 16, 36, 1);
  }
}

@media (max-width: 960px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .children-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px 12px;
    gap: 18px;
  }

  .workspace {
    padding: 18px 16px;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .workspace-header h1 {
    font-size: 1.3rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .input {
    width: 100%;
    min-width: 0;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .actions > * {
    width: 100%;
  }

  .actions .btn,
  .actions .btn-primary,
  .actions .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    min-height: 44px; /* Better touch target */
  }

  .sidebar {
    width: clamp(260px, 85vw, 320px);
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .billing-stats {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Make tables scroll horizontally */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
    font-size: 0.85rem;
  }

  .table thead th,
  .table tbody td {
    padding: 10px 6px;
  }

  /* Card improvements */
  .card {
    padding: 16px;
  }

  .section {
    padding: 16px;
  }

  .modal-panel {
    width: 95vw;
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .inline-actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 10px;
  }

  .inline-actions > * {
    flex: 1 1 100%;
    text-align: center;
  }

  .inline-actions .muted {
    order: 3;
    text-align: left;
  }

  .tab-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  .tab-button {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .charge-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .charge-row input {
    width: 100%;
    font-size: 16px; /* Prevent zoom */
  }

  .workspace-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }

  .sidebar::after {
    display: none;
  }

  .toast-host {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .toast {
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
  }

  .product-mark {
    gap: 10px;
  }

  .product-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .product-name {
    font-size: 0.95rem;
  }

  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    min-height: 44px;
    font-size: 15px;
  }

  .card-title {
    font-size: 1rem;
  }

  .section-title-large {
    font-size: 1rem;
  }
}

/* Landscape phone optimization */
@media (max-width: 896px) and (orientation: landscape) {
  .app-shell {
    padding: 12px;
  }

  .sidebar {
    width: clamp(240px, 60vw, 280px);
  }

  .workspace {
    padding: 16px;
  }
}

/* Ensure inputs don't cause zoom on mobile */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Better touch targets for all interactive elements */
  button,
  a.btn,
  .btn-icon,
  .toggle-password,
  .school-tile,
  .sidebar-link {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .mobile-menu-toggle,
  .actions,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    display: none !important;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .workspace {
    box-shadow: none;
    border: none;
  }
}

.full-width {
  width: 100%;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-footer button {
  width: 100%;
}