@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e4e9;
  --text: #1a1d24;
  --text-muted: #4a525d;
  --text-faint: #8a92a0;
  --accent: #1e4ed8;
  --accent-contrast: #ffffff;
  --ok: #1a9c5f;
  --ok-bg: #e7f7ef;
  --warn: #b5730a;
  --warn-bg: #fdf3e0;
  --fail: #cc2936;
  --fail-bg: #fdeaec;
  --unknown: #6b7280;
  --unknown-bg: #eceef1;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.06);
  --font-ui: 'Quicksand', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #0a0a0f;
  --surface: #14151b;
  --border: #24262f;
  --text: #eef0f4;
  --text-muted: #a8adb8;
  --text-faint: #6b7280;
  --accent: #4c7cf0;
  --accent-contrast: #0a0a0f;
  --ok: #34c281;
  --ok-bg: #0f2a1f;
  --warn: #e3a53a;
  --warn-bg: #2c2410;
  --fail: #f0555f;
  --fail-bg: #2c1418;
  --unknown: #8790a0;
  --unknown-bg: #1c1e26;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0f;
    --surface: #14151b;
    --border: #24262f;
    --text: #eef0f4;
    --text-muted: #a8adb8;
    --text-faint: #6b7280;
    --accent: #4c7cf0;
    --accent-contrast: #0a0a0f;
    --ok: #34c281;
    --ok-bg: #0f2a1f;
    --warn: #e3a53a;
    --warn-bg: #2c2410;
    --fail: #f0555f;
    --fail-bg: #2c1418;
    --unknown: #8790a0;
    --unknown-bg: #1c1e26;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline-block; }
}
.topbar .brand .sep { color: var(--text-faint); font-weight: 400; }
.topbar .brand .page { color: var(--text-muted); font-weight: 500; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; color: var(--text-muted); }
.topbar nav a { color: var(--text-muted); }
.topbar nav a.active { color: var(--accent); font-weight: 600; }
.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  width: 32px; height: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.theme-toggle:hover { background: var(--bg); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 36px 28px 80px; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; color: var(--text-faint); font-weight: 600; margin-bottom: 6px; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 4px; }
.subtitle { color: var(--text-muted); font-size: 14px; max-width: 640px; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  margin: 22px 0 28px;
}
.hero .status-line { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; }
.hero .status-dot { width: 12px; height: 12px; border-radius: 50%; }
.hero .status-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }
.hero .metric { text-align: right; }
.hero .metric .value { font-size: 24px; font-weight: 700; font-family: var(--font-mono); }
.hero .metric .label { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }

.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.host-card { padding: 16px 18px; }
.host-card .host-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.host-card .host-name { font-weight: 700; font-size: 15px; }
.host-card .host-role { color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); }
.check-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13.5px; border-top: 1px solid var(--border); }
.check-row:first-of-type { border-top: none; }
.check-row .name { color: var(--text-muted); }
.check-row .msg { color: var(--text-faint); font-size: 12px; max-width: 55%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.fail { background: var(--fail-bg); color: var(--fail); }
.badge.unknown { background: var(--unknown-bg); color: var(--unknown); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.fail { background: var(--fail); }
.dot.unknown { background: var(--unknown); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--accent-contrast);
  border: none; padding: 9px 16px; border-radius: 6px;
  font-family: var(--font-ui); font-weight: 600; font-size: 13.5px;
  cursor: pointer;
}
.btn:hover { opacity: .92; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn.danger { background: var(--fail); }
.btn.small { padding: 5px 11px; font-size: 12px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-field input[type=text], .form-field input[type=password], .form-field textarea {
  width: 100%; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 14px;
}
.form-field textarea { font-family: var(--font-mono); font-size: 13px; min-height: 480px; }

.login-wrap { max-width: 380px; margin: 90px auto; }
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13.5px; margin-bottom: 16px; }
.alert.error { background: var(--fail-bg); color: var(--fail); }
.alert.success { background: var(--ok-bg); color: var(--ok); }

.footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 20px 28px; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-faint); }

.layer-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.layer-tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.layer-tab.active { border-color: var(--accent); color: var(--accent); }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--unknown-bg); border-radius: 20px; transition: .15s; }
.switch .slider:before { content: ""; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider:before { transform: translateX(16px); border-color: transparent; }

.pill-nav { display: flex; gap: 6px; margin-bottom: 20px; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.stat-tile { flex: 1; min-width: 140px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-tile .value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); }
.stat-tile .label { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
