/* stats.phantrium.com — dashboard */
:root {
  --bg: #07080d; --bg-2: #0d111c; --bg-3: #131a2c; --line: #1f2740; --line-soft: #1a2138;
  --text: #e6ecff; --text-soft: #a8b1cc; --text-mute: #6c7596;
  --gold: #ffd700; --gold-2: #f0bb00; --gold-soft: rgba(255,215,0,.12);
  --red: #ff3b3b; --green: #2ddd7a; --yellow: #f8c145; --blue: #3aa6ff;
  --font: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max: 1280px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--text); line-height: 1.5;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255,215,0,.08), transparent 60%), var(--bg);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
code { font-family: var(--font-mono); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: .88em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.head {
  background: rgba(7,8,13,.92); border-bottom: 1px solid var(--line);
  padding: 16px 0; position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #161616; font-weight: 900;
}
.brand .logo i { font-size: 15px; }
.head-meta { display: flex; align-items: center; gap: 14px; font-size: .85rem; color: var(--text-mute); flex-wrap: wrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 4px rgba(45,221,122,.15); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(45,221,122,.15); } 50% { box-shadow: 0 0 0 6px rgba(45,221,122,.05); } }

main { padding: 32px 0 60px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 32px 0 16px; }
.section-title h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.section-title .badge { font-size: .8rem; color: var(--text-mute); background: var(--bg-3); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }

/* Top KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; display: flex; align-items: flex-start; gap: 14px;
}
.kpi-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.kpi-ico.green { background: rgba(45,221,122,.12); color: var(--green); }
.kpi-ico.blue  { background: rgba(58,166,255,.12); color: var(--blue); }
.kpi-ico.red   { background: rgba(255,59,59,.12); color: var(--red); }
.kpi-label { font-size: .8rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; }
.kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.kpi-sub { font-size: .82rem; color: var(--text-mute); margin-top: 2px; }

/* Brain card */
.brain-card {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--gold-soft); border-radius: 16px; padding: 24px;
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 18px;
  box-shadow: 0 0 0 1px rgba(255,215,0,.1), 0 12px 36px rgba(0,0,0,.3);
}
@media (max-width: 760px) { .brain-card { grid-template-columns: 1fr 1fr; } }
.brain-fact { display: flex; flex-direction: column; }
.brain-fact .l { font-size: .78rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.brain-fact .v { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; color: var(--text); word-break: break-all; }
.brain-fact .v.gold { color: var(--gold); }

/* Agent grid */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.agent-row {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, transform .15s;
}
.agent-row:hover { border-color: var(--line-soft); }
.agent-row.healthy { border-left: 3px solid var(--green); }
.agent-row.degraded { border-left: 3px solid var(--yellow); }
.agent-row.down { border-left: 3px solid var(--red); }
.agent-row .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agent-row .name { font-weight: 600; font-size: .98rem; color: var(--text); }
.agent-row .cat { font-size: .72rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; }
.agent-row .status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.agent-row .status-pill.ok   { color: var(--green); background: rgba(45,221,122,.1); }
.agent-row .status-pill.warn { color: var(--yellow); background: rgba(248,193,69,.1); }
.agent-row .status-pill.err  { color: var(--red); background: rgba(255,59,59,.1); }
.agent-row .metrics { display: flex; gap: 14px; font-size: .78rem; color: var(--text-mute); flex-wrap: wrap; }
.agent-row .metric b { color: var(--text); font-weight: 600; }

/* Catalog summary */
.cat-summary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .cat-summary { grid-template-columns: 1fr; } }
.cat-list {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px;
  max-height: 380px; overflow-y: auto;
}
.cat-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.cat-row:last-child { border-bottom: none; }
.cat-row .bar { flex: 1; height: 4px; background: var(--bg-3); border-radius: 2px; margin: 0 14px; position: relative; overflow: hidden; }
.cat-row .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px;
}
.card h3 { margin: 0 0 14px; font-size: 1rem; }
.tier-list { list-style: none; padding: 0; margin: 0; }
.tier-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.tier-list li:last-child { border: none; }
.tier-list .v { color: var(--gold); font-weight: 600; }

footer { text-align: center; padding: 32px 0; color: var(--text-mute); font-size: .85rem; border-top: 1px solid var(--line); margin-top: 40px; }

.skel { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 8px; }
@keyframes skel { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
