/* --- 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; }
}

/* Monthly P&L */
.pnl-month { width: auto; }
.pnl-card { padding: 8px 0; }
.pnl-card > .small { padding: 0 16px 8px; }
.pnl-scroll { overflow-x: auto; }
.pnl-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.pnl-table th, .pnl-table td { padding: 7px 16px; text-align: left; border-top: 1px solid var(--hairline, var(--border)); }
.pnl-table thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.pnl-table tbody th { font-weight: 400; padding-left: 28px; }
.pnl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 1%; }
.pnl-table tr.pnl-sub th, .pnl-table tr.pnl-sub td { font-weight: 600; }
.pnl-table tr.pnl-sub th { padding-left: 16px; }
.pnl-table tr.pnl-total th, .pnl-table tr.pnl-total td { font-weight: 700; padding-left: 16px; border-top: 1px solid var(--border-strong, var(--border)); }
.pnl-table tr.pnl-total td.num { padding-left: 8px; }
.pnl-table tr.pnl-bottom th, .pnl-table tr.pnl-bottom td { border-bottom: 3px double var(--border-strong, var(--border)); }
.pnl-table tr.pnl-note td { border-top: 0; padding-top: 0; font-size: 12px; color: var(--text-secondary); padding-left: 16px; }
.pnl-table tr.pnl-gap td { border: 0; padding: 6px; }
.pnl-src { margin-left: 6px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.pnl-inline { gap: 6px; align-items: center; flex: 0 0 auto; }
.pnl-small-input { width: 76px !important; flex: none !important; }
.pnl-entry, .pnl-asset { grid-template-columns: 72px minmax(0, 1fr) auto minmax(0, 1.6fr) auto; }
.pnl-asset { grid-template-columns: 72px minmax(0, 1fr) auto minmax(0, 1.6fr); }
.pnl-actions { gap: 6px; justify-content: flex-end; }
.pnl-weeks { gap: 6px; flex-wrap: wrap; }
.pnl-beans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
@media (max-width: 600px) {
    .pnl-entry { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
    .pnl-asset { grid-template-columns: 64px minmax(0, 1fr) auto; }
    .pnl-entry .small, .pnl-asset .small { grid-column: 1 / -1; grid-row: 2; }
}

/* The logo goes Home */
.logo-link { color: inherit; text-decoration: none; }
.sidebar a.brand { display: block; padding: 22px 0 14px; border-radius: 0; background: none; }
.sidebar a.brand::before { content: none; }

/* Home: ask box, what needs you, and each person's cards */
.home-ask { display: flex; gap: 8px; margin: 4px 0 16px; }
.home-ask input { flex: 1 1 auto; min-width: 0; }
.home-ask button { flex: none; }
.home-answer { margin-bottom: 16px; }
.home-answer > .home-card { border-color: var(--brand); }
.home-answer-actions { gap: 8px; }
.home-notices { margin-bottom: 16px; }
.home-cards-head { align-items: center; margin: 8px 0 10px; }
.home-cards-head h2 { margin: 0; }
.home-add { gap: 8px; margin-bottom: 12px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.home-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-card { min-width: 0; }
.home-card-head { align-items: flex-start; gap: 8px; }
.home-card-head h2 { margin: 0; font-size: 17px; }
.home-card-edit { gap: 6px; justify-content: flex-end; }
.home-figures { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; }
.home-figures > div { display: flex; flex-direction: column; }
.home-figure { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.home-list { display: flex; flex-direction: column; }
.home-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--border); color: inherit; }
.home-row:first-child { border-top: 0; }
.home-row > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.home-notice { text-decoration: none; }
a.home-notice:hover > :first-child { text-decoration: underline; }
.home-notice.urgent > :first-child { color: var(--danger-ink); }
@media (max-width: 600px) {
    .home-grid { grid-template-columns: minmax(0, 1fr); }
    .home-row { grid-template-columns: minmax(0, 1fr) auto; }
    .home-row > .muted { grid-column: 1; grid-row: 2; }
    .home-row > .home-num { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}
.pnl-stale { opacity: .55; transition: opacity .2s; }
@media (max-width: 600px) {
    .pnl-table { min-width: 0; font-size: 13px; }
    .pnl-table th, .pnl-table td { padding: 6px 6px; }
    .pnl-table th:first-child, .pnl-table td:first-child { padding-left: 12px; }
    .pnl-table tbody th { padding-left: 20px; }
    .pnl-table tr.pnl-sub th, .pnl-table tr.pnl-total th, .pnl-table tr.pnl-note td { padding-left: 12px; }
    .pnl-table td:last-child, .pnl-table th:last-child { padding-right: 12px; }
    .pnl-src { display: block; margin-left: 0; }
}
