/*
 * xPlatform-owned color-theme extension point.
 *
 * Keep Metronic's generated style.bundle.rtl.css untouched when adding a new
 * user-selectable palette. Add the new [data-bs-theme="light-{mode-slug}"]
 * override here, after defining its menu entry and explicit persisted value in
 * _PanelLayout.cshtml.
 *
 * Required color-family tokens for every new palette:
 * --bs-primary, --bs-primary-rgb, --bs-primary-active,
 * --bs-primary-light, --bs-primary-inverse, --bs-text-primary,
 * --bs-component-active-bg, --bs-component-hover-color,
 * --bs-component-checked-bg, --bs-menu-link-color-hover/show/here/active,
 * --bs-link-color, --bs-link-color-rgb, --bs-link-hover-color,
 * --bs-link-hover-color-rgb, --bs-focus-ring-color,
 * --bs-menu-dropdown-box-shadow,
 * --bs-aside-bg-color, --bs-aside-bg-color-active,
 * --bs-aside-icon-color and --bs-aside-logo-bg-color.
 *
 * Semantic success/warning/danger colors must not be remapped to the palette.
 */

:root {
    --x-theme-primary: var(--bs-aside-bg-color-active, var(--bs-primary, #009ef7));
    --x-action-primary: #006EAF;
    --x-action-primary-hover: #00598F;
    --x-action-primary-text: #FFFFFF;
    --x-action-primary-soft: var(--bs-primary-light, #F1FAFF);
    --x-action-positive: #198754;
    --x-action-positive-hover: #146C43;
    --x-action-positive-text: #FFFFFF;
    --x-action-positive-soft: #EAF7F0;
    --x-action-danger: #C92A3A;
    --x-action-danger-hover: #A91F2E;
    --x-action-danger-text: #FFFFFF;
    --x-action-danger-soft: #FFF0F2;
    --x-action-warning: #E6A100;
    --x-action-warning-hover: #C58700;
    --x-action-warning-text: #302100;
    --x-action-warning-soft: #FFF6DB;
    --x-action-info: #146ED0;
    --x-action-info-hover: #0F58AA;
    --x-action-info-text: #FFFFFF;
    --x-action-info-soft: #EDF5FF;
    --x-action-neutral: #5F6B7A;
    --x-action-neutral-hover: #4B5563;
    --x-action-neutral-text: #FFFFFF;
    --x-action-dark: #1F2937;
    --x-action-dark-hover: #111827;
    --x-action-dark-text: #FFFFFF;
    --x-action-disabled-bg: var(--bs-gray-200, #F1F1F2);
    --x-action-disabled-text: var(--bs-gray-500, #99A1B7);
    --x-action-focus-ring: var(--bs-focus-ring-color, rgba(0, 158, 247, .28));
    --x-floating-surface-border: color-mix(in srgb, var(--bs-gray-500, #99A1B7) 38%, transparent);
    --x-floating-surface-shadow: 0 12px 30px rgba(15, 23, 42, .18), 0 3px 9px rgba(15, 23, 42, .10);
    --x-floating-tooltip-shadow: var(--x-floating-surface-shadow);
    --bs-dropdown-box-shadow: var(--x-floating-surface-shadow);
    --bs-popover-box-shadow: var(--x-floating-surface-shadow);
}

/*
 * Select2 appends its option panel outside the field wrapper. Give only that
 * floating surface enough elevation to remain distinguishable from forms and
 * tables; cards and ordinary page sections deliberately remain shadow-free.
 */
.select2-container--open .select2-dropdown,
.select2-container--bootstrap5 .select2-dropdown {
    border: 1px solid var(--x-floating-surface-border) !important;
    background-color: var(--bs-dropdown-bg, #FFFFFF) !important;
    box-shadow: var(--x-floating-surface-shadow) !important;
}

.select2-dropdown.x-report-select2-dropdown {
    z-index:100!important;
}

/*
 * Tooltips and popovers are also temporary floating surfaces. Metronic keeps
 * tooltips white, so a compact neutral shadow and a real border are required
 * to separate them from white headers, forms and page backgrounds. Keep this
 * elevation aligned with Select2/dropdowns so white tooltips remain obvious
 * on white headers, forms and page backgrounds.
 */
.tooltip .tooltip-inner {
    border: 1px solid var(--x-floating-surface-border) !important;
    background-color: var(--bs-tooltip-bg, var(--bs-body-bg, #FFFFFF)) !important;
    box-shadow: var(--x-floating-tooltip-shadow) !important;
}

.popover {
    --bs-popover-border-color: var(--x-floating-surface-border);
    --bs-popover-box-shadow: var(--x-floating-surface-shadow);
    border-color: var(--x-floating-surface-border) !important;
    box-shadow: var(--x-floating-surface-shadow) !important;
}

/* Accessible control tones for each persisted xPlatform palette. */
[data-bs-theme="light"] {
    --x-action-primary: #006EAF;
    --x-action-primary-hover: #00598F;
    --x-action-primary-text: #FFFFFF;
}

[data-bs-theme="light-blue"] {
    --x-action-primary: #4C2A85;
    --x-action-primary-hover: #3A1F67;
    --x-action-primary-text: #FFFFFF;
}

[data-bs-theme="light-brown"] {
    --x-action-primary: #C34617;
    --x-action-primary-hover: #A43A12;
    --x-action-primary-text: #FFFFFF;
}

[data-bs-theme="light-orange"] {
    --x-action-primary: #FCA311;
    --x-action-primary-hover: #E18B00;
    --x-action-primary-text: #FFFFFF;
    --bs-primary-inverse: #FFFFFF;
}

/* Role-based action colors shared by Metronic and legacy dynamic controls. */
.btn.btn-primary{border-color:var(--x-action-primary)!important;background-color:var(--x-action-primary)!important;color:var(--x-action-primary-text)!important}
.btn.btn-primary:hover,.btn.btn-primary:focus,.btn.btn-primary:focus-visible,.btn.btn-primary:active,.btn.btn-primary.active,.btn.btn-primary.show,.show>.btn.btn-primary{border-color:var(--x-action-primary-hover)!important;background-color:var(--x-action-primary-hover)!important;color:var(--x-action-primary-text)!important}
.btn.btn-success,.btn.btn-green{border-color:var(--x-action-positive)!important;background-color:var(--x-action-positive)!important;color:var(--x-action-positive-text)!important}
.btn.btn-success:hover,.btn.btn-success:focus,.btn.btn-success:focus-visible,.btn.btn-success:active,.btn.btn-success.active,.btn.btn-success.show,.show>.btn.btn-success,.btn.btn-green:hover,.btn.btn-green:focus,.btn.btn-green:focus-visible,.btn.btn-green:active,.btn.btn-green.active,.btn.btn-green.show,.show>.btn.btn-green{border-color:var(--x-action-positive-hover)!important;background-color:var(--x-action-positive-hover)!important;color:var(--x-action-positive-text)!important}
.btn.btn-danger,.btn.btn-red{border-color:var(--x-action-danger)!important;background-color:var(--x-action-danger)!important;color:var(--x-action-danger-text)!important}
.btn.btn-danger:hover,.btn.btn-danger:focus-visible,.btn.btn-danger:active,.btn.btn-red:hover,.btn.btn-red:focus-visible,.btn.btn-red:active{border-color:var(--x-action-danger-hover)!important;background-color:var(--x-action-danger-hover)!important;color:var(--x-action-danger-text)!important}
.btn.btn-warning,.btn.btn-yellow{border-color:var(--x-action-warning)!important;background-color:var(--x-action-warning)!important;color:var(--x-action-warning-text)!important}
.btn.btn-warning:hover,.btn.btn-warning:focus-visible,.btn.btn-warning:active,.btn.btn-yellow:hover,.btn.btn-yellow:focus-visible,.btn.btn-yellow:active{border-color:var(--x-action-warning-hover)!important;background-color:var(--x-action-warning-hover)!important;color:var(--x-action-warning-text)!important}
.btn.btn-info,.btn.btn-blue{border-color:var(--x-action-info)!important;background-color:var(--x-action-info)!important;color:var(--x-action-info-text)!important}
.btn.btn-info:hover,.btn.btn-info:focus-visible,.btn.btn-info:active,.btn.btn-blue:hover,.btn.btn-blue:focus-visible,.btn.btn-blue:active{border-color:var(--x-action-info-hover)!important;background-color:var(--x-action-info-hover)!important;color:var(--x-action-info-text)!important}
.btn.btn-secondary,.btn.btn-gray{border-color:var(--x-action-neutral)!important;background:var(--x-action-neutral)!important;background-color:var(--x-action-neutral)!important;color:var(--x-action-neutral-text)!important}
.btn.btn-secondary:hover,.btn.btn-secondary:focus,.btn.btn-secondary:focus-visible,.btn.btn-secondary:active,.btn.btn-secondary.active,.btn.btn-secondary.show,.btn.btn-gray:hover,.btn.btn-gray:focus,.btn.btn-gray:focus-visible,.btn.btn-gray:active,.btn.btn-gray.active,.btn.btn-gray.show{border-color:var(--x-action-neutral-hover)!important;background:var(--x-action-neutral-hover)!important;background-color:var(--x-action-neutral-hover)!important;color:var(--x-action-neutral-text)!important}
.btn.btn-dark,.btn.btn-black{border-color:var(--x-action-dark)!important;background-color:var(--x-action-dark)!important;color:var(--x-action-dark-text)!important}
.btn.btn-dark:hover,.btn.btn-dark:focus-visible,.btn.btn-dark:active,.btn.btn-black:hover,.btn.btn-black:focus-visible,.btn.btn-black:active{border-color:var(--x-action-dark-hover)!important;background-color:var(--x-action-dark-hover)!important;color:var(--x-action-dark-text)!important}

/*
 * Metronic utility colors on nested labels/icons must never survive a filled
 * button state. Otherwise the control can become blue-on-blue or green-on-
 * green after hover/focus. Keep the semantic color on the button as the one
 * source of truth and let its direct visual children inherit it.
 */
.btn.btn-primary>span,.btn.btn-primary>i,.btn.btn-success>span,.btn.btn-success>i,.btn.btn-green>span,.btn.btn-green>i,
.btn.btn-danger>span,.btn.btn-danger>i,.btn.btn-red>span,.btn.btn-red>i,.btn.btn-warning>span,.btn.btn-warning>i,
.btn.btn-yellow>span,.btn.btn-yellow>i,.btn.btn-info>span,.btn.btn-info>i,.btn.btn-blue>span,.btn.btn-blue>i,
.btn.btn-secondary>span,.btn.btn-secondary>i,.btn.btn-gray>span,.btn.btn-gray>i,.btn.btn-dark>span,.btn.btn-dark>i,
.btn.btn-black>span,.btn.btn-black>i{color:inherit!important}

.btn.btn-outline-primary{border-color:var(--x-action-primary)!important;background-color:transparent!important;color:color-mix(in srgb,var(--x-action-primary) 55%,#000)!important}
.btn.btn-outline-primary:hover,.btn.btn-outline-primary:focus-visible,.btn.btn-outline-primary:active{border-color:var(--x-action-primary-hover)!important;background-color:var(--x-action-primary-hover)!important;color:var(--x-action-primary-text)!important}
.btn.btn-outline-primary>span,.btn.btn-outline-primary>i{color:inherit!important}

/* Process actions are semantic: stale BPMN color metadata must not change their meaning. */
.process-action-buttons [data-type="Accept" i],.process-action-buttons [data-id="btn-sender" i]{border-color:var(--x-action-positive)!important;background-color:var(--x-action-positive)!important;color:var(--x-action-positive-text)!important}
.process-action-buttons [data-type="Accept" i]:hover,.process-action-buttons [data-type="Accept" i]:focus-visible,.process-action-buttons [data-type="Accept" i]:active,.process-action-buttons [data-id="btn-sender" i]:hover,.process-action-buttons [data-id="btn-sender" i]:focus-visible,.process-action-buttons [data-id="btn-sender" i]:active{border-color:var(--x-action-positive-hover)!important;background-color:var(--x-action-positive-hover)!important;color:var(--x-action-positive-text)!important}
.process-action-buttons [data-type="Reject" i],.process-action-buttons [data-type="Cancel" i],.process-action-buttons [data-id="Cancel" i]{border-color:var(--x-action-danger)!important;background-color:var(--x-action-danger)!important;color:var(--x-action-danger-text)!important}
.process-action-buttons [data-type="Reject" i]:hover,.process-action-buttons [data-type="Reject" i]:focus-visible,.process-action-buttons [data-type="Reject" i]:active,.process-action-buttons [data-type="Cancel" i]:hover,.process-action-buttons [data-type="Cancel" i]:focus-visible,.process-action-buttons [data-type="Cancel" i]:active,.process-action-buttons [data-id="Cancel" i]:hover,.process-action-buttons [data-id="Cancel" i]:focus-visible,.process-action-buttons [data-id="Cancel" i]:active{border-color:var(--x-action-danger-hover)!important;background-color:var(--x-action-danger-hover)!important;color:var(--x-action-danger-text)!important}
.process-action-buttons [data-type="Refer" i],.process-action-buttons [data-id="btn-info" i]{border-color:var(--x-action-info)!important;background-color:var(--x-action-info)!important;color:var(--x-action-info-text)!important}
.process-action-buttons [data-type="Refer" i]:hover,.process-action-buttons [data-type="Refer" i]:focus-visible,.process-action-buttons [data-type="Refer" i]:active,.process-action-buttons [data-id="btn-info" i]:hover,.process-action-buttons [data-id="btn-info" i]:focus-visible,.process-action-buttons [data-id="btn-info" i]:active{border-color:var(--x-action-info-hover)!important;background-color:var(--x-action-info-hover)!important;color:var(--x-action-info-text)!important}
.process-action-buttons [data-type="Draft" i],.process-action-buttons [data-id="Draft" i]{border-color:var(--x-action-neutral)!important;background-color:var(--x-action-neutral)!important;color:var(--x-action-neutral-text)!important}
.process-action-buttons [data-type="Draft" i]:hover,.process-action-buttons [data-type="Draft" i]:focus-visible,.process-action-buttons [data-type="Draft" i]:active,.process-action-buttons [data-id="Draft" i]:hover,.process-action-buttons [data-id="Draft" i]:focus-visible,.process-action-buttons [data-id="Draft" i]:active{border-color:var(--x-action-neutral-hover)!important;background-color:var(--x-action-neutral-hover)!important;color:var(--x-action-neutral-text)!important}
.process-action-buttons [data-id="btn-up" i]{border-color:var(--x-action-dark)!important;background-color:var(--x-action-dark)!important;color:var(--x-action-dark-text)!important}
.process-action-buttons [data-id="btn-up" i]:hover,.process-action-buttons [data-id="btn-up" i]:focus-visible,.process-action-buttons [data-id="btn-up" i]:active{border-color:var(--x-action-dark-hover)!important;background-color:var(--x-action-dark-hover)!important;color:var(--x-action-dark-text)!important}
.process-action-buttons [data-type="Return" i]{border-color:var(--x-action-warning)!important;background-color:var(--x-action-warning)!important;color:var(--x-action-warning-text)!important}
.process-action-buttons [data-type="Return" i]:hover,.process-action-buttons [data-type="Return" i]:focus-visible,.process-action-buttons [data-type="Return" i]:active{border-color:var(--x-action-warning-hover)!important;background-color:var(--x-action-warning-hover)!important;color:var(--x-action-warning-text)!important}
.process-action-buttons .btn>i,.process-action-buttons .btn>span{color:inherit!important}

.btn.btn-light-primary{border-color:color-mix(in srgb,var(--x-action-primary) 36%,var(--bs-border-color,#DBDFE9))!important;background-color:var(--x-action-primary-soft)!important;color:color-mix(in srgb,var(--x-action-primary) 55%,#000)!important}
.btn.btn-light-success{border-color:color-mix(in srgb,var(--x-action-positive) 38%,var(--bs-border-color,#DBDFE9))!important;background-color:var(--x-action-positive-soft)!important;color:var(--x-action-positive-hover)!important}
.btn.btn-light-danger{border-color:color-mix(in srgb,var(--x-action-danger) 38%,var(--bs-border-color,#DBDFE9))!important;background-color:var(--x-action-danger-soft)!important;color:var(--x-action-danger-hover)!important}
.btn.btn-light-warning{border-color:color-mix(in srgb,var(--x-action-warning) 42%,var(--bs-border-color,#DBDFE9))!important;background-color:var(--x-action-warning-soft)!important;color:#715000!important}
.btn.btn-light-info{border-color:color-mix(in srgb,var(--x-action-info) 38%,var(--bs-border-color,#DBDFE9))!important;background-color:var(--x-action-info-soft)!important;color:var(--x-action-info-hover)!important}
.btn.btn-light{border-color:var(--x-action-neutral)!important;background:var(--x-action-neutral)!important;background-color:var(--x-action-neutral)!important;color:var(--x-action-neutral-text)!important}
.btn.btn-light:hover,.btn.btn-light:focus,.btn.btn-light:focus-visible,.btn.btn-light:active,.btn.btn-light.active,.btn.btn-light.show,
.btn.btn-light[class*="btn-active-"]:hover,.btn.btn-light[class*="btn-active-"]:focus,.btn.btn-light[class*="btn-active-"]:focus-visible,.btn.btn-light[class*="btn-active-"]:active,.btn.btn-light[class*="btn-active-"].active,.btn.btn-light[class*="btn-active-"].show,
.show>.btn.btn-light{border-color:var(--x-action-neutral-hover)!important;background:var(--x-action-neutral-hover)!important;background-color:var(--x-action-neutral-hover)!important;color:var(--x-action-neutral-text)!important;filter:none!important}
.btn.btn-light-primary:hover,.btn.btn-light-primary:focus-visible,.btn.btn-light-primary:active,.btn.btn-light-primary.show,
.btn.btn-light-success:hover,.btn.btn-light-success:focus-visible,.btn.btn-light-success:active,.btn.btn-light-success.show,
.btn.btn-light-danger:hover,.btn.btn-light-danger:focus-visible,.btn.btn-light-danger:active,.btn.btn-light-danger.show,
.btn.btn-light-warning:hover,.btn.btn-light-warning:focus-visible,.btn.btn-light-warning:active,.btn.btn-light-warning.show,
.btn.btn-light-info:hover,.btn.btn-light-info:focus-visible,.btn.btn-light-info:active,.btn.btn-light-info.show{filter:saturate(1.08) brightness(.97)}
.btn.btn-light-primary>span,.btn.btn-light-primary>i,.btn.btn-light-success>span,.btn.btn-light-success>i,
.btn.btn-light-danger>span,.btn.btn-light-danger>i,.btn.btn-light-warning>span,.btn.btn-light-warning>i,
.btn.btn-light-info>span,.btn.btn-light-info>i,.btn.btn-light>span,.btn.btn-light>i,.btn.btn-secondary>span,.btn.btn-secondary>i,.btn.btn-gray>span,.btn.btn-gray>i{border-color:transparent!important;background:transparent!important;color:inherit!important}

/* Export actions keep their icon readable when Metronic promotes a light button to the theme color. */
.btn.x-export-button,
.btn.x-export-button:focus {
    border-color:color-mix(in srgb,var(--x-action-primary) 36%,var(--bs-border-color,#DBDFE9))!important;
    background-color:var(--x-action-primary-soft)!important;
    color:color-mix(in srgb,var(--x-action-primary) 72%,#000)!important;
    filter:none!important;
}
.btn.x-export-button:hover,
.btn.x-export-button:focus-visible,
.btn.x-export-button:active,
.btn.x-export-button.active,
.btn.x-export-button.show {
    border-color:var(--x-action-primary-hover)!important;
    background-color:var(--x-action-primary-hover)!important;
    color:var(--x-action-primary-text,#fff)!important;
    filter:none!important;
}
.btn.x-export-button>i,
.btn.x-export-button>span,
.btn.x-export-button:hover>i,
.btn.x-export-button:hover>span,
.btn.x-export-button:focus-visible>i,
.btn.x-export-button:focus-visible>span,
.btn.x-export-button:active>i,
.btn.x-export-button:active>span,
.btn.x-export-button.active>i,
.btn.x-export-button.active>span,
.btn.x-export-button.show>i,
.btn.x-export-button.show>span {
    border-color:transparent!important;
    background-color:transparent!important;
    color:inherit!important;
}

/* Keep the default report filter light while its menu is open. */
.btn.btn-light-primary.x-report-filter-button,
.btn.btn-light-primary.x-report-filter-button:hover,
.btn.btn-light-primary.x-report-filter-button:focus,
.btn.btn-light-primary.x-report-filter-button:focus-visible,
.btn.btn-light-primary.x-report-filter-button:active,
.btn.btn-light-primary.x-report-filter-button.active,
.btn.btn-light-primary.x-report-filter-button.show,
.show>.btn.btn-light-primary.x-report-filter-button {
    border-color:color-mix(in srgb,var(--x-action-primary) 28%,transparent)!important;
    background-color:var(--x-action-primary-soft)!important;
    color:color-mix(in srgb,var(--x-action-primary) 72%,#000)!important;
    filter:none!important;
}

/* An applied filter must remain visibly different from the unfiltered state. */
.btn.btn-light-primary.x-report-filter-button.filter-selected,
.btn.btn-light-primary.x-report-filter-button.filter-selected:hover,
.btn.btn-light-primary.x-report-filter-button.filter-selected:focus,
.btn.btn-light-primary.x-report-filter-button.filter-selected:focus-visible,
.btn.btn-light-primary.x-report-filter-button.filter-selected:active,
.btn.btn-light-primary.x-report-filter-button.filter-selected.show {
    border-color:var(--x-action-primary)!important;
    background-color:var(--x-action-primary)!important;
    color:var(--x-action-primary-text,#fff)!important;
    box-shadow:0 0 0 3px color-mix(in srgb,var(--x-action-primary) 18%,transparent)!important;
    filter:none!important;
}
.btn.btn-light-primary.x-report-filter-button>i,
.btn.btn-light-primary.x-report-filter-button>span,
.btn.btn-light-primary.x-report-filter-button.filter-selected>i,
.btn.btn-light-primary.x-report-filter-button.filter-selected>span {
    border-color:transparent!important;
    background-color:transparent!important;
    color:inherit!important;
}
.x-report-filter-button .x-report-filter-reset {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1.35rem;
    height:1.35rem;
    margin-inline-start:.2rem;
    border-radius:50%;
    cursor:pointer;
    line-height:1;
}
.x-report-filter-button .x-report-filter-reset:hover,
.x-report-filter-button .x-report-filter-reset:focus-visible {
    background-color:rgba(255,255,255,.2)!important;
    outline:1px solid currentColor;
}
.x-report-filter-button .x-report-filter-reset.d-none { display:none!important; }

.x-report-surface,
.x-report-surface>[id^="kt_content_container"],
.x-report-surface .card,
.x-report-surface .card-body {
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
}

.x-report-table-header,
.x-report-toolbar,
.x-report-toolbar-controls {
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
}

.x-report-surface {
    overflow-x:clip;
}

@media (max-width:991.98px) {
    .x-report-table-header {
        display:flex!important;
        flex-direction:column!important;
        align-items:stretch!important;
        gap:.65rem;
        padding:.75rem!important;
    }
    .x-report-table-header>.card-title,
    .x-report-table-header>.x-report-toolbar,
    .x-report-table-header .card-title>div {
        width:100%!important;
        max-width:none!important;
        margin:0!important;
    }
    .x-report-table-header [id^="search-input-table"] {
        width:100%!important;
        height:40px!important;
        min-height:40px!important;
    }
    .x-report-toolbar-controls {
        display:grid!important;
        grid-template-columns:40px minmax(0,1fr) auto auto;
        grid-template-areas:"export spacer filter add";
        align-items:center!important;
        gap:.5rem;
        width:100%;
    }
    .x-report-export-control {
        grid-area:export;
        width:40px;
        height:40px;
        margin:0!important;
    }
    .x-report-export-control>[data-kt-menu-trigger] {
        width:40px!important;
        height:40px!important;
    }
    .x-report-filter-button {
        grid-area:filter;
        min-height:40px;
        margin:0!important;
    }
    .x-report-toolbar-controls>[id^="href_add_button"] {
        grid-area:add;
        min-height:40px;
        margin:0!important;
    }
    .x-report-filter-panel.menu {
        width:min(320px, calc(100vw - 1.5rem))!important;
        max-width:calc(100vw - 1.5rem)!important;
        z-index:100!important;
        padding:0!important;
        overflow:hidden;
        border:1px solid var(--x-floating-surface-border)!important;
        border-radius:.75rem!important;
        background:var(--bs-body-bg, #fff)!important;
        box-shadow:var(--x-floating-surface-shadow)!important;
    }
    .x-report-filter-panel-header {
        padding:.75rem 1rem!important;
        border-bottom:1px solid var(--bs-border-color, #DBDFE9);
    }
    .x-report-filter-panel-header .fs-5 {
        font-size:1rem!important;
        line-height:1.5;
    }
    .x-report-filter-panel-separator {
        display:none;
    }
    .x-report-filter-fields {
        display:flex;
        flex-direction:column;
        gap:.65rem;
        padding:.8rem 1rem 1rem!important;
    }
    .x-report-filter-field {
        width:100%;
        margin:0!important;
    }
    .x-report-filter-field .form-label {
        display:none!important;
    }
    .x-report-filter-field>.form-select,
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection {
        min-height:42px!important;
        height:42px!important;
        border-color:var(--bs-border-color, #DBDFE9)!important;
        border-radius:.475rem!important;
    }
    .x-report-filter-panel-reset {
        order:999;
        width:100%;
        justify-content:flex-end!important;
        margin-top:.15rem;
        padding-top:.75rem;
        border-top:1px dashed var(--bs-border-color, #DBDFE9);
    }
    .x-report-filter-panel-reset .btn {
        min-height:36px;
        margin:0!important;
        padding:.35rem .85rem!important;
        border:1px solid color-mix(in srgb, var(--x-action-primary) 24%, var(--bs-border-color, #DBDFE9))!important;
        background:var(--x-action-primary-soft)!important;
        color:color-mix(in srgb, var(--x-action-primary) 72%, #000)!important;
        font-size:.8rem!important;
    }
}

@media (min-width:992px) {
    .x-report-table-header {
        flex-wrap:wrap!important;
        align-items:center!important;
        gap:.75rem;
    }
    .x-report-table-header>.card-title {
        flex:0 0 auto;
        margin:0!important;
    }
    .x-report-table-header>.x-report-toolbar {
        flex:1 1 auto;
        min-width:0;
    }
    .x-report-toolbar-controls {
        width:100%;
        min-width:0;
        flex-wrap:wrap;
        align-items:center!important;
        gap:.65rem;
    }
    .x-report-filter-button {
        display:none!important;
    }
    .x-report-export-control {
        order:2;
        margin-inline-start:auto!important;
        margin-inline-end:0!important;
    }
    .x-report-export-control>[data-kt-menu-trigger] {
        width:40px!important;
        height:40px!important;
    }
    .x-report-toolbar-controls>[id^="href_add_button"] {
        order:3;
        min-height:40px;
    }
    .x-report-filter-panel.menu {
        position:static!important;
        inset:auto!important;
        transform:none!important;
        display:block!important;
        flex:1 1 auto;
        order:0;
        width:auto!important;
        max-width:none!important;
        min-width:0!important;
        margin:0!important;
        padding:0!important;
        border:0!important;
        border-radius:0!important;
        background:transparent!important;
        box-shadow:none!important;
    }
    .x-report-filter-panel.menu.d-none {
        display:none!important;
    }
    .x-report-filter-panel-header,
    .x-report-filter-panel-separator,
    .x-report-filter-panel-reset {
        display:none!important;
    }
    .x-report-filter-fields {
        display:flex;
        align-items:center;
        justify-content:flex-start;
        min-width:0;
        max-width:100%;
        flex-wrap:wrap;
        gap:.65rem;
        padding:0!important;
    }
    .x-report-filter-field {
        flex:0 0 220px;
        min-width:0;
        width:220px;
        max-width:220px;
        margin:0!important;
    }
    .x-report-filter-field .form-label {
        display:none!important;
    }
    .x-report-filter-field .select2-container,
    .x-report-filter-field>.form-select {
        width:100%!important;
    }
    .x-report-filter-field>.form-select,
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection {
        min-height:40px!important;
        height:40px!important;
    }
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection__rendered {
        display:flex;
        align-items:center;
        flex-wrap:nowrap;
        width:100%;
        min-height:38px;
        overflow-x:auto;
        overflow-y:hidden;
        padding-inline-end:2rem!important;
        padding-block:0!important;
        scrollbar-width:none;
        white-space:nowrap;
    }
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection__rendered::-webkit-scrollbar {
        display:none;
    }
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection--multiple {
        position:relative;
        overflow:hidden;
    }
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__choice {
        flex:0 0 auto;
        max-width:135px;
    }
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__choice__display {
        display:block;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .x-report-filter-field .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__clear {
        position:absolute!important;
        z-index:2;
        top:50%!important;
        inset-inline-end:.55rem!important;
        margin:0!important;
        transform:translateY(-50%);
    }
    .x-report-table-header [id^="search-input-table"] {
        width:260px!important;
        height:40px!important;
        min-height:40px!important;
    }
}

@media (min-width:992px) {
    .aside-fixed .aside {
        z-index:110!important;
    }
}

/* The fixed Metronic header creates its own stacking context at 100.
   Keep it and the workspace switcher above report filter/select surfaces (z-index <= 110). */
.header-fixed #kt_header {
    z-index:115!important;
}
.menu-sub-dropdown.x-workspace-switcher-menu {
    z-index:120!important;
}

.btn:focus-visible{outline:3px solid var(--x-action-focus-ring)!important;outline-offset:2px;box-shadow:none!important}
.btn:disabled,.btn.disabled,fieldset:disabled .btn{border-color:var(--x-action-disabled-bg)!important;background-color:var(--x-action-disabled-bg)!important;color:var(--x-action-disabled-text)!important;opacity:.72}
.btn i,.btn i::before,.btn svg,.btn svg path{color:currentColor!important;fill:currentColor}

/* Shared badge contract: one size, spacing, border and semantic palette system-wide. */
.badge:not(.badge-dot) {
    display: inline-flex;
    min-height: 1.5rem;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .2rem .5rem;
    border: 1px solid color-mix(in srgb, var(--x-action-neutral) 24%, var(--bs-border-color, #DBDFE9));
    border-radius: .375rem;
    background-color: color-mix(in srgb, var(--x-action-neutral) 8%, var(--bs-body-bg, #FFFFFF)) !important;
    color: var(--x-action-neutral-hover) !important;
    font-size: .75rem !important;
    font-weight: 600;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
    box-shadow: none;
}

.badge:not(.badge-dot) i,
.badge:not(.badge-dot) i::before,
.badge:not(.badge-dot) svg,
.badge:not(.badge-dot) svg path {
    color: currentColor !important;
    fill: currentColor;
}

.badge.badge-primary,
.badge.badge-light-primary {
    border-color: color-mix(in srgb, var(--x-action-primary) 35%, var(--bs-border-color, #DBDFE9));
    background-color: var(--x-action-primary-soft) !important;
    color: color-mix(in srgb, var(--x-action-primary) 72%, #000000) !important;
}

.badge.badge-success,
.badge.badge-light-success {
    border-color: color-mix(in srgb, var(--x-action-positive) 35%, var(--bs-border-color, #DBDFE9));
    background-color: var(--x-action-positive-soft) !important;
    color: var(--x-action-positive-hover) !important;
}

.badge.badge-warning,
.badge.badge-light-warning {
    border-color: color-mix(in srgb, var(--x-action-warning) 42%, var(--bs-border-color, #DBDFE9));
    background-color: var(--x-action-warning-soft) !important;
    color: #715000 !important;
}

.badge.badge-danger,
.badge.badge-light-danger {
    border-color: color-mix(in srgb, var(--x-action-danger) 35%, var(--bs-border-color, #DBDFE9));
    background-color: var(--x-action-danger-soft) !important;
    color: var(--x-action-danger-hover) !important;
}

.badge.badge-info,
.badge.badge-light-info {
    border-color: color-mix(in srgb, var(--x-action-info) 35%, var(--bs-border-color, #DBDFE9));
    background-color: var(--x-action-info-soft) !important;
    color: var(--x-action-info-hover) !important;
}

.badge.badge-secondary,
.badge.badge-light,
.badge.badge-light-dark,
.badge.badge-dark {
    border-color: color-mix(in srgb, var(--x-action-neutral) 32%, var(--bs-border-color, #DBDFE9));
    background-color: color-mix(in srgb, var(--x-action-neutral) 10%, var(--bs-body-bg, #FFFFFF)) !important;
    color: var(--x-action-neutral-hover) !important;
}

/* Header counters remain compact without changing the appearance of content badges. */
.badge.position-absolute:not(.badge-dot) {
    min-width: 1.25rem;
    min-height: 1.25rem;
    padding: .1rem .3rem;
    border-radius: 999px;
    font-size: .6875rem !important;
    line-height: 1;
}

/* Shared navigation affordances for every user-selected color theme. */
.menu-sub-dropdown {
    border: 1px solid var(--bs-border-color, #DBDFE9);
    border: 1px solid color-mix(in srgb, var(--bs-border-color, #DBDFE9) 82%, transparent);
}

.menu-sub-dropdown .x-menu-accordion-toggle {
    min-height: 40px;
    border-radius: 0.475rem;
}

.menu-sub-dropdown .x-menu-accordion-toggle .menu-title {
    color: var(--bs-gray-800, #252F4A);
    font-size: 1.075rem;
    font-weight: 700;
    line-height: 1.6;
}

.x-menu-accordion-indicator {
    display: inline-grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    margin-inline-start: auto;
    place-items: center;
    border-radius: 7px;
    background: var(--bs-primary-light, #F1FAFF);
    color: var(--bs-link-color, var(--x-theme-primary));
}

.x-menu-accordion-indicator i {
    display: inline-block;
    color: currentColor !important;
    font-size: 1rem;
    transition: transform 180ms ease;
}

.x-menu-accordion.show > .x-menu-accordion-toggle .x-menu-accordion-indicator,
.x-menu-accordion.showing > .x-menu-accordion-toggle .x-menu-accordion-indicator {
    background: var(--bs-component-active-bg, var(--x-theme-primary));
    color: var(--bs-primary-inverse, #FFFFFF);
}

.x-menu-accordion.show > .x-menu-accordion-toggle .x-menu-accordion-indicator i,
.x-menu-accordion.showing > .x-menu-accordion-toggle .x-menu-accordion-indicator i {
    transform: rotate(180deg);
}

.aside .x-aside-footer-trigger {
    border: 1px solid rgba(255, 255, 255, .72) !important;
    background: rgba(255, 255, 255, .94) !important;
    color: var(--bs-aside-bg-color, #1e1e2d) !important;
}

.aside .x-aside-footer-trigger i {
    color: inherit !important;
}

.aside .x-aside-footer-trigger:hover,
.aside .x-aside-footer-trigger:focus-visible,
.aside .x-aside-footer-trigger.show {
    border-color: #FFFFFF !important;
    background: #FFFFFF !important;
    color: var(--bs-aside-bg-color-active, var(--bs-aside-bg-color, #1e1e2d)) !important;
}

.aside .x-aside-footer-trigger:hover i,
.aside .x-aside-footer-trigger:focus-visible i,
.aside .x-aside-footer-trigger.show i {
    color: inherit !important;
}

/*
 * Pistachio green
 *
 * Fresh pistachio surfaces are paired with a deeper leaf green for controls.
 * This keeps long sessions calm without sacrificing hierarchy or contrast.
 */
[data-bs-theme="light-pistachio"] {
    --x-action-primary: #3D8255;
    --x-action-primary-hover: #2C673F;
    --x-action-primary-text: #FFFFFF;

    /* Bootstrap light-theme foundation: custom selectors do not inherit it. */
    --bs-white: #FFFFFF;
    --bs-black: #000000;
    --bs-white-rgb: 255, 255, 255;
    --bs-black-rgb: 0, 0, 0;
    --bs-gray-100: #F9F9F9;
    --bs-gray-100-rgb: 249, 249, 249;
    --bs-gray-200: #F1F1F2;
    --bs-gray-200-rgb: 241, 241, 242;
    --bs-gray-300: #DBDFE9;
    --bs-gray-300-rgb: 219, 223, 233;
    --bs-gray-400: #B5B5C3;
    --bs-gray-400-rgb: 181, 181, 195;
    --bs-gray-500: #99A1B7;
    --bs-gray-500-rgb: 153, 161, 183;
    --bs-gray-600: #78829D;
    --bs-gray-600-rgb: 120, 130, 157;
    --bs-gray-700: #4B5675;
    --bs-gray-700-rgb: 75, 86, 117;
    --bs-gray-800: #252F4A;
    --bs-gray-800-rgb: 37, 47, 74;
    --bs-gray-900: #071437;
    --bs-gray-900-rgb: 7, 20, 55;

    --bs-body-color: #071437;
    --bs-body-color-rgb: 7, 20, 55;
    --bs-body-bg: #FFFFFF;
    --bs-body-bg-rgb: 255, 255, 255;
    --bs-emphasis-color: #000000;
    --bs-emphasis-color-rgb: 0, 0, 0;
    --bs-heading-color: #071437;
    --bs-secondary-color: rgba(7, 20, 55, 0.75);
    --bs-secondary-color-rgb: 7, 20, 55;
    --bs-secondary-bg: #F1F1F2;
    --bs-secondary-bg-rgb: 241, 241, 242;
    --bs-tertiary-color: rgba(7, 20, 55, 0.5);
    --bs-tertiary-color-rgb: 7, 20, 55;
    --bs-tertiary-bg: #F9F9F9;
    --bs-tertiary-bg-rgb: 249, 249, 249;
    --bs-border-color: #DBDFE9;
    --bs-border-color-translucent: rgba(7, 20, 55, 0.16);
    --bs-border-dashed-color: #DBDFE9;

    /* Keep semantic status colors independent from the selected palette. */
    --bs-secondary: #DBDFE9;
    --bs-success: #50CD89;
    --bs-info: #7239EA;
    --bs-warning: #FFC700;
    --bs-danger: #F1416C;
    --bs-dark: #071437;
    --bs-secondary-rgb: 219, 223, 233;
    --bs-success-rgb: 80, 205, 137;
    --bs-info-rgb: 114, 57, 234;
    --bs-warning-rgb: 255, 199, 0;
    --bs-danger-rgb: 241, 65, 108;
    --bs-dark-rgb: 7, 20, 55;
    --bs-success-active: #47BE7D;
    --bs-info-active: #5014D0;
    --bs-warning-active: #F1BC00;
    --bs-danger-active: #D9214E;
    --bs-success-light: #E8FFF3;
    --bs-info-light: #F8F5FF;
    --bs-warning-light: #FFF8DD;
    --bs-danger-light: #FFF5F8;
    --bs-success-inverse: #FFFFFF;
    --bs-info-inverse: #FFFFFF;
    --bs-warning-inverse: #FFFFFF;
    --bs-danger-inverse: #FFFFFF;
    --bs-text-success: #50CD89;
    --bs-text-info: #7239EA;
    --bs-text-warning: #FFC700;
    --bs-text-danger: #F1416C;

    --bs-primary: #3D8255;
    --bs-primary-rgb: 61, 130, 85;
    --bs-primary-active: #2C673F;
    --bs-primary-light: #EFF8E8;
    --bs-primary-inverse: #FFFFFF;
    --bs-text-primary: #3D8255;
    --bs-primary-text-emphasis: #255438;
    --bs-primary-bg-subtle: #E4F3DA;
    --bs-primary-border-subtle: #B8DDA5;

    --bs-link-color: #2F6B45;
    --bs-link-color-rgb: 47, 107, 69;
    --bs-link-hover-color: #255438;
    --bs-link-hover-color-rgb: 37, 84, 56;
    --bs-focus-ring-color: rgba(61, 130, 85, 0.3);

    --bs-component-active-color: #FFFFFF;
    --bs-component-active-bg: #3D8255;
    --bs-component-hover-color: #2F6B45;
    --bs-component-hover-bg: #F4FAF0;
    --bs-component-checked-color: #FFFFFF;
    --bs-component-checked-bg: #3D8255;

    /* Opaque menu and control surfaces. */
    --bs-input-bg: #FFFFFF;
    --bs-input-color: #4B5675;
    --bs-input-solid-color: #4B5675;
    --bs-input-solid-bg: #F9F9F9;
    --bs-input-solid-bg-focus: #F1F1F2;
    --bs-input-solid-placeholder-color: #99A1B7;
    --bs-dropdown-bg: #FFFFFF;
    --bs-drawer-bg-color: #FFFFFF;
    --bs-menu-dropdown-box-shadow: 0 12px 32px rgba(31, 54, 41, 0.16), 0 3px 10px rgba(31, 54, 41, 0.08);
    --bs-menu-dropdown-bg-color: #FFFFFF;
    --bs-menu-heading-color: #78829D;
    --bs-menu-link-bg-color-hover: #F4FAF0;
    --bs-menu-link-bg-color-show: #F4FAF0;
    --bs-menu-link-bg-color-here: #F4FAF0;
    --bs-menu-link-bg-color-active: #F4FAF0;
    --bs-symbol-label-color: #252F4A;
    --bs-symbol-label-bg: #F9F9F9;
    --bs-symbol-border-color: rgba(255, 255, 255, 0.5);
    --bs-scrollbar-color: #F1F1F2;
    --bs-scrollbar-hover-color: #DBDFE9;

    --bs-menu-link-color-hover: #2F6B45;
    --bs-menu-link-color-show: #2F6B45;
    --bs-menu-link-color-here: #2F6B45;
    --bs-menu-link-color-active: #2F6B45;

    --bs-aside-bg-color: #173D2B;
    --bs-aside-bg-color-active: #3D8255;
    --bs-aside-icon-color: #DFF0D5;
    --bs-aside-logo-bg-color: #102D20;
    --bs-page-bg: #F7F9F6;
    --bs-app-blank-bg: #FFFFFF;
    --bs-header-default-bg-color: #FFFFFF;
    --bs-header-fixed-bg-color: #FFFFFF;
    --bs-toolbar-bg-color: #FFFFFF;
    --bs-toolbar-border-top: 1px solid #F1F1F2;
    --bs-footer-bg-color: #FFFFFF;
}

/* Final neutral-action guard: page-level Metronic utilities may be emitted
 * after their base button class. Keep Back/Close controls visible in every
 * interaction state regardless of btn-active-* helpers. */
html body .btn.btn-light,
html body .btn.btn-secondary,
html body .btn.btn-gray {
    border-color: var(--x-action-neutral) !important;
    background: var(--x-action-neutral) !important;
    background-color: var(--x-action-neutral) !important;
    color: var(--x-action-neutral-text) !important;
}

html body .btn.btn-light:hover,
html body .btn.btn-light:focus,
html body .btn.btn-light:focus-visible,
html body .btn.btn-light:active,
html body .btn.btn-light.active,
html body .btn.btn-light.show,
html body .btn.btn-light[class*="btn-active-"]:hover,
html body .btn.btn-light[class*="btn-active-"]:focus,
html body .btn.btn-light[class*="btn-active-"]:focus-visible,
html body .btn.btn-light[class*="btn-active-"]:active,
html body .btn.btn-secondary:hover,
html body .btn.btn-secondary:focus,
html body .btn.btn-secondary:focus-visible,
html body .btn.btn-secondary:active,
html body .btn.btn-secondary.active,
html body .btn.btn-secondary.show,
html body .btn.btn-gray:hover,
html body .btn.btn-gray:focus,
html body .btn.btn-gray:focus-visible,
html body .btn.btn-gray:active,
html body .btn.btn-gray.active,
html body .btn.btn-gray.show,
html body .show > .btn.btn-light,
html body .show > .btn.btn-secondary,
html body .show > .btn.btn-gray {
    border-color: var(--x-action-neutral-hover) !important;
    background: var(--x-action-neutral-hover) !important;
    background-color: var(--x-action-neutral-hover) !important;
    color: var(--x-action-neutral-text) !important;
    filter: none !important;
}

html body .btn.btn-light > i,
html body .btn.btn-light > span,
html body .btn.btn-secondary > i,
html body .btn.btn-secondary > span,
html body .btn.btn-gray > i,
html body .btn.btn-gray > span {
    border-color: transparent !important;
    background: transparent !important;
    color: inherit !important;
}

/* Finance pages emit their page-level styles after this shared stylesheet.
 * Keep every neutral Back/Dashboard action stable even when a later Metronic
 * or finance utility attempts to restore a white hover background. */
html[data-bs-theme] body .finance-shell .btn.btn-light,
html[data-bs-theme] body .finance-shell .btn.btn-light:hover,
html[data-bs-theme] body .finance-shell .btn.btn-light:focus,
html[data-bs-theme] body .finance-shell .btn.btn-light:focus-visible,
html[data-bs-theme] body .finance-shell .btn.btn-light:active,
html[data-bs-theme] body .finance-shell .btn.btn-light.active,
html[data-bs-theme] body .finance-shell .btn.btn-light.show,
html[data-bs-theme] body .finance-shell .btn.btn-light[class*="btn-active-"]:hover,
html[data-bs-theme] body .finance-shell .btn.btn-light[class*="btn-active-"]:focus,
html[data-bs-theme] body .finance-shell .btn.btn-light[class*="btn-active-"]:active,
html[data-bs-theme] body .finance-shell .show > .btn.btn-light {
    border-color: var(--x-action-neutral-hover) !important;
    background: var(--x-action-neutral-hover) !important;
    background-color: var(--x-action-neutral-hover) !important;
    color: var(--x-action-neutral-text) !important;
    filter: none !important;
    opacity: 1 !important;
}

html[data-bs-theme] body .finance-shell .btn.btn-light:not(:hover):not(:focus):not(:active):not(.active):not(.show) {
    border-color: var(--x-action-neutral) !important;
    background: var(--x-action-neutral) !important;
    background-color: var(--x-action-neutral) !important;
}

html[data-bs-theme] body .finance-shell .btn.btn-light > i,
html[data-bs-theme] body .finance-shell .btn.btn-light > span {
    background: transparent !important;
    color: inherit !important;
}
