/* ==========================================================================
   Google Material Design 3 — Minimalist PWA Styles (Gestão de Territórios)
   ========================================================================== */
:root {
  --m3-surface: #f8fafc;
  --m3-surface-container: #ffffff;
  --m3-surface-variant: #f1f5f9;
  --m3-outline: #e2e8f0;
  --m3-primary: #0b57d0;
  --m3-primary-hover: #0842a0;
  --m3-primary-container: #d3e3fd;
  --m3-on-primary-container: #041e49;
  --m3-text-primary: #1f1f1f;
  --m3-text-secondary: #444746;
}

body {
  font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--m3-surface);
  color: var(--m3-text-primary);
  -webkit-font-smoothing: antialiased;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Abas de Navegação Padrão Google Material 3 (Navigation Pills) */
.nav-tab {
  color: var(--m3-text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.nav-tab:hover {
  color: var(--m3-text-primary);
  background-color: #eef2f6;
}
.nav-tab.active-tab {
  color: var(--m3-on-primary-container);
  background-color: var(--m3-primary-container);
  border-color: #b8d1fc;
  font-weight: 600;
}

/* Elevação sutil padrão Google Workspace Cards */
.m3-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06), 0 2px 6px rgba(60, 64, 67, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.m3-card:hover {
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.1), 0 6px 16px rgba(60, 64, 67, 0.06);
}
.m3-card-selected,
.selected-card {
  border-color: #0b57d0 !important;
  background-color: #f4f8ff !important;
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.18), 0 4px 12px rgba(11, 87, 208, 0.08) !important;
}

.m3-btn-filled {
  background-color: #0b57d0;
  color: #ffffff;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.m3-btn-filled:hover {
  background-color: #0842a0;
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.28);
}

.m3-btn-tonal {
  background-color: #d3e3fd;
  color: #041e49;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.m3-btn-tonal:hover {
  background-color: #c2d7fc;
}

.m3-backdrop {
  background-color: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.m3-dialog-surface {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.75rem;
  box-shadow: 0 20px 32px -8px rgba(15, 23, 42, 0.24), 0 8px 16px -6px rgba(15, 23, 42, 0.12);
  animation: m3DialogEnter 0.2s cubic-bezier(0.2, 0, 0, 1) forwards;
}

/* Animação de Diálogo Material 3 */
@keyframes m3DialogEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.m3-dialog-panel {
  animation: m3DialogEnter 0.2s cubic-bezier(0.2, 0, 0, 1) forwards;
}

/* Radio Cards para Devolução em Duas Etapas */
.m3-radio-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.m3-radio-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.m3-radio-card.selected {
  border-color: #0b57d0;
  background: #f0f6ff;
  box-shadow: 0 0 0 1px #0b57d0;
}

/* Customização de Popups e Tooltips do Leaflet no Tema Google Maps Light */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #ffffff !important;
  color: #1f1f1f !important;
  border: 1px solid #e2e8f0;
  border-radius: 1rem !important;
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.15) !important;
}
.leaflet-container {
  background: #eef2f6;
  font-family: inherit;
  /* As camadas do Leaflet usam z-index 400+: sem isolar, o mapa geral fica por cima das modais (z-50) */
  isolation: isolate;
}
.leaflet-container .leaflet-control-attribution {
  font-size: 10px;
}

/* Rótulos de mapa (números de territórios e quadras): texto com halo, sem caixa, sem capturar cliques.
   O tamanho vem de --rotulo-px, definido por js/map.js conforme o zoom (também exposto em data-z). */
.rotulo-mapa {
  pointer-events: none !important;
  overflow: visible;
}
.rotulo-mapa > span {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  line-height: 1;
  font-weight: 800;
  font-size: calc(var(--rotulo-px, 12px) * 1.2);
  color: #0f172a;
  -webkit-text-stroke: 3px rgba(255, 255, 255, 0.92);
  paint-order: stroke fill;
  text-shadow: 0 0 2px #ffffff, 0 0 3px #ffffff;
}
.rotulo-mapa.rotulo-oculto {
  display: none;
}
.rotulo-mapa > .rotulo-quadra {
  font-size: calc(var(--rotulo-px, 12px) * 0.8);
  font-weight: 600;
  color: #475569;
  -webkit-text-stroke-width: 2.5px;
}
/* Nome das estradas rurais (vias-rurais.geojson): só a partir do zoom 14 (classe posta por js/map.js) */
.rotulo-mapa > .rotulo-via {
  display: none;
  font-size: 11px;
  font-weight: 600;
  font-style: italic;
  color: #57351a;
  -webkit-text-stroke-width: 2.5px;
}
.vias-nomes-visiveis .rotulo-mapa > .rotulo-via {
  display: block;
}

/* Fundo "Sem mapa": nenhum ladrilho (uso sem internet); cor neutra de papel */
.leaflet-container.mapa-sem-fundo {
  background: #f3efe6;
}

.rotulo-mapa > .rotulo-vizinho {
  font-size: calc(var(--rotulo-px, 12px) * 0.85);
  font-weight: 700;
  color: #64748b;
}

/* Hachura dos territórios ocupados: a regra `fill: url(#padrao-hachura-ocupado)` fica num <style>
   de index.html, porque em folha externa a referência seria resolvida em relação a este arquivo. */
.svg-padroes {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Amostra da legenda gerada a partir de Utils.ESTILO_STATUS */
.legenda-amostra {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-radius: 3px;
  box-sizing: border-box;
}

/* Indicação do norte e minimapa de localização */
.controle-norte {
  width: 30px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}
.minimapa-cartao {
  width: 112px;
  height: 112px;
  border: 2px solid #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.35);
  background: #eef2f6;
}
@media (max-width: 639px) {
  .minimapa-cartao {
    display: none;
  }
}

/* Pino Numerado de Prédios no Mapa */
.predio-pin-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  transition: transform 0.15s ease;
}
.predio-pin-marker:hover {
  transform: scale(1.18);
  z-index: 999 !important;
}
.pin-green {
  background-color: #16a34a;
}
.pin-amber {
  background-color: #d97706;
}
.pin-red {
  background-color: #dc2626;
}
.pin-done {
  background-color: #0b57d0;
}

/* Alfinete de Quadra Trabalhada (marcado pelo dirigente no mapa do cartão) */
.quadra-pin-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background-color: #146c2e;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
}
.quadra-pin-marker span {
  transform: rotate(45deg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.quadra-pin-editando {
  background-color: #0b57d0;
  cursor: pointer;
}
/* Modo de marcação: cursor de mira sobre o mapa do cartão */
.modo-marcar-quadras,
.modo-marcar-quadras .leaflet-interactive {
  cursor: crosshair !important;
}
.modo-marcar-quadras .leaflet-marker-icon {
  cursor: pointer !important;
}

/* ==========================================================================
   Cartão de território para impressão (A5 paisagem) — overlay #cartao-impressao
   ========================================================================== */
#cartao-impressao {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  background: #475569;
  padding: 12px;
}
#cartao-impressao.hidden {
  display: none;
}
.cartao-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 198mm;
  margin: 0 auto 10px;
  color: #ffffff;
  font-size: 12px;
}
.cartao-barra > div {
  display: flex;
  gap: 8px;
}
.cartao-btn {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cartao-btn-primario {
  background: #0b57d0;
  border-color: #0b57d0;
  color: #ffffff;
}
.cartao-folha {
  width: 198mm;
  height: 136mm;
  margin: 0 auto;
  padding: 3mm;
  box-sizing: border-box;
  background: #ffffff;
  color: #111827;
  display: flex;
  flex-direction: column;
  gap: 2mm;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.cartao-cartela {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4mm;
  border-bottom: 0.5mm solid #111827;
  padding-bottom: 1.5mm;
}
.cartao-congregacao {
  font-size: 8pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
}
.cartao-cartela h1 {
  font-size: 20pt;
  font-weight: 800;
  line-height: 1.05;
}
#cartao-subtitulo {
  font-size: 10pt;
  font-weight: 600;
  color: #334155;
}
.cartao-qr-bloco {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5mm;
  font-size: 6.5pt;
  color: #475569;
}
#cartao-qr {
  width: 19mm;
  height: 19mm;
}
#cartao-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cartao-corpo {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 2.5mm;
}
#cartao-mapa {
  flex: 3;
  min-width: 0;
  border: 0.3mm solid #94a3b8;
}
.cartao-lateral {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 7pt;
  line-height: 1.25;
}
.cartao-lateral h2 {
  font-size: 7.5pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 0.2mm solid #cbd5e1;
  margin: 0 0 1mm;
  padding-bottom: 0.5mm;
}
.cartao-legenda,
#cartao-predios {
  list-style: none;
  margin: 0 0 2.5mm;
  padding: 0;
}
.cartao-legenda li,
#cartao-predios li {
  display: flex;
  align-items: flex-start;
  gap: 1.5mm;
  margin-bottom: 1mm;
}
.cartao-amostra {
  flex: none;
  width: 6mm;
  height: 3mm;
  margin-top: 0.3mm;
  box-sizing: border-box;
}
.cartao-amostra-limite {
  border: 0.7mm solid #111827;
}
.cartao-amostra-quadra {
  border: 0.25mm dashed #334155;
}
.cartao-amostra-vizinho {
  border: 0.25mm dotted #475569;
}
.cartao-predio-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4mm;
  height: 4mm;
  border-radius: 9999px;
  background: #111827;
  color: #ffffff;
  font-size: 6.5pt;
  font-weight: 700;
}
.cartao-sem-predios {
  color: #64748b;
}
.cartao-rodape {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  font-size: 6.5pt;
  color: #475569;
}
.predio-pin-marker.pin-impressao {
  width: 22px;
  height: 22px;
  font-size: 10px;
  background-color: #111827;
  box-shadow: none;
}

@media print {
  @page {
    size: A5 landscape;
    margin: 6mm;
  }
  body.imprimindo-cartao {
    background: #ffffff !important;
    min-height: 0;
  }
  body.imprimindo-cartao > *:not(#cartao-impressao) {
    display: none !important;
  }
  body.imprimindo-cartao #cartao-impressao {
    position: static;
    padding: 0;
    overflow: visible;
    background: none;
  }
  body.imprimindo-cartao .cartao-barra {
    display: none;
  }
  body.imprimindo-cartao .cartao-folha {
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  body.imprimindo-cartao * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Fundo "Mapa claro": ladrilhos do OpenStreetMap dessaturados, para os territórios se destacarem */
.ladrilhos-claros {
  filter: grayscale(1) brightness(1.06) contrast(0.92);
}

/* Ação assíncrona em andamento (Utils.sinalizarOcupado): spinner + bloqueio de novo clique */
@keyframes giroOcupado {
  to { transform: rotate(360deg); }
}
.giro-ocupado,
.acao-ocupada::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.125em;
  animation: giroOcupado 0.7s linear infinite;
}
.acao-ocupada::after {
  margin-left: 0.5em;
}
.acao-ocupada {
  pointer-events: none;
  opacity: 0.75;
  cursor: progress;
}
@media (prefers-reduced-motion: reduce) {
  .giro-ocupado,
  .acao-ocupada::after {
    animation-duration: 2s;
  }
}

/* Aviso de nova versão publicada (service worker trocado com o app aberto) */
.aviso-nova-versao {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  padding: 0.625rem 0.75rem 0.625rem 1rem;
  border-radius: 1rem;
  background-color: #1f1f1f;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 8px 16px -6px rgba(15, 23, 42, 0.35);
}
.aviso-nova-versao[hidden] {
  display: none;
}
.aviso-nova-versao button {
  flex: none;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background-color: #a8c7fa;
  color: #062e6f;
  font-weight: 600;
}

/* Convite para instalar o app (js/instalacao.js) */
.faixa-instalar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  background-color: #e8f0fe;
  border-bottom: 1px solid #d3e3fd;
  color: #041e49;
  font-size: 0.75rem;
  line-height: 1.35;
}
.faixa-instalar[hidden] {
  display: none;
}
.faixa-instalar p {
  flex: 1;
  min-width: 0;
}
.faixa-instalar-acao {
  flex: none;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background-color: #0b57d0;
  color: #ffffff;
  font-weight: 600;
}
.faixa-instalar-fechar {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  color: #475569;
}

/* Estado da conexão e fila de alterações feitas sem rede */
.faixa-offline,
.faixa-fila {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  line-height: 1.35;
}
.faixa-offline[hidden],
.faixa-fila[hidden],
.faixa-fila-acao[hidden] {
  display: none;
}
.faixa-offline {
  background-color: #3c4043;
  color: #ffffff;
  font-weight: 500;
}
.faixa-fila {
  background-color: #fef7e0;
  border-bottom: 1px solid #fde293;
  color: #7a4a00;
}
.faixa-fila p {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.faixa-fila-acao {
  flex: none;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background-color: #b06000;
  color: #ffffff;
  font-weight: 600;
}
.lista-nao-enviados {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
  list-style: disc;
  font-size: 0.75rem;
  color: #3c4043;
}
.lista-nao-enviados li + li {
  margin-top: 0.5rem;
}

/* Controle "minha posição" nos mapas */
.controle-localizacao {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
}
.controle-localizacao.ativo {
  color: #1a73e8;
  background: #e8f0fe;
}

/* Modal de prédios do cartão (js/modal-predios.js) */
.mp-janela {
  width: 100%;
  max-width: 40rem;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}
.mp-cabecalho {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.5rem;
}
.mp-cabecalho-texto {
  min-width: 0;
  flex: 1;
}
.mp-cabecalho-texto h3 {
  line-height: 1.3;
  overflow-wrap: anywhere;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
}
.mp-cabecalho-texto p {
  overflow-wrap: anywhere;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: #64748b;
}
.mp-fechar {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  color: #475569;
}
.mp-fechar:hover {
  background: #f1f5f9;
}
.mp-filtros {
  flex-shrink: 0;
  display: flex;
  gap: 0.375rem;
  padding: 0.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}
.mp-filtro {
  flex: none;
  padding: 0.3125rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
}
.mp-filtro.ativo {
  background: #d3e3fd;
  border-color: #a8c7fa;
  color: #041e49;
}
.mp-conteudo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  background: #f8fafc;
}
.mp-vazio {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}
.mp-predio {
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
}
.mp-predio.feito {
  background: #f4fbf6;
  border-color: #a8dab5;
}
.mp-predio-topo {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}
.mp-ordem {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #0b57d0;
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp-predio.feito .mp-ordem {
  background: #146c2e;
}
.mp-predio-info {
  flex: 1;
  min-width: 0;
}
.mp-predio-info h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
}
.mp-predio-info p {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: #64748b;
}
.mp-link {
  flex: none;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #0b57d0;
}
.mp-selos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.mp-progresso {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
}
.mp-grade {
  margin-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
}
.mp-andar {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  flex-wrap: wrap;
}
.mp-andar-rotulo {
  width: 1.75rem;
  flex: none;
  font-size: 0.625rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: right;
}
.mp-apto {
  min-width: 2.75rem;
  min-height: 2.25rem;           /* alvo de toque confortável em campo */
  padding: 0 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}
.mp-apto.marcado {
  background: #146c2e;
  border-color: #146c2e;
  color: #ffffff;
}
.mp-dica {
  margin-top: 0.125rem;
  font-size: 0.625rem;
  color: #94a3b8;
}
.mp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid #a8dab5;
  border-radius: 9999px;
  background: #e6f4ea;
  color: #146c2e;
  font-size: 0.6875rem;
  font-weight: 600;
}
.mp-campo {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.mp-campo input {
  flex: 1;
  min-width: 0;
  padding: 0.4375rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #1e293b;
}
.mp-campo input:focus {
  outline: none;
  border-color: #0b57d0;
}
/* Cadastro do prédio: sugestão de correção (andares × aptos por andar) com revisão do ADMIN */
.mp-link-cadastro {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0b57d0;
}
.mp-revisao {
  margin-top: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.625rem;
  background: #fef7e0;
  color: #7c4a00;
  font-size: 0.6875rem;
  font-weight: 600;
}
.mp-cadastro {
  margin-top: 0.5rem;
  padding: 0.625rem;
  border: 1px solid #d3e3fd;
  border-radius: 0.75rem;
  background: #f8fafd;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.mp-cadastro-titulo {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #041e49;
}
.mp-cadastro-campos {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}
.mp-cadastro-campos label {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #475569;
}
.mp-cadastro-campos input {
  width: 5.5rem;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  background: #ffffff;
  font-size: 0.8125rem;
  color: #1e293b;
}
.mp-cadastro-total {
  padding-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #146c2e;
}
.mp-cadastro-obs {
  width: 100%;
  padding: 0.4375rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #1e293b;
}
.mp-cadastro-acoes {
  display: flex;
  gap: 0.375rem;
}

/* Painel admin: revisões de cadastro de prédios */
.rv-item {
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.rv-titulo {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}
.rv-titulo span,
.rv-meta {
  font-size: 0.6875rem;
  font-weight: 400;
  color: #64748b;
}
.rv-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.rv-diff {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: #f1f5f9;
  font-size: 0.6875rem;
  color: #475569;
}
.rv-diff.mudou {
  background: #e6f4ea;
  color: #146c2e;
}
.rv-diff s {
  color: #b3261e;
}
.rv-obs {
  font-size: 0.6875rem;
  font-style: italic;
  color: #334155;
}
.rv-alerta {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b06000;
}
.rv-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.rv-acoes input {
  flex: 1;
  min-width: 10rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.6875rem;
}
.rv-aprovar,
.rv-recusar {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
}
.rv-aprovar {
  background: #146c2e;
  color: #ffffff;
}
.rv-recusar {
  background: #fce8e6;
  color: #b3261e;
}
.rv-historico {
  padding: 0.5rem 0.875rem;
  font-size: 0.6875rem;
  color: #475569;
}
.rv-status {
  margin-right: 0.25rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
}
.rv-status.ok {
  background: #e6f4ea;
  color: #146c2e;
}
.rv-status.nao {
  background: #fce8e6;
  color: #b3261e;
}
.selo-revisoes {
  margin-left: 0.375rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  background: #b3261e;
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
}
/* Campo de apartamentos vazio/inválido: aviso junto ao campo (o toast fica sob o teclado do celular) */
input.campo-invalido,
input.campo-invalido:focus {
  border-color: #b3261e !important;
  box-shadow: 0 0 0 1px #b3261e;
}
.mp-erro {
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b3261e;
}
.mp-erro[hidden] {
  display: none;
}
.mp-botao {
  flex: none;
  padding: 0.4375rem 0.875rem;
  border-radius: 9999px;
  background: #d3e3fd;
  color: #041e49;
  font-size: 0.75rem;
  font-weight: 600;
}
.mp-botao.secundario {
  background: #f1f5f9;
  color: #334155;
}
.mp-botao-predio {
  width: 100%;
  margin-top: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
}
.mp-botao-predio.feito {
  background: #e6f4ea;
  border: 1px solid #a8dab5;
  color: #146c2e;
}
.mp-feito {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #146c2e;
}
.mp-rodape {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.mp-rodape:empty {
  display: none;
}

/* Casas do interior (pontos rurais) no mapa do cartão */
.controle-pontos {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  max-width: 13rem;
  padding: 0.375rem 0.625rem;
  background: #ffffff;
  font-size: 0.6875rem;
  color: #334155;
}
.controle-pontos b {
  color: #0f172a;
}
.cp-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.cp-proxima {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e2e8f0;
}
.cp-proxima[hidden] {
  display: none;
}
.cp-botao {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: #d3e3fd;
  color: #041e49;
  font-weight: 600;
  font-size: 0.6875rem;
}
.cp-cor {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  box-shadow: 0 0 0 1px #cbd5e1;
}
.popup-ponto .pp-titulo {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}
.popup-ponto .pp-meta {
  margin: 0.125rem 0 0;
  font-size: 0.6875rem;
  color: #64748b;
}
.popup-ponto .pp-status {
  margin: 0.375rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b06000;
}
.popup-ponto .pp-status.ok {
  color: #146c2e;
}
.popup-ponto .pp-botao {
  margin-top: 0.5rem;
  width: 100%;
  min-height: 2.25rem;
  border-radius: 9999px;
  background: #146c2e;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}
.popup-ponto .pp-botao.desfazer {
  background: #f1f5f9;
  color: #334155;
}

/* Janelas (modais): nunca maiores que a área visível (no celular, sem a barra do navegador) */
.modal-janela {
  max-height: 92vh;
  max-height: 92dvh;
}
/* Janela de prédios no celular: ocupa a tela toda, cabeçalho e filtros sempre visíveis */
@media (max-width: 639px) {
  #modal-predios {
    padding: 0;
  }
  .mp-janela {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .mp-cabecalho {
    padding: 0.75rem 1rem 0.375rem;
  }
  .mp-filtros {
    padding: 0.25rem 1rem 0.625rem;
  }
}

/* Abas da janela do cartão (Cartão | Quadras | Prédios) */
.mm-abas {
  flex-shrink: 0;
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 1rem 0;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  overflow-x: auto;
  scrollbar-width: none;
}
.mm-abas::-webkit-scrollbar {
  display: none;
}
.mm-aba {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  border-bottom: 3px solid transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.mm-aba.ativa {
  border-bottom-color: #0b57d0;
  color: #0b57d0;
}
.mm-aba-cont:empty {
  display: none;
}
.mm-aba-cont {
  padding: 0 0.375rem;
  border-radius: 9999px;
  background: #e8f0fe;
  font-size: 0.6875rem;
}
#modal-mapa-territorio[data-aba="predios"] #modal-mapa-coluna,
#modal-mapa-territorio:not([data-aba="predios"]) #modal-predios-section,
#modal-mapa-territorio[data-aba="quadras"] #modal-mapa-legenda,
#modal-mapa-territorio:not([data-aba="quadras"]) #modal-quadras-barra {
  display: none !important;
}
@media (min-width: 640px) {
  .mm-abas {
    padding: 0.5rem 1.25rem 0;
  }
}

/* Balão do prédio no mapa do cartão */
.balao-predio-acoes {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.625rem;
}
.balao-btn {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: #e8f0fe;
  color: #041e49;
  font-size: 0.75rem;
  font-weight: 600;
}
.balao-btn.primario {
  background: #146c2e;
  color: #ffffff;
}
.balao-btn.desfazer {
  background: #f1f5f9;
  color: #334155;
}
.balao-feito {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #146c2e;
}
