:root {
  color-scheme: dark;
  --bg: #070910;
  --ink: #f5f7fb;
  --muted: #8792a8;
  --line: rgba(148, 163, 184, .16);
  --panel: rgba(13, 18, 31, .82);
  --panel-2: rgba(18, 25, 42, .72);
  --ok: #20e3a2;
  --warn: #ffb020;
  --crit: #ff4d6d;
  --cyan: #38d9ff;
  --violet: #8b5cf6;
  --blue: #4f7cff;
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

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

.stage {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% -10%, rgba(79, 124, 255, .26), transparent 34%),
    radial-gradient(circle at 84% 0%, rgba(139, 92, 246, .22), transparent 30%),
    linear-gradient(180deg, #090c15 0%, #070910 46%, #080a12 100%);
}

.topbar {
  min-height: 82px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
}

.eyebrow, .section-kicker {
  color: #9fb0ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 26px; line-height: 1.1; }
h2 { font-size: 28px; line-height: 1.12; max-width: 620px; }

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

.status-chip, .cadence span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 14px var(--ok);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 28px 44px;
}

.ops-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric, .panel {
  background: linear-gradient(180deg, rgba(21, 29, 49, .82), rgba(10, 14, 25, .8));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  backdrop-filter: blur(18px);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--ok));
  opacity: .82;
}

.metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { font-size: 38px; line-height: 1; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, .75fr);
  gap: 18px;
  align-items: start;
}

.panel { overflow: hidden; }

.panel-head {
  height: 60px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #d8ddff;
}

.legend { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.ok { background: var(--ok); }
.warning { background: var(--warn); }
.critical { background: var(--crit); }
.planned { background: #98a2b3; }

.server-list { display: grid; }

.server {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 92px minmax(250px, .9fr) minmax(210px, .85fr);
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

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

.title { min-width: 0; }
.name { font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role, .meta { color: var(--muted); font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: #62708a; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 30px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill.ok { color: var(--ok); background: rgba(32, 227, 162, .12); border: 1px solid rgba(32, 227, 162, .22); }
.pill.warning { color: var(--warn); background: rgba(255, 176, 32, .13); border: 1px solid rgba(255, 176, 32, .24); }
.pill.critical { color: var(--crit); background: rgba(255, 77, 109, .13); border: 1px solid rgba(255, 77, 109, .26); }
.pill.planned { color: #b7c0d4; background: rgba(255,255,255,.07); border: 1px solid var(--line); }

.meters {
  display: grid;
  gap: 10px;
}

.meter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meter-row strong {
  color: var(--ink);
  font-size: 12px;
}

.track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .065);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.28);
}

.track-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #19d6ff 0%, #20e3a2 100%);
  box-shadow: 0 0 16px rgba(32, 227, 162, .24);
  transition: width .35s ease, background .35s ease;
}

.meter.warning .track-fill {
  background: linear-gradient(90deg, #20e3a2 0%, #ffb020 100%);
  box-shadow: 0 0 16px rgba(255, 176, 32, .24);
}

.meter.critical .track-fill {
  background: linear-gradient(90deg, #ffb020 0%, #ff4d6d 100%);
  box-shadow: 0 0 16px rgba(255, 77, 109, .26);
}

.issues {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

.endpoint-list { display: grid; }
.endpoint {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.endpoint:last-child { border-bottom: 0; }
.endpoint-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.endpoint-name { font-weight: 850; }
.endpoint-url { margin-bottom: 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.small-label { color: var(--muted); font-size: 12px; margin-top: 8px; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 28%, rgba(79, 124, 255, .24), transparent 35%),
    linear-gradient(180deg, #090c15, #070910);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(13, 18, 31, .88);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--blue), var(--violet));
}

.login-mark svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #05050d;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-card p {
  margin: 14px 0 22px;
  color: var(--muted);
}

.login-btn {
  width: 100%;
  height: 54px;
  border: 1px solid rgba(118, 136, 255, .42);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(79,124,255,.34), rgba(139,92,246,.26));
  color: var(--ink);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.login-btn.compact {
  width: 118px;
  flex: 0 0 118px;
}

.code-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.code-row input {
  min-width: 0;
  flex: 1;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  color: var(--ink);
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .18em;
}

.login-message {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .summary-grid, .layout { grid-template-columns: 1fr; }
  .ops-hero { align-items: start; flex-direction: column; }
  .server {
    grid-template-columns: 1fr 92px;
    gap: 12px;
  }
  .server .meters, .server .issues { grid-column: 1 / -1; }
  .topbar { padding: 18px; align-items: flex-start; gap: 14px; flex-direction: column; }
  .top-status { justify-content: flex-start; }
  main { padding: 12px 18px 32px; }
}

@media (max-width: 560px) {
  h1 { font-size: 23px; }
  h2 { font-size: 23px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { min-height: 96px; padding: 15px; }
  .metric strong { font-size: 30px; }
  .panel-head { padding: 0 14px; }
  .legend { display: none; }
}
