html,
body {
    height: 100%;
    min-height: 100%;
    margin: 0;
}

/* Sticky footer: main wrapper fills viewport and uses flex */
#main-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Page layout - grows to fill and is flex column so footer sticks at bottom */
.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Header already fixed/sticky; padding-bottom so content doesn't sit under fixed footer */
.body-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 52px;
}

/* Main container */
.fullscreen-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Form layout */
.form-scroll-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Sticky program header */
.program-header {
    position: sticky;
    top: 80px;
    /* navbar height */
    z-index: 1070;
    background: #fff;
}

/* ONLY this scrolls */
.program-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 10px;
}

/* Footer fixed at bottom of screen (same as header sticks at top) */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    flex-shrink: 0;
    z-index: 1030;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.08);
}

/* Vertical layout: align footer with content area (same width as topbar) */
@media (min-width: 1300px) {
    [data-layout="vertical"] footer {
        width: calc(100% - 270px);
        left: 270px;
        right: auto;
    }

    [data-layout="vertical"] body[data-sidebartype="mini-sidebar"] footer {
        width: calc(100% - 87px);
        left: 87px;
    }
}

.dataTables_wrapper table thead th:first-child {
    border-top-left-radius: 9px;
}

.dataTables_wrapper table thead th:last-child {
    border-top-right-radius: 9px;
}

.dataTables_wrapper table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 9px;
}

.dataTables_wrapper table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 9px;
}

/* DataTables: keep Length (Show entries) + Filter (Search) in one row */
.dataTables_wrapper .dataTables_length {
    float: left;
}
.dataTables_wrapper .dataTables_filter {
    float: right;
    text-align: right;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    margin-bottom: 0;
}
/* Clear floats so table doesn't jump up */
.dataTables_wrapper > .row:first-child::after,
.dataTables_wrapper > .row.dt-row:first-child::after {
    content: "";
    display: block;
    clear: both;
}

/* DataTables: mobile – center Length + Filter, then pagination */
@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
    }
    .dataTables_wrapper .dataTables_filter {
        margin-top: 0.5rem;
    }
    .dataTables_wrapper .row:first-child,
    .dataTables_wrapper .row.dt-row:first-child {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        justify-content: center;
    }
    .dataTables_wrapper .dataTables_paginate {
        margin-top: 1.0rem;
        margin-bottom: 1.0rem;
        padding: 0.15rem 0;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1px;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.15rem 0.28rem;
        margin: 0;
        font-size: 0.75rem;
        min-width: 1.5rem;
        min-height: 1.5rem;
        line-height: 1.3;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
    .dataTables_wrapper .dataTables_paginate .paginate_button.next {
        padding: 0.15rem 0.25rem;
    }
    .dataTables_wrapper .dataTables_paginate span {
        margin-top: 0.35rem;
        margin-bottom: 0.35rem;
    }
}

/* Sidebar: keep SimpleBar vertical scrollbar visible all the time (no fade after 2–3 sec) */
.left-sidebar .scroll-sidebar .simplebar-track.simplebar-vertical {
    opacity: 1;
    visibility: visible;
}

.left-sidebar .scroll-sidebar .simplebar-scrollbar:before {
    opacity: 0.5 !important;
    transition: none !important;
}

/* Amount formatting with tabular numbers for proper alignment */
body {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum"; 
}

.text-end {
    text-align: right !important;
}
