:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --line: #243041;
  --accent: #38bdf8;
  --good: #22c55e;
  --warn: #facc15;
  --bad: #ef4444;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-bottom: 1px solid var(--line); background: #020617;
}
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.container { max-width: 1500px; margin: 0 auto; padding: 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 18px;
}
.card.collapsed table,
.card.collapsed .muted,
.card.collapsed .toolbar,
.card.collapsed .section-sub,
.card.collapsed .grid,
.card.collapsed .list { display: none; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat {
  background: #0b1220; border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat strong { font-size: 20px; display: block; }
.muted { color: var(--muted); }
.right-note { margin-left: auto; text-align: right; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.sortable-head { cursor: pointer; user-select: none; }
.sortable-head::after { content: ' ↕'; font-size: 12px; color: var(--muted); }
.sortable-head[data-sort-direction='asc']::after { content: ' ↑'; }
.sortable-head[data-sort-direction='desc']::after { content: ' ↓'; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .toolbar button, .btn-secondary {
  background: #0b1220; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.toolbar input { flex: 1; min-width: 240px; }
.btn-secondary { cursor: pointer; }
.list { margin: 0; padding-left: 18px; }
.is-good { color: var(--good); font-weight: 600; }
.is-warn { color: var(--warn); font-weight: 600; }
.is-bad { color: var(--bad); font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
}
@media (max-width: 1100px) {
  .grid-2, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
