:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #66736f;
  --line: #d8e0dc;
  --panel: #ffffff;
  --bg: #eef4f0;
  --green: #0f766e;
  --amber: #c47f10;
  --red: #c7334a;
  --blue: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

button.quiet {
  background: #fff;
  color: var(--ink);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 18px;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.grid,
.dashboard {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  padding: 14px;
}

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

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.dashboard {
  grid-template-columns: 1.3fr 0.8fr;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.wide {
  grid-column: 1 / -1;
}

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

.pill {
  border-radius: 999px;
  background: #e8f1ee;
  color: #27514b;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  text-transform: uppercase;
}

.map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 33, 31, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(23, 33, 31, 0.08) 1px, transparent 1px),
    #dfece4;
  background-size: 44px 44px;
}

.map::before,
.map::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  border: 2px solid rgba(15, 118, 110, 0.45);
  border-radius: 6px;
}

.map::before {
  top: 8%;
  bottom: 50%;
}

.map::after {
  top: 50%;
  bottom: 8%;
}

.marker {
  position: absolute;
  z-index: 1;
  width: 38px;
  height: 38px;
  min-height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 0;
}

.marker.normal {
  background: var(--green);
}

.marker.warning {
  background: var(--amber);
}

.marker.critical,
.marker.offline {
  background: var(--red);
}

.marker span {
  display: grid;
  place-items: center;
  font-size: 13px;
}

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

.alert {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--amber);
  background: #fff8eb;
  padding: 12px;
}

.alert.critical {
  border-color: var(--red);
  background: #fff1f3;
}

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

canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
}

ul {
  margin: 0;
  padding-left: 20px;
}

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

.roi div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

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

.report div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

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

pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  border-radius: 8px;
  background: #101918;
  color: #e8f1ee;
  padding: 16px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  h1 {
    font-size: 28px;
  }

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