:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --cyan: #0891b2;
  --cyan-soft: #cffafe;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #0f172a; color: #e2e8f0; padding: 22px 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #60a5fa, #a78bfa); color: white; font-weight: 800; }
.brand h1 { font-size: 17px; margin: 0; }
.brand p { font-size: 12px; margin: 3px 0 0; color: #94a3b8; }
.nav { display: grid; gap: 8px; }
.nav a { padding: 11px 12px; border-radius: 12px; color: #cbd5e1; display: flex; justify-content: space-between; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-foot { position: absolute; bottom: 20px; left: 18px; right: 18px; font-size: 12px; color: #94a3b8; line-height: 1.6; }

.main { padding: 24px 28px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.title h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.title p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; align-items: center; }
.btn { border: 1px solid var(--line); background: white; padding: 10px 14px; border-radius: 12px; cursor: pointer; }
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.input { background: white; border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; min-width: 220px; }

.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.2fr 0.8fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 30px; font-weight: 800; margin-top: 8px; }
.metric-note { color: var(--muted); margin-top: 8px; font-size: 13px; }

.table-wrap { overflow: auto; border-radius: 16px; border: 1px solid var(--line); background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: #f8fafc; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge.gray { background: #f1f5f9; color: #475569; }
.link { color: var(--primary); font-weight: 700; }
.muted { color: var(--muted); }
.path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #334155; background: #f8fafc; border: 1px solid var(--line); padding: 8px; border-radius: 10px; word-break: break-all; }
.detail-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
.health { width: 110px; height: 110px; border-radius: 999px; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--score) * 1%), #e2e8f0 0); }
.health-inner { width: 82px; height: 82px; background: white; border-radius: 999px; display: grid; place-items: center; font-weight: 800; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.footer-note { margin-top: 20px; color: var(--muted); font-size: 13px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-foot { position: static; margin-top: 24px; }
  .grid.cards, .grid.two { grid-template-columns: 1fr; }
}

.tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.tab { min-width: 220px; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 12px; display: grid; gap: 7px; }
.tab span { color: var(--muted); font-size: 12px; }
.tab.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.mini-section { margin-top: 12px; }
.mini-section h4 { margin: 0 0 8px; font-size: 13px; color: #334155; }
.mini-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.mini-row span { color: var(--muted); font-size: 13px; }
.mini-row code { white-space: normal; word-break: break-all; font-size: 12px; color: #0f172a; background: #f8fafc; padding: 4px 6px; border-radius: 8px; }
