/* ========================================
   MODERN BOOTSTRAP ENHANCEMENTS
   Melhorias visuais modernas mantendo Bootstrap
   ======================================== */

/* ===== FONTES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== SCROLLBAR MODERNA ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0066cc 0%, #0052a3 100%);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0052a3 0%, #003d7a 100%);
}

/* ===== CARDS MODERNOS ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    border: none;
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

.card-body {
    padding: 1.5rem;
}

/* Headers com gradiente */
.card-header.bg-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.card-header.bg-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

/* ===== BOTÕES MODERNOS ===== */
.btn {
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    color: white;
}

/* Botões pequenos */
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

/* Botões grandes */
.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
    border-radius: 12px;
}

/* ===== BADGES MODERNOS ===== */
.badge {
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.025em;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

/* ===== TABELAS MODERNAS ===== */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f1f5f9;
    transform: scale(1.01);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}

.table-bordered {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

/* ===== ALERTS MODERNOS ===== */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
    color: #065f46;
}

.alert-info {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    border-left-color: #06b6d4;
    color: #164e63;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
    color: #991b1b;
}

/* ===== FORMULÁRIOS MODERNOS ===== */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.9375rem;
}

.form-control:focus, .form-select:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* ===== BREADCRUMB MODERNO ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.25rem;
    color: #94a3b8;
}

.breadcrumb-item a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #0052a3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #64748b;
    font-weight: 500;
}

/* ===== MODAIS MODERNOS ===== */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
}

/* ===== DROPDOWN MODERNO ===== */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 82, 163, 0.1) 100%);
    color: #0066cc;
}

/* ===== PROGRESS BAR MODERNO ===== */
.progress {
    height: 12px;
    border-radius: 10px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #0066cc 0%, #0052a3 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

/* ===== SOMBRAS PERSONALIZADAS ===== */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* ===== TÍTULOS MODERNOS ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.025em;
    margin-top: 0 !important;
}

/* Títulos dentro do conteúdo principal */
#main-content h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    margin-top: 4rem !important;
}

#main-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.875rem;
    margin-top: 0 !important;
}

#main-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 0 !important;
}

/* Títulos de página específicos */
.page-header h1 {
    font-size: 1.75rem !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
}

.page-header p {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Card headers não devem ser afetados */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    font-size: inherit !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* ===== ÍCONES COLORIDOS ===== */
.bi-file-earmark-text-fill {
    color: #0066cc;
}

.bi-currency-dollar {
    color: #10b981;
}

.bi-calendar-event {
    color: #06b6d4;
}

.bi-info-circle {
    color: #0066cc;
}

.bi-calculator {
    color: #10b981;
}

/* ===== BACKGROUND GRADIENTE SUAVE ===== */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    min-height: 100vh;
}

/* ===== HEADER DO SISTEMA ===== */
.header {
    min-height: auto !important;
    padding: 0.75rem 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

.brand-title {
    font-size: 1.35rem !important;
    margin: 0 !important;
}

/* ===== CONTAINER MODERNO ===== */
.container-fluid {
    padding: 1.5rem;
    margin-top: 0 !important;
}

/* Ajuste para não tampar conteúdo - CORRIGIDO COM MAIS ESPAÇO */
#main-content {
    padding-top: 120px !important;
    margin-top: 0 !important;
}

/* Page header sem espaço extra mas com espaço do header fixo */
.page-header {
    margin-top: 4rem !important;
    padding-top: 0 !important;
}

/* Container fluid sem margem superior */
.container-fluid.mt-4 {
    margin-top: 0 !important;
}

/* Primeiro elemento do main-content */
#main-content > .container-fluid:first-child {
    padding-top: 4rem !important;
}

/* ===== STATS/MÉTRICAS CARDS ===== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #0066cc;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0066cc;
    margin: 0;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .card {
        border-radius: 12px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* ===== HOVER EFFECTS GLOBAIS ===== */
a {
    transition: all 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* ===== LOADING SPINNER MODERNO ===== */
.spinner-border {
    border-width: 3px;
}

.spinner-border-sm {
    border-width: 2px;
}

/* ===== SIDEBAR MODERNA ===== */
#sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    border-right: 1px solid #e2e8f0;
}

/* Links da sidebar */
#sidebar .nav-link {
    border-radius: 10px;
    margin: 0.25rem 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#sidebar .nav-link:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08) 0%, rgba(0, 82, 163, 0.08) 100%);
    color: #0066cc;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

#sidebar .nav-link.active {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    font-weight: 600;
}

#sidebar .nav-link.active:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

#sidebar .nav-link i {
    font-size: 1.125rem;
    min-width: 24px;
    text-align: center;
}

/* Ícones coloridos na sidebar */
#sidebar .nav-link:not(.active) i.bi-house-door {
    color: #3b82f6;
}

#sidebar .nav-link:not(.active) i.bi-people {
    color: #8b5cf6;
}

#sidebar .nav-link:not(.active) i.bi-file-earmark-text {
    color: #10b981;
}

#sidebar .nav-link:not(.active) i.bi-calculator {
    color: #f59e0b;
}

#sidebar .nav-link:not(.active) i.bi-graph-up {
    color: #06b6d4;
}

#sidebar .nav-link:not(.active) i.bi-gear {
    color: #6b7280;
}

/* Separadores na sidebar */
#sidebar hr {
    border-color: #e2e8f0;
    opacity: 0.5;
    margin: 1rem 0.5rem;
}

/* Títulos de seção na sidebar */
#sidebar .nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
}

/* Sidebar colapsada - CORRIGIDO */
#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

#sidebar.collapsed .sidebar-text {
    display: none !important;
}

#sidebar.collapsed .nav-link i {
    margin: 0;
}

/* Badge na sidebar */
#sidebar .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

/* Dropdown na sidebar */
#sidebar .dropdown-menu {
    margin-left: 1rem;
    border: none;
    background: #f8fafc;
}

#sidebar .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

#sidebar .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08) 0%, rgba(0, 82, 163, 0.08) 100%);
    color: #0066cc;
}

/* Scroll suave na sidebar */
#sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
