:root {
  --bg: #0b1220; --bg2: #0e1626; --panel: #141c2e; --panel2: #1a2438;
  --border: #263149; --text: #e6edf7; --muted: #93a1b8; --accent: #4f8cff;
  --good: #2fbf71; --warn: #f5a623; --bad: #e5484d; --info: #5bc0de;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }

/* ---------- Header ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 22px; background: rgba(10,16,29,.92);
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
  z-index: 50; backdrop-filter: blur(8px); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg,#4f8cff 0%,#8b5cf6 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.app-name { font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.tagline { font-size: .72rem; color: var(--muted); line-height: 1.2; }
#cats { display: flex; gap: 6px; flex-wrap: wrap; }
#cats button {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 13px; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: .15s; font-family: inherit;
}
#cats button:hover { background: #22304a; }
#cats button.active { background: var(--accent); color: #06101f; border-color: var(--accent); }

/* ---------- Main ---------- */
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 22px 40px; }
h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.28rem; font-weight: 650; margin: 26px 0 10px; }
h3 { font-size: 1.03rem; font-weight: 600; margin: 18px 0 8px; }
.sub { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 15px 17px;
}
.card h4 {
  margin: 0 0 7px; color: var(--muted); font-size: .74rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.value { font-size: 1.7rem; font-weight: 700; line-height: 1.15; }
.small { font-size: .8rem; color: var(--muted); margin-top: 5px; }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .73rem; font-weight: 600; margin: 0 6px 6px 0; border: 1px solid transparent;
}
.chip.ok { background: rgba(47,191,113,.15); color: #6fe0a5; border-color: rgba(47,191,113,.4); }
.chip.warn { background: rgba(245,166,35,.15); color: #ffcb6b; border-color: rgba(245,166,35,.4); }
.chip.bad { background: rgba(229,72,77,.16); color: #ff9598; border-color: rgba(229,72,77,.45); }
.chip.info { background: rgba(91,192,222,.14); color: #9be0f5; border-color: rgba(91,192,222,.4); }
.chip.neutral { background: rgba(147,161,184,.14); color: #c3cede; border-color: rgba(147,161,184,.35); }

.note {
  background: rgba(91,192,222,.08); border-left: 3px solid var(--info);
  padding: 9px 13px; border-radius: 0 8px 8px 0; font-size: .86rem; color: #cfeaf5;
  margin: 12px 0;
}
.warnbox {
  background: rgba(245,166,35,.09); border-left: 3px solid var(--warn);
  padding: 9px 13px; border-radius: 0 8px 8px 0; font-size: .86rem; color: #ffe2b0; margin: 12px 0;
}
.badbox {
  background: rgba(229,72,77,.10); border-left: 3px solid var(--bad);
  padding: 9px 13px; border-radius: 0 8px 8px 0; font-size: .86rem; color: #ffc3c5; margin: 12px 0;
}

table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; }
tr:hover td { background: rgba(255,255,255,.02); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }

.bar { height: 8px; background: #22304a; border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 6px; }

.empty {
  text-align: center; padding: 34px 20px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px;
}
.empty .t { font-size: 1.1rem; font-weight: 700; }
.empty .m { color: var(--muted); font-size: .88rem; margin-top: 7px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend span::before { content: '●'; margin-right: 5px; }

/* ---------- Footer ---------- */
#foot {
  border-top: 1px solid var(--border); background: rgba(10,16,29,.92);
  padding: 18px 22px 22px; margin-top: auto;
}
#footer-nav { max-width: 1180px; margin: 0 auto; }
.fcat { margin-bottom: 12px; }
.fcat-title {
  font-size: .78rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.flinks { display: flex; flex-wrap: wrap; gap: 7px; }
.flinks a {
  color: var(--accent); text-decoration: none; font-size: .81rem;
  padding: 4px 10px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 6px; transition: .15s;
}
.flinks a:hover { background: #22304a; }
.flinks a.active { background: var(--accent); color: #06101f; border-color: var(--accent); }
.foot-status {
  max-width: 1180px; margin: 14px auto 0; text-align: center;
  font-size: .73rem; color: var(--muted);
}

@media (max-width: 720px) {
  #topbar { flex-direction: column; align-items: stretch; }
  #cats { justify-content: center; }
}
