:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --line: #2a3542;
  --text: #e7eef6;
  --muted: #8b9aab;
  --accent: #3d9cfd;
  --ok: #3ecf8e;
  --bad: #f07178;
  --warn: #e6b450;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1b2a3a, var(--bg));
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }
.gate {
  max-width: 360px;
  margin: 12vh auto;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.gate h1 { margin: 0; font-size: 1.4rem; letter-spacing: 0.04em; }
label { font-size: 0.85rem; color: var(--muted); }
input, select, button, textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121820;
  color: var(--text);
}
button {
  background: var(--accent);
  color: #041018;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.danger { background: var(--bad); color: #1a0505; }
button.ok { background: var(--ok); color: #04140c; }
.muted { color: var(--muted); font-size: 0.9rem; }
.err { color: var(--bad); min-height: 1.2rem; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}
nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.tab.on {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}
main { padding: 1.25rem; max-width: 1100px; margin: 0 auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}
.card .n { font-size: 1.6rem; font-weight: 700; }
.card .l { color: var(--muted); font-size: 0.85rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 500; }
.pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.pill.on { background: rgba(62, 207, 142, 0.15); color: var(--ok); }
.pill.off { background: rgba(240, 113, 120, 0.15); color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.link {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }
button.tiny { padding: 0.15rem 0.4rem; font-size: 0.75rem; }

