/* Brand Analytics page — supplements team-dashboard.css */

/* ── Brand picker bar ─────────────────────────────────── */
.ba-picker-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
}
.ba-picker-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 12px 24px;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.ba-picker-wrap {
    position: relative; display: flex; align-items: center;
    flex: 1; max-width: 480px;
}
.ba-search-icon {
    position: absolute; left: 10px;
    color: var(--ink-mute); pointer-events: none;
}
.ba-search {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--hairline-2);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.ba-search:focus { border-color: var(--accent); background: var(--surface); }

.ba-active-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px; border-radius: 20px;
    background: var(--accent-bg); color: var(--accent);
    font-size: 13px; font-weight: 600;
}
.ba-active-chip button {
    background: none; border: none; cursor: pointer;
    color: var(--accent); font-size: 16px; line-height: 1;
    padding: 0; opacity: 0.7;
}
.ba-active-chip button:hover { opacity: 1; }

/* ── Empty / loading states ───────────────────────────── */
.ba-empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 80px 24px;
    text-align: center;
}
.ba-empty-icon { font-size: 48px; margin-bottom: 16px; }
.ba-empty-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.ba-empty-sub { font-size: 14px; color: var(--ink-mute); max-width: 400px; }

/* ── Content layout ───────────────────────────────────── */
.ba-content-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 20px 24px 60px;
    display: flex; flex-direction: column; gap: 20px;
}

/* ── KPI strip ────────────────────────────────────────── */
.ba-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 0 !important; /* override .kpi-strip defaults */
    background: none !important;
}
.ba-kpi {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-1);
}
.ba-kpi-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--ink-mute);
    margin-bottom: 6px;
}
.ba-kpi-value {
    font-size: 28px; font-weight: 700; color: var(--ink);
    line-height: 1;
}
.ba-kpi-sub {
    font-size: 12px; color: var(--ink-mute); margin-top: 4px;
}
.ba-kpi-value.good { color: var(--good); }
.ba-kpi-value.warn { color: var(--warn); }

/* ── Rep grid (active + inactive columns) ────────────── */
.ba-rep-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 0;
    border-top: 1px solid var(--hairline);
}
.ba-rep-grid > div:first-child {
    padding: 16px 0;
    border-right: 1px solid var(--hairline);
}
.ba-inactive-section {
    padding: 16px 20px;
}
.ba-inactive-section .subheading {
    margin-bottom: 10px;
}
.ba-inactive-chip {
    display: inline-block;
    margin: 0 4px 6px 0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    color: var(--ink-mute);
}

/* ── Notes ────────────────────────────────────────────── */
.ba-notes-list {
    padding: 0 20px;
}
.ba-note {
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
}
.ba-note:last-child { border-bottom: none; }
.ba-note-head {
    display: flex; align-items: baseline; gap: 8px;
    flex-wrap: wrap;
    font-size: 12px; color: var(--ink-mute);
    margin-bottom: 4px;
}
.ba-note-head strong { color: var(--ink-2); font-weight: 600; font-size: 12px; }
.ba-note-wine { color: var(--accent); font-size: 11px; font-weight: 500; }
.ba-note-text { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.ba-note-out {
    font-size: 11px; padding: 1px 6px; border-radius: 4px;
    background: var(--surface-2); color: var(--ink-2);
}
.ba-note-out.sampled  { background: color-mix(in srgb,#22c55e 12%,transparent); color:#16a34a; }
.ba-note-out.ordered  { background: color-mix(in srgb,#3b82f6 12%,transparent); color:#1d4ed8; }
.ba-note-out.follow_up,.ba-note-out.follow { background: color-mix(in srgb,#f59e0b 12%,transparent); color:#b45309; }
.ba-note-out.declined { background: color-mix(in srgb,#ef4444 10%,transparent); color:#b91c1c; }

.ba-sent-pos { color: var(--good); font-size: 11px; }
.ba-sent-neg { color: var(--bad);  font-size: 11px; }

/* ── Weekly trend bar chart ───────────────────────────── */
.ba-trend-chart {
    padding: 16px 20px 8px;
    overflow-x: auto;
}
.ba-trend-bars {
    display: flex; align-items: flex-end; gap: 8px;
    min-height: 100px;
}
.ba-trend-week {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; flex: 1; min-width: 44px;
}
.ba-trend-bars-pair {
    display: flex; align-items: flex-end; gap: 3px;
    height: 80px;
}
.ba-bar {
    width: 14px; border-radius: 3px 3px 0 0;
    transition: opacity .15s;
}
.ba-bar-shows   { background: var(--accent); opacity: 0.25; }
.ba-bar-samples { background: var(--accent); }
.ba-trend-label { font-size: 10px; color: var(--ink-mute); white-space: nowrap; }
.ba-trend-legend {
    display: flex; gap: 14px; padding: 10px 0 4px;
    font-size: 11px; color: var(--ink-mute);
}
.ba-trend-legend span { display: flex; align-items: center; gap: 5px; }
.ba-legend-dot {
    width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}

/* ── Filter bar ───────────────────────────────────────── */
.ba-filter-bar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 4px 0 8px;
}
.ba-filter-ctrl {
    padding: 6px 10px; font-size: 13px; height: 32px;
    border: 1px solid var(--hairline-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink-2);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color .15s;
}
.ba-filter-ctrl:focus { border-color: var(--accent); }
.ba-filter-ctrl[type="search"] { min-width: 200px; }
.ba-filter-clear {
    padding: 5px 12px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--hairline-2); border-radius: var(--radius-sm);
    background: transparent; color: var(--ink-mute);
    cursor: pointer; font-family: var(--font-sans); height: 32px;
    transition: color .15s, border-color .15s;
}
.ba-filter-clear:hover { color: var(--ink-2); border-color: var(--ink-mute); }

/* ── Rep accounts sub-table ───────────────────────────── */
tr.rep-row { cursor: pointer; }
tr.rep-row td:first-child::before {
    content: '▸ ';
    font-size: 10px;
    color: var(--ink-mute);
    transition: transform .15s;
}
tr.rep-row.expanded td:first-child::before { content: '▾ '; }
tr.rep-accts-row { background: var(--surface-2); }
tr.rep-accts-row td { padding: 0 !important; }
.ba-accts-wrap { padding: 8px 16px 12px; }
.ba-accts-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px;
}
.ba-accts-table th {
    padding: 4px 10px; text-align: left;
    font-size: 11px; font-weight: 600; color: var(--ink-mute);
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid var(--hairline);
}
.ba-accts-table th.num, .ba-accts-table td.num { text-align: right; }
.ba-accts-table td {
    padding: 5px 10px; border-bottom: 1px solid var(--hairline);
    color: var(--ink-2);
}
.ba-accts-table tr:last-child td { border-bottom: none; }

/* ── Feedback snippets (expandable in SKU rows) ────────── */
.ba-snippets {
    display: none;
    padding: 8px 12px;
    background: var(--surface-2);
    border-top: 1px solid var(--hairline);
}
tr.sku-expanded + tr .ba-snippets { display: block; }
.ba-snippet-item {
    font-size: 12px; color: var(--ink-2);
    padding: 3px 0; border-bottom: 1px solid var(--hairline);
}
.ba-snippet-item:last-child { border-bottom: none; }

/* ── Sentiment bar (reused from team-dashboard) ─────────── */
.sentiment-bar {
    display: flex; height: 6px; border-radius: 3px; overflow: hidden; min-width: 60px;
}
.s-pos { background: var(--good); }
.s-neu { background: var(--hairline-2); }
.s-neg { background: var(--bad); }
.sentiment-legend { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* ── Sample rate coloring ─────────────────────────────── */
.rate-high { color: var(--good);  font-weight: 600; }
.rate-mid  { color: var(--warn);  font-weight: 600; }
.rate-low  { color: var(--bad);   font-weight: 500; }

.ba-date-input {
    font-size: 13px; padding: 5px 8px;
    border: 1px solid var(--hairline); border-radius: 6px;
    background: var(--surface); color: var(--ink-body);
    cursor: pointer;
}

@media (max-width: 760px) {
    .ba-rep-grid { grid-template-columns: 1fr; }
    .ba-rep-grid > div:first-child { border-right: none; border-bottom: 1px solid var(--hairline); }
    .ba-content-inner { padding: 12px 12px 40px; }
}
