:root { 
    --sidebar-width: 250px;
    --transition-speed: 0.3s;
}

body { 
    background-color: #f8f9fa; 
    transition: margin var(--transition-speed) ease;
}

/* Sidebar */
.sidebar { 
    position: fixed; 
    top: 0; 
    left: 0; 
    height: 100vh; 
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: white; 
    z-index: 1000;
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar a { 
    color: white; 
    text-decoration: none; 
    display: block; 
    padding: 12px 20px; 
}

.sidebar a:hover, 
.sidebar a.active { 
    background: rgba(255,255,255,0.1); 
    border-left: 4px solid white; 
}

.main-content { 
    margin-left: var(--sidebar-width); 
    padding: 0;
    transition: margin var(--transition-speed) ease;
}

.topbar { 
    background: white; 
    padding: 15px 30px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 900;
}

/* Menu Toggle Button (visível apenas em mobile) */
.menu-toggle {
    background: none;
    border: none;
    color: #000;
    font-size: 1.9rem;
    cursor: pointer;
    padding: 0;
    display: none;
    margin: 0;
    line-height: 1;
}

/* Ajustes para o botão de menu no mobile */
@media (max-width: 991.98px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        margin: 0 8px 0 -12px; /* Ajustado para puxar o botão ainda mais para a esquerda */
    }
    
    .menu-toggle i {
        font-size: 1.9rem;
        color: #E2191A; /* Alterado para vermelho */
    }
    
    .topbar h4 {
        display: flex;
        align-items: center;
        margin: 0;
    }
}

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Estilos existentes */
.card { 
    border: none; 
    border-radius: 10px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    overflow-x: auto;
}

.status-badge { 
    padding: 5px 10px;   
    border-radius: 20px; 
    font-size: 0.8rem; 
}

.table th { 
    border-top: none; 
    font-weight: 600; 
    color: #6c757d; 
    white-space: nowrap;
}

/* Melhorias para os botões de ação */
.btn-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.btn-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Estilo do botão de sair */
.sidebar .btn-light {
    background-color: #f8f9fa;
    color: #212529 !important;
    border: 1px solid #dee2e6;
}
 
.sidebar .btn-light:hover {
    background-color: #e9ecef;
    color: #212529 !important;
}

/* Ajustes para o botão com ícone e texto */
.btn-icon-text .btn-text {
    display: inline;
}

.btn-icon-text .btn-icon {
    display: none;
}

/* Estilos para o rodapé da sidebar */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 1000;
    max-height: 40vh; /* Limita a altura máxima do rodapé */
    overflow-y: auto; /* Adiciona rolagem se o conteúdo for muito grande */
}

/* Responsividade */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        height: 100%;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Ajustes para o rodapé no mobile */
    .sidebar-footer {
        position: relative; /* Muda para relativo para rolagem suave */
        bottom: auto;
        border-top: 1px solid #dee2e6;
    }
    
    /* Garante que o conteúdo principal da sidebar não fique escondido atrás do rodapé */
    .sidebar > nav {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .btn-actions {
        gap: 0.25rem;
    }
    
    .btn-actions .btn {
        padding: 0.2rem 0.4rem;
    }
    
    .btn-actions .btn i {
        margin: 0;
    }
    
    .btn-actions .btn span {
        display: none;
    }
    
    .btn-icon-text .btn-text {
        display: none;
    }
    
    .btn-icon-text .btn-icon {
        display: inline-block;
    }
    
    .table td, .table th {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Estilos da página de login */
body.login-page { 
    background-color: #f0f2f5; 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.login-card { 
    background: white; 
    border-radius: 15px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
    max-width: 400px; 
    width: 100%; 
    overflow: hidden; 
}

.login-header { 
    background-color: #00a884; 
    color: white; 
    padding: 30px; 
    text-align: center; 
}

.login-header i { 
    font-size: 3rem; 
}

.login-body { 
    padding: 30px; 
}

.btn-login { 
    background-color: #1877f2; 
    border: none; 
    padding: 12px; 
    font-weight: 600; 
    width: 100%;
    color: white;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #166fe5; 
    color: white;
}