:root {
  --bg: #0f141e;
  --bg-soft: #151c29;
  --card: rgba(27, 35, 51, 0.86);
  --line: rgba(140, 167, 207, 0.22);
  --text: #e7ecf7;
  --muted: #97a7c2;
  --ok: #2fd7a1;
  --warn: #f3c86c;
  --bad: #ff7f8f;
  --accent: #79e5ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% -10%, #2f4664, transparent 42%),
              radial-gradient(circle at 90% 115%, #26444e, transparent 38%),
              var(--bg);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  z-index: 0;
  filter: blur(50px);
  opacity: 0.35;
  pointer-events: none;
}

.orb-a {
  width: 290px;
  height: 290px;
  background: #2f77ff;
  left: -100px;
  top: -80px;
  animation: driftA 10s ease-in-out infinite;
}

.orb-b {
  width: 250px;
  height: 250px;
  background: #1ed3a9;
  right: -70px;
  top: 40%;
  animation: driftB 12s ease-in-out infinite;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 1.2rem auto 2rem;
}

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

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-size: 0.73rem;
}

.subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 130ms ease, border-color 130ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(121, 229, 255, 0.56);
}

.btn-primary {
  background: linear-gradient(90deg, #2aa6ff, #22d4bc);
  color: #07202f;
  border: none;
  font-weight: 700;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.status-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

.status-card {
  padding: 0.9rem;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-card h2 {
  margin: 0.38rem 0 0;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.panel {
  margin-top: 0.9rem;
}

.panel-head {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.panel h3 {
  margin: 0;
  font-size: 1.02rem;
}

.panel small {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  max-height: 410px;
}

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

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

th {
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

td {
  font-size: 0.88rem;
}

.timebox {
  display: grid;
  gap: 0.15rem;
}

.utc {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.local {
  color: var(--muted);
  font-size: 0.78rem;
}

.sync-json {
  margin: 0;
  padding: 0.85rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  overflow: auto;
}

.badge {
  display: inline-block;
  font-size: 0.73rem;
  border-radius: 999px;
  padding: 0.12rem 0.52rem;
  border: 1px solid;
}

.badge.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok), transparent 42%);
}

.badge.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn), transparent 42%);
}

.badge.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad), transparent 42%);
}

.hidden {
  display: none;
}

@keyframes driftA {
  0%,
  100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(36px, 18px) scale(1.06); }
}

@keyframes driftB {
  0%,
  100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-25px, -20px) scale(1.1); }
}

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

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

@media (max-width: 640px) {
  .status-grid {
    grid-template-columns: 1fr;
  }
}
