:root {
  --fundo: #f2f4f8; --cartao: #ffffff; --texto: #0f172a; --suave: #64748b; --linha: #e2e8f0;
  --marca: #0f2a4a; --marca-2: #1d4ed8; --entrada: #15803d; --entrada-bg: #dcfce7; --saida: #c2410c; --saida-bg: #ffedd5;
  --pendente: #a16207; --pendente-bg: #fef3c7; --perigo: #b91c1c;
  --raio: 16px; --sombra: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
  --nav: 64px; --seguro-baixo: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0b1220; --cartao: #131c2e; --texto: #e5e9f0; --suave: #94a3b8; --linha: #23304a;
    --marca: #0b1f38; --marca-2: #60a5fa; --entrada: #4ade80; --entrada-bg: #0f2e1c; --saida: #fb923c; --saida-bg: #3a1d0b;
    --pendente: #facc15; --pendente-bg: #3a300b; --sombra: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--marca-2); }
.num { font-variant-numeric: tabular-nums; }

/* topo */
.topo { background: var(--marca); color: #fff; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 64px; }
.topo-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topo h1 { font-size: 15px; font-weight: 600; margin: 0; opacity: .85; }
.topo .empresa { font-size: 13px; opacity: .7; }
.saldo-rotulo { margin-top: 18px; font-size: 13px; opacity: .75; }
.saldo-valor { font-size: 34px; font-weight: 700; letter-spacing: -.5px; }
.olho { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; }
.seletor-mes { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 2px; }
.seletor-mes button { background: none; border: 0; color: #fff; width: 32px; height: 32px; border-radius: 999px; font-size: 18px; }
.seletor-mes span { font-size: 14px; min-width: 92px; text-align: center; text-transform: capitalize; }

main { padding: 0 16px calc(var(--nav) + 96px + var(--seguro-baixo)); max-width: 720px; margin: 0 auto; }
.sobe { margin-top: -48px; }
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; margin-bottom: 12px; }
.cartao h2 { font-size: 15px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; }
.cartao h2 small { font-weight: 400; color: var(--suave); font-size: 13px; }
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { border-radius: 12px; padding: 12px; }
.mini .r { font-size: 12px; color: var(--suave); display: flex; align-items: center; gap: 6px; }
.mini .v { font-size: 19px; font-weight: 700; margin-top: 4px; }
.mini.ent { background: var(--entrada-bg); } .mini.ent .v { color: var(--entrada); }
.mini.sai { background: var(--saida-bg); } .mini.sai .v { color: var(--saida); }
.mini.pen { background: var(--pendente-bg); } .mini.pen .v { color: var(--pendente); font-size: 16px; }
.resultado { margin-top: 12px; display: flex; justify-content: space-between; font-size: 14px; color: var(--suave); }
.resultado b { color: var(--texto); }

/* lista */
.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linha); }
.item:first-child { border-top: 0; }
.item button.abrir { all: unset; display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; cursor: pointer; }
.item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 700; }
.ic.ent { background: var(--entrada-bg); color: var(--entrada); } .ic.sai { background: var(--saida-bg); color: var(--saida); }
.item .meio { flex: 1; min-width: 0; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--suave); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item .val { font-weight: 700; text-align: right; white-space: nowrap; }
.val.ent { color: var(--entrada); } .val.sai { color: var(--saida); }
.selo { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--pendente-bg); color: var(--pendente); font-weight: 600; }
.clipe { font-size: 12px; color: var(--suave); }
.ponto { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: none; }
.dia { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); margin: 18px 4px 6px; font-weight: 600; display: flex; justify-content: space-between; }
.vazio { text-align: center; color: var(--suave); padding: 28px 12px; font-size: 14px; }

/* contas */
.banco-ico { display: inline-grid; place-items: center; border-radius: 12px; font-weight: 800; letter-spacing: -.3px; flex: none; line-height: 1; font-family: system-ui, Arial, sans-serif; overflow: hidden; }
.conta-linha { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linha); }
.conta-linha:first-child { border-top: 0; }
.conta-linha .meio { flex: 1; min-width: 0; }
.conta-linha .t { font-weight: 600; } .conta-linha .s { font-size: 13px; color: var(--suave); }

/* barras categoria */
.barra { margin: 10px 0; }
.barra .cab { display: flex; justify-content: space-between; font-size: 14px; gap: 8px; }
.barra .cab span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.barra .trilho { height: 8px; border-radius: 999px; background: var(--linha); margin-top: 6px; overflow: hidden; }
.barra .enche { height: 100%; border-radius: 999px; }
.abas { display: flex; gap: 6px; background: var(--linha); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.abas button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--suave); }
.abas button[aria-pressed="true"] { background: var(--cartao); color: var(--texto); box-shadow: var(--sombra); }

/* gráfico dias */
.grafico { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 8px; }
.grafico .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; height: 100%; }
.grafico .e { background: var(--entrada); border-radius: 3px 3px 0 0; opacity: .85; }
.grafico .x { background: var(--saida); border-radius: 0 0 3px 3px; opacity: .85; }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--suave); margin-top: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* barra de navegação */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav) + var(--seguro-baixo)); padding-bottom: var(--seguro-baixo);
  background: var(--cartao); border-top: 1px solid var(--linha); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 10; }
.nav button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--suave); }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--marca-2); font-weight: 600; }
.nav .mais-novo { position: relative; }
.nav .mais-novo span.bola { width: 54px; height: 54px; border-radius: 18px; background: var(--marca-2); color: #fff; display: grid; place-items: center; margin-top: -26px; box-shadow: 0 6px 16px rgba(29,78,216,.35); }
.nav .mais-novo svg { width: 28px; height: 28px; }

/* formulários */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 13px; color: var(--suave); margin-bottom: 6px; font-weight: 500; }
.entrada, select.entrada, textarea.entrada { width: 100%; border: 1px solid var(--linha); background: var(--fundo); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; }
.entrada:focus { border-color: var(--marca-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marca-2) 20%, transparent); }
.botao { width: 100%; border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 700; font-size: 16px; background: var(--marca-2); color: #fff; }
.botao.sec { background: var(--linha); color: var(--texto); }
.botao.perigo { background: none; color: var(--perigo); border: 1px solid var(--linha); }
.botao.ent { background: var(--entrada); } .botao.sai { background: var(--saida); }
.botao:disabled { opacity: .6; }
.linha-botoes { display: flex; gap: 10px; } .linha-botoes > * { flex: 1; }
.erro { color: var(--perigo); font-size: 14px; margin: 0 0 12px; min-height: 0; }
.link { background: none; border: 0; color: var(--marca-2); font-weight: 600; padding: 8px; }
.icone-btn { background: none; border: 0; padding: 8px; color: var(--suave); border-radius: 10px; }

.valor-grande { text-align: center; padding: 4px 0 14px; }
.valor-grande input { border: 0; background: none; text-align: center; font-size: 40px; font-weight: 800; width: 100%; outline: none; font-variant-numeric: tabular-nums; }
.valor-grande.ent input { color: var(--entrada); } .valor-grande.sai input { color: var(--saida); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--linha); background: var(--cartao); border-radius: 999px; padding: 8px 12px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { border-color: var(--marca-2); background: color-mix(in srgb, var(--marca-2) 12%, var(--cartao)); font-weight: 600; }
.chip .banco-ico { border-radius: 7px; }
.interruptor { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--fundo); border-radius: 12px; border: 1px solid var(--linha); margin-bottom: 14px; }
.interruptor input { width: 44px; height: 26px; accent-color: var(--marca-2); }

/* comprovantes */
.anexos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 14px; }
.anexo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--fundo); border: 1px solid var(--linha); display: grid; place-items: center; font-size: 12px; color: var(--suave); text-align: center; padding: 0; }
.anexo img { width: 100%; height: 100%; object-fit: cover; }
.anexo .tira { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 999px; border: 0; background: rgba(15,23,42,.7); color: #fff; font-size: 15px; line-height: 1; }
.anexo .pdf { font-weight: 800; color: var(--perigo); font-size: 15px; }
.add-anexo { border: 1.5px dashed var(--linha); background: none; color: var(--marca-2); font-weight: 600; font-size: 13px; display: grid; place-items: center; gap: 2px; }
.add-anexo svg { width: 22px; height: 22px; }

/* folha (bottom sheet) */
.folha { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.folha[hidden] { display: none; }
.folha-fundo { position: absolute; inset: 0; background: rgba(2,6,23,.5); animation: aparece .15s; }
.folha-caixa { position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--cartao); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + var(--seguro-baixo)); animation: sobe .2s ease-out; }
.folha-caixa::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 9px; background: var(--linha); margin: 0 auto 12px; }
.folha-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.folha-cab h3 { margin: 0; font-size: 18px; }
@media (min-width: 720px) { .folha { align-items: center; } .folha-caixa { border-radius: 22px; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
@keyframes aparece { from { opacity: 0; } }

.aviso { position: fixed; left: 50%; bottom: calc(var(--nav) + 20px + var(--seguro-baixo)); transform: translateX(-50%) translateY(20px); background: #0f172a; color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); }
.aviso.ver { opacity: 1; transform: translateX(-50%); }

/* entrada / login */
.tela-login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.marca-login { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.marca-login img { width: 52px; height: 52px; border-radius: 14px; }
.marca-login b { font-size: 22px; display: block; } .marca-login span { color: var(--suave); font-size: 14px; }

.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-top: 1px solid var(--linha); padding: 14px 2px; text-align: left; font-size: 16px; }
.menu-item:first-child { border-top: 0; }
.menu-item .seta { margin-left: auto; color: var(--suave); }
.titulo-pag { padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 8px; max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.titulo-pag h1 { margin: 0; font-size: 24px; }
.filtros { display: flex; gap: 8px; margin-bottom: 12px; }
.filtros .entrada { padding: 10px 12px; font-size: 15px; }
.offline { background: var(--pendente-bg); color: var(--pendente); font-size: 13px; padding: 8px 16px; text-align: center; }
.cores { display: flex; gap: 8px; flex-wrap: wrap; }
.cores button { width: 34px; height: 34px; border-radius: 999px; border: 3px solid transparent; }
.cores button[aria-pressed="true"] { border-color: var(--texto); }
.detecta { font-size: 13px; color: var(--entrada); margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.grade-bancos { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; padding: 2px; }
.grade-bancos button { border: 1px solid var(--linha); background: var(--fundo); border-radius: 12px; padding: 8px 4px; display: grid; justify-items: center; gap: 6px; font-size: 11px; line-height: 1.2; }
.grade-bancos button[aria-pressed="true"] { border-color: var(--marca-2); box-shadow: 0 0 0 2px var(--marca-2); }
.visualizador { position: fixed; inset: 0; background: rgba(2,6,23,.92); z-index: 60; display: grid; place-items: center; padding: 16px; }
.visualizador img { max-width: 100%; max-height: 82dvh; border-radius: 8px; }
.visualizador .acoes { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; display: flex; gap: 8px; }
.visualizador .acoes a, .visualizador .acoes button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 999px; padding: 10px 14px; text-decoration: none; font-size: 14px; }
