.flash-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1060; /* Higher than most elements */
    min-width: 300px;
}
.balance-positive {
    color: #198754; /* Bootstrap success green */
}
.balance-negative {
    color: #dc3545; /* Bootstrap danger red */
}
.balance-zero {
    color: #6c757d; /* Bootstrap secondary grey */
}

.table-actions .btn {
    margin-left: 5px;
}
.table-actions .d-inline {
    vertical-align: middle;
}

/* NEW LAYOUT STYLES */
body {
    min-height: 100vh;
}

.page-wrapper {
    display: flex;
    flex-grow: 1;
}

#sidebar {
    width: 250px;
    min-width: 250px;
    background-color: #212529; /* bg-dark */
    color: white;
    transition: all 0.3s;
    height: 100vh;
    position: sticky;
    top: 0;
}

#sidebar .sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #495057;
}

#sidebar .sidebar-header .logo {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

#sidebar .nav-link {
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    color: #fff;
    background-color: #343a40;
}

#sidebar .nav-link .bi {
    font-size: 1.2rem;
}

.sidebar-footer {
    border-top: 1px solid #495057;
    padding: 1rem;
}

/* Dropup menu for sidebar footer */
.sidebar-footer .dropdown-menu {
    background-color: #343a40;
    border-color: #495057;
}
.sidebar-footer .dropdown-item {
    color: rgba(255, 255, 255, 0.75);
}
.sidebar-footer .dropdown-item:hover {
    color: #fff;
    background-color: #495057;
}

.sidebar-footer .dropdown-toggle strong {
    word-break: break-word;
    text-align: left;
    white-space: normal;
    flex-shrink: 1;
    min-width: 0;
}


#main-content {
    flex-grow: 1;
    background-color: var(--bs-body-bg); 
    overflow-y: auto; /* Allow content to scroll if it's too long */
    display: flex;
    flex-direction: column;
}

#main-content > .container {
    flex-grow: 1;
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .page-wrapper {
        flex-direction: column;
    }

    #sidebar {
        display: none !important;
    }

    .mobile-navbar {
        display: flex !important;
    }
}

[data-bs-theme="dark"] {
    .balance-positive {
        color: #72d672; /* Lighter green for dark background */
    }
    .balance-negative {
        color: #ff8b8b; /* Lighter red for dark background */
    }

    /* Make timeline comments stand out a bit more */
    .timeline-entry .bg-light {
        background-color: var(--bs-gray-800) !important;
    }
}