html, body {
    height: auto !important;
    min-height: 100vh;
}

body {
    background-color: #f8f9fa;
    overflow-y: auto; /* Scroll apenas se necessário */
    overflow-x: hidden;
}

.content-wrapper {
    min-height: 100vh;
}

#main-content {
    padding-bottom: 2rem;
}

#dashboard-content {
    min-height: calc(100vh - 60px); 
}

/* Enable horizontal scroll on specific sections on mobile */
@media (max-width: 767.98px) {
    #projections-section {
        overflow-x: auto;
    }
}

/* Glassmorphism for Navbar */
.navbar {
    backdrop-filter: blur(10px);
    background: var(--dark-gradient) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1050 !important;
}

.navbar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.navbar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar .dropdown-menu {
    background: #fff;
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 10px;
}

.navbar .dropdown-item {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.navbar .dropdown-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

/* Custom Scrollbar for mobile/web */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.fw-black {
    font-weight: 900 !important;
}

/* =================================================================================
   GLOBAL MODERN UI COMPONENTS
   ================================================================================= */
:root {
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    --success-gradient: linear-gradient(135deg, #198754 0%, #146c43 100%);
    --danger-gradient: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    --warning-gradient: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    --info-gradient: linear-gradient(135deg, #0dcaf0 0%, #0bacbe 100%);
    --dark-gradient: linear-gradient(135deg, #212529 0%, #000000 100%);
}

.modern-card {
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background: #fff;
}

.modern-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.icon-box {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-card {
    position: relative;
    z-index: 1;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: -1;
}

.table-modern {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-modern thead th {
    border: none;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    padding: 8px 15px;
}

.table-modern tbody tr {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    transition: all 0.2s;
}

.table-modern tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table-modern td {
    background: #fff;
    border: none;
    padding: 8px 15px;
    vertical-align: middle;
}

.table-modern td:first-child { border-radius: 12px 0 0 12px; }
.table-modern td:last-child { border-radius: 0 12px 12px 0; }

.status-badge {
    padding: 0.5em 1em;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* =================================================================================
   TRANSACTIONS TABLE - FIXED HEADER & SCROLL
   ================================================================================= */
#transactions-list {
    max-height: 800px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
    position: relative;
}

#transactions-list .table-modern thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa; /* Mesma cor de fundo da página para não parecer transparente */
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.pagination-container .btn-page {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
}

.pointer-cursor {
    cursor: pointer;
}

.pointer-cursor:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* =================================================================================
   MODERN BUTTONS STYLES
   ================================================================================= */
.btn-modern {
    border-radius: 50rem;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern-primary { background: var(--primary-gradient); color: #fff; }
.btn-modern-success { background: var(--success-gradient); color: #fff; }
.btn-modern-danger { background: var(--danger-gradient); color: #fff; }
.btn-modern-info { background: var(--info-gradient); color: #fff; }
.btn-modern-warning { background: var(--warning-gradient); color: #212529; }
.btn-modern-dark { background: var(--dark-gradient); color: #fff; }

.btn-modern-outline-primary { 
    background: transparent; 
    border: 2px solid #0d6efd; 
    color: #0d6efd; 
    box-shadow: none;
}
.btn-modern-outline-primary:hover {
    background: #0d6efd;
    color: #fff;
}

/* Ajuste para mobile */
@media (max-width: 575.98px) {
    .btn-modern {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* =================================================================================
   CATEGORIES SECTION STYLES
   ================================================================================= */
.category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background: #fff;
    overflow: hidden;
}

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

.category-card-expense {
    border-left: 5px solid #dc3545; /* Red for expenses */
}

.category-card-income {
    border-left: 5px solid #198754; /* Green for income */
}

.category-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    background-color: #f8f9fa;
}

.expense-icon {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.income-icon {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.category-goal-badge {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 50rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
}

/* =================================================================================
   LOGIN & HERO SECTION
   ================================================================================= */
.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 0;
    border-radius: 0 0 40px 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-icon {
    font-size: 5rem;
    color: #ffc107;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 20px;
    height: 100%;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

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

.feature-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: white;
}

/* Treeview Styles */
.treeview-container {
    padding: 10px;
}

.tree-node {
    user-select: none;
    border-bottom: 1px solid #f1f1f1;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.tree-node-content:hover {
    background-color: #f8f9fa;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 0.8rem;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
}

.tree-node-label {
    flex-grow: 1;
    font-weight: 500;
}

.tree-node-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.tree-children {
    display: none;
    background-color: rgba(0, 0, 0, 0.01);
}

.tree-node.expanded > .tree-children {
    display: block;
}

/* Níveis */
.tree-level-1 { padding-left: 20px; }
.tree-level-2 { padding-left: 40px; }

/* Transações (Último nível) */
.tree-transaction-item {
    padding: 8px 15px 8px 60px;
    font-size: 0.85rem;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    color: #6c757d;
}

.tree-transaction-date {
    width: 80px;
    color: #adb5bd;
}

.tree-transaction-desc {
    flex-grow: 1;
}

.tree-node-type-income .tree-node-value { color: var(--bs-success); }
.tree-node-type-expense .tree-node-value { color: var(--bs-danger); }

/* =================================================================================
   MOBILE RESPONSIVE STYLES
   ================================================================================= */

/* Tables transform into cards on mobile */
@media (max-width: 767.98px) {
    .table-mobile-cards thead {
        display: none !important;
    }
    .table-mobile-cards tbody tr {
        display: block;
        padding: 12px 16px;
        margin-bottom: 12px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid #e9ecef;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    .table-mobile-cards tbody tr:hover {
        transform: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    }
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        background: transparent !important;
        text-align: right !important;
    }
    .table-mobile-cards tfoot tr {
        display: block;
        padding: 8px 16px;
        margin-top: 4px;
        border-top: 2px solid #dee2e6;
    }
    .table-mobile-cards tfoot td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: none;
        background: transparent !important;
        text-align: right !important;
    }
    .table-mobile-cards tfoot td:before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        color: #212529;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 12px;
        text-align: left;
    }
    .table-mobile-cards tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.7rem;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 12px;
        text-align: left;
    }
    .table-mobile-cards tbody td:first-child {
        border-radius: 0;
    }
    .table-mobile-cards tbody td:last-child {
        border-radius: 0;
    }
    .table-mobile-cards tbody td .btn-group,
    .table-mobile-cards tbody td .d-flex {
        justify-content: flex-end;
    }
    /* Action columns full width */
    .table-mobile-cards tbody td[data-label="Ações"] {
        padding-top: 10px;
        border-top: 1px solid #eee;
        margin-top: 4px;
    }
}

/* Navbar mobile */
@media (max-width: 1199.98px) {
    .navbar .navbar-collapse {
        background: var(--dark-gradient);
        border-radius: 16px;
        padding: 12px;
        margin-top: 8px;
        border: 1px solid rgba(255,255,255,0.08);
    }
    .navbar .nav-link {
        padding: 10px 16px !important;
        margin: 2px 0;
        border-radius: 10px;
    }
    .navbar .dropdown-menu {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.08);
        margin: 0;
        padding: 4px;
    }
    .navbar .dropdown-item {
        color: rgba(255,255,255,0.8);
    }
    .navbar .dropdown-item:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
    }
    #auth-buttons {
        padding: 12px 16px 4px;
        border-top: 1px solid rgba(255,255,255,0.08);
        margin-top: 8px;
    }
}

/* Hero section mobile */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 40px 0;
        border-radius: 0 0 24px 24px;
        margin-bottom: 24px;
    }
    .hero-icon {
        font-size: 3.5rem;
    }
    .hero-section h1 {
        font-size: 1.75rem !important;
    }
    .hero-section .lead {
        font-size: 0.95rem;
    }
    .hero-section .d-flex {
        flex-direction: column;
        gap: 0.75rem !important;
    }
    .hero-section .btn-lg {
        width: 100%;
        padding: 0.6rem 1.5rem;
    }
    .feature-card {
        padding: 1.25rem !important;
    }
}

/* Section headers mobile */
@media (max-width: 575.98px) {
    .content-section > .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    .content-section > .d-flex .d-flex,
    .content-section > .d-flex > div:not(.btn-group) {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .content-section > .d-flex .btn-group {
        width: 100%;
    }
    .content-section > .d-flex .btn-group .btn {
        flex: 1;
    }
    .content-section > .d-flex h2 {
        font-size: 1.25rem;
    }
    /* Full-width buttons in headers */
    .content-section > .d-flex .btn-modern,
    .content-section > .d-flex .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dashboard stat cards mobile */
@media (max-width: 575.98px) {
    #summary-section > .row > .col,
    #account-balances-row .col-6 {
        margin-bottom: 0.5rem !important;
    }
    #summary-section .card-body {
        padding: 0.75rem !important;
    }
    #summary-section .card-text.fs-4 {
        font-size: 1.15rem !important;
    }
}

/* Dashboard charts/grid mobile */
@media (max-width: 767.98px) {
    #summary-section .row .col-lg-4,
    #summary-section .row.row-cols-1 > .col {
        margin-bottom: 0.75rem;
    }
    #category-spending-chart, #payment-method-chart {
        max-height: 200px;
    }
    #projections-chart {
        max-height: 250px;
    }
}

/* Transactions filter form mobile */
@media (max-width: 767.98px) {
    #transactions-filter-form .row {
        flex-direction: column;
    }
    #transactions-filter-form .col-md-2,
    #transactions-filter-form .col-md-3,
    #transactions-filter-form .col-md-4 {
        width: 100%;
        padding: 0 0.5rem;
    }
    #transactions-filter-form .col-md-2 {
        margin-bottom: 0.5rem;
    }
    .filter-toggle-btn {
        display: block !important;
    }
}

/* Transactions list container on mobile */
@media (max-width: 767.98px) {
    #transactions-list {
        max-height: none;
        overflow-y: visible;
    }
    .pagination-container {
        flex-wrap: wrap;
    }
    .pagination-container .d-flex {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Weekly statement mobile */
@media (max-width: 575.98px) {
    #ws-weeks-container .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    #ws-weeks-container .card-header .d-flex {
        width: 100%;
        justify-content: space-between;
    }
    #weekly-statement-section > .d-flex .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    #weekly-statement-section > .d-flex .d-flex select {
        width: 100% !important;
    }
}

/* Detailed statement mobile */
@media (max-width: 575.98px) {
    #detailed-statement-section > .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    #detailed-statement-section > .d-flex > div {
        width: 100%;
    }
    #month-selector {
        width: 100% !important;
    }
}

/* Cards section mobile */
@media (max-width: 575.98px) {
    #cards-section .card .row.text-center {
        flex-direction: column;
    }
    #cards-section .card .row.text-center .col-md-6 {
        padding: 0.5rem 0;
        border: none !important;
    }
    #cards-section .card .row.text-center .col-md-6:first-child {
        border-bottom: 1px solid #dee2e6 !important;
    }
}

/* Report tree mobile */
@media (max-width: 575.98px) {
    #report-section > .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }
    #report-section .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .tree-level-1 { padding-left: 12px !important; }
    .tree-level-2 { padding-left: 24px !important; }
    .tree-transaction-item {
        flex-direction: column;
        padding-left: 36px !important;
        gap: 2px;
    }
    .tree-transaction-date {
        width: auto !important;
    }
}

/* Accounts/Cards/Investments mobile (already cards, just adjust padding) */
@media (max-width: 575.98px) {
    #accounts-list .card-body,
    #credit-cards-list .card-body,
    #investments-list .card-body {
        padding: 1rem !important;
    }
    #accounts-list h3 {
        font-size: 1.25rem;
    }
    #investments-list .col-md-6,
    #accounts-list .col-md-6,
    #credit-cards-list .col-md-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Fixed costs summary mobile */
@media (max-width: 575.98px) {
    #scheduled-payments-section .card .row.text-center {
        flex-direction: column;
    }
    #scheduled-payments-section .card .row.text-center .col-md-4 {
        padding: 0.5rem 0;
        border: none !important;
    }
    #scheduled-payments-section .card .row.text-center .col-md-4:not(:last-child) {
        border-bottom: 1px solid #dee2e6 !important;
    }
}

/* Projection buttons mobile */
@media (max-width: 575.98px) {
    #projections-section > .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    #projections-filter-buttons {
        width: 100%;
    }
    #projections-filter-buttons .btn {
        flex: 1;
        text-align: center;
    }
}

/* General mobile spacing */
@media (max-width: 575.98px) {
    #main-content > .row > main > .p-4 {
        padding: 0.75rem !important;
    }
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .modern-card {
        border-radius: 12px;
    }
}

/* Larger touch targets for mobile */
@media (pointer: coarse) {
    .btn-sm, .btn-page {
        min-width: 44px;
        min-height: 44px;
    }
    .navbar-toggler {
        padding: 8px 12px;
    }
    .dropdown-item {
        padding: 10px 16px !important;
    }
    .table-mobile-cards tbody td .btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Modern card hover only for non-touch devices */
@media (hover: hover) {
    .modern-card:hover {
        transform: translateY(-7px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    }
}

/* =================================================================================
   DARK MODE - data-bs-theme="dark"
   ================================================================================= */
[data-bs-theme="dark"] {
    --dark-gradient: linear-gradient(135deg, #1a1d21 0%, #0d0f12 100%);
    --bs-body-bg: #0f1115;
    --bs-body-color: #e4e6ea;
}

[data-bs-theme="dark"] body {
    background-color: #0f1115;
    color: #e4e6ea;
}

/* Hero Section */
[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 100%);
}

[data-bs-theme="dark"] .feature-card {
    background: #1a1d23;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Modern Cards */
[data-bs-theme="dark"] .modern-card {
    background: #1a1d23;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
[data-bs-theme="dark"] .modern-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .modern-card .card-header {
    background: #1a1d23 !important;
    color: #e4e6ea;
}

/* Table Modern */
[data-bs-theme="dark"] .table-modern thead th {
    color: #adb5bd;
}
[data-bs-theme="dark"] .table-modern tbody tr {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
[data-bs-theme="dark"] .table-modern tbody td {
    background: #1a1d23;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .table-modern tbody tr:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}
[data-bs-theme="dark"] .table-modern tbody td .text-dark {
    color: #e4e6ea !important;
}

/* Table hover (detailed/weekly statement) */
[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.03);
}
[data-bs-theme="dark"] .table-hover td {
    color: #e4e6ea;
}
[data-bs-theme="dark"] .table-hover .text-dark {
    color: #e4e6ea !important;
}
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #1a1d23;
    --bs-table-color: #e4e6ea;
}
[data-bs-theme="dark"] thead.bg-light {
    background-color: #1a1d23 !important;
}
[data-bs-theme="dark"] thead.bg-light th {
    color: #e4e6ea;
}

/* Table striped (extrato.js) */
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-color-type: #e4e6ea;
    --bs-table-bg-type: rgba(255,255,255,0.02);
}

/* Mobile cards */
[data-bs-theme="dark"] .table-mobile-cards tbody tr {
    background: #1a1d23;
    border-color: #2a2d33;
}

/* Category Cards */
[data-bs-theme="dark"] .category-card {
    background: #1a1d23;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
[data-bs-theme="dark"] .category-icon-wrapper {
    background-color: rgba(255,255,255,0.05);
}

/* Tree View */
[data-bs-theme="dark"] .tree-node {
    border-bottom-color: #2a2d33;
}
[data-bs-theme="dark"] .tree-node-content:hover {
    background-color: rgba(255,255,255,0.03);
}
[data-bs-theme="dark"] .tree-children {
    background-color: rgba(0,0,0,0.15);
}
[data-bs-theme="dark"] .tree-toggle {
    border-color: #3a3d43;
    background: #1a1d23;
}
[data-bs-theme="dark"] .tree-transaction-item {
    border-bottom-color: #2a2d33;
}

/* Cards section */
[data-bs-theme="dark"] #cards-section .card.bg-light,
[data-bs-theme="dark"] #scheduled-payments-section .card.bg-light {
    background: #1a1d23 !important;
    border-color: #2a2d33 !important;
}

/* Progress bars */
[data-bs-theme="dark"] .progress {
    background-color: #2a2d33;
}

/* Badges */
[data-bs-theme="dark"] .badge.bg-light {
    background: #2a2d33 !important;
    color: #e4e6ea !important;
    border-color: #3a3d43 !important;
}
[data-bs-theme="dark"] .badge.bg-dark-subtle {
    background: #2a2d33 !important;
    color: #e4e6ea !important;
}

/* Alerts container */
[data-bs-theme="dark"] #alert-container .alert {
    background: #1a1d23;
    border-color: #2a2d33;
    color: #e4e6ea;
}

/* Footer */
[data-bs-theme="dark"] .footer {
    background-color: #1a1d23 !important;
    border-top: 1px solid #2a2d33;
}
[data-bs-theme="dark"] .footer .text-muted {
    color: #adb5bd !important;
}

/* Scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1d23;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a3d43;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #5a5d63;
}

/* Form controls */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1a1d23;
    border-color: #3a3d43;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #1a1d23;
    border-color: #0d6efd;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .input-group-text {
    background-color: #1a1d23;
    border-color: #3a3d43;
    color: #adb5bd;
}

[data-bs-theme="dark"] .form-control.is-valid,
[data-bs-theme="dark"] .form-select.is-valid {
    border-color: #198754;
}

[data-bs-theme="dark"] .form-control.is-invalid,
[data-bs-theme="dark"] .form-select.is-invalid {
    border-color: #dc3545;
}

[data-bs-theme="dark"] .invalid-feedback {
    color: #f87171;
}

.form-control.is-valid,
.form-select.is-valid {
    border-width: 2px;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-width: 2px;
}

.invalid-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* Dropdown menus inside modern-card */
[data-bs-theme="dark"] .dropdown-menu {
    background: #1a1d23;
    border-color: #2a2d33;
}
[data-bs-theme="dark"] .dropdown-item {
    color: #e4e6ea;
}
[data-bs-theme="dark"] .dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
[data-bs-theme="dark"] .dropdown-divider {
    border-top-color: #2a2d33;
}

/* Buttons */
[data-bs-theme="dark"] .btn-light {
    background: #2a2d33;
    border-color: #3a3d43;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .btn-light:hover {
    background: #3a3d43;
    border-color: #4a4d53;
    color: #fff;
}
[data-bs-theme="dark"] .btn-outline-light {
    border-color: #6c757d;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .btn-outline-light:hover {
    background: #3a3d43;
    border-color: #6c757d;
    color: #fff;
}

/* Chart container */
[data-bs-theme="dark"] #projections-section {
    overflow-x: visible;
}

/* Pagination */
[data-bs-theme="dark"] .pagination-container .btn-light {
    background: #2a2d33;
    border-color: #3a3d43;
    color: #e4e6ea;
}
[data-bs-theme="dark"] .pagination-container .btn-light:hover {
    background: #3a3d43;
}

/* Empty state */
[data-bs-theme="dark"] .bg-light.rounded {
    background: #1a1d23 !important;
    border: 1px solid #2a2d33;
}
[data-bs-theme="dark"] .bg-light.rounded h4,
[data-bs-theme="dark"] .bg-light.rounded p {
    color: #e4e6ea;
}

/* Navbar stays dark in both modes */
[data-bs-theme="dark"] .navbar {
    background: var(--dark-gradient) !important;
}

/* Modal adjustments */
[data-bs-theme="dark"] .modal .btn-close {
    filter: invert(1);
}

/* Auth buttons area */
[data-bs-theme="dark"] .navbar-text {
    color: rgba(255,255,255,0.8);
}

/* Summary stat cards text */
[data-bs-theme="dark"] #summary-section .card .card-text {
    color: #fff !important;
}

/* Text muted in dark mode */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-body-secondary {
    color: #adb5bd !important;
}

/* Text dark in dark mode */
[data-bs-theme="dark"] .text-dark {
    color: #e4e6ea !important;
}

/* Background utility overrides for dark mode */
[data-bs-theme="dark"] .bg-white {
    background-color: #1a1d23 !important;
}
[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: #2a2d33 !important;
}

/* Fixed costs summary modal */
[data-bs-theme="dark"] #fixedCostsModal .modal-header.bg-dark {
    background: #0d0f12 !important;
}
[data-bs-theme="dark"] #fixedCostsModal .modal-footer.bg-light {
    background: #1a1d23 !important;
}

/* Investment cards */
[data-bs-theme="dark"] .badge.bg-info-subtle {
    background: rgba(13,202,240,0.15) !important;
    color: #6edff6 !important;
    border-color: rgba(13,202,240,0.3) !important;
}

/* Category goal badge */
[data-bs-theme="dark"] .category-goal-badge {
    background: rgba(13,110,253,0.15);
    color: #6ea8fe;
}

/* Card bills dashboard */
[data-bs-theme="dark"] #card-bills-dashboard .bg-light {
    background: #2a2d33 !important;
}


