/* ContrataPUBLIC 2026.0.0.105.1 — Visitas (padrão «gestão de ações»). Só tokens de tema: funciona nos 3 temas. Usa as classes mkt-* do Marketing. */
body:not(.mode-vis) .only-vis { display: none !important; }
body.mode-vis .editor, body.mode-vis .preview { display: none !important; }
body.mode-vis .app-body { display: block; max-width: none; margin: 0; }
body.mode-vis #btn-print, body.mode-vis #btn-exemplo { display: none; }
#nav-sub-vis .nav-item[hidden], #nav-group-vis[hidden] { display: none !important; }
.vis-card { padding: 1rem 1.1rem 1.3rem; min-width: 0; }
.vis-topo { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.vis-corpo { margin-top: 0.4rem; min-width: 0; }
.vis-tab tr[data-vis-abrir] { cursor: pointer; }
.vis-tab tr[data-vis-abrir]:hover td, .vis-tab tr[data-vis-abrir]:focus td { background: var(--tb-2fcdee-6); }
.vis-tab tr.vis-fut td:first-child small { display: inline-block; color: var(--tf-7dffc8); font-weight: 700; }
.vis-st-agendada { color: var(--tf-7fd8ff); border-color: var(--tl-2fcdee-35); }
.vis-st-remarcada { color: var(--tf-ffd59a); border-color: var(--tl-ffe08a-35); }
.vis-st-realizada { color: var(--tf-7dffc8); border-color: var(--tl-34d399-50); }
.vis-st-cancelada { color: var(--tf-ffb4a4); border-color: var(--tl-ed785c-50); opacity: 0.85; }
.acx-tab th.num, .acx-tab td.num { text-align: right; white-space: nowrap; }
.acx-tab td, .acx-tab th { font-size: 0.82rem; padding: 0.3rem 0.45rem; }
.vis-pn-larga { grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); margin-bottom: 0.8rem; }
.vis-pn-larga .acx-tab th { letter-spacing: 0; }
.vis-prox { margin-top: 0.8rem; }
.vis-prox small, .vis-hist small { color: var(--muted); font-size: 0.75rem; }
/* janela */
.vis-box { width: min(820px, 100%); }
.vis-form .field > span { display: block; }
.vis-cli { position: relative; }
.vis-cli-sel { border: 1px solid var(--tl-2fcdee-35); background: var(--tb-2fcdee-6); border-radius: 10px; padding: 0.5rem 0.65rem; line-height: 1.5; }
.vis-cli-sel small { color: var(--muted); }
.vis-cli-sel .mkt-link { margin-left: 0.6rem; }
.vis-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.15rem 0 0.4rem; }
.vis-chip { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.3rem 0.2rem 0.65rem; font-size: 0.85rem; background: var(--tb-ffffff-3); }
.vis-chip small { color: var(--muted); font-size: 0.72rem; }
.vis-chip-x { border: 0; background: transparent; color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0 0.3rem; border-radius: 999px; }
.vis-chip-x:hover { color: var(--tf-ffb4a4); }
.vis-form select[data-vis-resp-add], .vis-form select[data-vis-ct-add] { max-width: 22rem; }
.vis-ct-novo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0.4rem; margin-top: 0.45rem; }
.vis-ct-novo[hidden] { display: none; }
.vis-fotos { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.vis-foto { position: relative; margin: 0; width: 6.2rem; height: 6.2rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--tb-ffffff-3); }
.vis-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vis-foto .vis-chip-x { position: absolute; top: 2px; right: 2px; background: var(--panel); }
.vis-foto-add { display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--muted); font-size: 0.8rem; border-style: dashed; }
.vis-foto-add:hover, .vis-foto-add:focus-within { border-color: var(--tl-2fcdee-45); color: var(--text); }
.vis-foto-box { width: min(980px, 100%); }
.vis-foto-grande { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; border-radius: 8px; }
.vis-ck-ok { margin: 0.2rem 0; font-size: 0.88rem; }
.vis-ck-ok a { color: var(--cyan-bright); }
.vis-meta { margin-top: 0.8rem; }
.vis-caixa[hidden] { display: none; }
@media (max-width: 760px) {
  .vis-card { padding: 0.75rem 0.7rem 1rem; }
  .vis-pn-larga { grid-template-columns: 1fr; }
  .vis-ct-novo { grid-template-columns: 1fr 1fr; }
  .vis-ct-novo .btn { grid-column: 1 / -1; }
  .vis-form .mkt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vis-form select[data-vis-resp-add], .vis-form select[data-vis-ct-add] { max-width: none; width: 100%; }
  .vis-tab td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
  .vis-tab td[data-label="Cliente"]::before { content: none; }
}
@media print { .vis, #vis-modal, #vis-foto-modal { display: none !important; } }
/* Configurações › Tipos de visita */
.cfg-vis-l { list-style: none; padding: 0; margin: 0.4rem 0 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; max-width: 640px; }
.cfg-vis-l li { display: flex; align-items: center; gap: 0.6rem; }
.cfg-vis-l li input[type=text] { flex: 1 1 auto; min-width: 0; }
.cfg-vis-l li .usu-check { margin: 0; white-space: nowrap; }
.cfg-vis-l li small { color: var(--muted); font-size: 0.72rem; min-width: 6rem; }

/* 2026.0.0.105.1 — órgão em cascata (UF → Cidade → Órgão) e endereço do órgão (também usado no Marketing e no cadastro do cliente) */
.org-cas { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.4rem; margin-bottom: 0.4rem; }
.org-cas select { min-width: 0; }
.org-cas-lista { max-height: 300px; overflow-y: auto; }
.org-cas-lista li.org-sep { cursor: default; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: transparent; padding-top: 0.5rem; }
.org-cas-lista li.org-sep:hover { background: transparent; }
.org-cas-lista li.org-ja { opacity: 0.8; }
.vis-end, .end-box { margin-top: 0.45rem; }
.end-box { border: 1px dashed var(--tl-2fcdee-35); border-radius: 10px; padding: 0.5rem 0.65rem; line-height: 1.45; }
.end-txt { font-size: 0.92rem; }
.end-tel { font-size: 0.88rem; margin-top: 0.15rem; }
.end-tel a { color: inherit; }
.end-acoes { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.end-acoes .btn-sm, .end-acoes a.btn { font-size: 0.8rem; padding: 0.3rem 0.6rem; min-height: 0; text-decoration: none; }
.end-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.end-form .end-logradouro { grid-column: span 2; }
.end-form .end-uf input { text-transform: uppercase; }
.vis-end-lin { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 0.1rem; }
@media (max-width: 640px) {
  .end-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .end-acoes .btn-sm, .end-acoes a.btn { flex: 1 1 auto; text-align: center; }
}

/* 2026.0.0.105.1 — mapa do Painel de visitas (Leaflet + OpenStreetMap) */
.vis-mapa-sec h4 small { font-weight: 400; margin-left: 0.4rem; }
.vm-wrap { position: relative; background: var(--bg, transparent); }
.vm-mapa { height: 460px; border-radius: 12px; overflow: hidden; border: 1px solid var(--tl-2fcdee-35); z-index: 0; }
.vm-wrap.vm-cheia { position: fixed; inset: 0; z-index: 9000; padding: 0.6rem; background: var(--bg, #0b0820); display: flex; flex-direction: column; }
.vm-wrap.vm-cheia .vm-mapa, .vm-wrap:fullscreen .vm-mapa { flex: 1; height: auto; }
.vm-wrap:fullscreen { padding: 0.6rem; background: var(--bg, #0b0820); display: flex; flex-direction: column; }
.vm-leg { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin-bottom: 0.45rem; font-size: 0.85rem; }
.vm-leg label { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.vm-leg .vm-acoes { margin-left: auto; display: inline-flex; gap: 0.35rem; }
.vm-leg .btn-sm { font-size: 0.8rem; padding: 0.3rem 0.6rem; min-height: 0; }
.vm-st { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; flex: none; }
.vm-info { margin-top: 0.35rem; }
/* 2026.0.0.105.1.1: mapa-base vetorial próprio (malhas IBGE); cores por tema no JS */
.vm-rot-uf { color: var(--vm-rot, #ddd); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.05em; text-align: center; opacity: 0.75; text-shadow: 0 0 3px rgba(0,0,0,.25); white-space: nowrap; }
.vm-rot-cap { color: var(--vm-rot, #ddd); font-size: 0.7rem; white-space: nowrap; opacity: 0.9; }
.vm-rot-cap i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--vm-rot, #ddd); margin-right: 4px; vertical-align: middle; }
.vm-tip { font-size: 0.78rem; padding: 2px 6px; }
.vm-wrap .leaflet-container { font: inherit; }
.vm-icone { background: transparent; border: 0; }
.vm-pin { position: relative; display: inline-flex; align-items: center; padding: 2px; border-radius: 999px; background: var(--vm-cor); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.vm-pin::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--vm-cor); border-bottom: 0; }
.vm-pin .cp-avatar { --av-t: 26px; width: 26px; height: 26px; font-size: 0.66rem; border: 2px solid #fff; margin-left: -10px; flex: none; }
.vm-pin .cp-avatar:first-child { margin-left: 0; }
.vm-pin .vm-mais { margin-left: 3px; padding: 0 4px; color: #fff; font-size: 0.7rem; font-weight: 700; }
.vm-pin .vm-n { position: absolute; top: -7px; right: -7px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #111; color: #fff; font-size: 0.62rem; line-height: 16px; text-align: center; }
.vm-cluster { background: transparent; border: 0; }
.vm-cluster > span { display: flex; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.vm-cluster b { display: flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: #1f1640; color: #fff; font-size: 0.8rem; }
.vm-balao { max-height: 300px; overflow-y: auto; font-size: 0.85rem; color: #222; }
.vm-balao > strong { display: block; margin-bottom: 0.3rem; }
.vm-item { display: flex; gap: 0.45rem; align-items: flex-start; padding: 0.35rem 0; border-top: 1px solid #e5e7eb; }
.vm-item .vm-st { margin-top: 0.3rem; }
.vm-item small { display: block; color: #555; }
.vm-item .mkt-link { padding: 0; margin-top: 0.15rem; color: #6d28d9; font-weight: 600; }
@media (max-width: 640px) { .vm-mapa { height: 360px; } .vm-leg .vm-acoes { margin-left: 0; width: 100%; } }
