// js/components/widgets/vendedor-activity-card/ActivityHeader.jsx
// [Wave 39 v224.20 NUCLEAR EXTRACT 2026-05-24] Header com title + subtitle + 3 KPIs inline
// Extract LITERAL VendedorActivityCard L154-164
//
// Props:
//   - totals (obj) — {totalDisparos, totalConversoes, totalReceita, taxaGeral}
//
// Deps lazy: window.fmt
(function(){
  'use strict';
  function ActivityHeader(props){
    const fmt = window.fmt;
    if(typeof fmt !== 'function'){
      console.error('[ActivityHeader] fmt global ausente');
      return null;
    }
    const { totals } = props;
    return (
      <div style={{display:'flex',justifyContent:'space-between',alignItems:'center',flexWrap:'wrap',gap:8,marginBottom:14}}>
        <div>
          <div style={{fontSize:14,fontWeight:700,color:'#1B2A4A'}}>📊 Atividade da Equipe</div>
          <div style={{fontSize:11,color:'#9CA3AF'}}>Disparos WhatsApp + conversões nos últimos 7 dias</div>
        </div>
        <div style={{display:'flex',gap:14,fontSize:12}}>
          <div><strong style={{color:'#2563EB',fontSize:18}}>{totals.totalDisparos}</strong><span style={{color:'#9CA3AF',marginLeft:4}}>disparos</span></div>
          <div><strong style={{color:'#16A34A',fontSize:18}}>{totals.totalConversoes}</strong><span style={{color:'#9CA3AF',marginLeft:4}}>conversões ({totals.taxaGeral.toFixed(0)}%)</span></div>
          <div><strong style={{color:'#92700A',fontSize:18}}>{fmt(totals.totalReceita)}</strong><span style={{color:'#9CA3AF',marginLeft:4}}>receita atribuída</span></div>
        </div>
      </div>
    );
  }
  window.ZNX = window.ZNX || {};
  window.ZNX.widgets = window.ZNX.widgets || {};
  window.ZNX.widgets['vendedor-activity-card'] = window.ZNX.widgets['vendedor-activity-card'] || {};
  window.ZNX.widgets['vendedor-activity-card'].ActivityHeader = ActivityHeader;
  // [Wave 39 marker v224.20] confirma ActivityHeader executado
  window.ActivityHeader_v224_20_wave39 = true;
})();
