/* ============================================
   DESPACHANTE IMOBILIÁRIO — SISTEMA USUÁRIO
   Paleta: Navy #09235B | Carmine #C10054
   Responsivo: mobile-first, breakpoints 480/768/1024
============================================ */

:root {
  --navy:        #09235B;
  --royal:       #001A75;
  --blue-mid:    #094F95;
  --carmine:     #C10054;
  --orange:      #FF8500;
  --gray-user:   #D6DCE8;
  --gray-light:  #F4F5F6;
  --gray-border: #E3E5E8;
  --text:        #333333;

  /* Alturas fixas do layout */
  --header-h:    56px;   /* mobile: menor */
  --ctx-h:       76px;   /* context bar: title (36) + user (40) */
  --top-offset:  calc(var(--header-h) + var(--ctx-h));

  --font: 'Open Sans', sans-serif;
}

@media (min-width: 768px) {
  :root {
    --header-h: 73px;
    --ctx-h:    72px;  /* title e user lado a lado */
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--gray-light);
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ============================================
   TELA DE LOGIN
============================================ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.login-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #09235B 0%, #001A75 50%, #094F95 100%);
}

.login-card {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
}

@media (min-width: 480px) {
  .login-card { padding: 48px 40px; }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-title {
  font-size: 17px;
  color: var(--navy);
  line-height: 1.3;
}
.login-title strong { color: var(--carmine); }

.login-card h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 6px;
}

@media (min-width: 480px) {
  .login-card h2 { font-size: 22px; }
}

.login-sub {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 24px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #003365;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  transition: border-color .2s;
  /* evita zoom no iOS ao focar */
  font-size: max(16px, 1em);
}

.form-group input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(9,79,149,0.12);
}

.btn-primary {
  background: var(--royal);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary:hover  { background: #002299; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.full   { width: 100%; padding: 14px; }

.btn-outlined {
  background: white;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 35px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-outlined:hover  { background: var(--navy); color: white; }

.login-err {
  color: var(--carmine);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
  text-align: center;
}

/* ============================================
   LAYOUT PRINCIPAL
============================================ */
.app { min-height: 100vh; }

/* ─── Header ─────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 999;
}

@media (min-width: 768px) {
  .header { padding: 0 32px; }
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-box {
  width: 34px; height: 34px;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .logo-box { width: 38px; height: 38px; font-size: 14px; }
}

.header-logo span {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 480px) {
  .header-logo span { font-size: 15px; }
}

@media (min-width: 768px) {
  .header-logo span { font-size: 16px; }
}

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (min-width: 768px) {
  .header-nav { gap: 8px; }
}

.nav-link {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .nav-link { padding: 8px 20px; font-size: 14px; }
}

.nav-link:hover  { background: var(--gray-user); }
.nav-link.active { background: var(--navy); color: white; }

.nav-sair               { color: var(--carmine); border: 1.5px solid var(--carmine); }
.nav-sair:hover         { background: var(--carmine); color: white; }
.nav-sair.active        { background: var(--carmine); color: white; }

/* ─── Barra de contexto ──────────────────── */
.page-context-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 998;
}

.page-context-title {
  background: var(--navy);
  padding: 8px 16px;
}

@media (min-width: 768px) {
  .page-context-title { padding: 10px 32px; }
}

.page-context-title span {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .page-context-title span { font-size: 15px; }
}

.page-context-user {
  background: var(--gray-user);
  padding: 6px 16px;
  font-size: 12px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 32px;
}

@media (min-width: 768px) {
  .page-context-user { padding: 8px 32px; font-size: 13px; gap: 12px; }
}

.sep { color: #aaa; }

/* Esconde em telas muito pequenas (< 360px) */
@media (max-width: 359px) {
  .hide-xs { display: none !important; }
}

/* ─── Páginas ────────────────────────────── */
.page {
  padding-top: var(--top-offset);
  min-height: 100vh;
}

/* ============================================
   PÁGINA: BUSCA
============================================ */
.busca-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--top-offset));
}

/* Barra de pesquisa */
.search-bar-wrapper {
  padding: 10px 12px;
  background: white;
  border-bottom: 1px solid var(--gray-border);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .search-bar-wrapper { padding: 14px 32px; }
}

.search-bar {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-border);
  border-radius: 10px;
  background: white;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  max-width: 900px;
}

.search-bar:focus-within {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(9,79,149,0.10);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: max(16px, 0.95em); /* evita zoom iOS */
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  min-width: 0;
}

@media (min-width: 768px) {
  .search-bar input { padding: 13px 18px; }
}

.search-bar input::placeholder { color: #94a3b8; }

.search-divider {
  width: 1px;
  height: 22px;
  background: var(--gray-border);
  flex-shrink: 0;
}

.btn-search-icon,
.btn-location-icon {
  background: none;
  border: none;
  padding: 0 12px;
  cursor: pointer;
  color: var(--blue-mid);
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 46px;
  transition: color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .btn-search-icon,
  .btn-location-icon { padding: 0 16px; min-height: 50px; }
}

.btn-search-icon:hover   { color: var(--royal); background: #f0f4ff; }
.btn-location-icon:hover { color: var(--navy);  background: #f0f4ff; }

/* Mapa */
.map-wrapper {
  flex: 1;
  background: var(--gray-light);
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .map-wrapper { padding: 10px 24px 16px; }
}

.map-inner {
  flex: 1;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(9,35,91,0.13);
  border: 1.5px solid var(--gray-border);
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* Botão modo seleção */
.btn-select-mode {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--royal);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,26,117,.3);
  transition: background .2s;
  z-index: 1000;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (min-width: 768px) {
  .btn-select-mode { top: 16px; right: 16px; padding: 10px 16px; font-size: 13px; gap: 8px; }
}

.btn-select-mode:hover { background: var(--navy); }
.btn-select-mode.ativo { background: var(--carmine); }

.modo-selecao-badge {
  position: absolute;
  top: 52px;
  right: 12px;
  background: var(--carmine);
  color: white;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(193,0,84,.3);
  max-width: calc(100% - 24px);
}

@media (min-width: 768px) {
  .modo-selecao-badge { top: 60px; right: 16px; font-size: 13px; padding: 8px 14px; }
}

.modo-selecao-badge button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   PÁGINA: PEDIDOS
============================================ */
.pedidos-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 12px 24px;
}

@media (min-width: 480px) {
  .pedidos-container { padding: 20px 16px 28px; }
}

@media (min-width: 768px) {
  .pedidos-container { padding: 28px 32px; }
}

.pedidos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

@media (min-width: 768px) {
  .pedidos-header { margin-bottom: 24px; }
}

.pedidos-header h2 {
  font-size: 20px;
  font-weight: 500;
  color: #152F65;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .pedidos-header h2 { font-size: 27px; }
}

.btn-refresh {
  background: white;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .btn-refresh { padding: 8px 16px; font-size: 13px; gap: 6px; }
}

.btn-refresh:hover { border-color: var(--navy); background: #f0f4ff; }

.pedidos-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .pedidos-lista { gap: 10px; }
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: #94a3b8;
}

.empty-state p { margin-top: 12px; font-size: 15px; }

/* Pedido item */
.pedido-item {
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  overflow: hidden;
}

.pedido-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  gap: 10px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .pedido-row { padding: 16px 20px; gap: 16px; }
}

.pedido-row:hover { background: #fafbfc; }
.pedido-row:active { background: #f0f4ff; }

.pedido-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .pedido-num { font-size: 12px; }
}

@media (min-width: 768px) {
  .pedido-num { font-size: 13px; min-width: 120px; }
}

.pedido-data {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 480px) {
  .pedido-data { display: block; font-size: 12px; }
}

@media (min-width: 768px) {
  .pedido-data { font-size: 13px; min-width: 120px; }
}

.pedido-end {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (min-width: 768px) {
  .pedido-end { font-size: 14px; }
}

.pedido-status {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .pedido-status { padding: 4px 10px; font-size: 11px; }
}

@media (min-width: 768px) {
  .pedido-status { padding: 4px 12px; font-size: 12px; }
}

.status-recebido    { background: #f1f5f9; color: #64748b; }
.status-processando { background: #fef3c7; color: #d97706; }
.status-disponivel  {
  background: #dcfce7; color: #166534;
  cursor: pointer;
  text-decoration: underline;
}
.status-erro        { background: #fee2e2; color: #991b1b; }

.pedido-chevron {
  color: #94a3b8;
  transition: transform .2s;
  flex-shrink: 0;
}

.pedido-chevron.open { transform: rotate(180deg); }

/* Detalhe expandido */
.pedido-detalhe {
  display: none;
  border-top: 1px solid var(--gray-border);
  background: #fafbfc;
}

.pedido-detalhe.open { display: flex; }

/* Em mobile: empilhado. Em desktop: lado a lado */
@media (max-width: 767px) {
  .pedido-detalhe { flex-direction: column; }
}

.pedido-detalhe-left {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 768px) {
  .pedido-detalhe-left { padding: 24px; gap: 12px; }
}

.detalhe-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detalhe-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--navy);
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .detalhe-label { font-size: 11px; }
}

.detalhe-value {
  font-size: 13px;
  color: var(--text);
}

@media (min-width: 768px) {
  .detalhe-value { font-size: 14px; }
}

.pedido-detalhe-right {
  width: 100%;
  min-height: 160px;
  background: #e5e7eb;
  position: relative;
}

@media (min-width: 768px) {
  .pedido-detalhe-right { width: 320px; min-height: 200px; flex-shrink: 0; }
}

.pedido-map {
  width: 100%;
  height: 100%;
  min-height: 160px;
}

@media (min-width: 768px) {
  .pedido-map { min-height: 200px; }
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (min-width: 768px) {
  .btn-download { padding: 10px 18px; font-size: 13px; gap: 8px; }
}

.btn-download:hover { background: var(--royal); }

/* ============================================
   MODAL
============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10000;
  padding: 0;
}

@media (min-width: 480px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
}

.modal-card {
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 28px 20px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
  /* handle para arrastar no iOS */
  padding-top: 20px;
}

.modal-card::before {
  content: '';
  display: block;
  width: 40px; height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 0 auto 20px;
}

@media (min-width: 480px) {
  .modal-card {
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
  }
  .modal-card::before { display: none; }
}

.modal-icon {
  width: 60px; height: 60px;
  background: #eef2ff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}

@media (min-width: 768px) {
  .modal-icon { width: 64px; height: 64px; margin-bottom: 20px; }
}

.modal-icon.warning { background: #fff0f6; }

.modal-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .modal-card h3 { font-size: 20px; margin-bottom: 10px; }
}

.modal-card p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .modal-card p { font-size: 14px; margin-bottom: 28px; }
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   TOAST
============================================ */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 99999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideUp .3s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .toast { bottom: 24px; padding: 12px 24px; font-size: 14px; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   AJUSTES MAPLIBRE GL JS
============================================ */

/* Controle Mapa / Satélite */
.ctrl-camadas {
  display: flex !important;
  flex-direction: row !important;
  overflow: hidden;
}

.ctrl-camada-btn {
  background: white;
  border: none;
  border-right: 1px solid #ddd;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, color .15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .ctrl-camada-btn { padding: 7px 14px; font-size: 13px; }
}

.ctrl-camada-btn:last-child        { border-right: none; }
.ctrl-camada-btn.ativo             { background: var(--navy); color: white; }
.ctrl-camada-btn:hover:not(.ativo) { background: #f0f4ff; }

/* Coordenadas no mapa */
.coord-display {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 35, 91, 0.92);
  color: #ffffff;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 1000;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  display: none;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .coord-display { bottom: 16px; font-size: 12px; padding: 8px 16px; }
}

.coord-display.visivel { display: block; }
.coord-display:hover   { background: rgba(9, 35, 91, 1); }

/* Marcador mini-mapa */
.mini-map-marker {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #FFD700;
  border: 3px solid #09235B;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

@media (min-width: 768px) {
  .mini-map-marker { width: 16px; height: 16px; }
}

/* Popup perímetro Mogi Guaçu */
.maplibregl-popup.popup-mogi-guacu .maplibregl-popup-content {
  background: var(--navy);
  color: white;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  box-shadow: 0 2px 8px rgba(9,35,91,0.25);
}
.maplibregl-popup.popup-mogi-guacu .maplibregl-popup-tip        { border-top-color: var(--navy); }
.maplibregl-popup.popup-mogi-guacu .maplibregl-popup-close-button { display: none; }

/* Logo card login */
.logo-box-login {
  width: 40px; height: 40px;
  background: var(--navy);
  color: white;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .logo-box-login { width: 44px; height: 44px; font-size: 18px; }
}

/* Loading pedidos */
.loading-msg {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

/* Mapa mini pedidos */
.pedido-map {
  width: 100%;
  height: 160px;
  min-height: 160px;
  background: #e5e7eb;
}

@media (min-width: 768px) {
  .pedido-map { height: 200px; min-height: 200px; }
}

/* ============================================
   POPUP DO LOTE (LotesRenderer)
============================================ */
.lote-painel {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 28px rgba(9,35,91,0.20), 0 0 0 1px rgba(9,35,91,0.08);
  width: calc(100% - 20px);
  max-width: 320px;
  z-index: 1100;
  display: none;
  overflow: hidden;
  border-top: 4px solid #CC0000;
}

@media (min-width: 480px) {
  .lote-painel { bottom: 20px; max-width: 340px; }
}

.lote-painel.visivel { display: block; }

/* Cabeçalho com inscrição cadastral */
.lote-painel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--gray-border);
}

.lote-painel-header svg { flex-shrink: 0; }

.lote-insc-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lote-insc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.lote-insc-valor {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
}

/* Grade de campos */
.lote-campos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 10px 14px 12px;
}

.lote-campo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lote-campo-full {
  grid-column: 1 / -1;
}

.lote-campo-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
}

.lote-campo-valor {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

/* Área de botões */
.lote-painel-acoes {
  display: flex;
  gap: 8px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--gray-border);
  background: #fafbfc;
}

.lote-btn-cancelar,
.lote-btn-solicitar {
  flex: 1;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: center;
}

.lote-btn-cancelar {
  background: white;
  color: var(--navy);
  border: 1.5px solid var(--gray-border);
}

.lote-btn-cancelar:hover { border-color: var(--navy); background: #f0f4ff; }

.lote-btn-solicitar {
  background: var(--royal);
  color: white;
  border: none;
}

.lote-btn-solicitar:hover { background: var(--navy); }

/* Legado — mantido para não quebrar outros usos */
.lote-painel-body { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; }
.lote-painel-icon { flex-shrink: 0; margin-top: 2px; }
.lote-painel-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lote-painel-titulo { font-size: 13px; font-weight: 700; color: var(--navy); }
.lote-detalhe { font-size: 12px; color: #64748b; margin-top: 2px; }
.lote-detalhe strong { color: var(--text); }
.lote-btn-confirmar {
  background: #CC0000; color: white; border: none; border-radius: 8px;
  padding: 8px 18px; font-size: 12px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: background .2s;
}
.lote-btn-confirmar:hover    { background: #aa0000; }
.lote-btn-confirmar:disabled { opacity: 0.7; cursor: not-allowed; }

/* ============================================
   PEDIDOS — novos estilos
============================================ */

/* Número do pedido + botão copiar */
.pedido-num-col {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-copiar {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 3px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-copiar:hover { color: var(--navy); background: #f0f4ff; }

/* Inscrição cadastral na linha do pedido */
.pedido-insc {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (min-width: 768px) {
  .pedido-insc { font-size: 13px; }
}

/* Colunas extras visíveis apenas no desktop */
.pedido-col-desktop {
  display: none;
}

@media (min-width: 768px) {
  .pedido-col-desktop {
    display: block;
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

.pedido-uso,
.pedido-ocup {
  min-width: 80px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botão Ver no Mapa */
.btn-ver-mapa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (min-width: 768px) {
  .btn-ver-mapa { padding: 9px 16px; font-size: 13px; }
}

.btn-ver-mapa:hover { background: var(--royal); }

/* Área de ações no detalhe expandido */
.detalhe-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Novos badges de status */
.status-pendente {
  background: #fef9c3;
  color: #854d0e;
}

.status-em-andamento {
  background: #dbeafe;
  color: #1e40af;
}

.status-concluido {
  background: #dcfce7;
  color: #166534;
}

/* Logradouro no popup do lote */
.lote-logradouro {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 14px 6px;
  border-bottom: 1px solid var(--gray-border);
}

.lote-logradouro-valor {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nome da rua na linha do pedido (abaixo da inscrição) */
.pedido-insc-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pedido-rua {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .pedido-rua { font-size: 11px; }
}
