:root {
  --verde: #2F6B4F; --verde-esc: #1F4A36; --texto: #14171A; --suave: #5B6168;
  --borda: #E3E5E1; --linha: #EEF0EC; --campo: #D5D8D3; --fundo-sel: #F4F9F6;
  --ok-bg: #E6F2EA; --ok-tx: #2F6B4F; --ok-bd: #CFE3D6;
  --warn-bg: #FBF0D5; --warn-tx: #7A5A14; --warn-bd: #EEDDB3;
  --neg-bg: #FBE4E2; --neg-tx: #A0362B; --neg-bd: #F1CFCB;
  --e: #3A9D6A; --s: #D1495B; --d: #9AA0A6; --hoje: #1F2A24;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: #FFFFFF; }
body { font-family: Inter, system-ui, -apple-system, sans-serif; color: var(--texto); -webkit-tap-highlight-color: transparent; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
#app.sem-menu { padding-bottom: 24px; }
main { flex: 1; padding: calc(22px + env(safe-area-inset-top)) 22px 22px; display: flex; flex-direction: column; gap: 20px; }
h1 { margin: 0; font-size: 22px; font-weight: 700; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
p { margin: 0; }
.sub { font-size: 14px; color: var(--suave); line-height: 1.5; }
.grande { font-size: 40px; font-weight: 700; letter-spacing: -1px; }
.neg { color: var(--neg-tx); }
.pos { color: var(--verde); }
.bloco { display: flex; flex-direction: column; gap: 4px; }
.bloco-12 { display: flex; flex-direction: column; gap: 12px; }
.divisor { border-top: 1px solid var(--linha); padding-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rotulo { font-size: 14px; color: var(--suave); }
.valor-md { font-size: 18px; font-weight: 600; }
.mini { font-size: 13px; color: var(--suave); }
.botao { height: 52px; border: 0; border-radius: 14px; background: var(--verde); color: #fff; font: 600 16px Inter, system-ui, sans-serif; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; cursor: pointer; }
.botao:active { background: var(--verde-esc); }
.botao[disabled] { opacity: .6; }
.botao-sec { min-height: 48px; border: 1px solid var(--campo); border-radius: 12px; background: #fff; color: var(--texto); font: 500 15px Inter, system-ui, sans-serif; width: 100%; cursor: pointer; padding: 0 14px; }
.botao-mini { border: 1px solid var(--campo); border-radius: 10px; background: #fff; color: var(--texto); font: 600 13px Inter, system-ui, sans-serif; padding: 8px 12px; cursor: pointer; }
.link { background: none; border: 0; color: var(--verde); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; padding: 8px 0; text-align: left; }
label.campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date] {
  height: 48px; border-radius: 10px; border: 1px solid var(--campo); padding: 0 14px; font: 16px Inter, system-ui, sans-serif; color: var(--texto); background: #fff; width: 100%; -webkit-appearance: none; appearance: none;
}
input:focus { outline: 2px solid var(--verde); outline-offset: -1px; }
.opcional { font-weight: 400; color: var(--suave); }
.erro { background: var(--neg-bg); color: var(--neg-tx); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.ok-box { background: var(--ok-bg); border: 1px solid var(--ok-bd); border-radius: 12px; padding: 14px; font-size: 14px; line-height: 1.5; }
.carregando { color: var(--suave); font-size: 15px; padding: 40px 0; text-align: center; }
.aviso { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--texto); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; max-width: 90%; z-index: 20; text-align: center; }

/* Marca */
.marca { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 24px; text-align: center; }
.marca img { width: 64px; height: 64px; border-radius: 18px; }

/* Etiqueta do dia */
.etiqueta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; align-self: flex-start; margin-top: 4px; }
.etiqueta.ok { background: var(--ok-bg); color: var(--ok-tx); }
.etiqueta.warn { background: var(--warn-bg); color: var(--warn-tx); }
.etiqueta.neg { background: var(--neg-bg); color: var(--neg-tx); }

/* Barra da meta */
.barra { height: 10px; background: var(--linha); border-radius: 99px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); border-radius: 99px; }
.barra.passou i { background: var(--s); }

/* Bolinhas por tipo */
.dot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex: 0 0 26px; }
.dot.e { background: var(--e); } .dot.s { background: var(--s); } .dot.d { background: var(--d); }
.dot.p { width: 18px; height: 18px; flex-basis: 18px; font-size: 10px; }

/* Lista de lançamentos */
.item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--linha); font-size: 15px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; font-family: inherit; color: inherit; text-align: left; cursor: pointer; }
.lista > .item:first-child { border-top: 0; }
.item .desc { flex: 1; min-width: 0; }
.item .desc b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .val { font-weight: 600; white-space: nowrap; }

/* Mês */
.mesnav { display: flex; align-items: center; justify-content: space-between; }
.seta { width: 44px; height: 44px; border: 0; background: none; color: var(--texto); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cartao { background: #F6F8F6; border-radius: 14px; padding: 14px 16px; }
.linha-res { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; padding: 5px 0; }
.linha-res span:first-child { color: var(--suave); }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { font: 600 14px Inter, system-ui, sans-serif; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--campo); color: var(--suave); background: #fff; cursor: pointer; }
.chip.on { background: var(--verde); border-color: var(--verde); color: #fff; }
.tabela { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabela th { font-size: 13px; color: var(--suave); font-weight: 600; text-align: right; padding: 8px; border-bottom: 1px solid var(--linha); }
.tabela th:first-child, .tabela td:first-child { text-align: left; }
.tabela td { text-align: right; padding: 7px 8px; border-bottom: 1px solid #F3F4F1; }
.tabela td.cel { padding: 4px 0 4px 8px; }
.saldo { display: block; font-weight: 700; padding: 5px 8px; border-radius: 7px; }
.saldo.ok { background: var(--ok-bg); color: var(--ok-tx); }
.saldo.warn { background: var(--warn-bg); color: var(--warn-tx); }
.saldo.neg { background: var(--neg-bg); color: var(--neg-tx); }
.tabela tr.hoje td { background: var(--hoje); color: #fff; }
.tabela tr.hoje td:first-child { border-radius: 8px 0 0 8px; }
.tabela tr.hoje td:last-child { border-radius: 0 8px 8px 0; }
.tabela tr.hoje .saldo { background: transparent; color: #FFE08A; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--suave); }
.legenda span { display: flex; align-items: center; gap: 6px; }
.legenda i { width: 16px; height: 12px; border-radius: 4px; display: inline-block; }

/* Lançar */
.tipo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--borda); border-radius: 12px; cursor: pointer; }
.tipo.sel { border: 2px solid var(--verde); background: var(--fundo-sel); padding: 11px 13px; }
.tipo input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--verde); }
.tipo b { display: block; font-size: 15px; font-weight: 600; }
.tipo span span { font-size: 13px; color: var(--suave); }
.cab { display: flex; align-items: center; gap: 8px; }
.voltar { width: 44px; height: 44px; margin-left: -12px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--texto); cursor: pointer; }

/* Menu com o + no centro */
nav.menu { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: calc(100% - 28px); max-width: 452px; height: 62px; border: 1px solid var(--borda); border-radius: 999px; background: #fff; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; z-index: 10; box-shadow: 0 6px 20px rgba(20, 23, 26, .08); }
nav.menu button { border: 0; background: none; font: 500 14px Inter, system-ui, sans-serif; color: var(--suave); cursor: pointer; height: 100%; }
nav.menu button.ativo { color: var(--verde); font-weight: 700; }
nav.menu button.mais { justify-self: center; width: 56px; height: 56px; border-radius: 50%; background: var(--verde); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -24px; box-shadow: 0 6px 14px rgba(47, 107, 79, .35); }
nav.menu button.mais:active { background: var(--verde-esc); }

/* Administração */
.cli { border: 1px solid var(--borda); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.cli .topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok-tx); }
.pill.neg { background: var(--neg-bg); color: var(--neg-tx); }
.pill.warn { background: var(--warn-bg); color: var(--warn-tx); }
.acoes { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pedido { background: var(--warn-bg); border: 1px solid var(--warn-bd); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pedido span { flex: 1; }
