/* Personal NST - Nova System Tecnologias */
:root {
  --fundo: #f6f7f9;
  --cartao: #ffffff;
  --cartao-2: #f1f3f6;
  --texto: #0b1220;
  --suave: #6b7280;
  --linha: #eaecf0;
  --pri: #0d9488;
  --pri-forte: #0f766e;
  --pri-claro: #e6f5f3;
  --sobre-pri: #ffffff;
  --verde: #059669;
  --vermelho: #e11d48;
  --amarelo: #d97706;
  --heroi: linear-gradient(140deg, #dcf5ee 0%, #eefaf6 55%, #f8fdfb 100%);
  --heroi-borda: #cdeee5;
  --heroi-linha: rgba(13, 148, 136, .16);
  --heroi-neg: linear-gradient(140deg, #ffe4ea 0%, #fff4f6 100%);
  --fundo-entrar: radial-gradient(130% 70% at 50% 0%, #d4f3eb 0%, #ecf9f5 45%, #f8fbfa 100%);
  --raio: 20px;
  --vidro: rgba(255, 255, 255, .82);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pri-forte); }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.tela {
  max-width: 560px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom));
}
.carregando { padding: 40vh 0; text-align: center; color: var(--suave); }

/* Topo */
.topo { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; }
.topo h1 { font-size: 1.5rem; margin: 0; flex: 1; letter-spacing: -.02em; font-weight: 700; }
.topo .ola { color: var(--suave); font-size: .88rem; display: block; font-weight: 500; letter-spacing: 0; margin-bottom: 2px; }
.icone-btn {
  border: 0; background: var(--cartao-2); color: var(--texto); width: 42px; height: 42px; border-radius: 50%;
  cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; flex: none;
}
.icone-btn:hover { background: var(--linha); }

/* Numero principal (claro, com o cofrinho) */
.heroi {
  position: relative; overflow: hidden; background: var(--heroi); color: var(--texto);
  border: 1px solid var(--heroi-borda); border-radius: 26px; padding: 22px 22px 18px;
}
.heroi .porco { position: absolute; right: -14px; top: 6px; width: 118px; height: auto; opacity: .95; pointer-events: none; }
.heroi .rot { font-size: .92rem; color: var(--pri-forte); font-weight: 600; position: relative; }
.heroi .valor { font-size: 2.75rem; font-weight: 780; letter-spacing: -.035em; margin: 4px 0 2px; line-height: 1.1; position: relative; }
.heroi .sub { font-size: .9rem; color: var(--suave); position: relative; }
.heroi .sub strong { color: var(--texto); font-weight: 650; }
.heroi.negativo { background: var(--heroi-neg); border-color: transparent; }
.heroi.negativo .valor, .heroi.negativo .rot { color: var(--vermelho); }
.heroi .trio { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--heroi-linha); }
.heroi .trio .r { font-size: .74rem; color: var(--suave); }
.heroi .trio .v { font-weight: 650; font-size: .95rem; overflow-wrap: anywhere; }
/* Barra de lancamento rapido */
.frase {
  display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; background: var(--cartao);
  border: 1px solid var(--linha); border-radius: 999px; padding: 5px 5px 5px 18px;
}
.frase input[type=text] { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; min-height: 40px; outline: none; border-radius: 0; }
.frase .icone-btn { width: 40px; height: 40px; background: none; color: var(--suave); }
.frase .btn { border-radius: 999px; min-height: 40px; padding: 8px 16px; }

/* Secoes */
.secao-tit { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 4px 8px; }
.secao-tit h2 { font-size: 1.02rem; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.secao-tit a, .link { font-size: .88rem; color: var(--pri-forte); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: none; font-weight: 550; }
.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 6px 16px; margin-bottom: 12px; }
.cartao.pad { padding: 16px; }

/* Formularios */
label.campo { display: block; margin-bottom: 14px; }
label.campo > span { display: block; font-size: .82rem; color: var(--suave); margin-bottom: 6px; font-weight: 550; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 14px;
  background: var(--cartao-2); outline: none; min-height: 48px; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--pri); background: var(--cartao); }
input.grande { font-size: 2.2rem; font-weight: 750; text-align: center; letter-spacing: -.03em; background: none; min-height: 64px; }
input.grande:focus { background: none; border-color: transparent; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 12px; align-items: center; margin: 4px 0 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--pri); flex: none; }
.dica { font-size: .84rem; color: var(--suave); margin: -4px 0 12px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 14px; padding: 12px 18px; min-height: 48px; cursor: pointer;
  background: var(--pri); color: var(--sobre-pri); font-weight: 650; text-decoration: none;
}
.btn:hover { filter: brightness(.95); }
.btn.sec { background: var(--pri-claro); color: var(--pri-forte); }
.btn.neutro { background: var(--cartao-2); color: var(--texto); }
.btn.perigo { background: transparent; color: var(--vermelho); box-shadow: inset 0 0 0 1px currentColor; }
.btn.bloco { width: 100%; }
.btn.peq { min-height: 32px; padding: 5px 12px; font-size: .82rem; border-radius: 999px; }
.btn:disabled { opacity: .55; cursor: wait; }
.acoes { display: flex; gap: 10px; margin-top: 8px; }
.acoes .btn { flex: 1; }

.alternar { display: grid; grid-template-columns: 1fr 1fr; background: var(--cartao-2); border-radius: 999px; padding: 4px; margin-bottom: 6px; }
.alternar button { border: 0; background: none; padding: 9px; border-radius: 999px; cursor: pointer; font-weight: 650; color: var(--suave); }
.alternar button.ativo { background: var(--cartao); color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.alternar button.ativo.desp { color: var(--vermelho); }
.alternar button.ativo.rec { color: var(--verde); }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .ic svg.i { width: 21px; height: 21px; }
.item .ic {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--cartao-2); flex: none; font-size: 1.15rem; color: var(--suave);
}
.item .meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { display: block; font-size: .8rem; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .val { font-weight: 650; text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item .val .s { font-weight: 400; }
.desp { color: var(--vermelho); }
.rec { color: var(--verde); }
.selo { display: inline-block; font-size: .7rem; padding: 1px 8px; border-radius: 99px; background: var(--cartao-2); color: var(--suave); margin-left: 4px; font-weight: 650; vertical-align: 1px; }
.selo.pend { background: #fef3c7; color: #92400e; }
.selo.atras { background: #ffe4e6; color: #9f1239; }
.dia { font-size: .76rem; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; margin: 18px 4px 4px; }
.vazio { text-align: center; color: var(--suave); padding: 26px 12px; font-size: .94rem; }
.vazio .grande { font-size: 2rem; display: block; margin-bottom: 6px; }

/* Barras */
.barra { height: 6px; background: var(--cartao-2); border-radius: 99px; overflow: hidden; margin-top: 7px; }
.barra > i { display: block; height: 100%; background: var(--pri); border-radius: 99px; }
.barra.alerta > i { background: var(--amarelo); }
.barra.estouro > i { background: var(--vermelho); }

/* Carrossel (contas e metas) */
.trilho { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.trilho::-webkit-scrollbar { display: none; }
.mini {
  flex: none; width: 168px; scroll-snap-align: start; background: var(--cartao); border: 1px solid var(--linha);
  border-radius: var(--raio); padding: 14px; cursor: pointer; text-align: left;
}
.mini .ponto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.mini .n { font-size: .84rem; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.mini .v { font-weight: 700; font-size: 1.1rem; margin-top: 10px; }
.mini .s { font-size: .74rem; color: var(--suave); }
.mini.novo { display: grid; place-items: center; color: var(--pri-forte); font-weight: 600; border-style: dashed; background: none; width: 120px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--cartao-2); border-radius: 99px; padding: 8px 14px; cursor: pointer; font-size: .88rem; font-weight: 550; color: var(--texto); }
.chip.ativo { background: var(--texto); color: var(--fundo); }

.mesnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mesnav strong { font-size: 1.05rem; }
.resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 14px; }
.resumo > div { background: var(--cartao); border: 1px solid var(--linha); border-radius: 16px; padding: 10px 12px; }
.resumo .r { font-size: .74rem; color: var(--suave); }
.resumo .v { font-weight: 650; font-size: .95rem; overflow-wrap: anywhere; }

/* Menu inferior flutuante */
.menu {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--vidro); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid var(--linha); border-radius: 24px; padding: 6px; max-width: 520px; margin: 0 auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}
.menu a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--suave); font-size: .68rem; font-weight: 550; padding: 6px 0; border-radius: 16px; }
.menu a.ativo { color: var(--texto); }
.menu a.ativo svg.i { stroke-width: 2.3; }
.fab {
  justify-self: center; width: 52px; height: 52px; border-radius: 18px; border: 0;
  background: var(--pri); color: var(--sobre-pri); cursor: pointer; display: grid; place-items: center;
}
.fab svg.i { width: 26px; height: 26px; stroke-width: 2.4; }

/* Folha (modal de baixo para cima) */
.folha-fundo { position: fixed; inset: 0; background: rgba(2, 6, 23, .4); z-index: 30; backdrop-filter: blur(2px); }
.folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-width: 560px; margin: 0 auto;
  background: var(--cartao); border-radius: 28px 28px 0 0; max-height: 92vh; overflow-y: auto; overflow-x: hidden;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: subir .2s ease-out;
}
.folha .alca { width: 40px; height: 5px; background: var(--linha); border-radius: 99px; margin: 0 auto 14px; }
.folha h2 { margin: 0 0 16px; font-size: 1.2rem; letter-spacing: -.01em; }
@keyframes subir { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }

.aviso {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--texto); color: var(--fundo); padding: 12px 18px; border-radius: 16px; max-width: calc(100% - 32px);
  font-size: .92rem; font-weight: 550; box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}
.aviso.erro { background: var(--vermelho); color: #fff; }

/* Assistente */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bolha { max-width: 86%; padding: 11px 15px; border-radius: 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .96rem; }
.bolha.eu { align-self: flex-end; background: var(--pri); color: var(--sobre-pri); border-bottom-right-radius: 6px; }
.bolha.ia { align-self: flex-start; background: var(--cartao); border: 1px solid var(--linha); border-bottom-left-radius: 6px; }
.bolha.pensando { color: var(--suave); }
.chat-entrada {
  position: sticky; bottom: calc(92px + env(safe-area-inset-bottom)); display: flex; gap: 6px; align-items: center;
  background: var(--cartao); border: 1px solid var(--linha); border-radius: 999px; padding: 5px 5px 5px 18px;
}
.chat-entrada input[type=text] { flex: 1; min-width: 0; border: 0; background: none; min-height: 40px; padding: 8px 0; border-radius: 0; }
.chat-entrada input:focus, .frase input:focus { background: none; border: 0; }
.chat-entrada .btn { border-radius: 999px; width: 40px; min-height: 40px; padding: 0; }

/* Entrar */
/* Entrada: foto do cofrinho (celular: no alto; computador: metade esquerda) */
body.fundo-entrar { background: #f4fbf9; }
body.fundo-entrar .tela { max-width: none; padding: 0; }
.entrar-pagina { min-height: 100vh; }
.entrar-foto {
  height: 46vh; min-height: 300px; background: #bfe3f5 url(/img/fundo-celular.jpg) 50% 56% / cover no-repeat;
}
.entrar {
  position: relative; max-width: 440px; margin: -28px auto 0; background: #f4fbf9; border-radius: 28px 28px 0 0;
  padding: 22px 16px calc(24px + env(safe-area-inset-bottom));
}
.marca { display: flex; align-items: center; gap: 12px; margin: 0 4px 18px; text-align: left; }
.marca img { width: 52px; height: auto; flex: none; }
.marca h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.marca p { margin: 2px 0 0; color: var(--suave); font-size: .92rem; }
@media (min-width: 900px) {
  .entrar-pagina { display: grid; grid-template-columns: 1.25fr 1fr; }
  .entrar-foto { height: 100vh; position: sticky; top: 0; background-image: url(/img/fundo-desktop.jpg); background-position: 50% 50%; }
  .entrar { margin: 0; align-self: center; justify-self: center; width: 100%; max-width: 420px; border-radius: 0; background: none; padding: 40px 24px; }
}.instalar-grande {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); color: #fff; border-radius: 22px;
  padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 12px 28px rgba(13, 148, 136, .28);
}
.instalar-grande .ii { width: 46px; height: 46px; border-radius: 15px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; flex: none; }
.instalar-grande strong { font-size: 1.02rem; }
.instalar-grande small { opacity: .9; font-size: .84rem; }
.instalar-grande .seta { margin-left: auto; opacity: .85; display: grid; }




.entrar .cartao { padding: 20px; }

.instalar { display: flex; gap: 12px; align-items: center; background: var(--pri-claro); border-radius: var(--raio); padding: 12px 14px; margin-bottom: 14px; }
.instalar p { margin: 0; flex: 1; font-size: .88rem; }

.perfil { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--pri-claro); color: var(--pri-forte); display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; flex: none; }

.rodape { text-align: center; color: var(--suave); font-size: .78rem; margin: 30px 0 8px; }
.tabela-admin .item { cursor: default; }
.mascara { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; color: var(--suave); }
.titulo-cartao { margin: 10px 0 14px; font-size: 1.02rem; font-weight: 650; }

@media (max-width: 370px) {
  .heroi .valor { font-size: 2.2rem; }
  .heroi .trio .v, .resumo .v { font-size: .84rem; }
}

/* Escolha de icone e cor da categoria */
.campo .rotulo { display: block; font-size: .82rem; color: var(--suave); margin-bottom: 8px; font-weight: 550; }
.grade-icones { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.esc-icone { aspect-ratio: 1; border: 0; border-radius: 14px; background: var(--cartao-2); color: var(--suave); cursor: pointer; display: grid; place-items: center; }
.esc-icone.ativo { box-shadow: inset 0 0 0 2px currentColor; }
.grade-cores { display: flex; flex-wrap: wrap; gap: 10px; }
.esc-cor { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; }
.esc-cor.ativo { box-shadow: 0 0 0 3px var(--cartao), 0 0 0 5px var(--texto); }
.btn svg.i { width: 20px; height: 20px; }
