:root {
  --ink: #0f1f1c;
  --paper: #f8f9fa;
  --rose: #c9ada7;
  --cedar: #4a7c59;
  --mint: #e6efe7;
  --amber: #e8c66f;
  --line: rgba(15, 31, 28, 0.14);
  --muted: rgba(15, 31, 28, 0.68);
  --shadow: 0 18px 44px rgba(15, 31, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(15, 31, 28, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 31, 28, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px;
  background: var(--ink);
  color: var(--paper);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
}

.brand img {
  width: 44px;
  height: 44px;
}

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

.nav-button {
  min-height: 42px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 10px 12px;
  background: transparent;
  color: rgba(248, 249, 250, 0.72);
  text-align: left;
  letter-spacing: 0;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-button:hover,
.nav-button.is-active {
  border-color: var(--rose);
  background: rgba(248, 249, 250, 0.08);
  color: var(--paper);
}

.rail-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(248, 249, 250, 0.72);
  line-height: 1.45;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cedar);
  box-shadow: 0 0 0 5px rgba(74, 124, 89, 0.2);
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 520px);
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(32px, 4vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

h3 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.12;
}

.searchbar {
  display: grid;
  gap: 8px;
}

.searchbar label,
.metric-label,
.muted,
dt {
  color: var(--muted);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
}

input,
select {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 22px;
}

.metric {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: rgba(248, 249, 250, 0.88);
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.view {
  display: none;
}

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

.split-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.board-column,
.detail-sheet,
.sheet-wide,
.calendar-layout,
.report-layout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 249, 250, 0.82);
  box-shadow: var(--shadow);
}

.board-column,
.detail-sheet,
.sheet-wide,
.calendar-layout,
.report-layout {
  padding: 18px;
}

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

.counter {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--mint);
  color: var(--cedar);
  font-size: 13px;
  font-weight: 800;
}

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

.decision-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.decision-card:hover,
.decision-card.is-selected {
  transform: translateY(-1px);
  border-color: rgba(74, 124, 89, 0.55);
  box-shadow: 0 14px 30px rgba(74, 124, 89, 0.12);
}

.card-button {
  width: 100%;
  border: 0;
  padding: 16px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.card-topline,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-button strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 20px;
  line-height: 1.15;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--mint);
  color: var(--cedar);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.high,
.status.needs_approval {
  background: rgba(232, 198, 111, 0.32);
  color: #7a5a00;
}

.status.reported {
  background: rgba(201, 173, 167, 0.42);
  color: #5f403b;
}

.route-line,
.route-wide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}

.route-step {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.route-step.is-done {
  border-color: var(--cedar);
  background: var(--cedar);
  color: var(--paper);
}

.detail-sheet {
  position: sticky;
  top: 28px;
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.quality-pill {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 21px;
  font-weight: 800;
}

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

.fact-grid div {
  min-height: 82px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

dt {
  margin-bottom: 4px;
  font-size: 13px;
}

dd {
  margin: 0;
  line-height: 1.45;
}

.vote-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.vote-panel div:not(.vote-bar) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.vote-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 31, 28, 0.1);
}

.vote-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cedar), var(--amber));
  transition: width 220ms ease;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.action-row button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease;
}

.action-row button:hover {
  transform: translateY(-1px);
  background: var(--cedar);
}

.sheet-wide,
.calendar-layout,
.report-layout {
  max-width: 1120px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.calendar-item {
  min-height: 170px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.calendar-item span {
  color: var(--cedar);
  font-weight: 800;
}

.calendar-item strong {
  font-size: 20px;
  line-height: 1.15;
}

.calendar-item p,
.timeline-row p,
.vote-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 18px;
}

.quality-ring {
  width: 210px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--paper) 0 54%, transparent 55%),
    conic-gradient(var(--cedar) calc(var(--value) * 1%), rgba(15, 31, 28, 0.12) 0);
}

.quality-ring span {
  font-size: 38px;
  font-weight: 800;
}

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

.timeline-row {
  border-left: 4px solid var(--rose);
  padding: 4px 0 8px 14px;
}

.timeline-row span {
  color: var(--cedar);
  font-size: 13px;
  font-weight: 800;
}

.timeline-row strong {
  display: block;
  margin: 5px 0;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  line-height: 1.5;
}

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

  .rail {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .nav-button {
    text-align: center;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .rail-note {
    margin-top: 0;
  }

  .topbar,
  .split-grid,
  .report-body {
    grid-template-columns: 1fr;
  }

  .detail-sheet {
    position: static;
  }
}

@media (max-width: 720px) {
  .workspace,
  .rail {
    padding: 16px;
  }

  .rail-nav,
  .metrics,
  .calendar-grid,
  .fact-grid,
  .action-row,
  .search-row {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 78px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.04;
  }

  h2 {
    font-size: 24px;
  }

  .detail-title-row,
  .card-topline,
  .card-footer,
  .vote-panel div:not(.vote-bar) {
    align-items: flex-start;
    flex-direction: column;
  }

  .quality-ring {
    width: min(210px, 100%);
  }
}

