:root {
  --bg: #0d1117; --panel: #161b22; --border: #222b36; --text: #e6edf3;
  --muted: #8b97a7; --accent: #4da3ff; --pos: #3fb950; --neg: #f85149;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text); font-family: system-ui, sans-serif;
  margin: 0; padding: 0;
}
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem; width: 320px;
}
.login-card h1 { font-size: 1.1rem; margin: 0 0 1.25rem; }
.login-card label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0.25rem; }
.login-card input {
  width: 100%; padding: 0.5rem 0.6rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem;
}
.login-card button {
  margin-top: 1.25rem; width: 100%; padding: 0.6rem; background: var(--accent);
  color: #06121f; border: none; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.error { color: var(--neg); font-size: 0.85rem; margin: 0 0 0.5rem; }

.container { max-width: 1080px; margin: 0 auto; padding: 1.5rem; }
.header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.header h1 { font-size: 1.2rem; margin: 0; }
.header a { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; }
.card .k { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.card .v { font-size: 1.15rem; font-weight: 600; margin-top: 0.2rem; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 0.95rem; margin: 0 0 0.75rem; }
.muted { color: var(--muted); font-size: 0.85rem; }
.commentary p { white-space: pre-wrap; line-height: 1.5; font-size: 0.92rem; }
.commentary h3 { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 1rem 0 0.35rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; }
.legend .item { display: flex; align-items: center; gap: 0.3rem; }
.legend .swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .swatch.dash { border-top: 2px dashed currentColor; background: none !important; height: 0; }
.hidden { display: none; }

.stats-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.stats-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
.stats-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table tr:last-child td { border-bottom: none; }
.footnote { color: var(--muted); font-size: 0.78rem; margin: 0.5rem 0 0; }

.legend .item.toggleable { cursor: pointer; user-select: none; }
.legend .item.toggleable:hover { opacity: 0.7; }
.legend .item.off { opacity: 0.35; }

.chart-tip {
  position: absolute; display: none; pointer-events: none; z-index: 5;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.65rem; font-size: 0.8rem; color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); min-width: 160px;
}
.chart-tip .date { color: var(--muted); font-size: 0.72rem; margin-bottom: 0.25rem; }
.chart-tip .row { display: flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0; white-space: nowrap; }
.chart-tip .row b { margin-left: auto; padding-left: 0.8rem; font-variant-numeric: tabular-nums; }
.chart-tip .dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
