:root {
  --ink: #1b2535;
  --muted: #657184;
  --line: #d9e1eb;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --nav: #182130;
  --green: #2f7d5b;
  --amber: #b36a00;
  --red: #b42318;
  --blue: #315c9b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.sidebar {
  min-height: 100vh;
  background: var(--nav);
  color: #fff;
  padding: 22px 14px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 0 8px;
}

.brand span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef6f1;
  color: var(--nav);
  font-weight: 850;
}

.nav {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 0 12px;
  text-align: left;
  background: transparent;
  color: #c9d2de;
  cursor: pointer;
  font: inherit;
}

.nav.active,
.nav:hover {
  background: #2a3547;
  color: #fff;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  letter-spacing: 0;
}

.filters {
  display: flex;
  gap: 10px;
}

select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

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

.metrics article {
  padding: 18px;
}

.metrics span,
.card span,
.queue span,
.alerts span,
.exception-grid span,
small {
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
}

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

.grid.two {
  grid-template-columns: 1.2fr 1fr;
}

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

.panel {
  padding: 18px;
  overflow: hidden;
}

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

.panel-head h2,
.panel h2 {
  margin-bottom: 0;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tag.green,
.status.ok {
  background: #e9f5ef;
  color: var(--green);
}

.tag.amber,
.status.warn {
  background: #fff4df;
  color: var(--amber);
}

.tag.blue {
  background: #eaf0f8;
  color: var(--blue);
}

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

.bars {
  display: grid;
  gap: 12px;
}

.bars div {
  display: grid;
  grid-template-columns: 42px 1fr 64px;
  gap: 12px;
  align-items: center;
}

.bars b {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) var(--v), #e7edf4 var(--v));
}

.bars strong {
  text-align: right;
}

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

.alerts li,
.queue li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.lane {
  min-height: 520px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.lane h2 {
  margin: 0 0 12px;
}

.card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 16px;
}

.card.danger {
  border-left: 5px solid var(--red);
}

.flow-panel {
  margin-bottom: 18px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(9, minmax(120px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.node {
  min-height: 74px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
  padding: 10px;
}

.node.done {
  background: #e9f5ef;
  border-color: #abd6c2;
}

.node.active {
  background: #eaf0f8;
  border-color: #b7c8e2;
}

.node.risk {
  background: #fff4df;
  border-color: #e8c57e;
}

.exception-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.exception-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

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

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

  .metrics,
  .grid.two,
  .grid.three,
  .kanban,
  .exception-grid {
    grid-template-columns: 1fr;
  }

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

  .app {
    padding: 18px;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
