/**
 * Estilos principais do Sistema ITEC - Evolua
 * Correções finais de layout
 */

/* Reset e estilos gerais */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Wrapper principal */
.wrapper {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Menu lateral */
.sidebar {
    min-width: 250px;
    max-width: 250px;
    min-height: 100vh;
    background-color: #004080;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 999;
}

/* Logo do menu lateral */
.sidebar-header {
    padding: 15px;
    text-align: center;
}

.sidebar-header img {
    max-width: 100%;
    height: auto;
}

/* Links do menu */
.sidebar-menu {
    padding: 0;
    list-style: none;
}

.sidebar-menu li a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #17a2b8;
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Content wrapper */
.content-wrapper {
    width: 100% !important;
    min-height: 100vh;
    margin-left: 250px !important;
    padding: 0 !important;
    position: relative;
    flex: 1 !important;
}

/* Cabeçalho principal - CORREÇÃO CRÍTICA */
.main-header {
    width: 100% !important;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    width: 100% !important;
    padding: 0.5rem 1rem !important;
}

.navbar-dark {
    width: 100% !important;
}

.navbar-dark.bg-primary {
    background-color: #0059b3 !important;
}

.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 15px !important;
    margin: 0 !important;
}

/* Conteúdo principal */
.main-content {
    padding: 20px;
    width: 100% !important;
}

/* Cards e painéis */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    width: 100%;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
    font-weight: 600;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.card-body {
    padding: 20px;
}

/* Dashboard cards */
.dashboard-card {
    height: 100%;
    text-align: center;
    padding: 20px;
    transition: all 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #0059b3;
}

.dashboard-icon i {
    font-size: 48px;
    margin-bottom: 10px;
    color: #0059b3;
}

/* Tabelas */
.table {
    width: 100%;
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-top: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Botões */
.btn-primary {
    background-color: #0059b3;
    border-color: #0059b3;
}

.btn-primary:hover {
    background-color: #004080;
    border-color: #004080;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

/* Formulários */
.form-control:focus {
    border-color: #0059b3;
    box-shadow: 0 0 0 0.2rem rgba(0, 89, 179, 0.25);
}

/* Página de login */
.login-container {
    max-width: 400px;
    margin: 10vh auto;
    padding: 30px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 150px;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
        position: fixed;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .dashboard-icon {
        font-size: 2.5rem;
    }
    
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Estilos específicos para os cards do dashboard */
.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    width: 100%;
}

.dashboard-col {
    flex: 1;
    padding: 10px;
    min-width: 250px;
}

@media (max-width: 992px) {
    .dashboard-col {
        flex: 0 0 50%;
    }
}

@media (max-width: 576px) {
    .dashboard-col {
        flex: 0 0 100%;
    }
}

/* Ajuste de espaçamento */
.dashboard-card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #0059b3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-card-icon i,
.dashboard-card-icon img {
    font-size: 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
