/* Finanças da Casa · paleta de painel: azul-marinho profundo, azul vivo de destaque, laranja como segunda cor (botão principal e alertas),
   verde para o que entrou/pagou e nenhum vermelho. (As variáveis --ouro* guardam o azul de destaque; o nome ficou de uma versão anterior.) */

:root {
  --fundo: #0a1222; --barra: rgb(10 18 34 / .95); --superficie: #111c31; --superficie-2: #0d1729; --elevado: #15223b; --hover: #172641;
  --texto: #e8edf5; --suave: #8e9bb3; --fraco: #5b6883;
  --linha: #1c2a45; --linha-forte: #26375a;
  --ouro: #3b82f6; --ouro-claro: #8db8fb; --ouro-suave: rgb(59 130 246 / .12);
  --ouro-grad: linear-gradient(135deg, #1e4fd8 0%, #2f6ff0 55%, #3b82f6 100%);
  --laranja: #f97316; --laranja-claro: #fb923c; --laranja-suave: rgb(249 115 22 / .12);
  --sobre-ouro: #ffffff;
  --receber: #34c47c; --receber-suave: rgb(52 196 124 / .12); --pagar: #d3dae6; --pagar-suave: rgb(211 218 230 / .07); --perigo: #e0896f;
  --alerta: #fb923c;
  --grafico-receita: #3b82f6; --grafico-despesa: #f97316;
  --brilho: 0 0 0 1px #2f6ff0;
  --sombra: 0 1px 2px rgb(0 0 0 / .3); --sombra-alta: 0 20px 50px rgb(0 0 0 / .55);
  --raio: 10px; --raio-p: 7px;
  --fonte: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, Roboto, sans-serif;
  --serifa: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.45 var(--fonte); color: var(--texto); -webkit-font-smoothing: antialiased; background: var(--fundo); }
[hidden] { display: none !important; }
::selection { background: rgb(59 130 246 / .35); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1rem; }
h3 { font-size: .9rem; }
a { color: var(--ouro-claro); }
.num, input { font-variant-numeric: tabular-nums; }
.num { white-space: nowrap; font-weight: 600; }
.sub, .dica { color: var(--suave); margin: 0; font-size: .82rem; }
.rotulo { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); }
.ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pagar { color: var(--pagar); } .receber { color: var(--receber); } .ouro { color: var(--ouro-claro); }
.erro { color: var(--perigo); margin: 0; font-size: .85rem; }
.vazio { color: var(--fraco); text-align: center; padding: 1.25rem .5rem; margin: 0; font-size: .85rem; }
.bolinha { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- Botões e campos ---------- */
.btn { font: 500 .85rem/1.2 var(--fonte); display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--linha-forte); background: var(--superficie); color: var(--texto); padding: .5rem .8rem; border-radius: var(--raio-p); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, filter .15s; }
.btn:hover { border-color: #34496f; background: var(--hover); color: var(--texto); }
.btn.primario { background: var(--laranja); border-color: var(--laranja); color: #fff; font-weight: 600; }
.btn.primario:hover { background: var(--laranja-claro); border-color: var(--laranja-claro); color: #fff; }
.btn.leve { background: transparent; border-color: transparent; color: var(--suave); }
.btn.leve:hover { background: var(--ouro-suave); color: var(--ouro-claro); }
.btn.perigo { color: var(--perigo); border-color: rgb(224 137 111 / .35); }
.btn.perigo:hover { background: rgb(224 137 111 / .1); color: var(--perigo); border-color: var(--perigo); }
.btn.mini { padding: .3rem .55rem; font-size: .78rem; }
.btn.icone { padding: .38rem; background: transparent; border-color: transparent; color: var(--suave); }
.btn.icone:hover { background: var(--ouro-suave); color: var(--ouro-claro); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .76rem; color: var(--suave); font-weight: 500; }
input, select, textarea { font: 400 .92rem var(--fonte); color: var(--texto); background: var(--superficie-2); border: 1px solid var(--linha-forte); border-radius: var(--raio-p); padding: .5rem .65rem; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--fraco); }
input:hover, select:hover, textarea:hover { border-color: rgb(59 130 246 / .45); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ouro); box-shadow: 0 0 0 3px rgb(59 130 246 / .18); }
input[type=date]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--texto); -webkit-box-shadow: 0 0 0 1000px var(--superficie-2) inset; transition: background-color 9999s; }
select { appearance: none; padding-right: 1.8rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e9bb3' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .5rem center; background-size: 14px; }
select option { background: var(--superficie); color: var(--texto); }
input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--ouro); padding: 0; margin: 0; cursor: pointer; }
.linha { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; }
.linha > label { flex: 1 1 140px; }
.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--texto); font-size: .88rem; cursor: pointer; }
.segmentos { display: inline-flex; background: var(--superficie-2); border: 1px solid var(--linha-forte); border-radius: var(--raio-p); padding: 2px; gap: 2px; }
.segmentos button, .segmentos label { font: 500 .82rem var(--fonte); border: 0; background: transparent; color: var(--suave); padding: .42rem .75rem; border-radius: 5px; cursor: pointer; white-space: nowrap; flex-direction: row; justify-content: center; }
.segmentos input { position: absolute; opacity: 0; pointer-events: none; }
.segmentos .ativo, .segmentos label:has(input:checked) { background: var(--ouro); color: #fff; box-shadow: none; }
.segmentos label:has(input[value=entrada]:checked) { color: var(--receber); }
.segmentos label:has(input[value=fixa]:checked), .segmentos label:has(input[value=variavel]:checked) { color: var(--pagar); }

/* ---------- Topo ---------- */
.topo { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .55rem clamp(.9rem, 2.5vw, 2rem); background: var(--barra); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linha); }
.marca { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--serifa); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; }
.marca span { color: var(--texto); }
.marca img { width: 30px; height: 30px; }
.topo-centro { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topo-acoes { display: flex; align-items: center; gap: .5rem; }
.seletor-mes { display: inline-flex; align-items: center; gap: 2px; background: var(--superficie-2); border: 1px solid var(--linha-forte); border-radius: var(--raio-p); padding: 2px; }
.seletor-mes .btn { border: 0; padding: .35rem; background: transparent; color: var(--ouro); }
.seletor-mes .btn:hover { background: var(--ouro-suave); }
.seletor-mes strong { min-width: 8.5rem; text-align: center; font-weight: 600; color: var(--ouro-claro); font-size: .92rem; cursor: pointer; position: relative; }
.seletor-mes strong input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seletor-mes .hoje { font-size: .74rem; color: var(--suave); padding: .3rem .5rem; }
.voltar { display: inline-flex; align-items: center; gap: .35rem; color: var(--suave); text-decoration: none; font-size: .88rem; }
.voltar:hover { color: var(--ouro-claro); }
.menu-mais { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: var(--elevado); border: 1px solid var(--linha-forte); border-radius: var(--raio); box-shadow: var(--sombra-alta); padding: .35rem; display: flex; flex-direction: column; z-index: 40; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--raio-p); color: var(--texto); text-decoration: none; font: 400 .9rem var(--fonte); background: none; border: 0; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--ouro-suave); color: var(--ouro-claro); }
.menu-pop a.ativo { color: var(--ouro-claro); }
.menu-pop .ic { color: var(--ouro); }
.menu-quem { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem .7rem; border-bottom: 1px solid var(--linha); margin-bottom: .3rem; }
.menu-quem b { display: block; font-weight: 600; }
.menu-quem small { color: var(--suave); font-size: .75rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ouro); color: #fff; font-weight: 700; font-size: .85rem; flex: none; }
main { padding: 1.1rem clamp(.9rem, 2.5vw, 2rem) 6rem; max-width: 1480px; margin: 0 auto; }
.pagina-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagina-topo .sub { margin-top: .2rem; }

/* ---------- Cartões genéricos ---------- */
.cartao { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 1rem 1.1rem; min-width: 0; }
.cartao-topo { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.grade { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .8rem; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; } .col-12 { grid-column: 1 / -1; }

/* ---------- Resumo do mês (KPIs) ---------- */
.kpis { display: grid; grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kpi { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: .75rem .95rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; position: relative; overflow: hidden; }

.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ouro); opacity: .7; }
.kpi.saldo::after { display: none; }
.kpi strong { font-size: 1.35rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; }
.kpi small { color: var(--suave); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.saldo { background: var(--ouro-grad); border: 1px solid #3b82f6; color: #fff; }

.kpi.saldo .rotulo, .kpi.saldo small { color: rgb(255 255 255 / .7); }
.kpi.saldo strong { font-size: 1.6rem; }
.kpi.saldo.negativo { background: linear-gradient(135deg, #c2410c, #f97316); border-color: #f97316; }

/* ---------- Ferramentas ---------- */
.ferramentas { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.busca { position: relative; flex: 1 1 240px; display: block; }
.busca .ic { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--ouro); width: 15px; height: 15px; }
.busca input { width: 100%; padding-left: 2.1rem; }
.aviso-faixa { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: var(--raio-p); background: var(--laranja-suave); border: 1px solid rgb(249 115 22 / .35); color: var(--laranja-claro); font-size: .86rem; margin-bottom: .8rem; }
.aviso-faixa a { color: inherit; font-weight: 600; margin-left: auto; }

/* ---------- Seções e quadro ---------- */
.secao-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1rem 0 .5rem; }
.secao-topo h2 { display: flex; align-items: center; gap: .5rem; }
.secao-topo h2 small { font-weight: 400; color: var(--suave); font-size: .8rem; }
.entradas { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: .5rem; }
.quadro { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: start; }
.coluna { background: var(--superficie-2); border: 1px solid var(--linha); border-radius: var(--raio); padding: .5rem; min-height: 140px; transition: border-color .15s, background .15s; }
.coluna.alvo { border-color: var(--ouro); background: var(--ouro-suave); }
.coluna-topo { display: flex; align-items: center; justify-content: space-between; padding: .25rem .4rem .55rem; }
.coluna-topo h3 { display: flex; align-items: center; gap: .45rem; }
.coluna-topo h3 small { color: var(--suave); font-weight: 400; }
.lista-cartoes { display: flex; flex-direction: column; gap: .4rem; }
.abas-quadro { display: none; }

/* Cartão de lançamento */
.cl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .55rem; background: var(--superficie); border: 1px solid var(--linha); border-left: 3px solid var(--linha-forte); border-radius: var(--raio-p); padding: .5rem .5rem .5rem .55rem; cursor: pointer; transition: border-color .12s, background .12s, opacity .12s; }
.cl:hover { background: var(--hover); border-color: var(--linha-forte); }
.cl.entrada { border-left-color: var(--receber); }
.cl.atrasado { border-left-color: var(--alerta); }
.cl.vence-logo { border-left-color: var(--alerta); }
.cl.pago { border-left-color: var(--receber); opacity: .78; }
.cl.pago .cl-desc b { text-decoration: line-through; text-decoration-color: rgb(239 232 216 / .35); }
.cl.selecionado { border-color: var(--ouro); background: var(--ouro-suave); }
.cl.arrastando { opacity: .4; }
.cl-sel { display: flex; }
.cl-desc { min-width: 0; }
.cl-desc b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; font-size: .74rem; color: var(--suave); margin-top: .1rem; }
.cl-meta .ic { width: 12px; height: 12px; }
.cl-meta .atraso { color: var(--alerta); font-weight: 600; }
.alerta-txt { color: var(--alerta); }
.cl-meta .logo { color: var(--alerta); font-weight: 600; }
.tag { font-size: .68rem; color: var(--suave); background: transparent; border: 1px solid var(--linha-forte); border-radius: 4px; padding: 0 .35rem; line-height: 1.5; }
.cl-valor { font-size: .98rem; text-align: right; }
.cl-acoes { display: flex; align-items: center; gap: .1rem; }
.btn-pagar { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--linha-forte); background: transparent; color: var(--fraco); display: grid; place-items: center; cursor: pointer; transition: all .15s; padding: 0; }
.btn-pagar .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.btn-pagar:hover { border-color: var(--receber); color: var(--receber); background: var(--receber-suave); }
.cl.pago .btn-pagar { background: var(--receber); border-color: var(--receber); color: #06281a; }
.cl.pago .btn-pagar:hover { background: var(--pagar-suave); border-color: var(--pagar); color: var(--pagar); }

/* Barra de ações em lote */
.barra-lote { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 35; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; background: var(--elevado); border: 1px solid var(--ouro); border-radius: 12px; box-shadow: var(--sombra-alta); padding: .55rem .7rem; max-width: calc(100vw - 1.5rem); }
.barra-lote b { color: var(--ouro-claro); margin-right: .3rem; }

/* Menu de contexto (⋯) */
.menu-ctx { position: fixed; z-index: 60; min-width: 230px; background: var(--elevado); border: 1px solid var(--linha-forte); border-radius: var(--raio); box-shadow: var(--sombra-alta); padding: .3rem; display: flex; flex-direction: column; }
.menu-ctx button { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border: 0; background: none; color: var(--texto); font: 400 .88rem var(--fonte); text-align: left; border-radius: 6px; cursor: pointer; }
.menu-ctx button:hover { background: var(--ouro-suave); color: var(--ouro-claro); }
.menu-ctx button.perigo { color: var(--perigo); }
.menu-ctx .ic { color: var(--ouro); }
.menu-ctx hr { border: 0; border-top: 1px solid var(--linha); margin: .25rem 0; }

/* ---------- Modal ---------- */
dialog { border: 1px solid var(--linha-forte); border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 1.5rem)); background: var(--elevado); color: var(--texto); box-shadow: var(--sombra-alta); }
dialog.largo { width: min(900px, calc(100vw - 1.5rem)); }
dialog::backdrop { background: rgb(0 0 0 / .6); backdrop-filter: blur(3px); }
dialog[open] { animation: entrar .18s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
dialog form { display: flex; flex-direction: column; gap: .8rem; padding: 1.25rem 1.35rem; }
dialog h2 { font-size: 1.1rem; }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rodape-modal { display: flex; flex-direction: row-reverse; gap: .5rem; margin-top: .3rem; flex-wrap: wrap-reverse; }
.rodape-modal .espaco { flex: 1; }
.valor-grande { display: flex; align-items: center; gap: .4rem; background: var(--superficie-2); border: 1px solid var(--linha-forte); border-radius: var(--raio); padding: .55rem .9rem; }
.valor-grande:focus-within { border-color: var(--ouro); box-shadow: var(--brilho); }
.valor-grande span { color: var(--ouro); font-size: 1.4rem; font-weight: 600; }
.valor-grande input { border: 0; background: transparent; box-shadow: none !important; font-size: 1.7rem; font-weight: 650; padding: .15rem 0; width: 100%; color: var(--ouro-claro); }
details.mais-opcoes { border: 1px solid var(--linha); border-radius: var(--raio-p); background: var(--superficie-2); }
details.mais-opcoes summary { cursor: pointer; padding: .55rem .75rem; color: var(--suave); font-size: .85rem; list-style: none; display: flex; align-items: center; gap: .4rem; }
details.mais-opcoes summary::-webkit-details-marker { display: none; }
details.mais-opcoes summary::before { content: "▸"; color: var(--ouro); transition: transform .15s; }
details.mais-opcoes[open] summary::before { transform: rotate(90deg); }
details.mais-opcoes .conteudo { display: flex; flex-direction: column; gap: .75rem; padding: 0 .75rem .8rem; }
.anexos { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.anexos ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; width: 100%; }
.anexos li { display: flex; align-items: center; gap: .4rem; }
.anexos li a { display: inline-flex; align-items: center; gap: .4rem; color: var(--ouro-claro); text-decoration: none; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.enviar-arquivo { cursor: pointer; }

/* Avisos (com "Desfazer") */
.aviso { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: .8rem; background: var(--elevado); color: var(--texto); border: 1px solid var(--ouro); padding: .6rem .9rem; border-radius: 10px; max-width: calc(100vw - 1.5rem); font-size: .9rem; box-shadow: var(--sombra-alta); animation: entrar .18s ease-out; }
.aviso button { background: none; border: 0; color: var(--ouro-claro); font: 600 .85rem var(--fonte); cursor: pointer; padding: .2rem .3rem; text-decoration: underline; }
.barra-lote:not([hidden]) ~ .fab { display: none; }

/* ---------- Tabelas e listas (orçamento, busca, histórico, cadastros) ---------- */
.tabela-cartao { padding: 0; overflow: hidden; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--linha-forte); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--suave); }
.tabela td { padding: .55rem .8rem; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: var(--hover); }
.tabela .direita { text-align: right; }
.tabela .clicavel { cursor: pointer; }
.cat-cel { display: inline-flex; align-items: center; gap: .45rem; }
.valor-orc { width: 8rem; text-align: right; font-weight: 600; color: var(--ouro-claro); padding: .35rem .5rem; }
.progresso { height: 4px; border-radius: 99px; background: var(--linha); overflow: hidden; }
.progresso i { display: block; height: 100%; border-radius: 99px; }
.lista-curta { list-style: none; margin: 0; padding: 0; }
.lista-curta li { display: flex; gap: .7rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--linha); }
.lista-curta li:first-child { border-top: 0; padding-top: 0; }
.lista-curta .desc { flex: 1; min-width: 0; }
.lista-curta .desc b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-curta small { color: var(--suave); font-size: .78rem; }
.lista-curta .clicavel { cursor: pointer; }
.data-bloco { width: 40px; flex: none; text-align: center; border: 1px solid var(--linha-forte); border-radius: 6px; padding: .2rem 0; line-height: 1.05; background: var(--superficie-2); }
.data-bloco b { display: block; font-size: 1rem; color: var(--ouro-claro); }
.data-bloco small { font-size: .6rem; text-transform: uppercase; color: var(--suave) !important; }
.inativo { opacity: .45; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cats h3 { margin-bottom: .4rem; }
.item-cat { display: flex; align-items: center; gap: .45rem; padding: .15rem 0; }
.item-cat input[type=color] { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; flex: none; }
.item-cat input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.item-cat input[type=color]::-webkit-color-swatch { border: 1px solid var(--linha-forte); border-radius: 50%; }
.item-cat .nome { flex: 1; border-color: transparent; background: transparent; padding: .3rem .45rem; }
.item-cat .nome:hover { border-color: var(--linha-forte); }
.fatura { display: flex; flex-direction: column; align-items: flex-end; }
.historico li .quando { color: var(--fraco); font-size: .75rem; white-space: nowrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { font: 500 .78rem var(--fonte); color: var(--ouro-claro); background: var(--ouro-suave); border: 1px solid var(--linha-forte); border-radius: 99px; padding: .25rem .6rem; cursor: pointer; }

/* Extrato (também é o que sai na impressão) */
.extrato h3 { margin: .9rem 0 .35rem; color: var(--ouro-claro); }
.extrato .tabela td, .extrato .tabela th { padding: .35rem .5rem; }
.extrato-resumo { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .9rem; }

/* ---------- Acesso (login) ---------- */
.acesso { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.acesso-lado { position: relative; background: radial-gradient(600px 420px at 50% 45%, rgb(59 130 246 / .16), transparent 70%), #081020; padding: 3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-right: 1px solid var(--linha); overflow: hidden; }
.acesso-lado::before { content: ""; position: absolute; inset: 22px; border: 1px solid var(--linha-forte); pointer-events: none; }
.acesso-lado::after { content: ""; position: absolute; inset: 28px; border: 1px solid var(--linha); pointer-events: none; }
.brasao { width: min(360px, 72%); height: auto; display: block;
  -webkit-mask-image: radial-gradient(ellipse 56% 54% at 50% 50%, #000 74%, transparent 100%);
  mask-image: radial-gradient(ellipse 56% 54% at 50% 50%, #000 74%, transparent 100%); }
.lema { font-size: .78rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--suave); margin-top: .5rem; }
.acesso-form { display: grid; place-items: center; padding: 2rem 1.25rem; }
.acesso-form form { width: min(340px, 100%); display: flex; flex-direction: column; gap: .9rem; }
.acesso-form h2 { font-family: var(--serifa); font-size: 1.6rem; letter-spacing: -.02em; color: var(--texto); }
.acesso-form .sub { margin: -.4rem 0 .3rem; }
.btn.grande { padding: .75rem 1rem; justify-content: center; font-size: .95rem; }

.fab { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .saldo { grid-column: span 3; }
  .col-6, .col-7, .col-5 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topo { gap: .5rem; padding: .45rem .7rem; }
  .marca span, #novo-topo span, #btn-mais span { display: none; }
  #novo-topo { display: none; }
  .seletor-mes strong { min-width: 7.2rem; font-size: .85rem; }
  main { padding: .8rem .7rem 6rem; }
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .5rem; margin: 0 -.7rem .7rem; padding: 0 .7rem; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 42%; scroll-snap-align: start; }
  .kpi.saldo { flex-basis: 62%; }
  .quadro { display: block; }
  .abas-quadro { display: flex; margin-bottom: .5rem; width: 100%; }
  .abas-quadro button { flex: 1; }
  .quadro .coluna:not(.visivel) { display: none; }
  .coluna { padding: .35rem; }
  .entradas { grid-template-columns: 1fr; }
  .cl { grid-template-columns: minmax(0, 1fr) auto auto; gap: .45rem; padding: .55rem .4rem .55rem .6rem; }
  .selecionando .cl { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .ferramentas .busca { flex-basis: 100%; }
  .ferramentas select { flex: 1; }
  .ferramentas .txt, .dica-quadro, .coluna-topo h3 { display: none; }
  .coluna-topo { padding: .15rem .35rem .4rem; justify-content: flex-end; }
  .cl-sel { display: none; }
  .selecionando .cl-sel { display: flex; }
  .cl-valor { font-size: .92rem; }
  .cats { grid-template-columns: 1fr; }
  .tabela-orc thead { display: none; }
  .tabela-orc .col-barra { display: none; }
  .fab { display: grid; place-items: center; position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--laranja); color: #fff; cursor: pointer; box-shadow: 0 8px 24px rgb(0 0 0 / .45); z-index: 25; }
  .fab .ic { width: 24px; height: 24px; stroke-width: 2.2; }
  .acesso { grid-template-columns: 1fr; }
  .acesso-lado { padding: 2.2rem 1.5rem; border-right: 0; border-bottom: 1px solid var(--linha); }
  .acesso-lado::before { inset: 12px; } .acesso-lado::after { inset: 17px; }
  .brasao { width: min(220px, 60%); }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; max-height: 94vh; }
  dialog form { padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom)); }
  .barra-lote { bottom: .7rem; }
}

/* ---------- Impressão do extrato ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topo, main, .fab, .barra-lote, .aviso, .acesso, .rodape-modal, .nao-imprimir { display: none !important; }
  dialog { position: static; border: 0; box-shadow: none; width: 100%; max-height: none; background: #fff; color: #000; }
  dialog::backdrop { display: none; }
  .extrato * { color: #000 !important; }
  .extrato .tabela th, .extrato .tabela td { border-color: #bbb; }
}
