[hidden] { display: none !important; }
:root {
  --bg: #0d0f13; --card: #161920; --card2: #1c2029; --line: #262b36; --text: #e8eaef; --muted: #8f97a4;
  --yt: #ff4e45; --tw: #a970ff; --accent: #6aa9ff; --err: #ff6b6b; --ok: #3ecf8e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-inline: 16px; }
h1 { font-size: 18px; margin: 0; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
h1 img { width: 26px; height: 26px; }
h2 { font-size: 14px; margin: 0; font-weight: 600; }
a { color: inherit; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--err); }
.yt { color: var(--yt); } .tw { color: var(--tw); }

input, select, button { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
button { cursor: pointer; }
button:hover { border-color: #3a4150; }
button.primary { background: var(--accent); border-color: var(--accent); color: #0b1220; font-weight: 600; }
button.ghost { background: transparent; }
input[type="date"] { padding: 5px 8px; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login form { width: min(360px, 100%); display: grid; gap: 10px; padding: 24px; }
.login label { color: var(--muted); font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; max-width: 1280px; margin: 0 auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--card); padding: 6px 10px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: #0b1220; font-weight: 600; }
.menu { position: absolute; right: 0; top: 100%; display: grid; gap: 6px; padding: 8px; }
.menu button { text-align: left; }

.chips { max-width: 1280px; margin: 0 auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 13px; }
.chip button { border: 0; background: transparent; padding: 0 6px; color: var(--muted); }

main { max-width: 1280px; margin: 12px auto 24px; display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.chart { position: relative; height: 260px; }
.chart.tall { height: 300px; }

.heatmap { display: grid; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; }
.heatmap .cell { aspect-ratio: 1; border-radius: 3px; background: var(--card2); }
.heatmap .lbl { color: var(--muted); display: flex; align-items: center; justify-content: center; }

.table-wrap { overflow-x: auto; max-height: 520px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--card); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.title { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--card2); }
.bar { height: 6px; border-radius: 3px; background: var(--line); min-width: 60px; }
.bar > i { display: block; height: 100%; border-radius: 3px; }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--card2); color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
footer { max-width: 1280px; margin: 0 auto 32px; }
.empty { color: var(--muted); padding: 20px; text-align: center; }
