/* Programa Zache — interface mobile-first. Cores da Ribeiro, Lda.: vermelho, preto, cinzento-escuro. */
:root {
  --verm: #A50A0E; --verm-2: #C81A1F; --verm-claro: #FBEAEA; --verm-txt: #A50A0E;
  --tinta: #141416; --cinza: #3B3A3C; --muted: #6E6D72; --fundo: #F5F4F2; --cartao: #FFFFFF;
  --linha: #E8E6E3; --verde: #1C8A57; --verde-claro: #E6F4EC; --ambar: #B86E00; --ambar-claro: #FFF4E0;
  --azul: #1D5FB8; --azul-claro: #E8F0FB; --sombra: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --r: 18px; --r-s: 12px; --nav-h: 64px;
  --topo: env(safe-area-inset-top, 0px); --base: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --verm: #E0262B; --verm-2: #F0393E; --verm-claro: #3A1416; --verm-txt: #FF6B6F;
    --tinta: #F1F0EE; --cinza: #C9C8CC; --muted: #9C9BA1; --fundo: #0E0E10; --cartao: #19191C;
    --linha: #2A2A2F; --verde: #3CC285; --verde-claro: #12291E; --ambar: #F0A43A; --ambar-claro: #2E2310;
    --azul: #6EA4F0; --azul-claro: #14213A; --sombra: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--tinta); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100dvh; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--verm-txt); }
.oculto { display: none !important; }
.muted { color: var(--muted); }
.peq { font-size: 13px; }
.lin { display: flex; align-items: center; gap: 8px; }
.lin.entre { justify-content: space-between; }
.cresce { flex: 1; min-width: 0; }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------ estrutura */
#topo {
  position: sticky; top: 0; z-index: 20; padding: calc(var(--topo) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--fundo) 88%, transparent); backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 10px;
}
#topo .logo { height: 26px; }
#topo .titulo { font-weight: 800; font-size: 20px; flex: 1; }
.btn-ico {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--cartao); box-shadow: var(--sombra);
  display: inline-grid; place-items: center; font-size: 19px; cursor: pointer; position: relative; flex: none;
}
.btn-ico .bolinha { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--verm); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
main { padding: 4px 16px calc(var(--nav-h) + var(--base) + 90px); max-width: 720px; margin: 0 auto; }

#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--base)); padding-bottom: var(--base);
  background: var(--cartao); border-top: 1px solid var(--linha); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
#nav a { text-decoration: none; color: var(--muted); display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; padding: 6px 0; }
#nav a .i { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .75; }
#nav a.activo { color: var(--verm-txt); }
#nav a.activo .i { filter: none; opacity: 1; }
#nav .mais {
  justify-self: center; width: 60px; height: 60px; margin-top: -26px; border-radius: 20px; border: 0; cursor: pointer;
  background: var(--verm); color: #fff; font-size: 32px; font-weight: 300; box-shadow: 0 8px 22px rgba(165,10,14,.35);
}
#nav .mais:active { transform: scale(.95); }

/* ------------------------------------------------ blocos */
.cartao { background: var(--cartao); border-radius: var(--r); box-shadow: var(--sombra); padding: 14px 16px; margin: 12px 0; }
.seccao { margin: 22px 2px 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.seccao a, .seccao button { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; background: none; border: 0; color: var(--verm-txt); cursor: pointer; text-decoration: none; }
.saudacao { margin: 6px 2px 0; }
.saudacao h1 { font-size: 26px; line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.saudacao .data { color: var(--muted); margin-top: 2px; }
.saudacao .data::first-letter { text-transform: uppercase; }
.frase { margin: 10px 2px 0; font-size: 14px; color: var(--muted); font-style: italic; }
.frase b { font-style: normal; font-weight: 600; }

.btn {
  border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; cursor: pointer; min-height: 46px;
  background: var(--fundo); color: var(--tinta); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn.prim { background: var(--verm); color: #fff; }
.btn.sec { background: var(--verm-claro); color: var(--verm-txt); }
.btn.verde { background: var(--verde); color: #fff; }
.btn.fino { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 11px; }
.btn.larga { width: 100%; }
.btn:disabled { opacity: .5; }
.btn:active { transform: scale(.98); }
.accoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.accoes.grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); }
.accao-q { display: grid; justify-items: center; gap: 4px; background: var(--fundo); border: 0; border-radius: 14px; padding: 10px 4px; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--tinta); }
.accao-q .i { font-size: 20px; }

/* ------------------------------------------------ "a seguir" */
.seguir { background: linear-gradient(135deg, var(--verm), #7A0709); color: #fff; position: relative; overflow: hidden; }
.seguir::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 26px solid rgba(255,255,255,.07); }
.seguir .rot { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.seguir h2 { margin: 4px 0 2px; font-size: 21px; line-height: 1.2; }
.seguir .meta { opacity: .9; font-size: 14px; }
.seguir .accao-q { background: rgba(255,255,255,.14); color: #fff; }
.seguir .contexto { margin-top: 10px; background: rgba(0,0,0,.18); border-radius: 12px; padding: 9px 11px; font-size: 13.5px; }

/* ------------------------------------------------ sugestões */
.sug { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; align-items: start; }
.sug .ic { font-size: 24px; line-height: 1.2; }
.sug h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.sug p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.sug .fechar { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 2px; }
.sug .accoes { grid-column: 2 / 4; margin-top: 8px; }
.sug.p1 { border-left: 4px solid var(--verm); }
.carrossel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.carrossel::-webkit-scrollbar { display: none; }
.carrossel > .cartao { flex: 0 0 86%; scroll-snap-align: center; margin: 4px 0; }

/* ------------------------------------------------ linha do tempo */
.tl { position: relative; }
.tl-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linha); cursor: pointer; }
.tl-item:last-child { border-bottom: 0; }
.tl-item .h { font-weight: 800; font-size: 14px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.tl-item .h small { display: block; font-weight: 500; font-size: 12px; }
.tl-item .t { font-weight: 700; }
.tl-item .s { font-size: 13.5px; color: var(--muted); }
.tl-item.passado { opacity: .55; }
.tl-item.agora .h { color: var(--verm-txt); }
.tl-livre { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--linha); cursor: pointer; color: var(--verde); font-size: 13.5px; font-weight: 600; }
.etq { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 20px; background: var(--fundo); color: var(--muted); vertical-align: 1px; }
.etq.verde { background: var(--verde-claro); color: var(--verde); }
.etq.verm { background: var(--verm-claro); color: var(--verm-txt); }
.etq.ambar { background: var(--ambar-claro); color: var(--ambar); }
.etq.azul { background: var(--azul-claro); color: var(--azul); }

/* ------------------------------------------------ tarefas */
.tarefa { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--linha); }
.tarefa:last-child { border-bottom: 0; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--linha); background: none; cursor: pointer; display: grid; place-items: center; color: transparent; font-size: 15px; font-weight: 900; transition: .15s; }
.check.p1 { border-color: var(--verm); }
.check.p2 { border-color: var(--ambar); }
.check.feito { background: var(--verde); border-color: var(--verde); color: #fff; }
.tarefa.feita .tt { text-decoration: line-through; color: var(--muted); }
.tarefa .tt { font-weight: 600; }
.tarefa .ts { font-size: 12.5px; color: var(--muted); }
.mini { background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.sapo { border: 2px solid var(--verde); background: var(--verde-claro); }
.sapo .rot { font-size: 12px; font-weight: 800; color: var(--verde); letter-spacing: .06em; text-transform: uppercase; }

/* ------------------------------------------------ hábitos */
.habitos { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.habito { flex: none; border: 2px solid var(--linha); background: var(--cartao); border-radius: 16px; padding: 8px 12px; cursor: pointer; display: grid; justify-items: center; min-width: 84px; }
.habito .i { font-size: 22px; }
.habito .n { font-size: 12px; font-weight: 700; max-width: 96px; text-align: center; line-height: 1.2; }
.habito .s { font-size: 11px; color: var(--muted); }
.habito.feito { border-color: var(--verde); background: var(--verde-claro); }

/* ------------------------------------------------ progresso */
.anel { --p: 0; width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--verde) calc(var(--p) * 1%), var(--linha) 0); display: grid; place-items: center; flex: none; }
.anel span { width: 42px; height: 42px; border-radius: 50%; background: var(--cartao); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.barra { height: 6px; border-radius: 3px; background: var(--linha); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 3px; background: var(--verde); }
.barra.ambar i { background: var(--ambar); }
.barra.verm i { background: var(--verm); }

/* ------------------------------------------------ agenda */
.semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0 4px; }
.semana button { border: 0; background: none; border-radius: 14px; padding: 7px 0; cursor: pointer; display: grid; justify-items: center; gap: 1px; color: var(--tinta); }
.semana .dn { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.semana .dd { font-size: 18px; font-weight: 800; }
.semana .pts { height: 6px; display: flex; gap: 2px; }
.semana .pts i { width: 5px; height: 5px; border-radius: 50%; background: var(--verm); }
.semana button.hoje .dd { color: var(--verm-txt); }
.semana button.sel { background: var(--verm); color: #fff; }
.semana button.sel .dn, .semana button.sel .dd { color: #fff; }
.semana button.sel .pts i { background: #fff; }

/* ------------------------------------------------ pessoas */
.filtros { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.filtro { flex: none; border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 20px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.filtro.activo { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }
.pessoa { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linha); cursor: pointer; }
.pessoa:last-child { border-bottom: 0; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 16px; flex: none; }
.avatar.g { width: 64px; height: 64px; border-radius: 20px; font-size: 24px; }
.pessoa .n { font-weight: 700; }
.pessoa .e { font-size: 13px; color: var(--muted); }
.pessoa .dir { text-align: right; font-size: 12px; color: var(--muted); }
.pessoa .barra { width: 54px; margin-top: 4px; margin-left: auto; }
.pesquisa { width: 100%; border: 0; background: var(--cartao); box-shadow: var(--sombra); border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; }
.estagios { display: flex; gap: 4px; margin-top: 10px; }
.estagios button { flex: 1; border: 0; padding: 8px 2px; font-size: 11.5px; font-weight: 700; border-radius: 9px; background: var(--fundo); color: var(--muted); cursor: pointer; }
.estagios button.on { background: var(--verm); color: #fff; }
.estagios button.feito { background: var(--verm-claro); color: var(--verm-txt); }
.info-l { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 7px 0; font-size: 15px; border-bottom: 1px solid var(--linha); }
.info-l:last-child { border-bottom: 0; }
.hist { border-left: 2px solid var(--linha); margin-left: 8px; padding-left: 14px; }
.hist .item { position: relative; padding: 6px 0 10px; }
.hist .item::before { content: ""; position: absolute; left: -20px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--cartao); border: 2px solid var(--verm); }
.hist .q { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------ folha (bottom sheet) */
.veu { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 50; opacity: 0; transition: opacity .2s; }
.veu.on { opacity: 1; }
.folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--cartao); border-radius: 24px 24px 0 0; padding: 8px 18px calc(18px + var(--base));
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); max-width: 720px; margin: 0 auto;
}
.folha.on { transform: none; }
.folha .pega { width: 42px; height: 5px; border-radius: 3px; background: var(--linha); margin: 2px auto 10px; }
.folha h2 { margin: 4px 0 12px; font-size: 20px; }
.campo { display: grid; gap: 5px; margin: 12px 0; }
.campo > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.campo input, .campo select, .campo textarea, .entrada {
  width: 100%; border: 1.5px solid var(--linha); border-radius: 12px; padding: 11px 12px; background: var(--fundo); font-size: 16px; outline: none;
}
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { border-color: var(--verm); }
.campo textarea { min-height: 84px; resize: vertical; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duas .campo { margin: 6px 0; }

/* captura rápida */
.captura { display: flex; gap: 8px; align-items: flex-end; }
.captura textarea { flex: 1; border: 2px solid var(--verm); border-radius: 16px; padding: 13px 14px; font-size: 18px; min-height: 58px; max-height: 140px; resize: none; background: var(--fundo); outline: none; line-height: 1.35; }
.mic { width: 58px; height: 58px; border-radius: 16px; border: 0; background: var(--tinta); color: var(--fundo); font-size: 24px; cursor: pointer; flex: none; }
.mic.ouvir { background: var(--verm); color: #fff; animation: pulso 1s infinite; }
@keyframes pulso { 50% { box-shadow: 0 0 0 10px rgba(224,38,43,.18); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; min-height: 30px; }
.chip { display: inline-flex; gap: 5px; align-items: center; background: var(--fundo); border: 1px solid var(--linha); border-radius: 20px; padding: 4px 10px; font-size: 14px; font-weight: 600; max-width: 100%; }
.chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tipos { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; scrollbar-width: none; }
.tipos button { flex: none; border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 7px 11px; font-weight: 700; font-size: 14px; cursor: pointer; }
.tipos button.on { border-color: var(--verm); background: var(--verm-claro); color: var(--verm-txt); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.slot { border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 8px 12px; cursor: pointer; text-align: left; }
.slot b { display: block; font-size: 14px; }
.slot small { color: var(--muted); font-size: 12px; }
.slot.on { border-color: var(--verde); background: var(--verde-claro); }
.exemplos { font-size: 13px; color: var(--muted); margin-top: 6px; }
.exemplos button { background: none; border: 0; color: var(--verm-txt); font: inherit; padding: 2px 0; cursor: pointer; text-align: left; }

.resultados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.resultados button { border: 2px solid var(--linha); background: var(--cartao); border-radius: 16px; padding: 12px 4px; cursor: pointer; display: grid; justify-items: center; gap: 4px; font-weight: 700; font-size: 13px; }
.resultados button .i { font-size: 30px; }
.resultados button.on { border-color: var(--verm); background: var(--verm-claro); }
.passos { display: flex; flex-wrap: wrap; gap: 6px; }
.passos button { border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 8px 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.passos button.on { border-color: var(--verde); background: var(--verde-claro); color: var(--verde); }

/* ------------------------------------------------ toast */
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--base) + 14px); z-index: 60; display: grid; justify-items: center; pointer-events: none; }
.torrada { pointer-events: auto; background: var(--tinta); color: var(--fundo); border-radius: 14px; padding: 12px 14px; display: flex; gap: 14px; align-items: center; box-shadow: 0 8px 26px rgba(0,0,0,.25); max-width: 560px; width: 100%; animation: sobe .2s; }
.torrada button { background: none; border: 0; color: #FF8A8D; font-weight: 800; cursor: pointer; white-space: nowrap; }
@keyframes sobe { from { transform: translateY(20px); opacity: 0; } }

/* ------------------------------------------------ login / boas-vindas */
.entrada-pg { min-height: 100dvh; display: grid; align-content: center; padding: 24px; max-width: 440px; margin: 0 auto; }
.entrada-pg .logo-g { width: 100%; max-width: 330px; margin: 0 auto 10px; display: block; }
.entrada-pg p.lema { text-align: center; color: var(--muted); margin: 4px 0 24px; }
.passo-ob { animation: sobe .25s; }
.passo-ob h1 { font-size: 26px; margin: 8px 0 6px; line-height: 1.2; }
.pontos-ob { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.pontos-ob i { width: 8px; height: 8px; border-radius: 4px; background: var(--linha); transition: .2s; }
.pontos-ob i.on { width: 24px; background: var(--verm); }
.opcoes { display: grid; gap: 8px; }
.opcao { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 14px; padding: 11px 12px; cursor: pointer; }
.opcao input { width: 20px; height: 20px; accent-color: var(--verm); }
.alterna { display: flex; background: var(--fundo); border-radius: 12px; padding: 3px; }
.alterna button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.alterna button.on { background: var(--cartao); color: var(--tinta); box-shadow: var(--sombra); }

/* ------------------------------------------------ eu */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--cartao); border-radius: 16px; padding: 12px 14px; box-shadow: var(--sombra); }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.histograma { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin-top: 8px; }
.histograma i { flex: 1; background: var(--verm); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.horas-hist { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.menu-l { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--linha); cursor: pointer; text-decoration: none; color: var(--tinta); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font-size: 16px; }
.menu-l:last-child { border-bottom: 0; }
.menu-l .i { font-size: 20px; width: 28px; text-align: center; }
.menu-l .seta { margin-left: auto; color: var(--muted); }
.vazio { text-align: center; padding: 26px 12px; color: var(--muted); }
.vazio .i { font-size: 40px; }
.esqueleto { height: 70px; border-radius: var(--r); background: linear-gradient(90deg, var(--cartao), var(--linha), var(--cartao)); background-size: 200% 100%; animation: brilho 1.2s infinite; margin: 12px 0; }
@keyframes brilho { to { background-position: -200% 0; } }
.offline { background: var(--ambar-claro); color: var(--ambar); font-size: 13px; font-weight: 700; text-align: center; padding: 6px; border-radius: 10px; margin: 6px 0; }
@media (min-width: 760px) { .carrossel > .cartao { flex-basis: 46%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
