:root {
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #171b21;
  --border: #22272f;
  --border-soft: #1b1f26;
  --text: #e8eaed;
  --muted: #9aa3ad;
  --dim: #6b7480;
  --accent: #35c3ae;
  --accent-soft: rgba(53, 195, 174, 0.12);
  --ok: #3ecf8e;
  --ok-soft: rgba(62, 207, 142, 0.12);
  --down: #e5484d;
  --down-soft: rgba(229, 72, 77, 0.12);
  --font-display: 'Outfit', 'Geist', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }

/* ---------- login ---------- */
.login-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 10;
}
.login-box {
  width: 360px; padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.login-logo {
  width: 60px; height: 60px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--border); margin-bottom: 22px; display: block;
}
.brand-title {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  letter-spacing: -0.01em; color: var(--text);
}
.brand-sub {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--dim); margin: 4px 0 26px; text-transform: uppercase;
}
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 11px 13px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-mono); font-size: 14px;
  outline: none; transition: border-color .15s var(--ease);
}
.field input:focus { border-color: var(--accent); }
.btn {
  width: 100%; margin-top: 6px; padding: 11px; cursor: pointer;
  background: var(--accent); border: none; border-radius: 8px; color: #04110e;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
  transition: transform .1s var(--ease), filter .15s var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.login-err { color: var(--down); font-size: 12px; margin-top: 12px; min-height: 16px; }

/* ---------- topbar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; gap: 20px; padding: 0 22px;
  background: rgba(11, 13, 16, 0.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
#brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
#logo { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); }
#wordmark { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--text); }

#tabs {
  display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; width: max-content;
}
#tabs::-webkit-scrollbar { display: none; }

.tab {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 7px; cursor: pointer;
  background: transparent; border: none; color: var(--muted);
  font-family: var(--font-display); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.tab:active { transform: translateY(1px); }
.tab-ic { display: flex; align-items: center; opacity: 0.9; }
.tab .dot { margin-left: 1px; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex-shrink: 0; }
.dot.up { background: var(--ok); animation: breathe 2.4s ease-in-out infinite; }
.dot.down { background: var(--down); }
.dot.big { width: 8px; height: 8px; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

#topright { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
#summary { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.ghost-btn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font-display); font-size: 13px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.ghost-btn:hover { color: var(--text); border-color: var(--border); }
.ghost-btn:active { transform: translateY(1px); }

/* ---------- content ---------- */
#content { padding: 34px 26px 70px; max-width: 1080px; margin: 0 auto; }

.page-head { margin-bottom: 26px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  letter-spacing: -0.02em; color: var(--text);
}
.sub { color: var(--dim); font-family: var(--font-mono); font-size: 12.5px; margin-top: 5px; }

/* ---------- stats strip ---------- */
.stats {
  display: flex; gap: 0; margin-bottom: 26px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); overflow: hidden;
}
.stats .stat { flex: 1; padding: 16px 22px; border-right: 1px solid var(--border-soft); }
.stats .stat:last-child { border-right: none; }
.stat-v { font-family: var(--font-mono); font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: -0.01em; }
.stat-v.ok { color: var(--ok); }
.stat-v.down { color: var(--down); }
.stat-k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ---------- table ---------- */
.table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.thead, .trow {
  display: grid; grid-template-columns: 1.7fr 1fr 0.8fr 1fr 1.7fr; gap: 16px;
  padding: 13px 20px; align-items: center;
}
.thead {
  background: var(--surface-2); font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); border-bottom: 1px solid var(--border);
}
.trow { border-bottom: 1px solid var(--border-soft); transition: background .15s var(--ease); cursor: pointer; }
.trow:last-child { border-bottom: none; }
.trow:hover { background: var(--surface-2); }
.trow:active { transform: translateY(1px); }
.trow { animation: rise 0.4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cell-svc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.svc-ic { display: flex; align-items: center; color: var(--muted); flex-shrink: 0; }
.svc-name { font-weight: 500; color: var(--text); }
.svc-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.cell-status { display: flex; align-items: center; gap: 8px; }
.status-text { font-family: var(--font-mono); font-size: 13px; }
.status-text.up { color: var(--ok); }
.status-text.down { color: var(--down); }
.cell-num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.cell-endpoint { font-family: var(--font-mono); font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- detail ---------- */
.detail { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.detail-head {
  display: flex; align-items: center; gap: 14px; padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-head .svc-ic { color: var(--accent); }
.detail-head h1 { font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--text); }
.dl { padding: 6px 24px; }
.dl-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.dl-row:last-child { border-bottom: none; }
.dl-k { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.dl-v { font-family: var(--font-mono); font-size: 14px; color: var(--text); word-break: break-all; }
.dl-v.up { color: var(--ok); }
.dl-v.down { color: var(--down); }
.note { margin: 0 24px 22px; padding: 14px 16px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 13px; }

/* ---------- footer ---------- */
#foot {
  position: fixed; bottom: 0; left: 0; right: 0; text-align: center; padding: 9px;
  color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  border-top: 1px solid var(--border-soft); background: rgba(11, 13, 16, 0.7);
}

@media (max-width: 760px) {
  #topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  #tabs { order: 3; width: 100%; }
  #summary { display: none; }
  #content { padding: 22px 14px 70px; }
  .thead { display: none; }
  .trow { grid-template-columns: 1fr auto; gap: 8px; }
  .cell-latency, .cell-check, .cell-endpoint { display: none; }
  .stats .stat { padding: 14px 16px; }
}
