:root {
  --bg: #f5efe6;
  --panel: rgba(255, 250, 243, 0.9);
  --panel-strong: #fffaf3;
  --line: rgba(55, 38, 18, 0.12);
  --text: #2d2216;
  --muted: #6a5844;
  --accent: #b55233;
  --accent-deep: #7d2e18;
  --accent-soft: rgba(181, 82, 51, 0.12);
  --success: #1c7c54;
  --warning: #b07a1d;
  --danger: #a93226;
  --shadow: 0 20px 45px rgba(56, 33, 10, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 133, 94, 0.28), transparent 30%),
    radial-gradient(circle at bottom right, rgba(110, 132, 145, 0.16), transparent 24%),
    linear-gradient(180deg, #f7f1e8 0%, #f2eadf 100%);
  min-height: 100vh;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  background: rgba(255, 248, 239, 0.74);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  box-shadow: var(--shadow);
}

.brand h1,
.hero h2,
.card h3,
.modal h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.nav button {
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav button.active,
.nav button:hover {
  background: var(--accent-soft);
  transform: translateX(4px);
}

.sidebar-card,
.hero,
.card,
.modal,
.stat,
.question-card,
.choice,
.empty-state,
.table-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar-card {
  margin-top: 24px;
  border-radius: 20px;
  padding: 16px;
  color: var(--muted);
}

.main {
  padding: 28px;
}

.hero {
  border-radius: 28px;
  padding: 24px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
}

.session-summary {
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-chip {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.content {
  margin-top: 24px;
  display: grid;
  gap: 20px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.card,
.stat,
.question-card,
.empty-state,
.table-shell {
  border-radius: var(--radius);
  padding: 20px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 6px 0;
}

.muted {
  color: var(--muted);
}

.actions,
.inline-actions,
.choice-list,
.stack {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stack {
  flex-direction: column;
}

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

button,
.button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

button.primary,
.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
}

button.secondary,
.button.secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--line);
}

button.ghost,
.button.ghost {
  background: transparent;
  color: var(--accent-deep);
  border: 1px dashed rgba(125, 46, 24, 0.35);
}

button:hover,
.button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(78, 58, 29, 0.16);
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 14px;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.choice-list {
  flex-direction: column;
}

.choice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
}

.choice.selected {
  border-color: rgba(181, 82, 51, 0.4);
  background: rgba(181, 82, 51, 0.12);
}

.choice.correct {
  border-color: rgba(28, 124, 84, 0.32);
  background: rgba(28, 124, 84, 0.12);
}

.choice.incorrect {
  border-color: rgba(169, 50, 38, 0.25);
  background: rgba(169, 50, 38, 0.1);
}

.choice-key {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.pill.success {
  color: var(--success);
}

.pill.warning {
  color: var(--warning);
}

.pill.danger {
  color: var(--danger);
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.table-shell {
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 28, 12, 0.36);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  width: min(640px, 100%);
  border-radius: 28px;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.toast {
  position: sticky;
  top: 16px;
  z-index: 10;
  margin-top: 16px;
  border-radius: 18px;
  padding: 14px 18px;
  background: rgba(28, 124, 84, 0.92);
  color: white;
  box-shadow: var(--shadow);
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .grid.columns-2,
  .grid.columns-3 {
    grid-template-columns: 1fr;
  }
}
