:root {
  --bg: #0b1020;
  --bg2: #0e1530;
  --card: #131c3a;
  --card2: #18224a;
  --line: #243056;
  --text: #e8edf9;
  --muted: #8b97bd;
  --accent: #2f7bff;
  --up: #2bd576;
  --degraded: #f5b13d;
  --down: #ff5470;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #16224d 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  min-height: 100vh;
  padding: 0 16px 48px;
  -webkit-font-smoothing: antialiased;
}
.muted { color: var(--muted); }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg), rgba(11,16,32,0.6) 80%, transparent);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.logout { color: var(--muted); text-decoration: none; font-size: 13px; border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; }
.logout:hover { color: var(--text); border-color: var(--accent); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(255,255,255,0.04); }
.dot.up { background: var(--up); box-shadow: 0 0 12px var(--up); }
.dot.degraded { background: var(--degraded); box-shadow: 0 0 12px var(--degraded); }
.dot.down { background: var(--down); box-shadow: 0 0 12px var(--down); }

/* summary tiles */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile .n { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.tile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.tile.up .n { color: var(--up); } .tile.degraded .n { color: var(--degraded); } .tile.down .n { color: var(--down); }

/* system bars */
.sys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.gauge { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.gauge .head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.gauge .val { color: var(--text); font-weight: 600; }
.bar { height: 8px; background: #0a1330; border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #5aa0ff); transition: width .5s; }
.bar.warn > span { background: linear-gradient(90deg, var(--degraded), #ffcf7a); }
.bar.crit > span { background: linear-gradient(90deg, var(--down), #ff8aa0); }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 6px 4px 12px; }

/* project grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proj { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .2s, transform .2s; }
.proj:hover { border-color: #34427a; transform: translateY(-2px); }
.proj .row { display: flex; align-items: center; gap: 10px; }
.proj h3 { font-size: 16px; font-weight: 640; flex: 1; letter-spacing: -0.01em; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.proj .desc { color: var(--muted); font-size: 13px; margin: 10px 0 14px; }
.signals { display: flex; flex-direction: column; gap: 7px; }
.sig { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sig .k { color: var(--muted); width: 74px; flex-shrink: 0; text-transform: capitalize; }
.sig .name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig .meta { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.pill.up { color: var(--up); background: rgba(43,213,118,0.12); }
.pill.degraded { color: var(--degraded); background: rgba(245,177,61,0.12); }
.pill.down { color: var(--down); background: rgba(255,84,112,0.12); }
.pill.unknown { color: var(--muted); background: rgba(139,151,189,0.12); }

.foot { margin-top: 28px; text-align: center; font-size: 12px; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: 100%; max-width: 360px; margin-top: 18vh; }
.login-card .brand { margin-bottom: 6px; }
.login-card p.muted { margin-bottom: 22px; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login-card input { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button { width: 100%; margin-top: 16px; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-card button:hover { background: #2569e0; }
.error { color: var(--down); font-size: 13px; margin-top: 12px; }

@media (max-width: 720px) {
  body { padding: 0 12px 40px; }
  .summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sys { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .topbar { padding: 14px 2px; }
  .topbar h1 { font-size: 15px; }
  .tile .n { font-size: 26px; }
  .topbar-right { gap: 10px; }
  .topbar-right .muted { font-size: 12px; }
}
