:root {
  --bg: #0f1419;
  --panel: #161c24;
  --panel-2: #1e252f;
  --border: #2a333f;
  --text: #e6edf3;
  --muted: #8b949e;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: radial-gradient(1200px 600px at 50% -200px, rgba(59,130,246,.15), transparent);
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-card h1 { margin: 0 0 1.5rem 0; font-size: 1.5rem; }
.auth-card label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-card input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  margin-top: 0.3rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}
.auth-card input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.setup-card { max-width: 520px; }

.btn-primary {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-warn  { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

.muted { color: var(--muted); font-size: 0.875rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; }
.topbar .brand span { color: var(--muted); font-weight: 400; }
.topbar nav { display: flex; gap: 1.2rem; flex: 1; }
.topbar nav a, .topbar nav span {
  color: var(--muted);
  padding: 0.3rem 0;
  font-size: 0.925rem;
}
.topbar nav a.active { color: var(--text); border-bottom: 2px solid var(--primary); }
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav .disabled { opacity: 0.4; cursor: not-allowed; }
.topbar .user { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: 1.4rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.card-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.card-value { font-size: 2rem; font-weight: 700; margin: 0.3rem 0; }

.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin: 0.3rem 0; }
.bar-fill { height: 100%; background: var(--ok); transition: width .3s; }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.75rem; margin-top: 0.3rem; }
.pill.bad { background: rgba(239,68,68,.15); color: #fca5a5; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.5rem;
}
.panel h2 { margin: 0 0 1rem 0; font-size: 1.05rem; }

.svc-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 0.6rem; }
.svc-list li { display: flex; align-items: center; gap: 0.6rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.warn td { color: #fcd34d; }
tr.bad td { color: #fca5a5; }

code {
  background: var(--panel-2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
}
