/* VIPCRED v13.44 — refinamento premium das telas operacionais.
   APRESENTAÇÃO APENAS: sem alterações em chamadas à API, cálculos ou permissões. */
:root{--vip44-ink:#143c2e;--vip44-green:#096a4b;--vip44-orange:#ef7f28;--vip44-soft:#eef7f2;--vip44-line:#e2ebe6;--vip44-shadow:0 12px 34px rgba(10,59,40,.06)}
#app .page:not(#home){--page-accent:#0a7853;}
#app #sales{--page-accent:#e98329}
#app #reactivation{--page-accent:#e98329}
#app #whatsapp{--page-accent:#e98329}
/* Topos consistentes para telas com ou sem row de ações */
#app .page:not(#home)>h1,
#app .page:not(#home)>div:first-child h1{
  color:var(--vip44-ink)!important;font-size:clamp(25px,2vw,32px)!important;
  font-weight:870!important;letter-spacing:-1.15px!important;line-height:1.18!important;
  margin:0 0 7px!important;
}
#app .page:not(#home)>p.mut,
#app .page:not(#home)>div:first-child p.mut{
 color:#7b8b81!important;font-size:13px!important;line-height:1.55!important;
 margin:0 0 15px!important;max-width:920px;
}
#app .page:not(#home)>h1:before,
#app .page:not(#home)>div:first-child h1:before{
 content:"";display:inline-block;width:6px;height:24px;margin:0 12px 0 0;
 background:linear-gradient(180deg,var(--page-accent),#2eab82);border-radius:5px;
 vertical-align:-3px;
}
#app #sales>div:first-child,#app #clients>.row:first-child,
#app #reactivation>.row:first-child,#app #clientAnalysis>.row:first-child,
#app #attendants>.row:first-child,#app #sellers>.row:first-child{
 min-width:0;margin-bottom:13px!important;gap:16px!important;
}
#app #sales>div:first-child .actions,#app #clients>.row:first-child .actions,
#app #attendants>.row:first-child .actions,#app #sellers>.row:first-child .actions{
 align-items:center;gap:10px;
}
/* Cards e títulos */
#app .page:not(#home) .panel,#app .page:not(#home) .kpi,#app .page:not(#home) .cardbox,
#app .page:not(#home) .waCard,#app .page:not(#home) .waHero{
 border:1px solid var(--vip44-line)!important;border-radius:19px!important;
 box-shadow:var(--vip44-shadow)!important;background:#fff;
}
#app .page:not(#home) .panel{padding:clamp(17px,1.7vw,24px)!important;margin:14px 0 18px!important;min-width:0}
#app .page:not(#home) .panel h3,#app .page:not(#home) .waCard h3{
 color:#143e30!important;letter-spacing:-.45px!important;line-height:1.35!important;
}
#app .page:not(#home) .panel>h3:first-child{
 display:flex;align-items:center;gap:9px;font-size:17px!important;margin:0 0 15px!important;
}
#app .page:not(#home) .panel>h3:first-child:before{
 content:"";display:block;width:5px;height:19px;border-radius:9px;background:#ef862e;flex:0 0 5px;
}
/* Campos e botões preservam os seletores/eventos atuais */
#app .page:not(#home) label{display:inline-block;color:#526f61!important;font-size:12px!important;font-weight:780!important;margin-bottom:3px}
#app .page:not(#home) input:not([type=checkbox]),#app .page:not(#home) select,
#app .page:not(#home) textarea{
 background:#fff!important;border:1px solid #dce7e0!important;border-radius:11px!important;
 min-height:45px;box-shadow:0 2px 5px rgba(5,64,36,.018);color:#193d2d!important;
}
#app .page:not(#home) input:not([type=checkbox]):focus,
#app .page:not(#home) select:focus,#app .page:not(#home) textarea:focus{
 border-color:#2d9873!important;box-shadow:0 0 0 4px rgba(23,136,89,.11)!important;
 outline:0;
}
#app .page:not(#home) textarea{min-height:82px;resize:vertical}
#app .page:not(#home) .btn{border-radius:10px!important;font-size:12px;min-height:41px;transition:transform .12s ease,box-shadow .15s ease}
#app .page:not(#home) .btn:focus-visible{outline:3px solid #f4ac67;outline-offset:2px}
#app .page:not(#home) .btn.o{background:linear-gradient(115deg,#f99737,#eb7921)!important;box-shadow:0 7px 14px rgba(230,116,25,.16)}
#app .page:not(#home) .btn.g{background:linear-gradient(105deg,#087454,#08573f)!important;box-shadow:0 7px 14px rgba(5,100,60,.11)}
#app .page:not(#home) .btn.light{border:1px solid #dae9df!important;background:#edf7f0!important}
#app .page:not(#home) .btn:disabled{opacity:.56;box-shadow:none;cursor:not-allowed}
#app .page:not(#home) .kpis,#app .page:not(#home) .caKpis,#app .page:not(#home) .rcKpis{gap:13px!important}
#app .page:not(#home) .kpi{
 position:relative;overflow:hidden;padding:20px 19px!important;background:#fff!important;
 border-radius:17px!important;min-width:0;
}
#app .page:not(#home) .kpi:before{width:4px!important;background:linear-gradient(180deg,#096f4f,#37b788)!important}
#app .page:not(#home) .kpi:nth-child(3n+2):before{background:linear-gradient(180deg,#f69334,#e57a20)!important}
#app .page:not(#home) .kpi small{font-size:12px;color:#72857a!important;margin-bottom:12px!important;font-weight:720}
#app .page:not(#home) .kpi strong{font-weight:880!important;color:#154632!important;font-size:clamp(20px,1.8vw,27px)!important;font-variant-numeric:tabular-nums}
/* Tabelas: cabeçalho suave, linhas separadas, scroll APENAS interno */
#app .page:not(#home) table{width:100%;border-spacing:0;border-collapse:separate;font-size:12.5px}
#app .page:not(#home) table thead th{
 background:#eaf5ee!important;color:#436f5c!important;font-size:10px!important;
 font-weight:860!important;letter-spacing:.75px;line-height:1.3;padding:13px 12px!important;
 border-bottom:1px solid #d7e8dc;
}
#app .page:not(#home) table thead th:first-child{border-radius:11px 0 0 0}
#app .page:not(#home) table thead th:last-child{border-radius:0 11px 0 0}
#app .page:not(#home) table tbody td{
 background:#fff;min-height:46px;padding:13px 12px!important;
 border-bottom:1px solid #edf2ee;color:#304e40;line-height:1.45;
}
#app .page:not(#home) table tbody tr:nth-child(even) td{background:#fafcfb}
#app .page:not(#home) table tbody tr:hover td{background:#f0f8f2!important}
#app .page:not(#home) table tbody td .ok{font-weight:750}
#app .page:not(#home) table tbody td .err{font-weight:750}
#app .page:not(#home) .panel>div[style*="overflow:auto"],
#app .page:not(#home) .caTableWrap,#app .page:not(#home) .rcTableWrap{
 max-width:100%;overflow-x:auto!important;scrollbar-width:thin;scrollbar-color:#b9d6c5 transparent;
 border-radius:10px;
}
/* Vendas: ações, formulário, seleção do tipo e filtros */
#app #sales #salesKpis{grid-template-columns:repeat(3,minmax(0,1fr))!important;margin:17px 0 20px!important}
#app #sales #salesKpis .kpi{min-height:109px}
#app #sales #saleTypeChoice{border-top:4px solid #ef8729!important}
#app #sales .saleTypeChoiceGrid{gap:14px}
#app #sales .saleTypeCard{
 background:linear-gradient(150deg,#fff,#f7fbf8)!important;border:1px solid #dfebe3!important;
 box-shadow:0 7px 22px rgba(15,57,38,.04);padding:22px!important;border-radius:16px!important;
}
#app #sales .saleTypeCard:hover,#app #sales .saleTypeCard:focus-visible{
 border-color:#ee983c!important;box-shadow:0 0 0 3px rgba(241,141,45,.11)!important;
}
#app #sales #saleForm{border-top:4px solid #ed8528!important;box-shadow:0 18px 38px rgba(14,73,46,.075)!important}
#app #sales #saleFormTitle{font-size:22px!important}
#app #sales #saleForm .saleClientLookupBox{border-radius:14px}
#app #sales #saleForm .saleFormRow{gap:14px}
#app #sales .saleTypeCard b{color:#12553c}
#app #sales details.productFilterDetails{border-radius:11px!important}
#app #sales #salesBody .btn{min-height:30px!important;padding:6px 8px!important}
#app #sales .panel table{min-width:max-content}
/* Clientes e histórico */
#app #clients .kpis{margin:17px 0 19px!important}
#app #clients #clientForm{border-top:4px solid #ef852c!important;max-width:850px!important}
#app #clients #clientFormTitle{font-size:20px!important}
#app #clients>.panel:last-child>label{margin-top:1px}
#app #clients #clientSearch{max-width:550px;margin-bottom:21px!important}
#app #clientAnalysis .caKpis{grid-template-columns:repeat(3,minmax(0,1fr));margin:17px 0 20px}
#app #clientAnalysis .caRankGrid{gap:16px!important}
#app #clientAnalysis .caRankGrid>.panel{margin:0!important}
#app #clientAnalysis .caRankItem{margin:5px 0;padding:12px 10px!important;border-radius:10px;border-bottom:1px solid #ebf0ed}
#app #clientAnalysis .caRankItem:nth-child(1){background:#fff5d9;border:1px solid #f5e2a2}
#app #clientAnalysis .caRankItem:nth-child(2){background:#f2f5f8;border:1px solid #dde5eb}
#app #clientAnalysis .caRankItem:nth-child(3){background:#fff0e6;border:1px solid #f0d5c4}
#app #clientAnalysis .caRankPosition{display:grid;place-items:center;flex:0 0 29px;height:29px;background:#edf5ee;border-radius:50%;font-weight:850}
#app #clientAnalysis .caRankItem:nth-child(1) .caRankPosition{background:#ffdb8a;color:#89600a}
#app #clientAnalysis .caRankItem:nth-child(2) .caRankPosition{background:#dbe3eb;color:#53667d}
#app #clientAnalysis .caRankItem:nth-child(3) .caRankPosition{background:#eec5ac;color:#8a5634}
#app #clientAnalysis #caDetail{border-top:4px solid #0d8c63!important}
#app #clientAnalysis .caMini{background:#fbfdfb;border:1px solid #e0ece3;border-radius:15px;gap:6px}
/* Reativação: destacar atendimento por loja, KPIs e modal de contato */
#app #reactivation>.panel:nth-child(2){border-top:4px solid #ef8428!important}
#app #reactivation .rcKpis{margin:15px 0 20px}
#app #reactivation #rcDetail{border:1px solid #d2e7db!important;border-top:4px solid #e9862d!important;background:#fff!important}
#app #reactivation .rcDetailGrid{gap:16px}
#app #reactivation .rcHistoryEntry{border-bottom:1px dashed #deece2;padding:12px 0}
#app #reactivation .rcFilters{gap:14px}
/* Cadastros e gerenciamento: tabela + painel de adição */
#app #units>.grid,#app #banks>.grid,#app #promoters>.grid,#app #products>.grid,
#app #attendants>.grid,#app #sellers>.grid{
 display:grid;grid-template-columns:minmax(0,1.55fr) minmax(270px,.88fr);gap:17px;align-items:start;
}
#app #units>.grid .panel,#app #banks>.grid .panel,#app #promoters>.grid .panel,
#app #products>.grid .panel,#app #attendants>.grid .panel,#app #sellers>.grid .panel{margin-top:0!important}
#app #units>.grid>.panel:last-child,#app #banks #newBankPanel,#app #promoters #newPromoterPanel,
#app #products #newProductPanel,#app #attendants>.grid>.panel:last-child,
#app #sellers>.grid>.panel:last-child,#app #machines #newMachinePanel{
 background:linear-gradient(155deg,#fff 75%,#f1f9f4)!important;
 border-top:4px solid #f18a32!important;
}
#app #units>.grid> .panel:first-child,#app #banks>.grid>.panel:first-child,
#app #products>.grid>.panel:first-child,#app #promoters>.grid>.panel:first-child{
 min-width:0;
}
#app #units>.grid>.panel>div[style*="overflow:auto"],#app #banks>.grid>.panel>div[style*="overflow:auto"],
#app #promoters>.grid>.panel>div[style*="overflow:auto"],#app #products>.grid>.panel>div[style*="overflow:auto"]{overflow-x:auto!important}
#app #machines>.grid{grid-template-columns:minmax(0,.95fr) minmax(0,1.35fr)!important;align-items:start}
#app #machines>.grid>.panel{margin-top:0!important}
#app #machines>.grid>.panel:first-child{overflow-x:auto}
#app #machines #rates{max-width:100%;overflow-x:auto}
#app #goals>.panel:first-of-type{background:linear-gradient(100deg,#fff,#f8fbf9)!important}
#app #goals>.kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important}
#app #goalEditPanel{max-width:650px;border-top:4px solid #ee8b33!important}
/* Automação e seleção de unidade */
#app #whatsapp .waHero{border-left:4px solid #0a875b!important}
#app #whatsapp .waCard{padding:21px!important;border-top:4px solid #168961!important}
#app #whatsapp .waCard:nth-child(2){border-top-color:#f18a32!important}
#app #whatsapp .waCardTop{gap:10px}
#app #whatsapp .waKpis{grid-template-columns:repeat(4,minmax(0,1fr))!important}
#app #whatsapp .waBadge{font-weight:800;padding:6px 10px}
#app #whatsapp .waSearch{max-width:650px}
#app #salesUnitChoice .panel,#app #clientsUnitChoice .panel,
#app #attendantsUnitChoice .panel,#app #sellersUnitChoice .panel{
 max-width:760px;border-top:4px solid #f18b32!important;
}
/* Desktop ajustes */
@media(min-width:1151px){
 #app #sales>.panel:not(#saleForm) .filters{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:1150px){
 #app #units>.grid,#app #banks>.grid,#app #promoters>.grid,#app #products>.grid,
 #app #attendants>.grid,#app #sellers>.grid,#app #machines>.grid{grid-template-columns:1fr!important}
 #app #goals>.kpis,#app #whatsapp .waKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:850px){
 #app #sales #salesKpis,#app #clientAnalysis .caKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #app #sales #saleForm .grid,#app #clientAnalysis .caRankGrid{grid-template-columns:1fr!important}
 #app #sales .panel table,#app #clients .panel table,#app #machines .panel table{min-width:680px}
 #app #machines>.grid>.panel:first-child,#app #whatsapp .panel:has(table){overflow-x:auto}
}
@media(max-width:580px){
 #app .page:not(#home)>h1,#app .page:not(#home)>div:first-child h1{font-size:25px!important}
 #app .page:not(#home)>h1:before,#app .page:not(#home)>div:first-child h1:before{height:22px;width:5px;margin-right:9px}
 #app .page:not(#home) .panel{padding:15px!important;margin:12px 0 16px!important;border-radius:16px!important}
 #app .page:not(#home) .kpi{padding:15px 12px!important;min-height:95px}
 #app .page:not(#home) .kpi small{font-size:11px;margin-bottom:8px!important}
 #app .page:not(#home) .kpi strong{font-size:clamp(17px,4.2vw,22px)!important}
 #app #sales #salesKpis,#app #clientAnalysis .caKpis,#app #reactivation .rcKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
 #app #sales>div:first-child,#app #clients>.row:first-child,#app #reactivation>.row:first-child,
 #app #clientAnalysis>.row:first-child{display:flex!important;flex-direction:column!important;align-items:stretch!important}
 #app #clients>.row:first-child .actions{display:grid!important;grid-template-columns:1fr 1fr;gap:7px;width:100%}
 #app #clients>.row:first-child .actions .btn{min-width:0}
 #app #sales .saleTypeChoiceGrid{grid-template-columns:1fr!important}
 #app #sales .saleTypeCard{padding:16px!important}
 #app #sales #saleForm .saleFormRow{grid-template-columns:1fr!important}
 #app #reactivation .rcFilters,#app #clientAnalysis .caFilterGrid{grid-template-columns:1fr!important}
 #app #whatsapp .waGrid{grid-template-columns:1fr!important}
 #app #whatsapp .waSearch{grid-template-columns:1fr!important}
 #app #goals>.kpis,#app #whatsapp .waKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #app .page:not(#home) table{font-size:12px}
 #app .page:not(#home) table thead th{padding:12px 9px!important}
 #app .page:not(#home) table tbody td{padding:11px 9px!important}
 #app #banks>.grid,#app #units>.grid,#app #promoters>.grid,#app #products>.grid,
 #app #attendants>.grid,#app #sellers>.grid{grid-template-columns:minmax(0,1fr)!important}
 #app #machines .row[style*="grid-template-columns"]{grid-template-columns:1fr!important}
}
@media(prefers-reduced-motion:reduce){#app .page:not(#home) .btn{transition:none}}
