/* =========================================================
   GOVDASH - STYLESHEET GLOBAL (C/ APPLE GLASSMORPHISM)
   ========================================================= */

/* -- VARIÁVEIS DE DESIGN E RESET -- */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --white-bg: #ffffff;
    --text-color: #212529;
    --subtle-text: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    min-height: 100vh;
    /* Fundo levemente cinza ajuda a destacar o vidro do menu */
    background-color: var(--light-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

/* -- ESTILOS DA SIDEBAR (GLASSMORPHISM) -- */
.sidebar {
    width: 280px; 
    display: flex; 
    flex-direction: column;
    position: fixed; 
    height: 100vh; 
    left: 0;
    padding: 2rem 0;
    overflow-y: auto;
    z-index: 100;
    
    /* Efeito Vidro Fosco */
    background: rgba(255, 255, 255, 0.6) !important; 
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important; 
    border-right: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.05) !important;
    color: #333333 !important; 
}

/* Ajuste da barra de rolagem para o fundo claro */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 10px; }

.sidebar-header { 
    text-align: center; 
    margin-bottom: 1.5rem; 
}

.sidebar-header h1 { 
    font-size: 1.8rem; 
    font-weight: 700; 
    color: #1a1a1a !important; 
    letter-spacing: 1px; 
}

.sidebar-header p {
    color: #666666 !important;
    font-weight: 600;
}

.sidebar-nav ul { list-style: none; }

/* -- TÍTULOS DE SEÇÃO DA SIDEBAR -- */
.sidebar-nav ul li.nav-section {
    color: #666666 !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    text-transform: uppercase;
}

.sidebar-nav ul li a {
    display: flex; 
    align-items: center;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem; 
    font-weight: 500;
    color: #4a4a4a !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-nav ul li a i { 
    margin-right: 1rem; 
    font-size: 1.2rem; 
    width: 25px; 
    text-align: center; 
}

/* Efeitos de Hover e Menu Ativo (Estilo Apple) */
.sidebar-nav ul li a:hover {
    background: rgba(0, 0, 0, 0.04) !important; 
    color: var(--primary-color) !important;
    border-radius: 8px;
}

.sidebar-nav ul li a.active {
    background: rgba(0, 123, 255, 0.08) !important;
    color: var(--primary-color) !important;
    border-right: 3px solid var(--primary-color) !important;
    border-radius: 8px;
    font-weight: 600;
}

/* -- ESTILOS DA ÁREA PRINCIPAL -- */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2.5rem;
    transition: margin-left 0.3s ease-in-out;
    width: calc(100% - 280px);
}

/* -- TIPOGRAFIA BÁSICA E CABEÇALHOS -- */
h2 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: var(--text-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

h3 { font-size: 1.1rem; color: var(--secondary-color); margin-bottom: 1rem; font-weight: 500; }
h4 { font-size: 1.1rem; color: var(--text-color); margin-bottom: 1rem; font-weight: 500; }

/* -- COMPONENTES: CARDS DE KPI -- */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background-color: var(--white-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; 
    flex-direction: column;
    justify-content: center;
    border-top: 4px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card.primary { border-top-color: var(--primary-color); }
.card.success { border-top-color: var(--success-color); }
.card.warning { border-top-color: var(--warning-color); }
.card.danger { border-top-color: var(--danger-color); }

.card h3 { margin-bottom: 0.5rem; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; }

.card p.data-value, .card .valor {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0.5rem 0;
}

.card span.data-label {
    color: var(--subtle-text);
    font-size: 0.85rem;
    font-style: italic;
}

/* -- COMPONENTES: CONTAINERS DE GRÁFICO -- */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container, .chart-box {
    background-color: var(--white-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.3s ease;
    width: 100%;
    overflow: hidden;
}

.chart-container:hover, .chart-box:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* -- BOTÕES GLOBAIS -- */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-bg);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover { 
    background-color: #0056b3; 
    transform: translateY(-2px); 
}

/* -- RESPONSIVIDADE (MOBILE E TABLET) -- */
@media (max-width: 992px) {
    body { flex-direction: column; }
    
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
        padding: 1rem; 
        flex-direction: column; 
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.8) !important;
    }
    
    .sidebar-header { margin-bottom: 1rem; }
    
    .sidebar-nav ul { 
        display: flex; 
        flex-wrap: wrap; 
        justify-content: center;
        gap: 0.5rem;
    }
    
    .sidebar-nav ul li.nav-section { 
        width: 100%; 
        text-align: center; 
        padding: 1rem 0 0.2rem 0; 
    }
    
    .sidebar-nav ul li a { 
        padding: 0.6rem 1rem; 
        border-left: none; 
        border-bottom: 3px solid transparent; 
        border-radius: 6px;
    }
    
    /* Ajuste do botão ativo para Mobile (linha embaixo em vez da lateral) */
    .sidebar-nav ul li a.active { 
        border-right: none !important;
        border-bottom: 3px solid var(--primary-color) !important;
    }
    
    .main-content { 
        margin-left: 0; 
        padding: 1.5rem; 
        width: 100%;
    }
    
    .charts-grid { grid-template-columns: 1fr; }
}