/* Finanças: resumo, rosca de categorias, contas, lançamentos, caixinhas (potes 3D). */

.botao-entrada { background: #2E8A5A; color: #fff; }

/* ---------- Resumo ---------- */
.resumo-fin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.saldo-bloco { display: flex; align-items: center; gap: 18px; }
.saldo-bloco p { margin: 0; }
.saldo-valor { display: block; font-family: var(--fonte-titulo); font-size: 44px; font-weight: 700; line-height: 1.1; color: var(--tinta); font-variant-numeric: tabular-nums; }
.saldo-valor.negativo { color: #B3261E; }
.resumo-pilulas { display: flex; flex-wrap: wrap; gap: 10px; }
.pilula { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 16px; min-width: 140px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pilula .pequeno { font-weight: 700; opacity: 0.85; }
.pilula.entrou { background: #DDF1E5; color: #1E6B45; }
.pilula.saiu { background: #FBE0EA; color: #8E1F4A; }
.pilula.pendente { background: #FBEBD3; color: #7A4A0C; }

/* moeda 3D girando */
.moeda-3d { width: 70px; height: 70px; position: relative; transform-style: preserve-3d; animation: moeda-gira 5s linear infinite; flex-shrink: 0; }
.moeda-face {
  position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--fonte-titulo); font-weight: 700; font-size: 22px; color: #7A5410;
  background: radial-gradient(circle at 35% 30%, #FFF1B8, #F2C14E 45%, #C9932A 100%);
  box-shadow: inset 0 0 0 4px #E3AE3A, inset 0 0 0 7px #F7D77A; backface-visibility: hidden;
}
.moeda-face.verso { transform: rotateY(180deg); font-size: 26px; }
@keyframes moeda-gira { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }

/* ---------- Categorias ---------- */
.categorias-fin { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.rosca { position: relative; width: 170px; height: 170px; margin: 0 auto; flex-shrink: 0; }
.rosca.vazia { border-radius: 50%; border: 26px solid var(--suave); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 18px; color: var(--apagado); }
.rosca-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.rosca-centro strong { font-size: 16px; }
.lista-cats { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cat-topo, .cat-rodape { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; }
.cat-nome { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.cat-valor { font-weight: 800; font-variant-numeric: tabular-nums; }
.cat-valor small { font-weight: 600; color: var(--apagado); }
.cat-linha .barra { margin: 6px 0 4px; height: 10px; }
.alerta-limite { font-size: 13px; font-weight: 800; color: #B3261E; }
.cat-linha.estourou .barra-cheia { animation: tremer 0.5s ease 2; }
@keyframes tremer { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.link-botao { border: 0; background: transparent; color: var(--destaque); font-weight: 800; font-size: 13px; cursor: pointer; padding: 6px 0; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contas a pagar ---------- */
.lista-contas { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.conta { display: flex; align-items: center; gap: 8px; }
.conta { flex-wrap: wrap; }
.conta-info {
  flex: 1 1 160px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; text-align: left;
  border: 0; cursor: pointer; padding: 10px 12px; border-radius: 14px; background: var(--suave); color: var(--tinta);
}
.conta-data { grid-column: 1 / -1; font-size: 12px; font-weight: 800; color: var(--apagado); }
.conta-nome { font-weight: 800; overflow-wrap: anywhere; }
.conta-valor { font-weight: 800; font-variant-numeric: tabular-nums; }
.conta.atrasada .conta-info { background: #FCE4E1; }
.conta.atrasada .conta-data { color: #B3261E; }
.paguei { flex-shrink: 0; }

/* ---------- Lançamentos ---------- */
.lista-lancamentos, .lista-lancamentos ul { list-style: none; margin: 0; padding: 0; }
.lista-lancamentos { display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.grupo-data { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--apagado); margin-bottom: 4px; }
.lancamento {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent;
  padding: 8px 6px; border-radius: 12px; cursor: pointer; color: var(--tinta); transition: background 0.15s ease, transform 0.15s ease;
}
.lancamento:hover { background: var(--suave); transform: translateX(3px); }
.lancamento .ponto { width: 10px; height: 10px; flex-shrink: 0; }
.lanc-desc { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 700; overflow: hidden; }
.lanc-desc small { font-weight: 600; font-size: 12px; color: var(--apagado); }
.lanc-valor { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lancamento.entrada .lanc-valor { color: #1E6B45; }
.lancamento.saida .lanc-valor { color: #8E1F4A; }
.lancamento.pendente { opacity: 0.7; }

/* ---------- Caixinhas: potes 3D ---------- */
.grade-caixinhas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.caixinha { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 20px; background: var(--clara); background: color-mix(in srgb, var(--clara) 45%, transparent); }
.pote { width: 86px; flex-shrink: 0; perspective: 400px; }
.pote-tampa {
  width: 70%; height: 14px; margin: 0 auto -2px; border-radius: 6px 6px 3px 3px; position: relative; z-index: 2;
  background: linear-gradient(180deg, color-mix(in srgb, var(--forte) 70%, #fff), var(--forte));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.pote-vidro {
  position: relative; height: 104px; border-radius: 18px 18px 26px 26px; overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9), inset 6px 0 10px rgba(255, 255, 255, 0.8), inset -8px -6px 14px rgba(0, 0, 0, 0.08), 0 10px 16px -10px rgba(0, 0, 0, 0.4);
  transform: rotateX(6deg); transition: transform 0.4s ease;
}
.caixinha:hover .pote-vidro { transform: rotateX(6deg) rotateY(-14deg); }
.pote-vidro::after { content: ''; position: absolute; top: 10px; left: 12px; width: 8px; height: 60%; border-radius: 8px; background: rgba(255, 255, 255, 0.7); }
.pote-liquido {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--nivel);
  background: linear-gradient(180deg, var(--clara), var(--forte)); color: var(--clara);
  transition: height 1s cubic-bezier(.3, 1.4, .5, 1);
}
.onda { position: absolute; left: 0; top: -9px; width: 200%; height: 12px; animation: onda 3s linear infinite; }
@keyframes onda { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.pote-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #2B2230; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
.caixinha-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.caixinha-nome { border: 0; background: transparent; padding: 0; text-align: left; font-family: var(--fonte-titulo); font-size: 20px; font-weight: 700; color: var(--tinta); cursor: pointer; }
.caixinha-valores { font-weight: 800; font-variant-numeric: tabular-nums; }
.caixinha-valores small { font-weight: 600; color: var(--apagado); }
.caixinha-ok { font-weight: 800; color: #1E6B45; }
.caixinha-botoes { display: flex; gap: 6px; margin-top: 4px; }
.caixinha-botoes .botao { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* moedinha caindo no pote ao guardar */
.pote.recebendo { position: relative; }
.pote.recebendo::before {
  content: ''; position: absolute; left: 50%; top: -40px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #FFF1B8, #F2C14E 45%, #C9932A 100%); box-shadow: inset 0 0 0 3px #E3AE3A;
  animation: moeda-cai 0.9s cubic-bezier(.5, 0, .7, .4) forwards;
}
@keyframes moeda-cai {
  0% { transform: translateY(-20px) rotateY(0); opacity: 1; }
  80% { transform: translateY(70px) rotateY(720deg); opacity: 1; }
  100% { transform: translateY(80px) rotateY(900deg) scale(0.6); opacity: 0; }
}

/* ---------- Janela: tipo e categorias ---------- */
.alternar-tipo { display: flex; padding: 4px; border-radius: 999px; background: var(--suave); }
.alternar-tipo label { flex: 1; }
.alternar-tipo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.alternar-tipo span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 999px; font-weight: 800; cursor: pointer; }
.alternar-tipo input:checked + span { background: var(--destaque); color: var(--destaque-texto); }
.alternar-tipo input[value="entrada"]:checked + span { background: #2E8A5A; }
.alternar-tipo input:focus-visible + span { outline: 3px solid #6E8BFF; }
.linha-campos.dois { grid-template-columns: 1fr 1fr; }
.cats-saida, .cats-entrada, .cats-limite { display: flex; flex-wrap: wrap; gap: 8px; }
.janela.m-tipo-entrada .cats-saida { display: none; }
.janela.m-tipo-saida .cats-entrada { display: none; }
.checar { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 700; }
.checar input { width: 22px; height: 22px; min-height: 0 !important; accent-color: var(--destaque); }

/* ---------- Animações de chegada ---------- */
.efeitos-ativos .financas-corpo.chegando .cartao { animation: cartao-sobe 0.6s cubic-bezier(.2, .8, .2, 1) both; }
.efeitos-ativos .financas-corpo.chegando .cartao:nth-child(2) { animation-delay: 0.08s; }
.efeitos-ativos .financas-corpo.chegando .cartao:nth-child(3) { animation-delay: 0.16s; }
.efeitos-ativos .financas-corpo.chegando .cartao:nth-child(4) { animation-delay: 0.24s; }
.efeitos-ativos .financas-corpo.chegando .cartao:nth-child(5) { animation-delay: 0.32s; }
@keyframes cartao-sobe { from { transform: perspective(1000px) rotateX(-25deg) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.efeitos-ativos .financas-corpo.chegando .rosca circle { animation: desenhar 1.1s cubic-bezier(.3, .7, .3, 1) both; animation-delay: calc(0.3s + var(--i) * 0.08s); }
@keyframes desenhar { from { stroke-dasharray: 0 999; } }
.efeitos-ativos .financas-corpo.chegando .barra-cheia { animation: encher 1s cubic-bezier(.3, .7, .3, 1) both; animation-delay: 0.4s; }
@keyframes encher { from { width: 0; } }
.efeitos-ativos .financas-corpo.chegando .pote-liquido { animation: subir 1.4s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: 0.5s; }
@keyframes subir { from { height: 0; } }
.efeitos-ativos .financas-corpo.entra-prox { animation: entra-prox 0.7s cubic-bezier(.2, .8, .2, 1) both; }
.efeitos-ativos .financas-corpo.entra-ant { animation: entra-ant 0.7s cubic-bezier(.2, .8, .2, 1) both; }

.sem-efeitos .moeda-3d, .sem-efeitos .onda { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .moeda-3d, .onda, .financas-corpo .cartao, .rosca circle, .barra-cheia, .pote-liquido, .pote.recebendo::before { animation: none !important; }
}
@media (max-width: 640px) {
  .saldo-valor { font-size: 34px; }
  .moeda-3d { width: 54px; height: 54px; }
  .pilula { min-width: 0; flex: 1 1 120px; }
}

/* ---------- Cartão do saldo (com relevo) ---------- */
.cartao-saldo {
  position: relative; overflow: hidden; flex: 0 1 380px; min-width: 280px; aspect-ratio: 1.586; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px 24px; border-radius: 16px;
  color: #FBF4E6;
  background:
    radial-gradient(120% 90% at 100% 0, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--destaque) 70%, #000), var(--destaque) 55%, color-mix(in srgb, var(--destaque) 75%, #fff));
  box-shadow: 0 22px 34px -20px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .5s cubic-bezier(.2,.8,.3,1), box-shadow .5s ease;
  transform: rotate(-1.5deg);
}
.resumo-fin { transform-style: flat !important; }
.cartao-saldo:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 30px 40px -22px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25); }
.cs-topo { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.cs-chip { width: 42px; height: 31px; border-radius: 6px; background: linear-gradient(135deg, #F4DE9A, #C9A24C 55%, #E8CD84); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2);
  background-image: linear-gradient(90deg, transparent 13px, rgba(0,0,0,.18) 13px 14px, transparent 14px 28px, rgba(0,0,0,.18) 28px 29px, transparent 29px), linear-gradient(0deg, transparent 15px, rgba(0,0,0,.18) 15px 16px, transparent 16px), linear-gradient(135deg, #F4DE9A, #C9A24C 55%, #E8CD84); }
.cs-marca { font-family: 'Pacifico', cursive; font-size: 18px; line-height: 1; opacity: .9; }
.cs-rotulo { position: relative; z-index: 1; font-size: 13.5px; opacity: .85; margin-top: auto; }
.cartao-saldo .saldo-valor { position: relative; z-index: 1; color: #FBF4E6; font-size: 38px; text-shadow: 0 -1px 0 rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.25); letter-spacing: .01em; }
.cartao-saldo.negativo .saldo-valor { color: #FFD9D2; }
.cs-rodape { position: relative; z-index: 1; font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
.cs-ondas { position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 22px rgba(255,255,255,.04), 0 0 0 46px rgba(255,255,255,.03); }
.resumo-fin .resumo-pilulas { flex: 1 1 300px; justify-content: flex-end; }

/* ---------- Cupom fiscal ---------- */
.cartao-cupom { display: flex; flex-direction: column; }
.impressora { position: relative; height: 14px; margin: 2px 4px 0; border-radius: 7px; background: linear-gradient(180deg, #5B5650, #3A3632); box-shadow: 0 3px 6px -2px rgba(0,0,0,.4); z-index: 2; }
.fenda { position: absolute; left: 8px; right: 8px; top: 6px; height: 2px; border-radius: 1px; background: #1C1A18; }
.cupom {
  --papel-cupom: #FFFDF7;
  position: relative; margin: -6px 16px 0; padding: 22px 18px 34px; background: var(--papel-cupom); color: #2F2B26;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; line-height: 1.5;
  box-shadow: 0 10px 18px -12px rgba(0,0,0,.4);
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 100% / 14px 100% repeat-x;
          mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 100% / 14px 100% repeat-x;
  max-height: 520px; overflow-y: auto; scrollbar-width: thin;
}
.cupom.imprimindo { animation: imprimir 1.4s steps(14, end) both; }
@keyframes imprimir { from { clip-path: inset(0 0 100% 0); transform: translateY(-30px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.cupom-cabeca { margin: 0 0 12px; text-align: center; display: flex; flex-direction: column; padding-bottom: 10px; border-bottom: 1px dashed rgba(0,0,0,.35); }
.cupom-cabeca strong { font-size: 14px; }
.cupom-lista, .cupom-lista ul { list-style: none; margin: 0; padding: 0; }
.cupom-dia { margin-bottom: 8px; }
.cupom-data { display: block; font-size: 12px; opacity: .65; margin: 2px 0; }
.cupom-linha { width: 100%; display: flex; align-items: baseline; gap: 6px; border: 0; background: none; padding: 3px 4px; margin: 0 -4px; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 4px; box-sizing: content-box; }
.cupom-linha:hover { background: rgba(0,0,0,.05); }
.cupom-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.cupom-desc small { font-size: 11px; opacity: .65; }
.cupom-pontos { flex: 1; border-bottom: 1px dotted rgba(0,0,0,.35); transform: translateY(-4px); min-width: 12px; }
.cupom-valor { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cupom-linha.entrada .cupom-valor { color: #1E6B45; }
.cupom-linha.pendente { opacity: .65; }
.cupom-vazio { text-align: center; opacity: .7; margin: 10px 0; }
.cupom-totais { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed rgba(0,0,0,.35); }
.cupom-totais div { display: flex; justify-content: space-between; }
.cupom-totais dt, .cupom-totais dd { margin: 0; }
.cupom-totais dd { font-variant-numeric: tabular-nums; }
.cupom-saldo { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,.5); font-weight: 700; font-size: 14px; }
.cupom-barras { display: block; height: 34px; margin: 18px auto 0; width: 70%; background: repeating-linear-gradient(90deg, #2F2B26 0 2px, transparent 2px 4px, #2F2B26 4px 5px, transparent 5px 8px, #2F2B26 8px 11px, transparent 11px 12px); opacity: .85; }

/* ---------- Pote de vidro com moedas ---------- */
.pote.pote-vidro-real { width: 104px; position: relative; perspective: none; transition: transform .4s ease; }
.pote.pote-vidro-real::before { display: none !important; }
.caixinha:hover .pote-vidro-real { transform: rotate(-2deg) translateY(-2px); }
.pote-svg { display: block; width: 104px; height: 130px; overflow: visible; }
.moeda-caindo { position: absolute; left: 50%; top: -34px; z-index: 3; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFF1B8, #E6BC52 50%, #B98A1E); box-shadow: inset 0 0 0 2px #D9A93C;
  animation: moeda-entra .9s cubic-bezier(.5, 0, .75, .4) both; }
.moeda-caindo.dois { animation-delay: .22s; margin-left: -2px; }
@keyframes moeda-entra { 0% { transform: translateY(-16px) rotateX(0); opacity: 0; } 15% { opacity: 1; } 80% { transform: translateY(66px) rotateX(540deg); opacity: 1; } 100% { transform: translateY(78px) rotateX(720deg) scaleY(.4); opacity: 0; } }
.pote-vidro-real.recebendo .pote-svg { animation: pote-balanca .5s .75s ease both; }
@keyframes pote-balanca { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 65% { transform: rotate(2deg); } }

@media (max-width: 640px) {
  .cartao-saldo { flex-basis: 100%; min-width: 0; }
  .cartao-saldo .saldo-valor { font-size: 32px; }
  .cupom { margin: -6px 6px 0; }
}
@media (prefers-reduced-motion: reduce) { .cupom.imprimindo, .moeda-caindo, .pote-svg { animation: none !important; } .cartao-saldo { transform: none; } }
