/* ===========================================================
   GeoX — estilos
   =========================================================== */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e3e6eb;
  --text: #1c2430;
  --muted: #64707e;
  --primary: #1f7a4d;        /* verde da marca */
  --primary-600: #17663f;
  --primary-soft: #e6f4ec;
  --marca-azul: #00284C;     /* azul-marinho da logo — títulos e superfícies de marca */
  --accent: #2563eb;
  --warn: #d98a1a;
  --danger: #d64545;
  --ok: #1f9d55;
  --shadow: 0 1px 3px rgba(20, 30, 45, .08), 0 6px 20px rgba(20, 30, 45, .06);
  --radius: 12px;
  --sidebar-w: 244px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0f141a;
  --surface: #171e26;
  --surface-2: #1e2732;
  --border: #2a343f;
  --text: #e7ecf2;
  --muted: #93a1b0;
  --primary: #2fa869;
  --primary-600: #38b978;
  --primary-soft: #16352a;
  --accent: #4f8cf7;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
/* ícones inline (sem classe) ficam do tamanho do texto; Leaflet e ilustrações têm classe e não são afetados */
svg:not([class]) { width: 1.05em; height: 1.05em; vertical-align: -2px; flex: none; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg);
  color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.scrim { display: none; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
/* o pin da marca; a proporção é mais alta que larga, então fixamos a altura */
.brand .logo { height: 36px; width: auto; display: block; }
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.3px; color: var(--marca-azul); }
[data-theme="dark"] .brand h1 { color: var(--text); }
.brand small { color: var(--muted); font-size: 11px; display: block; }

.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 9px; color: var(--muted); cursor: pointer; font-weight: 500;
  border: none; background: none; width: 100%; text-align: left; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--muted); padding: 8px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.search {
  flex: 1; max-width: 520px; position: relative;
}
.search input {
  width: 100%; padding: 9px 12px 9px 36px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 14px;
}
.search input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  max-height: 380px; overflow: auto; display: none; z-index: 50;
}
.search-results.show { display: block; }
.sr-group { padding: 6px; }
.sr-label { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; font-weight: 600; }
.sr-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.sr-item:hover { background: var(--surface-2); }
.sr-item small { color: var(--muted); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; display: grid;
  place-items: center;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px;
  transition: filter .15s, background .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); background: var(--primary); }
.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .lbl { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .lbl svg { width: 16px; height: 16px; }
.stat .val { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* ---------- Tabela ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; background: var(--surface-2); }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pf { background: #e6effd; color: #2563eb; }
.badge-pj { background: #f3e9fd; color: #8b3fd6; }
[data-theme="dark"] .badge-pf { background: #172c4d; color: #7aa7f5; }
[data-theme="dark"] .badge-pj { background: #2c1e42; color: #c299ee; }
.pill { padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill-danger { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

.progress { height: 7px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 10px; transition: width .4s; }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.col-2 { grid-column: span 2; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--primary-soft); border-color: var(--primary);
}
.field .err { color: var(--danger); font-size: 12px; min-height: 0; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field .hint { font-size: 11px; color: var(--muted); }
.multi { display: flex; flex-direction: column; gap: 6px; }
.multi-row { display: flex; gap: 6px; }
.multi-row input { flex: 1; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { border: none; background: none; padding: 7px 16px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

.gms-row { display: grid; grid-template-columns: 1fr 1fr 1.1fr 64px; gap: 5px; }
.gms-row input, .gms-row select { padding: 9px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; width: 100%; }

/* Painel de camadas oficiais (WMS) sobre o mapa */
.map-wrap { position: relative; }
.wms-panel { position: absolute; top: 12px; right: 12px; z-index: 500; width: 300px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.18)); padding: 12px 14px; }
.wms-panel[hidden] { display: none; }
.wms-panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wms-x { border: none; background: none; cursor: pointer; font-size: 15px; color: var(--muted); }
.wms-row2 { display: grid; gap: 8px; margin-bottom: 10px; }
.wms-row2 label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.wms-row2 select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.wms-grp { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.wms-grp-h { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 6px; }
.wms-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.wms-item input { width: 15px; height: 15px; }
.wms-note { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 20, 26, .5);
  display: none; align-items: flex-start; justify-content: center; z-index: 1500;
  padding: 40px 16px; overflow: auto; backdrop-filter: blur(2px);
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 760px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); border: 1px solid var(--border);
  animation: pop .2s ease; margin: auto;
}
.modal.lg { max-width: 960px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Drag & drop ---------- */
.dropzone {
  border: 2px dashed var(--border); border-radius: 12px; padding: 30px;
  text-align: center; color: var(--muted); cursor: pointer; transition: .15s;
  background: var(--surface-2);
}
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone svg { width: 34px; height: 34px; margin-bottom: 8px; }

/* ---------- Doc list ---------- */
.doc-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.doc-item .ficon { width: 38px; height: 38px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--primary); flex: none; }
.doc-item .meta { flex: 1; min-width: 0; }
.doc-item .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .meta small { color: var(--muted); }

/* ---------- Checklist situação ---------- */
.checklist { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); }
.check-row .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; flex: none; }
.st.ok { background: var(--ok); }
.st.falta { background: var(--danger); }
.st.warn { background: var(--warn); }

/* ---------- Mapa ---------- */
#map { height: 620px; border-radius: var(--radius); border: 1px solid var(--border); }
/* mantém qualquer mapa Leaflet contido no próprio card (não fura topbar/modal) */
.leaflet-container { z-index: 1; }
/* ---------- Malha branca sobre o mapa ("costura" entre os ladrilhos) ----------
   Quando o navegador está com zoom diferente de 100% (devicePixelRatio
   fracionário, ex.: 1,1 = zoom 110%), o Chrome INTERPOLA cada ladrilho para
   caber num número quebrado de pixels físicos. A borda de cada imagem sai
   esmaecida e o conjunto vira uma grade branca sobre o mapa.

   Não é fresta: pintei o fundo de vermelho e de preto durante o diagnóstico e
   a linha continuou branca — ou seja, não é o fundo aparecendo, é a própria
   imagem sendo suavizada na borda. Por isso só sobrepor os ladrilhos não
   resolve; é preciso desligar a suavização.

   A regra vale apenas quando o dpr é fracionário (classe posta pelo mapa.js).
   Em tela normal (1x ou 2x) nada muda, e o mapa segue suavizado.
   O !important é necessário: o Leaflet grava width/height direto no style do
   próprio <img>. Todas as camadas do app usam ladrilhos de 256px. */
html.dpr-fracionario .leaflet-container img.leaflet-tile {
  /* meio pixel de sobreposição para fechar a costura.
     NÃO usar image-rendering: pixelated aqui. Foi tentado e piorou: com o
     zoom em 90% o ladrilho é REDUZIDO, e sem suavização a imagem fica
     serrilhada — trocava a malha branca por um mapa feio. A nitidez de
     verdade veio de pedir ladrilho 512px ao Google (scale=2, ver mapa.js). */
  width: 256.5px !important;
  height: 256.5px !important;
}
.map-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }

/* ---------- Barra de controles do mapa ----------
   Antes era uma fileira só, com fundo do mapa, camadas oficiais, importação e
   exportação embolados. Agora são três linhas rotuladas: o que se olha, o que
   se sobrepõe e o que se faz. */
/* ---------- Rótulo dentro do perímetro ----------
   Contorno claro em volta do texto (não caixa sólida): sobre satélite escuro
   ou pasto claro o texto tem que ser legível nos dois, e uma caixa opaca
   esconderia justamente a imagem que se quer ver. */
.rotulo-imovel {
  background: none !important; border: none !important;
  width: auto !important; height: auto !important;
  white-space: nowrap; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.rotulo-imovel span {
  transform: translate(-50%, -50%);
  display: inline-block; text-align: center; line-height: 1.25;
  font-size: 12px; font-weight: 700; color: #fff;
  text-shadow:
    -1px -1px 2px rgba(0,0,0,.85), 1px -1px 2px rgba(0,0,0,.85),
    -1px  1px 2px rgba(0,0,0,.85), 1px  1px 2px rgba(0,0,0,.85),
     0    0   6px rgba(0,0,0,.6);
}

.map-barra { padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 10px; }
.map-linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-rot {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); min-width: 108px; flex: none;
}
.map-barra .seg { display: flex; flex-wrap: wrap; gap: 3px; }

/* Painel de camadas FORA do mapa. Antes flutuava por cima e tapava a área que
   a pessoa queria enxergar — justamente o motivo de abrir o painel. */
.wms-fora {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  padding: 12px 14px; max-height: 320px; overflow: auto;
}
.wms-fora[hidden] { display: none; }
.wms-fora .wms-panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
/* em tela larga, os temas em colunas em vez de uma lista comprida */
.wms-fora .wms-grp { break-inside: avoid; }
@media (min-width: 900px) {
  .wms-fora > .wms-grp, .wms-fora .wms-grp { column-break-inside: avoid; }
  .wms-fora { column-width: 260px; column-gap: 22px; }
  .wms-fora .wms-panel-h, .wms-fora .wms-row2, .wms-fora .wms-note { column-span: all; }

  /* Estado e Opacidade em linha, cada rótulo COLADO no seu controle.
     O `justify-content: space-between` herdado empurrava o rótulo para uma
     ponta e o controle para a outra — numa faixa larga, ficavam a meio metro
     um do outro e o par deixava de ser lido como um par. */
  .wms-fora .wms-row2 {
    display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center;
    border-bottom: 1px solid var(--border); padding-bottom: 10px;
  }
  .wms-fora .wms-row2 label {
    justify-content: flex-start; gap: 8px; width: auto; flex: none;
  }
  .wms-fora .wms-row2 input[type=range] { width: 150px; }
}
@media (max-width: 760px) {
  .map-rot { min-width: 100%; margin-bottom: -4px; }
}
.map-toolbar select, .map-toolbar input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }

/* ---------- OCR ---------- */
.ocr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ocr-preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); min-height: 320px; display: grid; place-items: center; }
.ocr-preview img { max-width: 100%; max-height: 460px; }
.ocr-fields .field input.auto { background: var(--primary-soft); border-color: var(--primary); }
.ocr-fields .field.missing input { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.progressbar { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; margin: 10px 0; }
.progressbar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 2000; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); min-width: 240px;
  transform: translateX(120%); transition: transform .3s; font-size: 13.5px;
}
.toast.show { transform: translateX(0); }
.toast-ok { border-left-color: var(--ok); }
.toast-err { border-left-color: var(--danger); }
.toast-warn { border-left-color: var(--warn); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; margin-bottom: 12px; opacity: .5; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface-2); padding: 3px 10px; border-radius: 20px; font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.detail-grid .di { display: flex; flex-direction: column; }
.detail-grid .di span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.detail-grid .di b { font-size: 14.5px; font-weight: 600; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { border: none; background: none; padding: 10px 16px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

.mobile-only { display: none; }

/* ---------- Login ---------- */
#login { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), #0d3b26); padding: 20px; z-index: 300; }
.login-card { background: var(--surface); border-radius: 18px; padding: 34px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 22px; text-align: center; }
.login-brand img { height: 64px; width: auto; display: block; }
.login-brand h1 { margin: 0; font-size: 20px; }
.login-brand small { color: var(--muted); letter-spacing: .02em; }
/* com a marca centralizada, o título da tela acompanha */
.login-card h2 { margin: 0 0 16px; font-size: 17px; text-align: center; }
.login-card .field { margin-bottom: 12px; }

/* ---------- Search select ---------- */
.ssel { position: relative; }
.ssel-control { min-height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); padding: 3px 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: text; }
.ssel-control:focus-within { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.ssel-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ssel-chip { background: var(--primary-soft); color: var(--primary); padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.ssel-chip b { cursor: pointer; font-weight: 700; }
.ssel-input { border: none; background: none; outline: none; color: var(--text); font-size: 14px; flex: 1; min-width: 80px; padding: 5px; font-family: inherit; }
.ssel-menu { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; z-index: 120; display: none; }
.ssel-menu.open { display: block; }
.ssel-opt { padding: 8px 12px; cursor: pointer; }
.ssel-opt:hover { background: var(--surface-2); }
.ssel-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* ---------- Doc flag ---------- */
.doc-flag { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.doc-flag svg { width: 17px; height: 17px; }
.doc-flag.on { color: var(--primary); background: var(--primary-soft); }
.doc-flag.off { color: var(--border); background: var(--surface-2); }

.tab-body { padding-top: 4px; }

/* ---------- Ícones de documento personalizados ---------- */
.docbadge { border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: .3px; flex: none; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc-card { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: var(--surface); transition: box-shadow .15s; }
.dc-year { position: absolute; top: 8px; right: 8px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 20px; }
.doc-card:hover { box-shadow: var(--shadow); }
.doc-card .dc-name { font-weight: 600; font-size: 13px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card .dc-sub { font-size: 11px; color: var(--muted); }
.doc-card .dc-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ---------- Staging de upload (tipo/descrição/data por arquivo) ---------- */
.stage-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); }
.stage-head { display: flex; align-items: center; gap: 10px; }
.stage-fields { display: grid; grid-template-columns: 160px 1fr 150px; gap: 8px; margin-top: 8px; }
.stage-fields select, .stage-fields input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; }
@media (max-width: 640px) { .stage-fields { grid-template-columns: 1fr; } }

/* ---------- Painel de status por tipo ---------- */
.doc-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.doc-status-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.dsc-head { display: flex; align-items: center; gap: 10px; }
.dsc-head b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dsc-hist { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }

/* ---------- Repositório de documentos ---------- */
.pend-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-pend { border: none; cursor: pointer; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.chip-danger { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.chip-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip-pend:hover { filter: brightness(.95); }
.pend-ok { color: var(--ok); font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.repo-group { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.repo-ghead { background: var(--surface-2); padding: 9px 14px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repo-falta { font-weight: 500; font-size: 12px; color: var(--danger); }
.repo-empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }
.repo-file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.repo-file:hover { background: var(--surface-2); }
.rf-txt { flex: 1; min-width: 150px; }
.rf-txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-txt small { color: var(--muted); }
.rf-acts { display: flex; gap: 4px; }

/* ---------- Lista de situação documental ---------- */
.doc-list-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--surface-2); }
.dr-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 170px; }
.dr-txt { min-width: 0; }
.dr-txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-txt small { color: var(--muted); }
.dr-acts { display: flex; gap: 4px; }
.dr-hist { flex-basis: 100%; width: 100%; display: grid; gap: 8px; padding-top: 10px; margin-top: 2px; border-top: 1px dashed var(--border); }
.dr-hist[hidden] { display: none; }

/* ---------- Matrícula + cartório ---------- */
.mat-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.mat-top { display: flex; gap: 8px; align-items: flex-start; }
.mat-grid { flex: 1; display: grid; gap: 6px; }
.mat-grid > input, .mat-grid > select { padding: 8px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; }
.mat-grid input:focus, .mat-grid select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.cart-manual { display: grid; grid-template-columns: 1.6fr 100px 64px 1fr; gap: 6px; }
.cart-manual[hidden] { display: none !important; }
.cart-manual input, .cart-manual select { padding: 8px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; }
.cart-info { font-size: 12px; color: var(--muted); min-height: 4px; }
@media (max-width: 640px) { .cart-manual { grid-template-columns: 1fr 1fr; } .mat-grid { grid-template-columns: 1fr !important; } }

/* ---------- OCR banner ---------- */
.ocr-banner { border: 1px dashed var(--border); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.ocr-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 20px; }
.ocr-chip svg { width: 13px; height: 13px; }

/* ---------- Filtros ---------- */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filterbar input, .filterbar select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 14px; }
.filterbar input.grow { flex: 1; min-width: 200px; }

/* hero satélite / ilustração no detalhe */
.imo-hero { height: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; }
.imo-hero svg { width: 100%; height: 100%; display: block; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 90; width: 250px; transform: translateX(-100%);
    transition: transform .25s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: grid; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.col-2 { grid-column: span 1; }
  .ocr-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; display: none; }
  .scrim.show { display: block; }
}
@media (max-width: 560px) {
  .cols-4 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 760px) {
  .mat-grid { grid-template-columns: 1fr 1fr; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .tabs button { flex: none; }
  #map { height: 440px; }
  .imo-hero { height: 170px; }
  .map-toolbar { gap: 6px; }
  .map-toolbar select, .map-toolbar input, .map-toolbar .btn, .map-toolbar .seg, .map-toolbar label { flex: 1 1 auto; min-width: 0; }
  .modal-head h3 { font-size: 16px; }
  .doc-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .page-head h2 { font-size: 19px; }
}

/* ===========================================================
   Celular — ajustes de toque, rolagem e tela cheia
   Referência: campo com fonte < 16px faz o Safari do iPhone dar
   zoom sozinho ao focar; alvo de toque confortável = 44px.
   =========================================================== */
@media (max-width: 900px) {
  /* 1. Campos em 16px: impede o zoom automático do iPhone ao tocar */
  .field input, .field select, .field textarea,
  .search input, .map-toolbar select, .map-toolbar input,
  .stage-fields select, .stage-fields input,
  input, select, textarea { font-size: 16px; }

  /* 2. Alvos de toque */
  .btn { padding: 11px 16px; min-height: 44px; }
  .btn-sm { padding: 8px 12px; min-height: 38px; font-size: 13px; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-item { padding: 12px 12px; }
  .row-actions { gap: 10px; }
  .row-actions .icon-btn { width: 40px; height: 40px; }
  a, label { -webkit-tap-highlight-color: transparent; }

  /* 3. Tabelas: rolam na horizontal em vez de espremer as colunas */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 520px; }
  .table-wrap th, .table-wrap td { padding: 12px 10px; white-space: nowrap; }
  .table-wrap td:first-child { white-space: normal; min-width: 150px; }

  /* 4. Área segura (notch / barra de gestos) */
  .sidebar { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  /* 5. Barra de topo mais enxuta: a busca ganha a linha */
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .search { max-width: none; }
  .search input::placeholder { font-size: 14px; }
}

@media (max-width: 760px) {
  /* 6. Modais em tela cheia, com cabeçalho e rodapé fixos.
        ATENÇÃO: aqui vai `align-items: flex-start`, nunca `stretch`.
        Com `stretch` o modal fica travado em 100% da altura da tela e o
        formulário, que é mais alto, vaza para fora da caixa — o fundo branco
        termina no meio e a página de trás aparece atrás dos campos. */
  .modal-bg { padding: 0; align-items: flex-start; }
  .modal {
    max-width: none; border-radius: 0; border: none; margin: 0;
    width: 100%; min-height: 100%; height: auto;
    display: flex; flex-direction: column; animation: none;
  }
  .modal-head {
    position: sticky; top: 0; z-index: 6; background: var(--surface);
    padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
  }
  .modal-body { padding: 16px; flex: 1 1 auto; }
  .modal-foot {
    position: sticky; bottom: 0; z-index: 6; background: var(--surface);
    padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
  .modal-foot .btn { flex: 1 1 140px; justify-content: center; }

  /* 7. Cabeçalho da página: botão de ação ocupa a largura */
  .page-head { align-items: stretch; }
  .page-head > div:last-child .btn,
  .page-head .btn { flex: 1 1 auto; justify-content: center; }

  .dropzone { padding: 22px 14px; }
  .doc-item { gap: 10px; padding: 12px 10px; }
}

/* Botão/blocos que só existem no celular */
.so-celular { display: none !important; }
@media (max-width: 900px) {
  .so-celular { display: inline-flex !important; }
  #mapCtrl.recolhido { display: none; }
  /* com os controles recolhidos, o mapa fica do tamanho da tela */
  #map { height: calc(100vh - 210px); min-height: 340px; }
  .seg { flex-wrap: wrap; }
  .seg button { flex: 1 1 45%; }

  /* Camadas oficiais: no celular vira uma gaveta na parte de baixo, ocupando
     no máximo metade da altura — assim o mapa continua visível enquanto você
     liga e desliga as camadas. */
  .wms-panel {
    top: auto; right: 0; left: 0; bottom: 0;
    width: auto; max-width: none;
    max-height: 52%;
    border-radius: 16px 16px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .22);
  }
  /* o título e o ✕ ficam presos no topo da gaveta ao rolar a lista */
  .wms-panel-h {
    position: sticky; top: -12px; z-index: 2;
    background: var(--surface);
    margin: -12px -14px 8px; padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border);
  }
  .wms-x { min-width: 40px; min-height: 40px; font-size: 18px; }
  .wms-item { padding: 8px 0; }
  .wms-item input[type=checkbox] { width: 20px; height: 20px; }
}

/* ===== Texto em MAIÚSCULAS nos campos (exceto e-mail, senha, URL, busca) ===== */
input:not([type=email]):not([type=password]):not([type=url]):not([type=number]):not([type=date]):not([type=file]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=search]):not([type=color]):not([type=time]):not([id*=email]):not([id*=mail]):not([name*=email]):not([name*=mail]):not([name*=senha]):not([name*=url]):not([name*=link]):not([name*=sigef]):not([id*=sigef]):not(#globalSearch):not(.lc),
textarea:not(.lc) { text-transform: uppercase; }

/* ===========================================================
   Blocos (imóvel rural formado por várias matrículas)
   =========================================================== */
.badge-bloco { background: #e8f3ed; color: #1f7a4d; cursor: pointer; font-size: 11px; padding: 2px 8px; }
.badge-bloco svg { width: 12px; height: 12px; }
[data-theme="dark"] .badge-bloco { background: #163325; color: #6fd19c; }
.badge-bloco:hover { filter: brightness(.95); }

/* rótulo da matrícula dentro do polígono, no mapa do bloco */
.leaflet-tooltip.rotulo-bloco {
  background: none; border: none; box-shadow: none; padding: 0;
  font-size: 12px; font-weight: 700; color: #fff;
  text-shadow: -1px -1px 2px rgba(0,0,0,.85), 1px -1px 2px rgba(0,0,0,.85), -1px 1px 2px rgba(0,0,0,.85), 1px 1px 2px rgba(0,0,0,.85);
}
.leaflet-tooltip.rotulo-bloco::before { display: none; }

/* barra que aparece ao marcar imóveis na lista */
.selbar {
  position: sticky; top: 8px; z-index: 5;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--primary); color: #fff; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.selbar b { font-size: 14px; }
.selbar .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; }
.selbar .btn:hover { background: rgba(255,255,255,.24); }
.selbar .btn.btn-branco { background: #fff; color: var(--primary); border-color: #fff; }
.selbar .sp { flex: 1; }
td.sel, th.sel { width: 34px; padding-right: 0; }
td.sel input, th.sel input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
tr.marcada td { background: color-mix(in srgb, var(--primary) 7%, transparent); }

/* faixa "faz parte do bloco" na ficha do imóvel */
.bloco-faixa {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
}
.bloco-faixa > svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.bloco-faixa .txt { flex: 1; min-width: 200px; font-size: 13.5px; line-height: 1.5; }
.bloco-faixa .txt small { color: var(--muted); }

/* bolinha de cor que liga a linha da tabela ao polígono do mapa */
.cor-membro { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; flex: none; }

/* sugestões de CCIR/CAR/CIB encontradas nos imóveis selecionados */
.sugestoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sugestoes .chip { cursor: pointer; font-size: 12px; }
.sugestoes small { color: var(--muted); width: 100%; }
.campo-herdado input[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.nota-herdado { font-size: 12px; color: var(--muted); margin-top: 4px; }
.aviso-bloco { font-size: 12.5px; color: var(--warn); margin-top: 6px; line-height: 1.45; }

/* ===========================================================
   Reorganização (out/2026): imóvel com matrículas, trilha, selos,
   lista de imóveis, documentos em padrão único, cadastro em página
   =========================================================== */
.trilha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; }
.trilha a { color: var(--primary); text-decoration: none; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trilha a:hover { text-decoration: underline; }
.trilha .tr-sep { color: var(--border); font-weight: 700; }
.trilha .tr-atual { color: var(--text); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.selo { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--surface-2); color: var(--muted); }
.selo-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.selo-wa { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #a8640a; }
.selo-er { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
[data-theme="dark"] .selo-wa { color: #f0b45a; }

.st-nota, .cad-nota { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 12px; }
.copy-btn { border: none; background: var(--surface-2); color: var(--muted); border-radius: 5px; padding: 1px 7px; cursor: pointer; font-size: 12px; line-height: 1.5; }
.lnk-consulta { font-size: 11px; margin-left: 6px; font-weight: 500; }
.pelo-cliente { color: var(--accent); font-weight: 600; }
.btn-txt-danger { color: var(--danger); }

/* ---- lista de imóveis ---- */
.filtros-card { margin-bottom: 16px; padding: 14px; }
.busca-wrap { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.busca-ico { position: absolute; left: 12px; color: var(--muted); display: flex; }
.busca-inp { width: 100%; padding-left: 36px !important; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 14px; }
.lbl-filtro { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.sel-filtro { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; height: 36px; }
.prop-lista { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.prop-lista > .card { margin: 0; box-shadow: none; border: 0; }
.prop-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(140px, 1.4fr) 120px minmax(150px, 1.2fr) 110px; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.prop-row:hover { background: var(--surface-2); }
.prop-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.prop-head { border-top: 0; cursor: default; background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 9px 16px; }
.prop-head:hover { background: var(--surface-2); }
.pr-nome b { display: block; font-size: 14px; }
.pr-nome small { color: var(--muted); font-size: 12px; }
.pr-tit { font-size: 13px; }
.pr-area { font-size: 13px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; padding-right: 18px; }
.prop-head .pr-area { font-size: 11px; }
.pr-acts { justify-content: flex-end; }
@media (max-width: 760px) {
  .prop-head { display: none; }
  .prop-row { grid-template-columns: 1fr auto; grid-template-areas: "nome acts" "tit tit" "area sit"; gap: 4px 10px; padding: 12px 14px; }
  .pr-nome { grid-area: nome; } .pr-tit { grid-area: tit; color: var(--muted); font-size: 12.5px; }
  .pr-area { grid-area: area; color: var(--muted); font-size: 12.5px; text-align: left; padding-right: 0; } .pr-sit { grid-area: sit; justify-self: end; }
  .pr-acts { grid-area: acts; }
  .pr-acts [data-act="edit"], .pr-acts [data-act="del"] { display: none; }
}

/* ---- documentos em padrão único ---- */
.prop-docs .repo-group { margin-bottom: 10px; }
.prop-docs .repo-ghead { cursor: pointer; flex-wrap: nowrap; }
.prop-docs .repo-ghead .rg-tit { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.prop-docs .repo-ghead .rg-tit svg { width: 15px; height: 15px; }
.prop-docs .repo-ghead .rg-sub { font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prop-docs .repo-ghead .sp { flex: 1; }
.prop-docs .repo-ghead .btn { flex: none; }
.prop-docs .rg-caret { color: var(--muted); width: 12px; text-align: center; flex: none; }
.prop-docs .repo-group.fechado .rg-body { display: none; }
.repo-pend { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px dashed var(--border); font-size: 13px; }
.repo-pend .rp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.repo-pend .rp-txt { flex: 1; min-width: 0; }
.repo-pend-er .rp-dot { background: var(--danger); } .repo-pend-er .rp-txt { color: var(--danger); }
.repo-pend-wa .rp-dot { background: var(--warn); } .repo-pend-wa .rp-txt { color: #a8640a; }
[data-theme="dark"] .repo-pend-wa .rp-txt { color: #f0b45a; }
@media (max-width: 640px) {
  .prop-docs .repo-ghead { flex-wrap: wrap; row-gap: 4px; }
  .prop-docs .repo-ghead .sp { display: none; }
  .prop-docs .repo-ghead .selo { margin-left: auto; }
  .prop-docs .repo-ghead .rg-sub { flex-basis: 100%; order: 10; white-space: normal; }
}
.faixa-membro { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); border-radius: 10px; padding: 9px 14px; font-size: 13px; margin-bottom: 14px; }
.faixa-membro svg { width: 18px; height: 18px; color: var(--primary); flex: none; }

/* ---- cadastro do imóvel em página ---- */
.cad-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.cad-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.cad-mapa-col { position: sticky; top: 76px; }
.cad-card { margin: 0; }
.cad-tit { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cad-tit .sp { flex: 1; }
.cad-tit .btn { text-transform: none; letter-spacing: 0; }
.cad-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cad-mapa { height: 420px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.cad-drop { margin-top: 10px; padding: 12px; font-size: 12.5px; }
small.aviso { color: var(--warn); font-size: 12px; }
.mt-tab { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mt-row { display: grid; grid-template-columns: minmax(104px, .9fr) minmax(120px, 1.6fr) minmax(118px, 1.15fr) 44px 70px 14px; gap: 8px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.mt-row:first-child { border-top: 0; }
.mt-row:hover { background: var(--surface-2); }
.mt-row.aberta { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.mt-head { background: var(--surface-2); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); cursor: default; }
.mt-row .mr-num { display: flex; align-items: center; }
.mt-row .mr-area { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-row .mr-den { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.mt-row b.dif { color: #a8640a; }
.mt-row .mr-caret { color: var(--muted); }
.mt-editor { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); border-top: 1px solid var(--border); border-bottom: 2px solid var(--primary); padding: 12px; cursor: default; }
.mt-limite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; }
.mt-limite .sp { flex: 1; }
.mt-acoes { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.aviso-faixa { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-top: 8px; }
.opcao-grande { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--text); }
.opcao-grande:hover { border-color: var(--primary); }
.opcao-grande svg { width: 20px; height: 20px; color: var(--primary); }
.opcao-grande span, .opcao-lista span { display: flex; flex-direction: column; }
.opcao-grande small, .opcao-lista small { color: var(--muted); font-size: 12px; }
.opcao-lista { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 400; }
.opcao-lista:hover { background: var(--surface-2); }
@media (max-width: 1100px) {
  .cad-grid { grid-template-columns: 1fr; }
  .cad-mapa-col { position: static; order: -1; }
  .cad-mapa { height: 300px; }
}
@media (max-width: 640px) {
  .cad-3 { grid-template-columns: 1fr; }
  .mt-row { grid-template-columns: 1fr auto auto 18px; }
  .mt-row > span:nth-child(2), .mt-row > span:nth-child(3) { display: none; }
  .mt-head { display: none; }
}

/* ---- menu, avatar, barra de baixo (cliente) ---- */
.nav-badge { margin-left: auto; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.menu-avatar { position: fixed; top: 58px; right: 16px; z-index: 1500; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; padding: 6px; display: grid; }
.menu-avatar .ma-quem { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: grid; }
.menu-avatar .ma-quem small { color: var(--muted); font-size: 12px; }
.menu-avatar button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; text-align: left; }
.menu-avatar button:hover { background: var(--surface-2); }
.barra-baixo { display: none; }
@media (max-width: 900px) {
  body.com-barra-baixo .barra-baixo { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  .barra-baixo button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: 11px; padding: 6px 2px; cursor: pointer; }
  .barra-baixo button svg { width: 21px; height: 21px; }
  .barra-baixo button.on { color: var(--primary); font-weight: 700; }
  body.com-barra-baixo .content { padding-bottom: 84px; }
  body.com-barra-baixo #btnMenu { display: none !important; }
}

/* ---- Início ---- */
.pd-caixas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pd-caixa { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; color: var(--text); }
.pd-caixa b { font-size: 26px; line-height: 1.1; }
.pd-caixa span { font-size: 12.5px; color: var(--muted); }
.pd-caixa:hover { border-color: var(--primary); }
.pd-caixa-er b { color: var(--danger); } .pd-caixa-wa b { color: var(--warn); } .pd-caixa-ok b { color: var(--ok); }
.venc-linha { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.venc-linha:hover { background: var(--surface-2); }
.venc-data { font-weight: 800; font-size: 12px; border-radius: 6px; padding: 3px 7px; flex: none; }
.venc-er { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.venc-wa { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #a8640a; }
.venc-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartoes-imoveis { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cartao-imovel { text-align: left; cursor: pointer; display: grid; gap: 4px; margin: 0; color: var(--text); font: inherit; border: 1px solid var(--border); }
.cartao-imovel:hover { border-color: var(--primary); }
.cartao-imovel b { font-size: 15px; }
.cartao-imovel small { color: var(--muted); font-size: 12.5px; }
.ci-selos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ---- Pendências ---- */
.pd-tabela th.c, .pd-tabela td.c { text-align: center; }
.pd-cel { display: inline-block; min-width: 44px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pd-ok { color: var(--ok); }
.pd-na { color: var(--muted); font-weight: 400; }
.pd-er { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.pd-wa { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #a8640a; }
.pd-click { cursor: pointer; }
.pd-click:hover { outline: 2px solid currentColor; }
.pd-cartoes { display: none; }
.pd-cartao { display: grid; gap: 2px; cursor: pointer; margin-bottom: 10px; }
.pd-cartao small { color: var(--muted); }
@media (max-width: 760px) {
  .pd-tabela { display: none; }
  .pd-cartoes { display: block; }
  .pd-caixas { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pd-caixa b { font-size: 21px; }
}

/* ---- cadastro por IA: matrículas do imóvel ---- */
.ia-mats { display: grid; gap: 8px; }
.ia-mat { position: relative; border: 1px solid var(--border); border-radius: 9px; padding: 8px 40px 8px 10px; background: var(--surface-2); }
.ia-mat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
.ia-mat-grid .field { margin: 0; }
.ia-mat-grid label { font-size: 11px; }
.ia-mat-rm { position: absolute; top: 6px; right: 6px; }
@media (max-width: 640px) { .ia-mat-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Configurações → Relatórios (timbrado) ---------- */
.tb-logo { display:flex; gap:12px; align-items:center; }
.tb-logo-box { width:200px; height:72px; border:1px dashed var(--border); border-radius:8px; display:flex; align-items:center; justify-content:center; background:#fff; overflow:hidden; }
.tb-logo-box img { max-width:180px; max-height:60px; object-fit:contain; }
.tb-logo-box span { color:var(--muted); font-size:12px; }
.tb-previa { margin-top:14px; border:1px solid var(--border); border-radius:8px; padding:14px 16px; background:#fff; color:#1c2430; }
.tb-cab { display:flex; align-items:center; gap:12px; border-bottom:3px solid; padding-bottom:8px; }
.tb-cab img { max-height:38px; max-width:160px; object-fit:contain; }
.tb-cab b { font-size:14px; }
.tb-doc { margin-left:auto; font-weight:700; font-size:11px; letter-spacing:.08em; }
.tb-rod { display:flex; justify-content:space-between; gap:10px; margin-top:40px; border-top:1px solid #d5dbe3; padding-top:4px; font-size:10.5px; color:#64707e; white-space:pre-line; }

/* ---------- Aba Dados do imóvel (js/ficha-imovel.js) ---------- */
.fi-acoes { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.fi-menu { position:relative; }
.fi-seta { font-size:11px; margin-left:2px; }
.fi-pop { position:absolute; right:0; top:calc(100% + 6px); background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow); padding:6px; min-width:250px; z-index:40; display:flex; flex-direction:column; }
.fi-pop[hidden] { display:none; }
.fi-pop button, .fi-pop a { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:none; border:0; padding:9px 11px; border-radius:7px; font:inherit; font-size:13.5px; color:var(--text); cursor:pointer; text-decoration:none; }
.fi-pop button:hover, .fi-pop a:hover { background:var(--surface-2); }
.fi-pop svg { width:16px; height:16px; flex:none; color:var(--muted); }
.fi-pop hr { border:0; border-top:1px solid var(--border); margin:5px 4px; }
.fi-pop .perigo, .fi-pop .perigo svg { color:var(--danger); }
.fi-chips { display:flex; flex-wrap:wrap; gap:8px; margin:-6px 0 16px; }
.fi-chip { display:inline-flex; align-items:center; gap:7px; padding:6px 11px; border-radius:999px; font:inherit; font-size:12.5px; font-weight:600; border:1px solid var(--border); background:var(--surface); color:var(--text); }
button.fi-chip { cursor:pointer; }
button.fi-chip:hover { filter:brightness(.97); }
.fi-chip i { width:8px; height:8px; border-radius:50%; display:inline-block; background:var(--muted); }
.fi-chip small { font-weight:500; color:var(--muted); font-size:12px; }
.fi-ok i { background:var(--ok); }
.fi-av i { background:var(--warn); } .fi-av { border-color:color-mix(in srgb, var(--warn) 40%, var(--border)); background:color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.fi-er i { background:var(--danger); } .fi-er { border-color:color-mix(in srgb, var(--danger) 35%, var(--border)); background:color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.fi-grid { display:grid; grid-template-columns:minmax(0,1.75fr) minmax(0,1fr); gap:16px; align-items:start; }
.fi-col { display:flex; flex-direction:column; gap:16px; min-width:0; }
.fi-card { margin:0; }
.fi-sem-pad { padding:0; overflow:hidden; }
.fi-pad { padding:16px 18px 0; }
.fi-h { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 12px; font-size:12.5px; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); font-weight:700; }
.fi-h a { font-size:12.5px; text-transform:none; letter-spacing:0; color:var(--primary); font-weight:600; text-decoration:none; }
.fi-sub { text-transform:none; letter-spacing:0; font-weight:500; font-size:12.5px; }
.fi-cad { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; }
.fi-cad-item { border:1px solid var(--border); border-radius:10px; padding:10px 12px; background:var(--surface-2); min-width:0; }
.fi-cad-item.larga { grid-column:1 / -1; }
.fi-cad-item > span { display:block; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.3px; }
.fi-cad-item > b { display:block; font-size:14px; margin:3px 0 6px; word-break:break-all; }
.fi-cad-item em { font-style:normal; font-weight:500; color:var(--muted); }
.fi-links { display:flex; gap:12px; flex-wrap:wrap; align-items:center; font-size:12.5px; }
.fi-links a { color:var(--primary); text-decoration:none; font-weight:600; }
.fi-links small { color:var(--muted); font-size:12px; }
.fi-tab { border:0; border-radius:0; margin-top:4px; }
.fi-tab td, .fi-tab th { vertical-align:middle; }
.fi-tab .n { text-align:right; white-space:nowrap; }
.fi-tab small { display:block; color:var(--muted); font-size:11.5px; }
.fi-tab .fi-tot td { background:var(--surface-2); font-weight:700; }
.fi-click { cursor:pointer; }
.fi-click:hover td { background:var(--surface-2); }
.fi-mat { display:flex; align-items:center; gap:2px; }
.fi-dot { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:8px; flex:none; vertical-align:-1px; }
.fi-cart { font-size:13px; }
.fi-area { display:grid; grid-template-columns:150px minmax(0,1fr) 150px; gap:12px; align-items:center; font-size:13px; margin-bottom:10px; }
.fi-bar { height:10px; border-radius:6px; background:var(--surface-2); overflow:hidden; }
.fi-bar i { display:block; height:100%; border-radius:6px; }
.fi-area .v { text-align:right; font-weight:700; white-space:nowrap; }
.fi-area .v small { display:block; font-weight:600; font-size:11.5px; }
.fi-d-ok { color:var(--ok); } .fi-d-av { color:#b45309; } .fi-d-er { color:var(--danger); }
.fi-alerta { display:flex; gap:9px; align-items:flex-start; border-radius:10px; padding:9px 12px; font-size:12.5px; margin-top:8px; }
.fi-alerta svg { width:16px; height:16px; flex:none; margin-top:1px; }
.fi-alerta-av { background:color-mix(in srgb, var(--warn) 10%, var(--surface)); border:1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); }
.fi-alerta-er { background:color-mix(in srgb, var(--danger) 8%, var(--surface)); border:1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); }
.fi-ok-linha { color:var(--ok); font-size:12.5px; margin-top:4px; }
.fi-sat { position:relative; border-radius:10px; overflow:hidden; cursor:pointer; background:#1b2420; aspect-ratio:420/250; }
.fi-sat img, .fi-sat svg { width:100%; height:100%; display:block; object-fit:cover; }
.fi-sat-rot { position:absolute; right:8px; bottom:8px; background:rgba(0,0,0,.62); color:#fff; font-size:11.5px; padding:4px 10px; border-radius:999px; }
.fi-sat-vazio { border:1px dashed var(--border); border-radius:10px; padding:22px 12px; text-align:center; color:var(--muted); font-size:13px; }
.fi-sat-vazio svg { width:22px; height:22px; }
.fi-sat-vazio a { color:var(--primary); font-weight:600; }
.fi-kv { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 12px; font-size:13.5px; margin-top:12px; }
.fi-kv0 { margin-top:0; }
.fi-kv > span { color:var(--muted); font-size:12.5px; padding-top:1px; }
.fi-kv > b { font-weight:600; text-align:right; word-break:break-word; }
.fi-kv a { color:var(--primary); text-decoration:none; }
.fi-kv em { font-style:normal; font-weight:500; color:var(--muted); }
.fi-hist { list-style:none; margin:0; padding:0; font-size:13px; }
.fi-hist li { display:grid; grid-template-columns:10px minmax(0,1fr); gap:10px; padding-bottom:11px; }
.fi-hist li:before { content:""; width:9px; height:9px; border-radius:50%; background:var(--primary); margin-top:5px; }
.fi-hist b { font-weight:600; word-break:break-word; }
.fi-hist small { display:block; color:var(--muted); font-size:11.5px; }
.fi-rod { font-size:12px; color:var(--muted); margin-top:2px; border-top:1px solid var(--border); padding-top:8px; }
.fi-obs { margin:0; white-space:pre-line; font-size:13.5px; }
.fi-reg { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:12px; margin-bottom:12px; }
.fi-reg > div > span { display:block; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.3px; }
.fi-reg b { display:block; font-size:14px; margin-top:2px; }
.fi-reg small { display:block; color:var(--muted); font-size:11.5px; word-break:break-all; }
.fi-reg a { color:var(--primary); text-decoration:none; }
.ci-classe { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; font-size:13.5px; line-height:1.35; background:var(--surface-2); border:1px solid var(--border); border-radius:9px; padding:9px 12px; }
.ci-classe small { color:var(--muted); font-size:12px; }
.ci-classe .ci-mf-num { font-size:18px; font-weight:700; color:var(--primary); }
#ciMfFonte a { color:var(--primary); }
.fi-cad-item.dupla { grid-column: span 2; }
.fi-classe { color:var(--text); }
@media (max-width: 900px) {
  .fi-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width: 700px) {
  .fi-cad { grid-template-columns:minmax(0,1fr); }
  .fi-cad-item.dupla { grid-column:auto; }
  .fi-area { grid-template-columns:100px minmax(0,1fr) 112px; font-size:12px; gap:8px; }
  .fi-chips { margin-top:-2px; }
  .fi-pop { right:auto; left:0; }
  .fi-acoes { width:100%; }
}
.fi-tab .pill, .fi-tab .selo { white-space:nowrap; }
.fi-tab .fi-cart { display:block; max-width:220px; }
@media (max-width: 700px) {
  .fi-tab table { min-width:0; }
  .fi-tab td, .fi-tab th { padding:9px 6px; font-size:12.5px; }
  .fi-tab .pill { font-size:11px; padding:2px 6px; }
  .fi-tab td:last-child, .fi-tab th:last-child { padding-right:12px; }
  .fi-tab td:first-child, .fi-tab th:first-child { padding-left:14px; }
}

/* ---------- cadastro: campo de cartório com busca ---------- */
.cad-tudo { grid-column: 1 / -1; }
.cart-dica { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.cart-pick { position: relative; }
.cart-sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; z-index: 30; padding: 4px; }
.cart-sug[hidden] { display: none; }
.cart-op { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.cart-op small { display: block; color: var(--muted); font-size: 11.5px; }
.cart-op:hover, .cart-op.ativo { background: var(--surface-2); }
.cart-manual-op { border-top: 1px dashed var(--border); margin-top: 4px; }
.cart-vazio { padding: 10px; color: var(--muted); font-size: 12.5px; }
.cart-info { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cart-info .ok { color: var(--ok); font-weight: 700; }
.cart-info .av { color: #a8640a; }
.fi-cart-comum { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; font-size:13px; padding-bottom:10px; margin-top:-4px; }
.fi-cart-comum span { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.3px; }
.fi-cart-comum small { color:var(--muted); font-size:12px; }
.fi-tab td:first-child { width:40%; min-width:180px; }
.fi-tab td:not(:first-child), .fi-tab th:not(:first-child) { padding-left:8px; padding-right:8px; }
.fi-tab .fi-mat small { line-height:1.3; }
.fi-reg-cart { grid-column: span 2; }
.cart-pick input { width:100%; }
.fi-nota { display:block; margin-top:8px; color:var(--muted); font-size:11.5px; }
.pr-copro { display:inline-flex; align-items:center; gap:3px; margin-left:6px; padding:1px 7px 1px 5px; border-radius:999px; background:color-mix(in srgb, var(--accent) 12%, var(--surface)); color:var(--accent); font-size:11.5px; font-weight:700; vertical-align:1px; cursor:help; white-space:nowrap; }
.pr-copro svg { width:13px; height:13px; }

/* ---------- Baixar documentos (js/exportar.js) ---------- */
.ex-body { display:flex; flex-direction:column; gap:14px; }
.ex-sec { border:1px solid var(--border); border-radius:10px; padding:12px 14px; }
.ex-tit { display:flex; align-items:baseline; justify-content:space-between; gap:8px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); margin-bottom:8px; }
.ex-tit small, .ex-acoes { text-transform:none; letter-spacing:0; font-weight:500; }
.ex-acoes a { color:var(--primary); text-decoration:none; font-weight:600; }
.ex-grupo { display:grid; grid-template-columns:150px minmax(0,1fr); gap:6px 12px; align-items:start; padding:6px 0; border-top:1px dashed var(--border); }
.ex-grupo:first-of-type { border-top:0; }
.ex-g { display:flex; align-items:center; gap:7px; font-size:13px; cursor:pointer; padding-top:4px; }
.ex-tipos { display:flex; flex-wrap:wrap; gap:6px; }
.ex-chip { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:999px; padding:4px 11px 4px 8px; font-size:13px; cursor:pointer; background:var(--surface); font-weight:500; }
.ex-chip:has(input:checked) { border-color:color-mix(in srgb, var(--primary) 45%, var(--border)); background:var(--primary-soft); }
.ex-chip small { color:var(--muted); font-size:11.5px; }
.ex-cols { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ex-op { display:flex; gap:9px; align-items:flex-start; padding:5px 0; cursor:pointer; font-weight:400; }
.ex-op input { margin-top:3px; }
.ex-op span { display:flex; flex-direction:column; font-size:13.5px; }
.ex-op small { color:var(--muted); font-size:12px; }
.ex-ind { border:1px solid var(--border); border-radius:10px; padding:10px 14px; }
.ex-previa .ex-arvore { font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:12px; background:var(--surface-2); border-radius:8px; padding:10px 12px; max-height:220px; overflow:auto; line-height:1.6; word-break:break-all; }
.ex-mais { color:var(--muted); font-style:italic; }
.ex-resumo { margin-right:auto; color:var(--muted); font-size:13px; }
.ex-prog { padding:30px 10px; text-align:center; display:flex; flex-direction:column; gap:12px; }
.ex-prog small { color:var(--muted); }
@media (max-width:700px) { .ex-cols { grid-template-columns:1fr; } .ex-grupo { grid-template-columns:1fr; } }

/* ---------- Imóveis: lista × cartões ---------- */
.seg-visao { display:inline-flex; border:1px solid var(--border); border-radius:10px; overflow:hidden; background:var(--surface); }
.seg-visao button { border:0; background:none; padding:8px 10px; cursor:pointer; color:var(--muted); display:flex; }
.seg-visao button + button { border-left:1px solid var(--border); }
.seg-visao button.ativo { background:var(--primary-soft); color:var(--primary); }
.seg-visao svg { width:18px; height:18px; }
.prop-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; }
.prop-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; cursor:pointer; display:flex; flex-direction:column; transition:border-color .15s, transform .15s; }
.prop-card:hover { border-color:var(--primary); transform:translateY(-1px); }
.prop-card:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.pc-mapa { height:130px; background:#f3f6f4; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:center; }
.pc-mapa svg { width:100%; height:100%; display:block; }
.pc-sem { display:flex; flex-direction:column; align-items:center; gap:4px; color:var(--muted); }
.pc-sem svg { width:28px; height:28px; }
.pc-corpo { padding:12px 14px 14px; display:flex; flex-direction:column; gap:4px; flex:1; }
.pc-corpo b { font-size:14.5px; line-height:1.3; }
.pc-corpo small { color:var(--muted); font-size:12.5px; line-height:1.35; }
.pc-tit { color:var(--text) !important; }
.pc-rodape { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:auto; padding-top:8px; flex-wrap:wrap; }
.pc-area { font-weight:700; font-size:13.5px; font-variant-numeric:tabular-nums; }
.prop-row-cli { grid-template-columns:minmax(220px, 2.6fr) minmax(120px, 1fr) 130px minmax(150px, 1.3fr); }
@media (max-width: 760px) {
  .prop-row-cli { grid-template-columns:1fr auto; grid-template-areas:"nome nome" "mun mun" "area sit"; }
  .prop-row-cli .pr-mun { grid-area: mun; color: var(--muted); font-size: 12.5px; }
  .prop-cards { grid-template-columns:1fr; }
}

/* lista de imóveis com a coluna Município */
.prop-row-imo { grid-template-columns: minmax(240px, 2.4fr) minmax(120px, 1fr) minmax(150px, 1.4fr) 115px minmax(150px, 1.15fr) 110px; }
.pr-mun { font-size: 13px; }
@media (max-width: 760px) {
  .prop-row-imo { grid-template-columns: 1fr auto; grid-template-areas: "nome acts" "mun mun" "tit tit" "area sit"; }
  .pr-mun { grid-area: mun; color: var(--muted); font-size: 12.5px; }
}
.pr-nome small { display:block; }
.pr-nome .pr-cart, .pc-corpo .pr-cart { font-size:11.5px; opacity:.9; }
.prop-row-cimo { grid-template-columns: minmax(240px, 2.6fr) minmax(120px, 1fr) 120px minmax(150px, 1.2fr) 70px; }
@media (max-width: 760px) {
  .prop-row-cimo { grid-template-columns: 1fr auto; grid-template-areas: "nome acts" "mun mun" "area sit"; }
  .prop-row-cimo .pr-mun { grid-area: mun; color: var(--muted); font-size: 12.5px; }
}
.pr-mun-l { display:flex; align-items:center; gap:4px; }
.pr-mun-l svg { width:13px; height:13px; flex:none; }

/* padrão de identificação do imóvel nos cabeçalhos */
.page-head .ph-sub { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.page-head .ph-sub svg { width:15px; height:15px; flex:none; }
.page-head .ph-sub2 { margin-top:2px; font-size:12.5px; color:var(--muted); }
.pd-imo a { color:inherit; text-decoration:none; }
.pd-imo a:hover b { text-decoration:underline; }
.pd-imo { min-width:250px; }
.pd-imo .pd-tit { margin-top:2px; }
.pd-mun { font-size:13px; white-space:nowrap; }
.pd-cartao .pr-nome small { display:block; }

/* ---------- Início do cliente: resumo ---------- */
.ini-stats { margin-bottom:18px; }
.ini-grid > *, .ini-stats > * { min-width:0; }
.stat-btn { text-align:left; font:inherit; color:inherit; cursor:default; }
.stat-btn[data-ir] { cursor:pointer; }
.stat-btn[data-ir]:hover { border-color:var(--primary); }
.stat-er .val { color:var(--danger); }
.stat-wa .val { color:var(--warn); }
.stat-ok .val { color:var(--primary); }
.ini-h { margin:0 0 12px; display:flex; align-items:center; gap:8px; font-size:15px; }
.ini-lista { display:grid; grid-template-columns:minmax(0,1fr); gap:4px; }
.ini-linha { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; cursor:pointer; }
.ini-linha:hover, .ini-linha:focus-visible { background:var(--surface-2); outline:none; }
.ini-linha .selo { width:84px; justify-content:center; flex:none; }
.ini-txt { flex:1; min-width:0; display:flex; flex-direction:column; }
.ini-txt b { font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ini-txt small { color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ini-ir { color:var(--muted); font-size:18px; }
.ini-prazo .venc-data { width:84px; flex:none; box-sizing:border-box; text-align:center; font-size:12px; font-weight:700; color:var(--muted); background:var(--surface-2); border-radius:8px; padding:3px 6px; }
.ini-ok { display:flex; gap:12px; align-items:center; padding:12px; border-radius:10px; background:var(--primary-soft); color:var(--primary); }
.ini-ok svg { width:26px; height:26px; flex:none; }
.ini-ok div { display:flex; flex-direction:column; }
.ini-ok small { color:var(--muted); }
.ini-mais { color:var(--muted); display:block; margin:6px 10px 0; }
.ini-imo .selo { width:auto; }

/* ---------- Documentos pessoais em vagas ---------- */
.dp-dica { color:var(--muted); font-size:13px; margin:2px 0 12px; }
.dp-grade { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:10px; margin-top:12px; }
.dp-vaga { display:grid; grid-template-columns:40px 1fr; align-items:center; gap:8px 12px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.dp-vazio { border-style:dashed; background:transparent; }
.dp-vazio .ficon, .dp-vazio > :first-child { opacity:.55; }
.dp-pend { border-color:color-mix(in srgb, var(--danger) 45%, transparent); border-style:dashed; }
.dp-er { border-color:color-mix(in srgb, var(--danger) 45%, transparent); }
.dp-wa { border-color:color-mix(in srgb, var(--warn) 45%, transparent); }
.dp-txt { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.dp-txt b { font-size:13.5px; }
.dp-txt small { color:var(--muted); font-size:12px; display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.dp-txt small svg { width:13px; height:13px; }
.dp-ok .dp-txt small { color:var(--primary); }
.dp-pend .dp-txt small, .dp-er .dp-txt small { color:var(--danger); font-weight:600; }
.dp-wa .dp-txt small { color:var(--warn); font-weight:600; }
.dp-acts { grid-column:2; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.dp-acts .btn { margin-left:auto; }
.dp-acts .btn svg { width:15px; height:15px; }
@media (max-width:760px) {
  .dp-grade { grid-template-columns:1fr; }
  .ini-stats { grid-template-columns:1fr 1fr !important; gap:10px; }
  .ini-stats .stat { padding:12px 14px; }
  .ini-stats .val { font-size:22px; }
  .ini-imo { flex-wrap:wrap; }
  .ini-imo .ini-txt { flex:1 1 calc(100% - 30px); }
  .ini-imo .selo { order:3; margin-left:0; flex:none; }
  .ini-txt b, .ini-txt small { white-space:normal; }
}

/* ---------- CAR (beta) ---------- */
.selo-beta { display:inline-block; vertical-align:middle; font-size:10.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:#7c3aed; background:color-mix(in srgb, #7c3aed 13%, transparent); border-radius:999px; padding:2px 8px; margin-left:6px; }
.car-serv { margin-bottom:14px; }
.car-serv .aviso-faixa { margin-top:0; font-size:13px; padding:10px 12px; }
.car-serv-l { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }
.car-serv-l.ok { color:var(--primary); font-weight:600; }
.car-serv-l svg { width:16px; height:16px; }
.car-txt { width:100%; box-sizing:border-box; font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:13px; border:1px solid var(--border); border-radius:10px; padding:10px 12px; resize:vertical; background:var(--surface); color:var(--text); }
.car-add { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.car-inv { color:var(--muted); }
.car-cod { font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:12.5px; word-break:break-all; }
.modal-body > .car-cod { background:var(--surface-2); border-radius:8px; padding:8px 10px; }
.car-tab { margin-top:10px; }
.car-row { display:grid; grid-template-columns:minmax(260px, 2.2fr) minmax(170px, 1.4fr) minmax(140px, 1fr) 150px; gap:12px; align-items:center; padding:10px 4px; border-top:1px solid var(--border); }
.car-row > * { min-width:0; }
.car-head { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); border-top:0; }
.car-c, .car-i, .car-s { display:flex; flex-direction:column; gap:2px; }
.car-s { align-items:flex-start; }
.car-st[hidden] { display:none; }
.car-c small, .car-i small { color:var(--muted); font-size:12px; }
.car-i a { font-weight:600; }
.car-msg { color:var(--danger); font-size:12px; }
.car-a { display:flex; gap:4px; justify-content:flex-end; }
.car-st { margin-top:12px; padding:10px 12px; border-radius:10px; background:var(--surface-2); font-size:13px; display:flex; align-items:center; gap:8px; }
.car-st.ok { background:var(--primary-soft); color:var(--primary); }
.car-st.er { background:color-mix(in srgb, var(--danger) 12%, transparent); color:var(--danger); }
.car-st svg { width:16px; height:16px; }
.car-gira { width:13px; height:13px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; display:inline-block; animation:carGira .8s linear infinite; flex:none; }
@keyframes carGira { to { transform:rotate(360deg); } }
.car-esc { display:grid; gap:4px; max-height:46vh; overflow:auto; }
.car-esc .opcao-lista span { display:flex; flex-direction:column; }
.car-esc small { color:var(--muted); }
@media (max-width:760px) {
  .car-row { grid-template-columns:1fr auto; grid-template-areas:"c c" "i i" "s a"; }
  .car-head { display:none; }
  .car-c { grid-area:c; } .car-i { grid-area:i; } .car-s { grid-area:s; } .car-a { grid-area:a; }
}
