:root {
  --bg: #f4f1ea;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --ink: #19201f;
  --muted: #66706c;
  --line: #d7d1c5;
  --green: #237d5a;
  --amber: #a0661f;
  --blue: #285f8f;
  --brick: #93443c;
  --shadow: 0 18px 50px rgba(31, 37, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(35, 125, 90, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(40, 95, 143, 0.06) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.84);
  backdrop-filter: blur(16px);
}

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

.brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

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

.brand strong {
  font-size: 17px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

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

.nav-tab {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav-tab:hover,
.nav-tab:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  outline: none;
}

.nav-tab.active {
  background: #e6efe8;
  border-color: #c0d9c9;
  color: #12392b;
  font-weight: 700;
}

.side-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.panel-label,
.eyebrow,
.metrics span,
.node-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.side-panel strong {
  display: block;
  margin-top: 8px;
}

.side-panel p,
.section-head p,
.panel-note {
  color: var(--muted);
  line-height: 1.55;
}

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

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

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

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(320px, 100%);
  padding: 12px;
  border: 1px solid #b8d6c2;
  border-radius: 8px;
  background: #eff8f1;
}

.status-block strong,
.status-block span {
  display: block;
}

.status-block span:not(.status-dot) {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(35, 125, 90, 0.12);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics article {
  min-height: 116px;
  padding: 16px;
}

.metrics strong {
  display: block;
  margin-top: 18px;
  font-size: 20px;
  line-height: 1.18;
}

.metrics small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
}

.section-head p {
  max-width: 460px;
  margin-bottom: 0;
  text-align: right;
}

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

.panel {
  min-height: 220px;
  padding: 16px;
}

.span-2 {
  grid-column: span 2;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.good {
  background: #e4f2e9;
  color: #15553d;
}

.badge.warn {
  background: #faecd7;
  color: #764713;
}

.badge.neutral {
  background: #e7eef4;
  color: #234f77;
}

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

.flow div {
  min-height: 126px;
  padding: 14px;
  border: 1px solid #d8e3dc;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(35, 125, 90, 0.09), transparent),
    #fbfdfb;
}

.flow strong {
  display: block;
  margin-top: 38px;
  line-height: 1.2;
}

.task-list,
.gate-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-list li,
.gate-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #2f3936;
}

.task-list span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brick);
  flex: 0 0 auto;
}

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

.compact-list p,
.release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin: 0;
  border-bottom: 1px solid #ece7dd;
}

.compact-list p:last-child {
  border-bottom: 0;
}

.compact-list span,
.release-row em,
.timeline em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.meter {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #eee8dd;
  overflow: hidden;
}

.meter span {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  background: linear-gradient(90deg, var(--brick), var(--amber), var(--green));
}

.stacked-bars {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  height: 100px;
  margin-bottom: 14px;
}

.bar {
  display: block;
  border-radius: 6px 6px 0 0;
}

.bar.one {
  height: 54%;
  background: var(--blue);
}

.bar.two {
  height: 78%;
  background: var(--green);
}

.bar.three {
  height: 42%;
  background: var(--amber);
}

.bar.four {
  height: 92%;
  background: var(--brick);
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(120px, 180px);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid #ece7dd;
}

.timeline span,
.release-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 6px;
  background: #edf4ef;
  color: #174934;
  font-size: 12px;
  font-weight: 800;
}

.large-number {
  margin: 24px 0 2px;
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
}

.donut {
  display: grid;
  place-items: center;
  width: min(170px, 100%);
  aspect-ratio: 1;
  margin: 16px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 54%, transparent 55%),
    conic-gradient(var(--green) 0 100%);
}

.donut span {
  font-size: 30px;
  font-weight: 900;
}

.release-row {
  min-height: 54px;
}

.release-row strong {
  margin-right: auto;
}

.gate-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--green);
  flex: 0 0 auto;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    overflow-x: auto;
  }

  .nav-tabs {
    grid-auto-flow: column;
    grid-auto-columns: minmax(96px, 1fr);
    margin-left: auto;
  }

  .nav-tab {
    text-align: center;
  }

  .side-panel {
    display: none;
  }

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head p {
    text-align: left;
  }

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

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

@media (max-width: 680px) {
  .sidebar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    overflow-x: visible;
  }

  .nav-tabs {
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-left: 0;
  }

  .main {
    padding: 18px 12px 28px;
  }

  .brand div {
    min-width: 132px;
  }

  h1 {
    font-size: 34px;
  }

  .metrics,
  .grid,
  .flow {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .timeline li {
    grid-template-columns: 40px 1fr;
  }

  .timeline em {
    grid-column: 2;
  }

  .panel {
    min-height: auto;
  }
}
