:root {
  --bg: #f6f4ef;
  --ink: #1d2428;
  --muted: #687176;
  --line: #ddd7cc;
  --panel: #ffffff;
  --accent: #c78522;
  --accent-dark: #875817;
  --ok: #2f7d52;
  --warn: #b66028;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

main {
  margin: 0 auto;
  max-width: 1120px;
  padding: 32px 20px 64px;
}

.topbar {
  align-items: center;
  background: #1f2a2f;
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: white;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.topbar a,
.topbar button {
  color: white;
}

.topbar button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.topbar a:not(.brand),
.topbar button {
  border-radius: 8px;
  padding: 8px 10px;
}

.topbar a:not(.brand):hover,
.topbar button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  min-height: calc(100vh - 140px);
}

.hero h1,
.page-head h1,
.panel h1 {
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
  margin: 8px 0 18px;
}

.hero p,
.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.hero-panel,
.panel,
.card,
.empty,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(29, 36, 40, 0.06);
}

.hero-panel {
  padding: 28px;
}

.hero-panel span,
.metric span,
.status {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hero-panel strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.actions,
.page-head {
  align-items: center;
  display: flex;
  gap: 14px;
}

.compact-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 520px;
}

.page-head {
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-head .lead {
  margin: 8px 0 0;
  max-width: 720px;
}

.button {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b1307;
}

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

.action-grid,
.workbench-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 24px;
}

.action-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  min-height: 150px;
  padding: 18px;
}

.action-tile:hover {
  border-color: var(--accent);
}

.action-tile span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.action-tile strong {
  font-size: 20px;
}

.action-tile p {
  color: var(--muted);
  margin: 0;
}

.primary-tile {
  background: #fff8e8;
  border-color: #e7c06e;
}

.card,
.empty,
.panel {
  padding: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.card h2 {
  margin-bottom: 8px;
}

.card dl {
  margin-top: auto;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

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

.section-title h2 {
  margin-top: 0;
}

.section-title p {
  color: var(--muted);
  margin: 6px 0 0;
}

.narrow {
  margin: 48px auto;
  max-width: 460px;
}

.summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 24px;
}

.decision-band {
  align-items: center;
  background: #1f2a2f;
  border-radius: 8px;
  color: white;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 20px;
}

.decision-band span {
  color: #f0c36a;
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.decision-band strong {
  display: block;
  font-size: 24px;
}

.decision-band p {
  color: #d7dee2;
  margin: 4px 0 0;
}

.metric strong {
  display: block;
  font-size: 24px;
}

dl {
  display: grid;
  gap: 8px;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

dd {
  margin: 0;
}

.form {
  display: grid;
  gap: 16px;
}

.form p {
  display: grid;
  gap: 6px;
  margin: 0;
}

label {
  font-weight: 800;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 110px;
}

.risk,
.answer,
.lesson-row,
.queue-item {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 0;
}

.queue-item > div {
  min-width: 0;
}

.queue-item p {
  color: var(--muted);
  margin: 4px 0;
}

.risk {
  display: block;
}

.answer {
  display: block;
}

.lesson-row {
  align-items: center;
}

.lesson-row p {
  color: var(--muted);
  margin: 4px 0 0;
}

.done {
  color: var(--ok);
  font-weight: 800;
}

.checklist-item {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 18px 0;
}

.critical {
  background: #ffe8d4;
  border-radius: 8px;
  color: var(--warn);
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  margin-left: 8px;
  padding: 4px 8px;
  text-transform: uppercase;
}

.seal,
.seal-card strong {
  color: var(--ok);
  font-weight: 900;
}

.alert-green {
  color: var(--ok);
  font-weight: 900;
}

.alert-yellow {
  color: #9a6b00;
  font-weight: 900;
}

.alert-red {
  color: #b42318;
  font-weight: 900;
}

.report-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .no-print,
  .button {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .panel,
  .metric {
    box-shadow: none;
    break-inside: avoid;
  }
}

.risk span {
  color: var(--warn);
  display: block;
  font-weight: 800;
  margin: 6px 0;
}

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

.steps span {
  background: #f4efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  padding: 14px;
}

.notice {
  background: #f4efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 18px 0;
  padding: 16px;
}

.notice p {
  margin-bottom: 0;
}

.stacked-form {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

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

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}

.filter-chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 12px;
}

.filter-chip.active,
.filter-chip:hover {
  background: #1f2a2f;
  border-color: #1f2a2f;
  color: white;
}

.progress-block {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

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

.progress-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  background: #ece5d8;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

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

.lesson-preview {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.lesson-preview span {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  padding-top: 8px;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  background: #fff8e8;
  border: 1px solid #ecd6a6;
  border-radius: 8px;
  color: #63430a;
  font-weight: 700;
  margin: 0;
  padding: 12px 14px;
}

.message.error {
  background: #fff1f0;
  border-color: #ffc9c4;
  color: #8f1d15;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .topbar,
  .page-head,
  .actions,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .queue-item,
  .lesson-row,
  .report-head,
  .decision-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
