/* CRM de Visitas — identidade Davidson Pujoni
   Cores: Grafite #0B0F14 · Azul profundo #1E3A5F · Bronze #B5834F · Marfim #F7F7F5 · Cinza #8A8F98
   Tipografia: Montserrat (300/400/500/600). Título light em caixa-alta, subtítulo espaçado, linha vertical de bronze. */
:root {
  --graphite: #0B0F14; --azul: #1E3A5F; --bronze: #B5834F; --marfim: #F7F7F5; --cinza: #8A8F98;
  --bg: var(--graphite); --surface: #101822; --surface-2: #16212E; --line: rgba(138, 143, 152, .22); --line-strong: rgba(138, 143, 152, .4);
  --tx: var(--marfim); --mut: var(--cinza); --acc: var(--bronze); --acc-tx: #C99562; --on-acc: var(--graphite);
  --ok: #6DB68C; --okbg: rgba(109, 182, 140, .13); --warn: #D2A15F; --warnbg: rgba(181, 131, 79, .17); --bad: #DE8C84; --badbg: rgba(222, 140, 132, .13);
  --head: var(--azul); --r: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-tema=light] {
  --bg: var(--marfim); --surface: #fff; --surface-2: #EFEFEC; --line: rgba(11, 15, 20, .12); --line-strong: rgba(11, 15, 20, .28);
  --tx: var(--graphite); --mut: #5E646E; --acc-tx: #8A5F2E;
  --ok: #2F7A55; --okbg: rgba(47, 122, 85, .10); --warn: #8A5F2E; --warnbg: rgba(181, 131, 79, .15); --bad: #B04A42; --badbg: rgba(176, 74, 66, .09);
  --shadow: 0 10px 30px rgba(11, 15, 20, .10); color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 420px at 100% -10%, rgba(30, 58, 95, .35), transparent 70%); }
:root[data-tema=light] body::before { background: radial-gradient(900px 420px at 100% -10%, rgba(30, 58, 95, .06), transparent 70%); }
a { color: var(--acc-tx); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- tipografia ---------- */
.h-title { font-weight: 300; text-transform: uppercase; letter-spacing: .06em; line-height: 1.2; margin: 0 0 6px; font-size: clamp(22px, 5.4vw, 32px); }
.eyebrow { font-weight: 500; text-transform: uppercase; letter-spacing: .28em; font-size: 10.5px; color: var(--acc-tx); margin: 0 0 8px; }
.sec { display: flex; align-items: center; gap: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; margin: 30px 0 12px; color: var(--tx); }
.sec::before { content: ''; width: 2px; height: 18px; background: var(--acc); }
.mut { color: var(--mut); } .sm { font-size: 13px; } .pad { padding: 14px; }
.err { color: var(--bad); }
.legend { font-weight: 500; text-transform: uppercase; letter-spacing: .2em; font-size: 10px; color: var(--mut); }
.divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 4px; color: var(--acc); }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.divider::before { background: linear-gradient(90deg, var(--acc), var(--line)); }
.divider i { width: 7px; height: 7px; border: 1px solid var(--acc); transform: rotate(45deg); }

/* ---------- estrutura ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--head); border-bottom: 2px solid var(--acc); color: var(--marfim); }
.top .wrap { max-width: 1180px; margin: 0 auto; height: 58px; padding: 0 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--marfim); text-decoration: none !important; }
.brand img { height: 26px; width: auto; display: block; }
.brand b { white-space: nowrap; font-weight: 300; letter-spacing: .24em; text-transform: uppercase; font-size: 12px; padding-left: 12px; border-left: 1px solid rgba(181, 131, 79, .7); }
.nav { display: flex; gap: 2px; margin-left: 14px; flex-wrap: nowrap; }
.nav a { white-space: nowrap; color: rgba(247, 247, 245, .78); font-weight: 500; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; padding: 8px 11px; border-radius: 8px; }
.nav a:hover, .nav a.on { color: var(--marfim); background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a.on { box-shadow: inset 0 -2px 0 var(--acc); border-radius: 8px 8px 0 0; }
.sp { flex: 1; }
.quem { font-size: 12px; color: rgba(247, 247, 245, .75); letter-spacing: .04em; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico-btn { background: transparent; border: 1px solid rgba(247, 247, 245, .25); color: var(--marfim); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.ico-btn:hover { background: rgba(255, 255, 255, .1); }
.ico-btn svg, .tab svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 24px 16px 110px; }
main.estreito { max-width: 720px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: none; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--mut); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; padding: 6px 2px; border: 0; background: none; cursor: pointer; font-family: inherit; text-decoration: none !important; }
.tab.on { color: var(--acc-tx); }
.tab.mais span.fab { background: var(--acc); color: var(--on-acc); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-top: -22px; box-shadow: var(--shadow); border: 3px solid var(--bg); }
.tab.mais svg { stroke: var(--on-acc); width: 22px; height: 22px; }
@media (max-width: 760px) { .nav, .quem { display: none; } .tabbar { display: flex; } .brand b { display: none; } main { padding-bottom: 120px; } }
body.foco .tabbar, body.foco .top { display: none; }
body.foco main { padding-bottom: 170px; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.card.hl { border-left: 2px solid var(--acc); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.btn { font: 500 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--tx); cursor: pointer; text-decoration: none !important; transition: background .15s, transform .05s; }
.btn:hover { background: rgba(138, 143, 152, .12); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }
.btn.pri:hover { background: #C6945F; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 11px; border-radius: 10px; }
.btn.blk { width: 100%; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 0; min-width: 0; }
label.lbl { display: block; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; color: var(--mut); margin: 18px 0 8px; }
.in, select.in, textarea.in { width: 100%; min-height: 48px; font: 400 16px/1.4 var(--font); color: var(--tx); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; }
:root[data-tema=light] .in { background: #fff; }
textarea.in { min-height: 110px; resize: vertical; }
.in:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(181, 131, 79, .22); }
.in::placeholder { color: var(--mut); opacity: .75; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.opts.col { grid-template-columns: 1fr; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 56px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; font-weight: 500; background: var(--bg); transition: all .12s; }
.opt.cheio span { justify-content: flex-start; text-align: left; }
.opt input:checked + span { border-color: var(--acc); background: rgba(181, 131, 79, .16); box-shadow: inset 0 0 0 1px var(--acc); color: var(--tx); }
.opt input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; background: var(--surface-2); color: var(--mut); white-space: nowrap; }
.badge.Sucesso, .badge.Realizada { background: var(--okbg); color: var(--ok); }
.badge.Parcial, .badge.Planejada, .badge.hoje { background: var(--warnbg); color: var(--warn); }
.badge.Semvenda, .badge.Cancelada, .badge.atraso { background: var(--badbg); color: var(--bad); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list .row-i, button.row-i { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: none !important; }
.list .row-i:last-child { border-bottom: 0; }
.list .row-i:hover { background: rgba(138, 143, 152, .09); }
.row-i b { display: block; font-weight: 500; letter-spacing: .01em; }
.row-i .go { color: var(--acc-tx); font-size: 20px; line-height: 1; }
.row-i small { display: block; color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vazio { text-align: center; padding: 34px 16px; color: var(--mut); }
.vazio img { width: 54px; opacity: .25; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.kpi .legend { display: block; margin-bottom: 8px; }
.kpi b { display: block; font-weight: 300; font-size: clamp(22px, 5vw, 30px); letter-spacing: .01em; line-height: 1.1; }
.kpi small { color: var(--mut); font-size: 12px; }
.act { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--tx); text-decoration: none !important; min-height: 78px; }
.act:hover { border-color: var(--acc); }
.act.primary { background: linear-gradient(135deg, var(--azul), #17304F); border-color: var(--acc); color: var(--marfim); }
.act b { display: block; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; }
.act small { display: block; opacity: .7; font-size: 12.5px; margin-top: 2px; }
.act .mi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(181, 131, 79, .18); color: var(--acc-tx); flex: none; }
.act.primary .mi { background: var(--acc); color: var(--on-acc); }
.act svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl { border-left: 1px solid var(--line-strong); margin: 0 0 0 6px; padding: 0 0 4px 18px; }
.tl .it { position: relative; margin-bottom: 14px; }
.tl .it::before { content: ''; position: absolute; left: -23px; top: 8px; width: 9px; height: 9px; border: 1px solid var(--acc); background: var(--bg); transform: rotate(45deg); }
.tl details summary { cursor: pointer; color: var(--acc-tx); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
.dl dt { color: var(--mut); } .dl dd { margin: 0; }
.bar-res { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.bar-res i { display: block; height: 100%; }
.leg { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--mut); }
.leg b { color: var(--tx); font-weight: 600; } .leg s { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; text-decoration: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 500 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; padding: 10px 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--tx); cursor: pointer; }
.chip.on { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }
.card:has(> .tabelao) { overflow-x: auto; }
.tabelao { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelao th { text-align: left; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; font-size: 10px; color: var(--mut); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tabelao td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 760px) {
  .tabelao thead { display: none; }
  .tabelao tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .tabelao td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 4px 14px; text-align: right; }
  .tabelao td::before { content: attr(data-l); color: var(--mut); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; text-align: left; padding-top: 3px; }
}
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: brilho 1.3s infinite; border-radius: 12px; min-height: 58px; margin-bottom: 8px; }
@keyframes brilho { to { background-position: -200% 0; } }
#toasts { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
body.foco #toasts { bottom: 100px; }
.toast { pointer-events: auto; max-width: 520px; width: 100%; padding: 13px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--ok); box-shadow: var(--shadow); font-size: 14px; animation: sobe .2s ease-out; }
.toast.er { border-left-color: var(--bad); } .toast.out { opacity: 0; transition: opacity .4s; }
@keyframes sobe { from { transform: translateY(10px); opacity: 0; } }
#rede { background: var(--warn); color: var(--graphite); text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .08em; padding: 6px; position: relative; z-index: 30; }
dialog { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--tx); padding: 22px; width: min(520px, calc(100vw - 24px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }

/* ---------- assistente (uma pergunta por vez) ---------- */
.wiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.prog { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: 1; }
.prog i { display: block; height: 100%; background: var(--acc); transition: width .25s; }
.wiz-q { font-weight: 300; font-size: clamp(22px, 5.6vw, 30px); line-height: 1.25; margin: 6px 0 4px; }
.wiz-ctx { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 14px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--mut); max-width: 100%; }
.wiz-ctx b { color: var(--tx); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: linear-gradient(0deg, var(--bg) 70%, transparent); padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
.wiz-foot .wiz-bt { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.wiz-foot .btn { flex: 1; } .wiz-foot .btn.voltar { flex: 0 0 34%; }
.marca-dagua { position: fixed; right: -60px; bottom: -40px; width: min(60vw, 420px); opacity: .05; pointer-events: none; z-index: 0; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 22px 16px; position: relative; z-index: 1; }
.login .box { width: min(420px, 100%); }
.login .logo { width: min(300px, 80%); display: block; margin: 0 auto 20px; }
.login .tag { text-align: center; font-weight: 500; text-transform: uppercase; letter-spacing: .34em; font-size: 10px; color: var(--acc-tx); margin: 0 0 28px; }
.pw { position: relative; } .pw button { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border: 0; background: none; color: var(--acc-tx); font: 500 11px var(--font); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }

/* listas com muitas opções, limite de marcações e opção \"Outro:\" */
.opts.compacto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opts.compacto .opt span { min-height: 48px; padding: 8px 14px; }
.opt.bloq span { opacity: .38; cursor: not-allowed; }
.opt.bloq input { cursor: not-allowed; }
.outro-txt { margin-top: 10px; }

/* cabeçalho em telas médias: tira primeiro o nome do usuário, depois o texto da marca */
@media (min-width: 761px) and (max-width: 1040px) { .quem { display: none; } .nav a { padding: 8px 9px; letter-spacing: .1em; } }
@media (min-width: 761px) and (max-width: 880px) { .brand b { display: none; } }
.ico-btn { flex: none; }

.voltar-linha { margin: -6px 0 16px; }
.voltar-linha .btn { letter-spacing: .1em; }
