:root {
  --bg: #f4f6f8; --card: #ffffff; --txt: #121722; --mut: #5d6675; --linha: #e4e8ee;
  --acc: #0f766e; --acc-2: #14b8a6; --acc-suave: #e6f6f4;
  --perigo: #c62828; --perigo-suave: #fdecec; --aviso: #b45309; --aviso-suave: #fff4e0;
  --ok: #15803d; --ok-suave: #e8f6ec;
  --raio: 18px; --sombra: 0 1px 2px rgba(16,24,40,.05), 0 2px 10px rgba(16,24,40,.05);
  --nav-h: 72px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--txt);
  line-height: 1.45; min-height: 100vh; overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--acc); }
.hidden { display: none !important; }
.mut { color: var(--mut); }
small, .peq { font-size: .85rem; }
svg.ic { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* topo */
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(244,246,248,.92); backdrop-filter: blur(8px); }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.marca img { width: 32px; height: 32px; border-radius: 9px; }
.sino { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--txt); }
.sino:active { background: var(--linha); }
.bolha { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--perigo); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

main { max-width: 640px; margin: 0 auto; padding: 4px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
h2 { font-size: 1.35rem; margin: 6px 0 4px; }
h3 { font-size: 1.02rem; margin-bottom: 12px; }
.ola { font-size: 1.3rem; font-weight: 700; margin: 4px 0 8px; }

/* cartões de conteúdo */
.card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px; margin: 12px 0; }
.card.total { background: linear-gradient(135deg, #0f766e, #115e59); color: #fff; }
.card.total .rotulo { opacity: .85; font-size: .9rem; }
.valor-grande { font-size: 2.2rem; font-weight: 800; letter-spacing: -.5px; margin: 2px 0; }
.card.total .sub { opacity: .9; font-size: .9rem; }
.resumo-mes { display: flex; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); }
.resumo-mes > div { flex: 1; }
.resumo-mes small { display: block; opacity: .8; font-size: .8rem; }
.resumo-mes b { font-size: 1.05rem; }
.card.total .dica { margin-top: 8px; font-size: .85rem; }
.comp { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.18); font-size: .85rem; }
.aviso-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; }
.aviso-card .ico { font-size: 1.6rem; }
.aviso-card b { display: block; }
.aviso-card.amarelo { background: var(--aviso-suave); }
.aviso-card.vermelho { background: var(--perigo-suave); }
.aviso-card.verde { background: var(--acc-suave); }
.aviso-card .seta { margin-left: auto; color: var(--mut); font-size: 1.4rem; }

/* seletor de mês */
.mes { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 99px;
  box-shadow: var(--sombra); padding: 4px; margin: 8px 0; }
.mes button { width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; color: var(--acc); }
.mes button:disabled { color: var(--linha); }
.mes span { font-weight: 700; text-transform: capitalize; }

/* rosca + legenda */
.rosca { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; }
.rosca svg { width: 150px; height: 150px; flex: none; }
.legenda { flex: 1; min-width: 220px; list-style: none; }
.legenda li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--linha); cursor: pointer; }
.legenda li:last-child { border-bottom: 0; }
.legenda .ponto { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legenda .nome { flex: 1; }
.legenda .v { font-weight: 700; }
.legenda .p { color: var(--mut); width: 42px; text-align: right; font-size: .85rem; }

/* barras */
.barras { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 20px; }
.barra { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.barra .col { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: #cfe9e6; position: relative; min-height: 3px; }
.barra.atual .col { background: var(--acc); }
.barra .lbl { font-size: .78rem; color: var(--mut); text-transform: capitalize; }
.barra .val { font-size: .7rem; color: var(--mut); white-space: nowrap; }
.barra.atual .val { color: var(--txt); font-weight: 700; }

/* listas */
.lista { list-style: none; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--linha); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .emo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex: none; }
.item .meio { flex: 1; min-width: 0; }
.item .tit { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .det { font-size: .82rem; color: var(--mut); }
.item .val { font-weight: 700; white-space: nowrap; }
.item .val.entrada { color: var(--ok); }
.dia { font-size: .8rem; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .4px; margin: 16px 2px 2px; }
.selo { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; margin-left: 4px; vertical-align: 1px; }
.selo.amarelo { background: var(--aviso-suave); color: var(--aviso); }
.selo.vermelho { background: var(--perigo-suave); color: var(--perigo); }
.selo.verde { background: var(--ok-suave); color: var(--ok); }

/* filtros */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 99px; background: var(--card); box-shadow: var(--sombra); font-weight: 600; font-size: .92rem; }
.chip.on { background: var(--acc); color: #fff; }
.filtros { display: flex; gap: 8px; }
.filtros input, .filtros select { flex: 1; min-width: 0; }

/* formulários */
label.campo { display: block; margin: 12px 0 0; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--linha); background: #fff; margin-top: 6px; font-size: 1rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
textarea { min-height: 96px; resize: vertical; }
.valor-input { font-size: 1.6rem !important; font-weight: 800; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: 14px;
  font-weight: 700; background: var(--linha); width: 100%; margin-top: 12px; min-height: 52px; text-decoration: none; color: var(--txt); }
.btn.primario { background: var(--acc); color: #fff; }
.btn.perigo { background: var(--perigo-suave); color: var(--perigo); }
.btn.ok { background: var(--ok-suave); color: var(--ok); }
.btn.link { background: none; color: var(--acc); min-height: 40px; }
.btn:disabled { opacity: .55; }
.btns { display: flex; gap: 10px; }
.btns .btn { flex: 1; }

/* lançar */
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.grande { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px 14px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; min-height: 132px; justify-content: center; }
.grande .e { font-size: 2.1rem; }
.grande b { font-size: 1rem; }
.grande small { color: var(--mut); line-height: 1.3; }
.grande:active { transform: scale(.98); }
.mic { width: 96px; height: 96px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 2.4rem; display: grid; place-items: center; margin: 10px auto; }
.mic.ouvindo { background: var(--perigo); animation: pulso 1.2s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(198,40,40,.45); } 70% { box-shadow: 0 0 0 22px rgba(198,40,40,0); } 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0); } }
.itens { margin-top: 10px; font-size: .88rem; color: var(--mut); }
.itens li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; list-style: none; }
.nota { background: var(--aviso-suave); color: #7a4a0c; padding: 10px 12px; border-radius: 12px; margin-top: 12px; font-size: .9rem; }
.carregando { text-align: center; padding: 40px 0; color: var(--mut); }
.giro { width: 34px; height: 34px; border: 4px solid var(--linha); border-top-color: var(--acc); border-radius: 50%; margin: 0 auto 12px; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.vazio { text-align: center; padding: 28px 10px; color: var(--mut); }
.vazio .e { font-size: 2.4rem; display: block; margin-bottom: 6px; }

/* ajustes */
.opcao { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.opcao:last-child { border-bottom: 0; }
.opcao .txt { flex: 1; }
.opcao .txt small { display: block; color: var(--mut); }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd5dd; border-radius: 99px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--acc); }
.switch input:checked + span::before { transform: translateX(22px); }
.codigo-pessoal { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: 3px; color: var(--acc); }
.tag-tg { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ok); }
.mini-lista li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--linha); list-style: none; }
.mini-lista li:last-child { border-bottom: 0; }
.x { color: var(--perigo); font-weight: 700; padding: 6px 10px; border-radius: 10px; }
.x:active { background: var(--perigo-suave); }
.passos { margin: 10px 0 0 20px; }
.passos li { margin: 6px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--acc); padding: 6px 0; }

/* navegação inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--linha); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--mut);
  text-decoration: none; padding: 6px 8px; min-width: 60px; cursor: pointer; }
.nav a.on { color: var(--acc); }
.nav a.mais { width: 58px; height: 58px; min-width: 0; border-radius: 50%; background: var(--acc); color: #fff; margin-top: -26px;
  box-shadow: 0 6px 16px rgba(15,118,110,.4); justify-content: center; }
.nav a.mais svg { width: 30px; height: 30px; }

/* modal e toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15,20,30,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: sobe .2s ease-out; }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 22px; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-card h2 { margin-top: 0; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 60; width: max-content; max-width: min(90vw, 520px); text-align: center; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.on { opacity: 1; }
#toast.erro { background: var(--perigo); }

/* login */
.login { max-width: 440px; margin: 0 auto; padding: calc(36px + env(safe-area-inset-top)) 18px 40px; text-align: center; }
.login img.logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 8px 22px rgba(15,118,110,.3); }
.login h1 { font-size: 1.7rem; margin: 14px 0 4px; }
.login .card { text-align: left; }
.dica-tg { background: #eaf4fd; }
.dica-tg b { color: #1d6fb8; }
.teste { background: var(--aviso-suave); padding: 10px 12px; border-radius: 12px; margin-top: 12px; font-size: .9rem; }
.notif { padding: 14px 0; border-bottom: 1px solid var(--linha); }
.notif:last-child { border-bottom: 0; }
.notif.nova { }
.notif .quando { font-size: .78rem; color: var(--mut); margin-bottom: 4px; }
.notif .texto { white-space: pre-line; }

/* pistas */
.pistas { background: #f3f7fb; border: 1px solid #dfe8f2; border-radius: 14px; padding: 12px 14px; margin: 4px 0 6px; font-size: .9rem; }
.pistas ul { list-style: none; margin-top: 6px; }
.pistas li { display: flex; gap: 8px; padding: 5px 0; line-height: 1.35; }
.pistas .ico-p { flex: none; }
.item .det.pista { color: #1d4f7a; margin-top: 2px; }

.seg { display: flex; gap: 6px; background: #eef2f1; padding: 4px; border-radius: 12px; margin: 4px 0 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; font: inherit; font-weight: 600; color: #475569; cursor: pointer; }
.seg button.on { background: #fff; color: #0f766e; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.pergunta { padding: 14px 16px; }
.pergunta label { display: block; margin-bottom: 8px; }
.linha-perg { display: flex; gap: 8px; }
.linha-perg input { flex: 1; margin: 0; }
.linha-perg .btn { width: auto; margin: 0; padding: 0 18px; }
.chips-perg { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.chips-perg .chip { white-space: nowrap; border: 1px solid #d5e3e0; background: #f3f8f7; color: #0f766e; border-radius: 99px;
  padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.resposta { font-size: 1.05rem; line-height: 1.55; background: #f3f8f7; border-radius: 12px; padding: 14px; }
