:root {
    --primary: #004F9E; /* Azul para interações e botões */
    --cpr-green: #059669; /* Verde Esmeralda para a identidade CPR Verde */
    --accent: #EF7900; /* Laranja apenas para pequenos detalhes/tags */
    --bg-light: #F8F9FD;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif; }
body { background-color: var(--bg-light); color: var(--text-dark); line-height: 1.6; overflow: hidden; display: flex; height: 100vh; width: 100vw; padding: 15px; gap: 15px; }

/* Layout Restor (Sidebar Esquerda, Mapa Direita) */
.sidebar { width: 40%; min-width: 350px; height: 100%; overflow-y: auto; background: var(--bg-light); border: 1px solid #e5e7eb; box-shadow: 0 4px 15px rgba(0,0,0,0.05); z-index: 1000; display: flex; flex-direction: column; border-radius: 15px; }
.sidebar-header { padding: 20px 25px 10px; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; background: var(--bg-light); z-index: 10; border-top-left-radius: 15px; border-top-right-radius: 15px;}
.sidebar-content { padding: 20px 25px; display: flex; flex-direction: column; gap: 15px; }
.map-pane { width: 60%; flex-grow: 1; height: 100%; position: relative; border-radius: 15px; overflow: hidden; border: 1px solid #e5e7eb; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

/* Oculta scrollbar mas permite rolar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

header img { max-width: 140px; margin-bottom: 10px; }
header h1 { font-size: 1.6rem; color: var(--primary); line-height: 1.2;}
header p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 15px; }

.search-bar {
    width: 100%; display: block; padding: 12px 15px; font-size: 0.95rem; border: 1px solid #d1d5db;
    border-radius: 8px; outline: none; background: var(--bg-light); transition: 0.2s;
}
.search-bar:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,79,158,0.1); }

/* Icones customizados no mapa */
.custom-tree-icon { background: transparent; border: none; }
.tree-emoji {
    display: block;
    font-size: 26px; /* Tamanho fixo */
    line-height: 26px;
    text-align: center;
    filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.4));
    cursor: pointer;
}

/* Cards na Sidebar */
.card {
    background: #FFFFFF; border-radius: 8px; padding: 20px; border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex; flex-direction: column; transition: border-color 0.2s, box-shadow 0.2s; cursor:pointer; text-decoration: none;
}
.card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-color: #cbd5e1; }
.card-title { font-size: 1.1rem; color: var(--text-dark); margin-bottom: 8px; font-weight: 600; }

.tags { margin-bottom: 10px; }
.tag { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; margin-right: 8px; }
.tag-blue { background: #e0f2fe; color: #0284c7; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-green { background: #dcfce7; color: #059669; }

.card-desc { font-size: 0.85rem; color: #4b5563; margin-bottom: 15px; line-height: 1.4; text-align: justify; }
.card-footer {
    font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid #f3f4f6;
    padding-top: 10px; display: flex; flex-direction: column; gap: 5px;
}
.btn {
    display: block; width: 100%; text-align: center; padding: 10px;
    background: var(--primary); color: #fff; border-radius: 6px; font-weight: bold;
    text-decoration: none; transition: 0.3s; cursor: pointer;
    margin-top: 10px; border: none;
}
.btn:hover { background: #003870; }

/* Projeto Details */
.close-btn {
    display: flex; justify-content: center; align-items: center; width: 32px; height: 32px;
    background: #fee2e2; color: #dc2626; border-radius: 8px; font-size: 1.1rem; text-decoration: none;
    border: 1px solid #fecaca; transition: 0.2s; flex-shrink: 0;
}
.close-btn:hover { background: #fca5a5; color: #991b1b; }

.section-title { color: var(--primary); font-size: 1.1rem; border-bottom: 2px solid #e5e7eb; padding-bottom: 5px; margin: 10px 0 5px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card {
    background: #FFFFFF; padding: 12px; border-radius: 8px; text-align: center;
    border: 1px solid #e5e7eb;
}
.stat-title { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: bold; margin-bottom: 5px;}
.stat-value { font-size: 1.1rem; font-weight: 900; color: var(--primary); line-height: 1.2; }

.full-map { height: 100%; width: 100%; position: absolute; top:0; left:0; }

.alert { padding: 12px; background: #fff3cd; color: #9a3412; border-radius: 8px; font-weight: 500; font-size: 0.85rem;}

/* Navegação Principal (Menu Lateral Esquerdo) */
.nav-sidebar { width: 70px; background: var(--bg-light); border-radius: 15px; border: 1px solid #e5e7eb; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; padding: 20px 0 8px 0; flex-shrink: 0; justify-content: flex-start;}
.nav-sidebar-top { display: flex; flex-direction: column; gap: 15px; width: 100%; align-items: center;}
.nav-sidebar-bottom { margin-top: auto; margin-bottom: 0;}
.nav-sidebar-bottom img { width: 54px !important; }
.nav-btn { width: 52px; height: 52px; border-radius: 10px; border: none; background: transparent; cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center;}
.nav-icon { width: 30px; height: 30px; background-color: var(--primary); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; mask-size: contain; mask-repeat: no-repeat; mask-position: center; transition: 0.3s; }
.nav-btn:hover { background: #e0e6ed; }
.nav-btn.active { background: #FFFFFF; box-shadow: 0 2px 6px rgba(0,0,0,0.05); border: 1px solid #e5e7eb;}
.nav-btn.active .nav-icon { background-color: var(--cpr-green); }

/* Abas da Sidebar */
.panel-view { display: none; flex-direction: column; height: 100%; }
.panel-view.active { display: flex; }

/* Estilo Especial para a Descrição do Dashboard */
.dash-desc { font-size: 0.85rem; color: var(--text-dark); line-height: 1.6; padding: 15px; background: #FFFFFF; border-radius: 8px; margin-bottom: 10px; border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,0.04); text-align: justify; }

/* Painéis de Informação Padronizados (Métricas e Detalhes) */
.info-panel {
    background: #FFFFFF; border-radius: 8px; border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex; flex-direction: column; overflow: hidden;
}
.info-panel-header {
    background: transparent; padding: 15px 15px 5px 15px; border-bottom: none;
    font-weight: 600; color: var(--text-dark); font-size: 0.95rem; display: flex; align-items: center; gap: 8px;
}
.info-panel-content {
    padding: 10px 15px 15px 15px;
}
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: none;
}
.info-row:last-child {
    border-bottom: none;
}
.info-label { color: #4b5563; font-size: 0.8rem; }
.info-value { 
    color: #000000; font-size: 0.85rem; font-weight: normal;
    text-align: right; max-width: 60%; line-height: 1.4; 
}

/* Custom Side-by-Side Slider */
.custom-sbs-divider {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 4px;
    background: #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transform: translateX(-50%);
    z-index: 1000;
    cursor: ew-resize;
    pointer-events: auto;
}
.custom-sbs-divider::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: -15px; right: -15px;
    cursor: ew-resize;
}
.custom-sbs-knob {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 36px; height: 36px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}
.map-top-label {
    position: absolute;
    top: 12px;
    background: rgba(255, 255, 255, 0.92);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    color: #1f2937;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    z-index: 1025;
    pointer-events: none;
}
.map-top-label.map-left { left: 12px; color: var(--primary); border-color: #cbd5e1; }
.map-top-label.map-right { right: 12px; color: var(--cpr-green); border-color: #cbd5e1; }

.custom-sbs-arrow {
    width: 0; height: 0;
    border-style: solid;
}
.custom-sbs-arrow.left {
    border-width: 5px 6px 5px 0;
    border-color: transparent #64748b transparent transparent;
}
.custom-sbs-arrow.right {
    border-width: 5px 0 5px 6px;
    border-color: transparent transparent transparent #64748b;
}

/* Cartão de Métricas Sobre o Mapa (Portfólio) */
.map-overlay-stats {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    z-index: 1010; /* Fica acima dos controles do Leaflet */
    min-width: 220px;
    pointer-events: auto;
}
.map-overlay-stats .stat-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.85rem; }
.map-overlay-stats .stat-row:last-child { margin-bottom: 0; }
.map-overlay-stats .stat-label { color: #6b7280; font-weight: 500; }
.map-overlay-stats .stat-val { font-weight: 700; color: var(--primary); }

/* Sobrescrita das Cores e Fontes do Agrupamento de Marcadores (MarkerCluster) */
.marker-cluster-small { background-color: rgba(16, 185, 129, 0.4) !important; }
.marker-cluster-small div { background-color: rgba(16, 185, 129, 0.9) !important; color: white !important; font-size: 14px !important; font-weight: bold !important; }

.marker-cluster-medium { background-color: rgba(5, 150, 105, 0.4) !important; } /* Verde CPR */
.marker-cluster-medium div { background-color: rgba(5, 150, 105, 0.9) !important; color: white !important; font-size: 16px !important; font-weight: bold !important; }

.marker-cluster-large { background-color: rgba(2, 90, 60, 0.4) !important; } /* Verde Escuro */
.marker-cluster-large div { background-color: rgba(2, 90, 60, 0.9) !important; color: white !important; font-size: 18px !important; font-weight: bold !important; }