/* ═══════════════════════════════════════════════════════════════
   ROTIER CITIES — WebGIS / Mapa
   Usa tokens de design.css. Dark mode por padrão via [data-theme="dark"].
   ═══════════════════════════════════════════════════════════════ */

/* ── Variáveis do mapa ───────────────────────────────────────── */
:root {
  --mh-h:   52px;
  --sb-min: 52px;
  --sb-max: 220px;
  --glass-dark:  rgba(17, 24, 32, 0.92);
  --glass-light: rgba(255, 255, 255, 0.96);
}

/* ── Bootstrap vars: sincroniza com o tema ───────────────────── */
[data-theme="dark"] {
  --bs-body-color:        #e6edf3;
  --bs-body-bg:           #0b0f14;
  --bs-border-color:      #222d38;
  --bs-secondary-color:   #7b8a99;
  --bs-tertiary-color:    #5a6876;
  --bs-emphasis-color:    #e6edf3;
  --bs-secondary-bg:      #1d2830;
  --bs-tertiary-bg:       #222d38;
  --bs-form-valid-color:  #47a66d;
  --bs-form-invalid-color: #ef6b4b;
  color-scheme: dark;
}
[data-theme="light"] {
  --bs-body-color:        #1a1d1b;
  --bs-body-bg:           #f4f5f2;
  --bs-border-color:      #dcdeda;
  --bs-secondary-color:   #5c635d;
  --bs-emphasis-color:    #1a1d1b;
  --bs-secondary-bg:      #f7f8f5;
  --bs-tertiary-bg:       #f1f4ee;
  color-scheme: light;
}

/* Form controls respondem ao tema */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}
[data-theme="dark"] .form-control::placeholder { color: var(--muted-2) !important; }
[data-theme="dark"] .form-text,
[data-theme="dark"] .form-label { color: var(--muted) !important; }
[data-theme="dark"] .form-check-input {
  background-color: var(--surface-2) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .input-group-text {
  background-color: var(--surface-3) !important;
  border-color: var(--border) !important;
  color: var(--fg-2) !important;
}
[data-theme="dark"] .alert-light {
  background-color: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white { background-color: var(--surface) !important; }
[data-theme="dark"] .border { border-color: var(--border) !important; }
[data-theme="dark"] .text-dark { color: var(--fg) !important; }
[data-theme="dark"] .text-black-50 { color: var(--muted) !important; }
[data-theme="dark"] small { color: var(--muted); }

/* ── Reset do layout do mapa ─────────────────────────────────── */
body { overflow: hidden; padding-top: 0 !important; }

/* ── Map Header ──────────────────────────────────────────────── */
#map-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--mh-h);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--glass-dark);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
[data-theme="light"] #map-header {
  background: var(--glass-light);
  border-bottom-color: var(--border);
}

/* Esquerda */
.mh-left {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.mh-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.mh-brand img { height: 30px; width: auto; }
.mh-brand-name {
  font-family: var(--app-font);
  font-size: 14px; font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
  white-space: nowrap;
}

/* Ícone-botões */
.mh-icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-radius: var(--r-md);
  color: var(--fg-2); font-size: 15px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  flex-shrink: 0;
}
.mh-icon-btn:hover { background: rgba(255,255,255,.08); color: var(--fg); }
[data-theme="light"] .mh-icon-btn:hover { background: var(--surface-2); }

/* Busca */
.mh-search-wrap {
  flex: 1; min-width: 0; max-width: 460px;
}
.mh-search-inner {
  display: flex; align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  overflow: hidden; height: 34px;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.mh-search-inner:focus-within {
  border-color: var(--brand-500);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(94, 114, 87,.2);
}
[data-theme="light"] .mh-search-inner { background: var(--surface-2); }
[data-theme="light"] .mh-search-inner:focus-within {
  background: var(--surface); box-shadow: var(--sh-focus);
}
.mh-search-icon { padding: 0 10px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.mh-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--app-font); font-size: 13px; color: var(--fg);
  padding: 0; min-width: 0;
}
.mh-search-input::placeholder { color: var(--muted-2); }
.mh-search-type {
  background: rgba(255,255,255,.06);
  border: none; border-left: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--app-font-mono); font-size: 10px;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 0 8px; height: 100%; cursor: pointer; outline: none; flex-shrink: 0;
}
[data-theme="light"] .mh-search-type { background: var(--surface-3); color: var(--fg-2); }
.mh-search-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--brand-500); border: none; color: #fff;
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast);
}
.mh-search-btn:hover { background: var(--brand-600); }

/* Direita */
.mh-right {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0; margin-left: auto;
}

/* Usuário */
.mh-user-btn {
  display: flex; align-items: center; gap: 7px;
  background: transparent; border: none;
  border-radius: var(--r-md); padding: 4px 8px;
  cursor: pointer; color: var(--fg-2); font-size: 13px;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.mh-user-btn:hover, .mh-user-btn.show {
  background: rgba(255,255,255,.08); color: var(--fg);
}
[data-theme="light"] .mh-user-btn:hover { background: var(--surface-2); }
.mh-user-btn::after { display: none; }
.mh-avatar {
  width: 26px; height: 26px; background: var(--brand-500);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.mh-username {
  font-family: var(--app-font); font-size: 13px; color: var(--fg-2);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Dropdown */
.mh-dropdown {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important;
  padding: .4rem !important;
  box-shadow: var(--sh-xl) !important;
  margin-top: .4rem !important;
  min-width: 200px;
}
[data-theme="light"] .mh-dropdown { background: var(--surface) !important; }
.mh-dropdown .dropdown-item {
  font-size: .85rem; border-radius: var(--r-sm);
  padding: .45rem .75rem; color: var(--fg-2);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.mh-dropdown .dropdown-item:hover {
  background: rgba(255,255,255,.08); color: var(--fg);
}
[data-theme="light"] .mh-dropdown .dropdown-item:hover { background: var(--surface-2); }

/* Botão login */
.mh-login-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; background: var(--brand-500); color: #fff !important;
  border-radius: var(--r-full); font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.mh-login-btn:hover { background: var(--brand-600); transform: translateY(-1px); color: #fff !important; }

/* ── Sidebar rail (sempre visível) ───────────────────────────── */
#sidebar {
  position: fixed;
  top: var(--mh-h); left: 0; bottom: 0;
  width: var(--sb-min);
  background: var(--glass-dark);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  z-index: 2500;
  overflow: hidden;
  transition: width var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-slow) var(--ease-out);
  display: flex; flex-direction: column;
}
[data-theme="light"] #sidebar { background: var(--glass-light); }
#sidebar.expanded {
  width: var(--sb-max);
  box-shadow: 4px 0 24px rgba(0,0,0,.25);
}

/* Overlay (só para fechar ao clicar fora quando expandido) */
.map-sidebar-overlay {
  position: fixed; inset: 0; z-index: 1600;
  background: rgba(0,0,0,.35);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-slow), visibility var(--dur-slow);
}
.map-sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ── Cabeçalho da sidebar ────────────────────────────────────── */
#sidebar .sb-header {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  overflow: hidden; flex-shrink: 0;
  min-height: 50px;
}
#toggle-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  width: var(--sb-min); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 20px;
  transition: color var(--dur-fast);
}
#toggle-btn:hover { color: var(--fg); }
.sb-header-label {
  font-family: var(--app-font); font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
#sidebar.expanded .sb-header-label { opacity: 1; }

/* ── Nav ─────────────────────────────────────────────────────── */
.sidebar-nav { list-style: none; padding: 8px 0; margin: 0; flex: 1; overflow-y: auto; }
.sidebar-item { margin-bottom: 2px; }

.sidebar-link {
  display: flex; align-items: center;
  width: 100%; border: none; background: none;
  text-decoration: none; cursor: pointer;
  color: var(--fg-2);
  font-size: 13px; font-family: var(--app-font); font-weight: 500;
  white-space: nowrap; overflow: hidden;
  padding: 10px 0;
  transition: background var(--dur-fast), color var(--dur-fast);
  border-radius: 0;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,.07); color: var(--fg);
}
[data-theme="light"] .sidebar-link:hover { background: rgba(0,0,0,.05); }

/* Ícone: centralizado no trilho */
.sidebar-link .bi,
.sidebar-link .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
  width: var(--sb-min);
  text-align: center;
  color: var(--muted);
  transition: color var(--dur-fast);
}
.sidebar-link:hover .bi,
.sidebar-link:hover .material-symbols-outlined,
.sidebar-link.active .bi { color: var(--brand-400); }

/* Texto: invisível no estado colapsado, aparece ao expandir */
.sidebar-link span {
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}
#sidebar.expanded .sidebar-link span { opacity: 1; pointer-events: auto; }

/* ── Footer / usuário ────────────────────────────────────────── */
.sidebar-footer {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-dropdown {
  list-style: none; padding: 2px 0; margin: 0;
  overflow: hidden;
}
.sidebar-dropdown .sidebar-link { font-size: 12.5px; }

/* ── Map wrapper: sempre offset pelo trilho ──────────────────── */
#map-wrapper {
  position: fixed;
  top: var(--mh-h);
  left: var(--sb-min);
  right: 0; bottom: 0;
  transition: left var(--dur-slow) var(--ease-out);
}
#sidebar.expanded ~ #map-wrapper { left: var(--sb-max); }

#map { width: 100%; height: 100%; background: #0a1218; }
[data-theme="light"] #map { background: #e8e4d8; }

/* ── Toolbar flutuante ───────────────────────────────────────── */
#map-toolbar {
  position: absolute;
  top: 10px; right: 10px; z-index: 1500;
  display: flex; flex-direction: column;
  background: var(--glass-dark);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px; box-shadow: var(--sh-lg);
  gap: 1px;
  max-height: 600px; overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-out);
}
[data-theme="light"] #map-toolbar { background: var(--glass-light); }
#map-toolbar.collapsed { max-height: 42px; }
#map-toolbar.collapsed .map-toolbar-btn:not(#btn-toggle-toolbar),
#map-toolbar.collapsed .toolbar-sep {
  opacity: 0; pointer-events: none;
}
#map-toolbar hr { border: none; border-top: 1px solid var(--border); margin: 3px 4px; }

.map-toolbar-btn {
  width: 32px; height: 32px;
  background: transparent; border: none;
  border-radius: var(--r-sm); color: var(--fg-2);
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast); flex-shrink: 0;
}
.map-toolbar-btn:hover { background: rgba(255,255,255,.08); color: var(--fg); }
[data-theme="light"] .map-toolbar-btn:hover { background: var(--surface-2); color: var(--fg); }
.map-toolbar-btn.active { background: var(--tech-blue) !important; color: #fff !important; }
#btn-toggle-toolbar {
  border-bottom: 1px solid var(--border); margin-bottom: 3px; padding-bottom: 5px;
}
.toolbar-sep {
  height: 1px; background: var(--border); margin: 3px 4px;
}

/* ── Legenda flutuante ───────────────────────────────────────── */
#floating-legend {
  position: absolute;
  bottom: 28px; right: 10px;
  width: clamp(180px, 22vw, 260px);
  z-index: 1200;
  overflow: hidden;
  background: var(--glass-dark);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  max-height: 38px;
  transition: max-height var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-slow);
}
[data-theme="light"] #floating-legend { background: var(--glass-light); }
#floating-legend.expanded {
  max-height: 420px;
  box-shadow: var(--sh-xl);
}

.legend-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  user-select: none;
}
.legend-header:hover { background: rgba(255,255,255,.05); }
[data-theme="light"] .legend-header:hover { background: rgba(0,0,0,.03); }
#floating-legend.expanded .legend-header {
  border-bottom-color: var(--brand-500);
}

.legend-header-left {
  display: flex; align-items: center; gap: 7px;
}
.legend-header-icon {
  width: 22px; height: 22px;
  background: var(--brand-500);
  border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; flex-shrink: 0;
}
.legend-header-title {
  font-family: var(--app-font);
  font-size: 12px; font-weight: 600;
  color: var(--fg);
  letter-spacing: .01em;
}
.legend-chevron {
  color: var(--muted); font-size: 12px;
  transition: transform var(--dur-base) var(--ease-out);
}
#floating-legend.expanded .legend-chevron { transform: rotate(180deg); }

.legend-body {
  padding: 10px 10px 12px;
  overflow-y: auto;
  max-height: 380px;
  font-family: var(--app-font);
  font-size: 12px;
  color: var(--fg-2);
}

.legend-empty {
  text-align: center;
  padding: 16px 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.legend-group {
  margin-bottom: 10px;
}
.legend-group:last-child { margin-bottom: 0; }

.legend-group-title {
  font-family: var(--app-font-mono);
  font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
  padding: 0 2px 5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}

.legend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 2px;
  font-size: 11.5px; color: var(--fg-2);
}
.legend-swatch {
  width: 14px; height: 14px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.12);
}
[data-theme="light"] .legend-swatch { border-color: rgba(0,0,0,.1); }
.legend-layer-name { font-size: 11px; color: var(--muted); }

/* ── Leaflet popup ───────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--glass-dark) !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-lg) !important;
  color: var(--fg) !important; padding: 0 !important;
}
[data-theme="light"] .leaflet-popup-content-wrapper { background: var(--surface) !important; }
.leaflet-popup-content {
  margin: 0 !important; min-width: 260px !important; max-width: 420px !important;
  font-family: var(--app-font) !important; font-size: 13px !important;
  color: var(--fg) !important; padding: 14px 16px 12px !important;
}
.leaflet-popup-tip-container { display: none; }
.leaflet-popup-close-button {
  top: 8px !important; right: 10px !important;
  font-size: 20px !important; color: var(--muted) !important; font-weight: 400 !important;
}
.leaflet-popup-close-button:hover { color: var(--danger) !important; }
.leaflet-popup-content h3, .leaflet-popup-content h4 {
  font-size: 14px; font-weight: 600; margin: 0 0 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--fg) !important;
}
.leaflet-popup-content table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.leaflet-popup-content table th {
  background: rgba(255,255,255,.05); color: var(--muted);
  font-weight: 600; font-family: var(--app-font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.leaflet-popup-content table td {
  padding: 6px 8px; border-bottom: 1px solid var(--border-2);
  color: var(--fg-2); vertical-align: top;
}
.leaflet-popup-content table tr:last-child td { border-bottom: none; }
.leaflet-popup-content table td:first-child {
  font-weight: 600; color: var(--fg); width: 40%;
  font-family: var(--app-font-mono); font-size: 11px;
}
[data-theme="light"] .leaflet-popup-content table th { background: var(--surface-2); }

/* ── Controles Leaflet nativos ───────────────────────────────── */
.leaflet-control-zoom a, .leaflet-bar a {
  background-color: var(--glass-dark) !important;
  color: var(--fg-2) !important; border-color: var(--border) !important;
  font-size: 14px !important; backdrop-filter: blur(10px);
}
[data-theme="light"] .leaflet-control-zoom a,
[data-theme="light"] .leaflet-bar a { background-color: var(--glass-light) !important; }
.leaflet-control-zoom a:hover, .leaflet-bar a:hover {
  background-color: rgba(255,255,255,.1) !important; color: var(--fg) !important;
}
.leaflet-control-attribution {
  font-family: var(--app-font-mono) !important; font-size: 10px !important;
  background: rgba(17,24,32,.7) !important; color: var(--muted) !important;
  padding: 2px 6px !important; border-radius: var(--r-xs) !important;
}
[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,.85) !important; }

/* ── Text label no mapa ──────────────────────────────────────── */
.custom-text-label {
  background: transparent; border: none; box-shadow: none;
  font-family: var(--app-font); font-size: 13px; font-weight: 600; color: var(--fg);
  text-shadow: 1px 1px 3px rgba(0,0,0,.8), -1px -1px 3px rgba(0,0,0,.8);
  white-space: nowrap;
}

/* ── Sidebar de resultados (direita) ─────────────────────────── */
#sidebar-results {
  top: var(--mh-h) !important;
  height: calc(100% - var(--mh-h)) !important;
  background-color: var(--surface) !important;
  color: var(--fg) !important;
  box-shadow: -4px 0 24px rgba(0,0,0,.35) !important;
  border-left: 1px solid var(--border) !important;
}
#sidebar-results-close-btn {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  z-index: 10 !important;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-sm) !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  transition: background var(--dur-fast), color var(--dur-fast) !important;
}
#sidebar-results-close-btn:hover {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}
[data-theme="light"] #sidebar-results-close-btn {
  background: var(--surface-2) !important;
}
#sidebar-results h5,
#sidebar-results h6,
#sidebar-results label,
#sidebar-results p { color: var(--fg) !important; }
#sidebar-results .text-muted { color: var(--muted) !important; }
#sidebar-results .form-control,
#sidebar-results .form-select {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}
#sidebar-results .list-group-item {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}
#sidebar-results .card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
#sidebar-results .card-header {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
}

/* ── Modais: z-index acima do header + deslocamento ─────────── */
.modal        { z-index: 4000 !important; padding-top: var(--mh-h) !important; }
.modal-backdrop { z-index: 3900 !important; }
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: var(--sh-xl) !important;
}
.modal-header { border-bottom-color: var(--border) !important; }
.modal-footer { border-top-color: var(--border) !important; background: var(--surface-2) !important; }

/* ── BCI Side Panel ──────────────────────────────────────────── */
.bci-side-panel {
  position: fixed;
  top: var(--mh-h, 52px);
  right: 0;
  bottom: 0;
  width: 320px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  background: var(--glass-dark, rgba(17,24,32,.95));
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.35);
  transform: translateX(0);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
[data-theme="light"] .bci-side-panel {
  background: var(--glass-light, rgba(255,255,255,.97));
}
.bci-panel-hidden {
  transform: translateX(100%);
}
.bci-side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bci-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.bci-panel-close-btn {
  background: none;
  border: none;
  color: var(--fg-2);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm, 4px);
  line-height: 1;
  transition: background .15s, color .15s;
}
.bci-panel-close-btn:hover {
  background: rgba(255,255,255,.1);
  color: var(--fg);
}
[data-theme="light"] .bci-panel-close-btn:hover {
  background: var(--surface-2);
}
.bci-side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-size: .82rem;
  color: var(--fg);
}
.bci-panel-loading {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 8px 0;
}

/* Ajusta mapa quando o painel está aberto */
#map.bci-panel-open {
  right: 320px;
  transition: right .25s cubic-bezier(.4,0,.2,1);
}

@media (max-width: 600px) {
  .bci-side-panel { width: 100%; }
  #map.bci-panel-open { right: 0; }
}

/* ── Barra de busca expandida no header ─────────────────────── */
.mh-search-wide {
  flex: 1; min-width: 0; max-width: 600px;
}
.mh-search-wide .mh-search-type {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  min-width: 110px;
  padding: 0 10px;
}
@media (max-width: 768px) {
  .mh-search-wide { max-width: 320px; }
  .mh-search-wide .mh-search-type { min-width: 80px; font-size: 10px; }
}
@media (max-width: 480px) {
  .mh-search-wide .mh-search-type { display: none; }
}
.mh-brand-sep { opacity: .35; margin: 0 6px; font-weight: 300; }
