/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0c10;
  --surface:   #111318;
  --surface2:  #191c23;
  --border:    #252830;
  --text:      #e2e4ea;
  --text-dim:  #6b7280;
  --fire-1:    #ff4500;
  --fire-2:    #ff7200;
  --fire-3:    #ffaa00;
  --low:       #22c55e;
  --medium:    #eab308;
  --high:      #f97316;
  --critical:  #ef4444;
  --accent:    #3b82f6;
  --sidebar-w: 340px;
  --radius:    10px;
  --mobile-sidebar-h: 40vh;
}

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

/* ── Layout ───────────────────────────────────────────────── */
body { display: flex; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  z-index: 100;
}

.map-container { flex: 1; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; }

/* ── Brand ───────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1a0a00 0%, #0f0f14 100%);
}
.brand-icon { font-size: 28px; filter: drop-shadow(0 0 8px #ff4500aa); }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.brand-sub  { font-size: 11px; color: var(--fire-2); font-weight: 500; }

/* ── Panel ───────────────────────────────────────────────── */
.panel {
  padding: 14px 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ── Inputs ──────────────────────────────────────────────── */
.search-row, .coord-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.input:focus { border-color: var(--fire-2); }
.input.mini { max-width: 90px; padding: 8px 8px; }
.input::placeholder { color: var(--text-dim); }
.hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.btn-icon {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--fire-2);
  font-size: 18px;
  width: 36px;
  cursor: pointer;
  transition: background .2s, color .2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--fire-1); color: #fff; border-color: var(--fire-1); }

/* ── Layer Toggles ───────────────────────────────────────── */
.layer-group { display: flex; flex-direction: column; gap: 6px; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.toggle-row input[type=checkbox] {
  accent-color: var(--fire-2);
  width: 14px; height: 14px; cursor: pointer;
}
.select {
  width: 100%;
  margin-top: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* ── Chat ────────────────────────────────────────────────── */
.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 280px; }

.chat-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  max-height: 320px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: fadeUp .3s ease;
}
.chat-avatar {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 4px #ff450066);
}
.chat-msg .chat-content {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface2);
  border-radius: 0 8px 8px 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  flex: 1;
}
.chat-msg .chat-content p { margin: 0 0 8px; }
.chat-msg .chat-content p:last-child { margin-bottom: 0; }
.chat-msg .chat-content h3,
.chat-msg .chat-content h4 { font-size: 13px; font-weight: 700; margin: 10px 0 4px; color: var(--fire-3); }
.chat-msg .chat-content strong { font-weight: 700; color: #fff; }
.chat-msg .chat-content em { font-style: italic; color: var(--fire-3); }
.chat-msg .chat-content ul, .chat-msg .chat-content ol { padding-left: 16px; margin: 6px 0; }
.chat-msg .chat-content li { margin-bottom: 4px; }
.chat-msg .chat-content hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.chat-msg .chat-content .ai-warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-left: 3px solid var(--medium);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 12px;
  color: #fde68a;
}
.chat-msg .chat-content .ai-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 3px solid var(--critical);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 12px;
  color: #fca5a5;
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg.user .chat-content {
  background: linear-gradient(135deg, #e64a19, #d84315);
  border-color: #bf360c;
  border-radius: 8px 0 8px 8px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(230, 74, 25, 0.2);
}
.chat-msg.user .chat-content p { color: #ffffff; }
.chat-msg.system .chat-content { border-color: #252d3a; }
.chat-msg.error .chat-content { border-color: var(--critical); color: #fca5a5; }

.chat-input-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.btn-send {
  background: linear-gradient(135deg, var(--fire-1), var(--fire-2));
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 16px;
  width: 38px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  flex-shrink: 0;
}
.btn-send:hover { opacity: .85; }
.btn-send:active { transform: scale(.95); }
.btn-send:disabled { opacity: .4; cursor: not-allowed; }

/* ── Floating Risk Badge ─────────────────────────────────── */
.risk-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(10,12,16,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  backdrop-filter: blur(10px);
  z-index: 400;
  text-align: center;
  min-width: 140px;
  box-shadow: 0 4px 24px #00000060;
  transition: all .3s ease;
}
.risk-badge-inner { display: flex; align-items: baseline; gap: 4px; justify-content: center; }
.risk-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.risk-score { font-size: 42px; font-weight: 700; line-height: 1; }
.risk-unit  { font-size: 14px; color: var(--text-dim); }
.risk-location { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.risk-badge.low      { border-color: var(--low);      box-shadow: 0 0 20px var(--low)33; }
.risk-badge.medium   { border-color: var(--medium);   box-shadow: 0 0 20px var(--medium)33; }
.risk-badge.high     { border-color: var(--high);      box-shadow: 0 0 20px var(--high)44; }
.risk-badge.critical { border-color: var(--critical);  box-shadow: 0 0 28px var(--critical)55; }
.risk-label.low      { color: var(--low); }
.risk-label.medium   { color: var(--medium); }
.risk-label.high     { color: var(--high); }
.risk-label.critical { color: var(--critical); }
.risk-score.low      { color: var(--low); }
.risk-score.medium   { color: var(--medium); }
.risk-score.high     { color: var(--high); }
.risk-score.critical { color: var(--critical); }

/* ── Metrics Bar ─────────────────────────────────────────── */
.metrics-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10,12,16,.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  backdrop-filter: blur(10px);
  z-index: 400;
  box-shadow: 0 4px 24px #00000060;
  position: relative;
}

.metrics-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 410;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.metrics-close:hover {
  background: var(--critical);
  color: #fff;
  border-color: var(--critical);
}
.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  border-right: 1px solid var(--border);
}
.metric-card:last-of-type { border-right: none; }
.metric-icon { font-size: 15px; }
.metric-val  { font-size: 18px; font-weight: 700; color: var(--fire-3); line-height: 1; }
.metric-unit { font-size: 10px; color: var(--text-dim); }

.btn-forecast {
  background: linear-gradient(135deg, #1a3a6e, #1e4a8c);
  border: 1px solid #2a5bad;
  color: #93c5fd;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  margin-left: 8px;
}
.btn-forecast:hover { background: linear-gradient(135deg, #1e4a8c, #2563eb); }

.btn-report {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--fire-1), var(--fire-2));
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .2s, transform .1s;
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}
.btn-report:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-report:active { transform: translateY(0); }
.btn-report span { font-size: 16px; }

/* ── AI Scanner Overlay (Loading) ────────────────────────── */
.ai-scanner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,12,16,.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.ai-scanner-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.ai-scanner-box {
  width: 380px;
  background: rgba(17, 19, 24, 0.9);
  border: 1px solid var(--fire-2);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 0 30px rgba(255, 69, 0, 0.15), inset 0 0 20px rgba(255, 114, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.ai-scanner-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--fire-2), transparent);
  animation: scanLine 2s linear infinite;
}

.scanner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 114, 0, 0.2);
  padding-bottom: 12px;
}

.pulse-dot {
  width: 10px; height: 10px;
  background: var(--low);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--low);
  animation: pulseDot 1.5s infinite;
}

.scanner-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fire-2);
  letter-spacing: 1.5px;
  font-weight: 600;
}

.scanner-visual {
  position: relative;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.radar-circle {
  width: 80px; height: 80px;
  border: 1px dashed rgba(255, 114, 0, 0.4);
  border-radius: 50%;
  position: relative;
}

.radar-circle::after {
  content: '';
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(255, 114, 0, 0.2);
  border-radius: 50%;
}

.radar-sweep {
  position: absolute;
  width: 40px; height: 40px;
  top: 0; left: 50%;
  transform-origin: bottom left;
  background: conic-gradient(from 0deg, rgba(255, 114, 0, 0.6) 0deg, transparent 60deg);
  border-radius: 0 40px 0 0;
  animation: radarSpin 2s linear infinite;
}

.scanner-logs {
  height: 60px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.scanner-logs span {
  display: block;
  animation: fadeUp 0.2s ease-out;
}

.scanner-status {
  font-size: 12px;
  color: var(--text);
  text-align: center;
  font-weight: 500;
  margin-top: 4px;
}

@keyframes scanLine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}
@keyframes radarSpin {
  to { transform: rotate(360deg); }
}

/* ── Forecast Modal ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px #00000099;
  animation: fadeUp .25s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 4px;
  border-radius: 6px; transition: color .2s, background .2s;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-body {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Forecast Grid */
.forecast-header { display: flex; flex-direction: column; gap: 6px; }
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  width: fit-content;
}
.forecast-briefing {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--fire-2);
  border-radius: 8px;
}
.briefing-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fire-2);
  background: rgba(255,114,0,0.08);
  border-bottom: 1px solid rgba(255,114,0,0.2);
  padding: 8px 14px;
}
.briefing-text {
  padding: 14px 16px;
}
.briefing-text p { margin: 0 0 10px; }
.briefing-text p:last-child { margin-bottom: 0; }
.briefing-text h3,
.briefing-text h4 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; color: var(--fire-3); }
.briefing-text strong { font-weight: 700; color: #fff; }
.briefing-text em { font-style: italic; color: var(--fire-3); }
.briefing-text ul, .briefing-text ol { padding-left: 18px; margin: 6px 0; }
.briefing-text li { margin-bottom: 5px; }
.briefing-text hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.briefing-text .ai-warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-left: 3px solid var(--medium);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 10px 0;
  color: #fde68a;
}
.briefing-text .ai-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 3px solid var(--critical);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 10px 0;
  color: #fca5a5;
}
.forecast-briefing.no-briefing {
  padding: 14px 16px;
  color: var(--text-dim);
  font-style: italic;
  border-left-color: var(--border);
}
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.forecast-day {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .2s;
}
.forecast-day:hover { border-color: var(--fire-2); }
.fd-date  { font-size: 10px; color: var(--text-dim); }
.fd-level { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.fd-score { font-size: 22px; font-weight: 700; line-height: 1; }
.fd-fwi   { font-size: 9px; color: var(--text-dim); }
.fd-rain  { font-size: 10px; }
.fd-low    { color: var(--low); border-color: #16532833; }
.fd-medium { color: var(--medium); }
.fd-high   { color: var(--high); }
.fd-critical { color: var(--critical); border-color: #7f1d1d55; background: #1c0a0a; }

.kbdi-bar {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kbdi-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.kbdi-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.kbdi-fill  { height: 100%; border-radius: 4px; transition: width .6s ease; }
.kbdi-val   { font-size: 13px; font-weight: 700; min-width: 70px; text-align: right; }

/* ── Hotspot Markers ─────────────────────────────────────── */
.fire-marker {
  width: 10px; height: 10px;
  background: var(--fire-1);
  border-radius: 50%;
  border: 1.5px solid #ff7200;
  box-shadow: 0 0 6px var(--fire-1), 0 0 12px #ff450055;
  animation: pulse 2s ease-in-out infinite;
  cursor: pointer;
}
.fire-marker.high-frp {
  width: 14px; height: 14px;
  box-shadow: 0 0 10px var(--fire-1), 0 0 20px #ff450077;
}

.marker-ground-truth {
  width: 24px; height: 24px;
  background: var(--medium);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px var(--medium), 0 0 16px #eab30888;
  animation: pulseGroundTruth 1.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}
.marker-ground-truth.pending {
  background: #6b7280;
  box-shadow: 0 0 8px #6b7280, 0 0 16px #6b728088;
}
.marker-ground-truth.confirmed {
  background: #eab308;
  box-shadow: 0 0 8px #eab308, 0 0 16px #eab30888;
}
.marker-ground-truth::after {
  content: "📸";
  font-size: 14px;
}

@keyframes pulseGroundTruth {
  0%,100% { box-shadow: 0 0 8px var(--medium); }
  50% { box-shadow: 0 0 16px var(--medium); }
}

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }
.loading-text { color: var(--text-dim); font-size: 13px; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.6; transform:scale(1.3); } }
@keyframes fadeUp  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── Leaflet overrides ───────────────────────────────────── */
/* Fundo azul oceanânico quando tiles não carregam */
.leaflet-container { background: #4a90d9; }
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(37,99,235,0.15) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-close-button { color: var(--text-dim) !important; }
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface2) !important; color: var(--accent) !important; }
.leaflet-bar { border: 1px solid var(--border) !important; box-shadow: none !important; }
.leaflet-control-attribution {
  background: rgba(255,255,255,.85) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }

/* ── Fase 3: Alertas de Vegetação ── */
.marker-attention {
  animation: pulse-attention 2s infinite ease-in-out;
}

@keyframes pulse-attention {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── Alertas NDVI (DOM markers — estáveis no zoom) ── */
.ndvi-alert-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: ndviPulse 2s ease-in-out infinite;
  cursor: pointer;
}
.ndvi-alert-marker.ndvi-critical { filter: drop-shadow(0 0 6px #ef444488); }
.ndvi-alert-marker.ndvi-high     { filter: drop-shadow(0 0 6px #f9731688); }
.ndvi-alert-marker.ndvi-medium   { filter: drop-shadow(0 0 6px #eab30888); }
.ndvi-alert-marker.ndvi-low      { filter: drop-shadow(0 0 4px #22c55e88); }

@keyframes ndviPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* ── Responsividade Mobile ─────────────────────────────────── */
@media (max-width: 767px) {
  body {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: 40vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.4);
    background: rgba(17, 19, 24, 0.95);
    backdrop-filter: blur(10px);
    transition: height 0.3s ease;
    --mobile-sidebar-h: 40vh;
  }

  .sidebar.expanded {
    height: 90vh;
  }

  .sidebar.minimized-mobile {
    height: 72px !important;
    overflow: hidden !important;
    --mobile-sidebar-h: 72px;
  }

  .sidebar.minimized-mobile .panel,
  .sidebar.minimized-mobile::before {
    display: none;
  }


  .sidebar::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--text-dim);
    border-radius: 2px;
    margin: 10px auto 5px;
    flex-shrink: 0;
  }

  .map-container {
    height: 100vh;
    width: 100%;
  }

  .metrics-bar {
    bottom: calc(var(--mobile-sidebar-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 440px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border-radius: 16px;
    background: rgba(10, 12, 16, 0.95);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    position: relative;
  }

  .metrics-close {
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
  }

  .metric-card {
    padding: 8px 4px;
    border-right: none;
    background: rgba(25, 28, 35, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .metric-icon {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .metric-val {
    font-size: 15px;
    font-weight: 800;
  }

  .metric-unit {
    font-size: 9px;
    opacity: 0.8;
  }

  .btn-forecast {
    grid-column: span 3;
    margin: 4px 0 0 0;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e4a8c, #2563eb);
    color: #fff;
    border: none;
    text-align: center;
  }

  .risk-badge {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    min-width: 110px;
  }

  .risk-score {
    font-size: 32px;
  }

  .forecast-grid {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 10px;
    scrollbar-width: thin;
  }

  .forecast-day {
    min-width: 80px;
    flex-shrink: 0;
  }
}

