:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #0e1726;
  --muted: #617089;
  --line: #d7e0ec;
  --blue: #1557b7;
  --blue-2: #e5efff;
  --green: #087c55;
  --green-2: #ddf7ea;
  --amber: #a86405;
  --amber-2: #fff2cf;
  --red: #b3261e;
  --red-2: #ffe3e1;
  --purple: #6545a4;
  --purple-2: #eee8ff;
  --shadow: 0 14px 34px rgba(15, 39, 68, 0.08);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

.topbar {
  align-items: center;
  background: #0f2744;
  color: #fff;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 44px);
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
  margin: 2px 0 0;
}

.eyebrow {
  color: #a9d0ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

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

.segmented {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  display: flex;
  padding: 3px;
}

.segmented button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #dbeafe;
  font-weight: 800;
  padding: 9px 13px;
}

.segmented button.is-active {
  background: #fff;
  color: #0f2744;
}

.ghost-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  padding: 10px 13px;
}

.demo-banner {
  background: #fff7df;
  border-bottom: 1px solid #f1d182;
  color: #684100;
  font-size: 13px;
  font-weight: 750;
  padding: 10px clamp(18px, 4vw, 44px);
}

.app-main {
  padding: 22px clamp(16px, 4vw, 44px) 48px;
}

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

.sidebar,
.section,
.panel,
.metric,
.student-phone {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  align-self: start;
  padding: 14px;
  position: sticky;
  top: 16px;
}

.nav-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 850;
  gap: 8px;
  justify-content: space-between;
  padding: 11px 12px;
  text-align: left;
  width: 100%;
}

.nav-button.is-active {
  background: var(--blue-2);
  color: var(--blue);
}

.content-stack {
  display: grid;
  gap: 18px;
}

.section {
  padding: 18px;
}

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

.section-header h2,
.panel h3 {
  margin: 0;
}

.section-header p,
.panel p {
  color: var(--muted);
  margin: 4px 0 0;
}

.metrics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.metric {
  min-height: 96px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  margin-top: 8px;
}

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

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

.panel {
  padding: 16px;
}

.stack {
  display: grid;
  gap: 10px;
}

.row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 1.25fr 0.72fr 0.58fr 0.72fr 0.58fr 0.58fr 1fr;
  min-height: 52px;
  padding: 10px 0;
}

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

.queue-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
  padding: 11px;
}

.label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.badge {
  align-items: center;
  background: var(--blue-2);
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  min-height: 24px;
  padding: 4px 9px;
}

.badge.green {
  background: var(--green-2);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-2);
  color: var(--amber);
}

.badge.red {
  background: var(--red-2);
  color: var(--red);
}

.badge.purple {
  background: var(--purple-2);
  color: var(--purple);
}

.button {
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  min-height: 40px;
  padding: 10px 13px;
}

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

.button.green {
  background: var(--green);
}

.button.red {
  background: var(--red);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

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

.action-cell {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
}

.student-phone {
  margin: 0 auto;
  max-width: 430px;
  min-height: 760px;
  overflow: hidden;
  padding: 16px;
  width: 100%;
}

.phone-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.phone-top h2 {
  margin: 0;
}

.phone-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 14px;
}

.phone-card.alert {
  background: var(--red-2);
  border-color: #f4aaa5;
  color: var(--red);
}

.progress {
  background: var(--surface-2);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.progress span {
  background: var(--green);
  display: block;
  height: 100%;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.suggestion {
  background: var(--amber-2);
  border: 1px solid #f1d182;
  border-radius: 8px;
  color: #684100;
  padding: 12px;
}

.fine-print {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  background: #0f2744;
  border-radius: 8px;
  bottom: 18px;
  color: #fff;
  font-weight: 850;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 20px);
  transition: 180ms ease;
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .layout,
  .student-shell,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

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

  .section-header {
    display: grid;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: stretch;
    display: grid;
  }

  .topbar-actions {
    justify-content: start;
  }

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

  .app-main {
    padding-inline: 12px;
  }
}
