:root {
  --bg: #f4efe7;
  --surface: #fffdf9;
  --surface-strong: #fffaf2;
  --border: #d8cdbb;
  --text: #1f2933;
  --muted: #5d6975;
  --accent: #9a3412;
  --accent-soft: #f4d9c8;
  --success: #2f6d4f;
  --success-soft: #d7ecde;
  --warning: #9a6700;
  --warning-soft: #f8e7b0;
  --danger: #9f1239;
  --danger-soft: #f9d3dc;
  --shadow: 0 14px 30px rgba(31, 41, 51, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(154, 52, 18, 0.12), transparent 28%),
    linear-gradient(180deg, #f9f3ea 0%, #f4efe7 100%);
  color: var(--text);
}

button,
select {
  font: inherit;
}

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

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  background: rgba(255, 253, 249, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar__header {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.selector-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.report-selector {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.report-list {
  display: grid;
  gap: 10px;
}

.report-list__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.report-list__item.is-active {
  border-color: var(--accent);
  background: var(--surface-strong);
}

.report-list__status,
.status-pill,
.subtle-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.report-list__status {
  width: 12px;
  height: 12px;
  margin-top: 4px;
}

.report-list__content {
  display: grid;
  gap: 4px;
}

.report-list__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.hero,
.panel,
.metric {
  background: var(--surface);
  border: 1px solid rgba(216, 205, 187, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px;
}

.hero__summary {
  margin: 10px 0 0;
  max-width: 70ch;
}

.status-pill {
  min-width: 112px;
  padding: 12px 16px;
  align-self: start;
}

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

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

.section-tab {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.82);
  color: var(--muted);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.section-tab:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--text);
}

.section-tab.is-active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric__value {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.panel {
  padding: 24px;
}

.report-tab {
  animation: panel-enter 180ms ease;
}

.panel__header,
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.list li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.score-grid,
.stack {
  display: grid;
  gap: 14px;
}

.score-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 18px;
}

.score-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.score-card__label {
  margin: 0 0 8px;
  color: var(--muted);
}

.score-card__value {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
}

.score-card__note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.badge,
.subtle-pill {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.card__title {
  margin: 0;
  font-size: 1rem;
}

.card__block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.card__block h5 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--accent);
}

.card__text,
.verdict {
  line-height: 1.55;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

.status--green {
  background: var(--success-soft);
  color: var(--success);
}

.status--yellow {
  background: var(--warning-soft);
  color: var(--warning);
}

.status--red {
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .hero,
  .two-column {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero {
    padding: 24px;
  }

  .status-pill {
    justify-self: start;
  }

  .section-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .section-tab {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .panel,
  .hero {
    padding: 18px;
  }
}
