
/* ===================== ROOT THEME ===================== */
:root {
    --theme-primary: #20A2A0;
    --theme-primary-rgb: 32, 162, 160;
    /* main teal (darker) */
    --theme-primary-light: rgba(var(--theme-primary-rgb), 0.1);
    --theme-primary-light-03: rgba(var(--theme-primary-rgb), 0.03);
    --theme-primary-light-15: rgba(var(--theme-primary-rgb), 0.15);
    --theme-primary-light-20: rgba(var(--theme-primary-rgb), 0.2);
    --theme-primary-light-30: rgba(var(--theme-primary-rgb), 0.3);
    --theme-primary-lighter: #E8F7F7;
    --theme-primary-dark: #167877;
    --theme-text-light: #ffffff;
    --theme-text-dark: #000000;
    --theme-border: #20A2A0;
    --theme-shadow: rgba(var(--theme-primary-rgb), 0.25);
    --theme-control-line-height: 1.5;
    --theme-control-padding-y: 0;
    --theme-control-padding-x: 0.75rem;
    --theme-control-padding-right-select: 2.25rem;
    --theme-control-height: calc(2.5em + 2px);
    /* Universal table palette */
    --table-header-bg: var(--theme-primary-light-20);
    --table-header-color: var(--theme-text-dark);
    --table-header-border: #dee2e6;
    --table-cell-border: #dee2e6;
    --table-border: #dee2e6;
    --table-body-bg: #ffffff;
    --table-footer-bg: #f8f9fa;
    --table-row-hover-bg: var(--theme-primary-light-03);
    --table-quick-entry-bg: var(--theme-primary-light-03);
    --table-hover-bg: var(--theme-primary-lighter);
    --table-hover-color: var(--theme-text-dark);
    --table-cell-padding: 5px;
    --table-control-text-align: center;
    --table-control-padding: 0px;
}

/* ===================== GLOBAL ===================== */
html {
    font-family: 'Congenial', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 10pt !important;
    font-weight: 600;
}

body,
.form-control {
    /* font-family: 'Congenial', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;*/
    font-weight: 600;
}

    body.select2-open {
        overflow-x: hidden;
    }

input {
    autocomplete: off;
}

/* ===================== THEME UTILITIES ===================== */
.theme-bg-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
}

.theme-border {
    border-color: var(--theme-border) !important;
}

.theme-text {
    color: var(--theme-primary) !important;
}

.theme-bg-soft {
    background-color: var(--theme-primary-light) !important;
}

.theme-bg-lightest {
    background-color: var(--theme-primary-lighter) !important;
}

/* ===================== EXISTING THEME CLASSES ===================== */
.theme-bg {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
    border-color: var(--theme-border);
}

    .theme-bg td {
        color: var(--theme-text-light) !important;
    }

.theme-bg-lighter {
    background-color: var(--theme-primary-light);
    color: var(--theme-text-light) !important;
    border-color: var(--theme-border);
}

.theme-navbar {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
    border-color: var(--theme-border);
}

.theme-card {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-border);
}

.theme-text-color,
a {
    color: var(--theme-primary);
}

/* ===================== NAVBAR ===================== */
.theme-navbar .nav-item,
.theme-navbar .nav-link,
.theme-navbar .navbar-brand {
    padding: 5px 7px !important;
    color: var(--theme-text-light) !important;
}

.theme-navbar .dropdown-menu {
    background-color: var(--theme-primary-lighter) !important;
}

    .theme-navbar .dropdown-menu li a:hover {
        background-color: var(--theme-primary) !important;
        color: var(--theme-primary-lighter);
    }

    .theme-navbar .dropdown-menu li .dropdown-item {
        font-weight: 500 !important;
    }

/* ===================== BUTTON ===================== */
.theme-btn {
    padding: 5px 25px;
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-text-light);
    line-height: 1.5;
    font-weight: 600;
}

    .theme-btn:hover,
    .theme-btn:focus {
        background-color: var(--theme-primary-lighter) !important;
        border-color: var(--theme-primary-lighter) !important;
        color: var(--theme-primary);
        box-shadow: 0 2px 8px var(--theme-shadow) !important;
        font-weight: 600;
    }

.input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

    .input-group .form-select,
    .input-group select {
        min-width: 0;
    }

    .input-group .select2-container {
        min-width: 0;
        flex: 1 1 auto;
    }

    .input-group > .select2-container {
        width: 1% !important;
    }

        .input-group > .select2-container:not(:first-child) {
            margin-left: -1px;
        }

            .input-group > .select2-container:not(:first-child) .select2-selection--single,
            .input-group > .select2-container:not(:first-child) .select2-selection--multiple {
                border-top-left-radius: 0 !important;
                border-bottom-left-radius: 0 !important;
            }

        .input-group > .select2-container:not(:last-child) .select2-selection--single,
        .input-group > .select2-container:not(:last-child) .select2-selection--multiple {
            border-top-right-radius: 0 !important;
            border-bottom-right-radius: 0 !important;
        }

.input-group-sm > .select2-container .select2-selection--single {
    height: calc(1.5em + 2px);
    min-height: calc(1.5em + 2px);
    padding-top: 0;
    padding-right: 2rem;
    padding-bottom: 0;
    padding-left: 0.5rem;
}

.input-group-lg > .select2-container .select2-selection--single {
    height: calc(1.5em + 0.5rem + 2px);
    min-height: calc(1.5em + 0.5rem + 2px);
    padding-top: 0.25rem;
    padding-right: 3rem;
    padding-bottom: 0.25rem;
    padding-left: 1rem;
}

.input-group .theme-btn {
    white-space: nowrap;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

/* ===================== TABLE - COMMON MAIN AREA STYLES ===================== */
table tr th,
.table-responsive table tr th,
table th,
.table-responsive table th,
theaad th {
    background-color: var(--table-header-bg) !important;
    color: var(--table-header-color) !important;
    border: 1px solid var(--table-header-border);
    border-bottom: 2px solid var(--table-header-border-bottom) !important;
    padding: var(--table-cell-padding) !important;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
}

table td,
.table-responsive table td {
    padding: var(--table-cell-padding) !important;
    text-align: left;
    font-weight: 500;
    vertical-align: middle !important;
}

    /* Center td if it contains controls */
    table td:has(input, select, button, textarea, a),
    .table-responsive table td:has(input, select, button, textarea, a) {
        text-align: var(--table-control-text-align);
        padding: var(--table-control-padding) !important;
    }

/* ===================== TABLE - THEME COLOR VARIABLES & HOVER STATES ===================== */
.table-responsive table {
    border: 1px solid var(--table-border);
    width: 100% !important;
}

.custom-table-hover tbody tr:hover {
    background-color: var(--theme-primary-light);
}

/* Overwrite Bootstrap's table-hover / table-striped behavior for clear hover feedback */
.table-hover tbody tr {
    transition: background-color 0.15s ease-in-out;
}

    .table-hover tbody tr:hover td,
    .table-hover tbody tr:hover th,
    .table-responsive .table-hover tbody tr:hover td,
    .table-responsive .table-hover tbody tr:hover th {
        background-color: var(--table-hover-bg) !important;
        color: var(--table-hover-color) !important;
    }


/* ===================== FORM ===================== */
.form-control,
.form-select {
    border-radius: 0px !important;
    display: flex;
    align-items: center;
}

    .form-control:not(textarea):not([type="file"]),
    .form-select,
    select {
        line-height: var(--theme-control-line-height);
        padding-top: var(--theme-control-padding-y);
        padding-bottom: var(--theme-control-padding-y);
        padding-left: var(--theme-control-padding-x);
    }

    .form-control:not(textarea):not([type="file"]),
    .form-select,
    select,
    .select2-container .select2-selection--single {
        min-height: var(--theme-control-height);
    }

.form-select,
select {
    padding-right: var(--theme-control-padding-right-select);
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--theme-primary);
        box-shadow: 0 0 0 0.2rem var(--theme-shadow);
    }

.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

    .select2-container,
    .select2-container * {
        font-family: 'Congenial', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
        font-weight: 500;
        font-size: inherit;
    }


:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--single,
:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--multiple {
    border-radius: 0px !important;
    border-color: #ced4da !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--single {
    display: flex;
    align-items: center;
    height: var(--theme-control-height);
    padding-top: var(--theme-control-padding-y);
    padding-right: var(--theme-control-padding-right-select);
    padding-bottom: var(--theme-control-padding-y);
    padding-left: var(--theme-control-padding-x);
}

    :is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--single .select2-selection__rendered {
        color: var(--theme-text-dark);
        line-height: var(--theme-control-line-height);
        margin: 0;
        padding: 0;
    }

    :is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--single .select2-selection__arrow {
        height: calc(1.5em);
    }

:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--focus .select2-selection--single,
:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--focus .select2-selection--multiple,
:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--open .select2-selection--single,
:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--open .select2-selection--multiple {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 0.2rem var(--theme-shadow) !important;
}

.select2-dropdown {
    border-color: #ced4da !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden;
}

.select2-results,
.select2-results__options {
    overflow-x: hidden;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-results__option--selected {
    background-color: var(--theme-primary-light) !important;
    color: var(--theme-primary-dark) !important;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--multiple .select2-selection__choice {
    border-radius: 0px !important;
    border-color: var(--theme-primary-light) !important;
    background-color: var(--theme-primary-light) !important;
    color: var(--theme-primary-dark) !important;
}

/* ===================== CARDS ===================== */
.card {
    border-radius: 10px;
}

.card-header {
    font-weight: 600;
}

/* ===================== LIST ===================== */
.list-group-item:hover {
    background-color: var(--theme-primary-light);
}

.theme-academic-nav-wrap {
    background: linear-gradient(180deg, rgba(106, 63, 181, 0.08) 0%, rgba(106, 63, 181, 0.02) 100%);
    border: 1px solid rgba(106, 63, 181, 0.18);
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 6px 18px rgba(106, 63, 181, 0.08);
}

.theme-academic-nav-title {
    align-items: center;
    color: var(--theme-primary-dark);
    display: flex;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.25rem;
}

.theme-academic-nav {
    border-radius: 8px;
    gap: 0.45rem;
}

    .theme-academic-nav .list-group-item {
        background-color: #ffffff;
        border: 1px solid rgba(106, 63, 181, 0.16);
        border-radius: 8px !important;
        color: var(--theme-primary-dark);
        font-weight: 600;
        padding: 0.85rem 0.9rem;
        transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    }

        .theme-academic-nav .list-group-item:hover {
            border-color: rgba(106, 63, 181, 0.35);
            box-shadow: 0 4px 12px rgba(106, 63, 181, 0.12);
            transform: translateX(2px);
        }

        .theme-academic-nav .list-group-item.active,
        .theme-academic-nav .list-group-item.active:hover {
            background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
            border-color: var(--theme-primary);
            box-shadow: 0 8px 18px rgba(106, 63, 181, 0.22);
            color: var(--theme-text-light);
        }

.theme-session-list {
    background-color: #fff;
    border: 1px solid rgba(106, 63, 181, 0.16);
    border-radius: 12px;
    gap: 0;
    overflow: hidden;
}

    .theme-session-list .theme-session-item {
        align-items: center;
        background: transparent;
        border: 0;
        border-bottom: 1px solid rgba(106, 63, 181, 0.12);
        border-radius: 0 !important;
        display: flex;
        justify-content: space-between;
        min-height: 52px;
        padding: 0.8rem 0.95rem;
    }

        .theme-session-list .theme-session-item:last-child {
            border-bottom: 0;
        }

        .theme-session-list .theme-session-item:hover {
            background-color: rgba(106, 63, 181, 0.05);
            box-shadow: none;
            transform: none;
        }

        .theme-session-list .theme-session-item.active,
        .theme-session-list .theme-session-item.active:hover {
            background: linear-gradient(90deg, rgba(106, 63, 181, 0.14) 0%, rgba(106, 63, 181, 0.04) 100%);
            border-color: rgba(106, 63, 181, 0.12);
            box-shadow: inset 4px 0 0 var(--theme-primary);
            color: var(--theme-primary-dark);
        }

.theme-session-text {
    color: inherit;
    display: block;
    font-weight: 700;
    line-height: 1.35;
    padding-right: 0.75rem;
}

.theme-session-arrow {
    align-items: center;
    background-color: rgba(106, 63, 181, 0.08);
    border-radius: 999px;
    color: var(--theme-primary);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    width: 32px;
}

    .theme-session-arrow:hover,
    .theme-session-arrow:focus {
        background-color: var(--theme-primary);
        color: var(--theme-text-light);
        transform: translateX(2px);
    }

    .theme-session-arrow.active {
        background-color: var(--theme-primary);
        color: var(--theme-text-light);
    }

.theme-session-empty {
    background-color: rgba(106, 63, 181, 0.06);
    border: 1px dashed rgba(106, 63, 181, 0.25);
    border-radius: 12px;
    color: var(--theme-primary-dark);
    font-weight: 600;
    padding: 1rem;
}

.theme-academic-detail-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 238, 251, 0.72) 100%);
    border: 1px solid rgba(106, 63, 181, 0.16);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(106, 63, 181, 0.08);
    min-height: 100%;
    padding: 1.2rem;
}

.theme-academic-detail-header {
    border-bottom: 1px solid rgba(106, 63, 181, 0.12);
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
}

.theme-academic-detail-kicker {
    color: rgba(74, 44, 130, 0.75);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.theme-academic-detail-title {
    color: var(--theme-primary-dark);
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.theme-session-state-badge {
    align-self: flex-start;
    background-color: var(--theme-primary);
    border-radius: 999px;
    color: var(--theme-text-light);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
}

@media (max-width: 575.98px) {
    .theme-academic-detail-title {
        font-size: 1.1rem;
    }

    .theme-session-list .theme-session-item {
        padding: 0.75rem;
    }
}

/* ===================== PAGINATION ===================== */
.page-link {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
    border-color: var(--theme-primary);
}

/* ===================== EXTRA ===================== */
.entry-section-title {
    background: var(--theme-primary-light-20);
    color: var(--theme-text-dark) !important;
    border-radius: 8px;
    padding: 0.5rem;
}

/* ===================== footer ===================== */
.session-footer {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 15px;
    text-align: center;
    z-index: 1;
}

/* ================== Login Page ==================== */
.login-container {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

    .login-container .login-card {
        width: 100%;
        max-width: 900px;
        border: none;
        border-radius: 24px;
        overflow: hidden;
        background-color: #fff;
        box-shadow: 0 20px 60px var(--theme-shadow);
    }

    .login-container .login-left {
        padding: 3rem 2.5rem;
    }

    .login-container .login-right {
        background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
        color: var(--theme-text-light);
        padding: 3rem 2.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .login-container .login-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 1.5rem;
        border-radius: 50%;
        background: var(--theme-primary-light);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--theme-primary);
        font-size: 1.5rem;
    }

    .login-container .login-title {
        margin: 0;
        font-size: 1.7rem;
        font-weight: 700;
        color: var(--theme-primary-dark);
    }

    .login-container .login-subtitle {
        margin-top: 0.6rem;
        color: var(--theme-primary-dark);
        opacity: 0.7;
        font-size: 0.95rem;
    }

    .login-container .form-label {
        font-weight: 600;
        color: var(--theme-primary-dark);
    }

    .login-container .input-group-text {
        background-color: var(--theme-primary-lighter);
        border-color: var(--theme-primary-light);
        min-width: 46px;
        justify-content: center;
    }

    .login-container .form-control {
        border-color: #ced4da;
        border-radius: 4px;
    }

        .login-container .form-control:focus {
            border-color: var(--theme-primary);
            box-shadow: 0 0 0 0.2rem var(--theme-primary-light);
        }

    .login-container .btn-login {
        width: 100%;
        padding: 0.85rem 1rem;
        background-color: var(--theme-primary) !important;
        border-color: var(--theme-primary) !important;
        color: var(--theme-text-light) !important;
        font-weight: 600;
        border-radius: 4px;
    }

        .login-container .btn-login:hover {
            background-color: var(--theme-primary-dark) !important;
            border-color: var(--theme-primary-dark) !important;
        }

/*************** Pagination Code:Start ***************/
.table-pager {
    background-color: var(--theme-primary-lighter);
    padding: 6px;
    border-radius: 8px;
}

    .table-pager table {
        padding: 0px;
        margin: 0px auto;
        border-radius: 25px;
    }

        .table-pager table tr td span,
        .table-pager table tr td a {
            text-align: center;
            font-size: 10pt;
            font-weight: bold;
            color: var(--theme-primary-dark) !important;
            background-color: #fff;
            min-width: 25px !important;
            padding: 5px !important;
            border: 1px solid var(--theme-primary-light);
            border-radius: 10px;
            text-decoration: none;
            display: inline-block;
        }

        .table-pager table tr td a {
            padding: 5px !important;
            margin: 5px !important;
            background-color: var(--theme-primary);
            color: var(--theme-text-light) !important;
            transition: all 0.2s ease;
        }

            .table-pager table tr td a:hover {
                background-color: var(--theme-primary-dark);
                border-color: var(--theme-primary-dark);
                box-shadow: 0 2px 6px var(--theme-shadow);
            }

/* ===================== ADMIN LAYOUT ===================== */
.admin-header-bar {
    background-color: var(--theme-text-light);
    border-bottom: 1px solid #dee2e6;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2b3a4a;
    margin: 0;
}

.admin-navbar {
    background-color: var(--theme-primary) !important;
    padding: 0 !important;
    margin: 0;
}

.admin-navbar .navbar-nav {
    margin-bottom: 0 !important;
}

.admin-navbar .nav-link {
    color: #fff !important;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1;
    padding: 1rem 1.2rem !important;
    display: flex;
    align-items: center;
}

.admin-navbar .nav-link:hover,
.admin-navbar .nav-link.active,
.admin-navbar .nav-link.show {
    background-color: var(--theme-primary-dark) !important;
}

.admin-navbar .nav-link .fa {
    font-size: 1.15rem;
}

.admin-navbar .dropdown-menu {
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-navbar .dropdown-item {
    color: #2b3a4a !important;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
}

.admin-navbar .dropdown-item:hover {
    background-color: var(--theme-primary-lighter) !important;
    color: var(--theme-primary-dark) !important;
}

.admin-main-container {
    min-height: calc(100vh - 170px);
}

.admin-footer {
    background-color: var(--theme-text-light);
    border-top: 1px solid #dee2e6;
    padding: 1rem 0;
    color: #6c757d;
}

.user-profile-btn {
    background: none;
    border: none;
    color: #495057;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ==================== GLOBAL SAAS TABLES & DATATABLES ==================== */
/* Universal themed tables: list grids, voucher line items, modern-table */
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) {
    border: 1px solid var(--table-cell-border) !important;
    border-collapse: collapse !important;
}

    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead tr,
    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead th {
        background-color: var(--table-header-bg) !important;
        color: var(--table-header-color) !important;
        font-weight: 600 !important;
        border: 1px solid var(--table-header-border) !important;
        vertical-align: middle;
    }

    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead th {
        text-align: center !important;
    }

        :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead th.text-start {
            text-align: left !important;
        }

        :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead th.text-end {
            text-align: right !important;
        }

    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tbody > tr > td,
    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tfoot > tr > td,
    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tbody > tr > th,
    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tfoot > tr > th {
        background-color: var(--table-body-bg);
        border: 1px solid var(--table-cell-border) !important;
    }

    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered.table-hover):not(.table-sm) > tbody > tr:hover > * {
        background-color: var(--table-row-hover-bg) !important;
    }

    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tfoot > tr,
    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tfoot > tr > td,
    :is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) > tfoot > tr > th {
        background-color: var(--table-footer-bg) !important;
    }

    :is(.modern-table, .responsive-items-table) > tbody > tr.quick-entry-row > *,
    :is(.modern-table, .responsive-items-table) > tbody > tr.quick-entry-row:hover > * {
        background-color: var(--table-quick-entry-bg) !important;
    }

/* List grids in main layout (Index/Search pages without table-bordered) */
.container-fluid .table-responsive > table.table:not(.table-sm) thead tr,
.container-fluid .table-responsive > table.table:not(.table-sm) thead th {
    background-color: var(--table-header-bg) !important;
    color: var(--table-header-color) !important;
    font-weight: 600 !important;
    border: 1px solid var(--table-header-border) !important;
    vertical-align: middle;
    text-align: center !important;
}

.container-fluid .table-responsive > table.table:not(.table-sm) > tbody > tr > td,
.container-fluid .table-responsive > table.table:not(.table-sm) > tfoot > tr > td {
    background-color: var(--table-body-bg);
    border: 1px solid var(--table-cell-border) !important;
}

.container-fluid .table-responsive > table.table.table-hover:not(.table-sm) > tbody > tr:hover > * {
    background-color: var(--table-row-hover-bg) !important;
}

/* Backward-compatible alias */
.modern-table {
    border: 1px solid var(--table-cell-border) !important;
    border-collapse: collapse !important;
}

/* Common sizing helpers */
.w-40 {
    width: 40px !important;
}

.w-60 {
    width: 60px !important;
}

.w-80 {
    width: 80px !important;
}

/* Prevent sort icon overlap on sortable table headers */
table.dataTable thead th.dt-orderable-asc,
table.dataTable thead th.dt-orderable-desc,
table.dataTable thead th.dt-orderable-none,
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
thead th[class*="sorting"] {
    padding-right: 32px !important;
    white-space: nowrap !important;
    position: relative;
}

/* Make DataTable paging buttons slightly wider and bolder */
.pagination .page-item .page-link {
    min-width: 38px;
    text-align: center;
    font-weight: 700;
}

/* Custom search label alignment for inline headers */
.saas-search-label {
    white-space: nowrap;
    text-align: right;
    font-weight: 600;
    min-width: 60px;
}

/* ===================== FLATPICKR OVERRIDES ===================== */
.flatpickr-calendar select.flatpickr-monthDropdown-months {
    min-height: auto !important;
    height: auto !important;
    padding: 0 10px 0 5px !important;
    line-height: inherit !important;
    display: inline-block !important;
    width: auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-weight: bold !important;
    font-size: inherit !important;
}

.flatpickr-calendar input.numInput.cur-year {
    height: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    line-height: inherit !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-weight: bold !important;
    font-size: inherit !important;
}

/* Disable/hide spin buttons globally for number inputs in WebKit (Chrome, Safari, Edge) and Firefox */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ==================== SELECT2 IN INPUT GROUPS ==================== */
.input-group .select2-container--bootstrap-5 {
    flex-grow: 1;
}

    .input-group .select2-container--bootstrap-5 .select2-selection {
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

/* ==================== UNIVERSAL TRANSACTING / VOUCHER ITEMS TABLES ==================== */
.responsive-items-table .select2-container--bootstrap-5 {
    width: 100% !important;
}

.quick-entry-input {
    border-color: var(--theme-primary) !important;
}

.quick-entry-row {
    background-color: var(--table-quick-entry-bg) !important;
    /*border: 2px dashed var(--theme-primary) !important;*/
}

.responsive-items-table tbody tr.quick-entry-row > td :is(.form-control, .form-select) {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.responsive-items-table tbody tr.quick-entry-row > td .input-group {
    min-width: 0;
    width: 100%;
}

.card-charges {
    background-color: #fafafa;
    border: 1px solid #e9e9e9;
}

.col-form-label-sm {
    padding-top: calc(0.25rem + 1px);
    padding-bottom: calc(0.25rem + 1px);
    font-size: .875rem;
}

.card.theme-bg-lighter,
.card-body.theme-bg-lighter,
.theme-bg-lighter .responsive-items-table,
.theme-bg-lighter .responsive-items-table tbody td,
.theme-bg-lighter .responsive-items-table tfoot td,
.theme-bg-lighter .responsive-items-table tbody tr,
.theme-bg-lighter .responsive-items-table tfoot tr {
    background-color: var(--theme-primary-lighter) !important;
}

.card.theme-bg-lighter {
    border: none !important;
    box-shadow: none !important;
}

.divider-dashed {
    border-top: 1px dashed #dee2e6;
    margin: 20px 0;
}

@media (min-width: 992px) {
    .responsive-items-table {
        min-width: 1000px;
    }
        /* Use proper table borders in header, body, and footer */
        .responsive-items-table th,
        .responsive-items-table td,
        .responsive-items-table tfoot td {
            border: 1px solid var(--table-cell-border) !important;
        }
            /* Use right padding for numeric values (headers, body cells, and footer sums) */
            .responsive-items-table th.text-end,
            .responsive-items-table td.text-end,
            .responsive-items-table tfoot td[data-label^="Total"] {
                padding-right: 15px !important;
            }
}

@media (max-width: 991.98px) {
    .responsive-items-table,
    .responsive-items-table thead,
    .responsive-items-table tbody,
    .responsive-items-table tfoot,
    .responsive-items-table tr,
    .responsive-items-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

        .responsive-items-table thead {
            display: none !important;
        }

        .responsive-items-table tbody tr,
        .responsive-items-table tfoot tr {
            background: #fff;
            border: 1px solid #e2e8f0 !important;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            position: relative;
        }

            .responsive-items-table tbody tr:hover {
                background-color: var(--table-row-hover-bg) !important;
            }

        .responsive-items-table tfoot tr {
            background: var(--table-footer-bg);
            margin-top: 15px;
            margin-bottom: 0;
        }

        .responsive-items-table td,
        .responsive-items-table tfoot td {
            border: none !important;
            padding: 6px 0 !important;
            display: flex !important;
            justify-content: space-between;
            align-items: center;
        }

            .responsive-items-table td.row-number-label,
            .responsive-items-table tfoot td:empty {
                display: none !important;
            }

            .responsive-items-table td::before,
            .responsive-items-table tfoot td::before {
                content: attr(data-label);
                font-weight: 700;
                color: #475569;
                width: 130px;
                text-align: left;
                flex-shrink: 0;
            }

            .responsive-items-table td input:not([type="hidden"]),
            .responsive-items-table td select,
            .responsive-items-table td .select2-container {
                width: 100% !important;
            }

            .responsive-items-table td[data-label="Item"] {
                flex-direction: column !important;
                align-items: flex-start !important;
                border-bottom: 1px solid #f1f5f9 !important;
                padding-bottom: 10px !important;
                margin-bottom: 8px !important;
            }

                .responsive-items-table td[data-label="Item"]::before {
                    content: "Item Name *";
                    width: 100% !important;
                    margin-bottom: 4px;
                }

            .responsive-items-table td[data-label="#"]::before,
            .responsive-items-table td[data-label="Action"]::before {
                display: none !important;
            }

            .responsive-items-table td[data-label="Action"] {
                justify-content: center !important;
                border-top: 1px solid #f1f5f9 !important;
                padding-top: 12px !important;
                margin-top: 8px !important;
            }

                .responsive-items-table td[data-label="Action"] :is(.btn-group, .btn) {
                    width: 100%;
                }

            .responsive-items-table tfoot td[colspan="3"] {
                justify-content: center !important;
                background: #e2e8f0;
                padding: 8px 0 !important;
                border-radius: 4px;
                margin-bottom: 8px;
            }

                .responsive-items-table tfoot td[colspan="3"]::before {
                    content: "Total Summary" !important;
                }
}

/* ===================== DAY SUMMARY PANEL ===================== */
.day-summary-card {
    background: #fff;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.day-summary-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--theme-primary-lighter) 0%, #fff 100%);
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.12);
}

.day-summary-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--theme-text-dark);
}

.day-summary-subtitle {
    display: block;
    margin-top: 2px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
}

.day-summary-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.day-summary-metric {
    min-width: 140px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.day-summary-metric-primary {
    border-color: rgba(var(--theme-primary-rgb), 0.35);
    background: rgba(var(--theme-primary-rgb), 0.06);
}

.day-summary-metric-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.day-summary-metric-value {
    display: block;
    margin-top: 2px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--theme-primary-dark);
    text-align: right;
}

.day-summary-card-body {
    padding: 1rem 1.25rem 1.25rem;
    background: var(--theme-primary-light-03);
}

.day-summary-group {
    height: 100%;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.day-summary-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eef2f7;
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
}

.day-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.day-summary-list-compact {
    gap: 0.25rem;
}

.day-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.4rem;
    border-radius: 6px;
    font-size: 1rem;
}

.day-summary-row span {
    color: #64748b;
    font-weight: 600;
}

.day-summary-row strong {
    color: #0f172a;
    font-weight: 700;
    white-space: nowrap;
}

.day-summary-row-accent {
    margin-top: 0.15rem;
    background: var(--theme-primary-light);
}

.day-summary-row-accent span,
.day-summary-row-accent strong {
    color: var(--theme-primary-dark);
}

.day-summary-item-breakdown {
    padding-top: 0.5rem;
    border-top: 1px dashed #dbe3ee;
}

.day-summary-breakdown-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.4rem;
}

.day-summary-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.day-summary-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 0.95rem;
}

.day-summary-item-name {
    color: #475569;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.day-summary-item-row strong {
    color: #0f172a;
    font-weight: 700;
    white-space: nowrap;
}

.day-summary-item-empty {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.35rem;
}

@media (max-width: 767.98px) {
    .day-summary-card-header {
        padding: 0.85rem 1rem;
    }

    .day-summary-metrics {
        width: 100%;
    }

    .day-summary-metric {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
}

/* ===================== MODERN UI COMPONENTS ===================== */
.admin-content-area {
    background-color: #f4f7f9;
}

.ui-page-header {
    margin-bottom: 1.5rem;
}

.ui-page-title {
    color: var(--theme-primary-dark);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.ui-page-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0;
}

.ui-stat-card {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.ui-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.ui-stat-card .card-body {
    padding: 1.1rem 1.25rem;
}

.ui-stat-card--primary {
    border-left: 5px solid var(--theme-primary) !important;
    background-color: var(--theme-primary-lighter);
}

.ui-stat-card--success {
    border-left: 5px solid #28a745 !important;
    background-color: rgba(40, 167, 69, 0.06);
}

.ui-stat-card--info {
    border-left: 5px solid #17a2b8 !important;
    background-color: rgba(23, 162, 184, 0.06);
}

.ui-stat-card--warning {
    border-left: 5px solid #ffc107 !important;
    background-color: rgba(255, 193, 7, 0.06);
}

.ui-stat-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ui-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.ui-stat-value--primary { color: var(--theme-primary-dark); }
.ui-stat-value--success { color: #1e7e34; }
.ui-stat-value--info { color: #117a8b; }
.ui-stat-value--warning { color: #d39e00; }

.ui-icon-circle {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    flex-shrink: 0;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.ui-icon-circle--primary {
    background-color: var(--theme-primary-light);
    color: var(--theme-primary);
}

.ui-icon-circle--success {
    background-color: rgba(40, 167, 69, 0.12);
    color: #28a745;
}

.ui-icon-circle--info {
    background-color: rgba(23, 162, 184, 0.12);
    color: #17a2b8;
}

.ui-icon-circle--warning {
    background-color: rgba(255, 193, 7, 0.12);
    color: #ffc107;
}

.ui-panel {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.ui-panel-header {
    align-items: center;
    background-color: var(--theme-primary-lighter);
    border-bottom: 1px solid var(--theme-primary-light);
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
}

.ui-panel-title {
    color: var(--theme-primary-dark);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0;
}

.ui-panel-body--flush {
    padding: 0;
}

.ui-table thead th.ui-table-head {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary-dark) !important;
    color: var(--theme-text-light) !important;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.ui-table thead th.ui-table-head.text-end {
    text-align: right !important;
}

.ui-badge-count {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    height: 26px;
    justify-content: center;
    min-width: 26px;
    padding: 0;
}

.ui-filter-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
}

.ui-action-bar {
    background: linear-gradient(180deg, var(--theme-primary-lighter) 0%, #fff 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.15);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.ui-action-bar .btn-group .theme-btn {
    border-radius: 6px;
    margin: 2px;
}

.admin-top-chrome {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.admin-header-bar {
    box-shadow: none;
    position: relative;
    z-index: 1;
}

.user-profile-btn {
    align-items: center;
    background-color: var(--theme-primary-light);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.2);
    border-radius: 999px;
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.user-profile-btn:hover,
.user-profile-btn:focus,
.user-profile-btn.show {
    background-color: var(--theme-primary-lighter);
    box-shadow: 0 2px 8px rgba(var(--theme-primary-rgb), 0.15);
}

.admin-brand-mark {
    align-items: center;
    color: var(--theme-primary-dark);
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 700;
    gap: 0.5rem;
    text-decoration: none;
}

.admin-brand-mark:hover {
    color: var(--theme-primary);
}

.ui-empty-state {
    color: #94a3b8;
    font-weight: 600;
    padding: 2.5rem 1rem;
    text-align: center;
}

@media (max-width: 767.98px) {
    .ui-stat-value {
        font-size: 1.45rem;
    }

    .ui-icon-circle {
        height: 48px;
        width: 48px;
    }
}
