:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #68747d;
  --line: #d8e1e5;
  --paper: #f7faf9;
  --panel: #ffffff;
  --blue: #245c8f;
  --teal: #0f766e;
  --green: #2e7d32;
  --red: #b3261e;
  --gold: #a36300;
  --shadow: 0 18px 50px rgba(36, 61, 75, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 49, 62, 0.88);
}

.student-login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
  margin-bottom: 4px;
}

.student-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #43515a;
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #14313e;
  color: #f7fbfb;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3b34c;
  color: #14313e;
  font-weight: 900;
  font-size: 1.45rem;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.1rem;
}

.brand p {
  color: #b9cbd2;
  font-size: 0.86rem;
  margin-top: 3px;
}

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

.nav-button {
  border: 0;
  background: transparent;
  color: #dce8eb;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 12px;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.metric-label,
.eyebrow,
.stat-card span,
.panel-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

.sidebar-panel .metric-label {
  color: #b9cbd2;
}

.readiness-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 12px;
}

.readiness-row strong {
  font-size: 2rem;
}

.readiness-row span {
  color: #dce8eb;
  font-size: 0.88rem;
}

.progress-track {
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: #67d7c4;
}

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

.topbar {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.topbar h2 {
  font-size: 2rem;
}

.topbar-actions,
.quick-actions,
.runner-actions,
.bank-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.solid-button,
.ghost-button {
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  font-weight: 750;
}

.solid-button {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.ghost-button {
  background: #ffffff;
  color: var(--ink);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

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

.stat-card,
.panel,
.question-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.panel {
  padding: 20px;
}

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

.panel-heading h3 {
  font-size: 1.1rem;
}

.domain-bars {
  display: grid;
  gap: 14px;
}

.domain-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr 52px;
  gap: 12px;
  align-items: center;
}

.domain-track {
  height: 12px;
  border-radius: 99px;
  background: #e7eef1;
  overflow: hidden;
}

.domain-fill {
  display: block;
  height: 100%;
  background: var(--teal);
}

.recommendation {
  font-size: 1.04rem;
  line-height: 1.6;
  color: #39464d;
  margin: 8px 0 22px;
}

.session-config {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  margin: 18px 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #43515a;
  font-weight: 750;
  font-size: 0.9rem;
}

.checkbox-label {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

input[type="checkbox"] {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.runner.empty-state,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  border: 1px dashed #b9c9d0;
  border-radius: 8px;
  color: #60717a;
  background: rgba(255, 255, 255, 0.72);
}

.question-card {
  padding: 22px;
}

.question-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  background: #e6f2f0;
  color: #0f645e;
  font-size: 0.82rem;
  font-weight: 800;
}

.flag-button {
  border: 1px solid var(--line);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--gold);
  font-size: 1.35rem;
}

.flag-button.flagged {
  background: #fff4dc;
  border-color: #ebbd6f;
}

.question-text {
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 18px 0;
}

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

.choice-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  min-height: 54px;
  padding: 12px 14px;
  text-align: left;
  line-height: 1.35;
}

.choice-button:hover {
  border-color: var(--blue);
}

.choice-button.selected {
  border-color: var(--blue);
  background: #edf5fb;
}

.choice-button.correct {
  border-color: #65a86b;
  background: #eef8ef;
}

.choice-button.incorrect {
  border-color: #d57c76;
  background: #fff0ef;
}

.feedback {
  min-height: 0;
  margin: 16px 0 0;
  color: #3f4c53;
  line-height: 1.5;
}

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

.runner-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.review-list,
.bank-list {
  display: grid;
  gap: 12px;
}

.review-item,
.bank-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.student-account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.review-item h4,
.bank-item h4 {
  margin: 8px 0;
  font-size: 1rem;
}

.review-item p,
.bank-item p {
  margin: 6px 0;
  color: #4b5961;
  line-height: 1.45;
}

.bank-tools {
  margin-bottom: 16px;
}

.question-form,
.json-import-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  margin-bottom: 18px;
}

.admin-login,
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  margin-bottom: 18px;
}

.admin-login h4,
.admin-login p {
  margin: 0;
}

.admin-login h4 {
  font-size: 1rem;
}

.admin-login p,
.login-message {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.login-message {
  min-width: 130px;
}

.admin-toolbar span {
  font-weight: 800;
  color: var(--teal);
}

.hidden {
  display: none;
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.bank-tools input {
  flex: 1 1 260px;
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .sidebar-panel {
    margin-top: 0;
  }

  .workspace {
    padding: 18px;
  }

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

@media (max-width: 680px) {
  .topbar,
  .panel-heading,
  .domain-bar-row,
  .admin-login {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

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

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

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }
}
