:root {
    --primary: #1a237e;
    --secondary: #2e7d32;
    --bg: #f4f7f6;
    --card: #ffffff;
    --text-main: #1c1c1c;
    --text-muted: #757575;
    --border: rgba(0,0,0,0.08);
    --radius: 18px;
}

body.dark-mode {
    --bg: #121212;
    --card: #1e1e1e;
    --text-main: #f0f0f0;
    --text-muted: #aaaaaa;
    --border: rgba(255,255,255,0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body { 
    background-color: var(--bg); 
    color: var(--text-main); 
    line-height: 1.6; 
    transition: background 0.3s, color 0.3s; 
}

a { text-decoration: none; color: inherit; }

/* Utilitários */
.skeleton { 
    background: #e0e0e0; 
    border-radius: 12px; 
    animation: skeleton-loading 1.5s infinite linear; 
}
body.dark-mode .skeleton { background: #2a2a2a; }
@keyframes skeleton-loading { 
    0%, 100% { opacity: 0.6; } 
    50% { opacity: 1; } 
}

/* --- AJUSTES DE CORREÇÃO (MENU E CABEÇALHO) --- */

#header-container {
    position: sticky;
    top: 0;
    background-color: var(--bg);
    z-index: 1000; /* Fica acima do conteúdo, mas abaixo do menu lateral */
    border-bottom: 1px solid var(--border);
    width: 100%;
}

#side-menu {
    position: fixed;
    top: 0;
    left: -100%; /* Começa escondido */
    width: 280px;
    height: 100vh;
    background-color: var(--card); /* Fundo sólido para não ficar transparente */
    z-index: 9999; /* Camada máxima para cobrir tudo */
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0,0,0,0.2);
    padding: 20px;
    overflow-y: auto;
}

/* Estilo para quando o menu estiver aberto (controlado pelo JS) */
#side-menu.active {
    left: 0;
}

/* Barra de busca no cabeçalho */
#search-box-header {
    background-color: var(--card);
    z-index: 1001;
    position: relative;
}

/* Overlay opcional: um fundo escuro atrás do menu quando ele abre */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}
