/* v2 design system — tokens extracted directly from the Figma file
   (TMT Platform, DqFBAd34nnXPevMAeTVOm6) via the Figma API's node-level
   fill/typography/spacing data, not guessed. Font is Urbanist (variable),
   loaded from Google Fonts in base_v2.html, matching the exact convention
   v1's new_base2.html already uses for Poppins. */

:root {
    /* Colors — every value below is a real fill pulled from the Figma nodes */
    --v2-ink: #151d28;          /* sidebar bg, primary text, dark cards */
    --v2-yellow: #ffda00;       /* brand — buttons, active states, badges */
    --v2-yellow-deep: #d4b200;
    --v2-yellow-pale: #fffbe6;
    --v2-yellow-pale2: #fff099;
    --v2-bg: #f0ece3;           /* page background */
    --v2-bg-alt: #f4f1ea;
    --v2-white: #ffffff;
    --v2-border: #e9e4d9;
    --v2-border-alt: #ddd6ca;
    --v2-muted: #7e8089;
    --v2-muted-warm: #9c8e78;
    --v2-muted-warm2: #c2b8a6;
    --v2-slate: #4a4f57;
    --v2-green: #2f7d4f;
    --v2-green-bg: #f7faf8;
    --v2-green-light: #7cd6a0;
    --v2-brown: #5c4b39;
    --v2-gold-text: #6e5600;    /* text-on-yellow */
    --v2-orange: #f5a623;
    --v2-teal: #0e9b8a;
    --v2-red: #c0392b;          /* errors, losses, 'worse' deltas */

    /* Spacing scale, from the padding/gap values actually used */
    --v2-space-xs: 4px;
    --v2-space-sm: 8px;
    --v2-space-md: 12px;
    --v2-space-lg: 16px;
    --v2-space-xl: 20px;
    --v2-space-2xl: 24px;

    --v2-radius-sm: 6px;
    --v2-radius-md: 10px;
    --v2-radius-lg: 16px;

    --v2-font: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body.v2-app {
    margin: 0;
    font-family: var(--v2-font);
    color: var(--v2-ink);
    background: var(--v2-bg);
    font-size: 14px;
    line-height: 1.45;
}

h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 700; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--v2-muted); }
p { margin: 0 0 8px; color: var(--v2-slate); }
a { color: inherit; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.v2-shell { display: flex; min-height: 100vh; }

.v2-sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--v2-ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: var(--v2-space-lg);
    transition: width 0.15s ease, padding 0.15s ease;
    /* Without this, .v2-shell's flex row stretches the sidebar to match
       .v2-main's height (flex's default align-items: stretch) — on a page
       taller than the viewport, that makes the sidebar itself taller than
       the viewport too, so scrolling the page scrolls the sidebar out of
       view along with it. Pinning it to the viewport height means only the
       page content scrolls; the sidebar stays put. overflow: hidden here
       (not a scrollbar on the sidebar itself) because .v2-sidebar__nav
       below already declares its own overflow-y: auto and is the one
       meant to scroll internally, with brand/search/footer staying fixed
       — it just had nothing constraining its height to scroll within
       until now. */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}
.v2-sidebar__brand { display: flex; align-items: center; gap: var(--v2-space-sm); margin-bottom: var(--v2-space-xl); }
.v2-sidebar__brand img { width: 28px; height: 28px; border-radius: var(--v2-radius-sm); flex-shrink: 0; }
.v2-sidebar__brand-text { flex: 1; min-width: 0; }
.v2-sidebar__brand-name { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.v2-sidebar__brand-sub { font-size: 10px; letter-spacing: 0.08em; color: var(--v2-yellow); font-weight: 700; }
.v2-sidebar__collapse-btn {
    background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.55);
    width: 22px; height: 22px; border-radius: 6px; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 10px; margin-left: auto;
}
.v2-sidebar__collapse-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.v2-sidebar__collapse-btn i { transition: transform 0.15s ease; }
.v2-sidebar__collapse-btn i.is-flipped { transform: rotate(180deg); }
.v2-portfolio__peek-btn i.is-flipped { transform: rotate(180deg); }
.v2-filter-toggle {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    background: none; border: none; cursor: pointer; padding: 0; font: inherit; color: inherit;
}
.v2-filter-toggle i.is-flipped { transform: rotate(180deg); }
/* grid-template-columns alone isn't enough to force one line — inputs have
   a browser-default intrinsic width, and grid items default to
   min-width:auto (which respects that intrinsic size), so the row was
   still overflowing/wrapping past 4 real inputs. min-width:0 on each cell
   plus width:100% on the input is what actually makes them share the row. */
.v2-filter-row { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: var(--v2-space-md); align-items: end; }
.v2-filter-row label { min-width: 0; }
.v2-filter-row input { width: 100%; }

/* ── Call Bank (matches the Figma frame directly) ─────────────────── */
.v2-kpi-card--accent-orange { border-top: 3px solid var(--v2-orange); }
.v2-kpi-card--accent-green { border-top: 3px solid var(--v2-green); }
.v2-kpi-card--accent-teal { border-top: 3px solid var(--v2-teal); }
.v2-kpi-card--accent-yellow { border-top: 3px solid var(--v2-yellow); }

.v2-filters-card {
    background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-lg); margin-bottom: var(--v2-space-xl);
}
.v2-callbank-filters {
    display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: var(--v2-space-md); align-items: end;
    margin-top: var(--v2-space-lg);
}
.v2-callbank-filters label { min-width: 0; }
.v2-input-icon { position: relative; display: block; }
.v2-input-icon i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--v2-muted); font-size: 12.5px; pointer-events: none; }
.v2-input-icon input, .v2-input-icon select { width: 100%; padding-left: 32px; }
.v2-input-icon.is-prefilled input, .v2-input-icon.is-prefilled select {
    border-color: var(--v2-yellow-deep); background: var(--v2-yellow-pale);
}
.v2-modal input[readonly] {
    border-color: var(--v2-yellow-deep); background: var(--v2-yellow-pale); cursor: not-allowed;
}

.v2-file-drop {
    display: flex; align-items: center; justify-content: space-between; gap: var(--v2-space-md);
    border: 1px dashed var(--v2-border); border-radius: var(--v2-radius-md);
    padding: var(--v2-space-md); background: var(--v2-bg-alt);
}
.v2-file-drop__label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--v2-muted); }
.v2-file-drop__label i { color: var(--v2-ink); font-size: 15px; }
.v2-file-drop__name { font-weight: 600; color: var(--v2-ink); }

.v2-callbank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--v2-space-lg); }
@media (max-width: 1000px) { .v2-callbank-grid { grid-template-columns: 1fr; } }

.v2-callbank-card {
    background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg);
    overflow: hidden; display: flex; flex-direction: column;
}
.v2-callbank-card--featured { border-color: var(--v2-yellow); }
.v2-callbank-card__banner {
    background: var(--v2-yellow); color: var(--v2-gold-text); font-weight: 800; font-size: 11.5px;
    letter-spacing: 0.04em; text-transform: uppercase; padding: 10px var(--v2-space-lg);
    display: flex; align-items: center; gap: 6px;
}
.v2-callbank-card__body { padding: var(--v2-space-lg); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.v2-callbank-card__title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.v2-callbank-card__title-row h3 { margin: 0; font-size: 16px; }
.v2-callbank-card__stars { color: var(--v2-yellow-deep); white-space: nowrap; font-size: 12px; flex-shrink: 0; }
.v2-callbank-card__stars i.is-empty { color: var(--v2-border-alt); }
.v2-callbank-card__byline { color: var(--v2-muted); font-size: 13px; margin: 0; }
.v2-callbank-card__meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--v2-muted); }
.v2-callbank-card__meta span { display: flex; align-items: center; gap: 5px; }
.v2-callbank-card__desc { font-size: 13.5px; color: var(--v2-slate); margin: 0; }
.v2-callbank-card__shoutout {
    background: var(--v2-yellow-pale); border-left: 3px solid var(--v2-yellow-deep);
    border-radius: var(--v2-radius-sm); padding: var(--v2-space-md);
}
.v2-callbank-card__shoutout-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--v2-gold-text); margin-bottom: 4px; }
.v2-callbank-card__shoutout p { margin: 0; font-style: italic; font-size: 13px; color: var(--v2-brown); }
.v2-callbank-card__footer { display: flex; gap: 10px; padding: var(--v2-space-md) var(--v2-space-lg); border-top: 1px solid var(--v2-border); margin-top: auto; }
.v2-callbank-card__footer .v2-btn { flex: 1; justify-content: center; }

@media (max-width: 900px) {
    .v2-callbank-filters { grid-template-columns: 1fr 1fr; }
}

/* ── Leaderboard & Contributions (Collection Data) ────────────────── */
.v2-leaderboard__header {
    display: flex; justify-content: space-between; align-items: center; gap: var(--v2-space-lg);
    padding: var(--v2-space-lg) var(--v2-space-xl); border-bottom: 1px solid var(--v2-border);
}
.v2-leaderboard__title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.v2-leaderboard__title i { color: var(--v2-yellow-deep); }
.v2-leaderboard__medal { font-size: 12px; margin-right: 4px; }
.v2-leaderboard__medal--1 { color: #d4af37; }
.v2-leaderboard__medal--2 { color: #9aa0a6; }
.v2-leaderboard__medal--3 { color: #b56a3c; }

/* "Agent breakdown by KPI" — KPI Insights tab. Ranked bar-chart list, one
   tab per KPI, sharing one kpi_insights DB query (per_agent) across all
   4 — switching tabs is pure client-side x-show, no extra request. */
.v2-kpi-breakdown__tabs { display: flex; gap: 4px; padding: 0 var(--v2-space-lg); border-bottom: 1px solid var(--v2-border); overflow-x: auto; }
.v2-kpi-breakdown__tab {
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 13px 14px; font-size: 13px; font-weight: 700; color: var(--v2-muted);
    background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit;
}
.v2-kpi-breakdown__tab.is-active { color: var(--v2-ink); border-bottom-color: var(--v2-yellow-deep); }
.v2-kpi-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 800; color: var(--v2-muted);
}
.v2-kpi-rank--1 { background: #d4af37; color: #fff; }
.v2-kpi-rank--2 { background: #9aa0a6; color: #fff; }
.v2-kpi-rank--3 { background: #b56a3c; color: #fff; }
.v2-kpi-breakdown__country {
    display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
    background: var(--v2-bg-alt); color: var(--v2-muted); font-size: 10.5px; font-weight: 700;
}
.v2-kpi-breakdown__bar-cell { display: flex; align-items: center; gap: var(--v2-space-md); }
.v2-kpi-breakdown__bar-cell .v2-progress { flex: 1; margin: 0; }
.v2-leaderboard__avatar {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.v2-leaderboard__avatar--initials {
    display: flex; align-items: center; justify-content: center;
    background: var(--v2-bg-alt); color: var(--v2-muted); font-size: 10.5px; font-weight: 700;
}

/* ── Agent Explorer ────────────────────────────────────────────────── */
.v2-explorer-split { display: grid; grid-template-columns: 0.62fr 1fr; gap: var(--v2-space-lg); align-items: start; }
@media (max-width: 1000px) { .v2-explorer-split { grid-template-columns: 1fr; } }

.v2-explorer-picker { position: relative; display: inline-flex; align-items: center; }
.v2-explorer-picker select {
    appearance: none; padding: 8px 32px 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.v2-explorer-picker i { position: absolute; right: 12px; pointer-events: none; font-size: 11px; color: var(--v2-muted); }

.v2-explorer-identity { display: flex; align-items: center; gap: var(--v2-space-md); margin: var(--v2-space-lg) 0 var(--v2-space-xl); }
.v2-explorer-identity__avatar { width: 60px; height: 60px; font-size: 20px; }
.v2-explorer-identity__name { font-size: 19px; font-weight: 800; }
.v2-explorer-identity__sub { color: var(--v2-muted); font-size: 13px; }

.v2-explorer-gauges-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); margin-bottom: var(--v2-space-md); }
.v2-explorer-gauge { margin-bottom: var(--v2-space-lg); }
.v2-explorer-gauge__row { display: flex; justify-content: space-between; font-size: 13.5px; }
.v2-explorer-gauge .v2-progress__bar { background: var(--v2-orange); }
.v2-explorer-gauge .v2-progress__bar--met { background: var(--v2-green); }
.v2-explorer-gauge__foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--v2-muted); margin-top: 6px; }
.v2-explorer-status--behind { color: var(--v2-red); font-weight: 700; }
.v2-explorer-status--met { color: var(--v2-green); font-weight: 700; }

.v2-explorer-improve {
    display: flex; gap: 12px; align-items: flex-start; padding: var(--v2-space-md) var(--v2-space-lg);
    background: var(--v2-yellow-pale); border-radius: var(--v2-radius-md); margin-bottom: var(--v2-space-md);
}
.v2-explorer-improve i { color: var(--v2-red); margin-top: 3px; }
.v2-explorer-improve--met { background: var(--v2-green-bg); }
.v2-explorer-improve--met i { color: var(--v2-green); }
.v2-explorer-improve__title { font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em; margin-bottom: 2px; }
.v2-explorer-improve p { margin: 0; font-size: 13px; color: var(--v2-slate); }

/* ── KPI Insights ──────────────────────────────────────────────────── */
.v2-kpi-explain-row {
    display: grid; grid-template-columns: 0.8fr 2fr 1fr; gap: var(--v2-space-xl);
    padding: var(--v2-space-xl); border-bottom: 1px solid var(--v2-border); align-items: start;
}
.v2-kpi-explain-row:last-child { border-bottom: none; }
.v2-kpi-explain-row__label { display: flex; flex-direction: column; gap: 4px; }
.v2-kpi-explain-row__label strong { font-size: 15px; }
.v2-kpi-explain-row__label span { color: var(--v2-muted); font-size: 12px; }
.v2-kpi-explain-row__body p { margin: 0; font-size: 13.5px; color: var(--v2-slate); }
.v2-kpi-explain-row__chips { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
@media (max-width: 900px) {
    .v2-kpi-explain-row { grid-template-columns: 1fr; }
}

/* ── Product & Duration Insights ──────────────────────────────────── */
.v2-relative-bar { width: 120px; height: 8px; border-radius: 999px; background: var(--v2-border); overflow: hidden; }
.v2-relative-bar__fill { height: 100%; background: var(--v2-yellow); border-radius: 999px; }
.v2-pct-good { color: var(--v2-green); font-weight: 700; }
.v2-pct-bad { color: var(--v2-red); font-weight: 700; }
/* Portfolio Insights — same relative-bar, stacked full-width instead of a table cell */
.v2-relative-bar-row { margin-bottom: var(--v2-space-sm); }
.v2-relative-bar-row .v2-relative-bar { width: 100%; }

/* ── Champion Board ────────────────────────────────────────────────── */
.v2-champion-periods { display: flex; justify-content: space-between; align-items: center; margin: var(--v2-space-lg) 0; flex-wrap: wrap; gap: var(--v2-space-sm); }

.v2-champion-banner {
    display: flex; gap: var(--v2-space-md); align-items: flex-start; background: #fff;
    border-left: 3px solid var(--v2-yellow); border-radius: var(--v2-radius-md);
    padding: var(--v2-space-md) var(--v2-space-lg); margin-bottom: var(--v2-space-lg);
}
.v2-champion-banner i { color: var(--v2-yellow-deep); margin-top: 2px; }
.v2-champion-banner strong { display: block; margin-bottom: 2px; }
.v2-champion-banner span { color: var(--v2-muted); font-size: 13px; }

.v2-champion-hero { display: grid; grid-template-columns: 1fr 1fr; gap: var(--v2-space-lg); align-items: stretch; margin-bottom: var(--v2-space-lg); }
@media (max-width: 900px) { .v2-champion-hero { grid-template-columns: 1fr; } }

.v2-champion-position__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(255,255,255,0.5); }
.v2-champion-position__rank { font-size: 42px; font-weight: 800; color: var(--v2-yellow); line-height: 1.1; margin: 4px 0; }
.v2-champion-position__rank span { font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.6); }
.v2-champion-position__change { font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,0.7); margin-bottom: var(--v2-space-lg); }
.v2-champion-position__change--up { color: var(--v2-green-light); }
.v2-champion-position__change--down { color: #e08585; }
.v2-champion-position__stats { display: flex; gap: var(--v2-space-xl); margin-bottom: var(--v2-space-lg); flex-wrap: wrap; }
.v2-champion-position__stats span { display: block; font-size: 11px; color: rgba(255,255,255,0.5); margin-bottom: 2px; }
.v2-champion-position__stats strong { font-size: 15px; }
.v2-champion-position__distance { border-top: 1px solid rgba(255,255,255,0.12); padding-top: var(--v2-space-md); }
.v2-champion-position__distance-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.v2-champion-position__distance-row strong { color: var(--v2-yellow); font-size: 15px; }
.v2-champion-position__distance p { margin: 8px 0 0; font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.5; }

.v2-champion-nextmove { background: var(--v2-yellow-pale); border-color: var(--v2-yellow); display: flex; flex-direction: column; }
.v2-champion-nextmove__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-gold-text); margin-bottom: var(--v2-space-sm); }
.v2-champion-nextmove h2 { margin: 0 0 var(--v2-space-md); font-size: 21px; }
.v2-champion-nextmove__highlight { background: #fff; border-radius: var(--v2-radius-sm); padding: 1px 8px; }
.v2-champion-nextmove p { color: var(--v2-brown); font-size: 13.5px; line-height: 1.6; margin: 0 0 var(--v2-space-lg); flex: 1; }
.v2-champion-nextmove .v2-btn { align-self: flex-start; }

.v2-champion-bottom { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--v2-space-lg); align-items: start; }
@media (max-width: 1100px) { .v2-champion-bottom { grid-template-columns: 1fr; } }

.v2-champion-around-row {
    display: grid; grid-template-columns: 32px 1fr auto auto; gap: var(--v2-space-sm); align-items: center;
    padding: var(--v2-space-md) var(--v2-space-lg); border-bottom: 1px solid var(--v2-border); font-size: 13px;
}
.v2-champion-around-row:last-child { border-bottom: none; }
.v2-champion-around-row--me { background: var(--v2-yellow-pale); }
.v2-champion-around-row__rank { color: var(--v2-muted); font-weight: 700; }
.v2-champion-around-row__name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.v2-champion-around-row__collections { font-weight: 700; text-align: right; }
.v2-champion-around-row__delta { text-align: right; font-size: 12.5px; font-weight: 700; min-width: 70px; }

.v2-champion-avatar-row { display: flex; align-items: center; gap: var(--v2-space-md); margin-bottom: var(--v2-space-lg); }
.v2-champion-ahead-box {
    background: var(--v2-bg-alt); border-radius: var(--v2-radius-md); padding: var(--v2-space-md);
    margin-bottom: var(--v2-space-lg);
}
.v2-champion-ahead-box span { display: block; font-size: 11px; color: var(--v2-muted); margin-bottom: 2px; }
.v2-champion-ahead-box strong { font-size: 20px; }
.v2-champion-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--v2-space-md); }
.v2-champion-mini-stats span { display: block; font-size: 11px; color: var(--v2-muted); margin-bottom: 2px; }
.v2-champion-mini-stats strong { font-size: 14px; }

/* ── Escalation Dashboard ──────────────────────────────────────────── */
.v2-dash-banner {
    display: flex; align-items: center; gap: var(--v2-space-md); background: #fff;
    border: 1px solid var(--v2-border); border-left: 3px solid var(--v2-border);
    border-radius: var(--v2-radius-md); padding: var(--v2-space-md) var(--v2-space-lg);
}
.v2-dash-banner i { font-size: 18px; flex-shrink: 0; }
.v2-dash-banner div { flex: 1; }
.v2-dash-banner strong { display: block; margin-bottom: 2px; }
.v2-dash-banner span { color: var(--v2-muted); font-size: 13px; }
.v2-dash-banner--red { border-left-color: var(--v2-red); }
.v2-dash-banner--red i { color: var(--v2-red); }
.v2-dash-banner--amber { border-left-color: var(--v2-yellow-deep); }
.v2-dash-banner--amber i { color: var(--v2-yellow-deep); }
.v2-status-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }

/* ── Performance & Insights header (market/time/currency placeholder) ─ */
.v2-perf-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--v2-space-lg); flex-wrap: wrap; }
.v2-perf-filters { display: flex; gap: var(--v2-space-lg); }
.v2-perf-filters__field { gap: 4px; }
.v2-perf-filters__field span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--v2-muted); }
.v2-perf-filters__field select {
    border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 12.5px;
    background: #fff; color: var(--v2-ink); cursor: pointer;
}
.v2-perf-filters__field select:disabled { cursor: not-allowed; opacity: 0.7; }

/* Collapsed rail — icon-only, forced-open groups (no room for accordion
   chevrons), text hidden via font-size:0 rather than a template rewrite
   since every .v2-sidebar__link icon already carries its own explicit
   font-size and stays fully visible either way. */
.v2-sidebar.is-collapsed { width: 76px; }
.v2-sidebar.is-collapsed .v2-sidebar__brand { justify-content: center; }
.v2-sidebar.is-collapsed .v2-sidebar__brand-text,
.v2-sidebar.is-collapsed .v2-sidebar__search span,
.v2-sidebar.is-collapsed .v2-sidebar__group-header,
.v2-sidebar.is-collapsed .v2-sidebar__badge,
.v2-sidebar.is-collapsed .v2-sidebar__tag,
.v2-sidebar.is-collapsed .v2-sidebar__footer-name { display: none; }
.v2-sidebar.is-collapsed .v2-sidebar__collapse-btn { margin-left: 0; }
.v2-sidebar.is-collapsed .v2-sidebar__search { justify-content: center; padding: var(--v2-space-md) 0; }
.v2-sidebar.is-collapsed .v2-sidebar__link { font-size: 0; gap: 0; justify-content: center; padding: 10px 0; }
.v2-sidebar.is-collapsed .v2-sidebar__group { margin-top: var(--v2-space-sm); }
.v2-sidebar.is-collapsed .v2-sidebar__footer { justify-content: center; }
.v2-sidebar__search {
    display: flex; align-items: center; gap: var(--v2-space-sm);
    width: 100%;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: var(--v2-radius-md);
    padding: var(--v2-space-md);
    margin-bottom: var(--v2-space-xl);
    font-size: 13px;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    text-align: left;
}
.v2-sidebar__search--cta {
    justify-content: space-between;
    background: var(--v2-yellow); color: var(--v2-ink); border-color: transparent;
    font-weight: 700; margin-bottom: var(--v2-space-sm);
}
.v2-sidebar__search--cta:hover { background: var(--v2-yellow-deep); }
.v2-sidebar.is-collapsed .v2-sidebar__search--cta span { display: none; }
/* flex: 1 + min-height: 0 is what lets this shrink below its content size
   inside .v2-sidebar's own flex column, which is what makes the
   already-declared overflow-y: auto actually scroll instead of pushing
   .v2-sidebar__footer off the bottom of a now viewport-capped sidebar. */
.v2-sidebar__nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.v2-sidebar__section {
    margin: var(--v2-space-lg) 0 var(--v2-space-xs);
    padding: 0 var(--v2-space-md);
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: rgba(255,255,255,0.4);
}
.v2-sidebar__link {
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    padding: 8px var(--v2-space-md);
    border-radius: var(--v2-radius-sm);
    font-size: 13.5px;
    font-weight: 550;
    transition: background 0.12s ease;
}
.v2-sidebar__link i { width: 15px; text-align: center; font-size: 13px; opacity: 0.85; flex-shrink: 0; }
.v2-sidebar__link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.v2-sidebar__link.is-active { background: var(--v2-yellow); color: var(--v2-ink); font-weight: 700; }
.v2-sidebar__link.is-active i { opacity: 1; }
.v2-sidebar__link--top { margin-bottom: var(--v2-space-md); }
.v2-sidebar__badge {
    margin-left: auto; background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85);
    font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.v2-sidebar__link.is-active .v2-sidebar__badge { background: rgba(21,29,40,0.15); color: var(--v2-ink); }
.v2-sidebar__tag {
    margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
    color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px; padding: 1px 6px;
}
.v2-sidebar__group { display: flex; flex-direction: column; }
.v2-sidebar__group-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: none; cursor: pointer;
    margin: var(--v2-space-md) 0 2px; padding: 4px var(--v2-space-md);
    font-family: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(255,255,255,0.45);
}
.v2-sidebar__group-header i { font-size: 10px; transition: transform 0.15s ease; }
.v2-sidebar__group-header i.is-flipped { transform: rotate(-90deg); }
.v2-sidebar__group-body { display: flex; flex-direction: column; gap: 2px; }
.v2-sidebar__footer {
    margin-top: auto; padding-top: var(--v2-space-lg);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: var(--v2-space-sm);
    font-size: 12.5px;
}
.v2-sidebar__footer-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.v2-sidebar__footer-avatar--initials {
    display: flex; align-items: center; justify-content: center;
    background: var(--v2-yellow); color: var(--v2-ink); font-weight: 800; font-size: 12px;
}
.v2-sidebar__footer-name { min-width: 0; }
.v2-sidebar__footer-fullname { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-sidebar__footer-role { opacity: 0.55; font-size: 11px; }
.v2-sidebar__footer-logout { margin-left: auto; color: rgba(255,255,255,0.5); flex-shrink: 0; }
.v2-sidebar__footer-logout:hover { color: #fff; }

.v2-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.v2-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--v2-space-md) var(--v2-space-2xl);
    border-bottom: 1px solid var(--v2-border);
    background: var(--v2-white);
    gap: var(--v2-space-lg);
}
.v2-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--v2-muted); flex-shrink: 0; }
.v2-breadcrumb a { color: var(--v2-slate); }
.v2-breadcrumb i.fa-chevron-right { font-size: 9px; opacity: 0.5; }
.v2-breadcrumb__current { color: var(--v2-ink); font-weight: 700; }

.v2-topbar__filters { display: flex; gap: var(--v2-space-sm); align-items: center; }
.v2-topbar__select {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; border-radius: 999px;
    padding: 5px 10px; font-size: 12px; font-weight: 700; background: var(--v2-bg-alt); color: var(--v2-slate);
    cursor: pointer; white-space: nowrap; position: relative;
}
.v2-topbar__select i:first-child { color: var(--v2-muted); font-size: 10.5px; }
.v2-topbar__select i:last-child { color: var(--v2-muted); font-size: 8px; }
.v2-topbar__select-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
/* The real <select> sits invisibly on top (full-size, transparent) so the
   whole pill is clickable and native — the visible text/icons underneath
   are just for consistent styling across browsers' own select rendering. */
.v2-topbar__select select {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; border: none; cursor: pointer; appearance: none;
}
.v2-topbar__actions { display: flex; align-items: center; gap: var(--v2-space-lg); }

.v2-view-as { display: flex; align-items: center; gap: 8px; }
.v2-view-as__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--v2-muted); }
.v2-view-as__group { display: flex; background: var(--v2-bg-alt); border-radius: 999px; padding: 3px; gap: 2px; }
.v2-view-as__group form { display: contents; }
.v2-view-as__btn {
    font-family: inherit; border: none; background: none; cursor: pointer;
    padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
    color: var(--v2-muted);
}
.v2-view-as__btn.is-active { background: var(--v2-ink); color: #fff; }

.v2-topbar__bell {
    background: none; border: none; width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; color: var(--v2-slate); font-size: 15px; flex-shrink: 0;
}
.v2-topbar__bell:hover { background: var(--v2-bg-alt); }
.v2-topbar__avatar-wrap { position: relative; display: inline-flex; }
.v2-topbar__avatar { display: block; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px solid var(--v2-yellow); text-decoration: none; }
.v2-topbar__avatar img { width: 100%; height: 100%; object-fit: cover; }
.v2-topbar__avatar-initials {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: var(--v2-yellow); color: var(--v2-ink);
    font-size: 12px; font-weight: 800;
}
#topbar-avatar-content, #sidebar-avatar-content { display: contents; }
.v2-topbar__avatar-edit {
    position: absolute; bottom: -2px; right: -2px; width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--v2-ink); color: #fff; border: 2px solid #fff; font-size: 8px; padding: 0; cursor: pointer;
}
.v2-topbar__avatar-edit:hover { background: var(--v2-yellow); color: var(--v2-ink); }

.v2-profile-photo-preview {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden; margin: 0 auto var(--v2-space-lg);
    border: 2px solid var(--v2-yellow);
}
.v2-profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.v2-profile-photo-preview__initials {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: var(--v2-yellow); color: var(--v2-ink);
    font-size: 32px; font-weight: 800;
}

/* Every avatar draws the initials and lays the photo over them. The photo
   link is signed without checking the photo exists, so for someone with no
   photo it fails to load; it then removes itself (onerror) and the initials
   show instead of an empty circle. */
.v2-avatar-stack { position: relative; overflow: hidden; }
.v2-avatar-photo {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; border-radius: inherit;
}

.v2-content { padding: var(--v2-space-2xl) 32px 48px; }

.v2-messages { margin-bottom: var(--v2-space-lg); }
.v2-message { padding: 10px 14px; border-radius: var(--v2-radius-md); margin-bottom: var(--v2-space-sm); font-size: 13px; font-weight: 600; }
.v2-message--warning { background: var(--v2-yellow-pale); color: var(--v2-gold-text); }
.v2-message--error { background: #fdeceb; color: #9b3a2f; }
.v2-message--success { background: var(--v2-green-bg); color: var(--v2-green); }

/* ── Buttons, forms ────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

.v2-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--v2-radius-md); border: 1px solid var(--v2-border-alt);
    background: #fff; color: var(--v2-ink); font-weight: 700; font-size: 13px;
    font-family: inherit; text-decoration: none; cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.v2-btn:hover { box-shadow: 0 2px 8px rgba(21,29,40,0.08); }
.v2-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.v2-btn__spinner { display: none; }
.v2-btn:disabled .v2-btn__spinner { display: inline-flex; }
.v2-btn:disabled .v2-btn__label { display: none; }
.v2-btn--primary { background: var(--v2-yellow); border-color: var(--v2-yellow); color: var(--v2-ink); }
.v2-btn--ghost { background: transparent; }
.v2-btn--dark { background: var(--v2-ink); border-color: var(--v2-ink); color: #fff; }
.v2-btn.is-active { background: var(--v2-ink); color: #fff; border-color: var(--v2-ink); }
.v2-btn--whatsapp { padding: 9px 12px; border-color: #25d366; color: #25d366; font-size: 16px; }
.v2-btn--whatsapp:hover { background: #25d366; color: #fff; }
.v2-btn--sms { padding: 9px 12px; border-color: #2a5b96; color: #2a5b96; font-size: 16px; }
.v2-btn--sms:hover { background: #2a5b96; color: #fff; }

label { font-size: 12.5px; font-weight: 700; color: var(--v2-slate); display: flex; flex-direction: column; gap: 4px; }
input, select, textarea {
    font-family: inherit; font-size: 13.5px; padding: 9px 11px;
    border-radius: var(--v2-radius-sm); border: 1px solid var(--v2-border-alt);
    background: #fff; color: var(--v2-ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--v2-yellow); outline-offset: 1px; }

/* ── Cards / KPI tiles ─────────────────────────────────────────────── */
.v2-home-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--v2-space-xl); gap: var(--v2-space-lg); }
.v2-home-header h1 { font-size: 24px; }
.v2-home-header p { color: var(--v2-muted); font-size: 13.5px; }
.v2-page-sub { color: var(--v2-muted); font-size: 13.5px; margin: -4px 0 var(--v2-space-lg); }

.v2-subnav { display: flex; gap: 4px; background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: 4px; flex-wrap: wrap; }
.v2-subnav__link { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--v2-slate); font-weight: 600; font-size: 12.5px; padding: 8px 14px; border-radius: var(--v2-radius-sm); }
.v2-subnav__link.is-active { background: var(--v2-yellow); color: var(--v2-ink); font-weight: 700; }

.v2-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--v2-space-lg); }
.v2-metric-card { background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg); padding: var(--v2-space-lg) var(--v2-space-xl); }
.v2-metric-card__header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; color: var(--v2-muted); margin-bottom: var(--v2-space-md); }
.v2-metric-card__body { display: flex; gap: var(--v2-space-xl); }
.v2-metric-card__ranking { flex: 1.3; min-width: 0; }
.v2-metric-card__ranking-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.03em; margin-bottom: var(--v2-space-sm); }
.v2-metric-card__rank-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.v2-metric-card__rank-num { color: var(--v2-muted); font-weight: 700; width: 14px; }
.v2-metric-card__rank-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-metric-card__rank-value { font-weight: 700; }
.v2-metric-card__total { flex: 1; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--v2-border); padding-left: var(--v2-space-xl); }
.v2-metric-card__total-value { font-size: 30px; font-weight: 800; }
.v2-metric-card__total-label { font-size: 11px; color: var(--v2-muted); margin-top: 4px; }

.v2-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--v2-space-lg); margin-bottom: var(--v2-space-xl); }
.v2-kpi-card {
    background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-lg);
}
.v2-kpi-card--dark { background: var(--v2-ink); color: #fff; border-color: var(--v2-ink); }
.v2-kpi-card__label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.04em; }
.v2-kpi-card--dark .v2-kpi-card__label { color: rgba(255,255,255,0.55); }
.v2-kpi-card__value { font-size: 26px; font-weight: 800; margin: 6px 0; letter-spacing: -0.01em; }
.v2-kpi-card__sub { font-size: 12px; color: var(--v2-muted); }
.v2-kpi-card__sub-row { display: flex; justify-content: space-between; font-size: 11.5px; color: rgba(255,255,255,0.6); margin-top: 6px; }
.v2-kpi-card a, .v2-kpi-card__link { color: var(--v2-gold-text); font-weight: 700; font-size: 12.5px; text-decoration: none; }

.v2-progress { height: 6px; border-radius: 999px; background: var(--v2-border); overflow: hidden; margin-top: var(--v2-space-sm); }
.v2-kpi-card--dark .v2-progress { background: rgba(255,255,255,0.15); }
.v2-progress__bar { height: 100%; background: var(--v2-green); border-radius: 999px; }
.v2-progress--thin { height: 4px; margin-top: 4px; }

.v2-card {
    background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-xl); margin-bottom: var(--v2-space-lg);
}
.v2-card--dark { background: var(--v2-ink); color: #fff; border-color: var(--v2-ink); }
.v2-card--dark p, .v2-card--dark h3 { color: rgba(255,255,255,0.7); }
.v2-card__meta { font-size: 12px; font-weight: 500; color: var(--v2-muted); float: right; }
.v2-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--v2-space-lg); }
.v2-card__header h2 { margin: 0; }
.v2-card__link { color: var(--v2-gold-text); font-weight: 700; font-size: 12.5px; text-decoration: none; }
.v2-card__sub { color: var(--v2-muted); font-size: 12.5px; margin: -8px 0 var(--v2-space-lg); }
.v2-card h3 { margin-top: var(--v2-space-lg); }

.v2-field-hint { font-size: 11px; color: var(--v2-muted); font-weight: 500; text-transform: none; letter-spacing: 0; margin-top: -8px; align-self: end; }
.v2-form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: var(--v2-space-lg); }

.v2-toggle-row { display: flex; gap: 2px; background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: 4px; width: fit-content; }
.v2-toggle-btn {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--v2-slate);
    font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: var(--v2-radius-sm);
}
.v2-toggle-btn.is-active { background: var(--v2-yellow); color: var(--v2-ink); }

.v2-home-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--v2-space-lg); align-items: start; }
/* Admin/QA/lead's market-wide Home — a 2x2 grid (Core KPIs + Quality
   scores on top, Champion + Leaderboard below) instead of home.html's
   tall single-column stack, so the page fits without scrolling on a
   normal-width screen. Kept to 2 columns rather than 4 across — Core
   KPIs' donut row and Quality's 2-column skill grid both need real width
   to stay readable; squeezing them to quarter-width made them cramped. */
.v2-market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--v2-space-lg); align-items: start; }
@media (max-width: 1100px) {
    .v2-market-grid { grid-template-columns: 1fr; }
}
.v2-leaderboard-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-home-main { min-width: 0; }

/* Segmented control (WTD / MTD / Last month / Custom) */
.v2-segmented { display: flex; background: var(--v2-bg-alt); border-radius: 999px; padding: 3px; gap: 2px; }
.v2-segmented__btn {
    font-family: inherit; border: none; background: none; cursor: pointer;
    padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--v2-muted);
}
.v2-segmented__btn.is-active { background: var(--v2-ink); color: #fff; }

/* Donut rings — pure CSS conic-gradient, no chart library */
.v2-donut-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--v2-space-lg); text-align: center; }
.v2-donut-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.03em; margin-bottom: 10px; }
.v2-donut {
    width: 86px; height: 86px; border-radius: 50%; margin: 0 auto;
    background: conic-gradient(var(--ring-color, var(--v2-orange)) calc(var(--pct) * 1%), var(--v2-border) 0);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.v2-donut::before { content: ''; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.v2-donut__value { position: relative; z-index: 1; font-weight: 800; font-size: 15px; }
.v2-donut-sub { font-size: 11px; color: var(--v2-muted); margin-top: 8px; }

.v2-empty-note { color: var(--v2-muted); font-size: 13px; margin: 0; }

/* Quality scores card */
.v2-quality-headline { display: flex; align-items: baseline; gap: var(--v2-space-md); margin-bottom: var(--v2-space-lg); }
.v2-quality-headline__value { font-size: 34px; font-weight: 800; }
.v2-quality-headline__meta { font-size: 12px; color: var(--v2-muted); line-height: 1.5; }
.v2-quality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--v2-space-lg) var(--v2-space-xl); }
/* Home's market-wide Quality scores card only (home_market.html) — 3
   columns instead of 2 cuts a row off the 5-section breakdown, and a
   tighter headline margin, so this card's height lines up with its
   Core KPIs neighbour in the same grid row instead of running taller. */
.v2-quality-headline--compact { margin-bottom: var(--v2-space-sm); }
.v2-quality-grid--compact { grid-template-columns: repeat(3, 1fr); gap: var(--v2-space-md) var(--v2-space-lg); }
.v2-quality-row__label { font-size: 12.5px; font-weight: 600; }
.v2-quality-row__pct { float: right; font-size: 12.5px; font-weight: 700; color: var(--v2-green); }

/* Market Champion card */
.v2-champion-card { display: flex; flex-direction: column; }
.v2-champion-card__badge { display: flex; align-items: center; gap: var(--v2-space-md); margin-bottom: var(--v2-space-md); }
.v2-champion-avatar {
    width: 74px; height: 74px; border-radius: 50%; background: var(--v2-yellow); color: var(--v2-ink);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; flex-shrink: 0;
}
.v2-champion-avatar--photo { display: block; object-fit: cover; background: var(--v2-bg-alt); }
.v2-champion-tag { background: var(--v2-yellow); color: var(--v2-gold-text); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; }
.v2-champion-card__name { font-size: 18px; font-weight: 800; }
.v2-champion-card__sub { font-size: 12.5px; color: rgba(255,255,255,0.55); margin-bottom: var(--v2-space-lg); }
.v2-champion-card__you { color: rgba(255,255,255,0.75); font-size: 13.5px; }
.v2-champion-compare__caption { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: rgba(255,255,255,0.4); margin-bottom: var(--v2-space-sm); }
.v2-champion-compare__caption span { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; margin-top: 2px; }
.v2-champion-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.v2-champion-table th { text-align: right; font-weight: 600; color: rgba(255,255,255,0.4); font-size: 10.5px; text-transform: uppercase; padding-bottom: 8px; }
.v2-champion-table th:first-child, .v2-champion-table td:first-child { text-align: left; }
.v2-champion-table td { padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.08); text-align: right; color: rgba(255,255,255,0.85); }
.v2-champion-table__champ { color: var(--v2-yellow); font-weight: 700; }
.v2-gap--up { color: var(--v2-green-light); font-weight: 700; }
.v2-gap--down { color: rgba(255,255,255,0.5); font-weight: 700; }

/* ── Account 360 ───────────────────────────────────────────────────── */
.v2-back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--v2-slate); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: var(--v2-space-lg); }

.v2-account-header {
    display: flex; align-items: center; gap: var(--v2-space-lg);
    background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-lg) var(--v2-space-xl); margin-bottom: var(--v2-space-lg);
}
.v2-account-header__id {
    width: 128px; height: 128px; border-radius: 50%; background: var(--v2-bg-alt);
    display: flex; align-items: center; justify-content: center; color: var(--v2-muted); font-size: 44px; flex-shrink: 0;
}
.v2-account-header__id--photo { padding: 0; border: none; cursor: pointer; overflow: hidden; }
.v2-account-header__id--photo img { width: 100%; height: 100%; object-fit: cover; }
.v2-account-header__main { flex: 1; min-width: 0; }
.v2-account-header__name-row { display: flex; align-items: center; gap: var(--v2-space-sm); flex-wrap: wrap; }
.v2-account-header__name-row h1 { font-size: 28px; margin: 0; }
.v2-account-header__meta { color: var(--v2-muted); font-size: 16px; margin-top: 6px; }
.v2-account-header__product { color: #000; font-weight: 700; }
.v2-account-header__actions { display: flex; gap: var(--v2-space-sm); flex-shrink: 0; }

.v2-account-stats { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--v2-space-lg); margin-bottom: var(--v2-space-lg); }
.v2-account-stats__group {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--v2-space-md);
    background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-md) var(--v2-space-lg); flex: 2 1 520px;
}
.v2-account-stats__group--muted { flex: 1 1 420px; grid-template-columns: repeat(4, 1fr); }
.v2-stat__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.03em; margin-bottom: 4px; }
.v2-stat__value { font-size: 15px; font-weight: 800; }
.v2-stat__value--warn { color: var(--v2-red); }
.v2-stat__value--good { color: var(--v2-green); }
.v2-stat__sub { font-size: 11px; color: var(--v2-muted); margin-top: 2px; }

.v2-account-split { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--v2-space-lg); align-items: start; }
.v2-account-main, .v2-account-side { min-width: 0; }

.v2-product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--v2-space-md); margin-bottom: var(--v2-space-lg); }
.v2-product-tile { background: var(--v2-yellow-pale); border: 1px solid var(--v2-yellow-pale2); border-radius: var(--v2-radius-md); padding: var(--v2-space-md); }
.v2-product-tile__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-gold-text); letter-spacing: 0.03em; margin-bottom: 4px; }
.v2-product-tile__value { font-size: 16px; font-weight: 800; }
.v2-product-tile__value span { font-size: 11px; font-weight: 600; color: var(--v2-muted); margin-left: 3px; }

.v2-contact-row { display: flex; justify-content: space-between; gap: var(--v2-space-md); padding: 10px 0; border-top: 1px solid var(--v2-border); font-size: 13px; }
.v2-contact-row:first-of-type { border-top: none; }
.v2-contact-row__date { color: var(--v2-muted); flex-shrink: 0; }
.v2-contact-row__outcome { font-weight: 700; flex: 1; }
.v2-contact-row__agent { color: var(--v2-muted); text-align: right; }

.v2-legend { display: flex; gap: var(--v2-space-md); font-size: 11.5px; color: var(--v2-muted); }
.v2-legend__item { display: flex; align-items: center; gap: 5px; }
.v2-legend__item::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--v2-yellow); display: inline-block; }
.v2-legend__item--outline::before { background: none; border: 1px solid var(--v2-muted-warm2); }

.v2-behaviour-stats { display: flex; gap: var(--v2-space-xl); margin: var(--v2-space-md) 0 var(--v2-space-lg); }
.v2-behaviour-stats__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.03em; margin-bottom: 4px; }
.v2-behaviour-stats__value { font-size: 15px; font-weight: 800; }
.v2-behaviour-stats__value small { font-size: 11px; font-weight: 600; color: var(--v2-muted); }

.v2-behaviour-chart { display: flex; align-items: flex-end; gap: 8px; height: 100px; }
.v2-behaviour-bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.v2-behaviour-bar__track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--v2-bg-alt); border: 1px dashed var(--v2-border-alt); border-radius: 4px; overflow: hidden; }
.v2-behaviour-bar__fill { width: 100%; background: var(--v2-yellow); min-height: 2px; }
.v2-behaviour-bar__fill--empty { background: transparent; }
.v2-behaviour-bar__label { font-size: 10px; color: var(--v2-muted); margin-top: 6px; }

.v2-flag {
    display: flex; align-items: center; gap: var(--v2-space-sm); text-decoration: none; color: var(--v2-ink);
    background: var(--v2-yellow-pale); border: 1px solid var(--v2-yellow-pale2); border-radius: var(--v2-radius-md);
    padding: var(--v2-space-md); margin-bottom: var(--v2-space-sm); font-size: 13px;
}
.v2-flag--warn i.fa-triangle-exclamation { color: var(--v2-orange); }
.v2-flag--ok { background: var(--v2-green-bg); border-color: var(--v2-green-light); }
.v2-flag--ok i { color: var(--v2-green); }
.v2-flag:not(.v2-flag--warn):not(.v2-flag--ok) { background: #fff; border-color: var(--v2-border); color: var(--v2-slate); }
.v2-flag i.fa-chevron-right { margin-left: auto; font-size: 11px; color: var(--v2-muted); }
.v2-flag__title { font-weight: 700; }
.v2-flag__sub { font-size: 11.5px; color: var(--v2-muted); margin-top: 2px; }

.v2-contact-number { padding: 8px 0; border-top: 1px solid var(--v2-border); }
.v2-contact-number:first-of-type { border-top: none; }
.v2-contact-number__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.03em; }
.v2-contact-number__value { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.v2-account-tabs { display: flex; gap: var(--v2-space-sm); margin-bottom: var(--v2-space-lg); flex-wrap: wrap; }
.v2-account-tabs button, .v2-account-tabs a.v2-btn {
    background: #fff; border: 1px solid var(--v2-border-alt); font-weight: 600;
    padding: 8px 14px; border-radius: var(--v2-radius-sm); font-size: 13px;
}
.v2-account-tabs button.is-active, .v2-account-tabs a.is-active {
    background: var(--v2-ink); color: #fff; border-color: var(--v2-ink);
}
.v2-account-tab-panel { background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg); padding: var(--v2-space-xl); }
.v2-account-meta { color: var(--v2-muted); margin-bottom: var(--v2-space-lg); font-size: 13px; }

.v2-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--v2-space-lg); margin: 0 0 var(--v2-space-lg); }
.v2-overview-grid dt { font-size: 11px; text-transform: uppercase; color: var(--v2-muted); letter-spacing: 0.04em; font-weight: 700; }
.v2-overview-grid dd { margin: 4px 0 0; font-size: 15px; font-weight: 700; }

.v2-panel-error { color: var(--v2-muted); font-size: 13px; }

/* ── Portfolio / list rows ─────────────────────────────────────────── */
.v2-portfolio-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--v2-space-lg); gap: var(--v2-space-lg); }
.v2-portfolio-header__lookup {
    display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--v2-border-alt);
    border-radius: var(--v2-radius-md); padding: 0 var(--v2-space-md); width: 280px;
}
.v2-portfolio-header__lookup i { color: var(--v2-muted); font-size: 12px; }
.v2-portfolio-header__lookup input { border: none; padding: 9px 0; flex: 1; }
.v2-portfolio-header__lookup input:focus { outline: none; }

.v2-filter-bar {
    display: flex; align-items: center; gap: var(--v2-space-sm); flex-wrap: wrap;
    background: var(--v2-ink); color: rgba(255,255,255,0.7); border-radius: var(--v2-radius-md);
    padding: var(--v2-space-sm) var(--v2-space-lg); margin-bottom: var(--v2-space-lg); font-size: 12.5px;
}
.v2-filter-bar > i { font-size: 11px; }
.v2-filter-bar__form { display: contents; }
.v2-filter-bar select {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: #fff;
    border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600;
}
.v2-filter-bar__sort { margin-left: auto; color: rgba(255,255,255,0.45); }
.v2-filter-bar__clear { color: var(--v2-yellow); text-decoration: none; font-weight: 700; }

.v2-portfolio { display: flex; gap: var(--v2-space-xl); align-items: flex-start; }
.v2-portfolio__rail { display: flex; flex-direction: column; gap: 4px; width: 240px; flex-shrink: 0; background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-lg); padding: var(--v2-space-md); }
.v2-portfolio__rail-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--v2-muted); padding: 6px var(--v2-space-md) var(--v2-space-sm); }
.v2-portfolio__tray {
    display: flex; justify-content: space-between; padding: 10px var(--v2-space-md); border-radius: var(--v2-radius-md);
    text-decoration: none; color: var(--v2-ink); background: transparent; font-size: 13.5px; font-weight: 600;
}
.v2-portfolio__tray span { color: var(--v2-muted); font-weight: 700; }
.v2-portfolio__tray.is-active { background: var(--v2-yellow); }
.v2-portfolio__tray.is-active span { color: var(--v2-gold-text); }
.v2-portfolio__list { flex: 1; min-width: 0; }
.v2-portfolio__list-band {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--v2-ink); color: #fff; border-radius: var(--v2-radius-md) var(--v2-radius-md) 0 0;
    padding: var(--v2-space-md) var(--v2-space-lg);
}
.v2-portfolio__list-band-title { display: flex; align-items: center; gap: var(--v2-space-sm); font-size: 13.5px; color: rgba(255,255,255,0.75); }
.v2-portfolio__list-band-title strong { color: #fff; }
.v2-portfolio__list-band-warn { color: #f5a2a2; font-weight: 600; font-size: 12.5px; }
.v2-portfolio__list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--v2-space-md); }
.v2-portfolio__list-header span { color: var(--v2-muted); font-weight: 600; font-size: 13px; }
.v2-portfolio__sort {
    display: flex; gap: var(--v2-space-md); background: #fff; border: 1px solid var(--v2-border); border-top: none;
    padding: var(--v2-space-sm) var(--v2-space-lg);
}
.v2-portfolio__sort a { font-size: 12.5px; color: var(--v2-muted); text-decoration: none; font-weight: 600; }
.v2-portfolio__sort a.is-active { color: var(--v2-ink); }
.v2-portfolio__row {
    display: grid; grid-template-columns: 2fr 1.2fr auto; gap: var(--v2-space-md); align-items: center;
    background: #fff; border: 1px solid var(--v2-border); border-top: none; padding: var(--v2-space-md) var(--v2-space-lg);
}
.v2-portfolio__row-side { text-align: right; }
.v2-portfolio__row-meta { font-size: 12px; color: var(--v2-muted); margin-top: 2px; }
.v2-portfolio__row-actions { display: flex; gap: 6px; }
.v2-portfolio__row-peek:not(:empty) { grid-column: 1 / -1; border-top: 1px solid var(--v2-border); margin-top: var(--v2-space-sm); padding-top: var(--v2-space-sm); }
.v2-peek { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--v2-space-sm); font-size: 13px; }
.v2-peek dt { color: var(--v2-muted); font-size: 11px; text-transform: uppercase; font-weight: 700; }
.v2-peek dd { margin: 2px 0 0; font-weight: 700; }

.v2-pagination { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--v2-border); border-top: none; border-radius: 0 0 var(--v2-radius-md) var(--v2-radius-md); padding: var(--v2-space-md) var(--v2-space-lg); font-size: 13px; color: var(--v2-muted); }
.v2-pagination__pages { display: flex; align-items: center; gap: var(--v2-space-sm); }
.v2-pagination__btn { padding: 5px 11px; border-radius: var(--v2-radius-sm); border: 1px solid var(--v2-border-alt); text-decoration: none; color: var(--v2-ink); font-weight: 600; font-size: 12.5px; }
.v2-pagination__btn.is-active { background: var(--v2-ink); color: #fff; border-color: var(--v2-ink); }
.v2-pagination__meta { font-size: 12px; }

/* ── Chips ─────────────────────────────────────────────────────────── */
.v2-chip { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center; }
.v2-chip--hot { background: #fdeceb; color: #9b3a2f; }
.v2-chip--warm { background: var(--v2-yellow-pale); color: var(--v2-gold-text); }
.v2-chip--idle { background: var(--v2-green-bg); color: var(--v2-green); }
.v2-chip--info { background: #eaf1fb; color: #2a5b96; }

.v2-status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.v2-status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.v2-status-dot--hot { color: var(--v2-red); }
.v2-status-dot--warm { color: var(--v2-gold-text); }
.v2-status-dot--idle { color: var(--v2-green); }

.v2-pagination a { color: var(--v2-ink); text-decoration: none; font-weight: 600; }

/* ── Modal + toast ─────────────────────────────────────────────────── */
.v2-modal-overlay { position: fixed; inset: 0; background: rgba(21,29,40,0.45); display: flex; justify-content: flex-end; z-index: 100; }
.v2-modal { background: #fff; width: 400px; max-width: 100%; height: 100%; padding: var(--v2-space-2xl); overflow-y: auto; box-shadow: -18px 0 60px rgba(21,29,40,0.18); }
.v2-modal--wide { width: 560px; }
.v2-modal__header { display: flex; justify-content: space-between; align-items: center; }
.v2-modal__header button { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--v2-muted); }
.v2-modal__sub { color: var(--v2-muted); font-size: 13px; margin-bottom: var(--v2-space-lg); }
.v2-modal form { display: flex; flex-direction: column; gap: var(--v2-space-md); }

/* Look up an account — centered global modal (distinct from the PTP
   right-side drawer above) */
.v2-lookup-overlay {
    position: fixed; inset: 0; background: rgba(21,29,40,0.45);
    display: flex; align-items: center; justify-content: center; z-index: 100; padding: var(--v2-space-lg);
}
.v2-lookup-modal { background: #fff; width: 520px; max-width: 100%; border-radius: var(--v2-radius-lg); padding: var(--v2-space-2xl); }
.v2-lookup-modal__form { margin-top: var(--v2-space-lg); }
.v2-lookup-modal__form label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); margin-bottom: 6px; }
.v2-lookup-modal__row { display: flex; gap: var(--v2-space-sm); }
.v2-lookup-modal__input {
    flex: 1; display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--v2-border-alt); border-radius: var(--v2-radius-md); padding: 0 var(--v2-space-md);
}
.v2-lookup-modal__input i { color: var(--v2-muted); font-size: 13px; }
.v2-lookup-modal__input input { border: none; padding: 10px 0; flex: 1; }
.v2-lookup-modal__input input:focus { outline: none; }
.v2-lookup-recent { margin-top: var(--v2-space-xl); }
.v2-lookup-recent__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); margin-bottom: var(--v2-space-sm); }
.v2-lookup-recent__row {
    display: flex; align-items: center; gap: var(--v2-space-md);
    padding: 10px 4px; text-decoration: none; color: var(--v2-ink);
    border-top: 1px solid var(--v2-border);
}

/* New-badge celebration popup (agents only) — centered like the lookup
   modal above, but its own higher z-index so it always lands on top if a
   page happens to load with another modal already open. Two-tone card
   (sunburst yellow header + white body/footer) per the agreed design —
   distinct from the right-drawer .v2-modal pattern since this is a
   one-off celebration, not a form. */
.v2-celebrate-overlay {
    position: fixed; inset: 0; z-index: 200; padding: var(--v2-space-lg);
    background: rgba(21,29,40,0.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
}
.v2-celebrate-card {
    position: relative; overflow: hidden;
    background: #fff; border-radius: var(--v2-radius-lg);
    box-shadow: 0 28px 72px rgba(21,29,40,0.3);
    width: 480px; max-width: 100%; max-height: 90vh;
    display: flex; flex-direction: column;
    animation: v2CelebratePop 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes v2CelebratePop {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.v2-celebrate-close {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background: rgba(21,29,40,0.16); color: var(--v2-ink); font-size: 13px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.v2-celebrate-close:hover { background: rgba(21,29,40,0.28); }

.v2-celebrate-header {
    position: relative; flex: none; text-align: center;
    padding: 34px 28px 26px; background: var(--v2-yellow);
    background-image: repeating-conic-gradient(from 0deg at 50% 10%, rgba(255,255,255,0.16) 0deg 4deg, transparent 4deg 16deg);
}
.v2-celebrate-trophy {
    position: relative; z-index: 1; width: 64px; height: 64px; margin: 0 auto 14px;
    border-radius: 50%; background: var(--v2-ink); box-shadow: 0 0 0 4px rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--v2-yellow);
    animation: v2CelebrateGlow 1.8s ease-in-out infinite;
}
@keyframes v2CelebrateGlow {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-5px) rotate(2deg); }
}
.v2-celebrate-eyebrow {
    position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    background: var(--v2-ink); color: var(--v2-yellow); padding: 5px 14px; border-radius: 999px;
    margin-bottom: 12px;
}
.v2-celebrate-title { position: relative; z-index: 1; font-size: 23px; font-weight: 800; color: var(--v2-ink); margin: 0 0 6px; }
.v2-celebrate-sub { position: relative; z-index: 1; font-size: 14px; color: var(--v2-ink); opacity: 0.75; margin: 0; }
.v2-celebrate-sub strong { font-weight: 800; }

.v2-celebrate-body { flex: 1 1 auto; overflow-y: auto; padding: 24px 28px; }
.v2-celebrate-badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 22px 14px; }
.v2-celebrate-badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.v2-celebrate-badge__icon {
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--v2-ink);
    box-shadow: 0 0 0 3px rgba(21,29,40,0.05);
}
.v2-celebrate-badge__name { font-size: 13.5px; font-weight: 800; color: var(--v2-ink); line-height: 1.25; }
.v2-celebrate-badge__tier {
    font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 3px 10px; border-radius: 999px; background: var(--v2-bg-alt); color: var(--v2-slate);
}
.v2-celebrate-badge__tier--bronze { color: var(--v2-brown); }
.v2-celebrate-badge__tier--silver { color: var(--v2-slate); }
.v2-celebrate-badge__tier--gold { color: var(--v2-gold-text); background: var(--v2-yellow-pale); }
.v2-celebrate-badge__tier--platinum { color: #5b4f8a; background: #efecf7; }
.v2-celebrate-badge__desc { font-size: 11px; color: var(--v2-muted); line-height: 1.4; }

.v2-celebrate-footer {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--v2-space-md);
    padding: 18px 28px; border-top: 1px solid var(--v2-border);
}
/* Account 360's enlarged customer photo — centered like the celebrate
   popup above, since it's a single image to look at, not a form. */
.v2-photo-modal-overlay {
    position: fixed; inset: 0; z-index: 150; padding: var(--v2-space-lg);
    background: rgba(21,29,40,0.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
}
.v2-photo-modal {
    position: relative; background: #fff; border-radius: var(--v2-radius-lg);
    box-shadow: 0 28px 72px rgba(21,29,40,0.3); padding: var(--v2-space-sm);
    max-width: min(480px, 90vw); max-height: 90vh;
}
.v2-photo-modal img { display: block; max-width: 100%; max-height: calc(90vh - 2 * var(--v2-space-sm)); border-radius: var(--v2-radius-md); }
.v2-photo-modal__close {
    position: absolute; top: -14px; right: -14px; z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background: var(--v2-ink); color: #fff; font-size: 15px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 2px 8px rgba(21,29,40,0.3);
}
.v2-photo-modal__close:hover { opacity: 0.85; }

.v2-lookup-recent__row i.fa-clock-rotate-left { color: var(--v2-muted); font-size: 13px; }
.v2-lookup-recent__row i.fa-chevron-right { margin-left: auto; color: var(--v2-muted); font-size: 11px; }
.v2-lookup-recent__text { min-width: 0; }
.v2-lookup-recent__name { font-weight: 700; font-size: 13.5px; }
.v2-lookup-recent__meta { font-size: 12px; color: var(--v2-muted); }

.v2-toast-region { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: var(--v2-space-sm); }
.v2-toast { padding: 10px 16px; border-radius: var(--v2-radius-md); font-size: 13px; font-weight: 700; box-shadow: 0 4px 16px rgba(21,29,40,0.18); transition: opacity 0.3s ease, transform 0.3s ease; }
.v2-toast--success { background: var(--v2-green-bg); color: var(--v2-green); border: 1px solid var(--v2-green-light); }
.v2-toast--error { background: #fdeceb; color: #9b3a2f; }
.v2-toast.is-leaving { opacity: 0; transform: translateX(12px); }

/* ── Tables ────────────────────────────────────────────────────────── */
.v2-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.v2-table th { text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--v2-muted); padding: var(--v2-space-sm) var(--v2-space-md); border-bottom: 1px solid var(--v2-border); letter-spacing: 0.03em; }
.v2-table td { padding: 11px var(--v2-space-md); border-bottom: 1px solid var(--v2-border); }
.v2-table tr:hover td { background: var(--v2-bg-alt); }
.v2-table--tint thead th { background: var(--v2-yellow-pale); }

/* Wide centered modal (Leaderboard tab's Logs/View) — distinct from the
   right-drawer .v2-modal and the narrow centered .v2-lookup-modal, since
   this carries a data table + export toolbar, not a short form. Dark
   header bar (matches the agreed design) rather than a plain white one,
   so it reads as a data drill-down rather than an edit form. */
.v2-wide-modal-overlay {
    position: fixed; inset: 0; z-index: 150; padding: var(--v2-space-lg);
    background: rgba(21,29,40,0.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.v2-wide-modal {
    background: #fff; width: 1000px; max-width: 100%; max-height: 90vh;
    border-radius: var(--v2-radius-lg); overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 28px 72px rgba(21,29,40,0.3);
}
.v2-wide-modal__header {
    flex: none; display: flex; align-items: center; gap: var(--v2-space-md);
    padding: var(--v2-space-lg) var(--v2-space-xl);
    background: var(--v2-ink); border-bottom: 3px solid var(--v2-yellow);
}
.v2-wide-modal__icon {
    flex: none; width: 40px; height: 40px; border-radius: var(--v2-radius-md);
    background: var(--v2-yellow); color: var(--v2-ink);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.v2-wide-modal__title { font-size: 16px; font-weight: 800; color: var(--v2-yellow); }
.v2-wide-modal__sub { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.v2-wide-modal__close {
    margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: none; color: #fff; font-size: 13px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.v2-wide-modal__close:hover { background: rgba(255,255,255,0.22); }
.v2-wide-modal__body { flex: 1 1 auto; overflow-y: auto; padding: var(--v2-space-xl); }
.v2-wide-modal__stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--v2-space-md); margin-bottom: var(--v2-space-lg);
}
.v2-wide-modal__stat {
    background: var(--v2-bg-alt); border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md); padding: var(--v2-space-md) var(--v2-space-lg);
}
.v2-wide-modal__stat--tint-green { background: var(--v2-green-bg); border-color: var(--v2-green-light); }
.v2-wide-modal__stat-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--v2-muted); }
.v2-wide-modal__stat-value { font-size: 21px; font-weight: 800; color: var(--v2-ink); margin-top: 4px; }
.v2-wide-modal__stat--tint-green .v2-wide-modal__stat-value { color: var(--v2-green); }
.v2-wide-modal__toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--v2-space-md); margin-bottom: 10px; }
.v2-wide-modal__toolbar-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--v2-muted); }
.v2-wide-modal__toolbar-actions { display: flex; gap: 8px; }
.v2-wide-modal__footnote { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--v2-muted); margin-top: 10px; }

.v2-badge-category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--v2-space-xl); }
.v2-badge-category__header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; margin-bottom: var(--v2-space-sm); }
.v2-badge-category__count { font-size: 11px; font-weight: 700; color: var(--v2-muted); background: var(--v2-bg-alt); padding: 2px 8px; border-radius: 999px; }

.v2-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--v2-space-md); }
.v2-badge { position: relative; text-align: center; font-size: 11.5px; font-weight: 600; padding: var(--v2-space-md) var(--v2-space-sm); border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); background: #fff; }
.v2-badge i:not(.v2-badge__check) { font-size: 22px; display: block; margin-bottom: 6px; }
.v2-badge--locked { opacity: 0.35; filter: grayscale(1); }
.v2-badge__check { position: absolute; top: 6px; right: 6px; font-size: 11px !important; color: var(--v2-green) !important; }

.v2-formula { display: block; background: var(--v2-bg-alt); border: 1px solid var(--v2-border); border-radius: var(--v2-radius-sm); padding: 8px 12px; font-size: 12px; font-family: 'SF Mono', Consolas, monospace; margin: 8px 0; color: var(--v2-slate); }

.v2-lookup-form { display: flex; gap: var(--v2-space-sm); max-width: 440px; }
.v2-lookup-form input { flex: 1; }

/* ── Skeleton loading state — every async section starts here ────────── */
.v2-skeleton { display: flex; flex-direction: column; gap: 8px; }
.v2-skeleton__line {
    height: 14px; border-radius: var(--v2-radius-sm); margin-bottom: 2px; max-width: 100%;
    background: linear-gradient(90deg, var(--v2-border) 25%, #faf8f4 37%, var(--v2-border) 63%);
    background-size: 400% 100%;
    animation: v2-shimmer 1.4s ease infinite;
}
.v2-skeleton__line--wide { width: 70%; }
.v2-skeleton__line--short { width: 40%; }
.v2-skeleton-card { height: 88px; border-radius: var(--v2-radius-lg); }
.v2-skeleton-row { height: 56px; border-radius: var(--v2-radius-md); margin-bottom: 8px; }
@keyframes v2-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* htmx: hide the real content wrapper while a request for it is in
   flight, show only the sibling skeleton — this is the mechanism behind
   "proper loading state everywhere", applied via hx-indicator. */
.htmx-request .v2-lazy-content { display: none; }
.htmx-request.v2-lazy-content { display: none; }
.v2-lazy-skeleton { display: none; }
.htmx-request .v2-lazy-skeleton { display: block; }
.htmx-request.v2-lazy-skeleton { display: block; }

/* ── Full-page navigation loader ──────────────────────────────────────
   hx-boost is off app-wide (base_v2.html), so clicking into a new page
   is a real browser navigation, not an htmx swap — on a synchronous,
   aggregate-heavy render (Home, Champion Board, ...) that can leave a
   blank white screen for a few seconds. Shown the instant navigation
   starts (see the script in base_v2.html), covering that gap with the
   Sun King animated mark instead. Deliberately separate from the
   .v2-lazy-skeleton pattern above, which is for in-page htmx fragments
   that never navigate anywhere. */
.v2-page-loader {
    position: fixed; inset: 0; z-index: 2000; background: var(--v2-yellow);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.v2-page-loader.is-active { opacity: 1; pointer-events: all; }
.v2-page-loader img { width: 360px; max-width: 70vw; height: auto; }

@media (max-width: 900px) {
    .v2-shell { flex-direction: column; }
    /* Stacked layout on mobile — a sticky, viewport-height sidebar above
       the content would push the whole page below the fold, so this
       reverts to normal in-flow behavior here only. */
    .v2-sidebar { width: 100%; position: static; height: auto; overflow: visible; }
    .v2-content { padding: var(--v2-space-lg); }
    .v2-portfolio { flex-direction: column; }
    .v2-portfolio__rail { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .v2-home-split { grid-template-columns: 1fr; }
    .v2-topbar__filters { display: none; }
    .v2-account-split { grid-template-columns: 1fr; }
    .v2-account-stats__group, .v2-account-stats__group--muted { grid-template-columns: repeat(2, 1fr); }
    .v2-account-header { flex-wrap: wrap; }
}

/* ── Start an Audit ──────────────────────────────────────────────────── */
.v2-audit-layout { display: grid; grid-template-columns: 1fr 300px; gap: var(--v2-space-lg); align-items: start; margin-top: var(--v2-space-lg); }
@media (max-width: 1100px) { .v2-audit-layout { grid-template-columns: 1fr; } }

.v2-audit-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--v2-space-md); }
.v2-audit-section-title h2 { margin: 0; font-size: 15px; }
.v2-audit-section-title__marks { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--v2-green-bg); color: var(--v2-green); }
.v2-audit-section-title__marks.is-short { background: var(--v2-yellow-pale); color: var(--v2-gold-text); }

.v2-audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--v2-space-md); margin-bottom: var(--v2-space-md); }
@media (max-width: 700px) { .v2-audit-grid { grid-template-columns: 1fr; } }

.v2-audit-item { border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: var(--v2-space-md); background: var(--v2-bg-alt); }
.v2-audit-item__label { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.v2-audit-item.is-autofail { background: #fdeceb; border-left: 3px solid var(--v2-red); }
.v2-audit-item__autofail-badge { flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--v2-red); color: #fff; padding: 2px 8px; border-radius: 999px; }

.v2-audit-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.v2-score-pill { position: relative; }
.v2-score-pill input { position: absolute; opacity: 0; pointer-events: none; }
.v2-score-pill span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--v2-border-alt, var(--v2-border)); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; user-select: none; transition: all 0.12s; }
.v2-score-pill input:checked + span { background: var(--v2-yellow); border-color: var(--v2-ink); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }

.v2-audit-sidebar { position: sticky; top: var(--v2-space-lg); display: flex; flex-direction: column; gap: var(--v2-space-md); }
.v2-audit-score-card { background: var(--v2-ink); color: #fff; border-radius: var(--v2-radius-md); padding: var(--v2-space-lg); }
.v2-audit-score-card__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-bottom: 6px; }
.v2-audit-score-card__value { font-size: 40px; font-weight: 800; line-height: 1; }
.v2-audit-score-card__value span { font-size: 18px; font-weight: 600; color: rgba(255,255,255,0.55); }
.v2-audit-score-card__band { font-size: 12.5px; color: rgba(255,255,255,0.7); margin-top: 6px; line-height: 1.5; }
.v2-audit-score-card__band.is-autofail { color: #ff8a80; font-weight: 700; }
.v2-audit-section-list { list-style: none; margin: var(--v2-space-md) 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.v2-audit-section-list li { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; gap: 8px; }
.v2-audit-section-list li span:first-child { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.85); }
.v2-audit-section-list i.fa-circle-check { color: #4ade80; }
.v2-audit-section-list i.fa-triangle-exclamation { color: var(--v2-yellow); }

.v2-audit-checklist { background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: var(--v2-space-lg); }
.v2-audit-checklist h3 { margin: 0 0 var(--v2-space-md); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.v2-audit-checklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.v2-audit-checklist li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--v2-slate); }
.v2-audit-checklist i.fa-circle-check { color: var(--v2-green); margin-top: 1px; }
.v2-audit-checklist i.fa-circle { color: var(--v2-border-alt, var(--v2-border)); margin-top: 1px; }

.v2-file-choose { display: flex; align-items: center; gap: 8px; }
.v2-file-choose__name { font-size: 12px; color: var(--v2-muted); }

/* ── TeleQA Dashboard ────────────────────────────────────────────────── */
.v2-qa-period-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--v2-space-md); flex-wrap: wrap; background: var(--v2-ink); border-radius: var(--v2-radius-md); padding: 10px 14px; margin-top: var(--v2-space-lg); }
.v2-qa-period-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.v2-qa-period-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.65); text-decoration: none; border: none; background: transparent; cursor: pointer; }
.v2-qa-period-tab.is-active { background: var(--v2-yellow); color: var(--v2-ink); font-weight: 700; }
.v2-qa-period-bar select { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; }
.v2-qa-period-bar form { display: flex; gap: 8px; align-items: center; }

.v2-donut-legend { list-style: none; margin: var(--v2-space-md) 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.v2-donut-legend li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; font-size: 12.5px; }
.v2-donut-legend__label { display: flex; align-items: center; gap: 8px; color: var(--v2-slate); }
.v2-donut-legend__label .v2-status-swatch { flex-shrink: 0; }
.v2-donut-legend__n { font-weight: 700; text-align: right; }
.v2-donut-legend__pct { color: var(--v2-muted); text-align: right; }

.v2-qa-skills-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--v2-space-sm); margin-bottom: var(--v2-space-lg); }
.v2-qa-skills-tab { text-align: left; background: #fff; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: var(--v2-space-md); cursor: pointer; font-family: inherit; }
.v2-qa-skills-tab.is-active { background: var(--v2-yellow-pale); border-color: var(--v2-yellow-deep); }
.v2-qa-skills-tab__pct { font-size: 20px; font-weight: 800; }
.v2-qa-skills-tab__pct.level-good { color: var(--v2-green); }
.v2-qa-skills-tab__pct.level-warn { color: var(--v2-gold-text); }
.v2-qa-skills-tab__pct.level-bad { color: var(--v2-red); }
.v2-qa-skills-tab__title { font-size: 12.5px; font-weight: 700; margin-top: 4px; }
.v2-qa-skills-tab__marks { font-size: 11px; color: var(--v2-muted); }

.v2-qa-skill-item { margin-bottom: var(--v2-space-md); }
.v2-qa-skill-item__row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.v2-qa-skill-item__pct { font-weight: 700; font-size: 12px; }
.v2-progress__bar.level-good { background: var(--v2-green); }
.v2-progress__bar.level-warn { background: var(--v2-yellow-deep); }
.v2-progress__bar.level-bad { background: var(--v2-red); }

.v2-snoop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--v2-space-md); flex-wrap: wrap; margin-bottom: var(--v2-space-md); }
.v2-snoop-tabs { display: flex; gap: 4px; background: var(--v2-bg-alt); border-radius: 999px; padding: 3px; }
.v2-snoop-tab { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: transparent; border: none; cursor: pointer; color: var(--v2-slate); }
.v2-snoop-tab.is-active { background: var(--v2-ink); color: #fff; }
.v2-snoop-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.5fr auto; gap: var(--v2-space-md); align-items: center; padding: 10px 0; border-top: 1px solid var(--v2-border); font-size: 13px; }
.v2-snoop-row__agent { font-weight: 700; }
.v2-snoop-row__meta { font-size: 11.5px; color: var(--v2-muted); }

.v2-historical-table-wrap { overflow-x: auto; }
.v2-historical-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.v2-historical-table th, .v2-historical-table td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--v2-border); }
.v2-historical-table th:first-child, .v2-historical-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.v2-historical-table td.is-average { font-weight: 800; }
.v2-historical-table td.is-empty { color: var(--v2-border-alt); }

.v2-market-bar-row { display: grid; grid-template-columns: 1fr auto; gap: var(--v2-space-sm); align-items: baseline; margin-bottom: var(--v2-space-md); }
.v2-market-bar-row__label { font-size: 13px; font-weight: 700; }
.v2-market-bar-row__value { font-size: 15px; font-weight: 800; }
.v2-market-bar-row__sub { font-size: 11px; color: var(--v2-muted); grid-column: 1 / -1; margin-top: -6px; }

.v2-agent-rank-row { display: grid; grid-template-columns: 20px 1fr 1.6fr auto auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.v2-agent-rank-row__n { font-weight: 800; color: var(--v2-muted); }
.v2-agent-rank-row__score { font-weight: 800; }
.v2-agent-rank-row__count { font-size: 11px; color: var(--v2-muted); }

/* ── Team Overview (Lead home) ───────────────────────────────────────── */
.v2-champion-table__gap { color: var(--v2-green); font-weight: 700; }
.v2-champion-table__gap.is-behind { color: #ff8a80; }
.v2-champion-strategy-note {
    margin-top: var(--v2-space-lg); background: rgba(255,218,0,0.08); border: 1px solid rgba(255,218,0,0.25);
    border-radius: var(--v2-radius-md); padding: var(--v2-space-md); font-size: 12.5px; color: rgba(255,255,255,0.85);
}
.v2-champion-strategy-note strong { display: block; color: var(--v2-yellow); margin-bottom: 4px; font-size: 12px; }

.v2-team-table-wrap { overflow-x: auto; }
.v2-team-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.v2-team-table th { text-align: right; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); padding: 0 10px 10px; }
.v2-team-table th:first-child { text-align: left; }
.v2-team-table td { padding: 12px 10px; border-top: 1px solid var(--v2-border); text-align: right; vertical-align: middle; }
.v2-team-table td:first-child { text-align: left; }
.v2-team-table__agent { display: flex; align-items: center; gap: 10px; }
.v2-team-table__meta { font-size: 11.5px; color: var(--v2-muted); }
.v2-team-pct-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; background: var(--v2-bg-alt); color: var(--v2-slate); }
.v2-team-pct-chip.is-good { background: var(--v2-green-bg); color: var(--v2-green); }
.v2-team-pct-chip.is-bad { background: #fdeceb; color: var(--v2-red); }

/* ── PTP Monitoring ──────────────────────────────────────────────────── */
.v2-monitoring-banner { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--v2-muted); margin-bottom: var(--v2-space-sm); }
.v2-monitoring-banner__badge { background: var(--v2-ink); color: var(--v2-yellow); font-weight: 800; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; }

.v2-exceptions-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.v2-exceptions-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--v2-border); font-size: 13px; }
.v2-exceptions-list li:first-child { border-top: none; }
.v2-exceptions-list i { color: var(--v2-muted); width: 16px; text-align: center; flex-shrink: 0; }
.v2-exceptions-list__label { flex: 1; color: var(--v2-slate); }
.v2-exceptions-count { font-weight: 800; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--v2-bg-alt); color: var(--v2-ink); }
.v2-exceptions-count.is-warn { background: var(--v2-yellow-pale); color: var(--v2-gold-text); }
.v2-exceptions-count.is-hot { background: #fdeceb; color: var(--v2-red); }

.v2-promise-table-wrap { overflow-x: auto; }
.v2-promise-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.v2-promise-table th { text-align: right; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); padding: 0 10px 10px; }
.v2-promise-table th:first-child { text-align: left; }
.v2-promise-table td { padding: 11px 10px; border-top: 1px solid var(--v2-border); text-align: right; vertical-align: middle; }
.v2-promise-table td:first-child { text-align: left; font-weight: 700; }
.v2-promise-table__ratebar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.v2-promise-table__ratebar .v2-progress { width: 90px; margin: 0; }

.v2-feedback-placeholder { border: 1px dashed var(--v2-border-alt); border-radius: var(--v2-radius-md); padding: var(--v2-space-lg); }
.v2-feedback-placeholder__tag { background: var(--v2-bg-alt); color: var(--v2-muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; margin-left: 8px; }

/* ── AI Call Insights / Batches ──────────────────────────────────────── */
.v2-filter-row--wrap { display: flex; flex-wrap: wrap; gap: var(--v2-space-md); align-items: end; }
.v2-filter-row--wrap label { min-width: 130px; }
.v2-filter-row--wrap input, .v2-filter-row--wrap select { width: 100%; }
.v2-filter-row--wrap input[type="search"] { min-width: 200px; }
.v2-filter-more { margin-top: var(--v2-space-md); }
.v2-filter-more summary { cursor: pointer; font-size: 12.5px; color: var(--v2-muted); font-weight: 600; margin-bottom: var(--v2-space-sm); }
.v2-filter-more[open] summary { margin-bottom: var(--v2-space-md); }
.v2-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--v2-space-sm); }
.v2-filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--v2-bg-alt); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; color: var(--v2-slate); }
.v2-filter-chip a { color: var(--v2-muted); text-decoration: none; font-weight: 700; padding: 0 4px; }
.v2-filter-preset { display: inline-flex; align-items: center; font-size: 12px; border: 1px solid var(--v2-border-alt); border-radius: 999px; padding: 3px 12px; margin-right: 6px; color: var(--v2-slate); text-decoration: none; }
.v2-filter-preset.is-active { background: var(--v2-yellow); border-color: var(--v2-yellow); font-weight: 700; color: var(--v2-ink); }

.v2-ai-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--v2-space-md); }
.v2-ai-stat { background: var(--v2-bg-alt); border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: var(--v2-space-md); }
.v2-ai-stat.is-featured { background: var(--v2-yellow-pale); border-color: var(--v2-yellow-deep); }
.v2-ai-stat__n { font-size: 22px; font-weight: 800; }
.v2-ai-stat__l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); margin-top: 2px; }

.v2-ai-bar { background: var(--v2-border); border-radius: 6px; height: 7px; overflow: hidden; max-width: 260px; }
.v2-ai-bar > i { display: block; height: 100%; background: var(--v2-green); }
.v2-ai-bar.is-low > i { background: var(--v2-red); }
.v2-ai-bar.is-mid > i { background: var(--v2-yellow-deep); }

.v2-ai-drop { border: 2px dashed var(--v2-border-alt); border-radius: var(--v2-radius-md); padding: var(--v2-space-xl); text-align: center; color: var(--v2-muted); cursor: pointer; }
.v2-ai-drop.is-over { border-color: var(--v2-yellow-deep); background: var(--v2-yellow-pale); }
.v2-ai-opt { border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: var(--v2-space-md) var(--v2-space-lg); margin-bottom: var(--v2-space-md); }
.v2-ai-opt__h { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }

.v2-ai-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--v2-space-md); }
.v2-ai-kv__l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); }
.v2-ai-kv__v { font-weight: 700; font-size: 14px; margin-top: 2px; }
/* Grid-line variant (fraud case detail) — same layout as .v2-ai-kv, but
   with a ruled line between every cell, both axes. The 1px gap doubling as
   the line (filled by the container's own background, cells painted over
   it) is a plain CSS grid technique — no extra divider elements. */
.v2-ai-kv--lined { gap: 1px; background: var(--v2-border); border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); overflow: hidden; }
.v2-ai-kv--lined > div { background: #fff; padding: var(--v2-space-sm) var(--v2-space-md); }

.v2-ai-move { display: flex; gap: var(--v2-space-md); padding: 9px 0; border-top: 1px solid var(--v2-border); font-size: 13px; }
.v2-ai-move:first-child { border-top: none; }
.v2-ai-move__mark { width: 18px; font-weight: 800; flex-shrink: 0; color: var(--v2-border-alt); }
.v2-ai-move.is-done .v2-ai-move__mark { color: var(--v2-green); }
.v2-ai-move.is-missed .v2-ai-move__mark { color: var(--v2-red); }
.v2-ai-move.is-na { opacity: 0.5; }
.v2-ai-move__label { width: 230px; flex-shrink: 0; }
.v2-ai-move__evidence { color: var(--v2-muted); font-size: 12px; }

.v2-ai-turn { display: flex; gap: var(--v2-space-md); padding: 5px 0; font-size: 13px; }
.v2-ai-turn__t { color: var(--v2-border-alt); width: 48px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.v2-ai-turn__s { width: 72px; flex-shrink: 0; font-weight: 700; }
.v2-ai-turn.is-customer .v2-ai-turn__s { color: #0369a1; }
.v2-ai-turn.is-agent .v2-ai-turn__s { color: #b45309; }

.v2-ai-flag { background: #fdeceb; color: #9b3a2f; border-radius: var(--v2-radius-md); padding: 10px 14px; font-size: 13px; margin-bottom: 8px; }
.v2-ai-flag--warn { background: var(--v2-yellow-pale); color: var(--v2-gold-text); }

.v2-ai-score-big { font-size: 34px; font-weight: 800; line-height: 1; }
.v2-ai-sc-sec { margin-top: var(--v2-space-lg); }
.v2-ai-sc-sec h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); display: flex; justify-content: space-between; margin: 0 0 6px; }
.v2-ai-sc-item { display: grid; grid-template-columns: 15rem 6rem 1fr; gap: var(--v2-space-md); padding: 7px 0; border-top: 1px solid var(--v2-border); font-size: 13px; align-items: baseline; }
.v2-ai-sc-item:first-child { border-top: none; }
.v2-ai-sc-item__m { font-variant-numeric: tabular-nums; font-weight: 700; }
.v2-ai-sc-item.is-full .v2-ai-sc-item__m { color: var(--v2-green); }
.v2-ai-sc-item.is-partial .v2-ai-sc-item__m { color: var(--v2-yellow-deep); }
.v2-ai-sc-item.is-weak .v2-ai-sc-item__m { color: var(--v2-red); }
.v2-ai-sc-item.is-unassessed { opacity: 0.5; }
.v2-ai-sc-item__e { color: var(--v2-muted); font-size: 12px; }
.v2-ai-af { font-size: 10px; font-weight: 800; background: #fdeceb; color: #9b3a2f; border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

/* ── Shared number / visual-encoding primitives ──────────────────────
   First used by the Coverage page; generic on purpose. */
.v2-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v2-table th.v2-num { text-align: right; }
.v2-quiet-link { color: inherit; text-decoration: none; }
.v2-quiet-link:hover { color: var(--v2-gold-text); text-decoration: underline; }
/* Graded cell colour: set --heat (0–1) inline. Same custom-property trick as .v2-donut. */
.v2-heat { background: rgba(192, 57, 43, calc(var(--heat, 0) * 0.30)); font-weight: 700; }
/* 100% stacked bar — one segment per category, widths set inline. */
.v2-stackbar { display: flex; height: 10px; width: 100%; min-width: 120px; border-radius: 999px; overflow: hidden; background: var(--v2-border); }
.v2-stackbar > * { display: block; height: 100%; flex: 0 0 auto; }
.v2-stackbar__seg--telecollection { background: var(--v2-yellow); }
.v2-stackbar__seg--ace_acc { background: var(--v2-muted); }
.v2-stackbar__seg--collector { background: #3aa0c8; }
.v2-stackbar__seg--untracked { background: var(--v2-ink); }
.v2-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--v2-slate); }
.v2-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
/* Change chips. --bad/--good say whether the change is unwelcome, not its sign. */
.v2-delta { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.v2-delta--bad { background: #fdeceb; color: var(--v2-red); }
.v2-delta--good { background: var(--v2-green-bg); color: var(--v2-green); }
.v2-delta--flat { background: var(--v2-bg-alt); color: var(--v2-muted); }
.v2-table--sortable th[data-sort] { cursor: pointer; user-select: none; }
.v2-table--sortable th[data-sort]::after { content: ' \2195'; color: var(--v2-border-alt); }
.v2-table--sortable th.is-sorted-desc::after { content: ' \2193'; color: var(--v2-ink); }
.v2-table--sortable th.is-sorted-asc::after { content: ' \2191'; color: var(--v2-ink); }
.v2-table tr.is-extra { display: none; }
.v2-table.is-expanded tr.is-extra { display: table-row; }
.v2-view-toggle { display: inline-flex; gap: 4px; }
.v2-view-toggle a { font-size: 12px; padding: 3px 10px; border-radius: 999px; color: var(--v2-muted); text-decoration: none; border: 1px solid transparent; }
.v2-view-toggle a.is-active { border-color: var(--v2-border-alt); color: var(--v2-ink); font-weight: 700; background: #fff; }
.v2-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--v2-space-sm); flex-wrap: wrap; }
.v2-card-head h3 { margin-top: 0; }

/* ── Coverage page ─────────────────────────────────────────────────── */
/* align-items:start — each card is as tall as its own content, so a short
   "What matters" never pads itself out with an empty white block. */
.v2-cov-headline { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--v2-space-lg); margin-top: var(--v2-space-lg); align-items: start; }
.v2-cov-headline > .v2-card { margin-bottom: 0; }
.v2-insight { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; line-height: 1.5; color: var(--v2-brown); border-top: 1px solid rgba(212, 178, 0, 0.25); }
.v2-insight:first-of-type { border-top: none; }
.v2-insight__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--v2-muted); }
.v2-insight--bad .v2-insight__dot { background: var(--v2-red); }
.v2-insight--good .v2-insight__dot { background: var(--v2-green); }
.v2-act-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--v2-border); font-size: 13px; }
.v2-act-row:first-of-type { border-top: none; }
.v2-act-row .v2-relative-bar { width: 100%; grid-column: 1 / -1; height: 6px; }
.v2-cov-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--v2-space-lg); margin-top: var(--v2-space-lg); }
.v2-cov-kpis .v2-kpi-card { display: flex; flex-direction: column; }
.v2-cov-kpis .v2-kpi-card__value { font-size: 28px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.v2-cov-kpis .v2-kpi-card__value small { font-size: 13px; font-weight: 700; color: var(--v2-muted); }
.v2-cov-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--v2-border); }
.v2-cov-mini__n { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.v2-cov-mini__n a { color: inherit; font-size: inherit; font-weight: inherit; }
.v2-cov-mini__l { font-size: 11px; color: var(--v2-muted); line-height: 1.25; }
.v2-cov-filter-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--v2-space-lg); }
.v2-cov-filter-groups fieldset { border: 1px solid var(--v2-border); border-radius: var(--v2-radius-md); padding: var(--v2-space-md); margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--v2-space-sm); align-content: start; }
.v2-cov-filter-groups legend { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--v2-muted); padding: 0 6px; }
.v2-cov-filter-groups label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--v2-slate); }
.v2-cov-filter-groups select, .v2-cov-filter-groups input { width: 100%; }
/* Product groups: a searchable tick-list (several can be picked). The panel
   opens in the flow rather than floating, so the collapsible filter form
   can't clip it. */
.v2-cov-multi { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--v2-slate); grid-column: 1 / -1; }
.v2-cov-multi__toggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
    background: #fff; border: 1px solid var(--v2-border-alt); border-radius: var(--v2-radius-sm); font-size: 13px; color: var(--v2-ink); cursor: pointer; text-align: left; }
.v2-cov-multi__toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-cov-multi__toggle i.is-flipped { transform: rotate(180deg); }
.v2-cov-multi__panel { border: 1px solid var(--v2-border-alt); border-radius: var(--v2-radius-sm); background: #fff; padding: 8px; }
.v2-cov-filter-groups .v2-cov-multi__search { width: 100%; margin-bottom: 6px; }
.v2-cov-multi__options { max-height: 220px; overflow-y: auto; display: grid; gap: 2px; }
.v2-cov-filter-groups label.v2-cov-multi__option { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--v2-ink); padding: 4px 2px; cursor: pointer; }
.v2-cov-filter-groups label.v2-cov-multi__option input { width: auto; margin: 0; }
.v2-cov-multi__actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.v2-cov-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--v2-space-md); }
.v2-cov-presets .v2-filter-preset { margin-right: 0; }
.v2-cov-peer { display: flex; flex-wrap: wrap; gap: var(--v2-space-sm) var(--v2-space-xl); align-items: center; background: var(--v2-bg-alt); border-radius: var(--v2-radius-md); padding: 10px 14px; font-size: 13px; margin-bottom: var(--v2-space-md); }
.v2-cov-peer strong { font-size: 15px; }
.v2-cov-usd { display: flex; flex-wrap: wrap; gap: var(--v2-space-xl); margin-bottom: var(--v2-space-md); }
.v2-cov-usd__n { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.v2-cov-usd__l { font-size: 11px; color: var(--v2-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.v2-spark { display: block; }
.v2-spark polyline { fill: none; stroke: var(--v2-ink); stroke-width: 1.6; }
@media (max-width: 1200px) { .v2-cov-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .v2-cov-headline, .v2-cov-filter-groups { grid-template-columns: minmax(0, 1fr); }
    .v2-cov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .v2-cov-kpis { grid-template-columns: minmax(0, 1fr); } }
/* The three Coverage pages' switcher (reuses .v2-subnav) and the running
   "view the matching accounts" link under the filter chips. */
.v2-cov-pages { margin-top: var(--v2-space-md); }
.v2-cov-pages .v2-subnav__link { position: relative; }
.v2-cov-accounts-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
/* Channel cards stay short: total, share, the Telecollection / ACE-ACC
   outcome bar, one key figure and a "Details" link to a drawer holding the
   rest (portal/views_coverage.py _channel_split / _channel_key_line /
   _channel_details). */
.v2-cov-swatch--telecollection { color: #ffda00; }
.v2-cov-swatch--ace_acc { color: #7e8089; }
.v2-cov-swatch--collector { color: #3aa0c8; }
.v2-cov-swatch--untracked { color: #151d28; }
.v2-cov-card .v2-cov-split__bar { margin-top: 10px; }
.v2-cov-card__key { margin-top: 8px; font-size: 13px; line-height: 1.4; }
.v2-cov-card__key strong { font-variant-numeric: tabular-nums; }
.v2-cov-card__key--bad strong { color: var(--v2-red); }
.v2-cov-card__key--good strong { color: var(--v2-green); }
.v2-cov-card__more { margin-top: auto; align-self: flex-start; padding: 12px 0 0; background: none; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--v2-ink); }
.v2-cov-card__more:hover { text-decoration: underline; }
.v2-cov-card__more i { font-size: 11px; }
/* The outcome bar: green reached / contacted, amber called but not
   reached, grey reach not recorded, pale yellow contacted another way, red
   tint not called / not visited yet — the gap. */
.v2-cov-split__bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--v2-bg-alt); }
.v2-cov-split__bar span { display: block; height: 100%; }
.v2-cov-split__seg--reached, .v2-cov-split__seg--contacted { background: var(--v2-green); }
.v2-cov-split__seg--called_not_reached { background: #e0a800; }
.v2-cov-split__seg--called_reach_unknown { background: #b9bcc4; }
.v2-cov-split__seg--other_only { background: #ffe680; }
.v2-cov-split__seg--never { background: rgba(192, 57, 43, 0.35); }
.v2-cov-split__dot { flex: none; width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
/* The Details drawer (.v2-modal--wide). */
.v2-cov-drawer h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.v2-cov-drawer h2 i { font-size: 14px; }
.v2-cov-drawer h4 { margin: var(--v2-space-xl) 0 var(--v2-space-sm); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--v2-muted); }
.v2-cov-drawer__intro { margin: 0; font-size: 13px; line-height: 1.5; color: var(--v2-slate); }
.v2-cov-drawer .v2-cov-split__bar { height: 10px; }
.v2-cov-outcomes { width: 100%; border-collapse: collapse; margin-top: var(--v2-space-sm); font-size: 13px; }
.v2-cov-outcomes td { padding: 7px 4px; border-top: 1px solid var(--v2-border); vertical-align: middle; }
.v2-cov-outcomes td:first-child { width: 14px; padding-left: 0; }
.v2-cov-outcomes__row--never strong { color: var(--v2-red); }
.v2-cov-drawer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; padding-top: 0; border-top: none; gap: 14px 16px; }
.v2-cov-drawer__grid .v2-cov-mini__n { font-size: 18px; }
.v2-cov-drawer__grid .v2-cov-mini__l { font-size: 12px; }
@media (max-width: 520px) { .v2-cov-drawer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The total card's "not worked yet" line (dark card, so brand yellow). */
.v2-cov-notworked { margin-top: 10px; font-size: 13px; font-weight: 700; }
.v2-cov-notworked a { color: var(--v2-yellow); }
.v2-cov-notworked .v2-tip { color: #fff; }

/* ── Hover / tap explanations ─────────────────────────────────────────
   .v2-tip is a small info icon; its bubble shows on hover and on focus
   (tabindex=0), so a tap opens it on phones. .v2-tip--wrap puts the bubble
   on the element itself (work-list chips, page-switcher links). A closed
   bubble is display:none — a hidden-but-laid-out one near the right edge
   would widen the page on a phone. Open, it is absolutely placed by
   default; portal/js/coverage.js re-places it as position:fixed, so table
   scroll boxes and cards never clip it. */
.v2-tip { position: relative; display: inline-flex; align-items: center; margin-left: 4px; color: inherit; opacity: 0.55; cursor: help; vertical-align: middle; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: normal; line-height: 1; }
.v2-tip.is-open, .v2-tip:hover, .v2-tip:focus { opacity: 1; outline: none; }
.v2-tip:focus-visible i { outline: 2px solid var(--v2-yellow); outline-offset: 1px; border-radius: 50%; }
.v2-tip--wrap { position: relative; }
.v2-tip__bubble {
    display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 80;
    width: max-content; max-width: min(280px, calc(100vw - 16px));
    background: var(--v2-ink); color: #fff; border-radius: 6px; padding: 8px 10px;
    box-shadow: 0 6px 18px rgba(21, 29, 40, 0.22);
    font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal;
    text-transform: none; letter-spacing: normal; font-style: normal; pointer-events: none;
}
.v2-tip.is-open > .v2-tip__bubble, .v2-tip--wrap.is-open > .v2-tip__bubble,
.v2-tip:hover > .v2-tip__bubble, .v2-tip:focus > .v2-tip__bubble,
.v2-tip--wrap:hover > .v2-tip__bubble, .v2-tip--wrap:focus-visible > .v2-tip__bubble { display: block; }
/* The legend beside "Work lists" — every work list explained at once. */
.v2-tip__bubble dl { margin: 0; display: grid; gap: 6px; }
.v2-tip__bubble dt { font-weight: 700; color: var(--v2-yellow); }
.v2-tip__bubble dd { margin: 0; }

/* Print / save as PDF (leadership meetings). Any page can use .v2-print-hide. */
@media print {
    .v2-sidebar, .v2-topbar, .v2-print-hide, .v2-messages { display: none !important; }
    .v2-shell, .v2-main, .v2-content { display: block !important; width: 100% !important; padding: 0 !important; }
    body { background: #fff !important; }
    .v2-card, .v2-kpi-card { break-inside: avoid; }
    .v2-table tr.is-extra { display: table-row; }
    a { text-decoration: none !important; }
    .v2-tip, .v2-tip__bubble { display: none !important; }
    .v2-modal-overlay { display: none !important; }
}
