.bp { display: grid; grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 24px; align-items: start; }
@media (max-width: 800px) { .bp { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 16px; } }
.muted { color: var(--muted); }
.small { font-size: 13px; margin: 0; }

.side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; }
@media (max-width: 800px) { .side { position: static; } }
.agency { margin: 0; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { flex: none; color: var(--accent); }
.brand-name { margin: 0; font-size: 17px; font-weight: 600; }
.label { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.presets { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 800px) { .presets { flex-direction: row; flex-wrap: wrap; } }
.preset { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.preset:hover { border-color: var(--line); }
.preset[aria-pressed='true'] { background: var(--bg); border-color: var(--line); font-weight: 600; }
.dates { display: grid; gap: 8px; }
.dates label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.dates input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-width: 0; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.logout { font-size: 13px; color: var(--muted); }

.main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; }
.take { margin: 8px 0 0; }
.take b { font-weight: 600; }
.error { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 12px; }
.kpi, .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.kpi-l { margin: 0; font-size: 13px; color: var(--muted); }
.kpi-v { margin: 4px 0 0; font-family: var(--serif); font-size: 28px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 12px; }
.card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.note { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }

.loading .kpi-v, .loading .take, .loading .chart, .loading .types, .loading .table tbody { opacity: .45; transition: opacity .3s; }

.chart { position: relative; min-height: 240px; }
.chart svg { display: block; width: 100%; height: auto; }
.gl { stroke: var(--grid); stroke-width: 1; }
.tick { font-size: 12px; fill: var(--muted); font-family: var(--sans); }
.bar { fill: var(--accent); transition: opacity .15s; }
.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 8px 10px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tip .h { color: var(--muted); margin-bottom: 2px; }

.types { display: flex; flex-direction: column; gap: 14px; min-height: 160px; }
.type-head { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.type-val { color: var(--muted); }
.bar-bg { height: 10px; border-radius: 6px; background: var(--grid); margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.empty { margin: 0; color: var(--muted); font-size: 13px; }

.tablewrap { overflow: auto; max-height: 34rem; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { position: sticky; top: 0; background: var(--panel); text-align: right; font-weight: 600; border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.table th:nth-child(-n+2), .table td:nth-child(-n+2) { text-align: left; }
.table th button { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; }
.table th[aria-sort='ascending'] button::after { content: ' \2191'; }
.table th[aria-sort='descending'] button::after { content: ' \2193'; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.table td:first-child { white-space: normal; min-width: 13rem; }
.table td.msg { text-align: center; color: var(--muted); }
.table tfoot td { font-weight: 600; border-bottom: 0; }

.notes { font-size: 13px; color: var(--muted); }
.notes summary { cursor: pointer; }
.notes dt { color: var(--fg); margin-top: 8px; }
.notes dd { margin: 0; }
