:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #101316;
  --surface-2: #151a1f;
  --surface-3: #1b2228;
  --line: #2a3036;
  --line-soft: rgba(168, 179, 191, 0.14);
  --text: #edf2f7;
  --muted: #9aa7b5;
  --accent: #5eead4;
  --cyan: #67e8f9;
  --warning: #fbbf24;
  --critical: #fb7185;
  --ok: #34d399;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.ops-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.side-dashboard {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 48px);
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.side-dashboard__brand {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.side-dashboard__brand span,
.eyebrow,
.score-card span,
.side-metric span,
.refresh-stamp span,
.signal,
.probe-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-dashboard__brand span,
.eyebrow {
  color: var(--accent);
}

.side-dashboard__brand strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
}

.side-metrics {
  display: grid;
  gap: 8px;
}

.side-metric {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: #0c0f12;
  text-decoration: none;
}

.side-metric strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
}

.side-metric small {
  color: var(--muted);
  font-size: 0.78rem;
}

.side-metric--ok {
  border-left-color: var(--ok);
}

.side-metric--warning {
  border-left-color: var(--warning);
}

.side-metric--critical {
  border-left-color: var(--critical);
}

.side-metric--muted {
  border-left-color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.side-nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #c9d3df;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a:focus-visible,
.side-metric:hover,
.side-metric:focus-visible {
  color: var(--text);
  background: var(--surface-3);
  outline: 0;
}

.ops-content {
  min-width: 0;
}

#overview,
#infrastructure,
.service-card {
  scroll-margin-top: 24px;
}

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

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.1;
}

h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 8px;
}

.summary {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.refresh-stamp {
  min-width: 172px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: right;
}

.refresh-stamp strong {
  display: block;
  margin-top: 4px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
  margin: 18px 0 26px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.score-card {
  min-height: 146px;
  padding: 17px;
  border-right: 1px solid var(--line-soft);
}

.score-card:last-child {
  border-right: 0;
}

.score-card strong {
  display: block;
  margin: 20px 0 6px;
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1;
}

.score-card small,
.readiness-item p,
.service-card__header p,
.check-row p {
  color: var(--muted);
}

.score-card--ok {
  box-shadow: inset 0 3px 0 var(--ok);
}

.score-card--warning {
  box-shadow: inset 0 3px 0 var(--warning);
}

.score-card--critical {
  box-shadow: inset 0 3px 0 var(--critical);
}

.score-card--muted {
  box-shadow: inset 0 3px 0 #64748b;
}

.readiness-panel,
.data-panel,
.service-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.readiness-panel {
  padding: 17px;
}

.readiness-list {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.readiness-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0c0f12;
}

.readiness-item p {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.section-header {
  margin: 32px 0 13px;
}

.data-panel {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.data-table tbody th {
  font-weight: 750;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table--thresholds td:nth-child(2) {
  color: var(--warning);
}

.data-table--thresholds td:nth-child(3) {
  color: var(--critical);
}

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

.service-card {
  overflow: hidden;
}

.service-card__header {
  min-height: 126px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.service-card__header p:last-child {
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.check-list {
  display: grid;
}

.check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

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

.check-row p {
  margin: 5px 0 0;
  font-size: 0.86rem;
}

.check-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: min(270px, 36vw);
}

.signal {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-transform: none;
}

.probe-label {
  color: var(--cyan);
  font-size: 0.68rem;
}

.probe-value {
  display: block;
  max-width: min(310px, 40vw);
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: #d7f3ff;
  background: #0c0f12;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status--ok {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.1);
}

.status--warning {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
}

.status--critical {
  color: var(--critical);
  background: rgba(251, 113, 133, 0.1);
}

.status--muted {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
}

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

@media (max-width: 980px) {
  .ops-layout,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .side-dashboard {
    position: static;
    max-height: none;
  }

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

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

  .page-header {
    display: block;
  }

  .refresh-stamp {
    width: fit-content;
    margin-top: 16px;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 24px, 1360px);
    padding: 22px 0 38px;
  }

  .side-dashboard,
  .readiness-panel,
  .service-card,
  .data-panel {
    border-radius: 8px;
  }

  .side-metrics,
  .side-nav,
  .scoreboard,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .score-card {
    min-height: 112px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .score-card:last-child {
    border-bottom: 0;
  }

  .readiness-item,
  .check-row {
    grid-template-columns: 1fr;
  }

  .check-meta {
    justify-items: start;
    min-width: 0;
  }

  .probe-value {
    max-width: 100%;
  }

  .service-card__header {
    min-height: auto;
  }

  .data-table th,
  .data-table td {
    padding: 12px 13px;
  }
}
