:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-soft: #ebe7df;
  --ink: #1f2428;
  --muted: #667078;
  --line: #d9d3c8;
  --accent: #1f6f68;
  --accent-dark: #154f4a;
  --warning: #a65f00;
  --danger: #a23b3b;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(31, 36, 40, 0.08);
  font-family: Inter, 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;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: #20292d;
  color: #f7f4ed;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: #f4c86b;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: rgba(247, 244, 237, 0.68);
  font-size: 13px;
}

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

.nav-link {
  color: rgba(247, 244, 237, 0.78);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: var(--radius);
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(247, 244, 237, 0.68);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 30px;
}

.topbar,
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  margin-bottom: 28px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

.section-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions,
.dialog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.button {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-dark);
}

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

.button-secondary:hover {
  background: #ded8cc;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metric-grid,
.panel-grid,
.list-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 20px 0 18px;
}

.panel-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.metric,
.panel,
.item-card,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
}

.panel {
  padding: 18px;
}

.pipeline-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 32px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.section-header + .list-grid,
.section-header + .table-wrap,
.section-header + .panel {
  margin-top: 18px;
}

.list-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.item-card {
  padding: 16px;
}

.item-card h3 {
  margin-bottom: 8px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag-accent {
  background: rgba(31, 111, 104, 0.12);
  color: var(--accent-dark);
}

.tag-warning {
  background: rgba(166, 95, 0, 0.12);
  color: var(--warning);
}

.tag-danger {
  background: rgba(162, 59, 59, 0.12);
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.score {
  font-weight: 800;
  color: var(--accent-dark);
}

.report-preview ol {
  margin-bottom: 0;
  padding-left: 20px;
  line-height: 1.7;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
}

dialog::backdrop {
  background: rgba(31, 36, 40, 0.38);
}

.dialog-card {
  padding: 18px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dialog-fields {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

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

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

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

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .main {
    padding: 20px;
  }

  .metric-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-header {
    display: grid;
  }
}

@media (max-width: 520px) {
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 28px;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

