/* =========================================
   1. VARIÁVEIS E CORES
   ========================================= */
   :root {
    --donlee-red: #e30613;
    --donlee-dark-red: #b80510;
    --donlee-deep-red: #75030a;
    --donlee-light-gray: #f8f9fa;
    --donlee-dark: #212529;
    --sidebar-width: 260px;
    --sidebar-mini-width: 85px;
}

/* =========================================
   2. SIDEBAR E LAYOUT PRINCIPAL
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, var(--donlee-dark-red) 0%, var(--donlee-deep-red) 100%);
    color: white;
    z-index: 1050;
    box-shadow: 4px 0 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease-in-out;
    overflow-y: auto; /* Mantém a funcionalidade de rolar */
    white-space: nowrap;
    overflow-x: hidden !important; 
    
    /* Oculta scrollbar no Firefox e IE/Edge antigo */
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* FIX: Oculta a barra no Chrome/Edge para a sidebar E TODOS os elementos filhos dela */
.sidebar::-webkit-scrollbar,
.sidebar *::-webkit-scrollbar {
    display: none !important;
    width: 0px !important;
    height: 0px !important;
    background: transparent !important;
    -webkit-appearance: none !important;
}

/* Bloqueia o eixo X e impede colunas laterais APENAS nos contêineres do menu (nav/ul) */
.sidebar .nav,
.sidebar ul {
    overflow-x: hidden !important;
    flex-wrap: nowrap !important;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 1.5rem;
    transition: margin-left 0.3s ease-in-out;
}

/* =========================================
   3. LOGOS E DIVISORES (ESTILOS BASE)
   ========================================= */
.sidebar .p-4 a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 75px; 
}

.logo-icon {
    width: 60px !important;
    height: 60px !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50% !important; 
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: block;
    margin: 0 auto;
}

.logo-full {
    height: 70px; 
    width: auto;  
    transition: all 0.3s ease;
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
    display: block;
    transition: width 0.3s ease; 
    width: 220px !important; 
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    margin-left: 20px !important; 
}

.sidebar .nav .sidebar-divider {
    margin-left: 12px !important; 
}

/* =========================================
   4. EFEITO RETRÁTIL (HOVER) - DESKTOP
   ========================================= */
@media (min-width: 992px) {
    .sidebar { width: var(--sidebar-mini-width); }
    .main-content { margin-left: var(--sidebar-mini-width); }
    
    .sidebar:hover {
        width: var(--sidebar-width);
        box-shadow: 4px 0 25px rgba(0,0,0,0.3);
    }
    
    .sidebar:hover ~ .main-content {
        margin-left: var(--sidebar-width);
    }

    .sidebar:not(:hover) .logo-full { display: none !important; }
    .sidebar:not(:hover) .logo-icon { display: block !important; margin: 0 auto; }
    .sidebar:hover .logo-full { display: block !important; margin: 0 auto; }
    .sidebar:hover .logo-icon { display: none !important; }
    
    .sidebar:not(:hover) .sidebar-divider { width: 45px !important; }

   .sidebar:not(:hover) .nav-link {
        font-size: 0 !important;             
        justify-content: center !important;  
        padding: 12px 0 !important;          
    }

    .sidebar:not(:hover) .nav-link.active {
        width: 77px !important;              
        margin-left: 0 !important;           
        padding: 12px 12px 12px 0 !important; 
    }

    .sidebar:not(:hover) .nav-link i {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 1.1rem !important;        
        margin: 0 !important;                
    }

    .sidebar:not(:hover) .nav-link.active i {
        color: var(--donlee-dark-red) !important;
    }

    .sidebar:not(:hover) .collapse,
    .sidebar:not(:hover) .fa-chevron-down,
    .sidebar:not(:hover) .sidebar-footer {
        display: none !important;            
    }
}

/* =========================================
   5. LINKS GERAIS E SUBMENUS
   ========================================= */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, padding 0.2s ease, margin 0.2s ease, width 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 2px;
    border-radius: 0;
    white-space: nowrap;
    min-height: 48px;
}

.sidebar .nav-link i {
    width: 25px;
    font-size: 1.1rem;
    text-align: center;
    transition: color 0.3s;
}

.sidebar .nav-link:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.2); 
    color: white !important;
    padding-left: 25px; 
}

.sidebar .nav-link span {
    display: flex;
    align-items: center;
}

.sidebar .nav-link.active {
    background: white !important; 
    color: var(--donlee-dark-red) !important; 
    font-weight: 700;
    border-top-left-radius: 30px; 
    border-bottom-left-radius: 30px;
    margin-left: 10px; 
    box-shadow: -3px 3px 10px rgba(0,0,0,0.2);
}

.sidebar .nav-link.active i {
    color: var(--donlee-dark-red) !important;
}

.sidebar .collapse .nav-link {
    padding-left: 15px;      
    font-size: 0.9em;        
    margin-left: 20px;       
    margin-right: 15px;      
    margin-top: 2px;         
    border-radius: 6px;      
    transition: all 0.2s;
}

.sidebar .collapse .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.2) !important; 
    padding-left: 20px !important; 
    color: white !important;
}

.sidebar .collapse .nav-link.active {
    background-color: #8a030a !important; 
    color: white !important;              
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2) !important; 
    border-radius: 6px !important;
    border: none !important;
    border-top-left-radius: 6px !important; 
    border-bottom-left-radius: 6px !important;
    margin-left: 20px !important; 
    margin-right: 15px !important;
    padding-left: 15px !important;
}

.sidebar .collapse .nav-link.active i {
    color: white !important;
    opacity: 1;
}

.sidebar .collapse .nav-link.active::after {
    content: none !important;
    display: none;
}

.sidebar .fa-chevron-down { transition: transform 0.3s; }
.sidebar .nav-link:not(.collapsed) .fa-chevron-down { transform: rotate(180deg); }

/* =========================================
   6. RESTANTE (Botões, Topbar, Mobile)
   ========================================= */
.sidebar .btn-logout { color: #ffcccc !important; margin-top: 1rem; }
.sidebar .btn-logout:hover { background-color: rgba(0,0,0,0.3) !important; color: white !important; }

.topbar {
    background: white; padding: 0.8rem 1.5rem; border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); margin-bottom: 2rem; border: 1px solid rgba(0,0,0,0.05);
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1040; backdrop-filter: blur(2px); }
    .sidebar-overlay.show { display: block; }
    
    .logo-full { display: block !important; margin: 0 auto; }
    .logo-icon { display: none !important; }
}

/* =========================================
   7. LANDING PAGE DONLEE
   ========================================= */
.text-donlee {
    color: var(--donlee-red) !important;
}

.bg-donlee-light {
    background-color: rgba(227, 6, 19, 0.1) !important; 
}

.bg-donlee-gradient {
    background: linear-gradient(135deg, var(--donlee-red) 0%, var(--donlee-dark-red) 100%);
}

.hero-section {
    background-color: #ffffff;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.feature-card {
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: #fff;
    border-radius: 16px !important;
}

.feature-card:hover {
    transform: translateY(-10px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

.icon-box {
    width: 60px;
    height: 60px;
    background-color: rgba(227, 6, 19, 0.08); 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--donlee-red);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover .icon-box {
    background-color: var(--donlee-red);
    color: white;
}

.ls-1 { letter-spacing: 1px; }
.ls-2 { letter-spacing: 2px; }

/* =========================================
   8. FOOTER MODERNO DONLEE
   ========================================= */
.footer-donlee {
    background-color: #111 !important; 
    border-top: 4px solid #e30613; 
}

.title-decoration::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: #e30613;
    margin-top: 10px;
    border-radius: 2px;
}

.icon-circle {
    width: 35px;
    height: 35px;
    background-color: rgba(227, 6, 19, 0.1); 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e30613;
}

.footer-link, .hover-link {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link:hover, .hover-link:hover {
    color: #e30613 !important;
    padding-left: 5px; 
}

.btn-social {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-social:hover {
    background-color: #e30613;
    border-color: #e30613;
    color: white;
    transform: translateY(-3px);
}

/* =========================================
   9. HERO SECTION FULL
   ========================================= */
.hero-section-full {
    min-height: 650px; 
    max-height: 800px; 
    background-size: cover;           
    background-position: center center; 
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-section-full {
        min-height: 500px; 
        background-position: center top; 
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.8));
    z-index: 1;
}

.z-index-2 {
    z-index: 2;
    position: relative;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.9) !important; 
}

/* =========================================
   10. RECORTE ONDULADO (WAVE DIVIDER)
   ========================================= */
.hero-wave-divider {
    position: absolute;
    bottom: -1px; 
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg); 
    z-index: 3; 
}

.hero-wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 100px; 
}

.hero-wave-divider .shape-fill {
    fill: #f8f9fa; 
}

@media (max-width: 768px) {
    .hero-section-full {
        min-height: auto;
        padding-bottom: 120px; 
    }
    .hero-wave-divider svg {
        height: 50px; 
    }
}

/* =========================================
   11. PINO (FIXAR SIDEBAR ABERTA)
   ========================================= */

/* 11.1 Força a largura da barra */
body.sidebar-pinned .sidebar { 
    width: var(--sidebar-width) !important; 
    box-shadow: 4px 0 25px rgba(0,0,0,0.3) !important; 
}
body.sidebar-pinned .main-content { 
    margin-left: var(--sidebar-width) !important; 
}

/* 11.2 ANULA ESTRITAMENTE as regras do ':not(:hover)' que quebravam o layout */
body.sidebar-pinned .sidebar:not(:hover) .logo-full { display: block !important; margin: 0 auto; }
body.sidebar-pinned .sidebar:not(:hover) .logo-icon { display: none !important; }
body.sidebar-pinned .sidebar:not(:hover) .sidebar-divider { width: 220px !important; }

/* Restaura o layout flex do seu HTML para os botões principais */
body.sidebar-pinned .sidebar:not(:hover) .nav-link {
    font-size: 1rem !important; 
    padding: 12px 20px !important;
}

/* Permite que o seu "justify-content-between" funcione perfeitamente para as setas */
body.sidebar-pinned .sidebar:not(:hover) .nav-link.justify-content-between { justify-content: space-between !important; }
body.sidebar-pinned .sidebar:not(:hover) .nav-link:not(.justify-content-between) { justify-content: flex-start !important; }

/* Restaura o Botão Ativo (Dashboard) respeitando o espaçamento do seu container */
body.sidebar-pinned .sidebar:not(:hover) .nav-link.active {
    width: auto !important;
    margin-left: 10px !important; 
    padding: 12px 20px !important; 
}

/* CORREÇÃO AQUI: Restaura APENAS os ícones principais (ignora a seta para não bugar o tamanho) */
body.sidebar-pinned .sidebar:not(:hover) .nav-link i.me-2 {
    color: inherit !important;
    font-size: 1.1rem !important;
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}
body.sidebar-pinned .sidebar:not(:hover) .nav-link.active i.me-2 {
    color: var(--donlee-dark-red) !important;
}

/* Restaura a exibição das setas (chevrons) e do rodapé mantendo o tamanho nativo do seu HTML */
body.sidebar-pinned .sidebar:not(:hover) .fa-chevron-down { 
    display: inline-block !important; 
    font-size: 0.75rem !important; 
}
body.sidebar-pinned .sidebar:not(:hover) .sidebar-footer { display: block !important; }

/* 11.3 Mantém o funcionamento da sanfona (Bootstrap) intacto */
body.sidebar-pinned .sidebar:not(:hover) .collapse.show { display: block !important; }
body.sidebar-pinned .sidebar:not(:hover) .collapse:not(.show) { display: none !important; }

/* Restaura os botões de DENTRO da sanfona para ficarem idênticos ao original */
body.sidebar-pinned .sidebar:not(:hover) .collapse .nav-link {
    padding: 12px 15px !important;
    padding-left: 15px !important;      
    font-size: 0.9em !important;        
    margin-left: 20px !important;       
    margin-right: 15px !important; 
}

/* 11.4 Estilização do PINO */
#btnPinSidebar:hover #iconePin { color: rgba(255, 255, 255, 0.9) !important; }
body.sidebar-pinned #iconePin { color: #ffffff !important; transform: rotate(45deg) !important; }

/* =========================================
   12. AJUSTES DO MENU RETRAÍDO (LOGOTIPO E PINO)
   ========================================= */

/* 12.1 Esconde o pino quando a barra está encolhida */
body:not(.sidebar-pinned) .sidebar:not(:hover) #btnPinSidebar {
    display: none !important;
}

/* 12.2 Remove o padding lateral para o ícone de 60px caber no centro dos 85px */
body:not(.sidebar-pinned) .sidebar:not(:hover) .p-4 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}