:root {
  --bg: #08080a; --card: #121214; --card2: #18181b; --ink: #f3efe6; --muted: #9a958a; --line: #26252a;
  --gold: #c9a24b; --gold-2: #e3c988; --gold-soft: rgba(201,162,75,.14); --gold-ink: #17120a;
  --good: #3fcf8e; --bad: #f0605a; --blue: #5aa9ff; --warn: #e89a4c; --soft: #1e1e22;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 1180px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(90px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
h1 span { color: var(--gold); }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin: 30px 0 10px; font-weight: 650; }
h2 small { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; margin-left: 8px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; min-height: 40px; }
button:hover { border-color: #3a3840; }
button.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: transparent; font-weight: 700; }
button.ghost { background: transparent; }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
input, select { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; min-height: 40px; width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
a { color: var(--gold-2); }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.top .grow { flex: 1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button.on { background: var(--gold-soft); color: var(--gold-2); border-color: var(--gold); font-weight: 650; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; }
.month { display: flex; align-items: center; gap: 4px; }
.month b { min-width: 140px; text-align: center; font-size: 16px; }
.month b::first-letter { text-transform: uppercase; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.kpi .n { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.main { border-color: var(--gold); background: linear-gradient(180deg, rgba(201,162,75,.10), var(--card)); }
.pos { color: var(--good); } .neg { color: var(--bad); } .gold { color: var(--gold-2); } .muted { color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wide { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cc .name { font-weight: 650; }
.cc .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc .val { font-size: 21px; font-weight: 700; margin: 10px 0 8px; font-variant-numeric: tabular-nums; }
.cc .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 7px; gap: 8px; }
.meter { height: 7px; border-radius: 7px; background: var(--soft); overflow: hidden; position: relative; }
.meter i { display: block; height: 100%; background: var(--gold); border-radius: 7px; }
.meter i.hot { background: var(--bad); } .meter i.g { background: var(--good); } .meter i.b { background: var(--blue); }
.meter u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .7; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.g { background: rgba(63,207,142,.13); color: var(--good); } .tag.r { background: rgba(240,96,90,.13); color: var(--bad); } .tag.o { background: var(--gold-soft); color: var(--gold-2); }
.row3 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(60px, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.row3 > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row3 .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row3 .v small { display: block; font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: baseline; }
details.g { border-top: 1px solid var(--line); }
details.g:first-of-type { border-top: 0; }
details.g > summary { list-style: none; cursor: pointer; }
details.g > summary::-webkit-details-marker { display: none; }
details.g[open] > summary { color: var(--gold-2); }
.subs { padding: 2px 0 10px 17px; }
.subs .row3 { font-size: 13px; padding: 4px 0; color: var(--muted); }
.donutwrap { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: center; }
.donut { position: relative; width: 190px; height: 190px; }
.donut .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .c b { font-size: 19px; font-variant-numeric: tabular-nums; } .donut .c span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.flow { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.flow > button { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 5px; padding: 4px 2px; border: 0; border-radius: 8px; background: transparent; min-height: 0; }
.flow > button.cur { background: var(--gold-soft); }
.flow .bars { display: flex; align-items: flex-end; gap: 2px; flex: 1; }
.flow .bars i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.flow .lab { font-size: 10.5px; color: var(--muted); text-align: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.stack { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.stack i { display: block; height: 100%; min-width: 2px; }
.heat { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.heat th { font-weight: 500; color: var(--muted); padding: 5px 4px; text-align: right; }
.heat th:first-child, .heat td:first-child { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--card); padding-right: 10px; }
.heat td { padding: 6px 4px; text-align: right; border-top: 1px solid var(--line); border-radius: 4px; }
.heat tr.tot td { font-weight: 700; border-top: 2px solid var(--gold); }
.scroll { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars div { flex: 1; background: var(--gold); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars div.dim { background: var(--soft); } .bars div.r { background: var(--bad); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.tx { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.tx:first-child { border-top: 0; }
.tx .d { font-size: 12px; color: var(--muted); }
.tx .desc { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.tx .v { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; white-space: nowrap; }
.tx select { width: auto; min-height: 24px; padding: 0 6px; font-size: 12px; border-radius: 20px; background: var(--soft); border-color: transparent; max-width: 190px; }
.tx > div { min-width: 0; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.notice { border-left: 3px solid var(--gold); padding: 10px 14px; background: var(--card); border-radius: 0 12px 12px 0; margin-bottom: 12px; font-size: 14px; }
.steps { counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item .grow { flex: 1; min-width: 160px; }
.inline { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: end; }
.login { max-width: 380px; margin: 12vh auto 0; }
.msg { margin-top: 10px; font-size: 14px; min-height: 20px; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--good); }
.big3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.big3 div b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.big3 div span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); } .kpi.main { grid-column: 1 / -1; }
  .two, .three, .wide { grid-template-columns: 1fr; } .inline { grid-template-columns: 1fr; }
  .donutwrap { grid-template-columns: 1fr; justify-items: center; } .donutwrap > div:last-child { width: 100%; }
  .big3 { grid-template-columns: 1fr 1fr; }
  .filters select, .filters input { flex: 1; min-width: 0; }
  .flow { gap: 2px; } .flow .lab { font-size: 9px; }
}
