/* Estilos customizados do sistema */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
    position: relative;
    width: 100%;
}

/* Wrapper para header e conteúdo */
.content-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Header fixo */
.navbar {
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.15s ease-in-out;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: rgba(255, 255, 255, 1);
    font-weight: 500;
}

/* Sidebar moderno - integrado abaixo do header */
.sidebar {
    min-height: calc(100vh - 76px);
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px 0;
}

.sidebar .nav {
    padding: 0 15px;
}

.sidebar .nav-item {
    margin-bottom: 5px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #212529;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: white;
    font-weight: 500;
}

.sidebar .nav-link span.nav-icon {
    margin-right: 12px;
    font-size: 20px;
    width: 24px;
    text-align: center;
    display: inline-block;
}

.sidebar .nav-link span:not(.nav-icon) {
    flex: 1;
}

/* Main content */
main {
    min-height: calc(100vh - 76px);
    background-color: #ffffff;
}

/* Footer */
footer.footer {
    background-color: #343a40 !important;
    color: #ffffff;
    width: 100vw !important;
    max-width: 100% !important;
    flex-shrink: 0;
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    clear: both;
    position: relative;
    left: 0;
    right: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

footer.footer .text-center {
    padding: 0 15px;
    max-width: 100%;
    margin: 0 auto;
}

/* Responsivo */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    main {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

.min-vh-100 {
    min-height: 100vh;
}

.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    border: none;
    border-radius: 10px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.table-responsive {
    overflow-x: auto;
}

.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Scrollbar personalizado para sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Estilos para impressão */
@media print {
    .sidebar, .navbar, .btn, .no-print {
        display: none !important;
    }
    
    main {
        margin-top: 0 !important;
    }
}

