/* Background global do sistema */
body {
    background: #ffffff;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(43, 85, 152, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(43, 85, 152, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(248, 249, 250, 0.6) 0%, transparent 50%);
    z-index: -1;
}

/* Container principal */
.container-fluid {
    background: transparent;
}

/* Cores globais padronizadas */
.bg-primary {
    background: #2b5598 !important;
}

.btn-primary {
    background: #2b5598;
    border-color: #2b5598;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #1e3a6f;
    border-color: #1e3a6f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 85, 152, 0.3);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(43, 85, 152, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Cards padronizados */
.card {
    border: 1px solid rgba(230, 236, 241, 0.8);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-info):not(.bg-secondary):not(.card-gasto-total) {
    background: #ffffff;
}

.card-header {
    border-bottom: none;
    border-radius: 1rem 1rem 0 0 !important;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.card-header:not(.card-header-white) {
    background: #ffffff;
    color: white;
}

.card-body {
    padding: 1.5rem;
}

.card:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-info):not(.bg-secondary):not(.card-gasto-total) .card-body {
    background: #ffffff;
}

/* Logo responsivo padronizado */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .logo-container img {
        max-height: 40px;
    }
}

/* Títulos padronizados */
h1, h2, h3, h4, h5, h6 {
    color: #2b5598;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Breadcrumbs padronizados */
.breadcrumb {
    background: rgba(248, 249, 250, 0.6);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
}

/* Outros cabeçalhos padronizados com #2b5598 */
.accordion-header .accordion-button {
    background: #2b5598;
    color: white;
    border: none;
}

.accordion-header .accordion-button:not(.collapsed) {
    background: #2b5598;
    color: white;
}

.list-group-item.active {
    background: #2b5598;
    color: white;
    border-color: #2b5598;
}

.offcanvas-header {
    background: #2b5598;
    color: white;
    border-bottom: none;
}

.nav-tabs .nav-link.active {
    background: #2b5598;
    color: white;
    border-color: #2b5598;
}

.nav-pills .nav-link.active {
    background: #2b5598;
    color: white;
}

/* Elementos informativos com cor primária */
.alert.alert-primary {
    background: rgba(43, 85, 152, 0.1);
    color: #2b5598;
    border: 1px solid rgba(43, 85, 152, 0.2);
}

.text-primary {
    color: #2b5598 !important;
}

/* Elementos de destaque */
.bg-light {
    background: #f8f9fa !important;
}

.border-primary {
    border-color: #2b5598 !important;
}

/* Cabeçalhos específicos com fundo branco */
.card-header-white {
    background: #ffffff !important;
    color: #495057 !important;
    border-bottom: 1px solid rgba(230, 236, 241, 0.8) !important;
}

/* Card específico do Gasto Total */
.card-gasto-total {
    background-color: #ffffff !important;
    border: 1px solid rgba(230, 236, 241, 0.8) !important;
}

.card-gasto-total .card-body {
    background: #ffffff !important;
}

/* Cabeçalho da tabela de relatórios com fundo azul */
.table-relatorios thead th {
    background: #2b5598 !important;
    color: #ffffff !important;
    border: 1px solid #2b5598 !important;
}

/* Dropdown padronizado */
.dropdown-menu {
    border: 1px solid rgba(230, 236, 241, 0.8);
    border-radius: 0.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    background: #ffffff;
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: #495057;
    text-decoration: none;
    background-color: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #2b5598;
    background: rgba(43, 85, 152, 0.1);
    transform: translateX(4px);
}

.dropdown-item:active {
    color: #fff;
    background: linear-gradient(135deg, #2b5598 0%, #1e3a6f 100%);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

/* Dropdown item ativo */
.dropdown-item.active {
    background: linear-gradient(135deg, #2b5598 0%, #1e3a6f 100%);
    color: white;
    font-weight: 600;
    transform: translateX(4px);
}

.module-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease, background-color 0.08s ease;
}
.module-card .card-body { cursor: pointer; }
.module-card:hover,
.module-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08);
    border-color: #0d6efd;
}
.module-card:hover .card-body,
.module-card:focus-within .card-body {
    background-color: rgba(13, 110, 253, 0.04);
}
.module-card:active {
    transform: translateY(0);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
    border-color: #0d6efd;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

@media (min-width: 768px) {
    .chart-wrapper { height: 360px; }
}

@media (min-width: 992px) {
    .chart-wrapper { height: 420px; }
}

@media (min-width: 1200px) {
    .chart-wrapper { height: 460px; }
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.dropdown-item.active:hover {
    background: linear-gradient(135deg, #1e3a6f 0%, #2b5598 100%);
    color: white;
}

/* Dropdown divider */
.dropdown-divider {
    border-color: rgba(230, 236, 241, 0.8);
    margin: 0.5rem 0;
}

/* Navbar padronizada */
.navbar-dark .navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem;
    position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-dark .navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-dark .navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
}

/* Dropdown toggle ativo */
.navbar-dark .navbar-nav .dropdown-toggle.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-dark .navbar-nav .dropdown-toggle.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
}

/* Botões padronizados */
.btn {
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #e0a800;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    color: #212529;
}

.btn-info {
    background: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    background: #138496;
    border-color: #138496;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Position relative for autocomplete containers */
.position-relative {
    position: relative;
}

/* Paginação padronizada */
.pagination {
    --bs-pagination-border-radius: 0.75rem;
}

.page-link {
    border: 2px solid #f1f3f4;
    color: #2b5598;
    background: #fafbfc;
    transition: all 0.3s ease;
    border-radius: 0.5rem !important;
    margin: 0 0.125rem;
}

.page-link:hover {
    background: rgba(43, 85, 152, 0.1);
    border-color: #2b5598;
    color: #2b5598;
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background: #2b5598;
    border-color: #2b5598;
    color: white;
}

.page-item.disabled .page-link {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

/* Badges padronizados */
.badge {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.badge.bg-primary {
    background: #2b5598 !important;
}

/* Estilos modernos para tela de login */
.login-container {
    background: rgba(248, 249, 250, 0.4);
    border-radius: 2rem;
    border: 1px solid rgba(230, 236, 241, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

/* Modais padronizados */
.modal-content {
    border-radius: 1rem;
    border: 1px solid rgba(230, 236, 241, 0.8);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: #2b5598;
    color: #ffffff !important;
    border-bottom: none;
    border-radius: 1rem 1rem 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-header * {
    color: #ffffff !important;
}

.modal-title {
    font-weight: 600;
    color: #ffffff !important;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(230, 236, 241, 0.5);
    padding: 1rem 1.5rem;
    background: rgba(248, 249, 250, 0.3);
    border-radius: 0 0 1rem 1rem;
}

.login-card {
    background: #ffffff;
    border-radius: 1.5rem !important;
    border: 1px solid rgba(230, 236, 241, 0.8);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Inputs de busca padronizados */
.search-container {
    position: relative;
}

.search-container .form-control {
    padding-left: 2.5rem;
}

.search-container .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Tooltips padronizados */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background: #2b5598;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.login-header {
    background: linear-gradient(135deg, #2b5598 0%, #1e3a6f 100%) !important;
    border: none !important;
    padding: 1rem 1.5rem;
    border-radius: 0 !important;
}

.login-header h3 {
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.login-header h6 {
    font-weight: 400;
    opacity: 0.9;
    font-size: 0.9rem;
    color: #ffffff;
}

.login-body {
    padding: 2rem 2rem 2.5rem;
}

/* Form controls específicos para login */
.login-card .form-control {
    border-radius: 0.75rem !important;
    border: 2px solid #f1f3f4;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

/* Form controls focus específicos para login */
.login-card .form-control:focus {
    border-color: #2b5598;
    box-shadow: 0 0 0 0.2rem rgba(43, 85, 152, 0.25);
    background: #fff;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: left;
    display: block;
}

.btn-login {
    background: #2b5598;
    border: none;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(43, 85, 152, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 85, 152, 0.4);
    background: #1e3a6f;
}

.btn-login:active {
    transform: translateY(0);
}

.form-check-input:checked {
    background-color: #2b5598;
    border-color: #2b5598;
}

.form-check-label {
    font-size: 0.9rem;
    color: #6c757d;
    cursor: pointer;
}

.form-check-input {
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(43, 85, 152, 0.25);
}

.logo-modern {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease;
}

.logo-modern:hover {
    transform: scale(1.05);
}

.alert-danger {
    border-radius: 0.75rem;
    border: 1px solid rgba(220, 53, 69, 0.2);
    background: rgba(248, 215, 218, 0.8);
    color: #721c24;
    font-weight: 500;
}

/* Animação de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Formulários padronizados */
.form-control {
    border: 2px solid #f1f3f4;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-control:focus {
    border-color: #2b5598;
    box-shadow: 0 0 0 0.2rem rgba(43, 85, 152, 0.25);
    background: #fff;
}

.form-select {
    border: 2px solid #f1f3f4;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-select:focus {
    border-color: #2b5598;
    box-shadow: 0 0 0 0.2rem rgba(43, 85, 152, 0.25);
    background: #fff;
}

/* Tabelas padronizadas */
.table {
    background: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table thead th {
    background: #2b5598;
    color: white;
    border: none;
    font-weight: 500;
    padding: 1rem;
}

.table tbody tr {
    border-bottom: 1px solid rgba(230, 236, 241, 0.5);
}

.table tbody tr:hover {
    background: rgba(248, 249, 250, 0.8);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Alertas padronizados */
.alert {
    border-radius: 0.75rem;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: rgba(212, 237, 218, 0.8);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.alert-info {
    background: rgba(209, 236, 241, 0.8);
    color: #0c5460;
    border: 1px solid rgba(23, 162, 184, 0.2);
}

.alert-warning {
    background: rgba(255, 243, 205, 0.8);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Background global */
main {
    background: #ffffff;
    min-height: calc(100vh - 76px);
}

/* Responsividade melhorada */
@media (max-width: 768px) {
    .login-container {
        margin: 1rem;
        border-radius: 1.5rem;
    }
    
    .login-body {
        padding: 1.5rem;
    }
    
    .login-header {
        padding: 0.75rem 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}
