:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --surface-3: #f6f8fb;
  --text: #1f2937;
  --muted: #657185;
  --border: #d8e0ea;
  --border-strong: #c7d0dc;
  --accent: #2463eb;
  --accent-2: #0ea5e9;
  --ok: #0f7a4d;
  --major: #c53952;
  --partial: #bb7a16;
  --degraded: #b7791f;
  --maintenance: #4160d1;
  --shadow: 0 18px 40px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 20px rgba(16, 24, 40, 0.05);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at top left, rgba(36, 99, 235, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.06), transparent 28%),
    var(--bg);
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), transparent 24%),
    linear-gradient(90deg, rgba(255,255,255,0.45), transparent 12%, transparent 88%, rgba(255,255,255,0.45));
}

h1, h2, h3, p { margin: 0; }

p {
  color: var(--muted);
  line-height: 1.65;
}

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

.site-header,
.hero,
.hero-banner,
.section-header,
.detail-head,
.service-row,
.uptime-row,
.admin-row,
.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  padding: 10px 2px 18px;
  align-items: flex-end;
}

.site-brand,
.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-mark,
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(36, 99, 235, 0.24);
}

.site-name {
  font-size: 1rem;
  font-weight: 800;
}

.site-subtitle,
.subtle,
.row-sub,
.signal-card span,
.detail-kv span,
.service-source,
.admin-stat p,
.admin-row-tertiary,
.uptime-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav,
.sidebar-nav,
.hero-links,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a,
.pill-link,
.status-link,
.link-pill,
.sidebar-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  font-weight: 700;
}

.link-pill.ghost {
  background: transparent;
}

.hero-banner {
  align-items: stretch;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  margin: 6px 0 24px;
}

.hero-copy {
  max-width: 72ch;
}

.hero-copy .eyebrow,
.panel-label,
.admin-stat span,
.group-head span {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
}

.hero-copy p {
  margin-top: 10px;
  max-width: 58ch;
}

.hero-side {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: end;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
}

.panel,
.detail-card,
.collector-card,
.login-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.intro-grid {
  grid-template-columns: 1.15fr 0.85fr;
  margin-bottom: 20px;
}

.summary-grid,
.metrics-grid,
.admin-stats,
.collector-grid {
  display: grid;
  gap: 14px;
}

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

.summary-tile,
.signal-card,
.admin-stat {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.summary-tile {
  padding: 18px;
}

.summary-tile strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 6px;
}

.summary-tile span,
.signal-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.signal-card {
  padding: 18px;
}

.signal-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.signal-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.group-stack,
.admin-list,
.timeline-stack {
  display: grid;
  gap: 12px;
}

.group-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
}

.group-head h3 {
  font-size: 1rem;
  font-weight: 800;
}

.group-list {
  display: grid;
}

.service-row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.service-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.service-main h3 {
  font-size: 0.98rem;
  font-weight: 800;
}

.service-main p {
  margin-top: 3px;
  font-size: 0.92rem;
}

.service-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 6px rgba(36, 99, 235, 0.06);
}

.service-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-operational,
.status-pill.badge-operational,
.chip {
  background: #eaf7f0;
  border-color: #c9ead6;
  color: var(--ok);
}

.badge-major,
.status-pill.badge-major {
  background: #fff0f3;
  border-color: #f1c3cb;
  color: var(--major);
}

.badge-partial,
.status-pill.badge-partial {
  background: #fff6ea;
  border-color: #efd0a4;
  color: var(--partial);
}

.badge-degraded,
.status-pill.badge-degraded {
  background: #fff9ea;
  border-color: #f0deb0;
  color: var(--degraded);
}

.badge-maintenance,
.status-pill.badge-maintenance {
  background: #eef2ff;
  border-color: #cad5fb;
  color: var(--maintenance);
}

.badge-unknown,
.status-pill.badge-unknown {
  background: #f4f6f8;
  border-color: var(--border);
  color: var(--muted);
}

.detail-card {
  padding: 20px;
}

.detail-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.detail-head h3 {
  font-size: 1.06rem;
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 14px;
}

.detail-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-2);
}

.detail-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.detail-kv + .detail-kv {
  margin-top: 12px;
}

.detail-kv strong {
  display: block;
  margin-top: 4px;
  font-size: 0.96rem;
}

.timeline-stack {
  gap: 10px;
}

.timeline-item {
  display: flex;
  gap: 10px;
}

.timeline-item strong {
  font-size: 0.92rem;
}

.timeline-item p {
  margin-top: 3px;
  font-size: 0.92rem;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-bullet {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  margin-top: 5px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 5px rgba(36, 99, 235, 0.08);
}

.history-row,
.uptime-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 2px;
  flex: 1;
}

.history-cell {
  display: block;
  height: 12px;
  border-radius: 3px;
}

.card.warning {
  background: #fffaf2;
}

.empty-state {
  padding: 12px 0 4px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 4px 0;
  color: var(--muted);
}

.login-card {
  padding: 24px;
  max-width: 560px;
  margin: 36px auto;
}

.admin-login {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.login-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.08;
}

.login-card p {
  margin-top: 10px;
  max-width: 54ch;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  padding: 0 14px;
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(36, 99, 235, 0.22);
  cursor: pointer;
}

.admin-shell {
  width: min(1460px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-main {
  display: grid;
  gap: 18px;
}

.admin-content {
  display: grid;
  gap: 18px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px;
}

.admin-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.06;
  margin-top: 2px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

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

.admin-stat {
  padding: 18px;
}

.admin-stat strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 8px;
}

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

.collector-card {
  padding: 18px;
}

.collector-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.admin-list.compact .admin-row {
  padding: 10px 12px;
}

.admin-row {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px 16px;
}

.admin-row-primary strong {
  display: block;
  font-size: 0.96rem;
}

.admin-row-secondary,
.admin-row-tertiary {
  white-space: nowrap;
}

.admin-signal {
  min-height: 126px;
}

.card.warning {
  background: #fffaf2;
}

@media (max-width: 1080px) {
  .intro-grid,
  .metrics-grid,
  .summary-grid,
  .admin-stats,
  .collector-grid,
  .detail-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .site-header,
  .hero-banner,
  .hero,
  .section-header,
  .detail-head,
  .service-row,
  .uptime-row,
  .admin-row,
  .table-row,
  .admin-hero,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-side {
    justify-items: start;
  }

  .history-strip {
    grid-template-columns: repeat(30, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }
}
