/* ============================================================
   TEMA — PrecificPetNow
   Dois modos: escuro (padrao) e claro.
   Trocar: <html data-tema="claro"> ou "escuro"
   ============================================================ */

/* ---------- MODO ESCURO (padrao) ---------- */
:root,
html[data-tema="escuro"]{
  --bg:#0A1524;          /* fundo mais fundo, para o cartao saltar */
  --card:#16293D;        /* cartao */
  --card-topo:#1B3149;   /* cabecalho do cartao */
  --card2:#22405C;       /* campos */
  --ter:#D4632F;
  --ter-suave:rgba(212,99,47,.16);
  --claro:#EDF2F7;
  --muted:#93A9C0;
  --borda:rgba(237,242,247,.14);
  --borda-forte:rgba(237,242,247,.22);
  --verde:#3DBA7C;
  --amber:#E0A340;
  --verm:#E36457;
  --sombra:0 4px 6px rgba(0,0,0,.30), 0 12px 28px rgba(0,0,0,.34);
  --sombra-alta:0 8px 16px rgba(0,0,0,.38), 0 20px 44px rgba(0,0,0,.42);
  --entrada:#0A1524;
}

/* ---------- MODO CLARO ---------- */
html[data-tema="claro"]{
  --bg:#F2EEE2;
  --card:#FFFFFF;
  --card-topo:#FAF7F0;
  --card2:#F0EADC;
  --ter:#CB4E22;
  --ter-suave:rgba(203,78,34,.10);
  --claro:#0D2944;
  --muted:#5C7089;
  --borda:rgba(13,41,68,.12);
  --borda-forte:rgba(13,41,68,.20);
  --verde:#1B7F4B;
  --amber:#B26B00;
  --verm:#B3261E;
  --sombra:0 1px 2px rgba(13,41,68,.06), 0 8px 22px rgba(13,41,68,.07);
  --sombra-alta:0 4px 10px rgba(13,41,68,.10), 0 18px 40px rgba(13,41,68,.12);
  --entrada:#FBF9F4;
}

/* apelidos antigos */
:root,html[data-tema]{
  --surface2:var(--card2); --nav:var(--claro); --cream:var(--bg);
  --ink:var(--claro); --line:var(--borda); --navy:var(--card);
  --terra:var(--ter); --green:var(--verde); --red:var(--verm);
}

html,body{background:var(--bg)!important;color:var(--claro)!important}
body{font-family:'DM Sans',system-ui,-apple-system,sans-serif}
body.embed{background:transparent!important}
h1,h2,h3,h4,.tit,.logo{font-family:'Fraunces',serif;color:var(--claro)}

/* ============================================================
   CARTOES — separacao clara entre um e outro
   ============================================================ */
html body .card,
html body .painel,
html body .box:not(.modal .box),
html body .bloco{
  background-color:var(--card)!important;
  color:var(--claro)!important;
  border:1px solid var(--borda)!important;
  border-radius:16px!important;
  box-shadow:var(--sombra)!important;
  margin-bottom:18px!important;
  overflow:hidden;
  transition:box-shadow .18s ease, border-color .18s ease;
}
html body .card:hover,html body .painel:hover{
  border-color:var(--borda-forte)!important;
  box-shadow:var(--sombra-alta)!important;
}
/* cabecalho do cartao com faixa propria */
html body .painel > header,
html body .card > header{
  background:var(--card-topo)!important;
  border-bottom:1px solid var(--borda)!important;
  padding:18px 22px 16px!important;
  margin:0!important;
}
html body .painel > header h3,
html body .card > header h3{margin:0 0 3px!important;font-size:17px!important;color:var(--claro)!important}
html body .painel > header .dica,
html body .card > header .dica{color:var(--muted)!important;font-size:13px!important;margin:0!important}
/* espaco interno quando o cartao nao tem header */
html body .card{padding:20px 22px}
html body .painel{padding:0}
html body .painel > div:not(header){padding:4px 22px 18px}

/* grade com respiro entre cartoes */
html body .dash-cols,html body .grid2,html body .grade,html body .recursos{gap:18px!important}
html body .dash-kpis,html body .kpis,html body .inds{gap:16px!important}

/* ============================================================
   KPIs
   ============================================================ */
html body .kpi,html body .ind{
  background:var(--card)!important;border:1px solid var(--borda)!important;
  border-radius:14px!important;padding:17px 20px!important;box-shadow:var(--sombra)!important}
html body .kpi .rot,html body .ind .nome{color:var(--muted)!important}
html body .kpi .val{color:var(--claro)!important}
html body .kpi.dark,html body .kpi.destaque{
  background:linear-gradient(140deg,var(--ter),#A6421C)!important;border-color:transparent!important}
html body .kpi.dark .rot,html body .kpi.destaque .rot{color:rgba(255,255,255,.82)!important}
html body .kpi.dark .val,html body .kpi.destaque .val,
html body .kpi.dark div,html body .kpi.destaque div{color:#fff!important}

/* ============================================================
   MENU
   ============================================================ */
html body .sidebar,html body #sidebar,html body aside{
  background:var(--card)!important;border-right:1px solid var(--borda)!important}
html body .sidebar-section,html body .sec-cab{color:var(--muted)!important;background:transparent!important}
html body .nav-item{background:transparent!important;border-radius:9px}
html body .nav-item:hover,html body .sec-cab:hover{background:var(--ter-suave)!important}
html body .nav-item.active,html body .nav-item.on{background:var(--ter-suave)!important}
html body .nav-label{color:var(--claro)!important}
html body .nav-desc{color:var(--muted)!important}
html body .sec-fly,html body .sec-fly.on,html body div.sec-fly{
  background:var(--card)!important;border:1px solid var(--borda-forte)!important;
  box-shadow:var(--sombra-alta)!important;border-radius:14px!important}
html body .sec-fly .nav-label{color:var(--claro)!important;font-weight:600!important}
html body .sec-fly .nav-desc{color:var(--muted)!important}
html body .sec-fly > div:first-child{color:var(--ter)!important;background:transparent!important}
html body > header,html body header:first-of-type{
  background:var(--card)!important;border-bottom:1px solid var(--borda)!important}
html body > header *{color:var(--claro)}
html body .logo,html body .logo *{color:var(--claro)!important}
html body .logo span{color:var(--ter)!important}

/* ============================================================
   FORMULARIOS
   ============================================================ */
html body label{color:var(--muted)!important}
html body input,html body select,html body textarea{
  background:var(--entrada)!important;color:var(--claro)!important;
  border:1px solid var(--borda)!important;border-radius:10px!important}
html body input:focus,html body select:focus,html body textarea:focus{
  border-color:var(--ter)!important;box-shadow:0 0 0 3px var(--ter-suave)!important}
html body input::placeholder{color:var(--muted)!important;opacity:.7}
html body select option{background:var(--card);color:var(--claro)}
html[data-tema="escuro"] input[type=date],html[data-tema="escuro"] input[type=month]{color-scheme:dark}
html[data-tema="claro"] input[type=date],html[data-tema="claro"] input[type=month]{color-scheme:light}
html body input[type=checkbox],html body input[type=radio],html body input[type=range]{accent-color:var(--ter)}

/* ============================================================
   BOTOES
   ============================================================ */
html body .btn{background:var(--ter)!important;color:#fff!important;border:none!important;border-radius:10px!important}
html body .btn:hover{filter:brightness(1.08)}
html body .btn2,html body .dash-atalho{
  background:var(--card2)!important;color:var(--claro)!important;
  border:1px solid var(--borda)!important;border-radius:10px!important}
html body .btn2:hover,html body .dash-atalho:hover{border-color:var(--ter)!important;background:var(--ter-suave)!important}
html body .aba{background:var(--card2)!important;color:var(--claro)!important;border:1px solid var(--borda)!important}
html body .aba.on{background:var(--ter)!important;color:#fff!important;border-color:var(--ter)!important}
html body .perigo{background:rgba(227,100,87,.14)!important;color:var(--verm)!important;
  border:1px solid rgba(227,100,87,.30)!important}
html body .ok-b{background:rgba(61,186,124,.14)!important;color:var(--verde)!important;
  border:1px solid rgba(61,186,124,.30)!important}

/* ============================================================
   TABELAS
   ============================================================ */
html body table{color:var(--claro)!important;background:transparent!important}
html body table th{color:var(--muted)!important;background:var(--card-topo)!important;
  border-bottom:1px solid var(--borda)!important}
html body table td,html body table td *{color:var(--claro)!important}
html body table td.peq,html body table td small{color:var(--muted)!important}
html body table td{border-bottom:1px solid var(--borda)!important}
html body tbody tr:hover td{background:var(--ter-suave)!important}
html body tr.grupo td,html body tr.l-subtotal td{background:var(--card-topo)!important}
html body tr.total td,html body tr.l-destaque td{background:var(--ter-suave)!important}
html body .win,html body .pos{color:var(--verde)!important}
html body .neg,html body .perde{color:var(--verm)!important}

/* linhas de lista dentro dos paineis */
html body .linha-serv{border-bottom:1px solid var(--borda)!important;padding:14px 0!important}
html body .linha-serv:last-child{border-bottom:none!important}
html body .linha-serv .nome b{color:var(--claro)!important}
html body .linha-serv .nome span{color:var(--muted)!important}

/* ============================================================
   ESTADOS, AVISOS E DETALHES
   ============================================================ */
html body .tagst,html body .tag{border:1px solid transparent;font-weight:700}
html body .st-pago,html body .t-ativa{background:rgba(61,186,124,.15)!important;color:var(--verde)!important}
html body .st-venc,html body .t-suspensa,html body .t-cancelada{background:rgba(227,100,87,.15)!important;color:var(--verm)!important}
html body .st-parc,html body .st-hoje,html body .t-teste,html body .t-atrasada{background:rgba(224,163,64,.15)!important;color:var(--amber)!important}
html body .st-pend,html body .t-sem{background:var(--card2)!important;color:var(--muted)!important}
html body .aviso-box,html body .flag{background:var(--ter-suave)!important;
  border:1px solid rgba(212,99,47,.28)!important;color:var(--claro)!important;border-radius:12px!important}
html body .alerta{background:rgba(227,100,87,.11)!important;
  border:1px solid rgba(227,100,87,.28)!important;color:var(--verm)!important;border-radius:12px!important}
html body .vazio,html body .vazio-p{color:var(--muted)!important}
html body .modal:not(.modal-ov > .modal){background:rgba(4,10,18,.78)!important}
html body .modal .box{background:var(--card)!important;border:1px solid var(--borda-forte)!important;
  box-shadow:var(--sombra-alta)!important}
html body .sug,html body #sug-forn{background:var(--card)!important;
  border:1px solid var(--borda-forte)!important;color:var(--claro)!important;box-shadow:var(--sombra-alta)!important}
html body .sug:hover{background:var(--ter-suave)!important}
html body .zona{background:var(--card2)!important;border:2px dashed var(--borda-forte)!important;color:var(--muted)!important}
html body .zona:hover,html body .zona.sobre{border-color:var(--ter)!important;background:var(--ter-suave)!important}
html body .zona b{color:var(--claro)!important}
html body .anx{background:var(--card2)!important}
html body .chip{background:var(--card2)!important;color:var(--claro)!important;border:1px solid var(--borda)!important}
html body .ajuda{background:var(--card2)!important;color:var(--muted)!important}
html body .ajuda:hover{background:var(--ter)!important;color:#fff!important}
html body details{border-color:var(--borda)!important}
html body details p{color:var(--muted)!important}
html body code{background:var(--card2)!important;color:var(--claro)!important}
html body .bl-bar,html body .cat-b,html body .graf,html body .graf-linha{background:var(--card2)!important}
html body .dia,html body .legenda-g,html body .legenda{color:var(--muted)!important}
html body .cal-dia{background:var(--card2)!important;border:1px solid var(--borda)!important}
html body .cal-dia:hover{border-color:var(--ter)!important}
html body .cal-cab{color:var(--muted)!important}
html body .__fm-barra{background:var(--card)!important;border:1px solid var(--borda)!important;
  border-radius:14px!important;padding:14px 18px!important;box-shadow:var(--sombra)!important}
html body .__fm-barra *{color:var(--claro)!important}
html body #__fm-conta{color:var(--muted)!important}

/* rolagem */
html body ::-webkit-scrollbar{width:11px;height:11px}
html body ::-webkit-scrollbar-track{background:var(--bg)}
html body ::-webkit-scrollbar-thumb{background:var(--card2);border-radius:6px}

/* ============================================================
   BOTAO DE TROCA DE TEMA
   ============================================================ */
#troca-tema{
  position:fixed;right:18px;bottom:18px;z-index:8000;
  width:46px;height:46px;border-radius:50%;
  background:var(--card)!important;border:1px solid var(--borda-forte)!important;
  color:var(--claro)!important;cursor:pointer;
  box-shadow:var(--sombra-alta)!important;
  display:flex;align-items:center;justify-content:center;
  font-size:19px;line-height:1;padding:0!important;transition:all .18s}
#troca-tema:hover{border-color:var(--ter)!important;transform:translateY(-2px)}
body.embed #troca-tema{display:none}

/* tela de login */
html body #login-screen{background:var(--bg)!important}
html body .login-card{background:var(--card)!important;border:1px solid var(--borda)!important;
  box-shadow:var(--sombra-alta)!important}
html body .login-h,html body .brand-name{color:var(--claro)!important}
html body .login-sub{color:var(--muted)!important}
html body .brand-icon{background:var(--ter)!important;color:#fff!important}
html body .login-card a{color:var(--muted)!important}
html body .login-card a:hover{color:var(--ter)!important}


/* ============================================================
   TITULOS DA PAGINA — fora dos cartoes
   ============================================================ */
html body main > h1,html body main > h2,html body .conteudo > h1,
html body .tab-pane > h1,html body .tab-pane > h2,html body .page-head h1,
html body h1.page-title,html body .tela > h1{color:var(--claro)!important}
html body main > .sub,html body .tab-pane > .sub,html body .page-head .sub{color:var(--muted)!important}

/* qualquer h1/h2/h3 solto na pagina */
html body h1,html body h2,html body h3,html body h4{color:var(--claro)!important}
html body h1 span,html body h2 span{color:var(--ter)!important}

/* subtitulos e textos auxiliares */
html body p.sub,html body .subtitulo,html body .descricao{color:var(--muted)!important}


/* ============================================================
   MENU FORCADO NOS DOIS TEMAS + TEXTO SEM CORTE
   ============================================================ */
html[data-tema="escuro"] body nav.sidebar,html[data-tema="escuro"] body .sidebar,
html[data-tema="escuro"] body #sidebar{background:#16293D!important}
html[data-tema="escuro"] body .sidebar .sidebar-section,
html[data-tema="escuro"] body .sidebar .sec-cab{color:#93A9C0!important}
html[data-tema="escuro"] body .sidebar .nav-label,
html[data-tema="escuro"] body .sidebar .nav-item{color:#EDF2F7!important}
html[data-tema="escuro"] body .sidebar .nav-desc{color:#93A9C0!important}

html[data-tema="claro"] body nav.sidebar,html[data-tema="claro"] body .sidebar,
html[data-tema="claro"] body #sidebar{background:#FFFFFF!important}
html[data-tema="claro"] body .sidebar .sidebar-section,
html[data-tema="claro"] body .sidebar .sec-cab{color:#5C7089!important}
html[data-tema="claro"] body .sidebar .nav-label,
html[data-tema="claro"] body .sidebar .nav-item{color:#0D2944!important}
html[data-tema="claro"] body .sidebar .nav-desc{color:#5C7089!important}

/* submenu nos dois temas */
html[data-tema="escuro"] body .sec-fly{background:#16293D!important}
html[data-tema="escuro"] body .sec-fly .nav-label{color:#EDF2F7!important}
html[data-tema="escuro"] body .sec-fly .nav-desc{color:#93A9C0!important}
html[data-tema="claro"] body .sec-fly{background:#FFFFFF!important}
html[data-tema="claro"] body .sec-fly .nav-label{color:#0D2944!important}
html[data-tema="claro"] body .sec-fly .nav-desc{color:#5C7089!important}

/* cabecalho do topo nos dois temas */
html[data-tema="escuro"] body > header{background:#16293D!important}
html[data-tema="escuro"] body > header *{color:#EDF2F7!important}
html[data-tema="claro"] body > header{background:#FFFFFF!important}
html[data-tema="claro"] body > header *{color:#0D2944!important}
html body .logo span{color:var(--ter)!important}

/* ---------- TEXTO SEM CORTE ---------- */
html body .kpi,html body .ind,html body .card,html body .painel{overflow:visible!important}
html body .kpi .val,html body .ind .val{
  overflow:visible!important;white-space:normal!important;
  line-height:1.15!important;padding-bottom:2px!important;word-break:normal}
html body .kpi .rot,html body .ind .nome{
  white-space:normal!important;overflow:visible!important;line-height:1.35!important}
html body .painel > header h3,html body .card > header h3{
  line-height:1.3!important;overflow:visible!important}
html body .linha-serv .nome b,html body .linha-serv .nome span{
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
html body td{white-space:normal!important}
html body td.ts,html body td.num,html body th{white-space:nowrap!important}


/* ============================================================
   CONTEUDO SEM CORTE NA BORDA DO CARTAO
   ============================================================ */
html body .painel > div:not(header),html body .painel > .conteudo{
  padding-left:22px!important;padding-right:22px!important;
  box-sizing:border-box!important;overflow-x:auto!important}

/* linhas de lista: reserva espaco para o valor da direita */
html body .linha-serv{
  display:flex!important;align-items:center!important;gap:16px!important;
  padding:14px 0!important;box-sizing:border-box!important}
html body .linha-serv .nome{flex:1 1 auto!important;min-width:0!important;overflow:hidden}
html body .linha-serv .cifra,html body .linha-serv > div:last-child{
  flex:0 0 auto!important;text-align:right!important;
  padding-right:2px!important;white-space:nowrap!important}
html body .linha-serv .cifra b{display:block;white-space:nowrap}
html body .linha-serv .cifra span{display:block;font-size:11.5px;color:var(--muted)!important;white-space:nowrap}

/* grade do dashboard: colunas nao encostam na borda */
html body .dash-cols{padding:0!important}
html body .dash-cols > .painel{min-width:0!important}

/* cartoes com conteudo largo ganham rolagem interna em vez de cortar */
html body .card > .tabela,html body .painel .tabela,
html body .dre-wrap,html body #x-tab,html body #p-tab,html body #lista,
html body #r-lista,html body #i-lista,html body #c-tab,html body #fr-tab{
  overflow-x:auto!important;max-width:100%!important}

/* legenda de pagamento quebra em vez de estourar */
html body .legenda,html body .legenda-g{
  flex-wrap:wrap!important;row-gap:6px!important}
html body .legenda span,html body .legenda-g span{white-space:nowrap}


/* AREA DO USUARIO NO TOPO */
html body .topbar-user{background:var(--card2)!important;border:1px solid var(--borda)!important;border-radius:24px!important}
html[data-tema="claro"] body .topbar-user,html[data-tema="claro"] body .topbar-user *{color:#0D2944!important}
html[data-tema="escuro"] body .topbar-user,html[data-tema="escuro"] body .topbar-user *{color:#EDF2F7!important}
html body .topbar-user .avatar{background:var(--ter)!important;color:#fff!important}


/* ============================================================
   GRADE SEM ESTOURO — cartoes cabem na tela
   ============================================================ */
html body main,html body .conteudo,html body .tab-pane{
  max-width:100%!important;box-sizing:border-box!important;overflow-x:hidden!important}
html body .dash-cols,html body .grid2{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:18px!important;max-width:100%!important}
@media(max-width:900px){html body .dash-cols,html body .grid2{grid-template-columns:1fr!important}}
html body .dash-cols > *,html body .grid2 > *{min-width:0!important;max-width:100%!important}
html body .dash-kpis{display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;
  gap:16px!important;max-width:100%!important}
html body .dash-kpis > *{min-width:0!important}


/* ============================================================
   CARTAO DO PERFIL NO TOPO
   ============================================================ */
html body .topbar-user{
  display:flex!important;align-items:center!important;gap:11px!important;
  background:var(--card2)!important;border:1px solid var(--borda)!important;
  border-radius:12px!important;padding:7px 15px 7px 8px!important;
  box-shadow:none!important;transition:border-color .15s}
html body .topbar-user:hover{border-color:var(--ter)!important}
html body .topbar-user > *{background:transparent!important}

/* inicial em circulo terracota */
html body .topbar-user > :first-child{
  width:34px!important;height:34px!important;min-width:34px!important;
  border-radius:50%!important;background:var(--ter)!important;color:#fff!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  font-weight:700!important;font-size:14px!important;flex:0 0 auto!important}

/* nome e nivel */
html body .topbar-user > :last-child{
  display:flex!important;flex-direction:column!important;line-height:1.25!important;
  align-items:flex-start!important;text-align:left!important}
html[data-tema="claro"] body .topbar-user > :last-child > :first-child{color:#0D2944!important}
html[data-tema="escuro"] body .topbar-user > :last-child > :first-child{color:#EDF2F7!important}
html body .topbar-user > :last-child > :first-child{font-weight:600!important;font-size:13.5px!important}
html body .topbar-user > :last-child > :last-child{
  color:var(--muted)!important;font-size:11px!important;
  text-transform:uppercase!important;letter-spacing:.6px!important;font-weight:600!important}


/* ============================================================
   ALINHAMENTO DOS CAMPOS EM LINHA
   ============================================================ */
html body .linha{align-items:flex-end!important}
html body .linha > div{display:flex!important;flex-direction:column!important;justify-content:flex-end!important}

/* rotulo com altura fixa: campos ficam na mesma base */
html body .linha > div > label{
  display:block!important;margin:0 0 6px!important;
  line-height:1.3!important;min-height:16px!important}

/* o combo do fornecedor tem uma div extra dentro */
html body .linha > .combo{position:relative!important;justify-content:flex-end!important}
html body .combo > label{margin:0 0 6px!important}
html body #f-tipo-chip{position:absolute!important;top:100%!important;left:0!important;
  margin-top:3px!important;font-size:11.5px!important;pointer-events:none}

/* todos os campos com a mesma altura */
html body .linha input,html body .linha select{
  height:42px!important;box-sizing:border-box!important}
html body .linha textarea{box-sizing:border-box!important}
html body .linha button{height:42px!important;padding-top:0!important;padding-bottom:0!important}


/* ============================================================
   CAIXAS DE MARCAR — caixinha e texto na mesma linha
   ============================================================ */
html body .linha > div:has(> input[type=checkbox]){
  flex-direction:row!important;align-items:center!important;gap:9px!important}
html body .linha > div > input[type=checkbox]{
  width:18px!important;height:18px!important;flex:0 0 auto!important;margin:0!important}
html body .linha > div > input[type=checkbox] + label{
  margin:0!important;min-height:0!important;color:var(--claro)!important;
  font-size:13.5px!important;font-weight:500!important;cursor:pointer;white-space:nowrap}

/* o bloco de repetir tambem */
html body #f-repetir{width:18px!important;height:18px!important;flex:0 0 auto!important}
html body label[for="f-repetir"]{margin:0!important;min-height:0!important;
  color:var(--claro)!important;font-size:13.5px!important;font-weight:500!important}

/* etiquetas de pessoas */
html body #f-pessoas label{flex-direction:row!important;align-items:center!important;
  min-height:0!important;margin:0!important}
html body .pessoa-chk{width:15px!important;height:15px!important;flex:0 0 auto!important;margin:0!important}


/* ============================================================
   COMPONENTES PADRAO — usados por PP.* em base.js
   Um jeito so de montar tabela, estado, filtro e aviso.
   ============================================================ */

/* ---------- tabela ---------- */
html body .pp-rolagem{overflow-x:auto;max-width:100%;margin:0 -4px}
html body .pp-tabela{width:100%;border-collapse:collapse;font-size:13.5px}
html body .pp-tabela th{
  text-align:left;font-size:10px;letter-spacing:.9px;text-transform:uppercase;
  padding:12px 10px;font-weight:700;color:var(--muted)!important;
  background:var(--card-topo)!important;white-space:nowrap;
  position:sticky;top:0;z-index:1}
html body .pp-tabela th.num{text-align:right}
html body .pp-tabela td{
  padding:12px 10px;border-bottom:1px solid var(--borda)!important;vertical-align:middle}
html body .pp-tabela td.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
html body .pp-tabela td.peq{font-size:12.5px;color:var(--muted)!important}
html body .pp-tabela tbody tr:hover td{background:var(--ter-suave)!important}
html body .pp-tabela tbody tr:last-child td{border-bottom:none!important}
html body .pp-tabela tr.apagada td{opacity:.5}
html body .pp-tabela tr.alerta td{background:rgba(227,100,87,.08)!important}
html body .pp-tabela tfoot td{
  font-weight:700;border-top:2px solid var(--borda)!important;
  background:var(--card-topo)!important;padding:13px 10px}

/* ---------- estados: carregando, vazio, erro ---------- */
html body .pp-estado{text-align:center;padding:38px 22px;color:var(--muted)!important}
html body .pp-vazio-t{font-family:'Fraunces',serif;font-size:16px;
  color:var(--claro)!important;margin:0 0 6px}
html body .pp-vazio-d{font-size:13px;margin:0;line-height:1.55;max-width:44ch;
  margin-left:auto;margin-right:auto}
html body .pp-estado.pp-erro .pp-vazio-t{color:var(--verm)!important}
html body .pp-estado button{margin-top:14px}
html body .pp-girando{
  width:26px;height:26px;margin:0 auto 14px;border-radius:50%;
  border:2.5px solid var(--borda);border-top-color:var(--ter);
  animation:pp-girar .7s linear infinite}
@keyframes pp-girar{to{transform:rotate(360deg)}}

/* ---------- filtros em pilula ---------- */
html body .pp-chip{
  padding:9px 18px;border-radius:22px;font-size:13.5px;font-weight:600;
  cursor:pointer;height:auto;font-family:inherit;
  border:1px solid var(--borda)!important;
  background:var(--card2)!important;color:var(--claro)!important;
  transition:all .14s}
html body .pp-chip:hover{border-color:var(--ter)!important}
html body .pp-chip.on{background:var(--ter)!important;color:#fff!important;border-color:var(--ter)!important}
html body .pp-chip .n{opacity:.62;margin-left:7px;font-weight:500}

/* ---------- indicadores ---------- */
html body .pp-kpi-nota{font-size:11.5px;margin-top:4px;opacity:.72;line-height:1.4}

/* ---------- avisos ---------- */
html body #pp-aviso{
  position:fixed;right:16px;bottom:16px;z-index:9500;
  display:flex;flex-direction:column;gap:9px;max-width:370px}
html body .pp-toast{
  padding:13px 17px;border-radius:11px;color:#fff;font-size:13.5px;line-height:1.5;
  box-shadow:0 8px 26px rgba(0,0,0,.42);transition:opacity .4s;
  background:var(--ter)}
html body .pp-toast.ok{background:#3DBA7C}
html body .pp-toast.erro{background:#E36457}

/* ---------- edicao na celula ---------- */
html body .pp-cel-input{
  width:110px;padding:5px 8px!important;font-size:12.5px!important;
  height:auto!important;text-align:right;border-radius:6px!important}

/* ---------- formulario padrao ---------- */
html body .linha{align-items:flex-end}
html body .linha > div{display:flex;flex-direction:column;justify-content:flex-end}
html body .linha > div > label{min-height:16px;margin:0 0 6px!important;line-height:1.3}
html body .linha input,html body .linha select{height:42px;box-sizing:border-box}
html body .linha button{height:42px}


/* ============================================================
   CAMPOS LEGIVEIS NOS DOIS TEMAS
   Regras antigas fixavam texto claro nos campos; no tema claro o
   numero sumia. Esta regra vence todas e segue a variavel do tema.
   ============================================================ */
html[data-tema] body input, html[data-tema] body select, html[data-tema] body textarea,
html[data-tema] body .card input, html[data-tema] body .card select,
html[data-tema] body .painel input, html[data-tema] body .painel select,
html[data-tema] body table input, html[data-tema] body td input,
html:not([data-tema]) body .card input, html:not([data-tema]) body table input,
html:not([data-tema]) body td input{
  color:var(--claro)!important;
  -webkit-text-fill-color:var(--claro)!important;
  background:var(--entrada)!important;
  border:1px solid var(--borda-forte)!important;
  opacity:1!important}
html[data-tema] body input::placeholder, html[data-tema] body textarea::placeholder{
  color:var(--muted)!important;-webkit-text-fill-color:var(--muted)!important;opacity:.75!important}
html[data-tema] body input:disabled, html[data-tema] body input[readonly]{
  color:var(--claro)!important;-webkit-text-fill-color:var(--claro)!important;opacity:.85!important}
html[data-tema] body td input{font-weight:600!important;text-align:right}

/* ============================================================
   FILTROS DA TABELA DE PRECOS, MARCAS E PREJUIZO
   ============================================================ */
html body #tp-filtros{margin:0 0 14px}
html body .tp-f-linha{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
html body #tp-busca{flex:0 0 250px;padding:9px 13px!important;border-radius:9px!important;height:auto!important}
html body .tp-chips{display:flex;gap:7px;flex-wrap:wrap}
html body .tp-chip{padding:8px 15px;border-radius:20px;font-size:13px;font-weight:600;cursor:pointer;
  font-family:inherit;border:1px solid var(--borda)!important;background:var(--card2)!important;
  color:var(--claro)!important;transition:all .14s;height:auto}
html body .tp-chip:hover{border-color:var(--ter)!important}
html body .tp-chip.on{background:var(--ter)!important;color:#fff!important;border-color:var(--ter)!important}
html body .tp-conta{margin-left:auto;font-size:12.5px;color:var(--muted)!important}
html body .tp-neg-n{color:var(--verm)!important}

/* selo da marca em cada linha */
html body .tp-selo{display:inline-block;margin-left:9px;padding:2px 8px;border-radius:11px;
  font-size:9.5px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;vertical-align:middle}
html body .tp-bubbles{background:rgba(233,64,138,.16);color:#E9408A}
html body .tp-petco{background:rgba(61,150,186,.16);color:#3D96BA}
html body .tp-hydra{background:rgba(120,140,165,.16);color:var(--muted)}

/* linha no prejuizo */
html body tr.tp-prejuizo td{background:rgba(227,100,87,.10)!important}
html body tr.tp-prejuizo td:first-child{box-shadow:inset 3px 0 0 var(--verm)}
html body .tp-aviso{display:inline-block;margin-left:9px;padding:2px 9px;border-radius:11px;
  font-size:9.5px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;
  background:var(--verm);color:#fff}
html body .tp-alerta{border-radius:12px;padding:14px 18px;margin:0 0 14px;font-size:13.5px;line-height:1.6;
  background:rgba(227,100,87,.11);border:1px solid rgba(227,100,87,.32);color:var(--verm)!important}

/* ============================================================
   MENU LATERAL — mais contraste e hierarquia
   ============================================================ */
html body .sidebar-section{font-size:10px!important;letter-spacing:1.1px!important;font-weight:800!important;
  color:var(--muted)!important;opacity:.85;padding:16px 18px 7px!important}
html body .sidebar .nav-item{border-radius:9px;margin:1px 8px;padding:9px 12px!important;transition:all .13s}
html body .sidebar .nav-item:hover{background:var(--ter-suave)!important}
html body .sidebar .nav-item .nav-label{font-weight:600!important;color:var(--claro)!important}
html body .sidebar .nav-item .nav-desc{color:var(--muted)!important;font-size:11.5px!important}
html body .sidebar .nav-item.on,html body .sidebar .nav-item.ativo{
  background:var(--ter)!important}
html body .sidebar .nav-item.on .nav-label,html body .sidebar .nav-item.ativo .nav-label{color:#fff!important}
html body .sidebar .nav-item.on .nav-desc,html body .sidebar .nav-item.ativo .nav-desc{color:rgba(255,255,255,.82)!important}

/* ============================================================
   MENU LATERAL FORTE — contraste e seçao ativa em destaque
   ============================================================ */
html body .sidebar{border-right:1px solid var(--borda)}
html body .sidebar-section.sec-cab{
  color:var(--claro)!important;font-size:11.5px!important;letter-spacing:.8px!important;
  font-weight:800!important;padding:11px 16px!important;margin:2px 8px;border-radius:9px;
  cursor:pointer;opacity:1!important;display:flex;align-items:center;transition:all .13s}
html body .sidebar-section.sec-cab:hover{background:var(--ter-suave)!important;color:var(--ter)!important}
html body .sidebar-section.sec-cab.temativo{
  background:var(--ter)!important;color:#fff!important;box-shadow:0 2px 8px rgba(203,78,34,.28)}
html body .sidebar-section.sec-cab.temativo *{color:#fff!important}
html body .sec-fly{border-radius:13px!important;box-shadow:0 10px 32px rgba(0,0,0,.16)!important}
html body .sec-fly .nav-item{border-radius:9px;margin:2px 6px}
html body .sec-fly .nav-item:hover{background:var(--ter-suave)!important}

/* ============================================================
   ROAS NO BORDERO
   ============================================================ */
html body .roas-extra{margin:14px 0;padding:14px 16px;border-radius:11px;background:var(--card2);
  border:1px solid var(--borda)}
html body .roas-inv b{font-size:12.5px;display:block;margin-bottom:9px;color:var(--claro)}
html body .roas-linha{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
html body .roas-linha label{font-size:12px;color:var(--muted)!important;margin:0!important;min-height:0!important}
html body .roas-linha input{width:120px!important;padding:8px 11px!important;height:auto!important;text-align:right}
html body .roas-resumo{display:flex;gap:18px;flex-wrap:wrap;margin-top:12px;padding-top:12px;
  border-top:1px solid var(--borda);font-size:12.5px;color:var(--muted)}
html body .roas-resumo b{color:var(--claro);font-size:13.5px}
html body .roas-n b{font-size:15px}
html body .roas-n.bom b{color:var(--verde)!important}
html body .roas-n.ok b{color:var(--amber)!important}
html body .roas-n.ruim b{color:var(--verm)!important}

/* grade dos campos de ROAS */
html body .roas-tit{font-size:12.5px;font-weight:700;color:var(--claro);margin-bottom:9px}
html body .roas-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:9px 14px;align-items:center}
html body .roas-grid label{font-size:12.5px;color:var(--muted)!important;margin:0!important;
  min-height:0!important;text-align:right;padding-right:4px}
html body .roas-grid input{width:100%!important;padding:9px 12px!important;height:auto!important;
  text-align:right;border-radius:9px!important}
@media(min-width:620px){html body .roas-grid{grid-template-columns:140px 1fr 140px 1fr}}

/* filtro de clubinho na rentabilidade */
html body .rent-clube-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  padding:12px 16px;margin-bottom:14px;border-radius:11px;background:var(--card2);
  border:1px solid var(--borda)}
html body .rent-clube-bar label{display:flex;align-items:center;gap:9px;margin:0!important;
  font-size:13.5px;font-weight:600;color:var(--claro)!important;cursor:pointer;min-height:0!important}
html body .rent-clube-bar input[type=checkbox]{width:17px!important;height:17px!important;
  accent-color:var(--ter);margin:0!important}
html body #rent-clube-info{margin-left:auto;font-size:12.5px;color:var(--muted)!important}
html body #rent-clube-info b{color:var(--amber)!important}

/* ============================================================
   SUBMENU QUE NAO TRAVA — fantasma nao bloqueia mais o clique
   ============================================================ */
html body .sec-fly{
  pointer-events:none!important;
  transition:opacity .12s ease, visibility .12s!important;
  background:var(--card)!important;
  border:1px solid var(--borda)!important}
html body .sec-fly.aberto,html body .sec-fly.on,html body .sec-fly.ativo,
html body .sec-fly:hover,html body .sec-cab:hover + .sec-fly{pointer-events:auto!important}

/* itens do submenu sempre legiveis */
html body .sec-fly .nav-item .nav-label{color:var(--claro)!important}
html body .sec-fly .nav-item .nav-desc{color:var(--muted)!important}
html body .sec-fly .nav-item.on,html body .sec-fly .nav-item.ativo{background:var(--ter)!important}
html body .sec-fly .nav-item.on .nav-label,html body .sec-fly .nav-item.ativo .nav-label{color:#fff!important}
html body .sec-fly .nav-item.on .nav-desc,html body .sec-fly .nav-item.ativo .nav-desc{color:rgba(255,255,255,.85)!important}

/* ============================================================
   CORES COERENTES NOS DOIS TEMAS
   Nenhum texto usa cor fixa: tudo deriva das variaveis.
   ============================================================ */
html[data-tema="claro"]{--verde:#1B7F52;--amber:#9A6209;--verm:#C0392B}
html[data-tema="escuro"]{--verde:#3DBA7C;--amber:#E0A340;--verm:#E36457}

/* barra de topo */
html body .topbar{background:var(--card)!important;border-bottom:1px solid var(--borda)!important}
html body .topbar-brand,html body .topbar-brand *{color:var(--claro)!important}
html body .topbar-brand span{color:var(--ter)!important}
html body .btn-sair{color:var(--claro)!important;border-color:var(--borda)!important;
  background:var(--card2)!important}
html body .topbar-user{background:var(--card2)!important;border:1px solid var(--borda)!important}
html body .user-nm{color:var(--claro)!important}
html body .user-role{color:var(--muted)!important}

/* menu */
html body .seta{color:var(--muted)!important;opacity:.7}
html body .fly-tit{color:var(--ter)!important}

/* textos de apoio */
html[data-tema] body .sub,html[data-tema] body p.sub,html[data-tema] body div.sub{color:var(--muted)!important}
html body .kpi .rot{color:var(--muted)!important}
html body .kpi .val{color:var(--claro)!important}
html body .kpi.dark .rot,html body .kpi.destaque .rot{color:rgba(255,255,255,.85)!important}
html body .kpi.dark .val,html body .kpi.destaque .val,
html body .kpi.dark .val *,html body .kpi.destaque .val *{color:#fff!important}
html body .kpi.dark .sub,html body .kpi.destaque .sub{color:rgba(255,255,255,.8)!important}

/* restos de cor fixa em estilo embutido */
html[data-tema] body [style*="13,41,68"],html[data-tema] body [style*="13, 41, 68"]{color:var(--muted)!important}
html[data-tema] body [style*="#0D2944"],html[data-tema] body [style*="#0d2944"]{color:var(--claro)!important}

/* numeros coloridos com peso para compensar contraste */
html body .pos,html body b.pos{color:var(--verde)!important;font-weight:700}
html body .neg,html body b.neg{color:var(--verm)!important;font-weight:700}

/* ============================================================
   PALETA ANTIGA SEGUE O TEMA
   O index tinha 23 variaveis fixas do tema claro que o escuro
   nunca trocava. Aqui elas passam a derivar do tema atual.
   ============================================================ */
html[data-tema="claro"]{
  --surface:#FFFFFF; --surface2:#EDE7D7; --surface3:#E2D8C2;
  --border:rgba(13,41,68,.10); --border2:rgba(13,41,68,.18);
  --linha:rgba(13,41,68,.08); --linha-nav:rgba(13,41,68,.10);
  --accent:#CB4E22; --accent-dim:rgba(203,78,34,.10); --accent2:#0D2944;
  --text:#0D2944; --muted:#4A6A8A; --muted2:#7A9AB8;
  --navy:#0D2944; --terra:#CB4E22; --creme:#F2EEE2; --creme-2:#EDE7D7;
  --ok:#1B7F4B; --alerta:#B3261E; --danger:#C0392B; --warn:#9A6209; --info:#0369A1}

html[data-tema="escuro"]{
  --surface:#16293D; --surface2:#22405C; --surface3:#1B3149;
  --border:rgba(237,242,247,.14); --border2:rgba(237,242,247,.22);
  --linha:rgba(237,242,247,.10); --linha-nav:rgba(237,242,247,.12);
  --accent:#D4632F; --accent-dim:rgba(212,99,47,.16); --accent2:#EDF2F7;
  --text:#EDF2F7; --muted:#93A9C0; --muted2:#7C93AC;
  --navy:#EDF2F7; --terra:#D4632F; --creme:#16293D; --creme-2:#22405C;
  --ok:#3DBA7C; --alerta:#E36457; --danger:#E36457; --warn:#E0A340; --info:#5BA4CF}

/* ============================================================
   ABAS DO FINANCEIRO
   ============================================================ */
html body #abas{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}
html body #abas .aba{
  padding:10px 20px;border-radius:11px;font-size:13.5px;font-weight:600;
  text-decoration:none!important;cursor:pointer;transition:all .14s;
  border:1px solid var(--borda)!important;background:var(--card2)!important;
  color:var(--claro)!important}
html body #abas .aba:hover{border-color:var(--ter)!important;background:var(--ter-suave)!important}
html body #abas .aba.on{background:var(--ter)!important;color:#fff!important;
  border-color:var(--ter)!important;box-shadow:0 2px 8px rgba(203,78,34,.26)}

/* ============================================================
   TIPO DE CONTA — seletor compacto
   ============================================================ */
html body .tipo-btns{display:inline-flex;gap:0;flex-wrap:nowrap;margin-top:5px;
  padding:3px;border-radius:11px;background:var(--card2);border:1px solid var(--borda)}
html body .tipo-btns .tbtn{
  flex:0 0 auto;text-align:center;padding:8px 18px;border-radius:9px;cursor:pointer;
  border:none!important;background:transparent!important;color:var(--muted)!important;
  font-size:13px;font-weight:600;line-height:1.2;transition:all .13s;height:auto;
  white-space:nowrap}
html body .tipo-btns .tbtn span{display:none}
html body .tipo-btns .tbtn:hover{color:var(--claro)!important}
html body .tipo-btns .tbtn.on{
  background:var(--ter)!important;color:#fff!important;
  box-shadow:0 1px 4px rgba(203,78,34,.30)}

/* a explicacao do modo escolhido, abaixo do seletor */
html body #tipo-dica{font-size:12px;color:var(--muted);margin-top:7px}


/* ============================================================
   BOTOES DE ACAO NA MESMA LINHA
   A ultima coluna nao quebra mais em duas linhas.
   ============================================================ */
html body .pp-tabela td:last-child,html body table td:last-child{
  white-space:nowrap!important;text-align:right}
html body .pp-tabela td:last-child button,html body table td:last-child button{
  display:inline-block!important;vertical-align:middle;margin:0 0 0 5px!important;float:none!important}
html body .pp-tabela td:last-child .btn2,html body .pp-tabela td:last-child .perigo,
html body .pp-tabela td:last-child .ok-b{margin:0 0 0 5px!important}

/* a tabela rola na horizontal em vez de espremer as colunas */
html body .pp-rolagem,html body .tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
html body .pp-tabela{min-width:900px}

/* ============================================================
   DIA PREVISTO NO CALENDARIO DO FLUXO
   ============================================================ */
html body .dia.prev{border-style:dashed;opacity:.72}
html body .dia.prev .v,html body .dia.prev .s{opacity:.85}

/* ============================================================
   JANELAS FICAM FECHADAS ATE ALGUEM ABRIR
   ============================================================ */
html body .modal:not(.modal-ov > .modal){
  display:none;position:fixed;inset:0;z-index:9000;
  align-items:center;justify-content:center;padding:24px;
  background:rgba(4,12,22,.62);backdrop-filter:blur(3px);overflow-y:auto}
html body .modal[style*="flex"]{display:flex!important}
html body .modal > .box{max-height:90vh;overflow-y:auto;width:100%}

/* ============================================================
   TROCA DE TELA SEM PISCAR ENTRE OS TEMAS
   ============================================================ */
html:not([data-tema]){visibility:hidden}
html[data-tema]{visibility:visible}
html body iframe{background:var(--bg);border:0}

/* ============================================================
   TABELA DE CONTAS ALINHADA
   Linhas com a mesma altura, sem texto quebrando.
   ============================================================ */
html body #tabela .pp-tabela{table-layout:fixed;width:100%;min-width:1180px}
html body #tabela .pp-tabela th,
html body #tabela .pp-tabela td{
  vertical-align:middle;padding:11px 10px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* largura de cada coluna, na ordem da tela */
html body #tabela .pp-tabela th:nth-child(1),
html body #tabela .pp-tabela td:nth-child(1){width:88px}
html body #tabela .pp-tabela th:nth-child(2),
html body #tabela .pp-tabela td:nth-child(2){width:150px}
html body #tabela .pp-tabela th:nth-child(3),
html body #tabela .pp-tabela td:nth-child(3){width:150px}
html body #tabela .pp-tabela th:nth-child(4),
html body #tabela .pp-tabela td:nth-child(4){width:auto;min-width:180px}
html body #tabela .pp-tabela th:nth-child(5),
html body #tabela .pp-tabela td:nth-child(5){width:108px}
html body #tabela .pp-tabela th:nth-child(6),
html body #tabela .pp-tabela td:nth-child(6){width:108px}
html body #tabela .pp-tabela th:nth-child(7),
html body #tabela .pp-tabela td:nth-child(7){width:112px}
html body #tabela .pp-tabela th:nth-child(8),
html body #tabela .pp-tabela td:nth-child(8){width:112px}
html body #tabela .pp-tabela th:nth-child(9),
html body #tabela .pp-tabela td:nth-child(9){width:104px}
html body #tabela .pp-tabela th:nth-child(10),
html body #tabela .pp-tabela td:nth-child(10){width:92px}
html body #tabela .pp-tabela th:last-child,
html body #tabela .pp-tabela td:last-child{width:210px;text-align:right}

/* o nome completo aparece ao passar o mouse */
html body #tabela .pp-tabela td b{
  display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #tabela .pp-tabela td:last-child button{
  display:inline-block!important;margin:0 0 0 5px!important;padding:7px 13px!important;
  font-size:12.5px!important;vertical-align:middle}

/* ============================================================
   PREENCHIMENTO AUTOMATICO DO NAVEGADOR
   ============================================================ */
html body input:-webkit-autofill,
html body input:-webkit-autofill:hover,
html body input:-webkit-autofill:focus,
html body input:-webkit-autofill:active,
html body textarea:-webkit-autofill{
  -webkit-text-fill-color:var(--claro)!important;
  -webkit-box-shadow:0 0 0 1000px var(--card2) inset!important;
  box-shadow:0 0 0 1000px var(--card2) inset!important;
  caret-color:var(--claro)!important;
  transition:background-color 9999s ease-in-out 0s!important}

html body input[list]{background-color:var(--card2)!important;color:var(--claro)!important}
html body input[list]:focus{background-color:var(--card2)!important;color:var(--claro)!important;border-color:var(--ter)!important}
html body input::placeholder,html body textarea::placeholder{color:var(--muted)!important;opacity:1}
