:root {
  color-scheme: dark;
  --bg: #090c12;
  --panel: #111722;
  --panel-soft: #151d2b;
  --border: #253044;
  --text: #eef3fb;
  --muted: #8d9aae;
  --accent: #5cc8ff;
  --online: #35d07f;
  --auth: #66d9ef;
  --degraded: #f5c451;
  --offline: #ff6262;
  --skipped: #798397;
  --unknown: #9aa4b6;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(92, 200, 255, 0.14), transparent 32rem),
    var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  border: 1px solid rgba(92, 200, 255, 0.45);
  border-radius: 8px;
  background: rgba(92, 200, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.7rem 1rem;
}

button:hover:not(:disabled) {
  background: rgba(92, 200, 255, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

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

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  margin: 0;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.last-updated {
  color: var(--muted);
  font-size: 0.92rem;
}

.summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.76);
  padding: 0.9rem 1rem;
}

.metric strong {
  display: block;
  font-size: 1.6rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: capitalize;
}

.state-panel {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.82);
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  min-height: 180px;
  padding: 2rem;
  text-align: center;
}

.error-panel {
  border-color: rgba(255, 98, 98, 0.55);
  color: #ffd7d7;
  flex-direction: column;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.dashboard {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.86);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: rgba(21, 29, 43, 0.95);
  color: #c7d2e5;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  text-transform: capitalize;
  white-space: nowrap;
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  display: inline-block;
}

.status-online .dot {
  background: var(--online);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.12);
}

.status-auth_required .dot {
  background: var(--auth);
  box-shadow: 0 0 0 4px rgba(102, 217, 239, 0.12);
}

.status-degraded .dot {
  background: var(--degraded);
  box-shadow: 0 0 0 4px rgba(245, 196, 81, 0.12);
}

.status-offline .dot {
  background: var(--offline);
  box-shadow: 0 0 0 4px rgba(255, 98, 98, 0.12);
}

.status-skipped .dot,
.status-unknown .dot {
  background: var(--skipped);
  box-shadow: 0 0 0 4px rgba(121, 131, 151, 0.12);
}

.site-name {
  display: block;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.subtext,
.notes {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.notes {
  max-width: 30rem;
}

.server-cell {
  min-width: 10rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding: 24px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: space-between;
    width: 100%;
  }

  .dashboard {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(17, 23, 34, 0.86);
    margin-bottom: 0.9rem;
    overflow: hidden;
  }

  td {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 8.5rem 1fr;
    padding: 0.85rem 1rem;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  td:last-child {
    border-bottom: 0;
  }

  .notes {
    max-width: none;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  td {
    grid-template-columns: 1fr;
  }
}
