/* ============================================================
   RESET E CONFIGURAÇÕES GERAIS
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; }
html, body { height: 100%; width: 100%; background-color: #f4f6f9; margin: 0; }

/* ============================================================
   SIDEBAR (MENU LATERAL FIXO)
   ============================================================ */
.sidebar { 
    width: 260px; 
    background-color: #ffffff; 
    padding: 25px 20px; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid #e0e0e0; 
    height: 100vh; 
    position: fixed; 
    left: 0; 
    top: 0; 
    z-index: 1000; 
    overflow-y: auto; 
    box-shadow: 4px 0 15px rgba(0,0,0,0.03); 
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

.logo-area { display: flex; align-items: center; margin-bottom: 25px; padding-left: 5px; }
.logo-icon { width: 45px; height: 45px; background-color: #c8102e; color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; margin-right: 12px; }
.logo-text { font-size: 15px; font-weight: 700; color: #0a3161; line-height: 1.2; }
.logo-text span { font-weight: 400; display: block; font-size: 11px; color: #666; }

.nav-menu { list-style: none; flex-grow: 1; display: flex; flex-direction: column; }
.nav-item { margin-bottom: 8px; }
.nav-link { display: flex; align-items: center; padding: 12px 15px; text-decoration: none; color: #4a5568; border-radius: 10px; font-size: 15px; font-weight: 500; transition: all 0.2s ease; border-left: 4px solid transparent; cursor: pointer; }
.nav-link i { width: 24px; margin-right: 15px; font-size: 18px; color: #718096; }
.nav-link:hover { background-color: #f8fafc; color: #0a3161; }
.nav-link:hover i { color: #c8102e; }
.nav-link.active { background-color: #eef2f7; color: #0a3161; font-weight: 700; border-left: 4px solid #c8102e; }
.nav-link.active i { color: #c8102e; }

.nav-item-sair { margin-top: auto; padding-top: 10px; border-top: 1px solid #e8ecf0; }
.nav-link-sair { display: flex; align-items: center; padding: 12px 15px; text-decoration: none; color: #c8102e; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; background: transparent; }
.nav-link-sair i { width: 24px; margin-right: 15px; font-size: 18px; color: #c8102e; }
.nav-link-sair:hover { background-color: #fde8ec; color: #8b1a1a; }
.nav-link-senha { display: flex; align-items: center; padding: 12px 15px; text-decoration: none; color: #0a3161; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; background: transparent; margin-top: 10px; }
.nav-link-senha i { width: 24px; margin-right: 15px; font-size: 18px; color: #0a3161; }
.nav-link-senha:hover { background-color: #eef2f7; color: #c8102e; }
.nav-badge { background: #c8102e; color: white; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 800; margin-left: auto; }

/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */
.main-content { 
    margin-left: 260px; 
    padding: 30px 40px; 
    min-height: 100vh; 
    background: #f4f6f9;
    transition: margin-left 0.3s;
}
.main-content::-webkit-scrollbar { width: 8px; }
.main-content::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }

/* ============================================================
   CABEÇALHO E DROPDOWNS
   ============================================================ */
.top-header-curso { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.top-header-curso h2 { color: #0a3161; font-weight: 800; font-size: 24px; margin-bottom: 4px; }
.top-header-curso p { color: #555; font-size: 14px; }

.dropdown-niveis-container { position: relative; }
.btn-dropdown-nivel { background: white; border: 1px solid #e8ecf0; padding: 10px 18px; border-radius: 8px; font-weight: 700; color: #0a3161; cursor: pointer; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: 0.2s; font-size: 14px; }
.btn-dropdown-nivel:hover { border-color: #0a3161; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.btn-dropdown-nivel i.fa-chevron-down { font-size: 12px; color: #888; }

.dropdown-menu-niveis { display: none; position: absolute; right: 0; top: 110%; background: white; min-width: 240px; box-shadow: 0 10px 30px rgba(10,49,97,0.15); border-radius: 12px; border: 1px solid #e8ecf0; z-index: 100; overflow: hidden; animation: fadeIn 0.2s ease; }
.dropdown-menu-niveis.show { display: block; }
.dropdown-menu-niveis .dropdown-header { padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid #e8ecf0; font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; text-align: center; letter-spacing: 0.5px; }
.dropdown-item-nivel { padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; font-size: 14px; color: #4a5568; font-weight: 500; }
.dropdown-item-nivel:last-child { border-bottom: none; }
.dropdown-item-nivel.active { background: #eef2f7; color: #c8102e; font-weight: 700; border-left: 4px solid #c8102e; padding-left: 14px; }
.dropdown-item-nivel.locked { color: #a0aec0; cursor: not-allowed; background: #fafbfc; }
.dropdown-item-nivel.locked i { font-size: 12px; color: #cbd5e0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   RESPONSIVIDADE (TELAS MENORES)
   ============================================================ */
.menu-toggle { display: none; position: fixed; top: 15px; left: 15px; z-index: 1001; background: #0a3161; color: white; border: none; padding: 10px 14px; border-radius: 8px; font-size: 20px; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.15); }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 49, 97, 0.5); z-index: 999; }

@media (max-width: 1200px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease-in-out; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0 !important; padding: 20px 15px; padding-top: 75px; }
    .menu-toggle { display: block; }
    .sidebar-overlay.active { display: block; }
    
    .top-header-curso { flex-direction: column; align-items: stretch; gap: 15px; }
    .dropdown-niveis-container { width: 100%; position: relative; }
    .btn-dropdown-nivel { width: 100%; justify-content: space-between; }
    .dropdown-menu-niveis { width: 100%; left: 0; right: auto; }
}