/* /seu-projeto/style.css (VERSÃO FINAL COM SIDEBAR) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* --- Variáveis de Tema, Body, Login (sem alterações) --- */
:root { --primary-color: #3498db; --text-color: #34495e; --text-color-light: #7f8c8d; --bg-color: #f8f9fa; --card-bg: #ffffff; --border-color: #e9ecef; --shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
body.dark-mode { --text-color: #ecf0f1; --text-color-light: #95a5a6; --bg-color: #2c3e50; --card-bg: #34495e; --border-color: #4a627a; --shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
body { font-family: 'Poppins', sans-serif; background-color: var(--bg-color); margin: 0; color: var(--text-color); -webkit-text-size-adjust: 100%; transition: background-color 0.3s, color 0.3s; }
.login-page .theme-switch-wrapper { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.split-screen-container { display: flex; min-height: 100vh; }
.left-pane { flex: 1; background-image: linear-gradient(rgba(52, 152, 219, 0.8), rgba(41, 128, 185, 0.9)), url('https://images.unsplash.com/photo-1554435493-93422e8220c8?q=80&w=2070&auto=format&fit=crop'); background-size: cover; background-position: center; display: flex; justify-content: center; align-items: center; color: white; text-align: center; padding: 40px; }
.welcome-text h1 { font-size: 2.5rem; font-weight: 600; margin-bottom: 1rem; }
.welcome-text p { font-size: 1.1rem; font-weight: 300; opacity: 0.9; }
.right-pane { flex: 1; display: flex; justify-content: center; align-items: center; padding: 40px; background-color: var(--card-bg); }
.login-form-wrapper { width: 100%; max-width: 400px; }
.login-logo { max-width: 340px; height: auto; margin-bottom: 10px; }
.login-form-wrapper h2 { margin-bottom: 10px; color: var(--text-color); }
.login-form-wrapper p { margin-bottom: 25px; color: var(--text-color-light); }
.error-message { background-color: #e74c3c; color: #fff; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9em; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9em; }
.form-group input { width: 100%; padding: 12px; background-color: var(--bg-color); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 8px; box-sizing: border-box; transition: border-color 0.3s, background-color 0.3s; font-size: 16px; }
.form-group input:focus { outline: none; border-color: var(--primary-color); }
button { width: 100%; padding: 12px; background-color: var(--primary-color); border: none; color: #fff; font-size: 16px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: background-color 0.3s; }
button:hover { background-color: #2980b9; }
#login-button .fa-spinner { margin-right: 8px; }

/* --- Nova Estrutura da Página e Sidebar com Tooltip --- */
.page-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 80px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; height: 100%;
    z-index: 100;
}
.sidebar-header { padding: 6px; text-align: center; border-bottom: 1px solid var(--border-color); }
.sidebar-logo { width: 40px; height: auto; }
.sidebar-menu { list-style: none; padding: 0; margin: 20px 0; flex-grow: 1; }
.menu-item a {
    display: flex;
    align-items: center;
    justify-content: center; /* Centraliza o ícone */
    height: 50px;
    color: var(--text-color-light);
    text-decoration: none;
    position: relative; /* Essencial para o tooltip */
}
.menu-item.active a, .menu-item a:hover {
    color: var(--primary-color);
    background-color: var(--bg-color);
}
.menu-item i {
    font-size: 22px;
}
.menu-text {
    display: none; /* Oculta o texto por padrão */
}

/* Efeito Tooltip no Hover */
.menu-item a:hover::after {
    content: attr(title); /* Pega o texto do atributo 'title' */
    position: absolute;
    left: 100%; /* Posiciona à direita da sidebar */
    top: 50%;
    transform: translateY(-50%);
    margin-left: 15px; /* Espaço entre a sidebar e o tooltip */
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 101;
}

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: center; }
.main-content {
    flex-grow: 1;
    margin-left: 80px; /* Espaço para a sidebar fixa */
}

/* --- Dashboard --- */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; background-color: var(--card-bg); padding: 15px 30px; border-bottom: 1px solid var(--border-color); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions a { color: var(--text-color); font-size: 22px; text-decoration: none; }
.container { padding: 25px; }
.filter-container { background-color: var(--card-bg); padding: 20px; border-radius: 12px; margin-bottom: 25px; box-shadow: var(--shadow); }
.filter-container form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.filter-container .form-group { margin-bottom: 0; flex: 1; min-width: 200px; }
.grid-container { display: grid; gap: 25px; grid-template-columns: 1fr; }
@media (min-width: 1200px) { .grid-container { grid-template-columns: repeat(2, 1fr); } }
.card { background-color: var(--card-bg); padding: 25px; border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
.full-width-card { grid-column: 1 / -1; }
.card h3 { margin-top: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; color: var(--primary-color); font-size: 1.15em; font-weight: 600; }
.kpi-group { display: flex; justify-content: space-around; text-align: center; gap: 15px; }
.kpi { flex: 1; cursor: pointer; transition: transform 0.2s, background-color 0.2s; padding: 10px; border-radius: 8px; }
.kpi:hover { transform: translateY(-5px); background-color: rgba(0,0,0,0.05); }
.kpi-value { font-size: 2.5rem; font-weight: 600; color: var(--text-color); line-height: 1.2; }
.kpi-label { font-size: 0.9rem; color: var(--text-color-light); font-weight: 500; }
.card hr { border: 0; border-top: 1px solid var(--border-color); margin: 20px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: center; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; font-size: 0.9em; color: var(--text-color); background-color: var(--bg-color); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background-color: rgba(0,0,0,0.02); }
.benefit-row { cursor: pointer; transition: background-color 0.2s; }
.benefit-row:hover { background-color: rgba(52, 152, 219, 0.1); }
.filter-actions { display: flex; gap: 10px; align-items: center; }
.filter-button, .print-button { padding: 10px 25px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; border: none; box-sizing: border-box; line-height: 1.5; }
.print-button { background-color: #28a745; color: white; }
.print-button:hover { background-color: #218838; }
.chart-container { position: relative; height: 400px; width: 100%; }
.theme-switch { display: inline-block; height: 28px; width: 50px; position: relative; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.4s; border-radius: 28px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: 0.4s; border-radius: 50%; }
.slider .fa-moon, .slider .fa-sun { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 12px; }
.slider .fa-moon { left: 7px; }
.slider .fa-sun { right: 7px; opacity: 0; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); }
input:checked + .slider .fa-moon { opacity: 0; }
input:checked + .slider .fa-sun { opacity: 1; }
.dashboard-header .theme-switch-wrapper { display: flex; align-items: center; }
.kpi-main { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.kpi-comparison { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi-comparison.positive { color: #28a745; }
.kpi-comparison.negative { color: #dc3545; }
.kpi-comparison.neutral { color: var(--text-color-light); }
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn 0.3s; }
.modal-content { background-color: var(--card-bg); margin: 10% auto; padding: 25px; border: 1px solid var(--border-color); width: 80%; max-width: 800px; border-radius: 12px; position: relative; animation: slideIn 0.3s; }
.close-button { color: var(--text-color-light); position: absolute; top: 15px; right: 25px; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-button:hover, .close-button:focus { color: var(--text-color); }
.modal-chart-container { position: relative; height: 400px; width: 100%; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); } to { transform: translateY(0); } }

/* --- Responsividade --- */
/* --- Responsividade --- */
@media (max-width: 992px) {
    .left-pane { display: none; }
    .right-pane { padding: 20px; }

    /* Transforma a sidebar em uma barra de navegação inferior fixa */
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    /* Esconde o logo e o footer original (que contém o switch da sidebar) */
    .sidebar-header, .sidebar-footer {
        display: none;
    }
    /* Organiza o menu na horizontal */
    .sidebar-menu {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        margin: 0;
        padding: 5px 0;
    }
    .menu-item a {
        padding: 5px;
        height: auto;
        width: 70px;
        justify-content: center;
        flex-direction: column; /* Ícone em cima, texto embaixo */
        gap: 2px;
    }
    .menu-item a:hover::after {
        display: none; /* Desativa o tooltip no mobile */
    }
    .menu-text {
        display: block; /* Mostra o texto do menu no mobile */
        opacity: 1;
        margin-left: 0;
        font-size: 10px;
    }
    /* Impede o hover de expandir a barra */
    .sidebar:hover {
        width: 100%;
    }
    /* Adiciona espaço no final da página para não cobrir o conteúdo */
    .main-content {
        margin-left: 0;
        padding-bottom: 70px; /* Espaço para o menu inferior */
    }
}

@media (max-width: 768px) {
  .container { padding: 15px; }
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 15px; padding: 15px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .welcome-message { font-size: 1.1em; }
  .filter-container form { flex-direction: column; align-items: stretch; gap: 15px; }
  .filter-container .form-group, .filter-actions { width: 100%; flex: none; }
  .filter-actions { flex-direction: column; }
  .filter-button, .print-button { width: 100%; } /* Adicionado para igualar os botões */
  .kpi-value { font-size: 2rem; }
  .card { padding: 20px; }
  .login-page .theme-switch-wrapper { top: 10px; right: 10px; }
  .modal-content { width: 90%; margin: 20% auto; }
  
  /* Reduz a altura do mapa em telas de celular */
  #map {
    height: 450px;
  }
}

@media (max-width: 480px) {
  .kpi-group { flex-wrap: wrap; }
  .kpi-value { font-size: 1.8rem; }
  .kpi-label { font-size: 0.8rem; }
  .kpi-comparison { font-size: 0.9rem; }
}
/* --- ESTILOS ESPECÍFICOS PARA A PÁGINA DO MAPA --- */
#map {
    height: 600px;
    width: 100%;
    border-radius: 8px;
    z-index: 1; /* Garante que o mapa fique no seu próprio plano */
}

.map-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.map-controls button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    flex: 1; /* Faz os botões ocuparem o mesmo espaço */
}

.map-controls button.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.map-controls {
        /* ... suas regras existentes ... */
        margin-bottom: 20px; /* Adicione esta linha */
    }