:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --accent-2: #2ecc71;
  --border: #2a3542;
  --danger: #e74c3c;
  --side: 220px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: #121820; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1rem 0.75rem;
  overflow-y: auto;
}
.brand { font-weight: 700; letter-spacing: 0.02em; padding: 0.5rem 0.75rem 1rem; }
.side nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.side nav a {
  color: var(--muted); padding: 0.45rem 0.75rem; border-radius: 8px;
  text-decoration: none; font-size: 0.92rem;
}
.side nav a:hover, .side nav a.active { background: var(--panel); color: var(--text); text-decoration: none; }
.side-foot { padding: 1rem 0.75rem 0.25rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); }
.who { margin-bottom: 0.35rem; color: var(--text); }

.main { margin-left: var(--side); padding: 1.5rem 2rem 3rem; min-height: 100vh; }
.main-full { margin-left: 0; display: grid; place-items: center; }

.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 650; }

.period-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tab {
  padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem; text-decoration: none;
}
.tab.on, .tab:hover { background: var(--panel); color: var(--text); border-color: var(--accent); text-decoration: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.card-label { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.35rem; }
.card-value { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--muted); font-weight: 600; }

.report-html { white-space: pre-wrap; font-family: var(--mono); font-size: 0.86rem; line-height: 1.45; }
.report-html b { color: #fff; font-weight: 650; }
.report-html i { color: var(--muted); font-style: normal; }
.report-html code { background: #0c1015; padding: 0.05rem 0.3rem; border-radius: 4px; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }
.table code { font-size: 0.8rem; }

.muted { color: var(--muted); font-size: 0.9rem; }
.err { color: var(--danger); }

.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 2rem; max-width: 420px; text-align: center;
}
.login-card h1 { margin-top: 0; }
.btn {
  display: inline-block; margin-top: 1rem; background: var(--accent); color: #061018;
  font-weight: 650; padding: 0.7rem 1.2rem; border-radius: 10px; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }

@media (max-width: 860px) {
  .side { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .main { margin-left: 0; padding: 1rem; }
}
