:root {
  color-scheme: dark;
  --bg: #090b0d;
  --panel: rgba(18, 22, 26, 0.88);
  --panel-strong: #171c21;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f1e8;
  --muted: #9ba6b2;
  --good: #75d690;
  --warn: #e3bd5c;
  --bad: #ef7e7e;
  --blue: #7dc7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(125, 199, 255, 0.16), transparent 26rem),
    radial-gradient(circle at 90% 10%, rgba(117, 214, 144, 0.12), transparent 24rem),
    linear-gradient(180deg, #11161b 0%, #090b0d 64%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.monitor-shell {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1480px;
  min-height: 100vh;
  padding: 26px;
}

.monitor-top {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.monitor-top h1 {
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: 0;
  line-height: 0.95;
  margin: 2px 0 8px;
}

.monitor-top p,
.section-head p,
.pulse-card p,
.stat-tile small,
.service-card p,
.service-card small {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}

.button.primary {
  background: #d9edf3;
  border-color: #d9edf3;
  color: #0b0e10;
  width: 100%;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.live-dot,
.health-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  text-transform: uppercase;
}

.live-dot {
  background: rgba(117, 214, 144, 0.1);
  color: var(--good);
}

.live-dot i {
  animation: pulse 1.6s infinite;
  background: var(--good);
  border-radius: 999px;
  display: block;
  height: 8px;
  width: 8px;
}

.health-badge.good {
  background: rgba(117, 214, 144, 0.12);
  color: var(--good);
}

.health-badge.warn {
  background: rgba(227, 189, 92, 0.13);
  color: var(--warn);
}

.health-badge.bad {
  background: rgba(239, 126, 126, 0.13);
  color: var(--bad);
}

.hero-monitor {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.55fr);
}

.pulse-card,
.panel,
.manage-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.pulse-card {
  align-items: center;
  display: grid;
  gap: 22px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 260px;
  padding: 28px;
}

.pulse-card h2 {
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: 0;
  line-height: 1;
  margin: 10px 0;
}

.pulse-orbit {
  align-items: center;
  border-radius: 999px;
  display: flex;
  height: 150px;
  justify-content: center;
  position: relative;
  width: 150px;
}

.pulse-orbit::before,
.pulse-orbit::after {
  border: 1px solid currentColor;
  border-radius: inherit;
  content: "";
  inset: 0;
  opacity: 0.25;
  position: absolute;
}

.pulse-orbit::after {
  animation: radar 2.4s infinite;
}

.pulse-orbit span {
  align-items: center;
  background: #101418;
  border: 1px solid var(--line);
  border-radius: inherit;
  display: flex;
  font-size: 42px;
  font-weight: 950;
  height: 112px;
  justify-content: center;
  width: 112px;
  z-index: 1;
}

.pulse-card.good .pulse-orbit {
  color: var(--good);
}

.pulse-card.warn .pulse-orbit {
  color: var(--warn);
}

.pulse-card.bad .pulse-orbit {
  color: var(--bad);
}

.quick-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 20px;
}

.tile-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tile-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tile-head i {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
  position: relative;
  width: 74px;
}

.tile-head i::after {
  background: currentColor;
  border-radius: inherit;
  content: "";
  display: block;
  height: 100%;
  width: var(--value);
}

.stat-tile strong {
  font-size: clamp(42px, 6vw, 76px);
  letter-spacing: 0;
  line-height: 0.95;
}

.stat-tile.good {
  color: var(--good);
}

.stat-tile.warn {
  color: var(--warn);
}

.stat-tile.bad {
  color: var(--bad);
}

.chart-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  padding: 18px;
}

.chart-panel canvas {
  display: block;
  height: 240px;
  margin-top: 12px;
  width: 100%;
}

.section-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.section-head.compact {
  align-items: center;
}

.section-head h3,
.manage-panel h3 {
  font-size: 22px;
  letter-spacing: 0;
  margin: 0 0 5px;
}

.section-head > span,
.section-head > strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}

.focus-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

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

.service-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px;
}

.service-card.down {
  border-color: rgba(239, 126, 126, 0.45);
}

.service-top {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.service-top strong,
.service-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-top span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-card p {
  font-size: 13px;
}

.service-card small {
  color: #c5cbd2;
}

.status-dot {
  background: var(--muted);
  border-radius: 999px;
  display: block;
  height: 10px;
  width: 10px;
}

.status-dot.up {
  background: var(--good);
}

.status-dot.warn {
  background: var(--warn);
}

.status-dot.down {
  background: var(--bad);
}

.alert-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.alert,
.empty-state {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.alert {
  display: grid;
  gap: 5px;
}

.alert.bad {
  border-color: rgba(239, 126, 126, 0.45);
}

.alert.warn {
  border-color: rgba(227, 189, 92, 0.45);
}

.alert span,
.empty-state {
  color: var(--muted);
}

.manage-panel {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px;
}

.manage-panel p {
  color: var(--muted);
  margin: 0;
}

.loading-panel {
  align-self: center;
  justify-self: center;
  max-width: 560px;
  width: 100%;
}

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

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 420px;
  padding: 22px;
  width: 100%;
}

.auth-card h1 {
  margin: 0 0 6px;
}

.auth-card p {
  color: var(--muted);
  margin: 0 0 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 44px;
  padding: 0 12px;
}

.error {
  background: rgba(239, 126, 126, 0.13);
  border: 1px solid rgba(239, 126, 126, 0.34);
  border-radius: 8px;
  color: #ffdada;
  padding: 10px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(1.45);
  }
}

@keyframes radar {
  0% {
    opacity: 0.36;
    transform: scale(0.78);
  }

  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

@media (max-width: 1220px) {
  .hero-monitor,
  .focus-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .monitor-shell {
    padding: 16px;
  }

  .monitor-top,
  .manage-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .manage-actions {
    justify-content: stretch;
    width: 100%;
  }

  .top-actions .button,
  .manage-actions .button {
    flex: 1;
  }

  .hero-monitor,
  .quick-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .pulse-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .pulse-orbit {
    height: 124px;
    width: 124px;
  }

  .pulse-orbit span {
    font-size: 34px;
    height: 92px;
    width: 92px;
  }

  .stat-tile {
    min-height: 170px;
  }
}
