/* ==========================================================================
   CBMMG — OBSERVATÓRIO OPERACIONAL
   Design System Tático Aeroespacial • Glassmorphism AAA • WCAG 2.1 AA+
   Aceleração por GPU a 60/120 FPS • Easing com Física Suave
   ========================================================================== */

:root {
  /* Cores Estruturais de Fundo (Off-Blacks Ricos Táticos) */
  --bg-deep: #070a0f;
  --bg-surface: rgba(13, 19, 28, 0.82);
  --bg-surface-elevated: rgba(20, 29, 43, 0.72);
  --bg-surface-hover: rgba(28, 41, 60, 0.88);
  --bg-glass-card: rgba(16, 24, 36, 0.65);
  
  /* Bordas Translúcidas e Specular Highlights */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.13);
  --border-highlight: rgba(255, 255, 255, 0.22);
  --border-active: rgba(211, 47, 47, 0.55);
  --border-glow-red: rgba(211, 47, 47, 0.45);
  --border-glow-gold: rgba(255, 179, 0, 0.45);
  --border-glow-cyan: rgba(0, 229, 255, 0.45);
  
  /* Cores Institucionais e Táticas CBMMG */
  --cbmmg-red: #d32f2f;
  --cbmmg-red-bright: #ff334b;
  --cbmmg-red-glow: rgba(211, 47, 47, 0.45);
  --cbmmg-red-dark: #8b0000;
  
  --gold-accent: #ffb300;
  --gold-bright: #ffd54f;
  --gold-glow: rgba(255, 179, 0, 0.35);
  
  --cyan-telemetry: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.35);
  --blue-tactical: #1e88e5;
  --emerald-safe: #00e676;
  
  /* Tipografia & Fontes CBMMG / Governo de Minas Gerais */
  --font-sans: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-tactical: 'Rajdhani', 'Barlow', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Escala Oficial de Risco de Fogo (INPE v11 - 5 Classes) */
  --rf-minimo: #2e7d32;
  --rf-baixo: #7cb342;
  --rf-medio: #ffb300;
  --rf-alto: #ff6d00;
  --rf-critico: #ff1744;
  
  --alerta-verde: #00e676;
  --alerta-amarelo: #ffb300;
  --alerta-laranja: #ff6d00;
  --alerta-vermelho: #ff1744;
  
  /* Tipografia com Alto Contraste (WCAG 2.1 AA+ > 7:1) */
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Dimensões do Layout */
  --header-height: 60px;
  --sidebar-width: 440px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  /* Sombras & Efeitos de Vidro */
  --shadow-tactical: 0 10px 30px -5px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-elevated: 0 16px 40px -10px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --shadow-glow-red: 0 0 20px rgba(211, 47, 47, 0.4);
  --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.35);
  --glass-bg: rgba(11, 16, 25, 0.82);
  --glass-blur: blur(16px) saturate(180%);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  
  /* Curvas de Aceleração com Física Aeroespacial */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset Global & Otimização de Renderização */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Resumo prioritário para emprego rápido em telefone */
.mobile-quick-panel { display: none; }

/* Acessibilidade: Indicador de Foco Visível */
:focus-visible {
  outline: 2px solid var(--cyan-telemetry) !important;
  outline-offset: 2px !important;
}

/* ==========================================================================
   BARRA SUPERIOR (HEADER DE COMANDO TÁTICO)
   ========================================================================== */
.tactical-header {
  height: var(--header-height);
  width: 100vw;
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.96) 0%, rgba(10, 15, 24, 0.92) 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center; /* CENTRALIZADO NA TELA COMPLETA (100VW) */
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.header-tools-centered {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* EXACT DEAD CENTER DA TELA COMPLETA */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.header-tools-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  flex-shrink: 0;
}

.label-short {
  display: none;
}

.label-long {
  display: inline;
}

.tab-badge-focos {
  display: inline-block;
  font-size: 10px;
  background: rgba(255, 23, 68, 0.2);
  color: #ff5252;
  padding: 1px 6px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-top: 2px;
  border: 1px solid rgba(255, 23, 68, 0.35);
}

.insignia-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(255, 179, 0, 0.5);
}

.cbmmg-header-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 179, 0, 0.4));
}

.brand-titles h1 {
  font-family: var(--font-tactical);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.brand-titles h1 span {
  color: var(--gold-accent);
  text-shadow: 0 0 12px var(--gold-glow);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  font-weight: 500;
}

/* Pílulas de Telemetria e Conectividade */
.telemetry-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 26, 38, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.25s var(--ease-out);
}

.status-pill:hover {
  background: rgba(26, 38, 56, 0.85);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

.status-pill.status-pill-clickable {
  cursor: pointer;
  user-select: none;
}

.status-pill.status-pill-clickable:hover {
  border-color: var(--cbmmg-red-bright);
  box-shadow: 0 0 12px var(--cbmmg-red-glow);
  transform: translateY(-1px);
}

.status-pill.status-pill-clickable:active {
  transform: scale(0.97);
}

.status-pill.status-pill-clickable.active-filter {
  border-color: #00e676;
  background: rgba(0, 230, 118, 0.16);
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.4);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald-safe);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.8);
}

.status-indicator.pulse-red {
  background-color: var(--cbmmg-red-bright);
  box-shadow: 0 0 12px var(--cbmmg-red);
  animation: pulseGlow 1.8s infinite;
}

.status-indicator.pulse-gold {
  background-color: var(--gold-accent);
  box-shadow: 0 0 10px var(--gold-accent);
}

@keyframes pulseGlow {
  0% { transform: scale(0.92); opacity: 0.8; }
  50% { transform: scale(1.22); opacity: 1; box-shadow: 0 0 16px var(--cbmmg-red-bright); }
  100% { transform: scale(0.92); opacity: 0.8; }
}

/* Botões de Ação no Header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tactical {
  background: linear-gradient(180deg, rgba(28, 38, 54, 0.8) 0%, rgba(18, 26, 38, 0.8) 100%);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s var(--ease-out), background 0.18s, box-shadow 0.18s, border-color 0.18s;
  will-change: transform;
}

.btn-tactical:hover {
  background: rgba(36, 50, 72, 0.9);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.btn-tactical:active {
  transform: scale(0.98);
}

.btn-tactical.btn-primary {
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  border-color: rgba(255, 82, 82, 0.5);
  box-shadow: 0 0 16px var(--cbmmg-red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-tactical.btn-primary:hover {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  box-shadow: 0 0 24px rgba(229, 57, 53, 0.6);
  border-color: #ff5252;
}

/* ==========================================================================
   LAYOUT PRINCIPAL: SIDEBAR + MAPA
   ========================================================================== */
.main-layout {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* SIDEBAR TÁTICA (GLASSMORPHISM AAA) */
.tactical-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: linear-gradient(180deg, rgba(12, 17, 26, 0.94) 0%, rgba(8, 12, 18, 0.96) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 900;
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.65);
  margin-left: 0;
  transition: margin-left 0.32s var(--ease-out), box-shadow 0.32s;
  will-change: margin-left;
  position: relative;
}

.tactical-sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
  box-shadow: none;
  pointer-events: none;
}

/* ==========================================================================
   BLOCO INSTITUCIONAL MASTER CBMMG — CARD PERMANENTE
   O card COMPLETO (logo + título + descrição) fica sempre visível na tela,
   funcionando como um popup lateral que nunca sai — independente da sidebar.
   ========================================================================== */
.master-brand-dock {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 960;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  /* Sem transition de width — o card é sempre o mesmo */
}

.sidebar-dock-spacer {
  flex-shrink: 0;
  width: 100%;
  height: 0; /* Ajustado via JS/ResizeObserver */
}

.master-brand-card {
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, rgba(18, 27, 42, 0.98) 0%, rgba(10, 16, 26, 0.97) 100%);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-right: 1px solid var(--border-glass);
  border-bottom: 1px solid rgba(255, 179, 0, 0.28);
  box-shadow: 6px 0 36px rgba(0, 0, 0, 0.7), 0 4px 20px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.master-brand-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #d32f2f 0%, #ffb300 50%, #00e676 100%);
}

/* Botão toggle: sem text label, só ícone */
.sidebar-toggle-btn {
  position: relative;
  top: unset;
  left: unset;
  z-index: 1;
  background: rgba(18, 26, 38, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-tactical);
  transition: all 0.22s var(--ease-out);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--gold-accent);
  border-color: rgba(255, 179, 0, 0.5);
  transform: scale(1.06);
}

/* Esconde o label de texto — o ícone é auto-explicativo */
.toggle-btn-label {
  display: none !important;
}

/* Estado com sidebar recolhida: toggle fica dourado para indicar "abrir" */
.master-brand-dock.collapsed .sidebar-toggle-btn {
  color: var(--gold-accent);
  border-color: rgba(255, 179, 0, 0.5);
  background: rgba(20, 15, 5, 0.9);
}

/* Animação de pulso sutil no ícone do toggle quando recolhido */
@keyframes pulse-gold-btn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.35); }
  50%       { box-shadow: 0 0 0 5px rgba(255, 179, 0, 0); }
}


/* ==========================================================================
   CABEÇALHO INSTITUCIONAL MASTER CBMMG (SIDEBAR HEADER REDESENHADO)
   ========================================================================== */
.sidebar-brand-master {
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, rgba(20, 30, 46, 0.98) 0%, rgba(12, 18, 28, 0.96) 100%);
  border-bottom: 1px solid rgba(255, 179, 0, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand-master::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #d32f2f 0%, #ffb300 50%, #00e676 100%);
}

.master-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.master-insignia-wrapper {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: radial-gradient(circle, rgba(183, 28, 28, 0.95) 0%, rgba(10, 15, 24, 0.95) 100%);
  border-radius: 12px;
  border: 2px solid var(--gold-accent);
  box-shadow: 0 0 20px rgba(255, 179, 0, 0.35), inset 0 0 10px rgba(255, 23, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.master-insignia-wrapper:hover {
  transform: scale(1.06);
  box-shadow: 0 0 26px rgba(255, 179, 0, 0.55);
}

.master-cbmmg-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.master-titles {
  flex: 1;
  min-width: 0;
}

.master-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold-accent);
  margin-bottom: 2px;
}

.master-tag .tag-gold {
  display: flex;
  align-items: center;
  gap: 4px;
}

.master-tag .tag-sep {
  opacity: 0.5;
}

.master-tag .tag-sub {
  color: #ff5252;
  font-weight: 900;
}

.master-title {
  font-family: var(--font-tactical);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 23, 68, 0.25);
}

.master-subtitle {
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.master-desc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card de UC Selecionada (Substitui o antigo bloco de Região) */
.selected-uc-card {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.12) 0%, rgba(20, 28, 40, 0.96) 100%);
  border-bottom: 1px solid rgba(255, 179, 0, 0.35);
  position: relative;
  flex-shrink: 0;
  animation: fadeIn 0.3s ease;
}

.selected-uc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.selected-uc-badge {
  font-size: 11px;
  color: var(--gold-accent);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-deselect-uc {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-deselect-uc:hover {
  background: rgba(255, 23, 68, 0.2);
  border-color: #ff5252;
  color: #ffffff;
}

.selected-uc-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  word-break: break-word;
}

.selected-uc-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.35;
  word-break: break-word;
}

/* Navegação por Abas (Cockpit Aeroespacial) */
.sidebar-tabs {
  display: flex;
  background: rgba(8, 12, 18, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 8px 0;
  gap: 4px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s var(--ease-out);
  position: relative;
}

.tab-btn i {
  font-size: 14px;
  transition: transform 0.2s var(--ease-out);
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn:hover i {
  transform: translateY(-1px);
}

.tab-btn.active {
  color: #ffffff;
  border-bottom-color: var(--gold-accent);
  background: linear-gradient(180deg, rgba(255, 179, 0, 0.12) 0%, rgba(255, 179, 0, 0.02) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  box-shadow: inset 0 -2px 10px rgba(255, 179, 0, 0.25);
}

.tab-btn.active i {
  color: var(--gold-accent);
  text-shadow: 0 0 10px var(--gold-glow);
}

/* Estilo dedicado quando a Aba 4 (Focos Satélites) estiver ativa */
.tab-btn[data-tab="tabFocos"].active {
  border-bottom-color: var(--cbmmg-red);
  background: linear-gradient(180deg, rgba(211, 47, 47, 0.16) 0%, rgba(211, 47, 47, 0.02) 100%);
  box-shadow: inset 0 -2px 12px rgba(211, 47, 47, 0.35);
}

.tab-btn[data-tab="tabFocos"].active i {
  color: var(--cbmmg-red-bright);
  text-shadow: 0 0 10px var(--cbmmg-red-glow);
}

/* Conteúdo das Abas com Animação Fluida de Entrada */
@keyframes tabContentReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: none;
}

.sidebar-tab-content.active {
  display: block;
  animation: tabContentReveal 0.24s var(--ease-out) both;
  will-change: transform, opacity;
}

/* RODAPÉ INSTITUCIONAL DE CRÉDITOS DA SIDEBAR */
.sidebar-credits-footer {
  padding: 10px 14px;
  background: rgba(10, 15, 23, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: none;
}

.credits-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold-accent);
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.credits-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.credit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  line-height: 1.3;
}

.credit-item .credit-name {
  color: #e2e8f0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.credit-item .credit-bm {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #ff8a80;
  background: rgba(255, 82, 82, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 82, 82, 0.2);
}

/* ==========================================================================
   ELEMENTOS DE BUSCA & FILTROS (INPUTS TÁTICOS)
   ========================================================================== */
.search-filter-box {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-search-wrapper {
  position: relative;
  width: 100%;
}

.input-search-wrapper input {
  width: 100%;
  background: rgba(10, 15, 23, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 36px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-search-wrapper input:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.input-search-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.select-filter-bbm {
  width: 100%;
  background: rgba(10, 15, 23, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.select-filter-bbm:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.25);
}

/* ==========================================================================
   CARDS DE ALERTA DE FOCOS EM UCs (TAB 1)
   ========================================================================== */
.alert-card-hotspot {
  background: linear-gradient(135deg, rgba(183, 28, 28, 0.2) 0%, rgba(136, 14, 79, 0.12) 100%);
  border: 1px solid rgba(211, 47, 47, 0.5);
  border-left: 4px solid var(--cbmmg-red);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s, border-color 0.22s;
  will-change: transform;
}

.alert-card-hotspot:hover {
  background: linear-gradient(135deg, rgba(211, 47, 47, 0.28) 0%, rgba(183, 28, 28, 0.18) 100%);
  transform: translateY(-2px);
  border-color: #ff334b;
  box-shadow: 0 8px 24px rgba(211, 47, 47, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.alert-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.badge-focos-count {
  background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

.alert-details {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.alert-details strong {
  color: #ffffff;
}

.alert-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--gold-accent);
  font-weight: 700;
}

/* Listagem Geral de UCs */
.uc-list-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.uc-list-item:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
}

.uc-info-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.uc-info-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   PAINEL DE RISCO DE FOGO (INPE) & METEOROLOGIA (TAB 2)
   ========================================================================== */
.rf-summary-card {
  background: linear-gradient(180deg, rgba(22, 32, 46, 0.8) 0%, rgba(14, 20, 30, 0.8) 100%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow-tactical);
}

.rf-gauge-container {
  margin: 10px auto;
  position: relative;
  width: 160px;
  height: 95px;
}

.rf-value-display {
  font-family: var(--font-tactical);
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}

.rf-badge-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.rf-formula-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: 6px;
  margin-top: 14px;
  background: rgba(8, 12, 18, 0.75);
  border: 1px solid var(--border-subtle);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.formula-chip {
  text-align: center;
}

.formula-chip .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.formula-chip .val {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan-telemetry);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Grade de Previsão 5 Dias */
.forecast-mini-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.forecast-mini-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.2s var(--ease-out);
}

.forecast-mini-card.card-historico {
  background: rgba(30, 136, 229, 0.08);
  border: 1px solid rgba(30, 136, 229, 0.35);
  border-left: 4px solid #1e88e5;
}

.forecast-mini-card.card-hoje {
  background: rgba(255, 179, 0, 0.12);
  border: 1px solid rgba(255, 179, 0, 0.55);
  border-left: 4px solid #ffb300;
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.22);
}

.forecast-mini-card.card-previsao {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-left: 4px solid #00e5ff;
}

.badge-tipo-dia {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.badge-tipo-dia.badge-historico {
  background: #1e88e5;
  color: #ffffff;
}

.badge-tipo-dia.badge-hoje {
  background: #ffb300;
  color: #070a0f;
  font-weight: 900;
}

.badge-tipo-dia.badge-previsao {
  background: #00e5ff;
  color: #070a0f;
  font-weight: 900;
}

.forecast-mini-day {
  display: flex;
  flex-direction: column;
  min-width: 105px;
  flex-shrink: 0;
  white-space: nowrap;
}

.forecast-mini-day .name {
  font-size: 13px;
  font-weight: 800;
}

.forecast-mini-day .date {
  font-size: 10.5px;
  color: var(--text-muted);
}

.forecast-mini-metrics {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  min-width: 0;
  line-height: 1.25;
  padding: 0 2px;
}

.forecast-mini-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.forecast-mini-card > div:last-child {
  min-width: 46px;
  text-align: right;
  justify-self: end;
}

/* ==========================================================================
   PAINEL DE OCORRÊNCIAS & DROPZONE CAD (TAB 3)
   ========================================================================== */
.dropzone-container {
  border: 2px dashed rgba(255, 179, 0, 0.4);
  background: rgba(255, 179, 0, 0.03);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  margin-bottom: 16px;
}

.dropzone-container:hover, .dropzone-container.dragover {
  border-color: var(--gold-accent);
  background: rgba(255, 179, 0, 0.08);
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.2);
  transform: translateY(-1px);
}

.dropzone-icon {
  font-size: 28px;
  color: var(--gold-accent);
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-box-wrapper {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 220px;
  margin-bottom: 14px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   SELETOR DE INTERVALO TEMPORAL (7d, 30d, 90d, 180d, 1y, Período)
   ========================================================================== */
.period-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(8, 12, 18, 0.85);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-period-pill {
  flex: 1 1 auto;
  min-width: 48px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-tactical);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s var(--ease-out);
  will-change: transform;
}

.btn-period-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.btn-period-pill:active {
  transform: scale(0.96);
}

.btn-period-pill.active {
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  color: #ffffff;
  border-color: #ff5252;
  box-shadow: 0 2px 10px rgba(211, 47, 47, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 800;
}

.input-tactical-date {
  width: 100%;
  background: rgba(10, 15, 23, 0.9);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 8px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-tactical-date:focus {
  border-color: var(--cbmmg-red);
  box-shadow: 0 0 10px rgba(211, 47, 47, 0.4);
}

/* ==========================================================================
   CARDS DE FOCOS AGLOMERADOS POR BATALHÃO (TAB 4)
   ========================================================================== */
.bbm-cluster-card {
  background: linear-gradient(135deg, rgba(22, 31, 45, 0.75) 0%, rgba(14, 20, 30, 0.75) 100%);
  border: 1px solid var(--border-glass);
  border-left: 3.5px solid var(--cbmmg-red);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  cursor: pointer;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s, border-color 0.22s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.35);
  will-change: transform;
}

.bbm-cluster-card:hover {
  background: linear-gradient(135deg, rgba(28, 40, 58, 0.88) 0%, rgba(18, 26, 38, 0.88) 100%);
  border-color: rgba(255, 51, 75, 0.4);
  border-left-color: #ff334b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(211, 47, 47, 0.25);
  transform: translateY(-2px);
}

.bbm-cluster-card:active {
  transform: scale(0.985);
}

.bbm-cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bbm-cluster-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-tactical);
  letter-spacing: 0.4px;
}

.bbm-cluster-badge {
  font-size: 12px;
  font-weight: 800;
  color: #ff5252;
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid rgba(255, 23, 68, 0.4);
  padding: 2px 8px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bbm-cluster-ucs {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bbm-cluster-ucs strong {
  color: var(--gold-accent);
}

.bbm-cluster-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 11.5px;
  color: var(--cyan-telemetry);
  font-weight: 700;
  margin-top: 2px;
  gap: 4px;
  transition: transform 0.2s;
}

.bbm-cluster-card:hover .bbm-cluster-footer {
  transform: translateX(2px);
}

/* ==========================================================================
   POP-UP LATERAL (DRAWER DE FOCOS DO BATALHÃO)
   ========================================================================== */
.hotspots-lateral-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 95vw;
  background: linear-gradient(180deg, rgba(12, 18, 27, 0.96) 0%, rgba(8, 12, 19, 0.98) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-left: 1px solid var(--border-glass);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.8), inset 1px 0 0 rgba(255, 255, 255, 0.06);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease-out);
  will-change: transform;
}

.hotspots-lateral-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 14px 16px;
  background: rgba(14, 20, 30, 0.8);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-badge-unit {
  display: inline-block;
  font-family: var(--font-tactical);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--cbmmg-red-bright);
  background: rgba(211, 47, 47, 0.18);
  border: 1px solid rgba(211, 47, 47, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.drawer-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  font-family: var(--font-tactical);
  letter-spacing: 0.6px;
}

.drawer-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}

.drawer-close-btn:hover {
  background: rgba(255, 23, 68, 0.25);
  color: #ff5252;
  border-color: #ff5252;
  transform: scale(1.05);
}

.drawer-close-btn:active {
  transform: scale(0.95);
}

.drawer-filter-chips {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.drawer-chip {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 14px;
  background: rgba(20, 28, 40, 0.75);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}

.drawer-chip:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(28, 40, 58, 0.85);
}

.drawer-chip:active {
  transform: scale(0.96);
}

.drawer-chip.active {
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  color: #ffffff;
  border-color: #ff5252;
  box-shadow: 0 0 10px rgba(211, 47, 47, 0.4);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Card Individual de Foco no Drawer */
.drawer-foco-card {
  background: rgba(18, 26, 38, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: transform 0.2s var(--ease-out), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 3px 10px rgba(0, 0, 0, 0.35);
  will-change: transform;
}

.drawer-foco-card:hover {
  background: rgba(26, 38, 56, 0.85);
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.drawer-foco-card.em-uc {
  border-left: 4px solid #ff1744;
}

.drawer-foco-card.fora-uc {
  border-left: 4px solid #ff9100;
}

.drawer-foco-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-foco-date {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-mono);
  letter-spacing: 0.2px;
}

.drawer-foco-sat {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan-telemetry);
  background: rgba(0, 229, 255, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.drawer-foco-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.drawer-foco-frp {
  font-weight: 800;
  color: #ff9100;
  font-variant-numeric: tabular-nums;
}

.drawer-foco-frp.high {
  color: #ff1744;
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.4);
}

.drawer-foco-local {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-locate-hotspot {
  margin-top: 4px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12) 0%, rgba(0, 180, 216, 0.06) 100%);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--cyan-telemetry);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s var(--ease-out);
  will-change: transform;
}

.btn-locate-hotspot:hover {
  background: var(--cyan-telemetry);
  color: #070a0f;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.5);
  font-weight: 800;
  transform: translateY(-1px);
}

.btn-locate-hotspot:active {
  transform: scale(0.98);
}

/* ==========================================================================
   MAPA EM TELA CHEIA (LEAFLET CONTAINER) & HUDS FLUTUANTES
   ========================================================================== */
.map-viewport {
  flex: 1;
  height: calc(100vh - var(--header-height));
  position: relative;
  background: #070a0f;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 100;
}

/* Referência fixa para a seleção municipal na aba de risco. */
.risk-map-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  z-index: 720;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity .16s ease;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, .9));
}

.risk-map-crosshair.active { opacity: 1; }
.risk-map-crosshair::before,
.risk-map-crosshair::after {
  content: '';
  position: absolute;
  background: #00e5ff;
  box-shadow: 0 0 5px rgba(0, 229, 255, .8);
}
.risk-map-crosshair::before { width: 28px; height: 2px; left: 0; top: 13px; }
.risk-map-crosshair::after { width: 2px; height: 28px; left: 13px; top: 0; }
.risk-map-crosshair span {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 18, 28, .85);
}

/* HUD Superior Direito: Seletor de Camadas e Telemetria */
.map-hud-top-right {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.32s var(--ease-out);
  will-change: transform;
}

body.drawer-open .map-hud-top-right {
  transform: translateX(-450px);
}

/* ==========================================================================
   PAINEL TELEMETRIA COLAPSÁVEL — LATERAL DIREITA (Cockpit Tático)
   ========================================================================== */
.telemetry-side-panel {
  position: absolute;
  top: 72px;
  right: 0;
  z-index: 850;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  transform: translateX(0);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.telemetry-side-panel.collapsed {
  transform: translateX(calc(100% - 32px));
}

/* Aba de puxar — fica sempre visível na borda direita quando colapsado */
.telemetry-side-tab {
  width: 32px;
  flex-shrink: 0;
  background: rgba(14, 20, 30, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--cyan-telemetry);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.6), inset 1px 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.22s var(--ease-out);
}

.telemetry-side-tab:hover {
  background: rgba(0, 229, 255, 0.12);
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.4);
  transform: scale(1.03);
}

.telemetry-side-panel:not(.collapsed) .telemetry-side-tab {
  background: rgba(20, 28, 42, 0.98);
  color: var(--gold-accent);
  border-color: rgba(255, 179, 0, 0.4);
}

.telemetry-tab-label {
  font-family: var(--font-tactical);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: var(--text-secondary);
}

.telemetry-side-panel:not(.collapsed) .telemetry-tab-label {
  color: var(--gold-accent);
}

/* Corpo do painel */
.telemetry-side-body {
  width: 230px;
  background: linear-gradient(180deg, rgba(14, 20, 30, 0.96) 0%, rgba(8, 12, 18, 0.98) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-glass);
  border-right: none;
  border-radius: 0 0 0 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.telemetry-side-header {
  font-family: var(--font-tactical);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold-accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-coords-row {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--cyan-telemetry);
  letter-spacing: 0.5px;
  background: rgba(0, 229, 255, 0.06);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.telemetry-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

.telemetry-row {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.telemetry-row.muted {
  font-size: 11.5px;
  color: var(--text-secondary);
}


.hud-panel {
  background: rgba(10, 15, 23, 0.84);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-tactical);
}

.layer-switcher {
  display: flex;
  gap: 4px;
}

.btn-layer {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), background 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  will-change: transform;
}

.btn-layer:hover {
  background: var(--bg-surface-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-layer:active {
  transform: scale(0.97);
}

.btn-layer.active {
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  color: #ffffff;
  border-color: #42a5f5;
  box-shadow: 0 0 12px rgba(30, 136, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#btnToggleCbmmgUnits.active {
  background: linear-gradient(135deg, rgba(211, 47, 47, 0.25) 0%, rgba(183, 28, 28, 0.15) 100%);
  border: 1px solid rgba(211, 47, 47, 0.6);
  box-shadow: 0 0 10px rgba(211, 47, 47, 0.35);
  color: #ffffff;
}

.btn-layer.btn-filter-ucs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(0, 230, 118, 0.35);
  background: rgba(0, 230, 118, 0.08);
  color: #a7f3d0;
}

.btn-layer.btn-filter-ucs:hover {
  background: rgba(0, 230, 118, 0.18);
  border-color: #00e676;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
}

.btn-layer.btn-filter-ucs.active {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.28) 0%, rgba(0, 200, 83, 0.18) 100%);
  border-color: #00e676;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.badge-ucs-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 230, 118, 0.22);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.btn-layer.btn-filter-ucs.active .badge-ucs-count {
  background: #00e676;
  color: #070a0f;
  font-weight: 900;
}

/* HUD Inferior Direito: Legenda Oficial INPE */
.legend-hud {
  position: absolute;
  bottom: 24px;
  right: 14px;
  z-index: 800;
  background: rgba(10, 15, 23, 0.86);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 12px;
  box-shadow: var(--shadow-tactical);
}

.legend-title {
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.legend-scale-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 11.5px;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   MARCADORES DAS UNIDADES E QUARTÉIS CBMMG (BBM, CIA, PEL, PA)
   ========================================================================== */
.marker-cbmmg-bbm, .marker-cbmmg-cia, .marker-cbmmg-pel, .marker-cbmmg-pa {
  background: transparent;
  border: none;
}

.cbmmg-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
  position: relative;
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s ease;
  cursor: pointer;
  will-change: transform;
}

.cbmmg-pin:hover {
  transform: scale(1.4) !important;
  z-index: 1000 !important;
  box-shadow: 0 4px 18px rgba(255, 23, 68, 0.7);
}

/* Efeito mola de queda (Drop & Spring bounce) */
@keyframes cbmmgDropSpring {
  0% {
    opacity: 0;
    transform: translateY(-55px) scale(0.35);
  }
  50% {
    opacity: 1;
    transform: translateY(8px) scale(1.18, 0.85);
  }
  70% {
    transform: translateY(-4px) scale(0.96, 1.04);
  }
  85% {
    transform: translateY(2px) scale(1.02, 0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cbmmg-pin.anim-drop-spring {
  animation: cbmmgDropSpring 0.65s var(--ease-spring) both;
  will-change: transform, opacity;
}

/* 1. Sede de Batalhão / Cia Ind */
.bbm-pin {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
  border: 1.5px solid #ffb300;
  font-size: 10px;
  box-shadow: 0 0 10px rgba(211, 47, 47, 0.6);
}

.bbm-pin .pin-badge {
  position: absolute;
  bottom: -3px;
  right: -4px;
  background: #ffb300;
  color: #000000;
  font-family: var(--font-tactical);
  font-size: 8px;
  font-weight: 800;
  padding: 0 2px;
  border-radius: 2px;
  line-height: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* 2. Companhia (Laranja) */
.cia-pin {
  width: 17px;
  height: 17px;
  background: linear-gradient(135deg, #e65100 0%, #ff9800 100%);
  border: 1.2px solid #ffffff;
  font-size: 8px;
}

/* 3. Pelotão (Azul Tático) */
.pel-pin {
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
  border: 1.2px solid #00e5ff;
  font-size: 7px;
}

/* 4. Posto Avançado (Ciano Circular) */
.pa-pin {
  width: 13px;
  height: 13px;
  background: linear-gradient(135deg, #006064 0%, #00acc1 100%);
  border: 1px solid #ffffff;
  font-size: 7px;
  border-radius: 50%;
}

/* ==========================================================================
   ANEL DE PULSAÇÃO TÁTICA NO MAPA (MIRA DE FOCO SELECIONADO)
   ========================================================================== */
@keyframes tacticalPulseRing {
  0% {
    transform: scale(0.3);
    opacity: 1;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.tactical-pulse-marker {
  position: relative;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.tactical-pulse-marker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2.5px solid #ff1744;
  box-shadow: 0 0 16px #ff1744;
  animation: tacticalPulseRing 1.1s infinite ease-out;
  will-change: transform, opacity;
}

/* ==========================================================================
   CUSTOM LEAFLET POPUPS & TOOLTIPS
   ========================================================================== */
.leaflet-popup-content-wrapper {
  background: rgba(14, 20, 30, 0.96) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-elevated) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.leaflet-popup-tip {
  background: rgba(14, 20, 30, 0.96) !important;
}

.popup-uc-card {
  padding: 4px;
  min-width: 220px;
}

.popup-uc-card h3 {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 4px;
  font-weight: 700;
  font-family: var(--font-tactical);
}

.popup-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.popup-row strong {
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   SCROLLBAR CUSTOMIZADA SUAVE
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   DESIGN RESPONSIVO OPERACIONAL (TABLETS & SMARTPHONES)
   ========================================================================== */

/* Base para elementos móveis */
.sidebar-backdrop {
  display: none;
}

.legend-mobile-toggle {
  display: none;
}

.legend-hud-body {
  display: block;
}

/* --------------------------------------------------------------------------
   TABLETS E TELAS MÉDIAS (769px a 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 340px;
    --header-height: 56px;
  }

  .header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 6px;
    background: rgba(255, 179, 0, 0.12);
    border: 1px solid rgba(255, 179, 0, 0.4);
    color: var(--gold-accent);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    flex-shrink: 0;
    touch-action: manipulation;
  }

  .header-menu-btn:hover {
    background: rgba(255, 179, 0, 0.22);
    border-color: var(--gold-accent);
    color: #ffffff;
  }

  .header-menu-btn:active {
    transform: scale(0.95);
  }

  .tactical-header {
    padding: 0 14px;
    height: var(--header-height);
  }

  .brand-titles h1 {
    font-size: 16px;
    letter-spacing: 0.8px;
  }

  .brand-subtitle {
    font-size: 11px;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .telemetry-bar {
    gap: 8px;
  }

  .status-pill {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .status-pill.status-pill-meteo {
    display: none; /* Oculta meteo para dar prioridade à telemetria crítica de focos */
  }

  .header-actions {
    gap: 8px;
  }

  .btn-tactical {
    padding: 7px 12px;
    font-size: 11.5px;
  }

  .layer-switcher {
    gap: 3px;
  }

  .btn-layer {
    padding: 5px 8px;
    font-size: 11px;
  }

  .legend-hud {
    padding: 8px 12px;
    bottom: 16px;
    right: 12px;
  }
}

/* --------------------------------------------------------------------------
   SMARTPHONES E TELAS PEQUENAS (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 52px;
    --sidebar-width: min(380px, 88vw);
  }

  body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
  }

  .mobile-quick-panel {
    display: block; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 1200;
    padding: 8px 12px 10px; border: 1px solid rgba(0,229,255,.38); border-radius: 12px;
    background: rgba(7,12,20,.94); box-shadow: 0 10px 30px rgba(0,0,0,.6),0 0 18px rgba(0,229,255,.12);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .mobile-quick-grip { width: 34px; height: 3px; border-radius: 3px; background: #64748b; margin: 0 auto 7px; }
  .mobile-quick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mobile-quick-head strong { display: block; color: #fff; font-size: 14px; line-height: 1.15; }
  .mobile-quick-kicker { display: block; color: var(--text-muted); font-size: 9px; font-weight: 800; letter-spacing: .7px; }
  .mobile-quick-risk { min-width: 68px; padding: 5px 8px; border-radius: 7px; text-align: center; color: #fff; background: #334155; font: 700 15px var(--font-mono); }
  .mobile-quick-metrics { display: flex; justify-content: space-between; gap: 7px; padding: 8px 0 7px; color: var(--text-secondary); font-size: 10px; }
  .mobile-quick-metrics i { color: var(--cyan-telemetry); margin-right: 2px; }
  .mobile-quick-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
  .mobile-quick-actions button { min-height: 32px; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; background: rgba(255,255,255,.06); color: #fff; font: 700 10px var(--font-sans); }
  .mobile-quick-actions button:active { background: rgba(0,229,255,.18); border-color: var(--cyan-telemetry); }
  .tactical-sidebar { padding-bottom: 178px; }
  .telemetrySidePanel { display: none !important; }

  /* Header Compacto Móvel */
  .tactical-header {
    height: var(--header-height);
    padding: 0 10px;
    gap: 8px;
    justify-content: space-between;
  }

  .header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 6px;
    background: rgba(255, 179, 0, 0.12);
    border: 1px solid rgba(255, 179, 0, 0.4);
    color: var(--gold-accent);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    flex-shrink: 0;
    touch-action: manipulation;
  }

  .brand-section {
    gap: 8px;
    flex-shrink: 0;
  }

  .insignia-wrapper {
    width: 36px;
    height: 36px;
    padding: 1px;
    border-radius: 6px;
  }

  .brand-titles h1 {
    font-size: 13.5px;
    letter-spacing: 0.5px;
    gap: 2px;
    line-height: 1.15;
  }

  .brand-titles h1 span {
    display: inline !important;
    color: var(--gold-accent) !important;
    margin: 0 3px;
  }

  .brand-subtitle {
    display: block !important;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.1;
    margin-top: 1px;
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sub-full {
    display: none !important;
  }

  .sub-compact {
    display: inline !important;
  }

  /* Pílulas de Telemetria Condensadas com Rótulos Claros */
  .telemetry-bar {
    gap: 6px;
    display: flex;
    align-items: center;
  }

  .status-pill {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 14px;
    gap: 4px;
  }

  .label-long {
    display: none !important;
  }

  .label-short {
    display: inline !important;
  }

  .pill-suffix-text {
    display: none !important;
  }

  .status-pill.status-pill-meteo {
    display: none;
  }

  /* Rótulos da Sidebar & Seleção de UCs sem quebra truncada */
  #selectedUcTitle {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
  }

  #selectedUcMeta {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
  }

  .sidebar-tabs {
    padding: 6px 4px 0 !important;
    gap: 2px !important;
  }

  .tab-btn {
    padding: 6px 2px !important;
    font-size: 10px !important;
    letter-spacing: 0.2px !important;
  }

  .tab-btn span {
    white-space: normal !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  /* Previsão Clima Mini Card em Duas Linhas (Anti-Colapso) */
  .forecast-mini-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .forecast-mini-day {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .forecast-mini-metrics {
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    font-size: 11px !important;
    padding: 6px 0 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  /* Fórmula INPE v11 condensada */
  .rf-formula-breakdown {
    gap: 4px !important;
    padding: 6px 4px !important;
  }

  .formula-chip .label {
    font-size: 9.5px !important;
  }

  .formula-chip .val {
    font-size: 12.5px !important;
  }

  /* Ações Rápidas */
  .header-actions {
    gap: 6px;
  }

  .header-actions .btn-export-csv {
    display: none; /* Reservado para desktop/tablet */
  }

  .header-actions .btn-tactical {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 6px;
    min-height: 36px;
  }

  .header-actions .btn-action-label {
    display: none;
  }

  .header-actions .btn-report-cta i {
    font-size: 13px;
  }

  /* Layout Principal e Mapa em Tela Cheia */
  .main-layout {
    position: relative;
    width: 100vw;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
  }

  .map-viewport {
    width: 100vw !important;
    height: 100% !important;
    flex: none !important;
  }

  /* Sidebar Tática como Drawer Deslizante Móvel */
  .tactical-sidebar {
    position: fixed !important;
    top: var(--header-height) !important;
    left: 0 !important;
    bottom: 0 !important;
    height: calc(100vh - var(--header-height)) !important;
    width: min(380px, 88vw) !important;
    min-width: 0 !important;
    max-width: 88vw !important;
    margin-left: 0 !important;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 1200 !important;
    box-shadow: 12px 0 45px rgba(0, 0, 0, 0.85) !important;
    pointer-events: auto !important;
  }

  .tactical-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Quando a sidebar mobile está aberta, o card flutuante (master-brand-dock)
     sobrepõe o topo da sidebar. O sidebar-dock-spacer (primeiro filho) assume a
     altura do card via syncBrandDockSpacer() para empurrar o conteúdo para baixo. */
  .tactical-sidebar.mobile-open #sidebarDockSpacer {
    /* Altura definida por JS via syncBrandDockSpacerMobile() */
    display: block !important;
  }

  /* Backdrop Escuro Translúcido */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 8, 14, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease-out);
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* ============================================================
     MASTER BRAND DOCK NO MOBILE — Card sempre visível na tela
     O card completo (logo + título + desc) nunca desaparece.
     Age como um popup lateral permanente sobre o mapa.
     ============================================================ */
  .master-brand-dock {
    position: fixed !important;
    top: calc(var(--header-height) + 6px) !important;
    left: 8px !important;
    /* Largura calculada: ocupa ~80vw mas nunca mais que 310px */
    width: min(310px, calc(100vw - 16px)) !important;
    z-index: 1300 !important;
    /* Sem transition de width — sempre o mesmo tamanho */
    transition: none !important;
  }

  .master-brand-dock .master-brand-card {
    padding: 12px 14px 10px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 179, 0, 0.3) !important;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.8),
      0 0 0 1px rgba(255, 255, 255, 0.04) !important;
  }

  /* Todos os elementos sempre visíveis — nunca colapsa */
  .master-brand-dock .master-titles {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
  }

  .master-brand-dock .master-desc-bar {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 10px !important;
    margin-top: 6px !important;
  }

  .master-brand-dock .master-brand-row {
    gap: 10px !important;
    margin-bottom: 6px !important;
    align-items: center !important;
  }

  .master-brand-dock .master-insignia-wrapper {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0 !important;
  }

  .master-brand-dock .master-title {
    font-size: 13.5px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .master-brand-dock .master-subtitle {
    font-size: 9.5px !important;
  }

  .master-brand-dock .master-tag {
    font-size: 9.5px !important;
    gap: 4px !important;
  }

  .master-brand-dock .sidebar-toggle-btn {
    position: relative !important;
    top: unset !important;
    left: unset !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(14, 20, 30, 0.9) !important;
    color: var(--gold-accent) !important;
    border-color: rgba(255, 179, 0, 0.45) !important;
    animation: none !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
  }

  /* Ícone fica cor ciano quando sidebar está aberta */
  .master-brand-dock.mobile-open .sidebar-toggle-btn {
    color: var(--cyan-telemetry) !important;
    border-color: rgba(0, 229, 255, 0.4) !important;
    background: rgba(0, 10, 20, 0.9) !important;
  }


  /* HUD de Camadas Móvel Touch-Friendly */
  .map-hud-top-right {
    top: 10px !important;
    right: 10px !important;
    left: 58px !important; /* Deixa espaço livre para o botão de menu à esquerda */
    max-width: calc(100vw - 68px) !important;
    z-index: 950 !important;
    align-items: flex-end !important;
  }

  .map-hud-top-right .hud-panel {
    padding: 3px 6px !important;
    border-radius: 6px !important;
    max-width: 100% !important;
    background: rgba(10, 15, 23, 0.88) !important;
  }

  .layer-switcher {
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    padding: 2px 0 !important;
  }

  .layer-switcher::-webkit-scrollbar {
    display: none !important;
  }

  .btn-layer {
    flex-shrink: 0 !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
    min-height: 34px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  /* Legenda do INPE Colapsável Móvel */
  .legend-hud {
    position: absolute !important;
    bottom: 12px !important;
    right: 10px !important;
    z-index: 900 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .legend-mobile-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 12px !important;
    background: rgba(12, 18, 28, 0.94) !important;
    backdrop-filter: blur(14px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 20px !important;
    color: var(--gold-accent) !important;
    font-family: var(--font-tactical) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.6px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6) !important;
    transition: all 0.2s var(--ease-out) !important;
  }

  .legend-hud.open .legend-mobile-toggle {
    background: rgba(20, 28, 42, 0.98) !important;
    border-color: rgba(255, 179, 0, 0.5) !important;
    color: #ffffff !important;
  }

  .legend-hud-body {
    display: none;
    margin-bottom: 8px;
    background: rgba(10, 15, 23, 0.96) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-sm) !important;
    padding: 10px 14px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
    min-width: 220px !important;
    animation: fadeIn 0.22s ease-out;
  }

  .legend-hud.open .legend-hud-body {
    display: block !important;
  }

  /* Painel de Telemetria Lateral Direita */
  .telemetry-side-panel {
    top: 56px !important;
  }

  .telemetry-side-tab {
    width: 30px !important;
    padding: 10px 0 !important;
  }

  .telemetry-side-body {
    width: 200px !important;
    padding: 10px 12px !important;
  }

  /* Drawer Lateral de Detalhes de Focos */
  .hotspots-lateral-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    z-index: 1300 !important;
  }

  /* Container de Notificações Toast no Mobile */
  #toastContainer {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px) !important;
    align-items: center !important;
  }

  .tactical-toast {
    font-size: 11.5px !important;
    padding: 8px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* --------------------------------------------------------------------------
   SMARTPHONES EXTRA PEQUENOS (<= 420px)
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
  .brand-titles h1 {
    font-size: 12.5px;
    letter-spacing: 0.3px;
  }

  .status-pill {
    padding: 4px 6px;
    font-size: 10px;
  }

  .tactical-sidebar {
    width: 92vw !important;
    max-width: 92vw !important;
  }

  .sidebar-tab-content {
    padding: 12px 10px !important;
  }
}

/* ==========================================================================
   ACELERAÇÃO E REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   MODO IMPRESSÃO / RELATÓRIO EXECUTIVO (A4 BRIEFING)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    height: auto !important;
  }
  .tactical-header, .sidebar-toggle-btn, .map-hud-top-right, .legend-hud {
    display: none !important;
  }
  .tactical-sidebar {
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    border: none !important;
    position: static !important;
    transform: none !important;
  }
  .map-viewport {
    height: 450px !important;
    page-break-after: always;
  }
}
