/* ---------------- Online IFA POC ---------------- */
:root {
    --ifa-navy: #005893; --ifa-orange: #FF6400; --ifa-teal: #00989F; --ifa-peach: #FFE7D9; --ifa-text: #222B36;
    /* Brand fonts (Sculpin / BentonSans) are out of scope for the POC — system fallbacks; swap here later. */
    --ifa-font-display: "Montserrat", "Segoe UI", Arial, sans-serif;
    --ifa-font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}
body { font-family: var(--ifa-font-body); color: var(--ifa-text); }
.sidebar { background-image: linear-gradient(180deg, var(--ifa-navy) 0%, #003d66 70%) !important; }
.brand-logo { display: flex; align-items: center; gap: .5rem; }
.brand-logo img { height: 30px; width: auto; }
.nav-icon { font-size: 1.1rem; width: 1.5rem; margin-right: .5rem; text-align: center; }
.poc-badge { font-size: .65rem; background: var(--ifa-orange); color: #fff; border-radius: 3px; padding: 1px 5px; vertical-align: middle; }
.ifa-title { font-family: var(--ifa-font-display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ifa-navy); font-size: 1.6rem; margin: 0; }
.ifa-eyebrow { font-family: var(--ifa-font-display); letter-spacing: .15em; text-transform: uppercase; color: var(--ifa-orange); font-size: .8rem; }
.ifa-h2 { font-family: var(--ifa-font-display); color: var(--ifa-navy); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 1.5rem; }
.status-table th { width: 32%; font-weight: 600; }
.ok { color: #198754; } .bad { color: #dc3545; } .warn { color: #d68100; }

.results-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.kpi-box { background: var(--ifa-peach); border-radius: 12px; padding: .75rem 1.25rem; text-align: right; min-width: 260px; }
.kpi-label { font-size: .8rem; color: var(--ifa-navy); }
.kpi-value { font-family: var(--ifa-font-display); font-size: 1.9rem; font-weight: 700; }
.savings { color: var(--ifa-orange); } .cost { color: var(--ifa-navy); }

.panel { background: #fff; border: 1px solid #e3e8ee; border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.panel h3 { font-family: var(--ifa-font-display); font-size: 1rem; color: var(--ifa-navy); text-transform: uppercase; letter-spacing: .05em; }
.panel h4 { font-size: .9rem; color: var(--ifa-navy); }

.snapshot-chart { width: 100%; height: auto; font-family: var(--ifa-font-body); }
.snapshot-chart .seg { font-size: 11px; }
.snapshot-chart .seg.light { fill: #fff; }
.snapshot-chart .seg.dark { fill: var(--ifa-navy); }
.snapshot-chart .total { font-size: 13px; font-weight: 700; fill: var(--ifa-orange); }
.snapshot-chart .cat { font-size: 12px; fill: var(--ifa-text); }
.snapshot-chart .legend text { font-size: 11px; }

.snapshot-table td, .snapshot-table th { white-space: nowrap; font-size: .85rem; }
.delta { font-size: .78rem; }
.delta.savings { color: var(--ifa-orange); }
.delta.cost { color: var(--ifa-navy); }
.facts { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; }

.scenario-head { display: flex; align-items: center; gap: .5rem; }
.scenario-head h3 { margin: 0; }
.scenario-editor { display: grid; gap: .5rem; margin-top: .5rem; }
.scenario-editor label { font-size: .8rem; width: 100%; }
.tier-row { display: flex; align-items: flex-end; gap: .4rem; font-size: .8rem; }
.tier-row > span { padding-bottom: .35rem; }
.tier-input { width: 4.6rem; font-size: .75rem; }
.quick { font-size: .8rem; }
.assumptions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.assumptions label { font-size: .8rem; }

.class-table td, .class-table th, .band-table td, .band-table th, .emp-table td, .emp-table th { font-size: .78rem; white-space: nowrap; text-align: right; }
.class-table td:first-child, .band-table td:first-child, .emp-table td:nth-child(-n+6) { text-align: left; }
.class-table thead th, .band-table thead th, .emp-table thead th { background: var(--ifa-navy); color: #fff; position: sticky; top: 0; }
.class-table td.savings { color: var(--ifa-orange); font-weight: 600; }
.band-scroll { max-height: 480px; overflow: auto; }
.band-controls { max-width: 260px; margin-bottom: .5rem; }
.emp-table tr.waived td { color: #9aa5b1; }
.emp-table td.bad { color: #dc3545; font-weight: 700; }

/* ---------------- wizard ---------------- */
.stepper { margin-bottom: 1rem; }
.stepper-title { font-size: .85rem; margin-bottom: .4rem; }
.stepper ol { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.stepper li a { display: inline-block; padding: .35rem .8rem; border-radius: 999px; background: #eef2f6; color: var(--ifa-text); text-decoration: none; font-size: .85rem; }
.stepper li.done a { background: #e3f3ef; color: #0f6e5a; }
.stepper li.current a { background: var(--ifa-navy); color: #fff; }
.stepper .num { font-weight: 700; margin-right: .25rem; }
.stepper .step-blocked { display: inline-block; padding: .35rem .8rem; border-radius: 999px; background: #f4f6f8; color: #aab4be; font-size: .85rem; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem 1rem; }
.form-grid label, .wizard-form label { font-size: .8rem; }
.mapping-table td, .mapping-table th { font-size: .8rem; vertical-align: middle; }
.mapping-table tr.unmapped td:first-child { color: #9aa5b1; }
.mapping-table select { max-width: 18rem; }
.sheet-excluded { opacity: .6; }
.issue-table td { font-size: .82rem; vertical-align: middle; }
.census-grid td, .census-grid th { font-size: .75rem; white-space: nowrap; padding: .15rem .3rem; }
.census-grid thead th { background: var(--ifa-navy); color: #fff; position: sticky; top: 0; z-index: 1; }
.census-grid input, .census-grid select { font-size: .75rem; border: 1px solid #dde3ea; border-radius: 3px; padding: 0 .2rem; }
.census-grid tr.row-error td { background: #fdecee; }
.census-grid tr.row-warn td { background: #fff8e6; }
.rate-table input { max-width: 8rem; }
.rate-table td, .rate-table th { font-size: .8rem; vertical-align: middle; }
.review-panel { background: #f7f9fc; border: 1px solid #dbe4ee; border-left: 4px solid var(--ifa-navy); border-radius: 8px; padding: .6rem .8rem; }
.doc-viewer { position: sticky; top: 1rem; }
.doc-viewer iframe { width: 100%; height: 80vh; border: 1px solid #dde3ea; border-radius: 6px; margin-top: .5rem; }

/* Step 2 census scrub */
.scrub-kpis { display: flex; gap: .5rem; flex-wrap: wrap; }
.scrub-kpis .kpi-box { min-width: 0; flex: 1 1 8rem; padding: .5rem .75rem; text-align: left; }
.scrub-kpis .kpi-value { font-size: 1.3rem; }
.scrub-kpis .kpi-box.bad { background: #fde2e1; }
.scrub-grid td, .scrub-grid th { font-size: .78rem; white-space: nowrap; vertical-align: middle; }
.scrub-grid tr.row-error td { background: #fdecea; }
.scrub-grid tr.row-warn td { background: #fff8e6; }
.scrub-chat { position: sticky; top: 1rem; }
.chat-log { max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: .25rem 0; }
.chat-msg { font-size: .85rem; padding: .45rem .65rem; border-radius: 10px; max-width: 92%; position: relative; }
.chat-msg.me { align-self: flex-end; background: var(--ifa-navy); color: #fff; }
.chat-msg.them { align-self: flex-start; background: #eef3f8; }
.chat-via { font-size: .65rem; opacity: .6; margin-left: .4rem; text-transform: uppercase; letter-spacing: .05em; }
.scrub details > summary { cursor: pointer; }

/* Interactive report, Reports portfolio, Bavvatar */
.clickable { cursor: pointer; }
.chip { border: 1px solid #cfd8e3; background: #fff; color: var(--ifa-text); border-radius: 14px; padding: 1px 10px; font-size: .8rem; }
.chip.on { background: var(--ifa-navy); border-color: var(--ifa-navy); color: #fff; }
.insight-filters { position: sticky; top: 0; z-index: 4; padding: .6rem .8rem; }
.insight-tabs .nav-link { font-size: .9rem; }
.tab-body { border-top-left-radius: 0; }
.insight-chart { width: 100%; height: auto; font-family: var(--ifa-font-body); }
.insight-chart .lbl { font-size: 12px; fill: #222B36; }
.insight-chart .val { font-size: 11px; fill: #5B6673; }
.insight-chart .axis { font-size: 10px; fill: #5B6673; }
.insight-chart .clickable:hover path, .insight-chart circle.clickable:hover { opacity: .8; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.insight-table td, .insight-table th { font-size: .8rem; vertical-align: middle; white-space: nowrap; }
.insight-table th.sortable { cursor: pointer; user-select: none; }
.insight-table tr.hl td { background: #fff1e6 !important; }
.insight-table tr.waived td { color: #7a8591; }
.cost { color: #b34700; } .savings { color: #007a80; }
.pctbar { background: #eef2f6; border-radius: 4px; height: 10px; overflow: hidden; } .pctbar span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.carrier-chip { display: inline-block; background: #eef3f8; border-radius: 10px; padding: 0 7px; margin: 1px 3px 1px 0; font-size: .75rem; white-space: nowrap; }
.whatif-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; font-size: .85rem; }
.badge[class*="stage-"] { background: #e7ebf0; color: #46515e; } .badge.stage-locked { background: #dff3e6; color: #1d6b3a; } .badge.stage-delivered { background: var(--ifa-navy); color: #fff; }
/* Bavvatar: avatar on the left, chat on the right; stacked (avatar on top) where the space is narrow, e.g. a sidebar. */
.bavvatar { container-type: inline-size; }
.bv-grid { display: flex; flex-direction: column; }
.bv-side { flex: none; }
.bv-main { display: flex; flex-direction: column; min-width: 0; }
@container (min-width: 620px) {
    .bv-grid { display: grid; grid-template-columns: minmax(220px, 36%) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
    .bv-main .bv-log { min-height: 300px; max-height: 440px; }
}
.bv-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.bv-name { font-family: var(--ifa-font-display); color: var(--ifa-navy); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.bv-log { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; min-height: 200px; max-height: 58vh; }
.bv-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; } .bv-chips .btn { font-size: .75rem; padding: 1px 8px; border-radius: 12px; }
.bv-card { background: #fff; border: 1px solid #dbe4ee; border-radius: 8px; padding: .4rem .55rem; margin-top: .35rem; font-size: .8rem; color: var(--ifa-text); }
.bv-plans td { font-size: .75rem; padding: 1px 4px; background: transparent !important; }

/* Portfolio savings strip (beeswarm) */
.insight-chart.swarm circle.clickable { cursor: pointer; transition: opacity .1s; }
.insight-chart.swarm circle.clickable:hover { fill-opacity: 1; stroke: #222B36; stroke-width: 1.5; }
.swarm-stats { color: #5B6673; }
.swarm-stats b { color: #222B36; font-weight: 600; }

/* Bavvatar video avatar (Azure talking avatar) */
.bv-stage { position: relative; margin-bottom: .5rem; border-radius: 8px; overflow: hidden; background: #f4f6f9; border: 1px solid #e1e6ec; aspect-ratio: 4 / 3; }
/* the stream is a wide 1920×1080 shot with the avatar small in the middle — crop to head and shoulders */
.bv-stage video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(2.1); transform-origin: 50% 18%; }
.bv-stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; color: #5B6673; }
.bavvatar.talking .bv-stage { box-shadow: 0 0 0 2px var(--ifa-teal); }
.bavvatar.listening .bv-stage { box-shadow: 0 0 0 2px var(--ifa-orange); }
.bavvatar.thinking .bv-stage { box-shadow: 0 0 0 2px var(--ifa-peach); }
