/**
 * Admin - CSS Principal Consolidado
 * Template - Sistema de Gestão - By mbiasotto.com
 */

/* Importação do CSS do Admin */
@import url('./css/admin.css');

/* Tema azul customizado - sobrescreve os outros estilos */
@import url('./css/custom-admin.css');

/* Adiciona !important para garantir sobrescrita */
.badge-primary {
    background-color: var(--admin-primary) !important;
}

.btn-primary {
    background-color: var(--admin-primary) !important;
    border-color: var(--admin-primary) !important;
}

/* Botão de Filtrar - cor cinza conforme design original */
.btn-filtrar,
.filter-container button[type="submit"],
button[type="submit"].btn-primary.w-100 {
    background-color: #8d99ae !important;
    border-color: #8d99ae !important;
}

.btn-filtrar:hover,
.filter-container button[type="submit"]:hover,
button[type="submit"].btn-primary.w-100:hover {
    background-color: #7d8a9e !important;
    border-color: #7d8a9e !important;
}

.sidebar {
    background-color: var(--admin-primary) !important;
}

/* Correções para botões de ação */
.action-buttons {
    display: flex !important;
    gap: 0.30rem !important;
    justify-content: flex-end !important;
}

.action-buttons .btn,
.action-buttons .action-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.action-buttons .btn[title*="Editar"],
.action-buttons .action-btn[title*="Editar"] {
    background-color: rgba(29, 64, 174, 0.1) !important;
    color: var(--admin-primary) !important;
}

.action-buttons .btn[title*="Excluir"],
.action-buttons .action-btn[title*="Excluir"] {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

/* Estilos para o Header Mobile */
.mobile-header {
    background-color: var(--admin-primary);
    color: #fff;
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: none;
}

.mobile-header-container {
    width: 80%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.mobile-logo {
    max-height: 30px;
}

.mobile-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
}

.mobile-toggle-btn:hover,
.mobile-toggle-btn:active,
.mobile-toggle-btn:focus {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Ajustes de padding para o conteúdo principal em mobile */
@media (max-width: 767.98px) {
    .mobile-header {
        display: block;
    }

    body {
        padding-top: 60px;
    }

    .main-content {
        padding: 1rem !important;
        margin-left: 0 !important;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Filtros em acordeão */
    .filter-collapse {
        display: none;
        margin-bottom: 1rem;
    }

    .filter-collapse.show {
        display: block;
    }

    .filter-toggle-btn {
        margin-bottom: 0.5rem;
    }

    /* Ajustes para tabelas em mobile */
    .mobile-table-container {
        margin: 0 -1rem;
        border-radius: 0;
        width: calc(100% + 2rem);
    }

    .table th {
        white-space: nowrap;
    }

    .p-4 {
        padding: .8rem !important;
    }

    .form-control-lg {
        font-size: 1rem;
    }

    .mb-3 {
        margin-bottom: .5rem !important;
    }

    .page-title {
        margin-bottom: .2rem !important;
    }
}

/* Estilos para quando o sidebar está aberto */
body.sidebar-open {
    overflow: hidden;
}

/* Overlay do sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}
