/* =========================================================
   FINANCEIRO PESSOAL — ESTILO MODULAR
   ========================================================= */
.financeiro-pessoal-aviso{margin-bottom:14px;padding:12px 16px;background:#eef6ff;border:1px solid #bfd5f0;border-left:4px solid #1457a6;border-radius:8px;color:#244463;font-size:13px}
.filtros-financeiro-pessoal{display:grid;grid-template-columns:105px 140px 160px 180px minmax(220px,1fr) 90px 90px;gap:10px;align-items:end;margin-bottom:12px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}
.filtros-financeiro-pessoal .field{margin:0;min-width:0}.filtros-financeiro-pessoal select,.filtros-financeiro-pessoal input{width:100%;height:42px}.filtros-financeiro-pessoal button{height:42px;border:0;padding:0 14px;font-weight:700;cursor:pointer;background:var(--gold);color:#17263c}.filtros-financeiro-pessoal button:last-child{background:var(--navy-900);color:#fff}
.fp-acoes-topo{display:flex;justify-content:flex-end;margin-bottom:14px}.fp-btn-gerenciar{height:38px;padding:0 14px;border:1px solid #b9c7d8;background:#fff;color:#17365c;font-weight:700;cursor:pointer}
.financeiro-pessoal-cards .kpi-card:nth-child(1){border-top:3px solid #1457a6}.financeiro-pessoal-cards .kpi-card:nth-child(2){border-top:3px solid #17966a}.financeiro-pessoal-cards .kpi-card:nth-child(3){border-top:3px solid #e59a24}.financeiro-pessoal-cards .kpi-card:nth-child(4){border-top:3px solid #4b2bbd}
.financeiro-pessoal-graficos-variados{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.fp-grafico-pizza-panel{grid-column:1/-1}.financeiro-pessoal-graficos-variados .panel{margin:0;min-height:310px}
.fp-barra-item{margin-bottom:14px}.fp-barra-topo{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px;font-size:12px}.fp-barra-topo span{color:#52657c}.fp-barra-fundo{height:14px;background:#e7edf5;border-radius:999px;overflow:hidden}.fp-barra-preenchimento{height:100%;background:linear-gradient(90deg,#1457a6,#17966a);border-radius:999px}
.fp-colunas{height:235px;display:flex;align-items:flex-end;gap:8px;padding:12px 8px 0;border-bottom:1px solid #dbe3ee}.fp-coluna-item{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center}.fp-coluna-valor{height:26px;font-size:9px;color:#53667c;white-space:nowrap;transform:rotate(-25deg);transform-origin:center}.fp-coluna-barra{width:min(28px,70%);background:linear-gradient(180deg,#2b7de0,#174f9b);border-radius:4px 4px 0 0}.fp-coluna-item span{margin-top:6px;font-size:11px;font-weight:700;color:#45576d}
.fp-pizza-area{display:grid;grid-template-columns:260px 1fr;gap:28px;align-items:center;justify-content:center}.fp-pizza{width:230px;height:230px;border-radius:50%;display:grid;place-items:center}.fp-pizza-centro{width:125px;height:125px;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 0 0 1px #e1e7ef}.fp-pizza-centro strong{font-size:18px}.fp-pizza-centro span{font-size:11px;color:#6a7889}.fp-pizza-legenda{display:grid;gap:9px}.fp-pizza-legenda>div{display:grid;grid-template-columns:12px 1fr auto;gap:8px;align-items:center;font-size:12px}.fp-pizza-legenda i{width:10px;height:10px;border-radius:2px}.fp-pizza-legenda strong{color:#263b55}
.fp-detalhamento-topo{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:14px}.fp-detalhamento-topo h3{margin:0 0 4px}.fp-resumo-tabela{font-weight:700;color:#36536f;white-space:nowrap}.tabela-financeiro-pessoal-consulta tbody tr:hover td{background:#f7faff}.fp-descricao-cell{text-align:left;white-space:normal;min-width:280px}.fp-descricao-cell strong{display:block}.fp-descricao-cell small{display:block;margin-top:3px;color:#718096}.fp-tag{display:inline-block;padding:5px 9px;border-radius:999px;background:#eef2f7;color:#40536a;font-size:11px;font-weight:700}.fp-tag-categoria{background:#eaf2ff;color:#174f9b}
.fp-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(3,18,39,.62)}.fp-modal.hidden{display:none!important}.fp-modal-caixa{width:min(920px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.28)}.fp-modal-topo{display:flex;justify-content:space-between;gap:15px;padding:18px 20px;border-bottom:1px solid #e1e7ef}.fp-modal-topo h2{margin:0}.fp-modal-topo p{margin:4px 0 0;color:#65758a}.fp-modal-fechar{width:38px;height:38px;border:0;background:#eef2f7;font-size:25px;cursor:pointer}.fp-nova-categoria{display:grid;grid-template-columns:1fr auto;gap:10px;padding:16px 20px}.fp-nova-categoria input{height:42px}.fp-nova-categoria button,.fp-ger-cat button{border:0;background:#0d3a72;color:#fff;padding:8px 11px;font-weight:700;cursor:pointer}.fp-gerenciador-lista{padding:0 20px 20px}.fp-ger-cat{margin-bottom:12px;border:1px solid #dbe3ee;border-radius:8px;overflow:hidden}.fp-ger-cat.inativo{opacity:.55}.fp-ger-cat-topo{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 14px;background:#f4f7fb}.fp-ger-cat-topo>div,.fp-ger-subs>div>div{display:flex;gap:6px;flex-wrap:wrap}.fp-ger-subs>div{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:9px 14px;border-top:1px solid #edf1f5}.fp-ger-subs>div.inativo{opacity:.5}.fp-ger-cat button{font-size:11px;padding:6px 8px}
@media(max-width:1200px){.filtros-financeiro-pessoal{grid-template-columns:repeat(4,minmax(140px,1fr))}}@media(max-width:850px){.financeiro-pessoal-graficos-variados{grid-template-columns:1fr}.fp-grafico-pizza-panel{grid-column:auto}.fp-pizza-area{grid-template-columns:1fr}.fp-pizza{margin:auto}.filtros-financeiro-pessoal{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.filtros-financeiro-pessoal{grid-template-columns:1fr}.fp-modal-topo,.fp-ger-cat-topo,.fp-ger-subs>div,.fp-detalhamento-topo{display:block}.fp-ger-cat-topo>div,.fp-ger-subs>div>div{margin-top:8px}.fp-pizza-area{display:block}.fp-pizza-legenda{margin-top:18px}}


/* Cards de renda e pró-labore */
.financeiro-pessoal-cards .kpi-card:nth-child(1) { border-top: 3px solid #1457a6; }
.financeiro-pessoal-cards .kpi-card:nth-child(2) { border-top: 3px solid #17966a; }
.financeiro-pessoal-cards .kpi-card:nth-child(3) { border-top: 3px solid #e59a24; }
.financeiro-pessoal-cards .kpi-card:nth-child(4) { border-top: 3px solid #4b2bbd; }
.fp-saldo-positivo { color: #138650 !important; }
.fp-saldo-negativo { color: #b42318 !important; }


/* Tabela dinâmica por categoria e mês */
.fp-matriz-panel { margin-top: 18px; }
.fp-matriz-wrap { max-height: 520px; }
.fp-matriz-tabela th { text-align: center; }
.fp-matriz-tabela th:first-child,
.fp-matriz-tabela td:first-child { text-align: left; min-width: 240px; }
.fp-matriz-categoria td { font-weight: 700; background: #eaf2ff; color: #12345a; }
.fp-matriz-subcategoria td:first-child { padding-left: 28px; color: #52657b; }
.fp-matriz-tabela tfoot td { font-weight: 700; background: #f4f7fb; }
.tabela-financeiro-pessoal-consulta th:nth-child(1),
.tabela-financeiro-pessoal-consulta td:nth-child(1) { width: 125px; }
.tabela-financeiro-pessoal-consulta th:nth-child(3),
.tabela-financeiro-pessoal-consulta td:nth-child(3) { width: 150px; }


/* =========================================================
   TABELA GERENCIAL — PADRÃO VISUAL DA ABA DESPESAS
   ========================================================= */
.fp-matriz-panel{padding:18px;background:#fff;border:1px solid #dbe3ee;border-radius:8px;box-shadow:0 3px 12px rgba(12,35,69,.08)}
.fp-matriz-resumo{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px;padding:14px;background:#f7f9fc;border:1px solid #dbe3ee;border-left:4px solid #17966a;border-radius:8px}
.fp-matriz-resumo-card{min-width:0;padding:11px 13px;background:#fff;border:1px solid #dbe3ee;border-radius:7px}
.fp-matriz-resumo-card span{display:block;margin-bottom:5px;color:#50657e;font-size:10px;font-weight:700;letter-spacing:.2px;text-transform:uppercase}
.fp-matriz-resumo-card strong{display:block;color:#10233f;font-size:18px;font-weight:600;white-space:nowrap}
.fp-matriz-wrap{max-height:560px;border:1px solid #dbe3ee;border-radius:7px}
.fp-matriz-tabela{font-size:12px}
.fp-matriz-tabela th,.fp-matriz-tabela td{padding:9px 11px;border-color:#e1e7ef}
.fp-matriz-tabela th{background:#eef2f7;color:#183653;font-weight:700}
.fp-matriz-tabela th:first-child,.fp-matriz-tabela td:first-child{min-width:290px;text-align:left}
.fp-matriz-tabela .fp-cabecalho-mes{text-align:center}
.fp-matriz-categoria td{background:#dfe7f0!important;color:#132f4d!important;font-weight:700}
.fp-matriz-subcategoria td{background:#fff;color:#40536a}
.fp-matriz-subcategoria td:first-child{padding-left:30px;color:#40536a}
.fp-matriz-tabela tbody tr:hover td{background:#f7faff}
.fp-matriz-tabela tfoot td{background:#dfe7f0!important;color:#132f4d;font-weight:700}
@media(max-width:900px){.fp-matriz-resumo{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.fp-matriz-resumo{grid-template-columns:1fr}.fp-matriz-tabela th:first-child,.fp-matriz-tabela td:first-child{min-width:220px}}


/* Gerenciador de categorias simplificado */
.fp-topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.fp-topbar .fp-btn-gerenciar{margin-top:4px}
.fp-btn-gerenciar{height:40px;padding:0 15px;border:1px solid #b9c7d8;border-radius:7px;background:#fff;color:#17365c;font-weight:700;cursor:pointer;white-space:nowrap}
.fp-btn-gerenciar:hover{background:#f3f7fb}
.fp-modal-caixa{width:min(620px,94vw);max-height:82vh;border-radius:12px}
.fp-modal-topo{padding:17px 18px}
.fp-modal-topo h2{font-size:22px}
.fp-nova-categoria{padding:14px 18px;border-bottom:1px solid #edf1f5}
.fp-gerenciador-lista{padding:14px 18px 18px}
.fp-ger-cat{margin-bottom:10px;border:1px solid #dbe3ee;border-radius:9px;overflow:hidden}
.fp-ger-cat-topo{padding:11px 12px;background:#f5f8fc}
.fp-ger-cat-topo strong{font-size:15px;color:#17365c}
.fp-ger-cat-acoes{display:flex;gap:7px;align-items:center}
.fp-ger-cat button{border:0;border-radius:6px;color:#fff;font-weight:700;cursor:pointer;font-size:11px;padding:7px 9px}
.fp-ger-cat .fp-btn-sub{background:#174f9b}
.fp-ger-cat .fp-btn-excluir{background:#b42318}
.fp-ger-subs>div{padding:8px 12px;min-height:38px}
.fp-ger-subs>div span{color:#40536a}
.fp-ger-cat .fp-btn-excluir-sub{padding:5px 8px;background:#c43b31}
@media(max-width:700px){.fp-topbar{align-items:stretch;flex-direction:column}.fp-topbar .fp-btn-gerenciar{align-self:flex-end}.fp-nova-categoria{grid-template-columns:1fr}.fp-ger-cat-topo{align-items:flex-start;flex-direction:column}.fp-ger-cat-acoes{width:100%;justify-content:flex-end}}
