/* ========================= Professional Primary Theme ========================= */

:root,
[data-bs-theme="light"] {
    --app-primary: #2563EB;
    --app-primary-rgb: 37, 99, 235;
    --bs-primary: #2563EB;
    --bs-primary-rgb: 37, 99, 235;
    --kt-primary: #2563EB;
    --bs-link-color: #2563EB;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: #1D4ED8;
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-focus-ring-color: rgba(37, 99, 235, 0.25);
}

/* ========================= Active Menu ========================= */

#kt_app_sidebar_toggle,
#kt_app_sidebar_toggle i {
    color: var(--bs-primary) !important;
}

#kt_app_sidebar_toggle {
    background: rgba(var(--bs-primary-rgb), .08) !important;
}

#kt_app_sidebar_toggle:hover,
#kt_app_sidebar_toggle.active {
    background: rgba(var(--bs-primary-rgb), .14) !important;
}

.app-sidebar .menu .menu-item .menu-link {
    position: relative;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.app-sidebar .menu .menu-item .menu-link.active {
    background: rgba(var(--bs-primary-rgb), .100) !important;
    color: var(--bs-primary) !important;
    box-shadow: inset 4px 0 0 var(--bs-primary), 0 8px 18px rgba(var(--bs-primary-rgb), .08);
}

.app-sidebar .menu .menu-item .menu-link.active .menu-title,
.app-sidebar .menu .menu-item .menu-link.active .menu-icon,
.app-sidebar .menu .menu-item .menu-link.active .menu-icon i,
.app-sidebar .menu .menu-item .menu-link.active .menu-bullet,
.app-sidebar .menu .menu-item .menu-link.active .menu-arrow::after {
    color: var(--bs-primary) !important;
}

.app-sidebar .menu .menu-item .menu-link.active .menu-arrow::after {
    background-color: var(--bs-primary) !important;
}

.app-sidebar .menu .menu-item .menu-link.active .bullet {
    background-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .16);
}

.app-sidebar .menu .menu-item.here>.menu-link:not(.active) {
    background: rgba(var(--bs-primary-rgb), .06) !important;
}

.app-sidebar .menu .menu-item.here>.menu-link:not(.active) .menu-title,
.app-sidebar .menu .menu-item.here>.menu-link:not(.active) .menu-icon,
.app-sidebar .menu .menu-item.here>.menu-link:not(.active) .menu-icon i,
.app-sidebar .menu .menu-item.here>.menu-link:not(.active) .menu-arrow::after {
    color: var(--bs-primary) !important;
}

.app-sidebar .menu .menu-item.here>.menu-link:not(.active) .menu-arrow::after {
    background-color: var(--bs-primary) !important;
}

/* ========================= Shared Footer ========================= */

.app-footer-company-link {
    color: var(--bs-gray-600) !important;
}

.app-footer-company-link:hover,
.app-footer-company-link:focus {
    color: var(--bs-primary) !important;
}

.app-footer-primary-link,
.app-footer-primary-link:hover,
.app-footer-primary-link:focus,
#kt_app_footer .app-footer-primary-link,
#kt_app_footer .app-footer-primary-link:hover,
#kt_app_footer .app-footer-primary-link:focus,
.auth-footer .app-footer-primary-link,
.auth-footer .app-footer-primary-link:hover,
.auth-footer .app-footer-primary-link:focus {
    color: var(--bs-primary) !important;
}

/* ========================= Shared Module Status ========================= */

.app-status-pill {
    --status-color: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    min-height: 24px;
    padding: 4px 8px;
    overflow: visible;
    border: 1px solid rgba(var(--bs-primary-rgb), .28);
    border-color: color-mix(in srgb, var(--status-color) 30%, transparent);
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), .09);
    background: color-mix(in srgb, var(--status-color) 10%, transparent);
    color: var(--bs-body-color);
    color: color-mix(in srgb, var(--status-color) 68%, var(--bs-body-color));
    box-shadow: 0 2px 7px rgba(15, 23, 42, .04);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

.app-status-pill__dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--status-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 14%, transparent);
}

.app-status-pill__label {
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ========================= Pagination ========================= */

.pagination {
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination .page-item {
    margin: 0 !important;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #4a5570 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination .page-item.active .page-link,
.pagination .page-item.active>.page-link {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.pagination .page-item .page-link:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
    color: var(--bs-primary) !important;
}

.pagination .page-item.previous .page-link,
.pagination .page-item.next .page-link,
.pagination .page-item.first .page-link,
.pagination .page-item.last .page-link {
    min-width: 24px;
    width: 24px;
    height: 28px;
    color: #4a5570 !important;
    font-size: 20px;
    font-weight: 400;
}

.pagination .page-item.disabled .page-link {
    background: transparent !important;
    color: #c9ceda !important;
    opacity: 1;
}

/* ========================= Card Header Toolbars ========================= */

.card-header .card-toolbar,
.card-header [data-kt-user-table-toolbar="base"],
.card-header .d-flex.align-items-center.ms-auto,
.card-header .d-flex.justify-content-end {
    gap: 0.4rem !important;
}

.card-header .card-toolbar .me-3,
.card-header [data-kt-user-table-toolbar="base"] .me-3,
.card-header .d-flex.align-items-center.ms-auto .me-3,
.card-header .d-flex.justify-content-end .me-3 {
    margin-right: 0.25rem !important;
}

.card-header .card-toolbar .btn + .btn,
.card-header [data-kt-user-table-toolbar="base"] .btn + .btn,
.card-header .d-flex.align-items-center.ms-auto .btn + .btn,
.card-header .d-flex.justify-content-end .btn + .btn {
    margin-left: 0 !important;
}

/* ========================= Demo38 DataTables UI ========================= */

.dataTables_wrapper.app-dt-wrapper,
.dt-container.app-dt-wrapper {
    color: var(--bs-gray-700);
}

.dataTables_wrapper.app-dt-wrapper .dataTables_length,
.dataTables_wrapper.app-dt-wrapper .dataTables_filter,
.dataTables_wrapper.app-dt-wrapper .dataTables_info,
.dataTables_wrapper.app-dt-wrapper .dataTables_paginate {
    padding-inline: .25rem;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_length,
.dataTables_wrapper.app-dt-wrapper .dataTables_filter {
    margin-bottom: .95rem;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_length label,
.dataTables_wrapper.app-dt-wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    color: var(--bs-gray-600);
    font-size: .875rem;
    font-weight: 700;
}

.dataTables_wrapper.app-dt-wrapper .app-dt-search,
.dataTables_wrapper.app-dt-wrapper .app-dt-length {
    min-height: 38px;
    border-color: transparent;
    border-radius: .75rem;
    background-color: var(--bs-gray-100);
    color: var(--bs-gray-700);
    font-weight: 600;
    box-shadow: none;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.dataTables_wrapper.app-dt-wrapper .app-dt-search {
    min-width: 235px;
    padding-inline: 1rem;
}

.dataTables_wrapper.app-dt-wrapper .app-dt-length {
    min-width: 78px;
}

.dataTables_wrapper.app-dt-wrapper .app-dt-search:focus,
.dataTables_wrapper.app-dt-wrapper .app-dt-length:focus {
    border-color: rgba(var(--bs-primary-rgb), .28);
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .12);
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table {
    width: 100% !important;
    margin-top: .15rem !important;
    margin-bottom: .85rem !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table thead th,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table thead td {
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-gray-100);
    color: var(--bs-gray-600);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1.25;
    padding: .78rem .6rem;
    text-align: left !important;
    text-transform: uppercase;
    vertical-align: middle;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table thead th:first-child,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table thead td:first-child {
    border-top-left-radius: .75rem;
    border-bottom-left-radius: .75rem;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table thead th:last-child,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table thead td:last-child {
    border-top-right-radius: .75rem;
    border-bottom-right-radius: .75rem;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody td,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody th {
    border-bottom: 1px dashed var(--bs-border-color);
    color: var(--bs-gray-800);
    font-size: .9rem;
    font-weight: 400;
    padding: .74rem .6rem;
    text-align: left !important;
    vertical-align: middle;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody td :where(div, span, p, small, strong, a:not(.btn):not(.dropdown-item)),
.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody th :where(div, span, p, small, strong, a:not(.btn):not(.dropdown-item)) {
    font-weight: 400 !important;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody tr {
    transition: background-color .18s ease, box-shadow .18s ease;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), .035);
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody tr:hover td,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody tr:hover th {
    color: var(--bs-gray-900);
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody tr:last-child td,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table tbody tr:last-child th {
    border-bottom-color: transparent;
}

.dataTables_wrapper.app-dt-wrapper table.app-dt-table .dataTables_empty,
.dataTables_wrapper.app-dt-wrapper table.app-dt-table td.dataTables_empty {
    padding: 2.25rem 1rem !important;
    color: var(--bs-gray-500);
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_info {
    color: var(--bs-gray-500);
    font-size: .875rem;
    font-weight: 600;
    padding-top: .65rem;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_paginate {
    padding-top: .25rem;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .pagination {
    gap: 6px;
    margin: 0;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-link {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #4a5570;
    font-size: 13px;
    font-weight: 800;
    box-shadow: none !important;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-item.active .page-link {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-item.previous .page-link,
.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-item.next .page-link,
.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-item.first .page-link,
.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-item.last .page-link {
    min-width: 24px;
    width: 24px;
    height: 28px;
    color: #4a5570;
    font-size: 20px;
    font-weight: 400;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_paginate .page-item.disabled .page-link {
    background-color: transparent !important;
    color: #c9ceda !important;
}

.dataTables_wrapper.app-dt-wrapper .dataTables_processing {
    border: 0;
    border-radius: 1rem;
    background: var(--bs-body-bg);
    color: var(--bs-gray-700);
    font-weight: 800;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .13);
}

@media (max-width: 767.98px) {

    .dataTables_wrapper.app-dt-wrapper .dataTables_length,
    .dataTables_wrapper.app-dt-wrapper .dataTables_filter {
        width: 100%;
        text-align: left;
    }

    .dataTables_wrapper.app-dt-wrapper .dataTables_length label,
    .dataTables_wrapper.app-dt-wrapper .dataTables_filter label {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: .45rem;
    }

    .dataTables_wrapper.app-dt-wrapper .app-dt-search,
    .dataTables_wrapper.app-dt-wrapper .app-dt-length {
        width: 100%;
        min-width: 0;
    }
}

/* ========================= Primary Buttons ========================= */

.btn-primary,
.btn.btn-primary {

    --bs-btn-bg: var(--bs-primary) !important;
    --bs-btn-border-color: var(--bs-primary) !important;

    --bs-btn-hover-bg: var(--bs-primary) !important;
    --bs-btn-hover-border-color: var(--bs-primary) !important;

    --bs-btn-active-bg: var(--bs-primary) !important;
    --bs-btn-active-border-color: var(--bs-primary) !important;

    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;

    transition: all 0.2s ease !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {

    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.18), 0 10px 22px rgba(var(--bs-primary-rgb), 0.22) !important;

    opacity: 1;
}

.btn-primary:active,
.btn.btn-primary:active,
.btn-primary.active,
.btn.btn-primary.active,
.show>.btn-primary.dropdown-toggle,
.show>.btn.btn-primary.dropdown-toggle {

    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.16), 0 8px 18px rgba(var(--bs-primary-rgb), 0.18) !important;

    opacity: 1;
}

.btn-primary:focus,
.btn.btn-primary:focus {

    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;

    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

.btn:not(:disabled):not(.disabled):hover,
.btn:not(:disabled):not(.disabled):focus-visible {
    box-shadow: 0 0 0 0.22rem rgba(var(--bs-primary-rgb), 0.12), 0 8px 18px rgba(var(--bs-primary-rgb), 0.14);
}

.btn-check:focus+.btn,
.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.22) !important;
}

/* ========================= SweetAlert Primary Actions ========================= */

.swal2-popup.logout-alert-compact {
    width: min(420px, calc(100vw - 2rem));
    padding: 2rem 2rem 1.75rem;
    border-radius: 14px;
}

.swal2-popup.logout-alert-compact .swal2-icon {
    width: 5em;
    height: 5em;
    margin: 0.45rem auto 1rem;
    font-size: 0.85rem;
}

.swal2-popup.logout-alert-compact .swal2-html-container {
    margin: 0.35rem 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.swal2-popup.logout-alert-compact .swal2-actions {
    margin-top: 0.25rem;
}

.swal2-popup.logout-alert-compact .swal2-confirm {
    min-width: 104px;
    height: 40px;
    padding: 0.55rem 1.25rem;
    font-size: 0.95rem;
}

.swal2-popup .swal2-styled.swal2-confirm,
.swal2-popup .swal2-confirm.btn-primary,
.swal2-popup .swal2-confirm.btn.btn-primary,
.swal2-popup .swal2-confirm.btn-light-primary,
.swal2-popup .swal2-confirm.btn.btn-light-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.swal2-popup .swal2-styled.swal2-confirm:hover,
.swal2-popup .swal2-confirm.btn-primary:hover,
.swal2-popup .swal2-confirm.btn.btn-primary:hover,
.swal2-popup .swal2-confirm.btn-light-primary:hover,
.swal2-popup .swal2-confirm.btn.btn-light-primary:hover {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .16), 0 10px 22px rgba(var(--bs-primary-rgb), .2) !important;
    opacity: .92;
}

.swal2-popup .swal2-styled.swal2-confirm:focus,
.swal2-popup .swal2-confirm.btn-primary:focus,
.swal2-popup .swal2-confirm.btn.btn-primary:focus,
.swal2-popup .swal2-confirm.btn-light-primary:focus,
.swal2-popup .swal2-confirm.btn.btn-light-primary:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25) !important;
}

/* ========================= Compact Mode ========================= */

.compact-mode .card-body {
    padding: 1rem !important;
}

.compact-mode .app-sidebar-menu .menu-link {
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
}

/* ========================= Floating Theme Button ========================= */

.elevator-theme-float-btn {
    position: fixed;
    right: 18px;
    bottom: 22px;
    top: auto;
    transform: none;

    z-index: 1055;
    /* above app, below offcanvas */


    width: 46px;
    height: 46px;

    border-radius: 999px;
    border: 0;

    background: var(--bs-primary) !important;
    color: #fff !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);

    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.elevator-theme-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    background: rgba(var(--bs-primary-rgb), 0.95) !important;
}

.elevator-theme-float-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25), 0 8px 22px rgba(0, 0, 0, 0.18);
}

@media (max-width: 768px) {
    .elevator-theme-float-btn {
        right: 12px;
        width: 44px;
        height: 44px;
    }
}

.btn[data-kt-theme-mode] i {
    opacity: 1 !important;
    transition: all 0.2s ease;
}

.btn[data-kt-theme-mode]:hover i {
    transform: scale(1.1);
}

.dropdown-item {
    cursor: pointer;
}

/* ========================= Theme Customizer Drawer ========================= */

.theme-customizer-drawer {
    --bs-offcanvas-width: 410px;
    border-left: 1px solid var(--bs-border-color);
    box-shadow: -14px 0 34px rgba(15, 23, 42, .12);
}

.theme-customizer-header {
    align-items: center;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.85rem 1rem;
}

.theme-customizer-body {
    padding: 0.85rem 1rem;
    background:
        linear-gradient(180deg, rgba(var(--bs-primary-rgb), 0.06), transparent 180px),
        var(--bs-body-bg);
}

.theme-customizer {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.theme-customizer-section {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    padding: 0.75rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.theme-customizer-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.theme-customizer-kicker,
.theme-color-label {
    color: var(--bs-gray-600);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.theme-customizer-title {
    color: var(--bs-gray-900);
    font-size: 0.9rem;
    font-weight: 700;
}

.theme-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.theme-mode-option {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.3rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    color: var(--bs-gray-700);
    font-size: 0.78rem;
    font-weight: 700;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-mode-option i {
    font-size: 1rem;
}

.theme-mode-option:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.55);
    transform: translateY(-1px);
}

.theme-mode-option.btn-primary,
.theme-mode-option.active {
    border-color: var(--bs-gray-800) !important;
    background: var(--bs-body-bg) !important;
    color: var(--bs-gray-900) !important;
    box-shadow: inset 0 0 0 1px var(--bs-gray-800), 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.theme-mode-option.btn-primary i,
.theme-mode-option.active i {
    color: var(--bs-gray-900) !important;
}

.theme-color-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.5rem;
}

.theme-color-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.32rem;
    min-height: 51px;
    padding: 0.38rem 0.45rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: rgba(var(--bs-primary-rgb), .018);
    transition: background-color .15s ease, border-color .15s ease;
}

.theme-color-group:hover {
    border-color: var(--bs-border-color);
    background: var(--bs-gray-100);
}

.theme-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 21px);
    justify-content: start;
    gap: 0.38rem;
}

.color-swatch {
    position: relative;
    width: 21px;
    height: 21px;
    border: 2px solid var(--bs-body-bg);
    border-radius: 999px;
    background: var(--swatch-color);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12), 0 3px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12), 0 8px 18px rgba(15, 23, 42, 0.2);
}

.color-swatch.active {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.28);
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--bs-primary);
}

.theme-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.theme-control-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.theme-control-row,
.theme-radio-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-height: 40px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    background: var(--bs-gray-100);
}

.theme-control-copy,
.theme-radio-title {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 0.55rem;
    color: var(--bs-gray-800);
    font-size: 0.8rem;
    font-weight: 700;
}

.theme-control-copy i,
.theme-radio-title i {
    color: var(--bs-primary);
    font-size: 1rem;
}

.theme-radio-group+.theme-radio-group {
    margin-top: 0.5rem;
}

.theme-segmented-control {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 0.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
}

.theme-segmented-control .btn {
    border: 0;
    border-radius: 6px;
    min-width: 50px;
    font-size: 0.74rem;
    font-weight: 700;
}

.theme-segmented-control .btn-check:checked+.btn {
    background: var(--bs-primary) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .theme-customizer-section,
[data-bs-theme="dark"] .theme-mode-option,
[data-bs-theme="dark"] .theme-segmented-control {
    background: var(--bs-gray-100);
}

[data-bs-theme="dark"] .theme-control-row,
[data-bs-theme="dark"] .theme-radio-group {
    background: var(--bs-body-bg);
}

@media (max-width: 575.98px) {
    .theme-customizer-drawer {
        --bs-offcanvas-width: min(100vw, 380px);
    }

    .theme-customizer-header,
    .theme-customizer-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .theme-color-grid {
        grid-template-columns: repeat(5, 21px);
    }

    .theme-control-list {
        grid-template-columns: 1fr;
    }
}

/* Shared dark-theme fixes for dropdown/select surfaces. */
[data-bs-theme="dark"] .select2-container--bootstrap5 .select2-selection,
[data-bs-theme="dark"] .select2-container--default .select2-selection,
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: var(--bs-gray-100) !important;
    border-color: var(--bs-gray-300) !important;
    color: var(--bs-gray-700) !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap5 .select2-selection__rendered,
[data-bs-theme="dark"] .select2-container--bootstrap5 .select2-selection__placeholder,
[data-bs-theme="dark"] .select2-container--default .select2-selection__rendered,
[data-bs-theme="dark"] .select2-container--default .select2-selection__placeholder {
    color: var(--bs-gray-700) !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap5.select2-container--focus .select2-selection,
[data-bs-theme="dark"] .select2-container--bootstrap5.select2-container--open .select2-selection,
[data-bs-theme="dark"] .select2-container--default.select2-container--focus .select2-selection,
[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection {
    background-color: var(--bs-gray-100) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.45) !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .select2-dropdown,
[data-bs-theme="dark"] .select2-container--bootstrap5 .select2-dropdown,
[data-bs-theme="dark"] .select2-container--default .select2-dropdown,
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bs-gray-100) !important;
    border-color: var(--bs-gray-300) !important;
    color: var(--bs-gray-700) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-gray-300) !important;
    color: var(--bs-gray-700) !important;
}

[data-bs-theme="dark"] .select2-results__option {
    color: var(--bs-gray-700) !important;
}

[data-bs-theme="dark"] .select2-results__option--highlighted,
[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
[data-bs-theme="dark"] .select2-container--bootstrap5 .select2-results__option--highlighted {
    background-color: rgba(var(--bs-primary-rgb), 0.18) !important;
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .select2-results__option[aria-selected="true"],
[data-bs-theme="dark"] .select2-results__option--selected {
    background-color: rgba(var(--bs-primary-rgb), 0.14) !important;
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
    color: var(--bs-gray-700) !important;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:focus {
    background-color: rgba(var(--bs-primary-rgb), 0.16) !important;
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .dash-section-jump,
[data-bs-theme="dark"] .dash-period-jump {
    background-color: var(--bs-gray-100) !important;
    border-color: var(--bs-gray-300) !important;
    color: var(--bs-gray-700) !important;
}

/* Shared application modal presentation --------------------------------- */
.modal-backdrop.show {
    z-index: 1050;
    opacity: 1 !important;
    background: rgba(15, 23, 42, 0.32) !important;
    backdrop-filter: blur(14px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(120%) !important;
}

.modal {
    z-index: 1055;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal.show .modal-dialog,
.modal.show .modal-content {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4.5rem);
    overflow: hidden;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 20px !important;
}

.modal .modal-dialog.modal-fullscreen .modal-content {
    border: 0 !important;
    border-radius: 0 !important;
}

.bd-inspection-employee-dialog {
    width: min(440px, calc(100vw - 2rem)) !important;
    max-width: 440px !important;
    margin-right: auto;
    margin-left: auto;
}

.bd-inspection-employee-dialog .modal-header,
.bd-inspection-employee-dialog .modal-body,
.bd-inspection-employee-dialog .modal-footer {
    padding-right: 2rem !important;
    padding-left: 2rem !important;
}

.bd-inspection-employee-dialog .modal-footer {
    justify-content: flex-end;
}

.modal .modal-content>form {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.modal .modal-header,
.modal .modal-footer {
    flex-shrink: 0;
}

.modal .modal-header {
    background: transparent !important;
    background-image: none !important;
    color: var(--bs-body-color) !important;
    border-bottom-color: var(--bs-border-color) !important;
}

.modal .modal-header.text-white,
.modal .modal-header.bg-primary,
.modal .modal-header[class*="bg-"] {
    color: var(--bs-body-color) !important;
}

.modal .modal-header.text-white *,
.modal .modal-header.bg-primary *,
.modal .modal-header[class*="bg-"] * {
    color: inherit !important;
}

.modal .modal-header .btn-close,
.modal .modal-header .btn-close-white {
    filter: none !important;
}

[data-bs-theme="dark"] .modal .modal-header .btn-close,
[data-bs-theme="dark"] .modal .modal-header .btn-close-white {
    background-color: transparent !important;
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

.modal .modal-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: calc(100vh - 14rem);
    overflow-y: auto;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.modal .modal-body:has(> form > .text-center.pt-15:last-child) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal .modal-body>form {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.modal .modal-body>form>.row {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.modal .modal-body>form>.text-center.pt-15:last-child {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin: 0 -1.75rem -1.75rem;
    padding: 1rem 1.75rem !important;
    border-top: 1px solid var(--bs-gray-200);
    background: var(--bs-body-bg);
}

.modal .modal-footer {
    position: relative;
    z-index: 2;
    background: var(--bs-body-bg);
}

.modal-dialog:has(> .modal-content.compact-master-modal) {
    width: min(760px, calc(100vw - 2rem));
    max-width: 760px;
    margin-right: auto;
    margin-left: auto;
}

.modal .modal-content.compact-master-modal {
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 4.5rem);
}

.modal .modal-content.compact-master-modal>form {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
}

.modal .modal-content.compact-master-modal .modal-body {
    flex: 0 0 auto;
    max-height: calc(100vh - 14rem);
    padding-bottom: 0.75rem;
    overflow-y: auto;
}

.modal .modal-content.compact-master-modal .modal-footer {
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.app-modal-standard .modal-dialog,
.modal-dialog:has(> .modal-content.app-modal-standard) {
    width: min(980px, calc(100vw - 2rem));
    max-width: 980px;
    margin-right: auto;
    margin-left: auto;
}

.app-modal-standard .modal-content,
.modal-content.app-modal-standard {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 4.5rem);
    overflow: hidden;
    border: 0;
    border-radius: 20px !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.16);
}

.app-modal-standard .modal-content>form,
.modal-content.app-modal-standard>form {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.app-empty-value {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f6f8fb;
    color: #8a94a6;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.app-modal-standard .modal-header,
.modal-content.app-modal-standard .modal-header {
    flex-shrink: 0;
    min-height: 68px;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--bs-gray-200);
}

.app-modal-standard .modal-body,
.modal-content.app-modal-standard .modal-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: calc(100vh - 250px);
    padding: 1.75rem;
    overflow-y: auto;
}

.app-modal-standard .modal-footer,
.modal-content.app-modal-standard .modal-footer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    min-height: 72px;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--bs-gray-200);
    background: var(--bs-body-bg);
}

.app-modal-select2-dropdown {
    z-index: 1065;
}

.app-modal-standard .form-control,
.app-modal-standard .form-select,
.app-modal-standard .select2-selection,
.modal-content.app-modal-standard .form-control,
.modal-content.app-modal-standard .form-select,
.modal-content.app-modal-standard .select2-selection {
    min-height: 43px;
}

.app-modal-standard .is-invalid+.select2 .select2-selection,
.app-modal-standard .is-invalid,
.modal-content.app-modal-standard .is-invalid+.select2 .select2-selection,
.modal-content.app-modal-standard .is-invalid {
    border-color: var(--bs-danger) !important;
}

.was-validated .form-control:valid,
.form-control.is-valid {
    background-image: none !important;
    padding-right: 1rem;
}

.was-validated .form-select:valid,
.form-select.is-valid {
    background-image: var(--bs-form-select-bg-img) !important;
}

button.btn:has(> .ki-filter),
button.btn:has(> .bi-funnel),
button.btn:has(> .ti-filter) {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    overflow: visible;
    font-size: 0 !important;
    line-height: 1 !important;
}

button.btn:has(> .ki-filter) > .ki-filter,
button.btn:has(> .bi-funnel) > .bi-funnel,
button.btn:has(> .ti-filter) > .ti-filter {
    margin: 0 !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
}

button.btn:has(> .ki-filter) > .badge,
button.btn:has(> .bi-funnel) > .badge,
button.btn:has(> .ti-filter) > .badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    margin: 0 !important;
    font-size: 0.65rem !important;
    line-height: 1 !important;
}

.btn.is-loading:has(> .app-export-spinner),
.btn.is-loading:has(> .report-export-spinner),
a.btn.is-loading:has(> .app-export-spinner),
a.btn.is-loading:has(> .report-export-spinner) {
    pointer-events: none;
}

.btn > .app-export-spinner,
.btn > .report-export-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 0.14em;
    color: currentColor;
}

@media (max-width: 575.98px) {

    .app-modal-standard .modal-dialog,
    .modal-dialog:has(> .modal-content.app-modal-standard) {
        width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .app-modal-standard .modal-content,
    .modal-content.app-modal-standard {
        min-height: 0;
        max-height: calc(100vh - 1rem);
    }

    .modal .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .app-modal-standard .modal-header,
    .app-modal-standard .modal-body,
    .app-modal-standard .modal-footer,
    .modal-content.app-modal-standard .modal-header,
    .modal-content.app-modal-standard .modal-body,
    .modal-content.app-modal-standard .modal-footer {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}
