
:root {
  --bg: #060606;
  --surface: #0e0e10;
  --surface-2: #141416;
  --surface-3: #1a1a1d;
  --text: #ffffff;
  --muted: #9a9aa1;
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);
  --button: #ffffff;
  --button-text: #050505;
  --success: #22d391;
  --danger: #ff5c72;
  --warning: #f4b740;
  --shadow: 0 16px 50px rgba(0,0,0,.34);
}

html[data-theme="light"] {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #eeeeef;
  --text: #090909;
  --muted: #65656d;
  --border: rgba(0,0,0,.10);
  --border-strong: rgba(0,0,0,.18);
  --button: #090909;
  --button-text: #ffffff;
  --shadow: 0 16px 40px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 0%, rgba(255,255,255,.05), transparent 28%),
    var(--bg);
  transition: background .25s ease, color .25s ease;
}

button, a { font: inherit; }
button { color: inherit; }

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

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -.05em;
  line-height: 1;
}
h1 span {
  background: linear-gradient(90deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  color: transparent;
}
.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.overall-card,
.server-card,
.service-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.overall-card {
  min-width: 250px;
  border-radius: 18px;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
}
.overall-card small,
.metric small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.overall-card strong {
  display: block;
  font-size: 14px;
}
.shield {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--success);
}

.theme-toggle,
.refresh-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}
.theme-toggle:hover,
.refresh-btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }

.theme-toggle {
  width: 52px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.theme-toggle span {
  position: absolute;
  transition: transform .25s ease, opacity .25s ease;
}
html[data-theme="dark"] .sun { opacity: 1; transform: translateY(0); }
html[data-theme="dark"] .moon { opacity: 0; transform: translateY(18px); }
html[data-theme="light"] .sun { opacity: 0; transform: translateY(-18px); }
html[data-theme="light"] .moon { opacity: 1; transform: translateY(0); }

.server-card {
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 22px;
}
.server-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.server-head h2,
.section-title h2 {
  margin-bottom: 0;
  font-size: 22px;
  letter-spacing: -.03em;
}
.server-badge,
.service-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  background: var(--surface-2);
  overflow: hidden;
}
.metric strong {
  display: block;
  font-size: 23px;
  margin-bottom: 8px;
}
.metric canvas {
  width: 100%;
  height: 54px;
  display: block;
}
.metric-note {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.services-section {
  margin-top: 4px;
}
.section-title { margin-bottom: 12px; }
.refresh-btn {
  padding: 10px 13px;
  font-size: 13px;
}

.service-list {
  display: grid;
  gap: 10px;
}
.service-card {
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  gap: 15px;
  align-items: center;
  transition: transform .2s ease, border-color .2s ease, background .25s ease;
}
.service-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.service-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.service-info h3 {
  margin: 0 0 5px;
  font-size: 16px;
}
.service-info p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.service-status.online { color: var(--success); }
.service-status.offline { color: var(--danger); }
.service-status.checking { color: var(--warning); }

.open-btn {
  min-width: 170px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--button-text);
  background: var(--button);
  font-weight: 700;
  font-size: 13px;
  transition: transform .2s ease, opacity .2s ease;
}
.open-btn:hover { transform: translateY(-1px); opacity: .9; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.status-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(34,211,145,.08); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,92,114,.08); }
.status-dot.checking {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(244,183,64,.08);
  animation: pulse 1s infinite;
}
@keyframes pulse { 50% { opacity: .4; } }

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 840px) {
  .topbar { flex-direction: column; }
  .top-actions { width: 100%; }
  .overall-card { flex: 1; }
  .server-grid { grid-template-columns: 1fr; }
  .service-card {
    grid-template-columns: 52px 1fr auto;
  }
  .service-icon { width: 52px; height: 52px; }
  .service-status { grid-column: 2 / 3; width: fit-content; }
  .open-btn { grid-column: 3 / 4; grid-row: 1 / span 2; min-width: 0; }
}

@media (max-width: 590px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 20px; }
  .top-actions { flex-wrap: wrap; }
  .overall-card { min-width: calc(100% - 62px); }
  .theme-toggle { min-height: 64px; }
  .service-card {
    grid-template-columns: 48px 1fr;
    padding: 12px;
  }
  .service-icon { width: 48px; height: 48px; border-radius: 14px; }
  .service-status { grid-column: 2; }
  .open-btn { grid-column: 1 / -1; grid-row: auto; width: 100%; }
  footer { flex-direction: column; }
}
