/* Finanças do Casal — mesmo visual aprovado no Design (fundo petróleo, bege, verde = entrou, laranja = saiu) */
:root {
  --fundo: #101619;
  --painel: #182125;
  --painel-2: #141c1f;
  --destaque: #1c2a2a;
  --borda: #222d31;
  --borda-2: #2a3438;
  --texto: #ece7dd;
  --texto-2: #c9d2ce;
  --mudo: #9aa6a3;
  --apagado: #8e9a97;
  --verde: #7fe0b4;
  --verde-escuro: #0e2a20;
  --laranja: #f2b06b;
  --laranja-escuro: #2b1806;
  --vermelho: #f08a7e;
  --azul: #8cc4f0;
  --raio: 20px;
  --topo: env(safe-area-inset-top, 0px);
  --base: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--verde); }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- estrutura ---------- */
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.tela { flex: 1; display: flex; flex-direction: column; padding: calc(var(--topo) + 20px) 20px 20px; gap: 18px; }
.tela.com-menu { padding-bottom: calc(var(--base) + 170px); }
.tela.com-rodape { padding-bottom: calc(var(--base) + 150px); }
.carregando { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.girando { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--borda-2); border-top-color: var(--verde); animation: gira 0.8s linear infinite; display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }

.cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.cabecalho h1 { margin: 0; font-size: 17px; font-weight: 800; text-align: center; flex: 1; }
.saudacao { display: flex; flex-direction: column; gap: 2px; }
.saudacao small { font-size: 13px; color: var(--mudo); }
.saudacao strong { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.avatares { display: flex; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #10201a; border: 3px solid var(--fundo); flex-shrink: 0; }
.avatares .avatar + .avatar { margin-left: -10px; }
.avatar.p { width: 24px; height: 24px; font-size: 11px; border-width: 0; }
.avatar.m { width: 28px; height: 28px; font-size: 12px; border-width: 0; }

.botao-icone { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--painel); color: var(--texto); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.espaco-44 { width: 44px; flex-shrink: 0; }

.seletor-mes { display: flex; align-items: center; justify-content: space-between; background: var(--painel); border-radius: 14px; padding: 4px; }
.seletor-mes button { width: 48px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--texto); display: flex; align-items: center; justify-content: center; }
.seletor-mes button:disabled { opacity: 0.3; }
.seletor-mes span { font-size: 15px; font-weight: 700; }

/* ---------- cartões ---------- */
.saldo { background: var(--destaque); border: 1px solid #26393a; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.saldo .rotulo { font-size: 13px; color: #a9b7b2; }
.saldo .grande { font-size: 38px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.saldo .grande small { font-size: 22px; color: #a9b7b2; }
.saldo .grande.negativo { color: var(--vermelho); }
.comparacao { font-size: 12px; font-weight: 600; color: var(--mudo); }
.comparacao.bom { color: var(--verde); }
.comparacao.ruim { color: var(--laranja); }
.dupla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini { background: #142022; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.mini span { font-size: 12px; color: #a9b7b2; display: flex; align-items: center; gap: 6px; }
.mini strong { font-size: 18px; font-weight: 800; }
.entrou { color: var(--verde); }
.saiu { color: var(--laranja); }

.secao { display: flex; flex-direction: column; gap: 10px; }
.secao-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.secao-titulo h2 { margin: 0; font-size: 16px; font-weight: 800; }
.secao-titulo a, .secao-titulo button.link { font-size: 13px; font-weight: 700; text-decoration: none; color: var(--verde); background: none; border: 0; padding: 8px 0; }

.lista { background: var(--painel); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--borda); background: transparent; width: 100%; text-align: left; min-height: 64px; }
.item:last-child { border-bottom: 0; }
button.item:active { background: #1d272b; }
.item .icone { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #222d31; color: var(--texto); }
.item .meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .meio strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meio small { font-size: 12px; color: var(--mudo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meio small.alerta { color: var(--laranja); font-weight: 600; }
.item .meio small.atraso { color: var(--vermelho); font-weight: 700; }
.item .valor { font-size: 15px; font-weight: 700; white-space: nowrap; }
.item .tl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.item .tl .v { font-size: 15px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.item.paga .tl .v { color: var(--apagado); }
.item .acao { height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid #2e4543; background: var(--destaque); color: var(--verde); font-weight: 800; font-size: 13px; flex-shrink: 0; }
.item.paga .meio strong, .item.paga .valor { color: var(--apagado); }
.selo-pago { display: inline-flex; align-items: center; gap: 4px; color: var(--verde); font-weight: 700; }

.lancamentos { display: flex; flex-direction: column; }
.lanc { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border: 0; background: transparent; width: 100%; text-align: left; border-bottom: 1px solid #1a2327; min-height: 56px; }
.lanc:last-child { border-bottom: 0; }
.lanc .meio { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lanc .meio strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lanc .meio small { font-size: 12px; color: var(--mudo); }
.lanc .valor { font-size: 14px; font-weight: 700; white-space: nowrap; }
.dia-titulo { font-size: 12px; font-weight: 700; color: var(--mudo); text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 2px 2px; }

.vazio { background: var(--painel-2); border: 1px dashed var(--borda-2); border-radius: 16px; padding: 18px; text-align: center; color: var(--mudo); font-size: 14px; }

/* ---------- botões ---------- */
.rodape-acoes { position: fixed; left: 0; right: 0; bottom: calc(var(--base) + 66px); z-index: 5; display: flex; justify-content: center; pointer-events: none; }
.rodape-acoes > div { width: 100%; max-width: 520px; display: flex; gap: 10px; padding: 12px 20px 10px; background: linear-gradient(to top, var(--fundo) 70%, rgba(16, 22, 25, 0)); pointer-events: auto; }
.btn-gasto { flex: 1; height: 62px; border-radius: 20px; border: 0; background: var(--laranja); color: var(--laranja-escuro); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 800; text-decoration: none; }
.btn-entrada { width: 96px; height: 62px; border-radius: 20px; background: var(--destaque); border: 1px solid #2e4543; color: var(--verde); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; text-decoration: none; }
.btn { height: 56px; border-radius: 18px; border: 0; font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; text-decoration: none; }
.btn.verde { background: var(--verde); color: var(--verde-escuro); }
.btn.laranja { background: var(--laranja); color: var(--laranja-escuro); }
.btn.secundario { background: transparent; color: var(--texto-2); font-size: 15px; height: 48px; }
.btn.contorno { background: var(--painel); color: var(--texto); border: 1px solid var(--borda-2); font-size: 15px; }
.btn.perigo { background: transparent; color: var(--vermelho); font-size: 15px; height: 48px; }
.btn:disabled { opacity: 0.55; }
.acoes-fixas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; }
.acoes-fixas > div { width: 100%; max-width: 520px; padding: 14px 20px calc(var(--base) + 18px); background: linear-gradient(to top, var(--fundo) 80%, rgba(16, 22, 25, 0)); display: flex; flex-direction: column; gap: 6px; }

/* ---------- menu de baixo ---------- */
.menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--painel-2); border-top: 1px solid #1f292d; display: flex; justify-content: center; }
.menu nav { width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px calc(var(--base) + 8px); }
.menu a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--apagado); text-decoration: none; min-height: 52px; justify-content: center; }
.menu a[aria-current="page"] { color: var(--texto); font-weight: 800; }

/* ---------- lançar ---------- */
.titulo-grande { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; margin: 0; }
.sub { font-size: 14px; color: var(--mudo); margin: 0; line-height: 1.45; }
.opcoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opcao { height: 150px; border-radius: 22px; border: 1px solid #263034; background: var(--painel); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 16px; text-align: left; position: relative; }
.opcao.destaque { background: var(--destaque); border-color: #26393a; }
.opcao .icone { width: 48px; height: 48px; border-radius: 14px; background: #222d31; display: flex; align-items: center; justify-content: center; }
.opcao.destaque .icone { background: #24403a; color: var(--verde); }
.opcao strong { display: block; font-size: 16px; font-weight: 800; }
.opcao small { display: block; font-size: 12px; color: #a9b7b2; }
.opcao input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--borda-2); border-radius: 20px; background: var(--painel-2); color: var(--texto); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--verde); color: var(--verde-escuro); border-color: var(--verde); font-weight: 800; }
.rotulo-pequeno { font-size: 13px; font-weight: 700; color: var(--mudo); }

.area-mic { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 calc(var(--base) + 12px); }
.exemplo { background: var(--painel); border-radius: 16px; padding: 12px 16px; font-size: 14px; color: var(--texto-2); text-align: center; max-width: 320px; }
.exemplo b { color: var(--texto); }
.mic { width: 132px; height: 132px; border-radius: 50%; border: 0; background: var(--laranja); color: var(--laranja-escuro); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 12px #2a2318, 0 0 0 24px #1a1c18; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform 0.15s, box-shadow 0.15s; }
.mic.gravando { background: var(--vermelho); transform: scale(1.06); animation: pulso 1.2s ease-in-out infinite; }
@keyframes pulso { 50% { box-shadow: 0 0 0 16px #3a2420, 0 0 0 32px #22191a; } }
.mic-rotulo { font-size: 16px; font-weight: 800; margin-top: 10px; min-height: 22px; text-align: center; }
.mic-tempo { font-size: 13px; color: var(--mudo); min-height: 18px; }

/* ---------- conferir / formulários ---------- */
.ouvido { background: var(--painel); border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.ouvido .icone { width: 32px; height: 32px; border-radius: 10px; background: #2a2318; color: var(--laranja); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ouvido small { display: block; font-size: 12px; color: var(--mudo); }
.ouvido span { font-size: 15px; font-weight: 600; }
.valor-grande { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 4px; }
.valor-grande label { font-size: 13px; color: var(--mudo); }
.valor-grande .campo-valor { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.valor-grande .campo-valor span { font-size: 28px; font-weight: 800; color: inherit; }
.valor-grande input { width: 230px; background: transparent; border: 0; border-bottom: 2px dashed var(--borda-2); font-size: 48px; font-weight: 800; letter-spacing: -1.5px; text-align: center; padding: 0 0 2px; color: inherit; }
.valor-grande input:focus { outline: none; border-bottom-color: currentColor; }
.valor-grande.gasto { color: var(--laranja); }
.valor-grande.entrada { color: var(--verde); }
.formulario { background: var(--painel); border-radius: 20px; display: flex; flex-direction: column; }
.linha { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--borda); min-height: 58px; }
.linha:last-child { border-bottom: 0; }
.linha > label, .linha > .r { font-size: 13px; color: var(--mudo); width: 82px; flex-shrink: 0; }
.linha input, .linha select { flex: 1; min-width: 0; background: transparent; border: 0; font-size: 16px; font-weight: 700; padding: 8px 0; color: var(--texto); }
.linha select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236E7B78' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; padding-right: 24px; }
.linha select option { background: var(--painel); color: var(--texto); }
.linha input::placeholder { color: #6e7b78; font-weight: 600; }
.linha input:focus, .linha select:focus { outline: none; }
.linha .chips { flex: 1; }
.linha .chip { min-height: 36px; }
.quem { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 700; color: var(--mudo); }
.campo input { height: 54px; border-radius: 14px; border: 1px solid var(--borda-2); background: var(--painel); padding: 0 16px; font-size: 16px; font-weight: 600; }
.campo input:focus { outline: none; border-color: var(--verde); }
.erro-msg { color: var(--vermelho); font-size: 14px; font-weight: 600; min-height: 20px; margin: 0; }

/* ---------- login ---------- */
.marca { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0 10px; text-align: center; }
.marca img { width: 84px; height: 84px; border-radius: 22px; }
.marca h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.marca p { margin: 0; color: var(--mudo); font-size: 14px; }
.abas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--painel); border-radius: 14px; padding: 4px; gap: 4px; }
.abas button { height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--mudo); font-weight: 700; }
.abas button[aria-pressed="true"] { background: var(--destaque); color: var(--texto); }
.nomes-rapidos { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- resumo ---------- */
.barras { background: var(--painel); border-radius: 16px; padding: 6px 14px; display: flex; flex-direction: column; }
.barra { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.barra:last-child { border-bottom: 0; }
.barra .topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.barra .topo strong { font-size: 14px; font-weight: 700; }
.barra .topo span { font-size: 14px; font-weight: 700; white-space: nowrap; }
.barra .trilho { height: 8px; border-radius: 4px; background: #222d31; overflow: hidden; }
.barra .preench { height: 100%; border-radius: 4px; }
.barra .preench.gasto { background: var(--laranja); }
.barra .preench.entrada { background: var(--verde); }
.barra small { font-size: 12px; color: var(--mudo); }
.pessoas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pessoa { background: var(--painel); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pessoa .nome { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.pessoa dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 13px; }
.pessoa dt { color: var(--mudo); }
.pessoa dd { margin: 0; text-align: right; font-weight: 700; }

/* ---------- folha de baixo (pagar conta, confirmar) ---------- */
.fundo-folha { position: fixed; inset: 0; z-index: 20; background: rgba(5, 9, 10, 0.6); display: flex; align-items: flex-end; justify-content: center; animation: aparece 0.15s; }
.folha { width: 100%; max-width: 520px; background: #172024; border-radius: 26px 26px 0 0; padding: 10px 20px calc(var(--base) + 20px); display: flex; flex-direction: column; gap: 16px; max-height: 92dvh; overflow-y: auto; animation: sobe 0.2s ease-out; }
.folha .puxador { width: 40px; height: 5px; border-radius: 3px; background: #33403f; margin: 0 auto 4px; }
.folha h2 { margin: 0; font-size: 19px; font-weight: 800; }
.folha p { margin: 0; color: var(--mudo); font-size: 14px; }
@keyframes aparece { from { opacity: 0; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0.4; } }
.icones-conta { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.icones-conta button { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--borda-2); background: var(--painel-2); color: var(--texto); display: flex; align-items: center; justify-content: center; }
.icones-conta button[aria-pressed="true"] { background: var(--verde); color: var(--verde-escuro); border-color: var(--verde); }

/* ---------- aviso ---------- */
#aviso { position: fixed; left: 50%; top: calc(var(--topo) + 14px); transform: translate(-50%, -20px); opacity: 0; z-index: 40; background: #24343a; color: var(--texto); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transition: 0.2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#aviso.ver { opacity: 1; transform: translate(-50%, 0); }
#aviso.ruim { background: #4a2622; }

.processando { position: fixed; inset: 0; z-index: 30; background: rgba(10, 15, 17, 0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-weight: 700; text-align: center; padding: 20px; }
.lista-simples { margin: 0; padding-left: 18px; color: var(--texto-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
