/* =========================================================
   MAPA: Leaflet, Popups, Layout Geral
========================================================= */

body.map-page {
  --header-h: 56px;
  --nav-w: 106px;
  --nav-h: 34px;
}

body.map-page .site-title {
  font-size: clamp(13px, 1.45vw, 18px);
}

body.map-page .ministry-brand {
  max-width: clamp(132px, 17vw, 220px);
  padding-left: 8px;
}

body.map-page .ministry-brand__name {
  font-size: clamp(8px, 0.85vw, 10px);
}

body.map-page .header-logos__divider {
  height: 30px;
}

body.map-page .partner-brand__logo-wrap {
  height: 34px;
}

body.map-page .partner-brand__logo {
  height: 28px;
  max-width: 96px;
}

body.map-page .nav-button,
body.map-page .dropbtn {
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Container do mapa (Leaflet) --- */
#map {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-height: 320px;
  background: #fff;
}

#map .leaflet-top    { top: 12px !important; }
#map .leaflet-left   { left: 12px !important; }
#map .leaflet-right  { right: 12px !important; }
#map .leaflet-bottom { bottom: 12px !important; }

@supports (padding: env(safe-area-inset-bottom)) {
  #map .leaflet-bottom {
    bottom: calc(env(safe-area-inset-bottom) + 12px) !important;
  }
}

.leaflet-container {
  background: #fff;
  font: 12px/1.4 "Rawline", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}


/* --- Popups totalmente opacos --- */
.leaflet-popup,
.leaflet-popup-pane,
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fff !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  backdrop-filter: none !important;
}

/* Conteúdo padrão de popup (município / players / coops / etc.) */
.municipio-popup {
  font: 14px/1.35 system-ui, Roboto, sans-serif;
}

.municipio-popup .popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.municipio-popup h4 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.popup-emoji-title {
  font-size: 20px;
  line-height: 1;
}

.municipio-popup .row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.municipio-popup .row:first-of-type {
  border-top: 0;
}

.municipio-popup .label {
  font-weight: 700;
  color: #111;
}

.municipio-popup .value {
  text-align: right;
  font-weight: 700;
  font-size: 15px;
}

.municipio-popup .unit {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: #6b7280;
}

/* --- Popups dos ESTADOS (state-popup) --- */
.leaflet-popup.state-popup .leaflet-popup-content-wrapper,
.leaflet-popup.state-popup .leaflet-popup-tip {
  background: #fff !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* --- Rótulos das UFs (tooltips permanentes) --- */
.leaflet-tooltip.state-label {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #24384f;
  font-family: "Rawline", system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

/* =========================================================
   Cartão "Amazônia Legal" (se usado)
========================================================= */

#al-card {
  margin-top: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  font: 14px/1.35 system-ui, Roboto, sans-serif;
}
#al-card .head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-weight: 700;
}
#al-card .tree {
  font-size: 18px;
}
#al-card .body {
  padding: 10px 12px 12px;
}
#al-card .krow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 6px 0;
}
#al-card .krow + .krow {
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}
#al-card .klabel {
  color: #111;
}
#al-card .kval {
  text-align: right;
  font-weight: 700;
}
#al-card .kunit {
  display: block;
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

/* =========================================================
   Layout Geral: Container, Sidebar, Filtros, KPIs
========================================================= */

/* Container geral do mapa e sidebar */
.map-container {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100dvh - var(--header-h, 64px));
  overflow: hidden;
}

/* Sidebar fixa à esquerda */
.sidebar {
  flex: 0 0 auto;
  width: 320px;
  min-width: 280px;
  max-width: 340px;
  padding: 10px;
  overflow-y: auto;
  transition:
    width .22s ease,
    min-width .22s ease,
    max-width .22s ease,
    padding .22s ease,
    opacity .18s ease,
    transform .22s ease;
}

body.map-page.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-8px);
}

.sidebar-toggle {
  position: absolute;
  top: 120px;
  left: 0;
  z-index: 950;
  width: 46px;
  min-width: 46px;
  min-height: 148px;
  padding: 14px 10px;
  border: none;
  border-radius: 0 14px 14px 0;
  background: rgba(255, 255, 255, 0.96);
  color: #1f2937;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.sidebar-toggle:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.sidebar-toggle-icon {
  font-size: 18px;
  line-height: 1;
}

.sidebar-toggle-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

body.map-page:not(.sidebar-collapsed) .sidebar-toggle .sidebar-toggle-label {
  display: none;
}

body.map-page:not(.sidebar-collapsed) .sidebar-toggle {
  top: 16px;
  left: 336px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 0 12px 12px 0;
}

.sidebar-content h4 {
  margin-top: 12px;
  color: #1f3a68;
  font-weight: 700;
}

/* Texto justificado (notas e lista de instruções) */
.panel-note,
.panel-note p,
.howto-list li {
  text-align: justify;
  text-justify: inter-word;
}

.panel-note {
  margin-top: 6px;
  color: #2b2b2b;
  font-size: .88rem;
  line-height: 1.32;
}

/* Bloco dos filtros (Espécie / Biomassa / Aplicar) */
.filters-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 8px auto 12px;
  padding: 14px 12px;
  border-radius: 12px;
  width: 100%;
  max-width: 300px;
  border: 1px solid #d0d8ea;
  background: #f4f7fc;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.filter-group {
  width: 100%;
  max-width: 300px;
}

.filter-group label {
  display: block;
  margin: 6px 0 6px;
  font-weight: 600;
  color: #1f3a68;
  font-size: 0.92rem;
}

.filters-box .control {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
}

/* Selects dentro do bloco de filtros */
.filters-box select.control {
  font-size: 15.5px;
  border: 1px solid #c0cbe5;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

/* Botão "Aplicar filtros" */
#apply-filters-btn.control {
  font-size: 15.5px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  transition: filter .12s ease;
  text-align: center;
}
#apply-filters-btn.control:hover {
  filter: brightness(1.05);
}
#apply-filters-btn.control:active {
  filter: brightness(.97);
}

/* Foco acessível */
.filters-box select.control:focus,
#apply-filters-btn.control:focus {
  outline: 3px solid rgba(59, 130, 246, .35);
  outline-offset: 1px;
}

/* KPIs ajustados ao tamanho da caixa de filtros */
.kpi-box {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fafbfc;
}
.kpi-title {
  font-size: .88rem;
  color: #4a4f58;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f3a68;
}

.kpi-narrow {
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
  border: 1px solid #d0d8ea;
  background: linear-gradient(135deg, #f4f7fc, #edf2ff);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}
/* Caixas de filtros e KPIs mais clean */
.filters-box {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7ff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

/* KPIs harmonizados com a caixa de filtros */
.kpi-box.kpi-narrow {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7ff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  padding: 10px 14px;
}

.kpi-title {
  font-size: 0.9rem;
  color: #374151;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

/* número + unidade lado a lado, sem aquele ::after antigo */
.kpi-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1f3a68;
}

.kpi-value::after {
  content: none;   /* desativa o " t/ano" automático antigo */
}

.kpi-unit {
  font-size: 0.8rem;
  color: #4b5563;
  font-weight: 500;
}

/* textinho da fonte dentro da caixinha do KPI */
.kpi-source {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
}

/* legenda geral lá embaixo do painel */
.sidebar-source-note {
  margin: 10px auto 4px;
  max-width: 300px;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: left;
}
.sidebar-source-note strong {
  color: #4b5563;
}

/* Lista de instruções (indicadores) */
.howto-list {
  padding-left: 16px;
  margin: 6px 0 0;
}
.panel-note .howto-list li {
  margin-bottom: 6px;
  line-height: 1.45;
}

/* Centralizar texto dos selects e dos KPIs */
.filters-box select.control {
  text-align: center;
  text-align-last: center;
}
.filters-box select.control option {
  text-align: center;
}
.kpi-box .kpi-title,
.kpi-box .kpi-value {
  text-align: center;
}

/* =========================================================
   Popups de Cooperativas / Players
========================================================= */

/* Lista de informações (dentro do popup) */
.coop-list {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  font: 14px/1.35 system-ui, Roboto, sans-serif;
}

.coop-list .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.coop-list .row:first-of-type {
  border-top: 0;
}

.coop-list .label {
  position: relative;
  font-weight: 700;
  color: #0b1225;
  padding-left: 18px;
}
.coop-list .label::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8800;
  box-shadow:
    0 0 0 2px #fff inset,
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

.coop-list .value {
  text-align: right;
  font-weight: 600;
  color: #111;
  display: grid;
  gap: 2px;
}
.coop-list .row.row-justify .value,
.coop-list .row:last-child .value,
.coop-list .row .value:has(br) {
  display: block;
  justify-self: stretch;
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.32;
  max-width: 310px;
  font-weight: 500;
}
.coop-list .row.row-justify {
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
}
.coop-list .value b {
  font-weight: 700;
  color: #334155;
}
.coop-list .value a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.25);
}
.coop-list .value a:hover {
  filter: brightness(1.05);
}

@media (max-width: 480px) {
  .coop-list .row {
    grid-template-columns: 1fr;
  }
  .coop-list .value {
    text-align: left;
  }
}

/* Ícone de cooperativas (Leaflet) */
.leaflet-marker-icon.coop-marker {
  will-change: transform;
}
.cnae-sec {
  text-align: left !important;
  display: block;
}

.cnae-sec ul {
  margin: 4px 0 0 0;
  padding-left: 18px;
  list-style-position: outside;
}

.cnae-sec li {
  text-align: left;
  line-height: 1.35;
  margin-bottom: 4px;
}
.cnae-sec ul {
  padding-left: 16px;
}

.cnae-sec li::marker {
  color: #ff8800;
}

/* Ícones de players (logos) */
.player-marker {
  width: 48px;
  height: 48px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  border: 2px solid #fff;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.player-marker:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.player-marker-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #333;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.player-popup-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  background: #007bff;
  color: #fff !important;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: background .2s, filter .2s;
}
.player-popup-btn:hover,
.player-popup-btn:focus {
  background: #0056b3;
  filter: brightness(1.05);
}
.player-popup-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}
.municipio-popup .popup-head img {
  max-height: 28px;
  width: auto;
}

@media (min-resolution: 2dppx) {
  .player-marker {
    width: 56px;
    height: 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .player-marker {
    transition: none;
  }
}
/* Controle de tamanho do popup */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.leaflet-popup-content {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Scroll bonito */
.leaflet-popup-content::-webkit-scrollbar {
  width: 6px;
}
.leaflet-popup-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
}


/* =========================================================
   Toolbar / Painel Direita antigo (se ainda usado)
========================================================= */

.map-toolbar-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.map-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-toolbar .tb-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.map-toolbar .tb-btn:hover {
  background: #f3f4f6;
}

/* Ícone "pilha" de camadas (toolbar antiga) */
.tb-icon-stack {
  display: block;
  width: 18px;
  height: 18px;
  position: relative;
}
.tb-icon-stack::before,
.tb-icon-stack::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  height: 8px;
  border-radius: 3px;
  border: 2px solid #111827;
  box-sizing: border-box;
  background: #ffffff;
}
.tb-icon-stack::before { top: 2px; }
.tb-icon-stack::after  { top: 8px; }

/* Painel lateral (toolbar antiga) */
.map-sidepanel {
  margin-top: 10px;
  width: 320px;
  max-height: 420px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.map-sidepanel.hidden {
  display: none;
}
.sidepanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0f172a;
  color: #f9fafb;
  font-weight: 600;
}
.sidepanel-header .sidepanel-close {
  border: none;
  background: transparent;
  color: #f9fafb;
  font-size: 18px;
  cursor: pointer;
}
.sidepanel-content {
  padding: 8px 12px 10px;
  max-height: 360px;
  overflow-y: auto;
}

/* =========================================================
   NOVO LAYOUT – Cards "Indicadores" / "Camadas"
========================================================= */

.sidebar-cards {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card genérico da sidebar */
.sidebar-card {
  width: 100%;
  max-width: 292px;
  margin: 10px auto 0;
  border-radius: 12px;
  border: 1px solid #d0d8ea;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.sidebar-card:hover {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

/* Cabeçalho do card */
.sidebar-card-header {
  width: 100%;
  padding: 7px 11px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  text-align: left;
  background: #2563eb;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.sidebar-card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-card-header-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.sidebar-card-chevron {
  font-size: 11px;
  opacity: 0.9;
}

/* Corpo do card */
.sidebar-card-body {
  padding: 7px 9px 9px;
  background: #ffffff;
  display: none;
}
.sidebar-card.is-open .sidebar-card-body {
  display: block;
}

/* Texto dentro do card de indicadores */
.sidebar-card-body .howto-list li {
  font-size: 0.84rem;
  color: #2b2b2b;
}

/* Grupos de camadas (labels + switches) */
.layer-group {
  margin-bottom: 8px;
}
.layer-group .lg-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #4a6da8;
  margin-bottom: 4px;
}
.layer-group .lg-body {
  border-radius: 8px;
  background: #f5f7fb;
  padding: 5px 6px;
}

/* Linha de camada */
.lg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  font-size: 0.9rem;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.lg-label {
  order: 1;
  color: #111827;
  flex: 1;
}
.lg-row input[type="checkbox"] {
  order: 2;
}

/* Checkbox estilo switch */
.lg-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lg-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
  transition: transform 0.15s ease;
}
.lg-row input[type="checkbox"]:checked {
  background: #22c55e;
}
.lg-row input[type="checkbox"]:checked::before {
  transform: translateX(14px);
}

/* Menos sombra no mobile */
@media (max-width: 640px) {
  .sidebar-card,
  .filters-box,
  .kpi-box.kpi-narrow {
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
  }
}

/* =========================================================
   Controle CAMADAS / LEGENDA (barra Leaflet direita)
========================================================= */


/* Ícone real de camadas (3 quadradinhos) */
.bm-icon-layers {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}
.bm-icon-layers::before,
.bm-icon-layers::after,
.bm-icon-layers span {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  border: 0;
  box-sizing: border-box;
  background: #475569;
  left: 2px;
}
.bm-icon-layers::before {
  top: 2px;
}
.bm-icon-layers::after {
  top: 7px;
}
.bm-icon-layers span {
  top: 12px;
}

/* Ícone de legenda (3 barras) */
.bm-icon-legend {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}
.bm-icon-legend::before,
.bm-icon-legend::after,
.bm-icon-legend span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
}
.bm-icon-legend::before {
  top: 2px;
  height: 2px;
  background:
    linear-gradient(#475569, #475569) 0 0 / 3px 3px no-repeat,
    linear-gradient(#475569, #475569) 6px 0 / 10px 2px no-repeat;
}
.bm-icon-legend::after {
  top: 7px;
  height: 2px;
  background:
    linear-gradient(#475569, #475569) 0 0 / 3px 3px no-repeat,
    linear-gradient(#475569, #475569) 6px 0 / 10px 2px no-repeat;
}
.bm-icon-legend span {
  top: 12px;
  height: 2px;
  background:
    linear-gradient(#475569, #475569) 0 0 / 3px 3px no-repeat,
    linear-gradient(#475569, #475569) 6px 0 / 10px 2px no-repeat;
}

/* =========================================================
   Painel lateral (direita) – Camadas / Legenda
========================================================= */

.bm-sidepanel {
  position: absolute;
  top: 80px;
  right: 10px;
  width: 320px;
  max-height: 420px;
  background: #ffffff;
  color: #1f2937;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: "Rawline", system-ui, sans-serif;
  border: 1px solid #d0d8ea;
}
.bm-sidepanel-hidden {
  display: none;
}

.bm-sidepanel-legend {
  position: fixed !important;
  top: auto !important;
  right: 16px !important;
  bottom: 24px !important;
  width: 288px;
  max-height: 300px;
}

.bm-map-hint {
  position: absolute;
  left: 18px;
  bottom: 54px;
  width: min(340px, calc(100% - 36px));
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(74, 109, 168, 0.14);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  color: #304860;
  font-family: "Rawline", system-ui, sans-serif;
  text-align: left;
  z-index: 950;
  pointer-events: auto;
}

.bm-map-hint-hidden {
  display: none;
}

.bm-map-hint-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #6b7d94;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.bm-map-hint-close:hover {
  background: rgba(191, 219, 254, 0.35);
  color: #2f64d6;
}

.bm-map-hint-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 118px;
  overflow-y: auto;
  padding: 1px 16px 0 1px;
}

.bm-map-hint-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.82);
  border-radius: 8px;
  padding: 6px 8px;
}

.bm-map-hint-text {
  font-size: 0.69rem;
  line-height: 1.16;
  color: #4a5f77;
  text-align: justify;
  text-justify: inter-word;
}

.bm-map-hint-text strong {
  color: #365ea8;
  font-weight: 700;
}

.bm-sidepanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
}
.bm-sidepanel-title {
  font-size: 0.9rem;
}
.bm-sidepanel-close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 17px;
  cursor: pointer;
}

.bm-sidepanel-body {
  padding: 7px 8px 8px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.78rem;
}

/* Grupos internos (Base / Outros / Legenda) */
.bm-group {
  margin-bottom: 10px;
}
.bm-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #4a6da8;
  margin-bottom: 4px;
}
.bm-group-body {
  border-radius: 8px;
  background: #f5f7fb;
  padding: 5px 6px;
}

/* Linhas (bases / overlays) */
.bm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #111827;
}
.bm-row:hover {
  background: #e5edf9;
}
.bm-row input {
  margin: 0;
}

.bm-row span {
  font-family: "Rawline", system-ui, sans-serif;
}

/* Legenda de cores */
.bm-legend-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bm-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bm-legend-color {
  width: 16px;
  height: 9px;
  border-radius: 3px;
  border: 1px solid rgba(31, 41, 55, 0.4);
}
.bm-legend-label {
  font-family: "Rawline", system-ui, sans-serif;
  font-size: 0.75rem;
  line-height: 1.2;
  color: #49596d;
}
.bm-legend-note {
  margin-top: 5px;
  font-family: "Rawline", system-ui, sans-serif;
  font-size: 0.72rem;
  line-height: 1.24;
  color: #64748b;
}

/* Responsivo – painel menor no mobile */
@media (max-width: 640px) {
  .bm-sidepanel {
    width: 260px;
    right: 6px;
  }
}
/* ============================================
   CONTROLES DO MAPA – VERSÃO FINAL (4 QUADRADOS)
============================================ */

/* posição dos controles na DIREITA do mapa */
#map .leaflet-top.leaflet-right {
  top: 16px;
  right: 14px;
}

/* tira “caixa” padrão do Leaflet atrás dos botões */
#map .leaflet-top.leaflet-right .leaflet-bar {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* estilo ÚNICO para todos os botões (zoom +/-, camadas, legenda) */
.leaflet-control-zoom a,
.bm-dock-control a.bm-btn,
.leaflet-draw-toolbar a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;

  background: #ffffff !important;
  border: 1px solid #d7dee8 !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14) !important;

  margin-bottom: 8px;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.leaflet-control-zoom a:hover,
.bm-dock-control a.bm-btn:hover,
.leaflet-draw-toolbar a:hover {
  background: #f8fbff !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18) !important;
  transform: translateY(-1px);
}

/* deixa o + e o – bem legíveis */
.leaflet-control-zoom a {
  font-size: 22px;
  line-height: 1;
  color: #334155 !important;
  font-weight: 700;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  text-indent: 0 !important;
}

/* garante que o dock (camadas/legenda) não crie moldura extra */
.leaflet-bar.bm-dock-control {
  background: transparent;
  border: none;
  box-shadow: none;
}

.leaflet-draw-toolbar a {
  border-radius: 10px !important;
}

.leaflet-control-container .leaflet-top.leaflet-right .leaflet-draw {
  margin-top: 8px;
}

.leaflet-control-container .leaflet-top.leaflet-right .leaflet-draw-toolbar {
  border: none;
  box-shadow: none;
}

.leaflet-control-container .leaflet-top.leaflet-right .leaflet-draw-toolbar a {
  margin-bottom: 8px;
}

.leaflet-control-container .leaflet-top.leaflet-right .leaflet-draw-toolbar a:last-child {
  margin-bottom: 0;
}

.leaflet-draw-actions {
  left: 50px;
}

.leaflet-draw-actions a {
  height: 32px;
  line-height: 32px;
  font-family: "Rawline", system-ui, sans-serif;
  font-size: 12px;
  border-radius: 8px;
}

.leaflet-draw-toolbar a.leaflet-draw-draw-polyline,
.leaflet-draw-toolbar a.leaflet-draw-edit-remove {
  background-image: none !important;
  text-indent: -9999px;
  overflow: hidden;
}

.leaflet-draw-toolbar a.leaflet-draw-draw-polyline::before,
.leaflet-draw-toolbar a.leaflet-draw-edit-remove::before {
  content: "";
  width: 16px;
  height: 16px;
  display: block;
  background-color: #475569;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.bm-dock-control a.bm-btn {
  color: #475569;
}

.leaflet-draw-toolbar a.leaflet-draw-draw-polyline::before {
  content: "↔";
  width: auto;
  height: auto;
  display: block;
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  color: #475569;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  text-indent: 0;
}


.measure-panel .mp-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.measure-panel .mp-body {
  line-height: 1.35;
}

.measure-panel .mp-body strong {
  color: #f9fafb;
}

.measure-panel .mp-empty {
  font-size: 0.76rem;
  color: #9ca3af;
}
.measure-popup {
  font-family: "Rawline", system-ui, sans-serif;
  font-size: 13px;
  padding: 6px;
}

.measure-popup .leaflet-popup-content-wrapper {
  background: #0f172a;
  color: #f9fafb;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  padding: 10px 14px;
}

.measure-popup .leaflet-popup-tip {
  background: #0f172a;
}

.info.legend {
  line-height: 16px;
  color: #111;
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.info.legend i {
  width: 18px;
  height: 12px;
  float: left;
  margin-right: 6px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.2);
}
.measure-panel {
  display: none !important;
}

/* neutraliza a caixa padrão do Leaflet para essa legenda */
.leaflet-control .info.legend {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Caixa principal da legenda de água */
.legend-firjan {
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
  font-family: "Rawline", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  max-width: 260px;
}

/* Título + subtítulo */
.lf-title-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
}
.lf-title {
  font-weight: 700;
  font-size: 13px;
  color: #1f2937;
}
.lf-subtitle {
  font-size: 11px;
  color: #6b7280;
}

/* Grupo de indicadores (radios) */
.lf-ind-group {
  margin-top: 4px;
  margin-bottom: 6px;
}
.lf-ind-label {
  font-weight: 600;
  font-size: 11px;
  color: #374151;
  margin-bottom: 4px;
}
.lf-ind-item {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  cursor: pointer;
}
.lf-ind-item input[type="radio"] {
  margin: 0 4px 0 0;
}
.lf-ind-item span {
  font-size: 11px;
  color: #111827;
}

/* Linha separadora */
.lf-separator {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 6px 0 6px;
}

/* Título da parte de cores */
.lf-leg-title {
  font-weight: 600;
  font-size: 11px;
  color: #111827;
  margin-bottom: 4px;
}

/* Lista de itens da legenda */
.lf-leg-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Cada item de cor */
.lf-item {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #111827;
}
.lf-item::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 4px;
  background: var(--c);
  border: 1px solid #cbd5e1;
}

/* leve ajuste em mobile */
@media (max-width: 768px) {
  .legend-firjan {
    font-size: 11px;
    max-width: 220px;
  }
}

.map-topbar::before {
  content: "Filtros do mapa";
  position: absolute;
  top: -18px;
  left: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


.map-topbar {
  position: absolute;
  top: calc(var(--header-h, 64px) + 8px);
  left: calc(50% + 160px);
  transform: translateX(-50%);
  z-index: 900;

  display: flex;
  flex-direction: column;
  gap: 4px;

  background: rgba(248, 250, 252, 0.94);
  border: 1px solid rgba(191, 219, 254, 0.95);
  padding: 7px 12px 8px;
  border-radius: 20px;
  backdrop-filter: blur(10px);

  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  width: min(720px, calc(100% - 580px));
  transition: left .22s ease, width .22s ease, transform .22s ease;
}

body.map-page.sidebar-collapsed .map-topbar {
  left: 50%;
  width: min(760px, calc(100% - 180px));
}

.topbar-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar-row-secondary {
  width: 100%;
  align-self: stretch;
  justify-content: flex-start;
}

.topbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: 100%;
}

.topbar-group-especies {
  align-items: flex-start;
  gap: 8px;
}

.topbar-group-lang {
  width: auto;
  gap: 6px;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-right: -6px;
  transform: translateX(34px);
}

.lang-chip {
  min-width: 40px;
  height: 32px;
  border: 1px solid #cfe0f7;
  background: #ffffff;
  color: #47607d;
  border-radius: 999px;
  font: 700 12px/1 "Rawline", system-ui, sans-serif;
  cursor: pointer;
  transition: all .15s ease;
}

.lang-chip.is-active {
  background: #2f64d6;
  border-color: #2f64d6;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(47, 100, 214, 0.18);
}

.topbar-group-biomassa {
  width: auto;
  gap: 8px;
  padding: 0;
  flex: 0 0 auto;
}

.topbar-note {
  margin: 0 0 0 8px;
  font-size: 10px;
  line-height: 1.25;
  color: #5b6472;
  flex: 1 1 auto;
  max-width: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-label {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar-label,
.map-topbar label {
  display: flex;
  align-items: center;
  min-height: 28px;
}


.chip {
  padding: 5px 11px;
  border-radius: 999px;

  background: #ffffff;
  border: 1px solid #dbe3ef;

  font-size: 10.5px;
  font-weight: 500;
  color: #374151;

  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.chip:hover {
  background: #f8fafc;
  border-color: #bfd4f8;
  transform: translateY(-1px);
}

.chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.chips-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  scroll-behavior: smooth;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;

  max-width: 100%;
  flex: 1 1 auto;
}
.chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chips-container::-webkit-scrollbar {
  height: 6px;
}
.chips-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}


/* 🔹 Padroniza labels do topo (Espécies / Biomassa) */
.map-topbar .topbar-label,
.map-topbar label {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.map-topbar label {
  font-weight: 600;
  opacity: 0.9;
}

#map .leaflet-top.leaflet-left {
  top: 16px !important;
}

#map .leaflet-top.leaflet-right {
  top: 16px !important;
}


.map-topbar select {
  height: 32px;
  min-width: 160px;
  padding: 0 12px;
  font-size: 11px;
  border-radius: 12px;
  border: 1px solid #d8e2f0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.topbar-group + .topbar-group {
  padding-left: 12px;
  border-left: 1px solid #dbeafe;
}

.topbar-row-secondary .topbar-group + .topbar-group,
.topbar-row-primary .topbar-group + .topbar-group {
  padding-left: 0;
  border-left: 0;
}

@media (max-width: 980px) {
  .bm-map-hint {
    left: 12px;
    bottom: 46px;
    width: calc(100% - 24px);
  }

  .bm-map-hint-body {
    max-height: 156px;
  }

  .map-topbar {
    left: 50%;
    width: min(640px, calc(100% - 44px));
    padding: 7px 10px 8px;
  }

  .topbar-group-especies {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar-label,
  .map-topbar label {
    min-height: auto;
  }

  .topbar-row-secondary {
    width: 100%;
    align-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .map-topbar select {
    min-width: 150px;
  }

  .topbar-note {
    margin-left: 0;
    max-width: none;
  }
}

@media (orientation: portrait) {
  body.map-page.kiosk-mode header.site-header {
    display: none;
  }

  body.map-page.kiosk-mode .main-content {
    padding-top: 0;
  }

  body.map-page.kiosk-mode .map-container {
    flex-direction: column;
    height: 100dvh;
  }

  body.map-page.kiosk-mode .sidebar {
    order: 2;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 32vh;
    padding: 8px 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  body.map-page.kiosk-mode.sidebar-collapsed .sidebar {
    max-height: 0;
    padding: 0;
    box-shadow: none;
    transform: translateY(8px);
  }

  body.map-page.kiosk-mode #map {
    order: 1;
    min-height: 68vh;
  }

  body.map-page.kiosk-mode .map-topbar {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: none;
    padding: 6px 10px 8px;
  }

  body.map-page.kiosk-mode .map-topbar::before,
  body.map-page.kiosk-mode .topbar-note,
  body.map-page.kiosk-mode .panel-note {
    display: none;
  }

  body.map-page.kiosk-mode .topbar-row,
  body.map-page.kiosk-mode .topbar-row-secondary {
    flex-wrap: wrap;
    gap: 8px;
  }

  body.map-page.kiosk-mode .topbar-group,
  body.map-page.kiosk-mode .topbar-group-especies,
  body.map-page.kiosk-mode .topbar-group-biomassa {
    width: 100%;
  }

  body.map-page.kiosk-mode .topbar-group-especies {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  body.map-page.kiosk-mode .topbar-group-lang {
    width: auto;
    margin-right: 0;
    transform: none;
    justify-content: flex-start;
  }

  body.map-page.kiosk-mode .chips-container {
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
    padding-bottom: 0;
  }

  body.map-page.kiosk-mode .chip,
  body.map-page.kiosk-mode .lang-chip,
  body.map-page.kiosk-mode .map-topbar select,
  body.map-page.kiosk-mode .sidebar-card-header,
  body.map-page.kiosk-mode .lg-row {
    font-size: 14px;
  }

  body.map-page.kiosk-mode .lang-chip,
  body.map-page.kiosk-mode .map-topbar select {
    height: 38px;
  }

  body.map-page.kiosk-mode .sidebar-card {
    max-width: none;
  }

  body.map-page.kiosk-mode .sidebar-card-body {
    max-height: none;
  }

  body.map-page.kiosk-mode .sidebar-toggle {
    top: 92px;
    left: 0;
  }

  body.map-page.kiosk-mode:not(.sidebar-collapsed) .sidebar-toggle {
    left: 0;
    top: calc(72vh + 14px);
  }

}

@media (orientation: portrait) and (min-width: 900px) and (min-height: 1600px) {
  body.map-page.kiosk-mode .map-container {
    height: 100dvh;
  }

  body.map-page.kiosk-mode #map {
    min-height: 72vh;
  }

  body.map-page.kiosk-mode .sidebar {
    max-height: 28vh;
    padding: 10px 12px 14px;
  }

  body.map-page.kiosk-mode .sidebar-toggle {
    width: 50px;
    min-width: 50px;
    min-height: 164px;
    height: 50px;
    font-size: 16px;
  }

  body.map-page.kiosk-mode:not(.sidebar-collapsed) .sidebar-toggle {
    width: 50px;
    min-width: 50px;
    min-height: 50px;
  }


  body.map-page.kiosk-mode .map-topbar {
    width: calc(100% - 72px);
    padding: 8px 12px 10px;
    border-radius: 22px;
  }

  body.map-page.kiosk-mode .topbar-label,
  body.map-page.kiosk-mode .map-topbar label {
    font-size: 12px;
  }

  body.map-page.kiosk-mode .chip {
    padding: 7px 13px;
    font-size: 13px;
  }

  body.map-page.kiosk-mode .lang-chip {
    min-width: 46px;
    height: 40px;
    font-size: 13px;
  }

  body.map-page.kiosk-mode .map-topbar select {
    min-width: 220px;
    height: 40px;
    font-size: 14px;
  }

  body.map-page.kiosk-mode .sidebar-card-header {
    padding: 10px 12px;
    font-size: 0.98rem;
  }

  body.map-page.kiosk-mode .sidebar-card-header-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  body.map-page.kiosk-mode .sidebar-card-body .howto-list li,
  body.map-page.kiosk-mode .lg-row,
  body.map-page.kiosk-mode .lg-title {
    font-size: 0.95rem;
  }

  body.map-page.kiosk-mode .lg-row {
    padding: 10px 10px;
  }

  body.map-page.kiosk-mode .lg-row input[type="checkbox"] {
    width: 42px;
    height: 24px;
  }

  body.map-page.kiosk-mode .lg-row input[type="checkbox"]::before {
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
  }

  body.map-page.kiosk-mode .lg-row input[type="checkbox"]:checked::before {
    transform: translateX(18px);
  }

  body.map-page.kiosk-mode #map .leaflet-top,
  body.map-page.kiosk-mode #map .leaflet-left,
  body.map-page.kiosk-mode #map .leaflet-right,
  body.map-page.kiosk-mode #map .leaflet-bottom {
    margin: 4px;
  }

  body.map-page.kiosk-mode .leaflet-control-zoom a,
  body.map-page.kiosk-mode .bm-dock-control a.bm-btn,
  body.map-page.kiosk-mode .leaflet-draw-toolbar a {
    width: 42px;
    height: 42px;
    line-height: 42px;
    font-size: 18px;
  }

  body.map-page.kiosk-mode .leaflet-tooltip.state-label {
    font-size: 16px;
  }

  body.map-page.kiosk-mode .leaflet-popup-content {
    max-height: 360px;
    font-size: 14px;
  }
}


.info-icon {
  margin-left: 6px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0.6;
}

.info-icon:hover {
  opacity: 1;
}

.info-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.info-popup.hidden {
  display: none;
}

.info-popup-content {
  background: #fff;
  padding: 14px 16px;
  border-radius: 8px;
  max-width: 360px;
  font-size: 13px;
}

.bm-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bm-info-icon {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.75;
}

.bm-info-icon:hover {
  opacity: 1;
}

/* 🔽 Força a legenda (map-sidepanel) a ficar embaixo à direita */
.map-sidepanel {
  position: absolute;
  right: 16px;
  bottom: 24px;

  margin-top: 0; /* remove o comportamento antigo */
}
.leaflet-top.leaflet-right .bm-sidepanel:not(.bm-sidepanel-legend) {
  position: fixed !important;
  top: auto !important;
  bottom: 24px !important;
  right: 16px !important;
}
/* Botãozinho "i" ao lado dos indicadores */ 
.lf-ind-item { 
display: flex; 
align-items: center; 
gap: 6px; 
} 
 
.lf-ind-item input[type="radio"] { 
margin-right: 6px; 
} 
 
.lf-ind-info-btn { 
border: none; 
background: #e5e7eb; 
color: #111827; 
font-size: 11px; 
font-weight: 700; 
width: 18px; 
height: 18px; 
border-radius: 999px; 
cursor: pointer; 
padding: 0; 
line-height: 18px; 
text-align: center; 
} 
 
.lf-ind-info-btn:hover { 
background: #d1d5db; 
} 
 
/* Popup de explicação dos indicadores */ 
.agua-ind-popup h4 { 
margin: 0 0 8px; 
font-size: 15px; 
font-weight: 700; 
} 
 
.agua-ind-popup p { 
margin: 4px 0; 
font-size: 13px; 
line-height: 1.4; 
} 
 
.agua-ind-popup ul { 
margin: 6px 0 0; 
padding-left: 20px; 
font-size: 13px; 
} 
 
.agua-ind-popup li { 
margin-bottom: 2px; 
} 

.agua-ind-header {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 6px;
}
 
.lf-ind-info {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  margin-left: 6px;
  padding: 2px 4px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.lf-ind-info:hover {
  opacity: 1;
  transform: scale(1.15);
}
/* Linha completa de cada indicador */
.lf-ind-item {
  display: flex;
  align-items: center;   /* centraliza verticalmente */
  gap: 6px;
  margin: 4px 0;
}

/* texto ocupa o espaço central */
.lf-ind-item span {
  flex: 1;
  line-height: 1.3;
}

/* garante alinhamento do radio */
.lf-ind-item input[type="radio"] {
  margin: 0;
}

/* Linha do indicador: radio + texto + lupa */
.legend-firjan .lf-ind-item {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

/* Radio coladinho à esquerda */
.legend-firjan .lf-ind-item input[type="radio"] {
  margin: 0 4px 0 0;
}

/* Texto ocupa o meio, pode quebrar em duas linhas */
.legend-firjan .lf-ind-item span {
  flex: 1;
  line-height: 1.3;
}

/* Botão da lupa */
.legend-firjan .lf-ind-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 13px;
  border-radius: 50%;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #0ea5e9;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.legend-firjan .lf-ind-info:hover {
  background: #eff6ff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}
/* título do grupo: NOME  🔎 💾 */
.lg-title {
  display: flex;
  align-items: center;
  gap: 6px;               /* espaço entre texto e ícones */
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #475569;
  margin-bottom: 4px;
}

.lg-title-text {
  white-space: nowrap;
}

/* container dos ícones do título */
.lg-title-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ícones 🔎 e 💾 – sem quadrado */
.lg-title-icon {
  border: none;
  background: none;
  box-shadow: none;
  outline: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.lg-title-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.muni-popup-rich .muni-filters {
  margin-bottom: 8px;
}

.muni-total-card {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.muni-total-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.muni-total-value {
  font-size: 18px;
  font-weight: 700;
}

.muni-total-value .unit {
  font-size: 12px;
  font-weight: 400;
  margin-left: 4px;
  color: #6b7280;
}

.muni-section-title {
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

.muni-table-wrapper {
  max-height: 160px;
  overflow-y: auto;
}

.muni-species-cards {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.muni-species-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 10px 12px;
}

.muni-species-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.muni-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.muni-table th,
.muni-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.muni-table th {
  text-align: left;
  background: #f3f4f6;
  position: sticky;
  top: 0;
}

.muni-table-num {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}

.muni-species-name {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}

.muni-species-total {
  text-align: right;
  min-width: 84px;
}

.muni-species-total-value {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  color: #0f172a;
}

.muni-species-total-unit {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}

.muni-origin-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #dbe4ee;
}

.muni-origin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.muni-origin-name {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.muni-origin-value {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}

/* lista de espécies dentro do popup do município */
.muni-especies-list {
  list-style: none;   /* remove o bullet padrão do navegador */
  margin: 0;
  padding-left: 0;
}

.muni-especies-list li {
  position: relative;
  padding-left: 16px;
  margin: 4px 0;
  font-size: 13px;       /* tamanho padrão */
  line-height: 1.4;
}

.muni-especies-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f97316; /* laranja CNAE */
}
.municipio-popup {
  font-size: 13px;
  line-height: 1.4;
}

.municipio-popup h4 {
  font-size: 14px;
  font-weight: 600;
}

.muni-total-label,
.muni-section-title,
.muni-block-title {
  font-size: 13px;
}
/* Fonte padrão do popup inteiro */
.municipio-popup {
  font-family: "Rawline", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

/* Garante que todos esses sigam o mesmo 13px */
.municipio-popup p,
.municipio-popup li,
.municipio-popup table,
.municipio-popup th,
.municipio-popup td,
.muni-total-label,
.muni-section-title,
.muni-block-title {
  font-size: 13px;
}

/* Título só um tiquinho maior */
.municipio-popup h4 {
  font-size: 14px;
  font-weight: 600;
}

/* Lista de espécies (já com a bolinha laranja) */
.muni-especies-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.muni-especies-list li {
  position: relative;
  padding-left: 16px;
  margin: 4px 0;
  font-size: 13px;        /* reforça o padrão */
  line-height: 1.4;
}

.muni-especies-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f97316; /* laranja CNAE */
}
.export-modal {
  background: #ffffff;
  width: 340px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.25);
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.export-modal-header {
  padding: 12px 16px;
  background: #2563eb;
  color: white;
  font-weight: 600;
}

.export-modal-body {
  padding: 12px 16px;
  max-height: 260px;
  overflow-y: auto;
}

.export-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 13px;
}

.export-confirm {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.export-confirm:hover {
  background: #2f73c2;
}
.lg-title-save {
  background-color: #368bdc;
  border-radius: 5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: none;
  cursor: pointer;
}

.lg-title-save:hover {
  background-color: #1e40af;
}

.group-info-popup {
  font-size: 13px;
  line-height: 1.5;
}

.group-info-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.group-info-popup p {
  margin: 0 0 8px;
}
