/* --- Insights tabs: the numbers pages as one place --------------------- */
.insights-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.insights-tabs::-webkit-scrollbar { display: none; }
.insights-tab { flex: 0 0 auto; padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--text-secondary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.insights-tab:hover { color: var(--text); }
.insights-tab.active { color: var(--text); border-bottom-color: var(--brand); }

/* --- Sales reports ------------------------------------------------------ */
.report-head { align-items: flex-start; gap: 12px; }
.report-controls { gap: 10px; }
.report-range { gap: 10px; align-items: center; flex-wrap: wrap; }
.report-range select { width: auto; }
.report-show summary { cursor: pointer; }
.report-show-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; margin-top: 8px; }
.report-show-item { gap: 8px; align-items: center; min-height: 36px; cursor: pointer; flex-wrap: nowrap; }
.report-show-item input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.report-email input { flex: 1; min-width: 220px; }
.report-tiles { margin: 4px 0 16px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 12px; }
.report-grid > .card { margin: 0; }
.report-grid h2 { margin: 0; font-size: 17px; }
.report-wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }

.report-facts { display: grid; grid-template-columns: 1fr auto; margin: 0; }
.report-facts dt, .report-facts dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--border); }
.report-facts dt { color: var(--text-secondary); }
.report-facts dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Columns for one measure: thin bars, rounded tops on a baseline, a faint grid, the value on hover or focus. */
.col-chart { position: relative; height: calc(var(--chart-h) + 22px); padding-left: 46px; }
.col-grid { position: absolute; left: 46px; right: 0; top: 0; height: var(--chart-h); pointer-events: none; }
.col-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.col-gridline:last-child { border-top-color: var(--border-strong); }
.col-tick { position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: var(--chart-h); }
.col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; outline: none; cursor: default; }
.col-bar { width: 100%; max-width: 28px; margin: 0 auto; background: var(--brand); border-radius: 4px 4px 0 0; transition: opacity .1s; }
.col-plot:hover .col-bar { opacity: .55; }
.col:hover .col-bar, .col:focus .col-bar { opacity: 1; }
.col-label { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.col-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 6px 9px; border-radius: 8px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.col:hover .col-tip, .col:focus .col-tip { display: block; }
.col:first-child .col-tip { left: 0; transform: none; }
.col:last-child .col-tip { left: auto; right: 0; transform: none; }

/* Ranked bars: name, bar, value. */
.bar-list { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, max-content) minmax(60px, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-name { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--fill-muted); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.bar-value { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
@media (max-width: 600px) { .bar-row { grid-template-columns: minmax(0, 1fr) auto; } .bar-track { grid-column: 1 / -1; grid-row: 2; } }

/* Marketing spend, entered by hand. */
.spend-form { gap: 8px; flex-wrap: wrap; align-items: center; }
.spend-form input, .spend-form select { width: auto; flex: 1 1 130px; }
.spend-list { display: flex; flex-direction: column; }
.spend-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
@media (max-width: 600px) { .spend-row { grid-template-columns: 56px minmax(0, 1fr) auto auto; } .spend-row .small { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 600px) {
    .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .report-tiles .value { font-size: 21px; }
}
