/* ============================================================================
   Company Revenue — hidden panel, namespaced to #panel-revenue / .rev-* only.
   Reuses .dist-btn and .dash-spinner from the globally loaded sheets, so only
   revenue-specific pieces live here.

   Series colours are the validated 4-slot categorical set (checked for CVD
   separation and contrast against the white card surface). They are also the
   dashboard's own channel conventions: Amazon orange and Shopify purple match
   --orange / --purple in main.css. Colour follows the channel, never its rank —
   do not reorder these to match a sort.
   ========================================================================== */

#panel-revenue { font-size: 13px; }

#panel-revenue .rev-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:4px 0 14px; }
#panel-revenue .rev-title { margin:0; font-size:20px; font-weight:650; letter-spacing:-0.01em; }
#panel-revenue .rev-sub { font-size:12px; color:#64748b; margin-top:3px; }

#panel-revenue .rev-card { background:#fff; border:1px solid #e6eaf0; border-radius:10px; padding:15px 17px; margin-bottom:15px; }
#panel-revenue .rev-card-head { display:flex; align-items:center; gap:11px; margin-bottom:12px; flex-wrap:wrap; }
#panel-revenue .rev-card-head h3 { margin:0; font-size:14px; font-weight:640; color:#0f172a; }
#panel-revenue .rev-card-sub { font-size:11.5px; color:#94a3b8; }
#panel-revenue .rev-csv { margin-left:auto; }

/* ── KPI row ─────────────────────────────────────────────────────────────── */
#panel-revenue .rev-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:11px; margin-bottom:15px; }
#panel-revenue .rev-kpi { background:#fff; border:1px solid #e6eaf0; border-radius:9px; padding:13px 15px; }
#panel-revenue .rev-kpi-n { font-size:10.5px; font-weight:650; letter-spacing:.08em; text-transform:uppercase; color:#94a3b8; }
#panel-revenue .rev-kpi-v { font-size:25px; font-weight:650; letter-spacing:-0.025em; color:#0f172a; margin:5px 0 3px; font-variant-numeric:tabular-nums; }
#panel-revenue .rev-kpi-s { font-size:11.5px; color:#64748b; }
#panel-revenue .rev-kpi-s.rev-up { color:#15803d; font-weight:650; }

/* ── channel mix ─────────────────────────────────────────────────────────── */
#panel-revenue .rev-mix { display:flex; flex-direction:column; }
#panel-revenue .rev-mix-row {
  display:grid; grid-template-columns:220px minmax(0,1fr) 120px 58px;
  align-items:center; gap:14px; padding:8px 0; border-bottom:1px solid #f1f5f9;
}
#panel-revenue .rev-mix-row:last-child { border-bottom:0; }
#panel-revenue .rev-mix-name { display:flex; align-items:center; gap:9px; color:#334155; }
#panel-revenue .rev-mix-bar { height:9px; background:#f1f5f9; border-radius:2px; overflow:hidden; }
#panel-revenue .rev-mix-bar i { display:block; height:100%; border-radius:2px; }
#panel-revenue .rev-mix-v { text-align:right; font-weight:650; color:#0f172a; font-variant-numeric:tabular-nums; }
#panel-revenue .rev-mix-p { text-align:right; color:#64748b; font-variant-numeric:tabular-nums; }

#panel-revenue .rev-sw { width:10px; height:10px; border-radius:2px; flex:none; display:inline-block; }
#panel-revenue .rev-legend { display:flex; flex-wrap:wrap; gap:6px 20px; margin-bottom:14px; }
#panel-revenue .rev-leg { display:inline-flex; align-items:center; gap:7px; font-size:12px; color:#475569; }

/* validated categorical slots */
#panel-revenue .rev-sw1 { background:#0284C7; }
#panel-revenue .rev-sw2 { background:#0FA47F; }
#panel-revenue .rev-sw3 { background:#EA580C; }
#panel-revenue .rev-sw4 { background:#7C3AED; }
#panel-revenue .rev-bf1 { background:#0284C7; fill:#0284C7; }
#panel-revenue .rev-bf2 { background:#0FA47F; fill:#0FA47F; }
#panel-revenue .rev-bf3 { background:#EA580C; fill:#EA580C; }
#panel-revenue .rev-bf4 { background:#7C3AED; fill:#7C3AED; }

/* ── chart ───────────────────────────────────────────────────────────────── */
#panel-revenue .rev-chart-scroll { overflow-x:auto; }
#panel-revenue .rev-chart { display:block; width:100%; height:auto; min-width:560px; }
#panel-revenue .rev-grid { stroke:#eef2f6; stroke-width:1; }
#panel-revenue .rev-ax { fill:#94a3b8; font-size:10.5px; font-variant-numeric:tabular-nums; }

/* ── table ───────────────────────────────────────────────────────────────── */
#panel-revenue .rev-table-scroll { overflow-x:auto; }
#panel-revenue .rev-table { border-collapse:collapse; width:100%; min-width:840px; }
#panel-revenue .rev-table th {
  padding:9px 12px; text-align:right; white-space:nowrap; cursor:pointer;
  font-size:10.5px; font-weight:650; letter-spacing:.06em; text-transform:uppercase;
  color:#94a3b8; border-bottom:1px solid #e6eaf0; user-select:none;
}
#panel-revenue .rev-table th:hover { color:#0f172a; }
#panel-revenue .rev-table th.rev-sorted { color:#0F6E86; }
#panel-revenue .rev-table th.rev-l, #panel-revenue .rev-table td.rev-l { text-align:left; }
#panel-revenue .rev-arr { font-size:8px; font-style:normal; margin-left:4px; }

#panel-revenue .rev-table td {
  padding:8px 12px; text-align:right; white-space:nowrap;
  border-bottom:1px solid #f1f5f9; color:#334155; font-variant-numeric:tabular-nums;
}
#panel-revenue .rev-table tbody tr:hover td { background:#f8fafc; }
#panel-revenue .rev-table td.rev-l { font-weight:650; color:#0f172a; }
#panel-revenue .rev-table td.rev-sub { color:#64748b; }
#panel-revenue .rev-table td.rev-strong { font-weight:650; color:#0f172a; }
#panel-revenue .rev-table td.rev-up { color:#15803d; font-weight:650; }
#panel-revenue .rev-table td.rev-dn { color:#b91c1c; }
#panel-revenue .rev-table tfoot td {
  border-top:2px solid #0f172a; border-bottom:0; background:#f8fafc;
  font-weight:700; color:#0f172a; padding:10px 12px;
}

/* ── note ────────────────────────────────────────────────────────────────── */
#panel-revenue .rev-note {
  font-size:11.5px; line-height:1.65; color:#64748b;
  background:#f8fafc; border:1px solid #e6eaf0; border-radius:9px; padding:12px 15px;
}
#panel-revenue .rev-note b { color:#334155; font-weight:650; }

/* ── error state (honesty rule) ──────────────────────────────────────────── */
#panel-revenue .rev-error {
  background:#fff; border:1px solid #fecaca; border-left:3px solid #dc2626;
  border-radius:9px; padding:17px 19px;
}
#panel-revenue .rev-error-t { font-size:14px; font-weight:650; color:#b91c1c; }
#panel-revenue .rev-error-m { font-size:12px; color:#64748b; margin:5px 0 0; font-family:ui-monospace,Menlo,Consolas,monospace; }
#panel-revenue .rev-error-h { font-size:12px; color:#475569; margin:9px 0 13px; max-width:60ch; }
