:root {
  --ink: #15191f;
  --muted: #68717f;
  --line: #d9dee7;
  --panel: #ffffff;
  --page: #f3f6f8;
  --gold: #d6aa37;
  --blue: #234a62;
  --teal: #0c7c79;
  --red: #c3423f;
  --green: #168255;
}

* {
  box-sizing: border-box;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 24px 18px;
  background: #101820;
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand.large {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 0.86rem;
  letter-spacing: 0;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

nav a {
  color: #dbe7ef;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.account-card {
  margin-top: 22px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.account-card small,
.account-card strong,
.account-card span {
  display: block;
}

.account-card small {
  color: #aebdc9;
}

.account-card strong {
  margin-top: 4px;
  color: white;
}

.account-card span {
  width: fit-content;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(214, 170, 55, 0.18);
  color: #f1cf72;
  font-size: 0.72rem;
  font-weight: 800;
}

.sidebar-action {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 24px;
}

.sidebar-action a {
  color: #f1cf72;
  font-weight: 800;
  text-decoration: none;
}

.main {
  margin-left: 248px;
  padding: 34px;
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: white;
  border: 1px solid var(--line);
  padding: 28px;
  border-radius: 8px;
}

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

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

h1 {
  font-size: 2rem;
  margin-bottom: 0;
}

h2 {
  font-size: 1.1rem;
}

.eyebrow {
  color: var(--teal);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.run-state {
  border: 1px solid var(--line);
  background: white;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--muted);
}

.metric-grid,
.chart-grid,
.service-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.metric-grid span,
.service span,
small {
  color: var(--muted);
}

.metric-grid strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

.metric-grid article small {
  display: block;
  margin-top: 6px;
}

.delta-card.good {
  border-color: rgba(22, 130, 85, 0.45);
  background: #effaf5;
}

.delta-card.bad {
  border-color: rgba(195, 66, 63, 0.45);
  background: #fff2f1;
}

.chart-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  margin-bottom: 16px;
}

.service-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.service {
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.service strong,
.service small {
  display: block;
  margin-top: 6px;
}

.service.ok {
  border-left-color: var(--green);
}

.service.bad {
  border-left-color: var(--red);
}

.service.skip {
  border-left-color: var(--gold);
}

form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  margin-bottom: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: white;
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 15px;
  background: var(--gold);
  color: #111;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

.table-form {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.compact-table {
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.incident {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.incident:last-child {
  border-bottom: 0;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  background: #111820;
  color: #e9f2f8;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
}

.ok-text summary {
  color: var(--green);
}

.bad-text summary {
  color: var(--red);
}

td.ok-text,
.ok-text:not(details) {
  color: var(--green);
  font-weight: 800;
}

td.bad-text,
.bad-text:not(details) {
  color: var(--red);
  font-weight: 800;
}

td.neutral-text,
.neutral-text {
  color: var(--muted);
  font-weight: 800;
}

.notice.bad {
  color: var(--red);
}

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

h3 {
  font-size: 0.95rem;
  margin: 18px 0 8px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  word-break: break-word;
}

.perf-list {
  display: grid;
  gap: 8px;
}

.perf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 210px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.perf-row:last-child {
  border-bottom: 0;
}

.inline-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.inline-filter label {
  margin: 0;
  min-width: 96px;
}

.wide-filter {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 760px;
}

.wide-filter label {
  min-width: 130px;
}

.wide-filter label:nth-of-type(2) {
  min-width: 260px;
}

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap {
  min-width: 1250px;
}

.heatmap td,
.heatmap th {
  text-align: center;
  min-width: 44px;
}

.heatmap td:first-child,
.heatmap th:first-child {
  min-width: 260px;
  text-align: left;
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
}

.heatmap td {
  font-size: 0.78rem;
  font-weight: 700;
}

.heatmap .empty {
  background: #f1f4f7;
}

.heatmap .fast {
  background: #d9f0e6;
  color: #0f6240;
}

.heatmap .medium {
  background: #fff0bf;
  color: #6d5300;
}

.heatmap .slow {
  background: #ffd9c8;
  color: #8a3219;
}

.heatmap .hot {
  background: #f4b8ba;
  color: #7f1d1d;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .sidebar-action {
    position: static;
    margin-top: 20px;
  }

  .main {
    margin-left: 0;
    padding: 22px;
  }

  .metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .perf-row {
    grid-template-columns: 1fr;
  }
}
