/* Forecast Accuracy dashboard — follows {prefix}-kpi-* pattern from dashboard.css */

.fa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.fa-kpi-card {
  padding: 16px;
  text-align: center;
}

.fa-kpi-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.fa-kpi-value {
  font-size: 28px;
  font-weight: 700;
}

.fa-section {
  margin-bottom: 24px;
}

.fa-empty {
  text-align: center;
  padding: 40px;
}

.fa-empty-text {
  color: var(--muted);
}

.fa-badge-model {
  background: #fef3c7;
  color: #92400e;
}

.fa-badge-alert {
  background: #fef2f2;
  color: #dc2626;
}

.fa-color-success { color: #16a34a; }
.fa-color-warning { color: #d97706; }
.fa-color-danger  { color: #dc2626; }

.fa-alert-warning {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* =====================================================================
 * Forecast vs Actual tab (Phase 1 — customer-facing accuracy dashboard)
 * ===================================================================== */

.fva-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.fva-tab {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  padding: 10px 16px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  text-decoration: none;
}
.fva-tab:hover { color: var(--ink); }
.fva-tab.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.fva-tab .new-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Date range bar */
.fva-range-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.fva-range-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-right: 4px;
}
.fva-range-input {
  background: #fafaf8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  font-family: inherit;
}
.fva-range-arrow { color: var(--light); font-size: 12px; }
.fva-chips { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.fva-chip {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: #fafaf8;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.fva-chip:hover { border-color: #d4d2cd; color: var(--ink); }
.fva-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Bundle segmented toggle */
.fva-bundle-toggle {
  display: inline-flex;
  background: #f0eeea;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}
.fva-bundle-toggle a {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
}
.fva-bundle-toggle a.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Warning banner */
.fva-banner {
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12px;
}
.fva-banner.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* Headline card — accent-red gradient */
.fva-headline {
  background: linear-gradient(135deg, #fff5f3 0%, #fffaf7 55%, #ffffff 100%);
  border: 1px solid #f5d4ca;
  border-radius: 14px;
  padding: 32px 36px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.fva-headline::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229,77,46,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.fva-headline-grid {
  display: flex;
  align-items: flex-end;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.fva-headline-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent);
  margin-bottom: 10px;
}
.fva-headline-big {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: .95;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.fva-headline-big .pct {
  font-size: 42px;
  font-weight: 700;
  color: #f5a58f;
  margin-left: 2px;
  letter-spacing: -1px;
}
.fva-delta-group { display: flex; flex-direction: column; gap: 6px; }
.fva-delta-line {
  font-size: 13px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.fva-delta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.fva-delta-arrow.up { background: #dcfce7; color: #16a34a; }
.fva-delta-arrow.down { background: #fef2f2; color: #dc2626; }
.fva-delta-val { font-weight: 700; }
.fva-delta-muted { color: var(--muted); font-weight: 400; }
.fva-headline-facts {
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.fva-headline-facts .mono {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.fva-headline-facts .mono.fcast { color: #3b82f6; }
.fva-headline-facts .mono.actual { color: var(--accent); }
.fva-headline-scope {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* Model breakdown cards */
.fva-model-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.fva-model-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}
.fva-model-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.fva-model-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--m-color, #8a8a8a);
  border-radius: 12px 0 0 12px;
}
.fva-model-card.active {
  border-color: var(--m-color, #1a1a1a);
  box-shadow: 0 0 0 1px var(--m-color, #1a1a1a), 0 4px 14px var(--m-shadow, rgba(0,0,0,.08));
}
.fva-model-card[data-m="cold_start"]      { --m-color:#d97706; --m-tint:#fef3c7; --m-shadow:rgba(217,119,6,.15); }
.fva-model-card[data-m="hyper_seasonal"]  { --m-color:#16a34a; --m-tint:#dcfce7; --m-shadow:rgba(22,163,74,.15); }
.fva-model-card[data-m="croston"]         { --m-color:#ea580c; --m-tint:#ffedd5; --m-shadow:rgba(234,88,12,.15); }
.fva-model-card[data-m="weighted_window"] { --m-color:#3b82f6; --m-tint:#dbeafe; --m-shadow:rgba(59,130,246,.15); }
.fva-model-card[data-m="holt_winters"]    { --m-color:#7c3aed; --m-tint:#ede9fe; --m-shadow:rgba(124,58,237,.15); }
.fva-model-code {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--m-color);
  letter-spacing: .5px;
  background: var(--m-tint);
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-block;
}
.fva-model-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 8px;
  line-height: 1.2;
}
.fva-model-pct {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--m-color, var(--ink));
  margin-top: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fva-model-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.fva-model-bar {
  height: 4px;
  background: var(--m-tint, #f0eeea);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.fva-model-bar span {
  display: block;
  height: 100%;
  background: var(--m-color, #1a1a1a);
  border-radius: 2px;
}
@media (max-width: 1200px) { .fva-model-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px)  { .fva-model-grid { grid-template-columns: repeat(2, 1fr); } }

/* Per-SKU table */
.fva-table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.fva-table-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light, #f0eeea);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fva-table-head h3 { font-size: 14px; font-weight: 700; margin: 0; }
.fva-table-count { font-size: 12px; color: var(--muted); }
.fva-table-spacer { flex: 1; }
.fva-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fva-table thead th {
  background: #fafaf8;
  color: var(--light);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.fva-table thead th.num { text-align: right; }
.fva-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f5f4f2;
  vertical-align: middle;
}
.fva-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fva-main-row { cursor: pointer; transition: background .1s; }
.fva-main-row:hover { background: #fafaf8; }
.fva-main-row.expanded { background: #fafaf8; }
.fva-main-row.expanded td { border-bottom-color: transparent; }
.fva-sku-code {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.fva-sku-name {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink);
}
.fva-delta-pct {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fva-delta-pct.neg { color: #dc2626; }
.fva-delta-pct.pos { color: #16a34a; }
.fva-delta-pct.neutral { color: var(--muted); }
.fva-model-tag {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f0eeea;
  color: #555;
  letter-spacing: .5px;
  display: inline-block;
}
.fva-model-tag[data-m="cold_start"]      { background: #fef3c7; color: #b45309; }
.fva-model-tag[data-m="hyper_seasonal"]  { background: #dcfce7; color: #16a34a; }
.fva-model-tag[data-m="croston"]         { background: #ffedd5; color: #c2410c; }
.fva-model-tag[data-m="weighted_window"] { background: #dbeafe; color: #2563eb; }
.fva-model-tag[data-m="holt_winters"]    { background: #ede9fe; color: #7c3aed; }
.fva-caret-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform .15s;
  border: none;
  background: none;
  cursor: pointer;
}
.fva-main-row.expanded .fva-caret-btn { transform: rotate(180deg); color: var(--ink); }

/* Expand row */
.fva-expand-row td {
  padding: 0;
  border-bottom: 1px solid #f5f4f2;
  background: #fafaf8;
}
.fva-expand-inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease;
}
.fva-expand-row.open .fva-expand-inner { max-height: 260px; }
.fva-expand-content {
  padding: 14px 22px 18px 42px;
  border-left: 3px solid var(--ink);
  margin: 0 14px 10px;
  background: #f5f4f0;
  border-radius: 0 8px 8px 0;
}
.fva-expand-kv {
  display: flex;
  gap: 22px;
  font-size: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.fva-kv-k {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.fva-kv-v {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fva-reason-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  margin-right: 8px;
  font-weight: 700;
  font-size: 11px;
}
.fva-reason-icon.reason-oos        { background: #fef2f2; color: #dc2626; }
.fva-reason-icon.reason-surge      { background: #f5f3ff; color: #7c3aed; }
.fva-reason-icon.reason-override   { background: #fffbeb; color: #d97706; }
.fva-reason-icon.reason-cold_start { background: #eff6ff; color: #3b82f6; }
.fva-reason-icon.reason-on_target  { background: #dcfce7; color: #16a34a; }
.fva-reason-icon.reason-other      { background: #f0eeea; color: var(--muted); }
.fva-reason-line {
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  line-height: 1.5;
  font-weight: 500;
  margin-bottom: 8px;
}
.fva-reason-link {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  text-decoration: underline;
  text-decoration-color: #bfdbfe;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* Footer disclaimer */
.fva-disclaimer {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 900px;
  margin-top: 10px;
  padding: 0 4px;
}

/* Empty + inline messages */
.fva-empty {
  padding: 72px 24px;
  text-align: center;
}
.fva-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f0eeea;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 22px;
}
.fva-empty h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.fva-empty p { font-size: 13px; color: var(--muted); max-width: 400px; margin: 0 auto; }
.fva-inline-msg {
  padding: 48px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.fva-inline-msg b {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 14px;
}

/* Filters bar (Replen-by-SKU parity + accuracy-specific filters) */
.fva-filters-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.fva-filters-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.fva-filters-top h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin: 0;
}
.fva-filters-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 1200px) { .fva-filters-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .fva-filters-grid { grid-template-columns: repeat(2, 1fr); } }
.fva-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fva-filter-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.fva-filter-input,
.fva-filter-select {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  width: 100%;
  height: 32px;
}
.fva-filter-input:focus,
.fva-filter-select:focus {
  outline: none;
  border-color: #d4d2cd;
}
.fva-filters-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  gap: 8px;
}
.fva-clear-link {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: none;
}
.fva-clear-link:hover { color: var(--ink); }

/* =================================================================
   Forecast Engine Health (Phase 1.5) — super admin only
   .feh-* namespace. See ai_reference/forecast_accuracy_snapshots.md
   ================================================================= */

/* ---------- page header ---------- */
.feh-ph { margin-bottom:24px; }
.feh-ph h1 { font-size:28px; font-weight:700; letter-spacing:-0.3px; color:#2a2a2a; margin:0; }
.feh-ph-sub { font-size:12px; color:#6b7280; margin-top:6px; display:flex; align-items:center; gap:10px; }
.feh-ph-meta { font-size:11px; color:#9ca3af; font-family:var(--font-mono, monospace); font-variant-numeric:tabular-nums; margin-top:10px; }
.feh-pill-super {
  display:inline-flex; align-items:center; gap:5px;
  font-size:10px; font-weight:700; letter-spacing:.5px; text-transform:uppercase;
  background:#1a1a1a; color:#fff; padding:3px 9px; border-radius:999px;
}

/* ---------- filters ---------- */
.feh-filters {
  background:#fff; border:1px solid #e7e5e0; border-radius:12px;
  padding:16px 20px; margin-bottom:16px;
  display:grid; grid-template-columns: repeat(7, 1fr) auto; gap:12px 14px; align-items:end;
}
.feh-flt { min-width:0; }
.feh-flt label {
  display:block; font-size:9px; font-weight:700; letter-spacing:.5px;
  text-transform:uppercase; color:#6b7280; margin-bottom:6px;
}
.feh-flt .feh-ctrl {
  background:#fafaf8; border:1px solid #e0ded7; border-radius:8px;
  padding:10px 14px; font-family:inherit; font-size:13px; font-weight:500; color:#2a2a2a;
  width:100%; display:flex; align-items:center; gap:6px; cursor:pointer;
  font-variant-numeric:tabular-nums; text-align:left;
}
.feh-flt .feh-ctrl:hover { border-color:#d4d2cd; }
.feh-flt .feh-ctrl .feh-chev { margin-left:auto; color:#9ca3af; font-size:10px; }
.feh-flt .feh-ctrl .feh-val { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.feh-flt.feh-active label { color:#e54d2e; }
.feh-flt.feh-active .feh-ctrl { border-color:#e54d2e; color:#2a2a2a; background:#fff; box-shadow:0 0 0 3px rgba(229,77,46,.06); }
.feh-flt.feh-active .feh-ctrl .feh-chev { color:#e54d2e; }
.feh-clear-btn {
  height:40px; padding:0 16px; background:transparent; border:1px solid #d4d1c7;
  border-radius:8px; font-family:inherit; font-size:12px; font-weight:600; color:#6b7280;
  cursor:pointer; display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
  text-decoration:none;
}
.feh-clear-btn:hover { border-color:#2a2a2a; color:#2a2a2a; }

/* ---------- KPI card ---------- */
.feh-kpi {
  background:
    radial-gradient(ellipse 600px 300px at 0% 0%, var(--kpi-tint, #fff5f3) 0%, transparent 70%),
    #fff;
  border:1px solid #e7e5e0; border-radius:14px;
  padding:28px 32px; margin-bottom:16px; position:relative; overflow:hidden;
}
.feh-kpi::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
  background: var(--kpi-accent, #e54d2e);
}
.feh-kpi-row { display:grid; grid-template-columns: 1fr 360px; gap:32px; align-items:flex-start; }
.feh-kpi-eyebrow {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.8px;
  color: var(--kpi-accent, #e54d2e);
}
.feh-kpi-big {
  font-size:82px; font-weight:800; letter-spacing:-2px; color: var(--kpi-accent, #2a2a2a);
  font-variant-numeric:tabular-nums; line-height:1; margin-top:12px;
  display:flex; align-items:flex-start; gap:2px;
}
.feh-kpi-big .feh-pct { font-size:44px; font-weight:700; color: var(--kpi-accent, #9ca3af); opacity:.5; margin-top:10px; letter-spacing:-1px; }
.feh-kpi-big .feh-frac { font-size:82px; opacity:1; }
.feh-kpi-big.feh-insufficient { color:#9ca3af; font-weight:700; }
.feh-kpi-scope { font-size:13px; color:#6b7280; margin-top:18px; font-variant-numeric:tabular-nums; }
.feh-kpi-scope .feh-sep { color:#9ca3af; margin:0 8px; }
.feh-kpi-scope.feh-insufficient b { color:#2a2a2a; font-weight:600; }
.feh-kpi-scope .feh-mono-b { font-family:var(--font-mono, monospace); font-weight:700; font-size:12px; }

/* Filter-summary chips */
.feh-chips { display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
.feh-chips.feh-inline { flex-direction:row; flex-wrap:wrap; justify-content:flex-end; }
.feh-chips:empty { display:none; }
.feh-chip {
  display:inline-flex; align-items:center; gap:6px;
  background: var(--chip-bg, #f5f4f0); color: var(--chip-fg, #2a2a2a);
  font-size:12px; font-weight:500;
  padding:4px 4px 4px 10px; border-radius:999px; max-width:100%;
  text-decoration:none;
}
.feh-chip .feh-k { color: var(--chip-fg, #6b7280); font-weight:500; opacity:.7; }
.feh-chip .feh-v { color: var(--chip-fg, #2a2a2a); font-weight:700; }
.feh-chip .feh-x {
  width:18px; height:18px; border-radius:50%; background:transparent;
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
  color: var(--chip-fg, #6b7280); opacity:.7; font-size:11px; line-height:1;
  text-decoration:none;
}
.feh-chip .feh-x:hover { background:rgba(0,0,0,.06); opacity:1; }

/* ---------- chart ---------- */
.feh-chart-card {
  background:#fff; border:1px solid #e7e5e0; border-radius:12px;
  padding:24px 28px; margin-bottom:16px;
}
.feh-chart-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; gap:12px; }
.feh-chart-label {
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.8px;
  color:#6b7280;
}
.feh-chart-nsku { font-size:11px; color:#9ca3af; font-weight:500; text-transform:none; letter-spacing:0; margin-left:8px; }
.feh-chart-legend { font-size:11px; color:#6b7280; font-variant-numeric:tabular-nums; display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.feh-leg-item { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:#4b5563; }
.feh-leg-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.feh-chart-wrap { height:260px; position:relative; }

/* ---------- model cards ---------- */
.feh-mcards {
  display:grid; grid-template-columns: repeat(5, 1fr); gap:12px;
  margin-bottom:16px;
}
.feh-mcard {
  background:#fff; border:1px solid #e7e5e0; border-radius:12px;
  padding:14px 16px 0; position:relative; overflow:hidden;
  cursor:pointer; transition: box-shadow .15s, transform .15s;
  border-left:4px solid var(--model-accent);
  text-decoration:none; color:inherit; display:block;
}
.feh-mcard:hover { box-shadow:0 2px 12px rgba(0,0,0,.06); }
.feh-mcard.feh-active { box-shadow:0 0 0 2px var(--model-accent), 0 2px 12px rgba(0,0,0,.06); }
.feh-mcard.feh-grayed { opacity:.5; cursor:default; pointer-events:none; }
.feh-mc-top { display:flex; align-items:center; gap:8px; }
.feh-mc-code {
  font-family:var(--font-mono, monospace); font-size:11px; font-weight:700;
  background: var(--model-bg); color: var(--model-accent);
  padding:2px 7px; border-radius:4px;
}
.feh-mc-name { font-size:13px; font-weight:700; color:#2a2a2a; }
.feh-mc-acc {
  font-size:32px; font-weight:800; color: var(--model-accent);
  font-variant-numeric:tabular-nums; letter-spacing:-.5px; line-height:1;
  margin:10px 0 4px; display:flex; align-items:baseline; gap:1px;
}
.feh-mc-acc .feh-mc-frac { font-size:16px; font-weight:700; opacity:.65; }
.feh-mc-acc .feh-mc-pct { font-size:14px; font-weight:700; opacity:.6; margin-left:2px; }
.feh-mc-acc.feh-dash { color:#9ca3af; font-size:28px; font-weight:700; }
.feh-mc-sub {
  font-size:11px; color:#6b7280; padding-bottom:10px; display:flex; align-items:center; gap:6px;
}
.feh-mc-bar {
  position:absolute; left:0; right:0; bottom:0; height:3px;
  background: color-mix(in srgb, var(--model-accent) 14%, transparent);
}
.feh-mc-bar::after {
  content:''; position:absolute; left:0; top:0; bottom:0;
  width: var(--acc-w, 0%); background: var(--model-accent);
}

/* ---------- breakdown table ---------- */
.feh-brk {
  background:#fff; border:1px solid #e7e5e0; border-radius:12px;
  margin-bottom:16px; overflow:hidden;
}
.feh-brk-head {
  padding:16px 24px; display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid #f0efea;
}
.feh-brk-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:#6b7280; }
.feh-brk-hint { font-size:11px; color:#9ca3af; }
.feh-brk-tbl { width:100%; border-collapse:collapse; }
.feh-brk-tbl thead th {
  font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  color:#9ca3af; text-align:left; padding:10px 16px;
  border-bottom:1px solid #f0efea; white-space:nowrap;
}
.feh-brk-tbl thead th.feh-num { text-align:right; }
.feh-brk-tbl tbody tr { border-top:1px solid #f0efea; cursor:pointer; border-left:3px solid transparent; }
.feh-brk-tbl tbody tr:hover { background:#fafaf8; }
.feh-brk-tbl tbody tr.feh-active-filter { border-left-color: var(--model-accent); background:#fafaf8; }
.feh-brk-tbl tbody tr.feh-grayed { opacity:.5; cursor:default; }
.feh-brk-tbl tbody tr.feh-grayed:hover { background:transparent; }
.feh-brk-tbl tbody td { padding:16px; vertical-align:middle; font-size:13px; color:#2a2a2a; }
.feh-brk-tbl tbody td.feh-num { text-align:right; font-variant-numeric:tabular-nums; color:#6b7280; font-size:13px; }
.feh-brk-tbl tbody td.feh-num.feh-acc { color: var(--model-accent, #2a2a2a); font-size:18px; font-weight:700; }
.feh-brk-tbl tbody td.feh-num.feh-acc .feh-frac { font-size:13px; opacity:.55; font-weight:700; }
.feh-brk-tbl tbody td.feh-num.feh-acc.feh-dash { color:#9ca3af; font-weight:600; }
.feh-brk-tbl tbody tr.feh-grayed td.feh-num.feh-acc { color:#9ca3af; }

.feh-mcode {
  display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--font-mono, monospace); font-size:12px; font-weight:700;
  padding:4px 8px; border-radius:4px; min-width:36px;
  background: var(--model-bg); color: var(--model-accent);
}
.feh-mname { font-size:13px; font-weight:500; color:#2a2a2a; }
.feh-filtered-tag {
  margin-left:10px; font-size:9px; font-weight:700; letter-spacing:.5px;
  text-transform:uppercase; color: var(--model-accent);
  background: var(--model-bg); padding:2px 6px; border-radius:4px;
}
.feh-slope-pill {
  display:inline-flex; align-items:center; gap:4px;
  font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px;
  font-variant-numeric:tabular-nums;
}
.feh-slope-up   { background:#dcfce7; color:#16a34a; }
.feh-slope-down { background:#fef2f2; color:#dc2626; }
.feh-slope-flat { background:#f0efea; color:#6b7280; }
.feh-slope-na   { font-size:11px; color:#9ca3af; font-weight:500; }

/* ---------- deltas table ---------- */
.feh-deltas-card { background:#fff; border:1px solid #e7e5e0; border-radius:12px; overflow:hidden; margin-bottom:16px; }
.feh-deltas-head { padding:16px 24px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #f0efea; flex-wrap:wrap; gap:8px; }
.feh-deltas-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:#6b7280; }
.feh-deltas-sub { font-weight:400; text-transform:none; letter-spacing:0; color:#9ca3af; margin-left:8px; font-size:11px; }
.feh-deltas-hint { font-size:11px; color:#9ca3af; }
.feh-delta-tbl { width:100%; border-collapse:collapse; }
.feh-delta-tbl thead th { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:#9ca3af; text-align:left; padding:10px 16px; border-bottom:1px solid #f0efea; white-space:nowrap; }
.feh-delta-tbl thead th.feh-num { text-align:right; }
.feh-delta-tbl tbody tr { border-top:1px solid #f0efea; }
.feh-delta-tbl tbody tr:hover { background:#fafaf8; }
.feh-delta-tbl tbody td { padding:14px 16px; font-size:13px; color:#2a2a2a; vertical-align:middle; }
.feh-delta-tbl tbody td.feh-num { text-align:right; font-variant-numeric:tabular-nums; }
.feh-delta-tbl .feh-sku { font-family:var(--font-mono, monospace); font-size:11px; color:#6b7280; }
.feh-delta-tbl .feh-pname { font-weight:600; font-size:13px; }
.feh-delta-tbl .feh-fc { color:#3b82f6; font-weight:700; }
.feh-delta-tbl .feh-ac { color:#2a2a2a; font-weight:700; }
.feh-delta-tbl .feh-diff-pos { color:#16a34a; font-weight:700; font-variant-numeric:tabular-nums; }
.feh-delta-tbl .feh-diff-neg { color:#dc2626; font-weight:700; font-variant-numeric:tabular-nums; }
.feh-delta-tbl .feh-sub-unit { display:block; font-size:10px; color:#9ca3af; font-weight:500; margin-top:2px; }
.feh-sku-link { display:block; text-decoration:none; color:inherit; border-radius:4px; padding:2px 4px; margin:-2px -4px; transition:background .12s; }
.feh-sku-link:hover { background:#f5f4f0; }
.feh-sku-link:hover .feh-pname { color:#e54d2e; }
.feh-sku-link:hover .feh-sku { color:#3b82f6; }

/* ---------- empty state ---------- */
.feh-empty {
  background:#fff; border:1px solid #e7e5e0; border-radius:14px;
  padding:72px 32px; text-align:center; margin-bottom:16px;
}
.feh-empty h2 { font-size:20px; font-weight:700; color:#2a2a2a; margin:0 0 8px; }
.feh-empty p { font-size:14px; color:#6b7280; margin:0; }
.feh-empty .feh-ei { color:#9ca3af; margin-bottom:16px; font-size:48px; }

/* ---------- retention warning ---------- */
.feh-warn {
  background:#fffbeb; border:1px solid #fbbf24; border-radius:10px;
  padding:12px 16px; margin-bottom:16px; color:#92400e;
  font-size:12px; display:flex; align-items:center; gap:8px;
}
.feh-warn b { color:#78350f; }

/* ---------- Per-SKU table — sortable headers, merged column, reason cell, csv,
              tooltip — added 2026-05-05 alongside the table redesign ---------- */
.fva-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  transition: all 0.15s;
}
.fva-help:hover, .fva-help:focus {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
  outline: none;
}

.fva-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  margin-left: auto;
  transition: all 0.15s;
}
.fva-csv-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.fva-th-sort { cursor: pointer; }
.fva-th-sort .fva-th-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}
.fva-th-sort:hover .fva-th-link { color: var(--ink); }
.fva-th-sort--active .fva-th-link { color: var(--ink); font-weight: 700; }
.fva-th-arrow { font-size: 8px; opacity: 0.7; }

.fva-sku-product {
  text-align: left;
  min-width: 240px;
  max-width: 360px;
}
.fva-sku-product .fva-product-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
}
.fva-sku-product .fva-sku-code {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.fva-sku-product .sku-link { color: inherit; text-decoration: none; }
.fva-sku-product .sku-link:hover { color: var(--accent); text-decoration: underline; }

.fva-reason-cell {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  min-width: 220px;
  max-width: 360px;
}
.fva-reason-cell .fva-reason-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  margin-top: 1px;
}
.fva-reason-cell .fva-reason-text { line-height: 1.35; }

.fva-th-action { white-space: nowrap; }
.fva-action-cell {
  white-space: nowrap;
  min-width: 160px;
}
.fva-action-cell .fva-reason-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.fva-action-cell .fva-reason-link:hover { text-decoration: underline; }

.fva-pagination {
  margin-top: 12px;
  padding-top: 4px;
}
.fva-table .num.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Shadow WW super-admin overlay — engineering signal surfaced on the
   customer-facing FvA tab only when current_user.super_admin?. See
   ai_reference/forecast_accuracy_snapshots.md for the column semantics. */
.fva-pill-super {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  vertical-align: middle;
}
.fva-shadow-sub { font-size: 11px; line-height: 1.1; margin-top: 2px; }
.fva-shadow-won {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  border-radius: 3px;
}
.fva-shadow-lost {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 3px;
}
.fva-muted { color: var(--muted); }

/* ── Stream B Seasonality Source surfaces (engine health + forecast QA) ── */
.feh-source-panel {
  background: #fff;
  border: 1px solid #e7e5e0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.feh-source-head { margin-bottom: 12px; }
.feh-source-label { font-size: 14px; font-weight: 700; color: #2a2a2a; }
.feh-source-hint { font-size: 11px; color: #6b7280; margin-top: 2px; }
.feh-source-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.feh-source-tile {
  background: var(--src-bg, #f5f4f0);
  color: var(--src-fg, #2a2a2a);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.04);
}
.feh-source-name { font-size: 11px; font-weight: 600; opacity: 0.85; }
.feh-source-count { font-size: 22px; font-weight: 700; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.feh-source-pct { font-size: 11px; opacity: 0.85; margin-top: 1px; }

.feh-top-sources { white-space: normal; vertical-align: middle; }
.feh-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-right: 4px;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}
.feh-source-badge-n {
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

/* ── Forecast QA source-distribution KPI tiles + per-row badges ── */
.fa-source-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.fa-source-tile {
  background: var(--src-bg, #f5f4f0);
  color: var(--src-fg, #2a2a2a);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 8px 10px;
}
.fa-source-tile .name { font-size: 10.5px; font-weight: 600; opacity: 0.85; }
.fa-source-tile .count { font-size: 18px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fa-source-tile .pct { font-size: 10.5px; opacity: 0.85; }

.fa-source-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}

