:root {
    --color-sidebar: #000080; /* Azul Marinho */
    --color-receita: #28a745;
    --color-despesa: #dc3545;
    --font-family-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --main-padding: 30px; /* Aumentado de 25px para 30px para máximo respiro */
}

/* Layout principal */
body {
    font-size: .875rem;
    background-color: #f8f9fa;
    font-family: var(--font-family-base);
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background: var(--color-sidebar);
    width: var(--sidebar-width);
}

.sidebar a {
    color: #fff !important;
    padding: .5rem 1rem;
    text-decoration: none;
}

.sidebar a:hover {
    color: #f8f9fa !important;
    background: rgba(255,255,255,.1);
}

.sidebar .nav-item.active a {
    background: rgba(255,255,255,.2);
}

main, .main-content, #page-container {
    padding-top: 2rem; /* Aumentado de 1.5rem para 2rem */
}

.navbar-brand {
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.navbar .navbar-toggler {
    top: .25rem;
    right: 1rem;
}

/* Cards */
.card {
    margin-bottom: 2rem; /* Aumentado o espaçamento entre cards */
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important; /* Sombra base um pouco mais presente para destaque */
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-body {
    padding: 1.75rem !important; /* Aumentado padding interno global dos cards para 'respirar' */
}

/* Efeitos de Hover para Cards - Premium Elevation */
.card:hover, .stats-card:hover, .card-resumo:hover, .cliente-card:hover {
    transform: translateY(-10px); /* Elevação sutilmente maior */
    box-shadow: 0 25px 50px rgba(0,0,0,0.1) !important; /* Sombra mais difusa e suave */
    z-index: 10;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e3e6f0;
}

/* Tabelas */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e3e6f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #4e73df;
    background-color: #f8f9fa;
}

.table td {
    vertical-align: middle;
}

.dt-top {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.dataTables_wrapper .dt-buttons {
    display: inline-flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.dataTables_wrapper .dt-buttons .btn {
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 0;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length select {
    width: auto;
    min-width: 56px;
}

/* Responsividade */
@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 0;
    }
    
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .table {
        font-size: 0.75rem;
    }

    .table td, .table th {
        padding: 0.5rem 0.25rem;
    }
}

@media (max-width: 1200px) {
    .dt-top {
        gap: .4rem;
    }

    .dataTables_wrapper .dataTables_length label {
        font-size: .8rem;
    }

    .dataTables_wrapper .dt-buttons .btn {
        padding: .2rem .45rem;
        font-size: .72rem;
        margin: 0;
    }

    .dataTables_wrapper .dt-buttons .btn.me-2,
    .dataTables_wrapper .dt-buttons .btn.ms-2 {
        margin: 0 !important;
    }

    .dataTables_wrapper .dt-buttons .btn span {
        font-size: 0;
    }

    .dataTables_wrapper .dt-buttons .btn i {
        font-size: .85rem;
    }
}

/* Modal */
.modal-content {
    border: none;
    border-radius: .35rem;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e3e6f0;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e3e6f0;
}

/* Utilitários */
.shadow {
    box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15)!important;
}

.font-weight-bold {
    font-weight: 700!important;
}

.text-primary {
    color: #4e73df!important;
}

/* Modern Modal Styles - Compact Version */
.modal-modern .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.modal-modern .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.5rem;
    background: #fff;
    border-radius: 12px 12px 0 0;
}
.modal-modern .modal-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}
.modal-modern .modal-body {
    padding: 1.5rem 2rem; /* Mais respiro interno no modal */
    background: #f8f9fa;
}
.modal-modern .modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

/* Form Fields - Compact with Height Fix */
.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 0.85rem;
    height: 3.5rem;
    min-height: 3.5rem;
    line-height: 1.25;
}
.form-floating > .form-select {
    padding-top: 1.25rem;
}
.form-floating > label {
    font-size: 0.8rem;
    color: #95a5a6;
    padding: 0.75rem 0.75rem;
}
.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

/* Section Headers - Compact */
.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b0b0b0;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
}
.form-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
    margin-left: 0.75rem;
}
.form-section-title:first-child {
    margin-top: 0;
}

/* Buttons - Compact */
.btn-modern {
    padding: 0.4rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

/* Filtros - Botão e Área Compacta */
.btn-filtros {
    font-size: 0.80rem;
    padding: 0.3rem 0.6rem;
}
.filters-compact .form-label {
    font-size: 0.75rem;
    color: #6c757d;
}
.filters-compact .form-select,
.filters-compact .form-control {
    font-size: 0.80rem;
    height: 2.25rem;
    padding: 0.25rem 0.5rem;
}
.filters-compact .input-group-text {
    font-size: 0.80rem;
    padding: 0.25rem 0.5rem;
}
.filters-compact .card-body {
    padding: 0.75rem 1rem;
}

/* Estado ativo do botão de filtros */
.btn-filtros {
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-filtros.btn-outline-primary[aria-expanded="true"] {
    background-color: #6C757D;
    color: #fff;
    border-color: #6C757D;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.btn-filtros.btn-outline-primary[aria-expanded="true"] i {
    color: #fff;
}

.btn-filtros.is-open {
    background-color: #6C757D !important;
    color: #fff !important;
    border-color: #6C757D !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15) !important;
}
.btn-filtros.is-open i {
    color: #fff !important;
}
.btn-modern-primary {
    background: #4e73df;
    color: white;
    border: none;
}
.btn-modern-primary:hover {
    background: #2e59d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.2);
}
.btn-modern-secondary {
    background: #f1f3f5;
    color: #7f8c8d;
    border: none;
}
.btn-modern-secondary:hover {
    background: #e9ecef;
    color: #2c3e50;
}

/* Green Variation (Success) */
.btn-modern-success {
    background: var(--color-receita);
    color: white;
    border: none;
}
.btn-modern-success:hover {
    background: #17a673;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}
.modal-modern-success .form-floating > .form-control:focus,
.modal-modern-success .form-floating > .form-select:focus {
    border-color: var(--color-receita);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Red Variation (Danger) */
.btn-modern-danger {
    background: var(--color-despesa);
    color: white;
    border: none;
}
.btn-modern-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}
.modal-modern-danger .form-floating > .form-control:focus,
.modal-modern-danger .form-floating > .form-select:focus {
    border-color: var(--color-despesa);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Modern Sidebar UI/UX */
.modern-sidebar {
    width: var(--sidebar-width) !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1000 !important;
    background: linear-gradient(180deg, #4e73df 0%, #224abe 100%) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    padding: 3.5rem 0 2rem !important;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Scrollbar para Webkit */
.modern-sidebar::-webkit-scrollbar {
    width: 4px;
}
.modern-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.modern-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Logo Area */
.modern-sidebar .sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modern-sidebar .sidebar-brand h5 {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.1rem; /* Aumentado devido ao novo espaço */
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Nav Items */
.modern-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.95rem 1.5rem;
    margin: 0.35rem 0.85rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
}

.modern-sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem !important;
    font-size: 1.1em;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hover State */
.modern-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    transform: translateX(5px);
}

.modern-sidebar .nav-link:hover i {
    transform: scale(1.2);
}

/* Active State */
.modern-sidebar .nav-link.active {
    background: #ffffff;
    color: #4e73df !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

/* Headers */
.modern-sidebar .nav-header {
    padding: 0 1.5rem;
    margin-top: 2.2rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    opacity: 0.65;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

/* Collapsed Sidebar */
.modern-sidebar {
    transition: width 0.3s ease, transform 0.3s ease !important;
}

.modern-sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
}

.modern-sidebar.collapsed .sidebar-brand h5,
.modern-sidebar.collapsed .nav-header,
.modern-sidebar.collapsed .btn-outline-light {
    display: none !important;
}

/* Esconder texto dos links mas manter ícone */
.modern-sidebar.collapsed .nav-link {
    font-size: 0;
    justify-content: center;
    padding: 0.8rem 0;
}

.modern-sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
    font-size: 1.4rem; /* Restaurar tamanho do ícone */
}

.modern-sidebar.collapsed .sidebar-brand {
    padding: 0 1rem 1.5rem;
    justify-content: center;
}

.modern-sidebar.collapsed .icon-wrapper {
    margin-right: 0 !important;
}

/* Main Content Adjustment */
main, .main {
    transition: margin-left 0.3s ease;
}

/* Garantir espaço do main ao lado da sidebar - Apenas para irmãos diretos ou seguintes */
.modern-sidebar ~ main, 
.modern-sidebar ~ .main, 
.modern-sidebar ~ .main-content, 
.modern-sidebar ~ #page-container {
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    transition: margin-left 0.3s ease, width 0.3s ease !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    min-width: 0;
    padding: var(--main-padding) !important;
}

/* Quando sidebar recolhida (via classe no body + seletor de irmãos para precisão) */
body.sidebar-collapsed .modern-sidebar ~ main, 
body.sidebar-collapsed .modern-sidebar ~ .main, 
body.sidebar-collapsed .modern-sidebar ~ .main-content, 
body.sidebar-collapsed .modern-sidebar ~ #page-container,
.modern-sidebar.collapsed ~ main, 
.modern-sidebar.collapsed ~ .main,
.modern-sidebar.collapsed ~ .main-content, 
.modern-sidebar.collapsed ~ #page-container {
    margin-left: var(--sidebar-collapsed-width) !important;
    width: calc(100% - var(--sidebar-collapsed-width)) !important;
}

/* Toggle Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 98px;
    left: calc(var(--sidebar-width) - 45px); 
    width: 32px; 
    height: 32px; 
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1100;
    backdrop-filter: blur(5px);
    font-size: 0.8rem;
}

body.sidebar-collapsed .sidebar-toggle-btn {
    left: calc(var(--sidebar-collapsed-width) - 45px);
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.modern-sidebar.collapsed .sidebar-toggle-btn {
    left: 20px; /* Centralizado na sidebar de 80px (80/2 - 40/2 = 20) */
}

/* --- Receitas Specific Styles (Moved from inline) --- */

/* Custom Column Widths */
.col-descricao {
    width: clamp(220px, 30vw, 420px);
}

.col-descricao .desc-text {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.col-acoes {
    width: 1%;
    white-space: nowrap;
}

.col-acoes .btn {
    padding: 0.25rem 0.5rem;
}

/* Container Limit Helper */
.container-max-width {
    max-width: 1600px;
    margin-left: 0;
}

/* DataTables Alignment Overrides */
.dt-buttons.btn-group {
    flex-wrap: nowrap !important;
}

div.dataTables_length {
    float: none !important;
    margin-right: 0.5rem;
}

div.dataTables_filter {
    text-align: right;
    float: none !important;
}

@media (max-width: 768px) {
    div.dataTables_wrapper div.dataTables_length,
    div.dataTables_wrapper div.dataTables_filter {
        text-align: left;
    }
    
    div.dataTables_wrapper div.dataTables_paginate {
        justify-content: center !important;
    }
}

@media (max-width: 1400px) {
    .col-descricao {
        width: clamp(200px, 26vw, 360px);
    }
}

/* --- Select2 Customization to match Form Floating height (3.5rem) --- */
.select2-container--bootstrap-5 .select2-selection {
    height: 3.5rem !important;
    min-height: 3.5rem !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    background-color: #fff;
    padding: 0 !important;
}

/* Adjust text rendering area */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    display: block !important;
    padding-top: 1.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-left: 0.75rem !important;
    font-size: 0.85rem !important;
    color: #212529 !important;
    line-height: 2 !important;
}

/* Adjust arrow position */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 3.5rem !important;
    top: 0 !important;
    right: 0 !important;
    width: 2.5rem !important;
    position: absolute !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: #999 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

/* Focus states */
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #4e73df !important;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1) !important;
}

/* Green Focus state for Receitas (Success context) */
.modal-modern-success .select2-container--bootstrap-5.select2-container--focus .select2-selection,
.modal-modern-success .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--color-receita) !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

/* ==========================================================================
   RESPONSIVIDADE DA SIDEBAR (Monitores pequenos, Tablets e Mobile)
   ========================================================================== */
@media (max-width: 991.98px) {
    /* 1. O conteúdo principal sempre ocupa a tela inteira (sem margem) */
    .modern-sidebar ~ main, 
    .modern-sidebar ~ .main, 
    .modern-sidebar ~ .main-content, 
    .modern-sidebar ~ #page-container,
    body.sidebar-collapsed .modern-sidebar ~ main, 
    body.sidebar-collapsed .modern-sidebar ~ .main, 
    body.sidebar-collapsed .modern-sidebar ~ .main-content, 
    body.sidebar-collapsed .modern-sidebar ~ #page-container,
    .modern-sidebar.collapsed ~ main, 
    .modern-sidebar.collapsed ~ .main,
    .modern-sidebar.collapsed ~ .main-content, 
    .modern-sidebar.collapsed ~ #page-container {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 15px !important; /* Reduzido padding superior */
    }

    /* 2. Sidebar aberta (overlay sobre o conteúdo) */
    .modern-sidebar {
        box-shadow: 10px 0 30px rgba(0,0,0,0.5) !important;
        transform: translateX(0);
        z-index: 1050 !important;
    }

    /* 3. Sidebar fechada some completamente na horizontal */
    .modern-sidebar.collapsed {
        width: var(--sidebar-width) !important;
        transform: translateX(-100%) !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        overflow: visible !important;
    }

    /* 4. Reposicionamento dinâmico do botão de Toggle */
    .sidebar-toggle-btn {
        left: 15px !important;
        top: 15px !important;
        background: #4e73df !important; /* Azul forte para destacar no fundo claro */
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        color: white !important;
        z-index: 1200 !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }
}

/* ==========================================================================
   ESTILOS GLOBAIS DE TABELAS E BOTÕES (PADRÃO GHOST)
   ========================================================================== */

/* Ghost Buttons (Modern Actions) */
.action-btn {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
    opacity: 0.8;
}

.action-btn:hover {
    transform: scale(1.25);
    opacity: 1;
}

/* Otimização de Tabelas */
.table-responsive-xl.overflow-hidden {
    overflow-x: hidden !important;
}

.table.align-middle td {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Compactar células em tabelas densas */
.table-compact td, .table-compact th {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Fix the .table-responsive default fallback for all responsive tables to act as cards on mobile */
@media (max-width: 991.98px) {
    .table-responsive {
        border: 0;
        margin-bottom: 1rem;
        contain: unset !important;
    }

    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
        min-width: 100% !important;
    }

    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 1px solid #e3e6f0;
        margin-bottom: 15px;
        background: #fff;
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid #f8f9fc;
        position: relative;
        padding: 12px 15px !important;
        text-align: left !important;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        word-break: break-word;
        font-size: 0.9rem;
        color: #5a5c69;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
        align-items: center;
        justify-content: center;
        padding: 15px !important;
        margin-top: 5px;
        border-top: 1px dashed #e3e6f0;
    }

    .table-responsive td:before {
        position: static;
        display: block;
        width: 100%;
        margin-bottom: 4px;
        text-align: left;
        font-weight: 700;
        color: #4e73df;
        content: attr(data-label);
        font-size: 0.75rem;
        text-transform: uppercase;
        transform: none;
        line-height: 1.2;
    }

    .table-responsive td:last-child:before {
        content: "";
        display: none;
    }
}

/* Fix toggle button behavior on small screens */
@media (max-width: 991.98px) {
    .sidebar-toggle-btn {
        top: 15px !important;
        left: 15px !important;
        background: #4e73df !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
        color: white !important;
        z-index: 1100 !important;
    }

    .modern-sidebar.collapsed .sidebar-toggle-btn {
        left: 15px !important;
    }

    body.sidebar-collapsed .sidebar-toggle-btn {
        left: 15px !important;
    }

    .modern-sidebar.collapsed {
        overflow: hidden !important; /* Fixes content bleeding when collapsed */
    }
}


/* Padronização de Formulários */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus, .form-select:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
}

/* Padronização de Tabelas e Formulários */
.table th, .table td {
    padding: 1rem;
    font-family: var(--font-family-base);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e3e6f0;
    color: #4e73df;
    font-weight: 600;
}

/* Padronização de Botões */
.btn {
    font-family: var(--font-family-base);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
    color: white;
}
.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.2);
}

.btn-success {
    background-color: var(--color-receita);
    border-color: var(--color-receita);
    color: white;
}
.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.btn-danger {
    background-color: var(--color-despesa);
    border-color: var(--color-despesa);
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Icones nos Cards */
.icon-shape {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.bg-success {
    background-color: var(--color-receita) !important;
}
.text-success {
    color: var(--color-receita) !important;
}
.bg-danger {
    background-color: var(--color-despesa) !important;
}
.text-danger {
    color: var(--color-despesa) !important;
}

/* Bordas dos Cards */
.border-success {
    border-color: var(--color-receita) !important;
}
.border-danger {
    border-color: var(--color-despesa) !important;
}


/* Global Summary Cards Default (Desktop) */
.stats-card, .info-box, .card-resumo, .card-summary {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.stats-card:hover, .info-box:hover, .card-resumo:hover, .card-summary:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1) !important;
}

.stats-card .icon, .info-icon, .card-resumo .icon-container, .card-summary .icon {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Global Summary Cards Responsiveness (2 per row on mobile) */
@media (max-width: 768px) {
    .stats-card, .info-box, .card-resumo, .card-summary {
        padding: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .stats-card h5, .info-box .text-muted, .card-resumo .card-title, .card-summary .summary-title {
        font-size: 0.7rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 0.25rem !important;
    }
    
    .stats-card h2, .info-box h4, .card-resumo h3, .card-summary .summary-value {
        font-size: 1.1rem !important;
        margin-bottom: 0 !important;
        font-weight: 700 !important;
    }
    
    .stats-card .icon, .info-icon, .card-resumo .icon-container, .card-summary .icon {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 0.9rem !important;
        margin-bottom: 0.4rem !important;
        right: 0.5rem !important;
        bottom: 0.5rem !important;
    }

    .card-resumo .icon-container i {
        font-size: 0.9rem !important;
    }
}
