/**
 * ============================================================================
 * APLICATIVO MOBILE DE INVENTÁRIO FLORESTAL - SÍTIO ACALANTO (JACAREÍ/SP)
 * Folha de Estilos Mobile-First & Touchscreen
 * Compatível com iOS (Safari), Android (Chrome/Firefox/Edge) e PWA Standalone
 * ============================================================================
 */

:root {
  --primary: #064e3b;
  --primary-dark: #022c22;
  --primary-light: #059669;
  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-light: rgba(16, 185, 129, 0.15);
  
  --bg-app: #090e17;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --bg-surface: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #0284c7;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Roboto Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  position: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   ESTRUTURA PRINCIPAL DO APLICATIVO
   ========================================================================== */

#app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-app);
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

/* Header Superior Mobile */
.app-header {
  height: 60px;
  min-height: 60px;
  background: linear-gradient(180deg, #064e3b 0%, #032f24 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.header-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255,255,255,0.08);
  padding: 2px;
}

.header-title-box {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-subtitle {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-action {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-action:active {
  transform: scale(0.95);
  background: rgba(16, 185, 129, 0.3);
}

.btn-install-pwa {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022c22;
  border: none;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.04); }
}

.status-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-badge.offline {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL & ABAS
   ========================================================================== */

.app-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-view {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 75px; /* Espaço para a barra inferior */
}

.tab-view.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   BARRA DE NAVEGAÇÃO INFERIOR (BOTTOM NAV BAR)
   ========================================================================== */

.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #0d1522;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 60;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item i {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.nav-item.active {
  color: var(--accent);
  font-weight: 700;
}

.nav-item.active i {
  transform: translateY(-2px);
  color: var(--accent);
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background: var(--accent);
  color: #022c22;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   ABA 1: LISTA DE ÁRVORES COLETADAS
   ========================================================================== */

.trees-toolbar {
  padding: 0.75rem 1rem 0.5rem 1rem;
  background: #0d1522;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 2.2rem;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: none;
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.trees-list-container {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tree-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.tree-card:active {
  transform: scale(0.99);
  background: var(--bg-card-hover);
}

.tree-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tree-card-title-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tree-icon-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.tree-name-box {
  display: flex;
  flex-direction: column;
}

.tree-species-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tree-scientific-name {
  font-size: 0.725rem;
  color: var(--text-secondary);
  font-style: italic;
}

.tree-tag-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.tree-card-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
}

.tree-stat-item {
  display: flex;
  flex-direction: column;
}

.tree-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.tree-stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.tree-stat-value.highlight {
  color: var(--accent);
}

.tree-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tree-meta-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.tree-health-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

.health-sadia {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.health-danificada {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.health-morta {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.tree-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-action:active {
  background: var(--accent-light);
  color: var(--accent);
}

.btn-card-action.danger:active {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  gap: 0.75rem;
}

.empty-state-icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 2rem;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.empty-state-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
}

/* ==========================================================================
   ABA 2: MAPA INTERATIVO MOBILE
   ========================================================================== */

#tab-map {
  padding: 0;
  position: relative;
}

#mobile-map {
  width: 100%;
  height: 100%;
  background: #0f172a;
  z-index: 10;
}

.map-floating-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}

.btn-map-fab {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #111827;
  border: 1px solid var(--border-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-map-fab:active {
  transform: scale(0.92);
  background: var(--accent);
  color: #022c22;
}

.btn-map-fab.active {
  background: var(--accent);
  color: #022c22;
  border-color: var(--accent);
}

.map-gps-hud {
  position: absolute;
  bottom: 80px;
  left: 10px;
  right: 10px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  box-shadow: var(--shadow-md);
}

.gps-hud-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gps-hud-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.gps-hud-coords {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.gps-hud-accuracy {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   ABA 3: ESTATÍSTICAS & DENDROMETRIA
   ========================================================================== */

.stats-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}

.kpi-card.blue::before { background: #0284c7; }
.kpi-card.amber::before { background: #f59e0b; }
.kpi-card.purple::before { background: #8b5cf6; }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.kpi-subtext {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.species-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.species-rank-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.species-rank-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}

.species-progress-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.species-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   ABA 4: FERRAMENTAS & EXPORTAÇÕES
   ========================================================================== */

.tools-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.btn-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.btn-tool-card:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.tool-icon-box {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.tool-icon-box.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.tool-icon-box.blue { background: rgba(2, 132, 199, 0.15); color: #0284c7; }
.tool-icon-box.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tool-icon-box.whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.tool-icon-box.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.tool-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.tool-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   BOTÃO FLUTUANTE GLOBAL (FAB) PARA NOVA COLETA
   ========================================================================== */

.fab-main-collect {
  position: absolute;
  bottom: 78px;
  right: 18px;
  height: 52px;
  padding: 0 1.25rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022c22;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  cursor: pointer;
  z-index: 55;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-main-collect:active {
  transform: scale(0.94);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.fab-main-collect i {
  font-size: 1.1rem;
}

/* ==========================================================================
   MODAL DE COLETA TOUCH (BOTTOM SHEET / FULLSCREEN)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 600px;
  height: 92%;
  background: #0d1522;
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-sheet-header {
  padding: 0.9rem 1.25rem;
  background: #111827;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-sheet-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-sheet-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}

.modal-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Grupos de Formulário */
.form-card-section {
  background: #151f30;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.section-label-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  background: #243248;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

/* Botão de GPS */
.btn-gps-capture {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

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

.gps-accuracy-indicator {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.accuracy-good {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.accuracy-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.accuracy-poor {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Upload e Câmera */
.camera-touch-button {
  background: #1e293b;
  border: 2px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s ease;
}

.camera-touch-button:active {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
}

.photo-preview-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid var(--border-color);
}

.photo-preview-container img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.btn-remove-photo-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Footer do Modal */
.modal-sheet-footer {
  padding: 0.85rem 1.25rem;
  background: #111827;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.6rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
}

.btn-modal-action {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  border: none;
}

.btn-modal-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.btn-modal-save {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022c22;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   TOAST & NOTIFICAÇÕES
   ========================================================================== */

.app-toast-box {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  white-space: nowrap;
  max-width: 90%;
}

.app-toast-box.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.app-toast-box.success { border-color: #10b981; color: #10b981; }
.app-toast-box.warning { border-color: #f59e0b; color: #f59e0b; }
.app-toast-box.danger { border-color: #ef4444; color: #ef4444; }

/* Custom Popup do Mapa */
.leaflet-popup-content-wrapper {
  background: #111827 !important;
  color: #fff !important;
  border-radius: 12px !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0.8rem !important;
  font-family: var(--font-sans) !important;
}

.leaflet-popup-tip {
  background: #111827 !important;
}
