/* ── Mapa de Registros — CSS ────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0e1117;
  --surface:   #161b24;
  --surface2:  #1e2534;
  --border:    #2a3347;
  --text:      #d4dbe8;
  --text-dim:  #6b7a99;
  --accent:    #00b4d8;
  --green:     #2ecc71;
  --red:       #e74c3c;
  --yellow:    #f39c12;
  --sidebar-w: 280px;
  --radius:    8px;
}

html, body { height: 100%; font-family: 'Syne', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }

/* ── Layout ──────────────────────────────────────────────────── */
#sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden; z-index: 1000;
  padding-bottom: 32px;
  box-shadow: 4px 0 24px rgba(0,0,0,.4);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
#map { position: fixed; left: var(--sidebar-w); top: 0; right: 0; bottom: 0; }

/* ── Créditos sobre o mapa ───────────────────────────────────── */
.map-credits {
  position: fixed; bottom: 16px; left: calc(var(--sidebar-w) + 12px);
  font-size: 11px; font-family: 'Syne', sans-serif; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.75); text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 8px rgba(0,0,0,.9); z-index: 999; pointer-events: none;
}
body.is-mobile .map-credits { display: none; }
@media (max-width: 767px) { .map-credits { display: none; } }

/* ── Header ──────────────────────────────────────────────────── */
.sidebar-header {
  position: sticky; top: 0; z-index: 10;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; gap: 8px;
}
.logo { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 14px; color: var(--text-dim); }
.logo strong { color: var(--text); }

/* ── Stats ───────────────────────────────────────────────────── */
.stats-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--border); }
/* Cards estragado/asfaltado ocultos até ter dados suficientes para justificar o espaço */
.stat.estragado, .stat.asfaltado { display: none; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 12px 8px; border-right: 1px solid var(--border); gap: 3px; }
.stat:last-child { border-right: none; }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.stat-val { font-family: 'JetBrains Mono', monospace; font-size: 24px; font-weight: 600; line-height: 1; color: var(--text); }
.stat.open .stat-val  { color: var(--green); }
.stat.closed .stat-val{ color: var(--red);   }

/* ── Abas ────────────────────────────────────────────────────── */
.abas-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.aba-btn {
  padding: 10px; font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.aba-btn:hover { color: var(--text); }
.aba-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.aba-content { }

/* ── Section titles ──────────────────────────────────────────── */
.section-title {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); padding: 12px 16px 6px;
  display: flex; align-items: center; justify-content: space-between;
  border-left: 3px solid var(--accent); padding-left: 13px;
}

/* ── Tipo Toggle ─────────────────────────────────────────────── */
.tipo-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 12px; }
.tipo-btn {
  padding: 8px 4px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text-dim);
  border-radius: var(--radius); font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.tipo-btn:hover  { border-color: var(--accent); color: var(--accent); }
.tipo-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }

/* ── Inputs ──────────────────────────────────────────────────── */
.coord-row { display: flex; gap: 6px; padding: 0 16px 8px; }
input[type=text], textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  padding: 8px 10px; outline: none; transition: border-color .2s;
}
input[type=text]:focus, textarea:focus { border-color: var(--accent); }
textarea { width: calc(100% - 32px); margin: 0 16px 12px; resize: none; }
.icon-btn {
  min-width: 36px; height: 36px; background: var(--accent); color: #000;
  border: none; border-radius: var(--radius); font-size: 18px; cursor: pointer; font-weight: 700; transition: opacity .2s;
}
.icon-btn:hover { opacity: .8; }

/* ── Upload ──────────────────────────────────────────────────── */
.upload-btn {
  display: flex; align-items: center; gap: 8px; margin: 0 16px 8px;
  padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
button.upload-btn { width: calc(100% - 32px); font-family: 'Syne', sans-serif; font-weight: 600; font-size: 12px; }
.upload-btn--green { border-color: var(--green); background: var(--green); color: #0a1628; }
.upload-btn--green:hover { background: #27ae60; border-color: #27ae60; color: #0a1628; }
.upload-btn--blue  { border-color: var(--accent); background: var(--accent); color: #0a1628; }
.upload-btn--blue:hover  { background: #0098b8; border-color: #0098b8; color: #0a1628; }
.import-msg { font-size: 11px; padding: 0 16px 8px; font-family: 'JetBrains Mono', monospace; }
.import-msg.ok  { color: var(--green); }
.import-msg.err { color: var(--red);   }

/* ── Hint ────────────────────────────────────────────────────── */
.hint { font-size: 10px; color: var(--text-dim); padding: 4px 16px 10px; line-height: 1.5; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }

/* ── Filtro tipo (desktop only) ──────────────────────────────── */
.tipo-filter { display:grid; grid-template-columns:1fr 1fr 1fr; border-bottom:1px solid var(--border); }
.tf-btn {
  padding:10px; font-family:'Syne',sans-serif; font-size:12px; font-weight:700;
  background:none; border:none; color:var(--text-dim); cursor:pointer;
  border-bottom:2px solid transparent; transition:all .2s;
}
.tf-btn:hover  { color:var(--text); }
.tf-btn.active { color:var(--accent); border-bottom-color:var(--accent); }
@media (max-width:767px) { .tipo-filter { display:none; } }

/* ── Dias ────────────────────────────────────────────────────── */
.dias-filter { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 16px 10px; }
.dia-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 20px; cursor: pointer;
  font-family: 'Syne', sans-serif; transition: all .2s;
}
.dia-btn:hover  { border-color: var(--accent); color: var(--accent); }
.dia-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

/* ── Atividades ──────────────────────────────────────────────── */
#atividades-list { padding: 0 8px; }
.ativ-item { display: flex; gap: 8px; padding: 8px; border-radius: var(--radius); margin-bottom: 4px; background: var(--surface2); font-size: 11px; cursor: pointer; transition: background .15s; }
.ativ-item:hover { background: var(--border); }
.ativ-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
.ativ-dot.aberto   { background: var(--green);  }
.ativ-dot.fechado  { background: var(--red);    }
.ativ-dot.movido, .ativ-dot.importado, .ativ-dot.criado { background: var(--accent); }
.ativ-text { color: var(--text-dim); line-height: 1.5; }
.ativ-text strong { color: var(--text); }
.ativ-obs  { font-size: 10px; color: var(--text-dim); margin-top: 2px; font-style: italic; }
.ativ-hora { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.ativ-empty { text-align: center; color: var(--text-dim); font-size: 12px; padding: 24px 0; }

/* ── Métricas ────────────────────────────────────────────────── */
.metricas-select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-size: 12px;
  padding: 8px 10px; outline: none; cursor: pointer;
}
.metricas-select:focus { border-color: var(--accent); }

.metricas-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 0 16px 12px; }
.m-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; padding: 10px 6px; gap: 4px;
}
.m-val  { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.m-lbl  { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.m-card.open   .m-val { color: var(--green); }
.m-card.closed .m-val { color: var(--red);   }

.pizza-wrap { padding: 8px 24px 16px; display: flex; flex-direction: column; align-items: center; }
#pizza-chart { max-width: 200px; max-height: 200px; }

/* ── Print Button ────────────────────────────────────────────── */
.print-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--radius); padding: 4px 8px; cursor: pointer; font-size: 14px; transition: all .2s;
}
.print-btn:hover    { border-color: var(--accent); color: var(--accent); }
.print-btn:disabled { opacity: .5; cursor: wait; }



/* ── Mapa ────────────────────────────────────────────────────── */
.leaflet-container { background: #0d1219; }

/* ── Context Menus ───────────────────────────────────────────── */
#ctx-menu, #ctx-marker {
  position: fixed; z-index: 9999; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 0; min-width: 210px; box-shadow: 0 8px 32px rgba(0,0,0,.5); display: none;
}
#ctx-menu .ctx-title, #ctx-marker .ctx-title {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); padding: 4px 14px 8px;
}
#ctx-menu button, #ctx-marker button {
  display: block; width: 100%; padding: 9px 14px; text-align: left;
  background: none; border: none; color: var(--text);
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s;
}
#ctx-menu button:hover, #ctx-marker button:hover { background: var(--surface2); }
#ctx-menu hr, #ctx-marker hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Banner Modo Mover ───────────────────────────────────────── */
#mover-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--yellow); color: #000;
  padding: 10px 20px; border-radius: 30px;
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
  display: none; align-items: center; gap: 14px;
  z-index: 9500; box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: slideDown .25s ease;
}
@keyframes slideDown {
  from { opacity:0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
#mover-banner button {
  background: rgba(0,0,0,.2); border: none; color: #000;
  border-radius: 20px; padding: 3px 10px; cursor: pointer;
  font-weight: 700; font-family: 'Syne', sans-serif; font-size: 12px;
}
#mover-banner button:hover { background: rgba(0,0,0,.35); }

/* ── Modal ───────────────────────────────────────────────────── */
#modal-overlay, #extrato-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; backdrop-filter: blur(2px);
}
#modal-overlay { z-index: 9000; }
#extrato-overlay { z-index: 9100; }

#modal {
  position: fixed; z-index: 9001;
  top: 50%; left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2);
  transform: translate(-50%, -50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: 360px; box-shadow: 0 16px 64px rgba(0,0,0,.6); display: none;
  animation: pop .2s ease;
}
@keyframes pop {
  from { opacity:0; transform: translate(-50%,-48%) scale(.97); }
  to   { opacity:1; transform: translate(-50%,-50%) scale(1); }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.tipo-badge { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; margin-right: 8px; }
.tipo-badge.manobra  { background: rgba(0,180,216,.15); color: var(--accent); }
.tipo-badge.descarga { background: rgba(46,204,113,.15); color: var(--green); }
.modal-id    { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body  { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-coords { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); }
.modal-status-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
#modal-toggle-btn { padding: 6px 18px; border: none; border-radius: 20px; font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .2s; }
#modal-toggle-btn.aberto  { background: rgba(46,204,113,.15); color: var(--green); border: 1px solid var(--green); }
#modal-toggle-btn.fechado { background: rgba(231,76,60,.15);  color: var(--red);   border: 1px solid var(--red);   }
.status-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.status-btn { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: 12px; cursor: pointer; }
.status-btn.active { border-color: var(--accent); color: var(--text); background: rgba(0,180,216,.12); }
#modal .modal-body textarea { margin: 0; width: 100%; }
#modal .modal-body input[type=text] { width: 100%; }
.modal-footer { display: flex; gap: 8px; }
.btn-salvar  { flex:1; padding:9px; background: var(--accent); color:#000; border:none; border-radius: var(--radius); font-family:'Syne',sans-serif; font-size:13px; font-weight:700; cursor:pointer; transition:opacity .2s; }
.btn-salvar:hover { opacity: .85; }
.btn-deletar { padding:9px 14px; background:rgba(231,76,60,.1); color:var(--red); border:1px solid var(--red); border-radius:var(--radius); font-family:'Syne',sans-serif; font-size:13px; font-weight:700; cursor:pointer; transition:all .2s; }
.btn-deletar:hover { background: rgba(231,76,60,.2); }
.modal-datas { font-size:10px; color:var(--text-dim); font-family:'JetBrains Mono',monospace; line-height:1.7; }

/* ── Modal Extrato ───────────────────────────────────────────── */
#extrato-modal {
  position: fixed; z-index: 9101;
  top: 5vh; left: calc(var(--sidebar-w) + 2vw); right: 2vw; bottom: 5vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: none; flex-direction: column; box-shadow: 0 16px 64px rgba(0,0,0,.6); overflow: hidden;
}
.extrato-filtros { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface2); flex-wrap: wrap; }
.extrato-filtros select, .extrato-filtros input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); font-family:'Syne',sans-serif; font-size:12px; padding:6px 10px; outline:none; }
.extrato-filtros select { cursor:pointer; }
.extrato-filtros select:focus, .extrato-filtros input:focus { border-color: var(--accent); }
.extrato-count { font-size:11px; color:var(--text-dim); font-family:'JetBrains Mono',monospace; padding:8px 16px; border-bottom:1px solid var(--border); }
#extrato-table-wrap { overflow:auto; flex:1; }
#extrato-table { width:100%; border-collapse:collapse; font-size:12px; font-family:'JetBrains Mono',monospace; }
#extrato-table th { position:sticky; top:0; background:var(--surface2); color:var(--text-dim); font-size:10px; text-transform:uppercase; letter-spacing:.08em; padding:10px 12px; text-align:left; border-bottom:1px solid var(--border); }
#extrato-table td { padding:9px 12px; border-bottom:1px solid rgba(255,255,255,.04); color:var(--text); vertical-align:middle; }
#extrato-table tr:hover td { background:var(--surface2); cursor:pointer; }
.ext-status { padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; }
.ext-status.aberto  { background:rgba(46,204,113,.15); color:var(--green); }
.ext-status.fechado { background:rgba(231,76,60,.15);  color:var(--red);   }
.extrato-export-btn { font-size:11px; font-weight:700; font-family:'Syne',sans-serif; background:rgba(46,204,113,.1); border:1px solid var(--green); color:var(--green); border-radius:var(--radius); padding:4px 10px; text-decoration:none; cursor:pointer; transition:all .2s; }
.extrato-export-btn:hover { background:rgba(46,204,113,.2); }

/* ── Marcadores ──────────────────────────────────────────────── */
/* marker-wrap tem tamanho fixo igual à forma — o label flutua via absolute,
   sem nunca alterar a caixa de ancoragem do Leaflet */
.marker-wrap {
  position:relative; width:22px; height:22px;
  display:flex; align-items:center; justify-content:center;
  transform: scale(var(--marker-scale, 1));
  transform-origin: center center;
  transition: transform .2s ease;
}

.marker-label {
  background: rgba(14,17,23,.82); color: #d4dbe8;
  font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:600;
  padding:2px 6px; border-radius:4px; border:1px solid rgba(255,255,255,.08);
  white-space:nowrap; letter-spacing:.03em; backdrop-filter:blur(4px);
  pointer-events:none; max-width:160px; overflow:hidden; text-overflow:ellipsis;
  /* Flutua acima do círculo/quadrado sem afetar o layout */
  position:absolute; bottom:26px; left:50%;
  transform:translateX(-50%) translateY(4px);
  opacity:0; transition:opacity .25s, transform .25s;
}
.labels-visiveis .marker-label { opacity:1; transform:translateX(-50%) translateY(0); }
.marker-label:empty { display:none; }

.marker-circle {
  width:22px; height:22px; border-radius:50%; position:relative;
  border:3px solid rgba(255,255,255,.25); box-shadow:0 2px 8px rgba(0,0,0,.5);
  cursor:pointer; transition:transform .15s, box-shadow .15s;
}
/* Descarga — triângulo via SVG inline (compatível com html2canvas) */
.marker-triangle-wrap {
  width:22px; height:22px;
  cursor:pointer; transition:transform .15s, filter .15s;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
}
.marker-triangle-wrap.marker-hover { transform:scale(1.25); filter:drop-shadow(0 0 8px rgba(255,255,255,.5)); }

/* Ponto central — indica a posição geográfica exata do registro */
.marker-circle::after {
  content:''; position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%);
  width:4px; height:4px; border-radius:50%;
  background:rgba(255,255,255,.9);
  box-shadow:0 0 3px rgba(0,0,0,.7);
  pointer-events:none;
}
.marker-circle.aberto    { background:#2ecc71; }
.marker-circle.fechado   { background:#e74c3c; }
.marker-circle.estragado { background:#f59e0b; }
.marker-circle.asfaltado { background:#7c3aed; }

.marker-circle.marker-hover { transform:scale(1.25); box-shadow:0 0 10px rgba(255,255,255,.4); }

/* Fantasma — marcador semitransparente que segue o cursor no modo mover */
.marker-fantasma {
  opacity: .55;
  outline: 3px dashed var(--yellow);
  outline-offset: 3px;
  animation: pulso-fantasma .7s ease-in-out infinite alternate;
}
@keyframes pulso-fantasma {
  from { opacity:.4; }
  to   { opacity:.8; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE — tela < 768px ou dispositivo touch
   Sidebar some, mapa ocupa tela toda, modal vira bottom sheet
══════════════════════════════════════════════════════════════ */
body.is-mobile #sidebar        { display: none !important; }
body.is-mobile #map            { left: 0 !important; }

/* Fallback CSS puro: garante que sidebar nunca apareça em telas < 768px,
   independente da detecção JS funcionar ou não */
@media (max-width: 767px) {
  #sidebar      { display: none !important; }
  #map          { left: 0 !important; }
  #mobile-stats { display: flex !important; }
  #mobile-hint  { display: block !important; }
}

/* Stats flutuando no topo do mapa */
body.is-mobile #mobile-stats {
  display: flex !important;
}

/* Modal vira bottom sheet */
body.is-mobile #modal {
  top: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100% !important;
  border-radius: 20px 20px 0 0 !important;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s ease !important;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Context menus maiores para toque */
body.is-mobile #ctx-menu button,
body.is-mobile #ctx-marker button {
  padding: 14px 18px;
  font-size: 15px;
}
body.is-mobile #ctx-menu,
body.is-mobile #ctx-marker {
  min-width: 240px;
}

/* Handle do bottom sheet */
body.is-mobile #modal::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 4px;
}

/* Stats no topo do mapa (mobile) */
#mobile-stats {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(10,15,26,.85) 70%, transparent);
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
#mobile-stats .m-stat-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
}
#mobile-stats .m-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#mobile-stats .m-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 700; line-height: 1;
  color: var(--text);
}
#mobile-stats .m-stat-val.green { color: var(--green); }
#mobile-stats .m-stat-val.red   { color: var(--red);   }
#mobile-stats .m-stat-lbl {
  font-size: 8px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim);
}
#mobile-stats .m-sync {
  display: flex; align-items: center; gap: 5px;
  background: rgba(46,204,113,.12);
  border: 1px solid rgba(46,204,113,.3);
  border-radius: 20px; padding: 4px 10px;
  font-size: 10px; font-weight: 700; color: var(--green);
  pointer-events: auto;
}
#mobile-stats .m-sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: blink 1.4s ease infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* Hint mobile no fundo do mapa */
#mobile-hint {
  display: none;
  position: fixed;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(14,17,23,.8);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 11px; color: var(--text-dim);
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
body.is-mobile #mobile-hint { display: block; }

/* ── Botão localização (mobile only) ────────────────────────── */
#btn-localizacao {
  display: none;
  position: fixed;
  bottom: 56px; right: 16px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  z-index: 998;
  cursor: pointer;
  align-items: center; justify-content: center;
  transition: background .2s;
}
#btn-localizacao:active { background: var(--surface2); }
#btn-localizacao svg { display: block; }
body.is-mobile #btn-localizacao { display: flex; }
@media (max-width: 767px) { #btn-localizacao { display: flex; } }

#geo-msg {
  display: none;
  position: fixed;
  bottom: 116px; right: 16px;
  background: rgba(14,17,23,.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px; color: var(--text-dim);
  z-index: 998;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
