/* ═══════════════════════════════════════════════════
   BUSINESS NUMBERS — Design System
   Tokens, Base, Components, Views
════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────── */
:root {
  --primary:       #7C3AED;
  --primary-tone:  #8b5cf6;
  --primary-soft:  #EDE9FE;
  --primary-tonal: #EDE9FE;
  --primary-dark:  #5B21B6;
  --accent:        #0EA5E9;
  --accent-tone:   #22d3ee;
  --accent-soft:   #E0F2FE;
  --error:         #EF4444;
  --error-tonal:   #FEE2E2;
  --error-on:      #991B1B;
  --warn:          #F59E0B;
  --warn-tonal:    #FEF3C7;
  --warn-on:       #92400E;
  --success:       #10B981;
  --success-tonal: #D1FAE5;
  --success-on:    #065F46;
  --surface:       #ffffff;
  --surface-2:     #fafbff;
  --bg:            #F8F7FF;
  --on-s:          #1C1433;
  --on-s2:         #3f3a52;
  --muted:         #6B7280;
  --faint:         #9CA3AF;
  --outline:       #E8E4F8;
  --outline-faint: #E8E4F8;
  --ink:           #1C1433;

  --sh1: 0 1px 3px rgba(124,58,237,.08), 0 1px 2px rgba(0,0,0,.04);
  --sh2: 0 4px 16px rgba(124,58,237,.1), 0 2px 4px rgba(0,0,0,.04);
  --sh3: 0 4px 16px rgba(124,58,237,.1), 0 2px 4px rgba(0,0,0,.04);
  --r:   12px;
  --rl:  16px;
  --rxl: 28px;

  --sidebar-w: 240px;
  --topbar-h:  44px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-disp: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--on-s);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
  display: flex;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 700; }

/* ── LAYOUT ─────────────────────────────────────── */
.dashboard {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Sidebar */
.nav-drawer {
  width: var(--sidebar-w);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--outline-faint);
}
.nav-header {
  padding: 16px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--outline-faint);
}
.nav-logo {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-brand { font-size: 13px; font-weight: 700; color: var(--on-s); line-height: 1.2; }
.nav-brand-sub { font-size: 11px; color: var(--muted); }
.nav-items { padding: 8px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  height: 44px;
  border-radius: var(--rxl);
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--on-s); text-decoration: none; }
.nav-item.active { background: var(--primary-tonal); color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 17px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-badge--warn { background: var(--warn); }
.nav-badge--alert { background: var(--error); }
.nav-footer { padding: 10px 10px 14px; border-top: 1px solid var(--outline-faint); }
.period-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  border: 1px solid var(--outline);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--on-s2);
  cursor: pointer;
  transition: background .15s;
}
.period-chip:hover { background: var(--bg); }
.period-arrow { margin-left: auto; color: var(--faint); font-size: 10px; transition: transform .15s; }
.period-chip.open .period-arrow { transform: rotate(180deg); }

.period-wrap { position: relative; margin: 0 4px; }
.period-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  display: none;
  z-index: 50;
  max-height: 330px;
  overflow-y: auto;
  padding: 4px;
}
.period-dropdown.open { display: block; }
.period-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--on-s2);
  cursor: pointer;
}
.period-item:hover { background: var(--bg); }
.period-item.active { background: var(--bg); color: var(--btn-primary); font-weight: 700; }
.period-item--empty { color: var(--muted); opacity: .75; }

/* Date range picker's own dropdown content (#range-dropdown) — a separate
   chip/panel from the Month one, not a section appended below it. */
.period-range-section {
  padding: 6px 8px 6px;
}
.period-range-label {
  font-size: 11px; font-weight: 700; color: var(--on-s2);
  text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px;
}
.period-range-hint { font-weight: 500; text-transform: none; color: var(--muted); letter-spacing: 0; }
.period-range-inputs { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.period-range-inputs input[type="date"] {
  flex: 1; min-width: 0; font-size: 12px; padding: 5px 6px;
  border: 1px solid var(--outline); border-radius: 6px; color: var(--on-s);
  background: var(--surface); font-family: inherit;
}
.period-range-sep { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.period-range-error {
  font-size: 11px; color: var(--error, #dc2626); margin-bottom: 6px; line-height: 1.4;
}
.period-range-actions { display: flex; gap: 6px; }
.period-range-apply {
  flex: 1; padding: 7px 10px; font-size: 12.5px; border-radius: 7px;
}
.period-range-cancel {
  padding: 7px 12px; font-size: 12.5px; border-radius: 7px;
}
.period-nodata { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

/* Main */
.main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.top-bar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--outline-faint);
  display: flex;
  align-items: center;
  padding: 0 16px 0 24px;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
.tb-title { font-size: 17px; font-weight: 700; color: var(--on-s); flex: 1; }
.tb-chips { display: flex; gap: 8px; }
.tb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}
.tb-chip--error { background: var(--error-tonal); color: var(--error-on); border: 1px solid #f5c6c5; }
.tb-chip--warn  { background: var(--warn-tonal);  color: var(--warn-on);   border: 1px solid #fde68a; }
.tb-chip--ok    { background: var(--success-tonal);color: var(--success-on);border: 1px solid #a8d5b5; }
.tb-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Board / Flow mode switcher */
.mode-pills-wrap { display: flex; margin: 0 14px; }
.mode-pills {
  display: flex; align-items: center; background: var(--bg);
  border: 1px solid var(--outline-faint); border-radius: 9px; padding: 3px; gap: 2px;
}
.m-pill {
  display: flex; align-items: center; gap: 6px; padding: 5px 16px;
  border-radius: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.m-pill svg { width: 14px; height: 14px; opacity: .7; }
.m-pill.active { background: var(--surface); color: var(--primary); box-shadow: var(--sh2); }
.m-pill.active svg { opacity: 1; }
.m-pill:not(.active):hover { color: var(--on-s2); }
.mp-ai-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 6px;
  background: var(--primary-tonal); color: var(--primary-dark);
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fbbc04;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-s2);
  cursor: pointer;
  flex-shrink: 0;
}
.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.view { display: none; }
.view.active { display: block; }
#view-container { max-width: 1260px; margin: 0 auto; }

/* ── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 22px;
  height: 38px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  font-family: inherit;
  text-decoration: none;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); box-shadow: var(--sh1); }
.btn--outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn--outline:hover { background: var(--primary-tonal); }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #166c34; }
.btn--danger { background: var(--error); color: #fff; }
.btn--danger:hover { background: var(--error-on); }
.btn--text { background: none; color: var(--muted); font-weight: 500; border: none; padding: 0; height: auto; }
.btn--text:hover { color: var(--primary); text-decoration: underline; }


/* ── CHANNEL AVAILABILITY TOGGLE (Settings > Channels) ─── */
.chan-avail-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--outline-faint);
}
.chan-avail-row:last-child { border-bottom: none; }

.chan-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.chan-toggle input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.chan-toggle-track {
  position: absolute; inset: 0; background: var(--outline-faint); border-radius: 999px; transition: background .15s;
}
.chan-toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh1); transition: transform .15s;
}
.chan-toggle input:checked + .chan-toggle-track { background: var(--success); }
.chan-toggle input:checked + .chan-toggle-track .chan-toggle-thumb { transform: translateX(18px); }
.chan-toggle input:disabled + .chan-toggle-track { opacity: .5; cursor: not-allowed; }
.chan-toggle input:disabled { cursor: not-allowed; }

/* Settings' toggle badge on a shared .welcome-ch-card (see
   BN.channelCardHtml in frontend/js/views/welcome.js) — sits where the
   plain checkmark badge goes on Welcome's own (non-toggle) cards. */
.welcome-ch-toggle { position: absolute; top: 10px; right: 10px; }


/* ── CONFIRMATION MODAL ──────────────────────────── */
.bn-modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 16, 25, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.bn-modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--sh3);
  width: 100%; max-width: 420px; padding: 24px;
}
.bn-modal-title { font-size: 16px; font-weight: 700; color: var(--on-s); margin-bottom: 10px; }
.bn-modal-body { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 20px; }
.bn-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Channel "Connect" modal (Welcome screen + reused wherever a channel needs
   connecting) — three equal integration-method options, not a form. */
.connect-modal { max-width: 440px; }
.connect-modal-hdr { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.connect-modal-logo { font-size: 26px; flex-shrink: 0; line-height: 1; }
.connect-opt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.connect-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg); border: 1.5px solid var(--outline-faint); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; transition: all .15s; font: inherit; color: inherit;
}
.connect-opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-tonal); }
.connect-opt:disabled { opacity: .6; cursor: default; }
.connect-opt--done { border-color: var(--success); background: var(--success-tonal); }
.connect-opt-icon { font-size: 20px; flex-shrink: 0; }
.connect-opt-text { flex: 1; min-width: 0; }
.connect-opt-title { display: block; font-size: 13px; font-weight: 700; color: var(--ink); }
.connect-opt-soon-tag {
  display: inline-block; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: var(--warn-tonal); color: var(--warn-on); padding: 1px 6px; border-radius: 99px; margin-left: 6px;
  vertical-align: middle;
}
.connect-opt-desc { display: block; font-size: 11px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.connect-opt--done .connect-opt-desc { color: var(--success-on); font-weight: 600; }
.connect-opt-arrow { font-size: 14px; color: var(--faint); flex-shrink: 0; }
.connect-opt--done .connect-opt-arrow { color: var(--success); font-weight: 800; }

/* Marketplace card "enabled method" pills (Welcome + Settings) — a channel
   can have more than one method on at once, so this is a row of small
   badges, not a single connected/not-connected state. */
.welcome-ch-pills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 2px; }
.welcome-ch-pill {
  font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 99px;
  background: var(--success-tonal); color: var(--success-on);
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}

/* "Work in progress" redirect page — where Connect via API / Browser
   Extension land instead of the old inline-close behavior, since neither
   is a real integration yet (frontend/js/views/welcome.js's BN.views.connect). */
.connect-wip { max-width: 480px; margin: 56px auto; text-align: center; }
.connect-wip-icon { font-size: 42px; margin-bottom: 10px; }
.connect-wip-badge {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  background: var(--warn-tonal); color: var(--warn-on); padding: 3px 11px; border-radius: 99px; margin-bottom: 14px;
}
.connect-wip-title { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 10px; }
.connect-wip-body { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.connect-wip-status { font-size: 12px; font-weight: 600; padding: 9px 14px; border-radius: 8px; margin-bottom: 22px; }
.connect-wip-status--ok { background: var(--success-tonal); color: var(--success-on); }
.connect-wip-status--err { background: var(--error-tonal); color: var(--error-on); }
.connect-wip-status--pending { background: var(--warn-tonal); color: var(--warn-on); }

/* Small shared bottom-right toast (BN.showToast) */
.bn-toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 600; z-index: 3000;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: all .2s;
  box-shadow: var(--sh3); max-width: 320px;
}
.bn-toast.show { opacity: 1; transform: translateY(0); }


/* ── CARDS ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh1);
  overflow: hidden;
}
.card--shadow2 { box-shadow: var(--sh2); }
.card--round-lg { border-radius: var(--rl); }
.card--round-xl { border-radius: var(--rxl); }
.card-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--outline-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-hdr h2, .card-hdr h3 { font-size: 14px; font-weight: 700; }
.card-body { padding: 16px 18px; }

/* ── TEXT UTILITIES ─────────────────────────────── */
.text-link { font-size: 13px; color: var(--primary); font-weight: 500; cursor: pointer; }
.text-link:hover { text-decoration: underline; }
.text-muted { color: var(--muted); }
.text-error { color: var(--error); }
.text-warn { color: var(--warn); }
.text-success { color: var(--success); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-uppercase { text-transform: uppercase; letter-spacing: .5px; }
.font-bold { font-weight: 700; }
.font-mono { font-variant-numeric: tabular-nums; }

/* ── CHIPS / BADGES ─────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--outline);
}
.chip--meesho { background: #fce4ec; color: #880e4f; border-color: #f48fb1; }
.chip--amazon { background: #fff8e1; color: #7b4f00; border-color: #ffe082; }
.chip--flipkart { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; }

.cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.cost-chip-lbl { font-weight: 500; opacity: .8; }
.cost-chip--supplier { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }
.cost-chip--packaging { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.cost-chip--duties { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.signal::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.signal--POSITIVE { background: var(--success-tonal); color: var(--success-on); }
.signal--AT_RISK  { background: var(--warn-tonal);   color: var(--warn-on); }
.signal--NEGATIVE { background: var(--error-tonal);  color: var(--error-on); }

.auto-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--success);
  background: rgba(5,150,105,.12);
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
}
.manual-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #8c5e00;
  background: #fef3c7;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
}

/* ── INPUTS ──────────────────────────────────────── */
.input {
  border: 1px solid var(--outline);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--on-s);
  background: var(--surface);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.18); }
.input--sm { width: 72px; text-align: right; }
.input--num { -moz-appearance: textfield; }
.input--num::-webkit-outer-spin-button,
.input--num::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── TABLES ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; position: relative; }
.table-wrap--sticky {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  border-bottom: 1px solid var(--outline-faint);
}

/* Signals there's more to scroll to horizontally — an edge fade that only
   appears on the side that actually has hidden content (toggled by JS via
   has-scroll-left/-right, since CSS alone can't tell "scrolled to the end"
   apart from "nothing to scroll" without the scroll-attachment hack, which
   fights the sticky thead's own background). */
.table-wrap::before, .table-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 3;
}
.table-wrap::before { left: 0; background: linear-gradient(to right, var(--surface), transparent); }
.table-wrap::after { right: 0; background: linear-gradient(to left, var(--surface), transparent); }
.table-wrap.has-scroll-left::before { opacity: 1; }
.table-wrap.has-scroll-right::after { opacity: 1; }

.table-scroll-hint {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border: none;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
  box-shadow: var(--sh2);
}
.table-scroll-hint svg { width: 12px; height: 12px; animation: scroll-hint-nudge 1.3s ease-in-out infinite; }
.table-wrap.has-scroll-right .table-scroll-hint { opacity: 1; pointer-events: auto; }
.table-scroll-hint:hover { transform: translateX(2px); }

@keyframes scroll-hint-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .table-scroll-hint svg { animation: none; } }
.table-wrap--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--outline-faint);
}
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--outline-faint);
  background: var(--bg);
}
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--primary); }
th.sortable.sorted { color: var(--primary); font-weight: 700; }
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--outline-faint);
  font-size: 13px;
}
tr:last-child td { border-bottom: none; }
tr.clickable td { cursor: pointer; }
tr.clickable:hover td { background: var(--primary-tonal); }

/* ── TABS ────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--outline-faint);
  background: var(--surface);
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  box-shadow: var(--sh1);
}
.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tab:hover { color: var(--on-s); background: var(--bg); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab--ok.active { color: var(--success); border-bottom-color: var(--success); }
.tab-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  background: var(--error-tonal); color: var(--error-on);
  margin-left: 6px;
}
.tab-badge--warn { background: var(--warn-tonal); color: var(--warn-on); }
.tab-badge--ok   { background: var(--success-tonal); color: var(--success-on); }

/* ── INFO CARD ───────────────────────────────────── */
.info-card {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
}
.info-card--tip { background: var(--primary-tonal); color: var(--primary-dark); }
.info-card--warn { background: var(--warn-tonal); border: 1px solid #fde68a; color: var(--warn-on); }
.info-card--error { background: var(--error-tonal); border: 1px solid #f5c6c5; color: var(--error-on); }
.info-card-icon { flex-shrink: 0; font-size: 14px; line-height: 1.3; }

/* ── INSIGHT BANNER ──────────────────────────────── */
.insight-banner {
  background: var(--warn-tonal);
  border: 1px solid #fde68a;
  border-radius: var(--r);
  padding: 12px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--warn-on);
  line-height: 1.5;
}

/* ── SECTION HEADERS ────────────────────────────── */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-hdr h3 { font-size: 14px; font-weight: 700; color: var(--on-s); }


/* ════════════════════════════════════════════════════
   WIZARD
═════════════════════════════════════════════════════ */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.wizard-shell {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--sh3);
  width: 100%;
  max-width: 760px;
  overflow: hidden;
}
.wizard-top {
  background: linear-gradient(135deg, #3b1d8f 0%, #7c3aed 55%, #0891b2 130%);
  padding: 28px 36px 24px;
}
.wiz-brand { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; }
.wizard-top h1 { font-size: 22px; font-weight: 700; color: #fff; line-height: 1.3; }
.wizard-top p { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }

.wiz-steps {
  display: flex;
  align-items: center;
  padding: 0 36px;
  background: #f8fbff;
  border-bottom: 1px solid var(--outline-faint);
}
.wiz-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  flex: 1;
}
.wiz-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--outline);
  margin: 0 8px;
}
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.step-label { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.wiz-step.done .step-num { background: var(--success); color: #fff; }
.wiz-step.done .step-label { color: var(--success); }
.wiz-step.active .step-num { background: var(--primary); color: #fff; }
.wiz-step.active .step-label { color: var(--primary); font-weight: 600; }
.wiz-step .step-num { background: var(--outline-faint); color: var(--muted); }

.wiz-body { padding: 28px 36px 24px; min-height: 340px; }
.wiz-step-content { display: none; }
.wiz-step-content.active { display: block; }
.wiz-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.wiz-action { font-size: 12px; color: var(--primary); margin-bottom: 8px; }

/* Channel picker */
.channel-pick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 18px; }
.channel-tile {
  border: 2px solid var(--outline);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  user-select: none;
}
.channel-tile:hover { border-color: var(--primary); background: var(--primary-tonal); }
.channel-tile.selected { border-color: var(--primary); background: var(--primary-tonal); }
.ct-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  color: #fff;
  margin: 0 auto 8px;
}
.ct-name { font-size: 13px; font-weight: 600; color: var(--on-s); }
.ct-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ct-logo.meesho { background: #e91e8c; }
.ct-logo.amazon { background: #ff9900; color: #000; }
.ct-logo.flipkart { background: #2874f0; }
.check-mark {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  display: none;
  align-items: center; justify-content: center;
  margin: 6px auto 0;
}
.channel-tile.selected .check-mark { display: flex; }

/* SKU input table */
.wiz-table-wrap { overflow-x: auto; max-height: 240px; overflow-y: auto; }
.sku-input-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.sku-input-table th {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-align: left; padding: 8px 10px;
  border-bottom: 2px solid var(--outline);
  background: var(--bg);
}
.sku-input-table td { padding: 6px 10px; border-bottom: 1px solid var(--outline-faint); vertical-align: middle; }
.sku-input-table tr:hover td { background: #f8fbff; }
.sku-name { font-weight: 500; color: var(--on-s); }
.sku-id { font-size: 11px; color: var(--muted); }
.computed { font-size: 12px; color: var(--muted); font-style: italic; }
.add-sku-row {
  text-align: center; padding: 10px;
  color: var(--primary); font-size: 13px; font-weight: 500;
  cursor: pointer; border-top: 1px dashed var(--outline);
}
.add-sku-row:hover { background: var(--primary-tonal); }

/* Return rate sliders */
.wiz-rates { margin-bottom: 20px; }
.cr-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--outline-faint);
}
.cr-row:last-child { border-bottom: none; }
.cr-logo {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.cr-logo.meesho { background: #e91e8c; }
.cr-logo.amazon { background: #ff9900; color: #000; }
.cr-logo.flipkart { background: #2874f0; }
.cr-name { width: 80px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.cr-slider-wrap { flex: 1; }
.cr-slider {
  width: 100%;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--outline); outline: none; cursor: pointer;
}
.cr-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--sh1);
}
.cr-val { width: 48px; text-align: right; font-size: 14px; font-weight: 700; color: var(--error); flex-shrink: 0; }

/* Ad spend section in wizard */
.wiz-ad { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--outline-faint); }
.wiz-ad h4 { font-size: 13px; font-weight: 700; color: var(--on-s); margin-bottom: 4px; }
.optional { font-weight: 400; color: var(--muted); }
.wiz-ad-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.ad-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--outline-faint); }
.ad-row:last-child { border-bottom: none; }
.ad-name { flex: 1; font-size: 13px; font-weight: 500; }
.ad-input { width: 120px; }
.wiz-ad-note { color: var(--muted); font-size: 12px; text-align: center; padding-top: 8px; }

/* P&L preview in wizard */
.pl-hero {
  background: linear-gradient(135deg, #3b1d8f, #7c3aed 55%, #0891b2);
  border-radius: var(--r);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.ph-label { font-size: 12px; color: rgba(255,255,255,.7); font-weight: 500; margin-bottom: 6px; }
.ph-val { font-size: 40px; font-weight: 800; color: #fff; letter-spacing: -2px; }
.ph-sub { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 4px; }
.verdict {
  display: inline-flex;
  align-items: center; gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  margin-top: 8px;
}
.verdict--warn { background: rgba(227,116,0,.2); color: #fde68a; }
.verdict--ok   { background: rgba(30,142,62,.2); color: #a8f0c0; }

.pl-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.pl-card {
  background: var(--bg);
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--outline-faint);
}
.pl-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.pl-val { font-size: 24px; font-weight: 700; letter-spacing: -1px; }
.pl-val.pos { color: var(--success); }
.pl-val.warn { color: var(--warn); }
.pl-val.neg { color: var(--error); }
.pl-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Wizard footer */
.wiz-footer {
  padding: 16px 36px;
  border-top: 1px solid var(--outline-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.wiz-actions { display: flex; gap: 10px; }


/* ════════════════════════════════════════════════════
   OVERVIEW — Income Statement
═════════════════════════════════════════════════════ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-row--five { grid-template-columns: repeat(5, 1fr); }
.kpi-row.kpi-row--six { grid-template-columns: repeat(6, 1fr); }
.kpi-row.kpi-row--3 { grid-template-columns: repeat(3, 1fr); }

.coverage-banner {
  background: var(--warn-tonal, #fff4d6);
  border: 1px solid var(--warn, #e6b800);
  color: var(--warn-on, #7a5b00);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.5;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}
.empty-state-ico { font-size: 34px; opacity: .7; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--on-s2); }
.empty-state-sub { font-size: 12px; }

/* ── Data nudge (empty-state upsell, see frontend/js/nudge.js) ── */
.data-nudge {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 56px 32px; max-width: 560px; margin: 0 auto;
}
.data-nudge-icon { font-size: 30px; }
.data-nudge-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.data-nudge-body { font-size: 13px; color: var(--muted); line-height: 1.6; }
.data-nudge-insights-hdr {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--faint); margin-top: 10px;
}
.data-nudge-insights { display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; max-width: 400px; }
.data-nudge-insight {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--on-s2);
  background: var(--bg); border-radius: 8px; padding: 8px 12px;
}
.data-nudge-insight-ico { font-size: 15px; flex-shrink: 0; }
.data-nudge-files-hdr {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--faint); margin-top: 6px;
}
.data-nudge-files { display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; max-width: 420px; }
.data-nudge-file {
  background: var(--bg); border-radius: 8px; padding: 9px 12px;
}
.data-nudge-file-label { font-size: 13px; font-weight: 700; color: var(--on-s); }
.data-nudge-file-why { font-size: 12px; color: var(--on-s2); line-height: 1.5; margin-top: 2px; }
.data-nudge-file-more { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0; }
.data-nudge-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.data-nudge-skip { font-size: 12px; color: var(--faint); cursor: pointer; margin-top: 2px; }
.data-nudge-skip:hover { color: var(--on-s2); text-decoration: underline; }

/* #mock-ribbon-slot sits outside #scroll-area (see index.html), as a direct
   flex sibling of .top-bar below it — so whatever it renders stays "frozen"
   at the header level regardless of how far the page content is scrolled,
   and stays visible across both Board and Flow modes. */
.mock-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--warn-tonal, #fffbeb); border-bottom: 1px solid var(--warn, #d97706);
  color: var(--warn-on, #92400e); font-size: 12.5px; font-weight: 600;
  padding: 8px 20px; text-align: center; flex-shrink: 0;
}
.mock-ribbon-exit { text-decoration: underline; cursor: pointer; font-weight: 700; white-space: nowrap; }
/* Automatic partial-mock variant (BN.setPageMockState) — same visual
   language as the manual preview ribbon above, minus the exit control, since
   it reflects a real data gap rather than a chosen preview. */
.mock-ribbon--partial { justify-content: center; }
/* First-time automatic landing variant (BN._firstTimeMock) — deliberately
   violet rather than amber: amber reads as "a data gap," this is a genuine
   first-run invitation to explore, not a warning. */
.mock-ribbon--firsttime {
  background: var(--primary-tonal); border-bottom: 1px solid var(--primary);
  color: var(--primary-dark);
}

/* Generic real-vs-mock per-CARD info icon + click popover (docs/
   data-completeness-lld.md) — quiet by design (an inline icon, not a
   banner) so the automatic per-card fallback never reads as the same
   thing as the seller's own page-wide "see a sample dashboard" toggle. */
.kpi-mock-icon {
  cursor: pointer; color: var(--warn); font-size: 12px; margin-left: 4px;
  vertical-align: middle; display: inline-block;
}
.kpi-mock-icon:hover { color: var(--warn-on); }
.kpi-mock-popover {
  position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--outline);
  box-shadow: var(--sh2); border-radius: 8px; padding: 10px 12px; font-size: 12px;
  max-width: 300px; color: var(--on-s2); line-height: 1.5;
}
.kpi-mock-list { margin: 6px 0 4px; padding-left: 16px; }
.kpi-mock-list li { margin: 2px 0; }
.kpi-mock-sub { margin-top: 6px; }
.kpi-mock-note { margin-top: 6px; font-size: 11px; color: var(--muted); }
.kpi-mock-popover strong {
  display: block; color: var(--warn-on); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--sh1);
  border-top: 3px solid var(--outline);
}
.kpi-card--primary { border-top-color: var(--primary); }
.kpi-card--err     { border-top-color: var(--error); }
.kpi-card--warn    { border-top-color: var(--warn); }
.kpi-card--ok      { border-top-color: var(--success); }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.kpi-val { font-size: 22px; font-weight: 800; color: var(--on-s); letter-spacing: -.5px; }
.kpi-sub { font-size: 12px; margin-top: 4px; }
.kpi-sub--up { color: var(--success); font-weight: 600; }
.kpi-sub--down { color: var(--error); font-weight: 600; }

/* Waterfall chart card */
.chart-card {
  background: var(--surface);
  border-radius: var(--rl);
  box-shadow: var(--sh2);
  overflow: hidden;
  margin-bottom: 20px;
}
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.chart-card--wide { grid-column: 1 / -1; }
.chart-card-hdr {
  padding: 13px 24px;
  border-bottom: 1px solid var(--outline-faint);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.chart-card-hdr h3 { font-size: 13px; font-weight: 700; color: var(--on-s); }
.chart-card-hdr span { font-size: 12px; color: var(--muted); }
.chart-wrap { padding: 16px 28px 20px; height: 210px; }

/* Cost-mix donut + mini summary */
.mix-body { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.mix-body .chart-wrap { height: 210px; padding: 16px 8px 8px 20px; }
.mix-stats {
  padding: 18px 8px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.mix-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px dashed var(--outline);
  padding-bottom: 8px;
}
.mix-stat strong { color: var(--on-s); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mix-hint { font-size: 11px; color: var(--faint); line-height: 1.5; }

/* Income Statement */
.is-card {
  background: var(--surface);
  border-radius: var(--rl);
  box-shadow: var(--sh2);
  overflow: hidden;
  margin-bottom: 20px;
}
.is-card--scroll {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.is-card--scroll .is-card-hdr { flex-shrink: 0; }
.is-card-body { overflow-y: auto; }
.is-card-hdr {
  padding: 18px 28px;
  border-bottom: 1px solid var(--outline-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.is-card-hdr h2 { font-size: 15px; font-weight: 700; color: var(--on-s); }

.is-section-hdr {
  padding: 7px 28px;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: #f1f3f4;
  border-bottom: 1px solid var(--outline-faint);
}
.is-subsection-hdr {
  padding: 6px 28px 6px 36px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 1px solid var(--outline-faint);
  display: flex;
  align-items: center;
  gap: 7px;
}
.is-subsection-hdr::before {
  content: '';
  width: 3px; height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.is-subsection-hdr--platform { color: var(--primary); }
.is-subsection-hdr--platform::before { background: var(--primary); }
.is-subsection-hdr--self { color: var(--on-s2); }
.is-subsection-hdr--self::before { background: var(--muted); }

.is-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px 110px 110px 60px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--outline-faint);
  align-items: center;
  transition: background .1s;
}
.is-row:hover { background: #fafbff; }
.is-row--highlighted { border-left: 3px solid var(--warn); padding-left: 25px; background: #fffdf0; }
.is-row--highlighted:hover { background: #fff8e1; }
.is-row--total {
  background: var(--bg);
  border-top: 1px solid var(--outline);
  border-bottom: 2px solid var(--outline);
  font-weight: 700;
}
.is-row--total:hover { background: #eef2fb; }

.ir-label {
  font-size: 13px;
  color: var(--on-s2);
  padding-left: 20px;
}
.ir-label--no-indent { padding-left: 0; font-weight: 700; color: var(--on-s); font-size: 14px; }
.ir-amount {
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}
.ir-amount--cost { color: var(--on-s2); }
.ir-amount--prev { color: var(--muted); font-weight: 400; }
.ir-amount--pos { color: var(--success); font-size: 15px; font-weight: 800; }
.ir-amount--warn { color: var(--warn); font-size: 15px; font-weight: 800; }
.ir-pct {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ir-pct--bold { font-weight: 700; color: var(--on-s2); }
.ir-change {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ir-change--up { color: var(--success); font-weight: 600; }
.ir-change--down { color: var(--error); font-weight: 600; }
.ir-change--flat { color: var(--muted); font-weight: 400; }
.ir-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ir-expand .ir-chevron { margin-left: 0; }

.ir-chg-col { text-align: right; font-variant-numeric: tabular-nums; }

/* Expandable rows */
.is-row--expandable { cursor: pointer; }
.is-row--expandable:hover { background: #f0f4ff; }
.is-row--expandable.open { background: #f0f4ff; }
.is-sub-row.is-row--expandable:hover { background: #f0f4ff; }
.is-sub-row.is-row--expandable.open { background: #f0f4ff; }
.ir-chevron {
  font-size: 13px;
  color: var(--muted);
  display: inline-block;
  transition: transform .2s;
}
.ir-chevron.open { transform: rotate(90deg); }
.is-sub-rows { display: none; background: #fafbff; }
.is-sub-rows.open { display: block; }

.is-sub-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px 110px 110px 60px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--outline-faint);
  align-items: center;
}
.is-sub-row:last-child { border-bottom: 1px solid var(--outline-faint); }
.is-sub-row--nested { padding-left: 48px; }
.sr-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 32px;
  font-size: 12px;
  color: var(--muted);
}
.sr-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sr-dot--meesho { background: #e91e8c; }
.sr-dot--amazon { background: #ff9900; }
.sr-dot--flipkart { background: #2874f0; }
.sr-dot--neutral { background: var(--muted); }
.sr-amount { text-align: right; font-size: 12px; font-weight: 500; color: var(--on-s2); font-variant-numeric: tabular-nums; }
.sr-pct { text-align: right; font-size: 11px; color: var(--muted); }

/* ── What Changed strip ─────────────────────────── */
.wc-card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh1);
  overflow: hidden;
  margin-bottom: 20px;
}
.wc-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--outline-faint);
  font-size: 14px;
  font-weight: 700;
}
.wc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--outline-faint);
}
.wc-item:last-child { border-bottom: none; }
.wc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wc-dot--bad  { background: var(--error); }
.wc-dot--warn { background: var(--warn); }
.wc-dot--good { background: var(--success); }
.wc-text { flex: 1; font-size: 13px; }
.wc-delta { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.wc-delta--bad  { background: var(--error-tonal); color: var(--error-on); }
.wc-delta--warn { background: var(--warn-tonal); color: var(--warn-on); }
.wc-delta--good { background: var(--success-tonal); color: var(--success-on); }


/* ════════════════════════════════════════════════════
   MARKETPLACES
═════════════════════════════════════════════════════ */
.mp-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.mp-pcard {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh1);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.mp-pcard:hover { box-shadow: var(--sh2); transform: translateY(-1px); }
.mp-pcard.active { box-shadow: var(--sh2); outline: 2px solid var(--primary); }

.mp-pcard-top {
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid transparent;
}
.mp-pcard-top--meesho  { border-bottom-color: #e91e8c; }
.mp-pcard-top--amazon  { border-bottom-color: #ff9900; }
.mp-pcard-top--flipkart { border-bottom-color: #2874f0; }

.mp-pcard-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.mp-status {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.mp-status--LOSING  { background: var(--error-tonal); color: var(--error-on); }
.mp-status--AT_RISK { background: var(--warn-tonal); color: var(--warn-on); }
.mp-status--HEALTHY { background: var(--success-tonal); color: var(--success-on); }

.mp-pcard-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.mp-pcard-row { display: flex; justify-content: space-between; font-size: 12px; }
.mp-pcard-key { color: var(--muted); }
.mp-pcard-val { font-weight: 600; }
.mp-pcard-val--neg { color: var(--error); }
.mp-pcard-val--warn { color: var(--warn); }

.mp-pcard-footer {
  padding: 10px 16px;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mp-pcard-cm { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.mp-pcard-cm--ok   { color: var(--success); }
.mp-pcard-cm--warn { color: var(--warn); }
.mp-pcard-cm--neg  { color: var(--error); }
.mp-pcard-cm-label { font-size: 11px; color: var(--muted); }

/* Comparison table */
.mp-compare { overflow-x: auto; }
.mp-compare-table { width: 100%; min-width: 600px; border-collapse: collapse; }
/* Specificity-boosted (.panel .mp-compare-table, not just .mp-compare-table)
   so these actually win over the later, equal-specificity .panel th/.panel
   td rules — same collision already fixed once for .ch-sc-table (see that
   rule's own comment); this table sat silently overridden to the generic
   .panel row size (13px/13px) instead of its own intended compact size. */
.panel .mp-compare-table th {
  padding: 9px 16px;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: right;
  background: var(--bg);
  border-bottom: 1px solid var(--outline-faint);
}
.mp-compare-table th:first-child { text-align: left; }
.panel .mp-compare-table td {
  padding: 9px 16px;
  font-size: 12.5px;
  text-align: right;
  border-bottom: 1px solid var(--outline-faint);
  font-variant-numeric: tabular-nums;
}
/* Channel-name weight/color matched to Overview's .ch-sc-name (600 weight,
   default ink) — was font-weight:500 + the muted --on-s2 tone, reading
   noticeably lighter/thinner than the same channel name on Overview. */
.mp-compare-table td:first-child { text-align: left; font-weight: 600; color: var(--ink); }
.mp-compare-table tr:hover td { background: #fafbff; }
.mp-compare-table .section-row td {
  background: #f1f3f4;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 20px;
}
.mp-compare-table .total-row td {
  font-weight: 700;
  font-size: 14px;
  background: var(--bg);
  border-top: 1px solid var(--outline);
}
.mp-tab-bar {
  display: flex;
  background: var(--surface);
  border-radius: var(--r) var(--r) 0 0;
  box-shadow: var(--sh1);
  overflow: hidden;
}
.mp-tab {
  flex: 1;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-align: center;
  transition: all .15s;
}
.mp-tab:hover { background: var(--bg); color: var(--on-s); }
.mp-tab.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); background: #f8fbff; }
.mp-tab-content { display: none; }
.mp-tab-content.active { display: block; }

/* Compare-table row interactions (Marketplaces) */
.mp-compare-table tr[data-mp-row] { cursor: pointer; }
.mp-compare-table tr[data-mp-row]:hover td { background: #f5f1ff; }
.mp-compare-table tr.active-row td, .mp-compare-table tr.active-row:hover td { background: #f0e9ff; }
.mp-compare-table tr.total-row td { border-top: 1px solid var(--outline); }
.mp-compare-table .mp-chandot { width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; display: inline-block; vertical-align: 0; }

/* Sortable column headers (Marketplaces channel comparison table) */
.mp-compare-table th[data-mp-sort] { cursor: pointer; user-select: none; }
.mp-compare-table th[data-mp-sort]:hover, .mp-compare-table th.sort-on { color: var(--primary); }
.mp-compare-table .si { font-size: 10px; opacity: .6; margin-left: 3px; }
.mp-compare-table th.sort-on .si { opacity: 1; }
.mp-cm-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }

/* Channel archetype tag next to the name, matching the mock's .mp-status
   chip — colour/label derived from this channel's own real CM%/return
   rate (mpStatusTag in channels.js), not the mock's hand-written per-
   channel insight copy (that's bespoke narrative text, not a real metric). */
.mp-status { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }

/* Channel comparison row expand (waterfall + insights, half/half) — same
   grid-template-columns:1fr 1fr split as the mock's own expand row. */
.mp-exp-arrow { display: inline-block; width: 11px; color: var(--faint); font-size: 11px; flex-shrink: 0; }
.mp-compare-table tr.mp-row-open td { background: var(--bg); }
.mp-exp-row td { border-top: none; padding: 0; }
.mp-exp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  padding: 14px 18px; background: var(--bg);
  border-top: 1px solid var(--outline-faint); border-bottom: 2px solid var(--primary-tonal);
}
.mp-exp-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 9px; }
.mp-exp-col .diag { background: var(--surface); border: 1px solid var(--outline-faint); border-radius: 7px; padding: 8px 10px; margin-bottom: 6px; }
@media (max-width: 760px) { .mp-exp-grid { grid-template-columns: 1fr; } }

/* Dummy Insight + Priority actions block (mpInsightHtml in channels.js) —
   same italic-quote-box + numbered-pill-row structure as the reference
   mock's own ARCH-driven panel. */
.mp-insight-box {
  font-size: 11px; color: var(--primary-dark); line-height: 1.55; margin-bottom: 12px;
  padding: 9px 11px; background: var(--primary-tonal); border-radius: 8px; font-style: italic;
}
.mp-act-row {
  display: flex; align-items: flex-start; gap: 7px; margin-bottom: 5px;
  padding: 6px 9px; background: var(--surface); border: 1px solid var(--outline-faint); border-radius: 7px;
}
.mp-act-num {
  width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 8px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.mp-act-text { font-size: 11px; color: var(--on-s2); line-height: 1.45; }
/* A known channel with zero uploaded files yet — see comparisonPanel's own
   comment in channels.js for why this row shape exists. */
.mp-compare-table tr.mp-row--connect td { opacity: .7; }
.mp-compare-table tr.mp-row--connect:hover td { background: transparent; }

/* ── Opportunity matrix (Marketplaces) ── */
.mx-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; }
.mx-divider-line { flex: 1; height: 1px; background: var(--outline); }
.mx-divider-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); white-space: nowrap; }
.mx-wrap { display: flex; gap: 16px; align-items: flex-start; }
.mx-controls {
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r);
  box-shadow: var(--sh1); min-width: 150px; flex-shrink: 0;
}
.mx-controls-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 6px; }
.mx-controls select { width: 100%; font-size: 12px; font-weight: 600; padding: 6px 8px; border: 1px solid var(--outline); border-radius: 6px; background: var(--bg); color: var(--on-s2); }
.mx-controls-note { font-size: 10px; color: var(--faint); line-height: 1.4; padding-top: 4px; border-top: 1px solid var(--outline); }
.mx-svg-wrap { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r); padding: 16px; box-shadow: var(--sh1); flex: 1; min-width: 0; }
.mx-svg { width: 100%; height: auto; }
.mx-legend { display: flex; flex-direction: column; gap: 7px; }
.mx-leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.mx-leg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
#mx-tooltip {
  position: fixed; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px;
  padding: 8px 11px; font-size: 12px; line-height: 1.55; z-index: 9999; display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.22); max-width: 200px;
}
@media (max-width: 760px) { .mx-wrap { flex-direction: column; } .mx-controls { width: 100%; } }

/* Channel-level income statement detail head */
.mp-detail-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 17px; font-weight: 800; color: var(--ink);
  margin: 6px 0 14px;
}
.mp-detail-head .mp-chandot { width: 13px; height: 13px; border-radius: 4px; margin-right: 0; }
.mp-detail-head small { color: var(--faint); font-size: 12.5px; font-weight: 600; }


/* ════════════════════════════════════════════════════
   ALERTS & OPPORTUNITIES
═════════════════════════════════════════════════════ */
.ao-group { margin-bottom: 20px; }
.ao-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  margin-bottom: 8px;
}
.ao-group-label-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}
.ao-group-label-text--cash     { color: var(--error); }
.ao-group-label-text--margin   { color: var(--warn); }
.ao-group-label-text--capital  { color: #795548; }
.ao-group-label-text--scale    { color: var(--success); }
.ao-group-label-text--structure { color: var(--primary); }
.ao-group-line { flex: 1; height: 1px; background: var(--outline-faint); }
.ao-group-rows { display: flex; flex-direction: column; gap: 6px; }

.ao-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--r);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: box-shadow .15s, background .1s;
  box-shadow: var(--sh1);
}
.ao-card:hover { box-shadow: var(--sh2); background: #fafbff; }
.ao-card--critical { border-left-color: var(--error); }
.ao-card--warning  { border-left-color: var(--warn); }
.ao-card--opp      { border-left-color: var(--success); }

.ao-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.ao-body { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 0; align-items: start; }
.ao-title { grid-column: 1; font-size: 13px; font-weight: 700; color: var(--on-s); margin-bottom: 3px; line-height: 1.35; }
.ao-desc { grid-column: 1; font-size: 12px; color: var(--muted); line-height: 1.45; }
.ao-directive { font-weight: 700; }
.ao-directive--crit { color: var(--error); }
.ao-directive--warn { color: #b54708; }
.ao-directive--ok   { color: #1a7f3c; }
.ao-metric {
  grid-column: 2;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.4px;
  white-space: nowrap;
  text-align: right;
  align-self: center;
}
.ao-metric--neg  { color: var(--error); }
.ao-metric--warn { color: var(--warn); }
.ao-metric--ok   { color: var(--success); }
.ao-chips { grid-column: 1 / -1; display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.ao-chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px; font-weight: 500;
  border: 1px solid var(--outline-faint);
  color: var(--muted);
}
.ao-cta {
  grid-column: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
  justify-self: end;
}
.ao-cta--crit { background: var(--error-tonal); color: var(--error-on); }
.ao-cta--warn { background: var(--warn-tonal); color: var(--warn-on); }
.ao-cta--ok   { background: var(--success-tonal); color: var(--success-on); }


/* ════════════════════════════════════════════════════
   SKUs
═════════════════════════════════════════════════════ */

.insight-card {
  background: var(--primary-tonal);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 14px;
  border-left: 4px solid var(--primary);
}
.insight-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.insight-card ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.insight-card ul li { font-size: 12px; color: var(--primary-dark); display: flex; gap: 6px; }
.insight-card ul li::before { content: '\2192'; font-weight: 700; flex-shrink: 0; }

/* Platform context strip */
.platform-ctx {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--outline-faint);
}
.pctx-cell {
  padding: 14px 20px;
  border-right: 1px solid var(--outline-faint);
}
.pctx-cell:last-child { border-right: none; }
.pctx-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 5px; }
.pctx-val { font-size: 18px; font-weight: 800; color: var(--on-s); letter-spacing: -.3px; }
.pctx-val--warn { color: var(--warn); }
.pctx-val--ok   { color: var(--success); }
.pctx-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }


/* ════════════════════════════════════════════════════
   MY COSTS
═════════════════════════════════════════════════════ */
.costs-explainer {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh1);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-left: 4px solid var(--primary);
}
.costs-explainer-icon { font-size: 20px; flex-shrink: 0; }
.costs-explainer h3 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.costs-explainer p { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 0; }

.cogs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--outline-faint);
}
.cogs-toolbar .tabs { margin-bottom: 0; box-shadow: none; border-radius: var(--r); border: 1px solid var(--outline-faint); }
.cogs-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* Default Supplier %/Packaging % — two separate fields (not merged into one
   control), reusing .cost-input verbatim so they match every other cost
   field on this page in style and size. */
.default-pct-field { display: flex; align-items: center; gap: 6px; }
.default-pct-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.default-pct-field .cost-input { width: 52px; text-align: right; }
.default-pct-suffix { font-size: 12px; color: var(--muted); }
.cogs-summary {
  padding: 8px 28px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--outline-faint);
  background: var(--surface-2);
}

.pending-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  background: var(--warn-tonal);
  color: var(--warn-on);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.pending-toggle:hover { filter: brightness(0.97); }
.pending-toggle.active { background: var(--warn); color: #fff; }

.cog-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.cog-table th {
  padding: 10px 14px;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: right;
  background: var(--bg);
  border-bottom: 1px solid var(--outline-faint);
  white-space: nowrap;
}
.cog-table th:first-child { text-align: left; min-width: 170px; }
.cog-table th.total-col { color: var(--primary); }
.cog-table td {
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--outline-faint);
  vertical-align: middle;
  text-align: right;
}
.cog-table td:first-child { text-align: left; }
.cog-table .total-row td {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  border-top: 2px solid var(--outline);
  background: var(--bg);
  text-align: right;
}
.cog-table .total-row td:first-child { text-align: left; color: var(--muted); }

.cost-input {
  width: 76px;
  padding: 5px 8px;
  border: 1px solid var(--outline-faint);
  border-radius: 6px;
  font-size: 12px;
  text-align: right;
  font-family: inherit;
  color: var(--on-s);
  background: var(--surface);
  transition: border .15s;
  -moz-appearance: textfield;
}
.cost-input::-webkit-outer-spin-button,
.cost-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cost-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.12); }
.cost-total { font-weight: 700; color: var(--primary); }

.fc-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--outline-faint);
  align-items: center;
}
.fc-label { font-size: 13px; color: var(--on-s2); }
.fc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.upload-template-link {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 0; margin-top: 4px;
  font-size: 11px; font-weight: 600; color: var(--primary); cursor: pointer;
}
.upload-template-link:hover { text-decoration: underline; }
.upload-template-link:disabled { opacity: .6; cursor: default; text-decoration: none; }
.fc-input-wrap { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.fc-prefix { font-size: 13px; color: var(--muted); font-weight: 500; }
.fc-input {
  width: 110px;
  padding: 7px 10px;
  border: 1px solid var(--outline-faint);
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  font-family: inherit;
  color: var(--on-s);
  background: var(--surface);
  transition: border .15s;
  -moz-appearance: textfield;
}
.fc-input::-webkit-outer-spin-button,
.fc-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.fc-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.12); }
.fc-auto { font-size: 13px; color: var(--muted); text-align: right; font-style: italic; }
.fc-total-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  padding: 13px 28px;
  background: var(--bg);
  border-top: 1px solid var(--outline);
  align-items: center;
}
.fc-total-label { font-size: 14px; font-weight: 700; color: var(--on-s); }
.fc-total-val { font-size: 15px; font-weight: 800; color: var(--primary); text-align: right; }

.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--outline-faint);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.save-bar-hint { font-size: 12px; color: var(--muted); }
.save-bar .btn--success.saved { background: var(--success); }


/* ════════════════════════════════════════════════════
   FILE UPLOAD
═════════════════════════════════════════════════════ */
.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--outline-faint);
  flex-wrap: wrap;
}
.upload-row:last-child { border-bottom: none; }
.upload-row-label { flex: 1 1 220px; min-width: 180px; }
.upload-period-input {
  width: 90px;
  padding: 7px 10px;
  border: 1px solid var(--outline-faint);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--on-s);
  background: var(--surface);
  transition: border .15s;
}
.upload-period-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.12); }
.upload-file-wrap { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 200px; }
.upload-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-filename {
  font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 160px; padding: 5px 10px; border-radius: 100px;
  border: 1px solid transparent;
}
.upload-filename--chosen {
  background: var(--primary-tonal); color: var(--primary-dark); font-weight: 700;
  border-color: rgba(124, 58, 237, .25); max-width: 220px;
}
.upload-row-status { flex-basis: 100%; font-size: 12px; margin-top: -2px; }
.upload-row-status--ok { color: var(--success); }
.upload-row-status--err { color: var(--error); }
.upload-row-status--warn { color: var(--warn); }
.upload-hist-download {
  cursor: pointer; color: var(--primary); font-size: 15px; font-weight: 700;
}
.upload-hist-download:hover { color: var(--primary-dark); }

.upload-row--done { background: var(--bg); }
.upload-row-uploaded {
  flex-basis: 100%; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.upload-row-uploaded-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes uploadRowFlash {
  0%, 100% { background: transparent; }
  30% { background: var(--primary-tonal); }
}
.upload-row--flash { animation: uploadRowFlash 1.6s ease; }

.upload-channel-section + .upload-channel-section { border-top: 1px solid var(--outline-faint); }
.upload-channel-heading { padding: 14px 28px 4px; display: flex; align-items: center; gap: 10px; }
.upload-period-picker { display: flex; align-items: center; gap: 10px; }

/* Data Coverage card — reuses Flow's .flow-dc-* bar/item classes (see
   FLOW section below) for the same visual language, laid out as a
   responsive grid of per-channel cards instead of Flow's single narrow
   sidebar column. */
.upload-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 18px 28px 22px;
}
.upload-coverage-card {
  border: 1px solid var(--outline-faint);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
}

/* Wizard nudge banner — same flow_upload_wizard nudge Flow's own wizard
   uses, surfaced here so switching to a pending month on this page (which
   doesn't do a full page navigation, unlike the global period picker)
   still offers the guided path. */
.upload-wizard-nudge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--primary-tonal);
  border: 1px solid rgba(124, 58, 237, .25);
  border-radius: var(--rl, 12px);
  padding: 14px 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.upload-wizard-nudge-icon { font-size: 20px; flex-shrink: 0; }
.upload-wizard-nudge-text { flex: 1 1 260px; font-size: 12.5px; color: var(--on-s2); line-height: 1.5; }
.upload-wizard-nudge-text strong { color: var(--on-s); }
.upload-wizard-nudge-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* "Upload any file, any channel" quick-detect box — first card on the
   Upload page, ahead of the structured channel x month list. */
.upload-quick-card { border: 1.5px dashed var(--primary); }
.upload-quick-card .upload-row { border-bottom: none; }

/* ── First-time "Welcome / set up your dashboard" screen ──
   (frontend/js/views/welcome.js, see docs/welcome-onboarding-lld.md) ── */
.welcome-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #6d28d9 100%);
  border-radius: var(--rl); padding: 40px 32px; text-align: center; color: #fff; margin-bottom: 20px;
}
.welcome-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; background: rgba(255,255,255,.15);
  padding: 4px 12px; border-radius: 99px; margin-bottom: 14px;
}
.welcome-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; max-width: 560px; margin: 0 auto 10px; line-height: 1.25; }
.welcome-sub { font-size: 14px; opacity: .85; max-width: 460px; margin: 0 auto 22px; line-height: 1.6; }
.welcome-sample-btn { background: rgba(255,255,255,.15); color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.welcome-sample-btn:hover { background: rgba(255,255,255,.25); }

.welcome-stepper {
  display: flex; align-items: center; gap: 0; background: var(--surface); border-radius: var(--rl);
  box-shadow: var(--sh2); padding: 18px 24px; margin-bottom: 28px; flex-wrap: wrap;
}
.welcome-step { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; }
.welcome-step-num {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.welcome-step-num.done { background: var(--success); color: #fff; }
.welcome-step-num.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-tonal); }
.welcome-step-num.todo { background: var(--bg); color: var(--muted); border: 1.5px solid var(--outline); }
.welcome-step-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.welcome-step-desc { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.welcome-step-connector { height: 2px; flex: 0 0 28px; background: var(--outline); margin: 0 6px; }
.welcome-step-connector.done { background: var(--success); }

.welcome-section { margin-bottom: 28px; }
.welcome-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.welcome-section-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.welcome-section-sub { font-size: 12px; color: var(--faint); }
.welcome-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--primary-tonal); color: var(--primary-dark); padding: 2px 9px; border-radius: 4px;
}
.welcome-badge--amber { background: var(--warn-tonal); color: var(--warn-on); }

.welcome-ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.welcome-ch-card {
  background: var(--surface); border: 1.5px solid var(--outline-faint); border-radius: var(--r);
  padding: 18px 14px; text-align: center; cursor: pointer; transition: all .15s; position: relative;
}
.welcome-ch-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tonal); transform: translateY(-2px); }
.welcome-ch-card--done { border-color: var(--success); background: var(--success-tonal); }
.welcome-ch-check { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 800; color: var(--success); }
.welcome-ch-logo { font-size: 26px; margin-bottom: 8px; }
.welcome-ch-name { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.welcome-ch-sub { font-size: 10.5px; color: var(--faint); margin-bottom: 10px; }
.welcome-connect-note {
  margin-top: 12px; padding: 10px 14px; background: var(--success-tonal);
  border: 1px solid var(--success); border-radius: 8px; font-size: 12px;
  font-weight: 600; color: var(--success-on, var(--success));
}

.welcome-cost-strip {
  background: var(--surface); border: 1.5px solid var(--outline-faint); border-radius: var(--r);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer;
  transition: border-color .15s; flex-wrap: wrap;
}
.welcome-cost-strip:hover { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-tonal); }
.welcome-cost-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--warn-tonal);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.welcome-cost-info { flex: 1; min-width: 180px; }
.welcome-cost-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.welcome-cost-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.welcome-value-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.welcome-value-card { background: var(--surface); border: 1px solid var(--outline-faint); border-radius: var(--r); padding: 16px; }
.welcome-value-icon { font-size: 20px; margin-bottom: 8px; }
.welcome-value-title { font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.welcome-value-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }

@media (max-width: 700px) {
  .welcome-ch-grid { grid-template-columns: repeat(2, 1fr); }
  .welcome-value-strip { grid-template-columns: 1fr; }
  .welcome-step-connector { display: none; }
}

.upload-period-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 28px 4px;
  padding: 10px 16px;
  background: var(--primary-tonal);
  border: 1px solid rgba(124, 58, 237, .18);
  border-radius: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.upload-period-banner-icon { font-size: 16px; flex-shrink: 0; }
.upload-period-banner-text { font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.upload-period-banner-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.upload-period-banner .upload-select { margin-left: auto; }

.upload-row-source {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.5;
  max-width: 320px;
}
.upload-row-source-icon { flex-shrink: 0; }
.upload-row-source strong { color: var(--on-s2); font-weight: 600; }

.upload-select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--outline-faint);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--on-s);
  background: var(--surface);
}
.upload-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.12); }


/* ════════════════════════════════════════════════════
   SKU DETAIL — side drawer over the SKU list
═════════════════════════════════════════════════════ */
.sku-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 300;
}
.sku-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.sku-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: min(440px, 94vw);
  background: var(--surface);
  box-shadow: -8px 0 32px rgba(0,0,0,.16);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  z-index: 301;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sku-drawer.open { transform: translateX(0); }
.sku-drawer-body { padding: 24px 32px 60px; }

/* SKU detail drawer content — matches the reference mock's own openSkuDrawer
   structure/sizing verbatim (sku-d-* class names kept identical to the
   mock's own so the mapping stays obvious): header, Key Metrics, Income
   Statement, Returns & RTO, Marketplace Comparison. Built in
   renderSkuDrawerContent/skuMarketplaceCompareHtml (skus.js). */
.sku-d-hd {
  display: flex; align-items: flex-start; gap: 8px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--outline-faint);
}
.sku-d-thumb {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sku-d-close { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--faint); padding: 2px 4px; flex-shrink: 0; }
.sku-d-close:hover { color: var(--ink); }
.sku-d-flag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.sku-d-body { display: flex; flex-direction: column; gap: 14px; }
.sku-d-kpis { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.sku-d-kpi { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.sku-d-kpi-lbl { font-size: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 3px; }
.sku-d-kpi-val { font-size: 12px; font-weight: 800; color: var(--ink); }
.sku-d-kpi-sub { font-size: 8px; color: var(--faint); margin-top: 1px; }
.sku-d-section { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 8px; }
.sku-d-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--outline-faint); font-size: 12px; }
.sku-d-row-lbl { color: var(--muted); }
.sku-d-row-val { font-weight: 300; color: var(--ink); }
.sku-d-mkt-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.sku-d-mkt-table thead tr { border-bottom: 2px solid var(--outline-faint); }
.sku-d-mkt-table th { text-align: right; padding: 4px 6px; font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.sku-d-mkt-table th:first-child { text-align: left; }
.sku-d-mkt-table td { padding: 6px; border-bottom: 1px solid var(--outline-faint); text-align: right; }
.sku-d-mkt-table td:first-child { text-align: left; white-space: nowrap; }
.sku-d-mkt-row--current { background: var(--primary-tonal); }
/* Channel cell — the marketplace logo itself is the clickable link (a
   .sku-d-mkt-chan span when there's no matching product_url, an <a> of the
   same class when there is); --current adds a ring so the topbar's active
   channel filter still reads at a glance without the name label this used
   to carry. */
.sku-d-mkt-chan { display: inline-flex; text-decoration: none; border-radius: 6px; }
a.sku-d-mkt-chan { cursor: pointer; }
a.sku-d-mkt-chan:hover { opacity: .85; }
.sku-d-mkt-chan--current { box-shadow: 0 0 0 2px var(--primary); }

/* COGS inline-edit (skuCogsEditFormHtml/wireSkuCogsEditForm, skus.js) —
   shared by the drawer's own Income Statement row and each Channel SKU's
   own form in the Master SKU breakdown table. */
.sku-d-cogs-edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0;
  border: 1px solid var(--outline-faint); background: var(--bg); color: var(--muted);
  cursor: pointer; padding: 0; transition: background .15s, color .15s, border-color .15s;
}
.sku-d-cogs-edit-btn svg { width: 12px; height: 12px; }
.sku-d-cogs-edit-btn:hover { background: var(--primary-tonal); color: var(--primary); border-color: var(--primary); }
.cogs-est-badge {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .02em; color: var(--warn-on); background: var(--warn-tonal);
  border-radius: 4px; padding: 1px 4px; margin-left: 4px; cursor: help; vertical-align: middle;
}
.sku-d-cogs-est-note {
  font-size: 10.5px; color: var(--warn-on); background: var(--warn-tonal);
  border-radius: 6px; padding: 6px 8px; margin: 2px 0 7px;
}
.sku-d-cogs-form {
  display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
  margin: 8px 0; padding: 10px; background: var(--bg); border: 1px solid var(--outline-faint); border-radius: 8px;
}
.sku-d-cogs-field { display: flex; flex-direction: column; gap: 3px; }
.sku-d-cogs-field label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.sku-d-cogs-field input {
  width: 72px; padding: 5px 7px; font-size: 12px; border: 1px solid var(--outline); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
.sku-d-cogs-actions { display: flex; align-items: center; gap: 6px; }
.sku-d-cogs-status { font-size: 10px; color: var(--faint); }

@media (max-width: 640px) {
  .sku-drawer { width: 100vw; }
  .sku-drawer-body { padding: 18px 16px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .sku-drawer, .sku-drawer-backdrop { transition: none; }
}

.hidden { display: none !important; }


/* ════════════════════════════════════════════════════
   FLOW — full-page AI chat mode
═════════════════════════════════════════════════════ */
.flow-view { flex: 1; display: flex; min-height: 0; }

.flow-left {
  width: 210px; flex-shrink: 0; border-right: 1px solid var(--outline-faint);
  background: var(--surface); display: flex; flex-direction: column; overflow-y: auto;
}
.flow-left-section { padding: 14px 12px 4px; }
.flow-left-label {
  font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .07em; margin-bottom: 8px;
}
.flow-new-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--primary-dark); cursor: pointer;
  border: 1px dashed var(--primary); background: var(--primary-tonal); margin-bottom: 10px;
}
.flow-new-btn:hover { background: var(--primary); color: #fff; }
.flow-thread {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 2px;
}
.flow-thread.active { background: var(--primary-tonal); }
.flow-thread:not(.active):hover { background: var(--bg); }
.flow-thread-title {
  font-size: 12.5px; font-weight: 600; color: var(--on-s); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.flow-thread.active .flow-thread-title { color: var(--primary-dark); }
.flow-thread-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.flow-left-empty { font-size: 11.5px; color: var(--muted); line-height: 1.6; padding: 4px 10px; }

.flow-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.flow-chat-scroll { flex: 1; overflow-y: auto; padding: 20px; scroll-behavior: smooth; }

.flow-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 22px; padding: 20px; text-align: center;
}
.flow-greeting { font-size: 22px; font-weight: 600; color: var(--on-s); max-width: 440px; line-height: 1.4; font-family: var(--font-disp); }
.flow-landing-box {
  width: 100%; max-width: 560px; border: 1.5px solid var(--outline-faint); border-radius: 14px;
  background: var(--surface); overflow: hidden; box-shadow: var(--sh3);
  transition: border-color .15s;
}
.flow-landing-box:focus-within { border-color: var(--primary); }
.flow-landing-box textarea {
  width: 100%; border: none; background: transparent; resize: none; font-family: inherit;
  font-size: 14px; color: var(--on-s); outline: none; padding: 14px 16px 8px; min-height: 84px; line-height: 1.6;
}
.flow-landing-footer {
  display: flex; align-items: center; justify-content: flex-end; padding: 8px 12px;
  border-top: 1px solid var(--outline-faint);
}

.flow-msg-row { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; }
.flow-msg-row.usr { flex-direction: row-reverse; }
.flow-avatar {
  width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}
.flow-avatar.ai { background: var(--primary-tonal); color: var(--primary-dark); }
.flow-avatar.usr { background: var(--surface); color: var(--on-s2); border: 1px solid var(--outline-faint); }
.flow-bubble { max-width: 82%; padding: 11px 14px; border-radius: 13px; font-size: 13.5px; line-height: 1.6; }
.flow-bubble.usr { background: var(--surface); border: 1px solid var(--outline-faint); border-radius: 13px 3px 13px 13px; color: var(--on-s); }
.flow-bubble.ai { background: var(--surface); border: 1px solid var(--outline-faint); border-radius: 3px 13px 13px 13px; color: var(--on-s); box-shadow: var(--sh2); }

.flow-file-req {
  border: 1px solid var(--primary); border-radius: 10px; padding: 12px 14px;
  margin-top: 10px; background: var(--primary-tonal);
}
.flow-fr-eyebrow {
  font-size: 10.5px; font-weight: 700; color: var(--primary-dark); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .05em;
}
.flow-fr-name { font-size: 14px; font-weight: 700; color: var(--on-s); margin-bottom: 3px; }
.flow-fr-path { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 8px 0 10px; }
.flow-fr-step {
  padding: 3px 8px; border-radius: 5px; background: var(--surface);
  border: 1px solid var(--outline-faint); font-size: 11.5px; color: var(--on-s2);
}
.flow-fr-arrow { color: var(--muted); font-size: 11px; }
.flow-fr-note {
  font-size: 11.5px; color: var(--on-s2); margin-bottom: 10px; padding: 6px 9px;
  background: var(--surface); border-radius: 6px; line-height: 1.5;
}

.flow-input-wrap { padding: 10px 16px 14px; border-top: 1px solid var(--outline-faint); background: var(--surface); flex-shrink: 0; }
.flow-input-box {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--outline-faint);
  border-radius: 10px; padding: 8px 10px; background: var(--bg);
}
.flow-input-box input { flex: 1; border: none; background: transparent; font-size: 13.5px; color: var(--on-s); outline: none; font-family: inherit; }
.flow-send-btn {
  width: 28px; height: 28px; border-radius: 7px; background: var(--primary); border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; flex-shrink: 0;
}
.flow-send-btn:hover { background: var(--primary-dark); }
.flow-send-btn:disabled { opacity: .5; cursor: not-allowed; }

.flow-right {
  width: 210px; flex-shrink: 0; border-left: 1px solid var(--outline-faint);
  background: var(--surface); overflow-y: auto;
}
.flow-right-section { padding: 14px 13px; border-bottom: 1px solid var(--outline-faint); }
.flow-dc-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.flow-dc-channel { font-size: 11.5px; font-weight: 600; color: var(--on-s2); }
.flow-dc-pct { font-size: 11.5px; font-weight: 700; color: var(--primary-dark); }
.flow-dc-bar { height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; margin-bottom: 8px; }
.flow-dc-fill { height: 100%; border-radius: 2px; background: var(--primary); transition: width .4s ease; }
.flow-dc-group + .flow-dc-group { margin-top: 10px; }
.flow-dc-items { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.flow-dc-item { display: flex; align-items: center; gap: 6px; font-size: 11px; padding: 3px 4px; border-radius: 5px; }
.flow-dc-item--done { color: var(--muted); }
.flow-dc-item-check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.flow-dc-item--pending {
  color: var(--on-s2); font-weight: 600; cursor: pointer; transition: background .12s;
}
.flow-dc-item--pending:hover { background: var(--primary-tonal); color: var(--primary-dark); }
.flow-dc-item-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--warn);
  flex-shrink: 0; margin: 0 1px;
}

/* Guided upload wizard */
.flow-wizard-context {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 8px;
}
.flow-wizard-period { font-size: 12px; font-weight: 600; color: var(--on-s2); }
.flow-fr-why { font-size: 12.5px; color: var(--on-s2); line-height: 1.55; margin: 4px 0 2px; }
.flow-wizard-progress {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}
.flow-wizard-skip {
  text-align: center; font-size: 12px; color: var(--muted); cursor: pointer;
  margin-top: 12px; text-decoration: underline; text-underline-offset: 2px;
}
.flow-wizard-skip:hover { color: var(--on-s2); }
.flow-mock-cta {
  text-align: center; font-size: 12px; color: var(--primary); font-weight: 600; cursor: pointer;
  margin-top: 10px; text-decoration: underline; text-underline-offset: 2px;
}
.flow-mock-cta:hover { color: var(--primary-dark); }
.flow-wizard-warn {
  font-size: 12px; color: var(--warn); background: var(--warn-tonal);
  border: 1px solid var(--warn); border-radius: 7px; padding: 7px 10px; margin-bottom: 10px;
}
.flow-wizard-note {
  font-size: 12px; color: var(--muted); background: var(--bg);
  border-radius: 7px; padding: 7px 10px; margin-bottom: 10px;
}

.flow-confirm-card { width: 100%; }
.flow-confirm-title { font-size: 13.5px; font-weight: 700; color: var(--on-s); margin-bottom: 8px; word-break: break-all; }
.flow-confirm-rows { display: flex; flex-direction: column; gap: 0; margin-bottom: 12px; }
.flow-confirm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-top: 1px solid var(--outline-faint); font-size: 12.5px;
}
.flow-confirm-row:first-child { border-top: none; }
.flow-confirm-row span { color: var(--muted); }
.flow-confirm-row b { color: var(--on-s); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.flow-confirm-btns { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .flow-right { display: none; }
}
@media (max-width: 700px) {
  .flow-left { display: none; }
}


/* ════════════════════════════════════════════════════
   ANIMATIONS
═════════════════════════════════════════════════════ */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
[data-pulse] { animation: pulse 2.4s ease-in-out infinite; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.view.active { animation: fadeIn .2s ease-out; }


/* ════════════════════════════════════════════════════
   RESPONSIVE
═════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .mp-summary { grid-template-columns: repeat(2, 1fr); }
  .pl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-drawer { width: 60px; overflow: hidden; }
  .nav-brand, .nav-brand-sub, .nav-item span:not(.nav-icon), .nav-badge, .nav-footer { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-header { justify-content: center; }
  .nav-logo { margin: 0; }
  .kpi-row { grid-template-columns: 1fr; }
  .mp-summary { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .mix-body { grid-template-columns: 1fr; }
  .is-row { grid-template-columns: 1fr 60px 60px 80px 80px 50px; padding: 10px 16px; }
  .is-row--highlighted { padding-left: 13px; }
  .is-sub-row { grid-template-columns: 1fr 60px 60px 80px 80px 50px; padding: 8px 16px; }
  .wizard-shell { max-width: 100%; border-radius: 0; }
  .wizard-top { padding: 20px; }
  .wiz-steps { padding: 0 16px; }
  .wiz-body { padding: 20px; }
  .wiz-footer { padding: 16px 20px; }
}

/* ── Avatar (opens the Profile page — see BN.views.profile) ── */
.user-menu { position: relative; cursor: pointer; display: inline-flex; }

/* ── Nav Sign Out ─────────────────────────────── */
.nav-signout {
  font-size: 12px; color: var(--muted); cursor: pointer;
  padding: 7px 14px; border-radius: 8px;
  display: flex; align-items: center; gap: 6px;
  transition: all .15s; margin-top: 6px;
}
.nav-signout:hover { background: var(--error-tonal); color: var(--error); }

/* ── Login Page ─────────────────────────────── */
.login-page {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface); border-radius: 20px;
  padding: 40px 36px; width: 380px; max-width: 92vw;
  box-shadow: var(--sh3); text-align: center;
}
.login-card-logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #0891b2);
  color: #fff; font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-card-title { font-size: 20px; font-weight: 700; color: var(--on-s); }
.login-card-sub { font-size: 13px; color: var(--muted); margin: 4px 0 24px; }
.login-card-field { text-align: left; margin-bottom: 16px; }
.login-card-label { display: block; font-size: 12px; font-weight: 600; color: var(--on-s2); margin-bottom: 5px; }
.login-card-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--outline);
  border-radius: 10px; font-size: 14px; outline: none;
  background: var(--bg); color: var(--on-s);
}
.login-card-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.login-card-error { font-size: 13px; color: var(--error); display: none; padding: 8px 12px; background: var(--error-tonal); border-radius: 8px; margin-bottom: 14px; }
.login-card-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 12px; color: var(--muted); font-size: 11px;
}
.login-card-divider::before,
.login-card-divider::after { content: ""; flex: 1; height: 1px; background: var(--outline); }
.login-admin-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border: 1.5px solid var(--outline); border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--on-s2); text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.login-admin-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tonal); }
.login-admin-icon { font-size: 15px; }
.login-admin-arrow { margin-left: auto; color: var(--muted); }

/* ── Settings / Channel Info ─────────────────────── */
.set-form { display:flex; flex-direction:column; gap:12px; }
.set-row { display:grid; grid-template-columns:160px 1fr; align-items:center; gap:12px; }
.set-row-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.set-row-grid .set-row { grid-template-columns:1fr; }
.set-label { font-size:13px; font-weight:600; color:var(--on-s); }
.set-input { width:100%; padding:9px 12px; border:1.5px solid var(--outline); border-radius:8px; font-size:13px; outline:none; background:var(--bg); color:var(--on-s); }
.set-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(124,58,237,.12); }
.set-section-hdr { font-size:12px; font-weight:700; color:var(--primary); text-transform:uppercase; letter-spacing:.5px; margin-top:8px; padding-top:12px; border-top:1px solid var(--outline); }
.set-section-hdr:first-of-type { margin-top:0; }


/* ════════════════════════════════════════════════════
   LXYA STYLE LAYER — cosmetic enhancement only.
   Same class names, same layout, same data. Zero markup
   dependence. Pure visual polish.
════════════════════════════════════════════════════ */

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 82% -10%, rgba(124,58,237,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(8,145,178,.06), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, .tb-title, .kpi-val, .mp-pcard-cm, .sku-hero-cm, .ph-val,
.login-card-title, .ao-metric, .fc-total-val, .pctx-val {
  font-family: var(--font-disp);
  letter-spacing: -.3px;
}

/* ── Sidebar ───────────────────────────── */
.nav-drawer {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  border-right: 1px solid var(--outline-faint);
  box-shadow: 1px 0 0 rgba(18,16,32,.03);
}
.nav-logo {
  background: linear-gradient(135deg, #7c3aed 0%, #0891b2 130%);
  box-shadow: 0 3px 10px -2px rgba(124,58,237,.4);
  font-family: var(--font-disp);
}
.nav-brand { font-family: var(--font-disp); font-size: 14px; }
.nav-item {
  border-radius: 12px;
  margin: 1px 0;
  font-weight: 500;
  transition: background .15s, color .15s, box-shadow .15s;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(124,58,237,.12), rgba(8,145,178,.07));
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-item.active .nav-icon-filter { filter: none; }

/* ── Topbar ────────────────────────────── */
.top-bar {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--outline-faint);
}
.tb-title { font-size: 19px; }
.avatar {
  background: linear-gradient(135deg, #7c3aed, #0891b2);
  box-shadow: 0 2px 8px -2px rgba(124,58,237,.4);
  font-family: var(--font-disp);
  font-weight: 600;
  color: #fff;
  border: none;
}
.period-chip {
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: var(--sh1);
}

/* ── Buttons ───────────────────────────── */
.btn--primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 55%, #0891b2 160%);
  box-shadow: 0 4px 12px -4px rgba(124,58,237,.5);
  border-radius: 100px;
}
.btn--primary:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 60%, #0e7490 170%);
  box-shadow: 0 8px 20px -6px rgba(8,145,178,.45);
  transform: translateY(-1px);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px transparent; }
.btn--success {
  background: linear-gradient(135deg, #059669, #0d9488);
  box-shadow: 0 4px 12px -4px rgba(5,150,105,.45);
}

/* ── Cards ─────────────────────────────── */
.card, .chart-card, .is-card, .wc-card, .mp-pcard, .sku-hero, .costs-explainer,
.ao-card, .kpi-card, .platform-ctx {
  border: 1px solid var(--outline-faint);
  background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
}
.card-hdr { background: linear-gradient(180deg, #fbfbff, transparent); border-radius: var(--r) var(--r) 0 0; }
.chart-card-hdr h3, .is-card-hdr h2 { font-family: var(--font-disp); font-size: 14px; letter-spacing: -.2px; }

.kpi-card { position: relative; overflow: hidden; }
.kpi-card::after {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 3px;
  -webkit-mask: linear-gradient(90deg, transparent, #000, transparent);
          mask: linear-gradient(90deg, transparent, #000, transparent);
}
.kpi-card--primary::after { background: linear-gradient(90deg, #7c3aed, #0891b2); }
.kpi-card--err::after { background: var(--error); }
.kpi-card--warn::after { background: var(--warn); }
.kpi-card--ok::after { background: var(--success); }
.kpi-card:hover, .chart-card:hover, .is-card:hover { box-shadow: var(--sh3); transition: box-shadow .2s; }

/* ── Tabs ──────────────────────────────── */
.tabs, .mp-tab-bar {
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-bottom: none;
}
.tab.active, .mp-tab.active {
  background: linear-gradient(180deg, rgba(124,58,237,.08), transparent);
  border-radius: 10px 10px 0 0;
}
.tab { margin-bottom: -2px; }

/* ── Tables ────────────────────────────── */
th {
  background: linear-gradient(180deg, #f6f7fd, #f1f2fb);
  font-family: var(--font-disp);
  font-size: 10px;
  letter-spacing: .6px;
  text-transform: uppercase;
}
tr.clickable:hover td, .mp-compare-table tr:hover td, .cog-table tr:hover td,
.sku-input-table tr:hover td { background: linear-gradient(180deg, rgba(124,58,237,.05), rgba(8,145,178,.03)); }
.is-row--total { background: linear-gradient(180deg, #f6f7fd, #f1f2fb); }
.is-row--highlighted { background: linear-gradient(90deg, #fff6e8, #fffdf6); }

/* ── Chips / Signals ───────────────────── */
.tb-chip { border-radius: 100px; box-shadow: var(--sh1); }
.signal { box-shadow: 0 1px 3px rgba(18,16,32,.08); }
.ao-chip { background: var(--surface-2); }

/* ── Login page — fancy gradient panel ─── */
.login-page {
  background:
    radial-gradient(900px 600px at 12% 0%, rgba(124,58,237,.14), transparent 55%),
    radial-gradient(800px 500px at 88% 100%, rgba(8,145,178,.12), transparent 55%),
    var(--bg);
}
.login-card { border: 1px solid var(--outline-faint); border-radius: 24px; box-shadow: var(--sh3); }

/* ── Empty state + info cards ──────────── */
.info-card, .costs-explainer, .insight-card, .insight-banner, .coverage-banner {
  border-radius: 12px;
}
.info-card--tip { background: linear-gradient(90deg, rgba(124,58,237,.09), rgba(8,145,178,.06)); }

/* ── Section headers get a hint of display type ── */
.section-hdr h3, .ao-group-label-text, .wc-hdr { font-family: var(--font-disp); letter-spacing: -.2px; }

/* ── Scrollbar polish ──────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 100px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
::-webkit-scrollbar-track { background: transparent; }

/* ── Income statement (mock v3: Label | Current | Previous | Change) ── */
.mc-card {
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-radius: var(--rl);
  overflow-x: auto;
  margin-top: 16px;
}
.mc-card--sku { margin-top: 0; }
.mc-title { padding: 12px 18px 8px; font-size: 14px; font-weight: 700; }
.mc-head {
  display: grid;
  grid-template-columns: 1fr 92px 92px 72px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--outline);
}
.mc-head > div {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; text-align: right;
  white-space: nowrap;
}
.mc-head .mc-lbl { text-align: left; }
.mc-head .mc-title-cell {
  font-size: 14px;
  font-weight: 700;
  color: var(--on-s);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}
.mc-sec {
  padding: 7px 18px; font-size: 11px; font-weight: 800;
  color: var(--ink); letter-spacing: .6px; text-transform: uppercase;
  background: #e9ecf1; border-bottom: 1px solid var(--outline);
}
.mc-row {
  display: grid;
  grid-template-columns: 1fr 92px 92px 72px;
  align-items: flex-start;
  padding: 7px 18px;
  border-bottom: 1px solid var(--outline);
  font-size: 12.5px;
}
.mc-row .mc-lbl {
  padding-left: 14px; padding-top: 2px; color: #3c4043;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-val { text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.mc-prev { text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--faint); }
.mc-chg-col { text-align: right; padding-top: 2px; }
.mc-units { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; font-weight: 400; white-space: nowrap; }
.mc-chg { font-size: 12px; font-weight: 600; }
.mc-chg--up { color: var(--success); }
.mc-chg--down { color: var(--error); }
.mc-chg--flat { color: var(--muted); font-weight: 500; }
.mc-row[data-mc-missing] .mc-val,
.mc-row[data-mc-missing] .mc-prev { color: var(--faint); }

.mc-row, .mc-subrow { position: relative; }
.mc-row::after, .mc-subrow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}
.mc-row:hover::after { background: rgba(124, 58, 237, 0.08); }
.mc-row--expand:hover::after { background: rgba(124, 58, 237, 0.12); }
.mc-row--op:hover::after { background: rgba(255, 255, 255, 0.07); }
.mc-subrow:hover::after { background: rgba(124, 58, 237, 0.06); }

.mc-row--expand .mc-lbl { cursor: pointer; }
.mc-expand {
  display: inline-block;
  width: 12px;
  margin-right: 4px;
  color: var(--faint);
  font-size: 10px;
  transform: rotate(0deg);
  transition: transform .15s ease;
}
.mc-expand::before { content: '\25B8'; }
.mc-row--expand.open .mc-expand { transform: rotate(90deg); }
.mc-subrows { display: none; }
.mc-subrows.open { display: block; }
.mc-subhdr {
  padding: 6px 18px 2px 54px;
  font-size: 10px;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-top: 1px dashed var(--outline);
}
.mc-subrow {
  display: grid;
  grid-template-columns: 1fr 92px 92px 72px;
  align-items: flex-start;
  padding: 5px 18px 5px 34px;
  border-bottom: 1px solid var(--outline-faint);
  font-size: 12px;
}
.mc-subrow--chan {
  padding: 4px 18px 4px 54px;
}
.mc-subrow--chan-child {
  padding: 4px 18px 4px 74px;
}
.mc-subrow--chan-child .mc-lbl { color: var(--faint); }
.mc-subrow .mc-lbl { color: var(--muted); padding-top: 2px; }

.mc-row--bold { font-weight: 700; }
.mc-row--bold .mc-prev { color: var(--muted); }
.mc-row--opex { background: #eef1f4; font-weight: 700; }
.mc-row--opex .mc-lbl, .mc-row--opex .mc-val, .mc-row--opex .mc-prev { color: #3c4043; padding-left: 0; }
.mc-row--cogs { background: #fef3e2; font-weight: 700; }
.mc-row--cogs .mc-lbl, .mc-row--cogs .mc-val, .mc-row--cogs .mc-prev { color: #92400e; padding-left: 0; }
.mc-row--grand {
  background: #e4e9f5; font-weight: 800; border-top: 1px solid #c3cbe0;
}
.mc-row--grand .mc-lbl { color: #28345c; padding-left: 0; font-size: 13px; }
.mc-row--grand .mc-val, .mc-row--grand .mc-prev { color: #28345c; }
.mc-row--op {
  background: #1f2430;
  border-top: 2px solid #3c4043;
  border-bottom: none;
  padding: 12px 18px;
}
.mc-row--op .mc-lbl { padding-left: 0; font-size: 15px; font-weight: 800; }
.mc-row--op .mc-prev { color: #8a8f9b; font-size: 13px; font-weight: 600; }

/* ── SKU table (mock v3: 8 columns) ────── */
.prod-name { font-weight: 600; color: var(--ink); font-size: 13.5px; line-height: 1.3; max-width: 260px; }
.val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.val.pos { color: var(--success); }
.val.neg { color: var(--error); }
.sub { font-size: 11px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.sub.up { color: var(--success); font-weight: 600; }
.sub.down { color: var(--error); font-weight: 600; }
.sub.neutral { color: var(--muted); font-weight: 600; }
.units { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dash { color: var(--faint); font-weight: 600; }

.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-thumb {
  width: 36px; height: 36px; border-radius: 7px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--outline-faint);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--faint);
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Signal-colored fallback (mock's .sku-thumb) — used only when there's no
   real product image, so the row still reads at a glance without a blank
   grey box: green/amber/red matching the same Profitable/At Risk/Losing
   signal as the row's own CM% pill, initial letter in white. */
.prod-thumb--signal { background: var(--muted); color: #fff; font-weight: 800; font-size: 14px; border: none; }
.prod-thumb--signal.sig-ok { background: var(--success); }
.prod-thumb--signal.sig-warn { background: var(--warn); }
.prod-thumb--signal.sig-err { background: var(--error); }
.prod-cell-body { min-width: 0; max-width: 300px; }
.prod-name-link {
  font-weight: 600; color: var(--on-s); font-size: 13.5px; line-height: 1.3;
  display: flex; align-items: center; gap: 4px;
}
.prod-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ext-ico {
  font-size: 11px; color: var(--muted); text-decoration: none;
  flex-shrink: 0; cursor: pointer;
}
.ext-ico:hover { color: var(--primary); }
.prod-status-row { margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sku-code-row {
  font-size: 10.5px; color: var(--faint); text-transform: uppercase;
  letter-spacing: .3px; margin-bottom: 3px;
  display: flex; align-items: center; gap: 3px;
}
.sku-code-val { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: normal; }
.copy-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  border: none; background: transparent; color: var(--faint);
  cursor: pointer; padding: 0; opacity: .55; transition: background .15s, color .15s, opacity .15s;
}
.copy-icon-btn svg { width: 13px; height: 13px; }
.copy-icon-btn:hover { background: var(--bg); color: var(--primary); opacity: 1; }
.copy-icon-btn.copied { color: var(--success); opacity: 1; }
.chip--action {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-tonal); color: var(--primary); font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.chip--action:hover { background: var(--primary); color: #fff; }

/* ── Marketplaces redesign (mock: hero cards + tabbed comparison) ── */
.mp-page-title { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.mp-heroes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.mp-hcard {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-top: 3px solid var(--muted);
  border-radius: var(--r);
  padding: 18px 22px;
}
.mp-hcard.losing { border-top-color: var(--error); }
.mp-hcard.healthy { border-top-color: var(--success); }
.mp-hcard.at-risk { border-top-color: var(--warn); }
.mp-hcard.active { box-shadow: 0 0 0 2px var(--accent, #0891b2); }
.mp-hcard { cursor: pointer; }
.mp-hcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mp-hcard-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.mp-hicon {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
}
.mp-hstatus { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.mp-hstatus.losing { background: var(--error-tonal); color: var(--error-on); }
.mp-hstatus.healthy { background: var(--success-tonal); color: var(--success-on); }
.mp-hstatus.at-risk { background: var(--warn-tonal); color: var(--warn-on); }
.mp-hgmv { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0 10px 0; }
.mp-hgmv-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; font-weight: 700; }
.mp-hgmv-val { font-size: 18px; font-weight: 800; }
.mp-h2col { display: flex; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--outline); margin-bottom: 2px; }
.mp-hstat { flex: 1; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.mp-hstat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: .3px; }
.mp-hstat-val { font-size: 15px; font-weight: 800; color: var(--warn-on); margin-top: 2px; }
.mp-hcm { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--outline); }
.mp-hcm-val { font-size: 20px; font-weight: 800; }
.mp-hcm-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mp-hcm-margin { font-size: 16px; font-weight: 800; text-align: right; }
.mp-hop { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; background: #1f2430; border-radius: 8px; padding: 9px 14px; }
.mp-hop-lbl { font-size: 11px; color: #c7cad1; font-weight: 600; }
.mp-hop-val { font-size: 15px; font-weight: 800; }
.mp-hop-val.pos { color: #8ee8a8; }
.mp-hop-val.neg { color: #ff8a80; }
.mp-chandot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* SKU table — matches the mock's .sku-tbl typography/spacing exactly
   (th: 9.5px uppercase, padding 9px 12px; td: 11.5px, tabular-nums,
   padding 8px 12px; row hover tinted purple, not grey). Numeric columns
   are right-aligned via .tnum on the cell itself rather than nth-child
   position, since the Channel column appears/disappears depending on the
   active filter. */
.sku-table th {
  padding: 9px 12px; white-space: nowrap; text-align: left;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}
.sku-table td { padding: 8px 12px; vertical-align: middle; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sku-table th.tnum { text-align: right; }
.sku-table tbody tr.clickable:hover td { background: var(--primary-tonal); }

/* Matches the mock's .sku-tab-hd (pills + a right-aligned count, one row)
   and .sku-tbl-wrap (the table's own card, replacing the generic .panel
   wrapper this page used to sit inside). Pills sit left; search/COGS-
   default/download/count are grouped into one cluster pushed to the right
   via margin-left:auto on the cluster itself (not the individual pieces),
   so they move as one unit and stay wrap-together on narrow screens. */
.sku-tab-hd { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin-bottom: 14px; }
.sku-tab-hd .sku-pills { margin-bottom: 0; flex-shrink: 1; min-width: 0; flex-wrap: nowrap; gap: 5px; }
/* Scoped smaller than the base .sku-pill (shared with Overview's own SKU
   Performance panel, which keeps its normal size) — only this page's pills
   shrink, so everything fits alongside the search/COGS/download cluster. */
.sku-tab-hd .sku-pill { padding: 4px 9px; font-size: 10px; }
.sku-tools-right-cluster { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: nowrap; flex-shrink: 0; }
.sku-cnt { font-size: 10px; color: var(--muted); white-space: nowrap; }

.sku-search-wrap { position: relative; width: 130px; flex-shrink: 1; min-width: 70px; }
.sku-search-icon { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 11px; height: 11px; color: var(--muted); pointer-events: none; }
.sku-search-input {
  width: 100%; padding: 4px 7px 4px 23px; border-radius: 999px; border: 1px solid var(--outline);
  background: var(--surface); color: var(--ink); font-size: 10.5px; height: 24px; box-sizing: border-box;
}
.sku-search-input:focus { outline: none; border-color: var(--primary); }
.sku-download-btn {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--primary); background: transparent; color: var(--primary);
  font-size: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.sku-download-btn:hover { background: var(--primary-tonal); }
.sku-download-btn:disabled { opacity: .6; cursor: default; }
.sku-default-cogs-pill {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--outline-faint); border-radius: 999px; padding: 0 7px;
  height: 24px; box-sizing: border-box; white-space: nowrap; position: relative; flex-shrink: 0;
}
.sku-default-cogs-pill b { color: var(--ink); font-weight: 600; }
.sku-default-cogs-edit-btn {
  border: none; background: none; padding: 1px; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center;
}
.sku-default-cogs-edit-btn:hover { color: var(--primary); }
.sku-default-cogs-edit-btn svg { width: 10px; height: 10px; }
/* Floats as a popover anchored to .sku-default-cogs-pill (position:relative)
   rather than expanding inline — two labeled inputs would otherwise widen
   the pill enough to push the header row into wrapping. Right-anchored
   (right:0, not left:0): the pill sits near the right edge of the header
   (margin-left:auto cluster), so growing rightward from its left edge ran
   the Cancel button off the visible viewport — growing leftward from its
   right edge instead keeps the whole popover on-screen. */
.sku-default-cogs-edit-inline {
  position: absolute; top: 100%; right: 0; margin-top: 6px; z-index: 20;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--outline); border-radius: 8px;
  padding: 8px 10px; box-shadow: var(--sh1);
}
.sku-default-cogs-edit-inline label {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted);
}
.sku-default-cogs-edit-inline input {
  width: 42px; padding: 3px 5px; border-radius: 6px; border: 1px solid var(--outline); font-size: 11px;
}
.sku-default-cogs-save, .sku-default-cogs-cancel {
  border: none; border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer;
}
.sku-default-cogs-save { background: var(--primary); color: #fff; }
.sku-default-cogs-cancel { background: var(--bg); color: var(--muted); border: 1px solid var(--outline-faint); }

.sku-tbl-wrap {
  background: var(--surface); border-radius: var(--r); border: 1px solid var(--outline-faint);
  box-shadow: var(--sh1); overflow: hidden; overflow-x: auto;
}
.sku-pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 12px 0 18px;
}
.sku-page-btn {
  height: 30px; padding: 0 14px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--outline); border-radius: 6px; background: var(--surface);
  color: var(--on-s2); cursor: pointer; transition: background .15s, color .15s;
}
.sku-page-btn:hover:not(:disabled) { background: var(--primary-tonal); color: var(--primary); border-color: var(--primary); }
.sku-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.sku-page-info { font-size: 12px; color: var(--muted); font-weight: 600; }
.sku-rank { color: var(--faint); font-size: 10px; font-weight: 700; }
/* SKU code + Active/Inactive pill on one line, under the name — mock's
   .sku-id-line/.sku-active. */
.sku-id-line { font-size: 9.5px; color: var(--faint); font-weight: 500; letter-spacing: .03em; display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.sku-active, .sku-inactive { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 8.5px; font-weight: 700; letter-spacing: .05em; margin-left: 4px; }
.sku-active { background: var(--success-tonal); color: var(--success-on); }
.sku-inactive { background: var(--bg); color: var(--muted); }
.sku-multich-lbl { font-size: 9px; color: var(--primary); font-weight: 600; margin-top: 2px; }
/* Cell content — the mock's inline sizes from its renderSkuTable. Scoped
   to .sku-table so the shared .val/.units used on other pages keep their
   larger sizing. */
.sku-table th { color: var(--faint); }
.sku-table td.sku-rank { font-size: 10px; }
.sku-table .prod-name-link { font-size: 12px; line-height: normal; }
.sku-table .val { font-size: 11.5px; font-weight: 600; }
.sku-table .units { font-size: 9px; font-weight: 400; color: var(--faint); margin-top: 0; }
.sku-table .units--gross { font-size: 10px; }
.sku-table .mp-cm-pill { padding: 2px 7px; border-radius: 4px; }
/* Mock's copy control is a 9px glyph; the shared 20px button inflates the
   name cell (and so every row) by ~6px. */
.sku-table .copy-icon-btn { width: 14px; height: 14px; }
.sku-table .copy-icon-btn svg { width: 10px; height: 10px; }

/* "Return leakers" panel — matches the mock's own renderLeakers() exactly:
   a name + proportional bar, rate, and units-lost column, top 8 by return
   rate. Replaces this page's old Margin Distribution donut + generic
   returns table, neither of which the mock has. */
.sku-leakers-panel { max-width: 680px; }
.sku-leaker-hd, .sku-leaker-row {
  display: grid; grid-template-columns: 1fr 52px 54px; gap: 4px 10px; align-items: center;
}
.sku-leaker-hd {
  font-size: 9.5px; font-weight: 700; color: var(--faint); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px;
}
.sku-leaker-row { padding: 6px 0; border-top: 1px solid var(--outline-faint); }
.sku-leaker-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sku-leaker-bar-wrap { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.sku-leaker-bar { height: 100%; border-radius: 2px; }
.sku-leaker-rate { font-weight: 800; font-size: 12px; text-align: right; }
.sku-leaker-lost { color: var(--muted); font-size: 11px; text-align: right; }

@media (max-width: 860px) {
  .mp-heroes { grid-template-columns: 1fr; }
  .geo-map-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════
   LXYA — COMMAND CENTER design system
   Skins the shell + Overview to the Command Center
   preview. Reused page-by-page by the other views.
   ════════════════════════════════════════════════════ */

/* ── Shell: light gradient sidebar ── */
.nav-drawer {
  --sidebar-w: 224px;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--outline-faint);
  position: relative;
  z-index: 30;
}
.nav-header {
  padding: 18px 18px 14px;
  height: auto;
  border-bottom: 1px solid var(--outline-faint);
  gap: 11px;
}
.nav-brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--primary);
}
.nav-brand-sub {
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 2px;
}
.sb-label {
  padding: 8px 13px 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav-items { padding: 0; gap: 0; }
.nav-item {
  height: auto;
  padding: 7px 13px;
  margin: 1px 7px;
  border-radius: 7px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--muted);
}
.nav-item:hover { background: var(--primary-tonal); color: var(--primary); }
.nav-item.active {
  background: var(--primary-tonal);
  color: var(--primary);
  font-weight: 600;
}
.nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  background: rgba(219, 39, 119, .12);
  color: var(--pink, #db2777);
  font-size: 11px;
  font-weight: 800;
  min-width: auto;
  height: auto;
  padding: 2px 8px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-badge--warn { background: rgba(217, 119, 6, .12); color: var(--warn-on); }
.nav-badge--alert { background: rgba(219, 39, 119, .12); color: var(--pink, #db2777); }
.nav-badge:empty, .nav-badge[data-badge-for] { }
.nav-foot-user {
  display: flex; align-items: center; gap: 8px;
}
.nav-foot-user .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: 11px;
  display: grid; place-items: center; flex-shrink: 0;
}
.nav-foot-user b { color: var(--ink); font-size: 12px; display: block; }
.nav-foot-user small { color: var(--faint); font-size: 11px; }
.nav-footer {
  padding: 12px;
  border-top: 1px solid var(--outline-faint);
  background: transparent;
  display: flex; flex-direction: column; gap: 12px;
}
/* ── Shell: top bar ── */
.top-bar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-faint);
  padding: 0 20px 0 24px;
  position: sticky; top: 0; z-index: 20;
}
/* Mock's topbar is just [title] [data-period] [channel select] — no LIVE
   tag, alert-summary chips, Board/Flow mode toggle, or search bar. Hidden
   here rather than removed from the markup/JS so the underlying features
   (Flow mode, AI ask, the alert chips) stay one CSS rule away from coming
   back if that's ever wanted again. */
.live-tag, .tb-chips, .mode-pills-wrap, .ai-ask-wrap { display: none !important; }
.tb-title {
  font-family: var(--font-disp);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: none;
  min-width: 120px;
}
.live-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(5, 150, 105, .1);
  border: 1px solid rgba(5, 150, 105, .25);
  color: var(--success);
  font-size: 11px; font-weight: 800; letter-spacing: .6px;
  padding: 5px 12px; border-radius: 100px;
  flex-shrink: 0;
}
.live-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: lxyaPulse 1.8s infinite; }
@keyframes lxyaPulse { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .4); } 70% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }
.tb-chips .tb-chip {
  border-radius: 100px;
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 14px;
}
.tb-chip--warn { background: rgba(217, 119, 6, .1); border: 1px solid rgba(217, 119, 6, .28); color: var(--warn-on); }
.tb-chip--error { background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .3); color: #b91c1c; }
.tb-chip--ok { background: rgba(5, 150, 105, .1); border: 1px solid rgba(5, 150, 105, .3); color: #047857; }
.tb-chip .dot { width: 7px; height: 7px; }

.period-chip {
  padding: 3px 9px;
  height: auto;
  border: 1px solid var(--outline);
  border-radius: 5px;
  font-weight: 500;
  font-size: 11px;
  color: var(--faint);
  background: var(--bg);
}
.period-chip strong, .period-chip #period-label, .period-chip.range-active #range-label { color: var(--muted); font-weight: 600; }
.period-chip.range-active { border-color: var(--primary); background: var(--primary-tonal); }
.period-dropdown { border-radius: 12px; padding: 6px; }
.period-item { padding: 8px 12px; border-radius: 9px; font-size: 12.5px; }
.period-item.active { background: var(--primary-tonal); color: var(--primary); font-weight: 700; }

.avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 13px; font-weight: 800;
}

.scroll { padding: 0; }
#view-container { max-width: 1440px; padding: 20px 24px; }

/* ── Common filter chip (Channels) ── */
.filter-wrap { position: relative; margin: 0 4px; }
.filter-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--outline);
  border-radius: 6px; padding: 4px 10px;
  font-weight: 600; font-size: 11.5px; color: var(--muted);
  cursor: pointer; transition: border-color .15s;
}
.filter-chip:hover { border-color: var(--primary-tone); }
.filter-chip .f-label { color: var(--faint); font-weight: 700; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.filter-chip .arrow { margin-left: 2px; color: var(--faint); font-size: 10px; transition: transform .15s; }
.filter-chip.open .arrow { transform: rotate(180deg); }
.filter-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 190px; background: var(--surface);
  border: 1px solid var(--outline-faint); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(18, 16, 32, .16);
  display: none; z-index: 55; padding: 6px; max-height: 330px; overflow-y: auto;
}
.filter-dropdown.open { display: block; }
.filter-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--on-s2);
  cursor: pointer;
}
.filter-item:hover { background: var(--bg); }
.filter-item.active { background: var(--primary-tonal); color: var(--primary); font-weight: 700; }
.filter-item .sw { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--primary); }
.filter-item .f-check { margin-left: auto; color: var(--primary); font-size: 12px; }

/* ── View title ── */
.view-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.view-title h2 { font-family: var(--font-disp); font-size: 20px; font-weight: 600; letter-spacing: -.3px; color: var(--ink); }
.view-title .sub { color: var(--muted); font-size: 13px; }
.view-title .secnum { font-family: var(--font-disp); font-size: 12px; color: var(--primary); font-weight: 600; letter-spacing: 1px; }

/* ── Objective banner (goal cockpit) ── */
.objective {
  margin-bottom: 16px;
  border-radius: var(--rl);
  padding: 18px 22px;
  position: relative; overflow: hidden;
  border: 1px solid var(--outline-faint);
  background: #ffffff;
  box-shadow: var(--sh1);
}
.objective::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(480px 180px at 12% -40%, rgba(124, 58, 237, .12), transparent 60%),
    radial-gradient(420px 160px at 90% -50%, rgba(8, 145, 178, .1), transparent 60%);
}
.obj-row { position: relative; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.obj-label { display: flex; align-items: center; gap: 10px; }
.obj-label .oc {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; font-size: 19px; flex-shrink: 0;
}
.obj-label small {
  display: block; color: var(--faint); font-size: 10.5px;
  font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
}
.obj-label h3 { font-family: var(--font-disp); font-size: 17px; font-weight: 600; color: var(--ink); }
.obj-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.obj-stat {
  background: #fafbff; border: 1px solid var(--outline-faint);
  border-radius: 12px; padding: 9px 16px; min-width: 118px;
}
.obj-stat small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; }
.obj-stat b { font-family: var(--font-disp); font-size: 16px; color: var(--ink); display: block; margin-top: 1px; font-variant-numeric: tabular-nums; }
.obj-stat em { font-style: normal; font-size: 11.5px; font-weight: 800; }
.obj-stat em.up { color: var(--success); }
.obj-stat em.bad { color: var(--error); }
.obj-conf { margin-left: auto; text-align: right; }
.obj-conf small { display: block; color: var(--faint); font-size: 10.5px; letter-spacing: .6px; }
.obj-conf b { font-family: var(--font-disp); font-size: 13px; font-weight: 700; display: block; margin-top: 2px; }
.obj-conf b.up { color: var(--success); }
.obj-conf b.bad { color: var(--error); }

/* ── Agent ticker ── */
.ticker {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; overflow: hidden;
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px;
  color: var(--faint); text-transform: uppercase;
}
.ticker .seg { display: flex; align-items: center; gap: 10px; }
.ticker .dotline { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.ticker .arrow { color: var(--primary); }
.ticker .live { color: var(--accent); margin-left: auto; }

/* ── KPI cards ── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-radius: var(--r);
  padding: 17px 19px;
  box-shadow: var(--sh2);
  position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--primary), var(--accent)); }
.kpi small { color: var(--faint); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-family: var(--font-disp); font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; font-weight: 700; margin-top: 6px; color: var(--success); }
.kpi .d.down { color: var(--error); }
.kpi .d .del { color: var(--faint); font-weight: 600; text-decoration: line-through; margin-right: 6px; font-size: 11.5px; }

/* Existing .kpi-card restyled into the same system (used by older views) */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-radius: var(--r);
  padding: 17px 19px;
  box-shadow: var(--sh2);
  position: relative; overflow: hidden;
  border-top: none;
}
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--primary), var(--accent)); }
.kpi-card--err::before { background: linear-gradient(180deg, var(--error), #f87171); }
.kpi-card--warn::before { background: linear-gradient(180deg, var(--warn), #fbbf24); }
.kpi-card--ok::before { background: linear-gradient(180deg, var(--success), #34d399); }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--faint); text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.kpi-val { font-family: var(--font-disp); font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; font-weight: 700; margin-top: 4px; }
.kpi-sub--up { color: var(--success); }
.kpi-sub--down { color: var(--error); }

/* ── Panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-radius: var(--r);
  box-shadow: var(--sh1);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px 10px; border-bottom: 1px solid var(--outline-faint); }
.panel-head h3 { font-size: 13px; font-weight: 700; color: var(--ink); }
.panel-head .agent-mini {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-disp); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; color: #7a4feb; background: #f3eefe;
  padding: 3px 9px; border-radius: 100px; text-transform: uppercase;
  white-space: nowrap;
}
.panel-head .agent-mini i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); display: inline-block; }
.panel-head .spacer { flex: 1; }
.panel-head .hint { color: var(--faint); font-size: 12px; font-weight: 500; }
.panel-body { padding: 12px 14px; }
.panel-body.flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1.1fr; gap: 14px; margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-3 .panel-head { flex-wrap: wrap; row-gap: 6px; }
.grid-3 .panel-head h3 { order: 2; flex-basis: 100%; }
.grid-3 .panel-head .spacer { order: 1; flex: 1; }
.grid-3 .panel-head .hint { order: 1; white-space: nowrap; }
.grid-3 .donut { width: 156px; height: 156px; }
.grid-3 .donut::before { inset: 19px; }
.grid-3 .donut .in b { font-size: 18px; white-space: nowrap; }
.grid-3 .donut-wrap { gap: 14px; align-items: stretch; }
.grid-3 .cost-mix { gap: 14px; }
.grid-3 .dlist { min-width: 0; flex: 1; }
.grid-3 .dlist .drow { padding: 4px 6px; margin: -4px -6px; }
.grid-3 .dlist .drow b { min-width: 0; white-space: normal; line-height: 1.25; }
.grid-3 .dlist .drow > span { margin-left: auto; white-space: nowrap; }

/* ── Overview: paired KPI cards ── */
.kpi-row--paired { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi-pair {
  background: var(--surface); border: 1px solid var(--outline-faint); border-radius: var(--r);
  box-shadow: var(--sh2); overflow: hidden; position: relative;
}
/* Accent bar marks a card, not a value — flat, matching the reference
   mock's convention; status (up/down) is carried by the delta pill below,
   not this bar. */
.kpi-pair::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--primary); }
.kpi-pair-inner { display: grid; grid-template-columns: 1fr 1fr; }
.kpi-pair-cell { padding: 13px 15px; display: flex; flex-direction: column; gap: 5px; }
.kpi-pair-cell:first-child { border-right: 1px solid var(--outline-faint); }
.kpi-pair-cell small { color: var(--faint); font-weight: 600; font-size: 10px; text-transform: uppercase; display: flex; align-items: center; gap: 5px; line-height: 1.3; }
.kpi-pair-cell .v { font-family: var(--font-disp); font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-pair-cell .d {
  font-size: 10px; font-weight: 700; margin-top: 2px; width: fit-content;
  padding: 2px 6px; border-radius: 5px; background: var(--success-tonal); color: var(--success-on);
}
.kpi-pair-cell .d.down { background: var(--error-tonal); color: var(--error-on); }
.kpi-pair-cell .d.d--neutral { background: var(--bg); color: var(--faint); }
@media (max-width: 900px) { .kpi-row--paired { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .kpi-row--paired { grid-template-columns: 1fr; } }

/* ── Overview: revenue waterfall + channel scorecard sit side by side in
   .ov-econ-row (.row2 in the mock) — sizing here matches the mock's own
   .card-body padding exactly (14px 18px vs the app-wide .panel-body's
   12px 14px default); everything else in this row already inherits the
   shared .panel/.panel-head defaults, which already equal the mock's
   .card/.card-header. The mock itself does nothing special to equalize
   the two cards' heights beyond .row2's own grid stretch — no forced
   content-fill here either. */
.ov-econ-row .panel-body { padding: 14px 18px; }

/* ── Overview: revenue waterfall (mock: .waterfall/.wf-item/etc., same values) ── */
.waterfall { display: flex; flex-direction: column; gap: 7px; }
.wf-item { display: flex; align-items: center; gap: 10px; }
.wf-label { width: 120px; color: var(--muted); font-weight: 500; flex-shrink: 0; font-size: 11.5px; }
.wf-bar-wrap { flex: 1; height: 20px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.wf-bar { height: 100%; border-radius: 5px; transition: width .3s; }
.wf-value { width: 62px; text-align: right; font-weight: 700; font-size: 12px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.wf-divider { height: 1px; background: var(--outline-faint); margin: 3px 0; }

/* ── Shared channel logo badge (BN.channelLogoHtml, frontend/js/app.js) ── */
.ch-logo {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; line-height: 1;
}
.ch-logo svg { width: 62%; height: 62%; display: block; }
.ch-logo--letter { color: #fff; font-weight: 800; font-family: var(--font-disp); }
/* Real brand icon files (frontend/assets/icons/) — transparent marks on a
   neutral white badge, not a colored square like the letter fallback.
   Padding is computed in JS (BN.channelLogoHtml) from the badge's own
   sizePx, not a CSS percentage — a padding percentage resolves against
   the *parent's* width, not this fixed-size badge's own, so it wouldn't
   scale correctly with sizePx. */
.ch-logo--icon { background: #fff; border: 1px solid var(--outline-faint); box-sizing: border-box; }
.ch-logo--icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Overview: channel scorecard table ── */
/* Deliberately its own width rules, not .mp-compare-table (that class
   carries a 600px min-width sized for Marketplaces' own 8-column table —
   inside this panel's grid-2 half-width column that min-width pushed the
   Net Margin cell past the panel's own overflow:hidden edge, clipping it
   instead of scrolling; this table only ever has 3 columns and fits
   naturally without a forced minimum). */
/* Values below match the mock's .ch-table exactly (td padding:9px 0,
   border-top divider, th padding:0 0 9px). */
.ch-sc-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
/* .panel td (below) is a generic rule with the SAME specificity
   (.panel td vs .ch-sc-table td) — being later in the file, it was
   silently winning the cascade over this and forcing 13px/16px padding
   regardless of what's set here. Prefixed with .panel to raise specificity
   above it for real, instead of relying on file order. */
.panel .ch-sc-table td { padding: 9px 0; border-top: 1px solid var(--outline-faint); border-bottom: none; font-size: inherit; }
.panel .ch-sc-table th { padding: 0 0 9px; border-bottom: none; font-size: inherit; }
.ch-sc-table th:first-child, .ch-sc-table td:first-child { width: 34%; }
.ch-sc-th-hint {
  display: block; font-size: 9px; font-weight: 500; text-transform: none;
  letter-spacing: 0; color: var(--faint); white-space: nowrap; margin-top: 2px;
}
.ch-sc-name { display: flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; }
.ch-sc-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-sc-margin-wrap { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ch-sc-margin-bar { width: 48px; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.ch-sc-margin-fill { height: 100%; border-radius: 3px; }
.ch-sc-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.ch-sc-tag--good { background: var(--success-tonal, #ecfdf5); color: var(--success); }
.ch-sc-tag--warn { background: var(--warn-tonal, #fffbeb); color: var(--warn); }
.ch-sc-tag--bad { background: var(--error-tonal, #fef2f2); color: var(--error); }
/* Light tint + ink text, no heavy saturated border — matches the palette's
   own light/ink pairing convention (used throughout for status), just
   applied consistently here instead of a solid-color border+text combo. */
.ch-sc-insight {
  margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5;
  background: var(--error-tonal, #fef2f2); color: var(--error-on, #b91c1c);
}
/* A known channel with zero uploaded files yet — shown alongside connected
   channels rather than only listing ones with real data, so the seller
   sees the full marketplace picture and a direct way to close the gap. */
.ch-sc-row--connect { opacity: .85; }
.ch-sc-row--connect .ch-sc-name { color: var(--muted); }
/* .btn's base height:38px is fixed and wins over .btn--sm's padding alone
   (padding can't shrink a button below an explicit height), so the Connect
   row was rendering much taller than a plain data row. Overridden here,
   scoped to this button only — not .btn/.btn--sm globally, which are
   shared by buttons all over the app. */
.ch-sc-connect-btn { cursor: pointer; height: 26px; padding: 0 10px; font-size: 11px; }
/* Same .btn base-height override as .ch-sc-connect-btn above, applied to
   the Marketplaces page's own Connect button so both pages render it at
   the identical compact size instead of the taller shared .btn default. */
.mp-connect-btn { cursor: pointer; height: 26px; padding: 0 10px; font-size: 11px; }
.ch-sc-waterfall-note {
  margin-top: 8px; padding: 8px 10px; border-radius: 7px; font-size: 11px; line-height: 1;
  background: var(--primary-tonal); color: var(--primary-dark);
}

/* ── Overview: Growth Opportunities (Recommendation Engine output) ── */
.growth-opp-panel { margin-bottom: 18px; }

/* Overview card — summary rows only (count + total impact), each one a
   link into the full /growth page where the SKU-level detail lives. */
.growth-opp-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--outline-faint); text-decoration: none; color: inherit; }
.growth-opp-item:first-child { border-top: none; padding-top: 2px; }
.growth-opp-item--link { cursor: pointer; }
.growth-opp-item--link:hover .growth-opp-agent { color: var(--primary); }
.growth-opp-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.growth-opp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.growth-opp-agent { font-size: 12px; font-weight: 700; color: var(--on-s); }
.growth-opp-text { font-size: 11px; color: var(--on-s2); line-height: 1.4; }
.growth-opp-sub { font-size: 10.5px; color: var(--muted); }
.growth-opp-cp { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Dedicated /growth tab — level 1: clickable summary cards. */
.growth-group { margin-bottom: 10px; }
.growth-summary-card {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--outline-faint); border-radius: var(--r);
  cursor: pointer; text-align: left; font: inherit; transition: box-shadow .12s, border-color .12s;
}
.growth-summary-card:hover { box-shadow: var(--sh1); border-color: var(--outline); }
.growth-summary-card--open { border-radius: var(--r) var(--r) 0 0; border-bottom-color: transparent; }
.growth-summary-icon { font-size: 19px; flex-shrink: 0; width: 26px; text-align: center; }
.growth-summary-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.growth-summary-label { font-size: 13px; font-weight: 700; color: var(--on-s); }
.growth-summary-text { font-size: 11.5px; color: var(--on-s2); line-height: 1.4; }
.growth-summary-sub { font-size: 11px; color: var(--muted); }
.growth-summary-cp { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.growth-summary-chevron { font-size: 11px; color: var(--faint); flex-shrink: 0; width: 14px; text-align: center; }

/* Level 2: SKU-level detail, revealed only once its summary card is
   clicked — same ao-card visual language the Alerts page already uses. */
.growth-detail { padding: 10px; border: 1px solid var(--outline-faint); border-top: none; border-radius: 0 0 var(--r) var(--r); background: var(--surface-2); }
.growth-detail .ao-card { margin-bottom: 8px; background: var(--surface); }
.growth-detail .ao-card:last-child { margin-bottom: 0; }

/* Per-agent on-demand run — see growth.js's wireGrowthRegenerate */
.btn-regenerate {
  font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 99px;
  background: var(--surface); color: var(--primary); border: 1px solid var(--outline);
  cursor: pointer; transition: background .12s, border-color .12s; white-space: nowrap;
}
.btn-regenerate:hover { background: var(--primary-tonal); border-color: var(--primary); }
.btn-regenerate:disabled { opacity: .6; cursor: default; }

/* ── Overview: SKU performance ── */
.sku-pills-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sku-pills-row .sku-pills { margin-bottom: 0; }
.sku-view-all { font-size: 11px; font-weight: 600; color: var(--primary); white-space: nowrap; text-decoration: none; }
.sku-view-all:hover { text-decoration: underline; }
.sku-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sku-pill {
  padding: 5px 13px; border-radius: 99px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--outline-faint); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.sku-pill:hover { border-color: var(--primary); color: var(--primary); }
.sku-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sku-pill-count { opacity: .75; }
.sku-fps { margin-bottom: 14px; }
/* Single full-width bordered list with its own header row — matches the
   mock's Overview-tab .sku-list/.sku-list-hd exactly (no side-by-side
   chart there; that's specific to the mock's separate SKU tab). */
.sku-perf-list { border: 1px solid var(--outline-faint); border-radius: 8px; overflow: hidden; overflow-x: auto; }
.sku-perf-list-hd {
  display: grid; grid-template-columns: 20px 1.3fr 0.8fr 50px 66px 70px 72px 74px; gap: 0 8px;
  padding: 7px 12px; background: var(--bg); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--faint);
  border-bottom: 1px solid var(--outline-faint); white-space: nowrap;
}
.sku-perf-list-hd .sku-col-r, .sku-col-r { text-align: right; }
.sku-perf-item {
  display: grid; grid-template-columns: 20px 1.3fr 0.8fr 50px 66px 70px 72px 74px; gap: 0 8px; align-items: center;
  padding: 9px 12px; border-top: 1px solid var(--outline-faint);
  cursor: pointer; transition: background .12s;
}
.sku-perf-item:hover { background: var(--bg); }
.sku-perf-item.neg { background: var(--error-tonal, #fef2f2); }
.sku-perf-rank { font-size: 10px; font-weight: 800; color: var(--faint); text-align: center; }
.sku-perf-name { display: flex; flex-direction: column; gap: 2px; justify-content: center; min-width: 0; }
.sku-perf-name .sku-code-row { margin-bottom: 0; }
.sku-perf-name-text { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sku-perf-ch { display: flex; align-items: center; gap: 4px; min-width: 0; }

/* ── Geo Intelligence (Marketplace page, Amazon only) ── */
.geo-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 8px; margin-bottom: 14px; width: fit-content; }
.geo-tab {
  padding: 6px 14px; border: none; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; background: transparent; color: var(--faint); transition: all .15s;
}
.geo-tab.active { background: var(--surface); box-shadow: var(--sh1); color: var(--primary); }
.geo-legend { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 11.5px; color: var(--faint); }
.geo-legend-label { font-weight: 600; color: var(--on-s2); }
.geo-legend-gradient {
  width: 90px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(124,58,237,.25), rgba(124,58,237,.85));
}
.geo-legend-endpoints { display: flex; justify-content: space-between; width: 60px; }
.geo-legend-note { color: var(--faint); font-size: 10.5px; }
.geo-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.geo-legend-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.geo-map-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.geo-map-wrap { position: relative; }
.geo-india-svg { width: 100%; max-width: 340px; display: block; margin: 0 auto; }
.geo-state-path { cursor: pointer; transition: opacity .15s; }
.geo-state-path:hover { opacity: .8; }
.geo-state-path--empty { cursor: default; }
.geo-state-path--empty:hover { opacity: 1; }
.geo-bubble-dot { cursor: pointer; transition: opacity .15s, fill-opacity .15s; }
.geo-bubble-dot:hover { fill-opacity: .8; }
.geo-tooltip {
  position: absolute; display: none; z-index: 20; pointer-events: none; white-space: nowrap;
  background: var(--ink); color: #fff; padding: 8px 11px; border-radius: 8px;
  font-size: 11.5px; box-shadow: var(--sh2);
}
.geo-tooltip-title { font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.geo-tooltip-body { line-height: 1.7; color: #d8d0f5; }
.geo-tooltip-body b { color: #fff; }
.geo-list-wrap { min-width: 0; }
.geo-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 12.5px; }
.geo-row-name { width: 130px; flex-shrink: 0; font-weight: 600; color: var(--on-s2); }
.geo-bar-wrap { flex: 1; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.geo-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.geo-pct { width: 55px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.geo-orders { width: 90px; text-align: right; color: var(--faint); font-size: 11.5px; }
.geo-expand-btn {
  display: block; width: 100%; margin-top: 8px; padding: 7px; text-align: center;
  border: 1px dashed var(--outline); border-radius: 8px; background: transparent;
  color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .12s;
}
.geo-expand-btn:hover { background: var(--bg); }
.geo-insight {
  margin-top: 12px; padding: 10px 12px; background: var(--warn-tonal, #fff4d6);
  border: 1px solid var(--warn, #e6b800); border-radius: 8px; font-size: 12px; line-height: 1.5; color: var(--on-s2);
}
.geo-row[data-geo-row-state] { cursor: pointer; border-radius: 6px; transition: background .12s; }
.geo-row[data-geo-row-state]:hover { background: var(--bg); }
.geo-drilldown { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--outline-faint); }
.geo-drilldown-hdr {
  display: flex; align-items: center; justify-content: space-between; font-size: 13px;
  color: var(--on-s2); margin-bottom: 10px;
}
.geo-drilldown-close {
  border: none; background: transparent; font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--faint); padding: 2px 6px;
}
.geo-drilldown-close:hover { color: var(--on-s2); }
.geo-drilldown-loading, .geo-drilldown-empty { font-size: 12.5px; color: var(--faint); padding: 8px 0; }
.geo-drilldown-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.geo-drilldown-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--faint); padding: 6px 10px; border-bottom: 1px solid var(--outline-faint);
}
.geo-drilldown-table td { padding: 7px 10px; border-bottom: 1px solid var(--outline-faint); font-variant-numeric: tabular-nums; }

/* ── Tables ── */
.panel table, .panel .mc-card table { border-collapse: collapse; }
.panel th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--faint); font-weight: 700;
  padding: 11px 16px; border-bottom: 1px solid var(--outline-faint);
  background: #fafaff;
}
.panel td { padding: 13px 16px; border-bottom: 1px solid var(--outline-faint); font-size: 13px; vertical-align: middle; }
.panel tr:last-child td { border-bottom: none; }
.panel tr:hover td { background: #fafbff; }
.tnum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--success); font-weight: 700; }
.neg { color: var(--error); font-weight: 700; }

/* ── Pills / thumbs / chevrons / sub-rows ── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 100px; white-space: nowrap; }
.pill.ok { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.pill.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pill.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pill.mut { background: #f1f1f7; color: var(--faint); border: 1px solid var(--outline-faint); }
.sku { display: flex; align-items: center; gap: 12px; }
.sku .thumb {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #f3eefe, #e0f2fe);
  border: 1px solid var(--outline-faint);
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
}
.sku b { display: block; font-size: 13.5px; color: var(--ink); }
.sku small { color: var(--faint); font-size: 12px; }
.chev { color: #c0c4dd; font-size: 12px; cursor: pointer; transition: transform .2s; display: inline-block; }
.chev.open { transform: rotate(90deg); }
tr.sub-row td { background: #fafaff; padding: 0; }
.sub-inner { padding: 14px 30px 18px; display: none; }
.sub-inner.open { display: block; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.mini-stats .ms { background: #fff; border: 1px solid var(--outline-faint); border-radius: 10px; padding: 12px 14px; }
.mini-stats .ms small { color: var(--faint); font-size: 11.5px; }
.mini-stats .ms b { font-size: 16px; display: block; margin-top: 2px; font-family: var(--font-disp); color: var(--ink); font-variant-numeric: tabular-nums; }

.channel-skus-breakdown { margin-bottom: 14px; border: 1px solid var(--outline-faint); border-radius: 10px; overflow: hidden; background: #fff; }
.channel-skus-breakdown-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); padding: 10px 14px 8px;
}
.channel-skus-breakdown .mp-compare-table { width: 100%; }
.channel-skus-breakdown tr.clickable { cursor: pointer; }
.channel-skus-breakdown tr.clickable:hover { background: var(--bg); }
.channel-name-cell { display: inline-flex; align-items: center; gap: 7px; }
.channel-name-link { color: var(--primary); text-decoration: none; }
.channel-name-link:hover { text-decoration: underline; }
.channel-name-link::after { content: "↗"; font-size: 10px; margin-left: 2px; color: var(--faint); }

/* ── Bars ── */
.grid-3 .panel-body { position: relative; }
.bars-chart { display: flex; gap: 10px; padding-top: 16px; position: relative; }
.bars-y { position: relative; width: 48px; height: 150px; flex-shrink: 0; border-right: 1px solid var(--outline); }
.bars-y span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars-plot { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bars {
  position: relative; height: 132px; overflow: visible;
  display: flex; align-items: flex-end; gap: 12px;
  background-image: linear-gradient(to top, rgba(124, 58, 237, .12) 1px, transparent 1px);
  background-size: 100% 25%;
  border-bottom: 1px solid var(--outline);
}
.bars .col-wrap { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bars .pair { display: flex; align-items: flex-end; gap: 6px; }
.bars-labels { display: flex; gap: 12px; margin-top: 8px; }
.bars-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--faint); font-weight: 600; }
.bars .bar {
  width: 34px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--primary), #7c3aed);
  transition: height .2s, filter .15s;
  cursor: pointer; position: relative;
}
.bars .bar.alt { background: linear-gradient(180deg, #c7b6fa, #9d87f2); }
.bars .bar:hover { filter: brightness(1.05); }
.bars.sel-one .bar { opacity: .25; }
.bars.sel-one .bar.sel { opacity: 1; box-shadow: 0 2px 10px rgba(124, 58, 237, .35); }
.bars .bar i {
  position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-style: normal; font-size: 10px; color: var(--faint); white-space: nowrap; pointer-events: none;
}
.legend { display: flex; gap: 20px; justify-content: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── Donut ── */
.donut-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.donut-wrap .donut { align-self: center; }
.donut {
  position: relative; width: 170px; height: 170px; border-radius: 50%;
  flex-shrink: 0;
}
.donut::before { content: ""; position: absolute; inset: 20px; border-radius: 50%; background: #fff; pointer-events: none; }
.donut svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.donut svg path { cursor: pointer; stroke: #fff; stroke-width: 2; transition: opacity .15s, filter .15s; }
.donut svg.dim path { opacity: .28; }
.donut svg.dim path.sel { opacity: 1; }
.donut .in { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut .in b { font-family: var(--font-disp); font-size: 26px; letter-spacing: -1px; color: var(--ink); }
.donut .in small { display: block; color: var(--faint); font-size: 12px; }
.dlist { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
.dlist .drow { display: flex; align-items: center; gap: 10px; }
.dlist .drow { cursor: pointer; border-radius: 8px; padding: 4px 8px; margin: -4px -8px; transition: opacity .15s, background .15s; }
.dlist .drow:hover { background: #f6f4ff; }
.dlist.sel-one .drow { opacity: .35; }
.dlist.sel-one .drow.sel { opacity: 1; background: #f6f4ff; }
.dlist .sw { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.cost-mix { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.cost-mix .donut { align-self: center; }
.dlist b { font-size: 13.5px; flex: 1; color: var(--ink); }
.dlist span { color: var(--faint); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── Agent diagnosis rows ── */
.diag {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-left: 3px solid var(--primary);
  background: #fafaff; border-radius: 0 10px 10px 0; margin-bottom: 10px;
}
.diag.cyan { border-left-color: var(--accent); background: #f2fcff; }
.diag.amber { border-left-color: var(--warn); background: #fffaf0; }
.diag .d-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; background: #f3eefe; }
.diag.cyan .d-ic { background: #e0f7fe; }
.diag.amber .d-ic { background: #fef3c7; }
.diag b { font-size: 13.5px; display: block; color: var(--ink); }
.diag small { color: var(--faint); font-size: 12px; }
.diag .d-impact { margin-left: auto; font-family: var(--font-disp); font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; text-align: right; }
.diag .d-impact .tag { display: block; text-align: right; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--primary); }
.diag.cyan .d-impact .tag { color: var(--accent); }
.diag.amber .d-impact .tag { color: #b45309; }

/* ── Alerts list ── */
.alert { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--outline-faint); align-items: flex-start; }
.alert:last-child { border-bottom: none; }
.alert .aic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.alert.err .aic { background: #fef2f2; }
.alert.warn .aic { background: #fffbeb; }
.alert.ok .aic { background: #ecfdf5; }
.alert b { font-size: 14px; color: var(--ink); display: block; }
.alert p { color: var(--faint); font-size: 13px; margin-top: 2px; }
.alert .aact { margin-left: auto; flex-shrink: 0; text-align: right; }
.alert .impact { font-size: 12.5px; font-weight: 800; color: var(--error); white-space: nowrap; }
.alert.warn .impact { color: #b45309; }
.alert .agent-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #7a4feb; margin-top: 4px; }

/* ── Chart.js panels keep working, skinned ── */
.chart-card { background: var(--surface); border: 1px solid var(--outline-faint); border-radius: var(--r); box-shadow: var(--sh2); overflow: hidden; margin-bottom: 20px; }

/* ── Income statement inside a panel ── */
.panel .mc-card { border: none; box-shadow: none; margin: 0; }
.panel .is-card { box-shadow: none; border: none; }

/* ── Buttons (mock alignment) ── */
.btn { border-radius: 9px; font-weight: 700; font-size: 13.5px; }
.btn--primary { background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 6px 16px rgba(124, 58, 237, .3); }
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn--sm { padding: 5px 12px; font-size: 12px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr; }
  .kpi-row, .kpis, .kpi-row.kpi-row--3, .kpi-row.kpi-row--six { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-drawer { transform: translateX(-100%); transition: transform .25s; position: fixed; inset: 0 auto 0 0; height: 100vh; }
  .nav-drawer.open { transform: none; }
  .dashboard .main { margin-left: 0; }
  .live-tag { display: none; }
}
@media (max-width: 640px) {
  .kpi-row, .kpis, .kpi-row.kpi-row--3, .kpi-row.kpi-row--six, .grid-2 { grid-template-columns: 1fr; }
  #view-container { padding: 16px; }
  .obj-stats { margin-left: 0; width: 100%; }
  .obj-conf { display: none; }
  .period-chip span, .filter-chip .f-label { display: none; }
}

/* ═══════════════════════════════════════════════════
   AI ANALYST — contextual chat widget
════════════════════════════════════════════════════ */
.agent-widget { position: fixed; right: 24px; bottom: 24px; z-index: 60; }
.agent-fab {
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: var(--sh3);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.agent-fab svg { width: 24px; height: 24px; }
.agent-fab:hover { transform: translateY(-2px) scale(1.04); }
.agent-fab.active { background: var(--on-s); }

.agent-panel {
  position: absolute; right: 0; bottom: 66px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--outline-faint);
  border-radius: var(--r); box-shadow: var(--sh3);
  display: flex; flex-direction: column; overflow: hidden;
}
.agent-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--outline-faint); flex-shrink: 0;
}
.agent-panel-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.agent-panel-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.agent-panel-name { font-weight: 700; font-size: 14px; color: var(--on-s); }
.agent-panel-sub { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.agent-panel-close {
  border: none; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 4px 6px; border-radius: 6px; flex-shrink: 0;
}
.agent-panel-close:hover { background: var(--bg); color: var(--on-s); }

.agent-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.agent-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.agent-msg--user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 3px; white-space: pre-wrap; }
.agent-msg--assistant { align-self: flex-start; background: var(--bg); color: var(--on-s2); border-bottom-left-radius: 3px; }

/* Markdown rendered inside an assistant bubble (agentMarkdownToHtml) */
.agent-msg--assistant p { margin: 0 0 6px; }
.agent-msg--assistant p:last-child { margin-bottom: 0; }
.agent-msg--assistant ul, .agent-msg--assistant ol { margin: 2px 0 6px; padding-left: 19px; }
.agent-msg--assistant li { margin-bottom: 2px; }
.agent-msg--assistant li:last-child { margin-bottom: 0; }
.agent-msg--assistant strong { font-weight: 700; color: var(--on-s); }
.agent-msg--assistant em { font-style: italic; }
.agent-msg--assistant a { color: var(--primary-dark); text-decoration: underline; }
.agent-msg--assistant code {
  background: var(--surface); border: 1px solid var(--outline-faint); border-radius: 4px;
  padding: 1px 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.agent-msg--assistant .agent-md-h { font-size: 13px; font-weight: 700; color: var(--on-s); margin: 2px 0 4px; }
.agent-code-block {
  background: var(--surface); border: 1px solid var(--outline-faint); border-radius: 8px;
  padding: 8px 10px; overflow-x: auto; margin: 2px 0 6px;
}
.agent-code-block code { background: none; border: none; padding: 0; font-size: 12px; white-space: pre; }
.agent-action-note {
  align-self: center; font-size: 11px; color: var(--faint); background: var(--surface-2);
  border: 1px solid var(--outline-faint); border-radius: 20px; padding: 3px 12px;
}
.agent-msg--typing { display: flex; align-items: center; gap: 4px; padding: 12px; }
.agent-msg--typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--faint);
  animation: agent-bounce 1.2s infinite ease-in-out;
}
.agent-msg--typing span:nth-child(2) { animation-delay: .15s; }
.agent-msg--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes agent-bounce { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.agent-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; flex-shrink: 0; }
.agent-suggestion-chip {
  border: 1px solid var(--outline-faint); background: var(--surface-2); color: var(--on-s2);
  border-radius: 20px; padding: 6px 12px; font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s;
}
.agent-suggestion-chip:hover { background: var(--primary-tonal); border-color: var(--primary); color: var(--primary-dark); }

.agent-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--outline-faint); flex-shrink: 0; }
.agent-input {
  flex: 1; border: 1px solid var(--outline); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; font-family: inherit; background: var(--bg); color: var(--on-s);
}
.agent-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.agent-input:disabled { opacity: .6; }
.agent-send {
  width: 36px; height: 36px; border-radius: 10px; border: none; cursor: pointer; flex-shrink: 0;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
}
.agent-send svg { width: 16px; height: 16px; }
.agent-send:hover { filter: brightness(1.08); }
.agent-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 640px) {
  .agent-widget { right: 16px; bottom: 16px; }
  .agent-panel { width: calc(100vw - 32px); height: calc(100vh - 140px); }
}

/* ═══════════════════════════════════════════════════
   TOP-BAR "ASK ANYTHING" SEARCH BOX
   Hands off to the AI Analyst widget (BN.askAgent) — the panel keeps the
   conversation going afterwards, this is just the first-question shortcut.
════════════════════════════════════════════════════ */
.ai-ask-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--outline);
  border-radius: 10px; padding: 0 12px; height: 38px;
  width: 240px; flex-shrink: 1; min-width: 0;
  transition: border-color .15s, width .15s;
  margin: 0 4px;
}
.ai-ask-wrap:focus-within { border-color: var(--primary-tone); width: 300px; }
.ai-ask-ico { width: 15px; height: 15px; color: var(--faint); flex-shrink: 0; }
.ai-ask-input {
  border: none; outline: none; background: none; flex: 1; min-width: 0;
  font-size: 13px; font-family: inherit; color: var(--on-s);
}
.ai-ask-input::placeholder { color: var(--faint); }

@media (max-width: 980px) {
  .ai-ask-wrap { width: 160px; }
  .ai-ask-wrap:focus-within { width: 200px; }
}
@media (max-width: 780px) {
  .ai-ask-wrap { display: none; }
}

/* ═══════════════════════════════════════════════════
   PROFILE PAGE
════════════════════════════════════════════════════ */
.profile-page { max-width: 880px; }

.profile-hero {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 28px; flex-wrap: wrap;
}
.profile-hero-avatar {
  width: 64px; height: 64px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.profile-hero-meta { flex: 1; min-width: 200px; }
.profile-hero-meta h1 {
  font-family: var(--font-disp); font-size: 20px; font-weight: 700;
  color: var(--on-s); letter-spacing: -.2px;
}
.profile-hero-sub {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12.5px; color: var(--muted);
}
.profile-id-pill {
  background: var(--primary-tonal); color: var(--primary-dark);
  font-weight: 700; font-size: 11.5px; letter-spacing: .2px;
  padding: 4px 10px; border-radius: 100px;
}
.profile-hero-actions { display: flex; gap: 10px; flex-shrink: 0; }

.profile-channel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.profile-channel-card {
  border: 1px solid var(--outline-faint); border-radius: var(--r);
  padding: 16px; background: var(--surface-2);
}
.profile-channel-hdr { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.profile-channel-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.profile-channel-name { font-size: 13.5px; font-weight: 700; color: var(--on-s); }
.profile-channel-acct { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.cred-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-top: 1px solid var(--outline-faint);
  font-size: 12.5px;
}
.cred-row:first-of-type { border-top: none; }
.cred-label { color: var(--muted); width: 96px; flex-shrink: 0; }
.cred-value {
  flex: 1; min-width: 0; color: var(--on-s2); font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cred-eye-btn {
  border: 1px solid var(--outline); background: #fff; color: var(--muted);
  font-size: 11px; font-weight: 700; cursor: pointer;
  border-radius: 100px; padding: 3px 10px; flex-shrink: 0;
}
.cred-eye-btn:hover { border-color: var(--primary-tone); color: var(--primary); }

/* Same masked-with-reveal pattern, adapted for an editable Settings input */
.cred-input-wrap { position: relative; }
.cred-input-wrap .set-input { padding-right: 56px; }
.cred-input-wrap .cred-eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
}

@media (max-width: 640px) {
  .profile-hero { flex-direction: column; align-items: flex-start; }
  .profile-hero-actions { width: 100%; }
  .profile-hero-actions .btn { flex: 1; }
}

/* ═══════════════════════════════════════════════════
   OPS READ-ONLY VIEW BANNER
════════════════════════════════════════════════════ */
.ops-readonly-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff;
  font-size: 12.5px; font-weight: 600; padding: 9px 16px; text-align: center;
  box-shadow: 0 2px 10px rgba(18, 16, 32, .18);
}
.ops-readonly-banner b { font-weight: 800; }
.ops-readonly-banner button {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .4); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: 100px; cursor: pointer;
  flex-shrink: 0;
}
.ops-readonly-banner button:hover { background: rgba(255, 255, 255, .3); }
body.ops-readonly-active { padding-top: 38px; }
@media (max-width: 640px) {
  .ops-readonly-banner { flex-direction: column; gap: 6px; padding: 8px 12px; }
  body.ops-readonly-active { padding-top: 58px; }
}


/* ═══════════════════════════════════════════════════
   LXYA EXTENSION BRIDGE (frontend/js/extension.js)
   Top-bar status pill + dropdown, Sync buttons/links dropped into views as
   placeholders, the Settings extension card and the install modal.
════════════════════════════════════════════════════ */
.ext-pill-wrap { position: relative; margin: 0 6px; flex-shrink: 0; }
.ext-pill-wrap:empty { display: none; }
.ext-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 100px; border: 1px solid var(--outline); background: var(--surface);
  color: var(--on-s2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ext-pill:hover { border-color: var(--primary); color: var(--primary); }
.ext-pill .arrow { font-size: 9px; color: var(--faint); }
.ext-pill--install { border-color: var(--primary); color: var(--primary); background: var(--primary-tonal); }
.ext-pill--warn { border-color: var(--warn); }
.ext-pill-dots { display: inline-flex; gap: 3px; }

.ext-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.ext-dot--ok { background: var(--success); }
.ext-dot--off { background: var(--error); }
.ext-dot--checking { background: var(--warn); animation: ext-pulse 1s ease-in-out infinite; }
.ext-dot--unknown, .ext-dot--none { background: var(--outline); border: 1px solid var(--faint); }
@keyframes ext-pulse { 50% { opacity: .35; } }

.ext-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 120; width: 340px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: 12px; box-shadow: var(--sh2);
  padding: 12px 14px; font-size: 12.5px;
}
.ext-pill-wrap.open .ext-menu { display: block; }
.ext-menu-hdr {
  display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px;
}
.ext-menu-sync { border-top: 1px solid var(--outline-faint); margin-top: 8px; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ext-menu-sync-lbl { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ext-menu-none { font-size: 12px; color: var(--muted); }
.ext-menu-none:empty { display: none; }
.ext-menu-foot { border-top: 1px solid var(--outline-faint); margin-top: 10px; padding-top: 8px; font-size: 11px; color: var(--faint); }
.ext-recheck { font-size: 11px; text-transform: none; letter-spacing: 0; margin-left: auto; }
.ext-recheck[disabled] { opacity: .6; cursor: default; text-decoration: none; }

.ext-mk-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--outline-faint); }
.ext-mk-row:last-of-type { border-bottom: none; }
.ext-mk-meta { flex: 1; min-width: 0; }
.ext-mk-name { font-weight: 700; color: var(--on-s); }
.ext-mk-reports { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-mk-status { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ext-mk-empty { color: var(--muted); padding: 6px 0; }

.ext-note { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.ext-note--warn { color: var(--warn-on); background: var(--warn-tonal); border-radius: 8px; padding: 6px 9px; }

/* Sync controls */
.ext-sync-btn { height: 30px; white-space: nowrap; flex-shrink: 0; }
.ext-sync-btn--busy, .ext-sync-btn[disabled] { opacity: .75; cursor: default; }
.ext-sync-btn--off { color: var(--warn-on); border-color: var(--warn); }
.ext-sync-link { color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: none; }
.ext-sync-link:hover { text-decoration: underline; }
.ext-sync-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 6px;
  border-radius: 50%; color: var(--primary); background: var(--primary-tonal); font-size: 12px; font-weight: 800;
  cursor: pointer; vertical-align: middle;
}
.ext-sync-icon:hover { background: var(--primary); color: #fff; }
.ext-sync-icon--off { color: var(--warn-on); background: var(--warn-tonal); }
.ext-sync-icon--busy { cursor: default; animation: ext-spin 1s linear infinite; }
.ext-spin { display: inline-block; animation: ext-spin 1s linear infinite; }
@keyframes ext-spin { to { transform: rotate(360deg); } }
.ext-install-link { color: var(--primary); font-weight: 700; cursor: pointer; }
.ext-install-link:hover { text-decoration: underline; }

.ext-chip {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 100px;
  font-size: 10px; font-weight: 700; white-space: nowrap; background: var(--outline-faint); color: var(--muted);
}
.ext-chip--ok { background: var(--success-tonal); color: var(--success-on); }
.ext-chip--off { background: var(--warn-tonal); color: var(--warn-on); }

/* Where placeholders sit inside existing views */
.mock-ribbon-ext:empty { display: none; }
.mock-ribbon-ext .ext-sync-link, .mock-ribbon-ext .ext-install-link { color: var(--warn-on); text-decoration: underline; white-space: nowrap; }
.data-nudge-ext { display: flex; justify-content: center; margin: 4px 0 10px; }
.data-nudge-ext:empty { display: none; }
.mp-exp-ext { padding: 12px 16px 0; }
.mp-exp-ext:empty { display: none; }
.upload-coverage-ext { margin: 8px 0 2px; }
.upload-coverage-ext:empty { display: none; }
.ext-pop-sync { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--outline-faint); display: flex; flex-direction: column; gap: 4px; }
.ext-pop-row { display: block; font-size: 12px; }
.ext-pop-row--busy { color: var(--muted); }
.ext-profile-line { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.connect-opt--unsupported { opacity: .55; cursor: not-allowed; }

.ext-install-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 20px 14px;
  padding: 10px 14px; border-radius: 10px; background: var(--primary-tonal); color: var(--primary-dark); font-size: 12.5px; font-weight: 600;
}

/* Settings > Channels extension card */
.ext-card { margin-bottom: 20px; }
.ext-card-body { padding: 4px 20px 16px; }
.ext-card-body--row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ext-card-title { font-weight: 700; color: var(--on-s); margin-bottom: 2px; }
.ext-card-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--outline-faint); margin-bottom: 4px; }

/* Install modal */
.ext-install-modal { max-width: 460px; }
.ext-install-hdr { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.ext-install-ico { font-size: 28px; line-height: 1; }
.ext-install-steps { margin: 0 0 14px 18px; padding: 0; font-size: 13px; color: var(--on-s2); line-height: 1.7; }
.ext-install-status { font-size: 12px; color: var(--muted); min-height: 16px; margin-bottom: 12px; }
.ext-also { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Sync states inside placeholders (queued / running step / failed / done) */
.ext-sync-status {
  display: inline-flex; align-items: center; gap: 5px; max-width: 260px; height: 30px; padding: 0 12px;
  border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--primary-tonal); color: var(--primary-dark); flex-shrink: 0;
}
.ext-sync-status--queued { background: var(--outline-faint); color: var(--muted); }
.ext-sync-status--uploading { background: var(--accent-soft); color: #075985; }
.ext-sync-status--done { background: var(--success-tonal); color: var(--success-on); }
.ext-sync-status--done .ext-spin, .ext-sync-status--queued .ext-spin { animation: none; }
.ext-sync-failed { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ext-sync-failed-msg { font-size: 12px; font-weight: 700; color: var(--error-on); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext-sync-btn--retry { color: var(--error-on); border-color: var(--error); }
.ext-sync-icon--failed { color: var(--error-on); background: var(--error-tonal); }
.ext-sync-icon--done { color: var(--success-on); background: var(--success-tonal); cursor: default; }
.ext-sync-icon--busy:not(.ext-busy--running) { animation: none; color: var(--muted); background: var(--outline-faint); }
.ext-pop-row--done { color: var(--success-on); }
.ext-pop-row--failed { color: var(--error-on); }

/* Per-report sync progress tray (bottom-left of the main area) */
.ext-tray {
  display: none; position: fixed; left: calc(var(--sidebar-w) + 20px); bottom: 20px; z-index: 900; width: 380px;
  max-width: calc(100vw - 40px); background: var(--surface); border: 1px solid var(--outline); border-radius: 14px;
  box-shadow: var(--sh2); overflow: hidden; font-size: 12.5px;
}
.ext-tray.show { display: block; }
@media (max-width: 900px) { .ext-tray { left: 16px; right: 16px; width: auto; } }
.ext-tray-hdr { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--primary-tonal); color: var(--primary-dark); }
.ext-tray-title { font-weight: 800; white-space: nowrap; }
.ext-tray-sum { flex: 1; min-width: 0; font-size: 11px; color: var(--primary-dark); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-tray-btn { border: none; background: none; cursor: pointer; font-size: 14px; color: var(--primary-dark); padding: 0 4px; line-height: 1; }
.ext-tray-body { max-height: 320px; overflow-y: auto; }
.ext-tray-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--outline-faint); }
.ext-tray-meta { flex: 1; min-width: 0; }
.ext-tray-name { font-weight: 700; color: var(--on-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-tray-period { font-weight: 500; color: var(--faint); margin-left: 6px; font-size: 11px; }
.ext-tray-step { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-tray-ico { display: inline-block; width: 16px; }
.ext-tray-step--running, .ext-tray-step--opening { color: var(--primary-dark); }
.ext-tray-step--uploading { color: #075985; }
.ext-tray-step--done { color: var(--success-on); font-weight: 600; }
.ext-tray-step--failed { color: var(--error-on); white-space: normal; }
.ext-tray-bar { height: 3px; border-radius: 3px; background: var(--outline-faint); margin-top: 6px; overflow: hidden; }
.ext-tray-bar span { display: block; height: 100%; width: 0; }
.ext-tray-bar--live span { width: 35%; background: var(--primary); animation: ext-indeterminate 1.4s ease-in-out infinite; }
@keyframes ext-indeterminate { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.ext-row-sync {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500;
  color: var(--muted); white-space: nowrap; line-height: 1.3;
}
.ext-row-sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }
.ext-row-sync-txt { color: var(--muted); }
.ext-row-sync-cta { color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: none; }
.ext-row-sync-cta:hover { text-decoration: underline; }
.ext-row-sync-cta--off { color: var(--warn-on); }
.ext-row-sync--busy .ext-spin { color: var(--primary); font-size: 11px; }
.mp-name-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mp-name-stack > [data-ext-sync-all]:empty { display: none; }
/* Channel tables: the extension's row Sync link goes on its own line under
   the channel name (the name column is too narrow to share), and must not
   inherit .ch-sc-name's last-child ellipsis rule. */
.ch-sc-name { flex-wrap: wrap; row-gap: 3px; }
.ch-sc-name > [data-ext-sync-all] { flex-basis: 100%; padding-left: 27px; overflow: visible; font-weight: 500; }
.ch-sc-name > [data-ext-sync-all]:empty { display: none; }
.ch-sc-name > [data-ext-sync-all] .ext-row-sync { margin-left: 0; }
/* Cancel controls */
.ext-cancel-x {
  border: none; background: none; cursor: pointer; color: inherit; opacity: .6; font-size: 14px; line-height: 1;
  padding: 0 0 0 4px; margin-left: 2px;
}
.ext-cancel-x:hover { opacity: 1; color: var(--error-on); }
.ext-sync-status { overflow: visible; }
.ext-sync-status--cancelled { background: var(--outline-faint); color: var(--muted); }
.ext-row-sync-cta--muted { color: var(--muted); font-weight: 600; }
.ext-row-sync-cta--muted:hover { color: var(--error-on); }
.ext-tray-cancel { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.ext-tray-cancel:hover { color: var(--error-on); }
.ext-tray-hdr .ext-tray-cancel { color: var(--primary-dark); }
.ext-tray-row--cancelled .ext-tray-name { color: var(--muted); }
.ext-tray-step--cancelled { color: var(--muted); }

/* ── Data Sync page (frontend/js/views/uploads.js) ── */
.upload-period-banner.sync-period-bar { margin: 0 0 20px; }
.sync-tab-bar { margin-bottom: 18px; }
.ext-card-hint { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.ext-card .is-card-hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ext-rep-section { padding: 10px 0 12px; border-bottom: 1px solid var(--outline-faint); }
.ext-rep-section:last-child { border-bottom: none; }
.ext-rep-mk { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ext-rep-mk-name { font-weight: 800; color: var(--on-s); font-size: 13.5px; }
.ext-rep-mk-sync { margin-left: auto; }
.ext-rep-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0 8px 30px; min-height: 44px; border-top: 1px dashed var(--outline-faint);
}
.ext-rep-name { font-size: 13px; color: var(--on-s2); font-weight: 600; }
.ext-rep-row:not(.ext-rep-row--missing) .ext-rep-name { color: var(--muted); font-weight: 500; }
.ext-rep-missing { font-size: 12px; color: var(--warn-on); font-weight: 700; }
.ext-rep-manual { font-size: 12px; color: var(--muted); padding: 8px 0 0 30px; }
.ext-hist-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ext-hist-table th { text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--outline-faint); }
.ext-hist-table td { padding: 9px 8px; border-bottom: 1px solid var(--outline-faint); vertical-align: middle; }
.ext-hist-table tr:last-child td { border-bottom: none; }
.ext-hist-table .ext-tray-step { margin-top: 0; white-space: normal; }
.ext-hist-name { font-weight: 700; color: var(--on-s); }
.ext-hist-sub, .ext-hist-when { font-size: 11px; color: var(--faint); white-space: nowrap; }
/* Extension not signed in (or signed in as another account) */
.ext-sync-link--off { color: var(--warn-on); }
.ext-signin-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 8px;
  padding: 10px 14px; border-radius: 10px; background: var(--warn-tonal); color: var(--warn-on); font-size: 12.5px; font-weight: 600;
}
/* Data Sync › Extension: already-in reports with Resync */
.ext-rep-in { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ext-rep-meta { font-size: 11px; color: var(--faint); white-space: nowrap; }
.ext-rep-meta--failed { color: var(--error-on); font-weight: 600; }
.ext-resync-btn { color: var(--muted); border-color: var(--outline); }
.ext-resync-btn:hover { color: var(--primary); border-color: var(--primary); }
.ext-rep-tag { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--outline-faint); border-radius: 100px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
