body {
    background-color: var(--bs-gray-200);
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background-color: #f8f9fa;
    height: 100vh;
    padding-top: 10px;
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
}

.sidebar a {
    padding: 10px 20px;
    display: block;
    color: #343a40;
}

.sidebar a.nav-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.sidebar a.nav-link.active {
    background-color: #d9dcdf;
    text-decoration: none;
}

main {
    overflow-y: auto;
    flex-grow: 1;
    padding: 1.5rem;
}

.content {
    padding: 20px;
}

.card {
    margin-bottom: 20px;
}

.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.75rem 1.25rem;
    color: inherit;
    border: none;
    background: none;
    cursor: pointer;
    opacity: 0.5;
}
.alert-dismissible .close:hover {
    opacity: 0.75;
}

.form-control:read-only {
    background-color: #e9ecef;
    opacity: 1;
}

.offcanvas.offcanvas-end {
    --bs-offcanvas-width: 600px;
}

/* Tooltip indicator for labels with Bootstrap tooltips */
label[data-bs-toggle="tooltip"] {
    position: relative;
    cursor: help;
}

label[data-bs-toggle="tooltip"]::after {
    content: " ⓘ"; /* space before icon for separation */
    font-size: 0.85em;
    color: var(--bs-secondary-color, #6c757d);
    transition: color 0.2s ease-in-out, opacity 0.2s ease-in-out;
    opacity: 0.75;
}

label[data-bs-toggle="tooltip"]:hover::after,
label[data-bs-toggle="tooltip"][aria-describedby]::after {
    color: var(--bs-primary, #0d6efd);
    opacity: 1;
}

/* If labels are inside .form-label class, ensure proper spacing */
.form-label[data-bs-toggle="tooltip"]::after,
label.form-label[data-bs-toggle="tooltip"]::after {
    margin-left: 0.25rem;
}

/* Custom CSS for sticky columns */
.table-sticky-columns th.sticky,
.table-sticky-columns td.sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: var(--bs-table-bg);
    border-right: 1px solid var(--bs-border-color);
}

.table-sticky-columns th:nth-child(2),
.table-sticky-columns td:nth-child(2) {
    position: sticky;
    left: 140px;
    z-index: 2;
    background-color: var(--bs-table-bg);
    border-right: 1px solid var(--bs-border-color);
}

.table-sticky-columns th.sticky {
    z-index: 4;
}

.table-sticky-columns thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-table-bg);
}

.table-sticky-columns td,
.table-sticky-columns th {
    white-space: nowrap;
}

.table-sticky-columns td,
.table-sticky-columns th {
    min-width: 140px;
}

.table-sticky-columns th:nth-child(1),
.table-sticky-columns td:nth-child(1) {
    width: 140px;
}

#acquisitionLoanCanvas, #renovationLoanCanvas, #constructionLoanCanvas, #accountingBalanceCanvas {
    width: 1200px;
}

body.modal-open {
    overflow: hidden;
}

.modal-fullscreen {
    width: 99vw;
    max-width: none;
    height: 99%;
    margin: 0;
    top: 0.5%;
    left: 0.5vw;
}


/* Yearly net income chart fixed height */
#yearlyNetIncomeChart {
    width: 100% !important;
    height: 700px !important;
    display: block;
}

/* Ensure horizontal scrollbar of simulation table is always visible on screen */
.simulation-scroll {
    /* Constrain height to keep the bottom edge (and thus the horizontal scrollbar) within the viewport */
    max-height: 75vh;
    overflow-y: auto;

    /* Always show horizontal scrollbar, even when content barely fits */
    overflow-x: scroll;

    /* Improve scroll behavior and avoid overlapping sticky header background */
    background: var(--bs-body-bg, #fff);
}
