:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #d7dde8;
  --text: #172033;
  --muted: #6a7385;
  --green: #168a54;
  --red: #c2413a;
  --blue: #2563eb;
  --amber: #a35f00;
  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(--text);
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 750;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  min-width: 84px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.ok {
  color: var(--green);
  border-color: #b9dec8;
  background: #ecf8f0;
}

.status-pill.error {
  color: var(--red);
  border-color: #f0b9b4;
  background: #fff0ef;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px 24px 32px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.metric {
  min-height: 82px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.metric strong {
  font-size: 22px;
  line-height: 1.1;
}

.charts,
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.panel-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.chart-wrap {
  height: 300px;
  padding: 12px;
}

.table-wrap {
  max-height: 420px;
  overflow: auto;
}

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

th,
td {
  height: 38px;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--surface-2);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.positive {
  color: var(--green);
  font-weight: 700;
}

.negative {
  color: var(--red);
  font-weight: 700;
}

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

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

  .charts,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  main {
    padding: 14px;
  }

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