/* InSightVision + Metronic 8 shared UI overrides */

:root,
[data-bs-theme=light] {
    --iv-purple: #7239EA;
    --iv-purple-dark: #5014D0;
    --iv-purple-soft: #E9DEFF;
    --iv-purple-deep: #3D1A6E;
    --bs-primary: var(--iv-purple);
    --bs-primary-rgb: 114, 57, 234;
    --bs-primary-text-emphasis: var(--iv-purple-dark);
    --bs-primary-bg-subtle: var(--iv-purple-soft);
    --bs-primary-border-subtle: #D8C3FF;
    --bs-info: #1B84FF;
    --bs-info-active: #056EE9;
    --bs-info-light: #E9F3FF;
    --bs-info-clarity: rgba(27, 132, 255, 0.2);
    --bs-info-inverse: #ffffff;
    --bs-info-rgb: 27, 132, 255;
    --bs-info-text-emphasis: #0b3566;
    --bs-info-bg-subtle: #d1e6ff;
    --bs-info-border-subtle: #a4ceff;
    --bs-link-color: var(--iv-purple);
    --bs-link-color-rgb: 114, 57, 234;
    --bs-link-hover-color: var(--iv-purple-dark);
    --bs-link-hover-color-rgb: 80, 20, 208;
    /* Always-dark header: a lifted deep-purple bar (#241046) in BOTH themes,
     * carrying the login screen's premium feel into the app. Decoupled from
     * --iv-purple-soft so it doesn't drag light-primary badges/chips with it.
     * The active/hover pills stay light lavender so the selected tab reads as a
     * bright chip on the dark bar (dark-purple text keeps it legible). */
    --iv-header-bg: #241046;
    --iv-menu-active-bg: #BE9CF2;
    --iv-menu-hover-bg: #D2BCF7;
    --bs-app-bg-color: var(--iv-header-bg);
    --bs-app-header-base-bg-color: var(--iv-header-bg);
    --bs-app-header-sticky-bg-color: var(--iv-header-bg);
    /* demo41 ships success as blue (#1B84FF); restore a conventional green */
    --bs-success: #50CD89;
    --bs-success-active: #47BE7D;
    --bs-success-light: #E8FFF3;
    --bs-success-clarity: rgba(80, 205, 137, 0.2);
    --bs-success-inverse: #ffffff;
    --bs-success-rgb: 80, 205, 137;
    --bs-success-bg-subtle: #d6f5e3;
    --bs-success-border-subtle: #aeebc8;
    --bs-success-text-emphasis: #1c8a4f;
}

/* Dark mode: keep the purple brand but swap the light lavender chrome for dark
 * surfaces. Neutral text/borders below use --bs-* tokens so they flip on their
 * own; only the brand-tinted surfaces need explicit dark values here. */
[data-bs-theme=dark] {
    --iv-purple-soft: rgba(114, 57, 234, 0.18);
    --iv-header-bg: #241046;  /* always-dark: same lifted purple as light mode */
    --iv-menu-active-bg: rgba(114, 57, 234, 0.28);
    --iv-menu-hover-bg: rgba(114, 57, 234, 0.16);
    --bs-primary-bg-subtle: rgba(114, 57, 234, 0.18);
    --bs-primary-border-subtle: rgba(114, 57, 234, 0.35);
    /* The light-mode info/success tints above are declared on :root, so without
     * these they leak into dark mode and make btn-light-info / btn-light-success
     * (and matching badges) render with bright light fills. Swap them for dark
     * translucent tints so the icon colour still reads. */
    --bs-info-light: rgba(27, 132, 255, 0.16);
    --bs-info-bg-subtle: rgba(27, 132, 255, 0.16);
    --bs-info-border-subtle: rgba(27, 132, 255, 0.35);
    --bs-info-text-emphasis: #6ea8ff;
    --bs-success-light: rgba(80, 205, 137, 0.16);
    --bs-success-bg-subtle: rgba(80, 205, 137, 0.16);
    --bs-success-border-subtle: rgba(80, 205, 137, 0.35);
    --bs-success-text-emphasis: #6ee0a0;
}

:root,
[data-bs-theme=light],
[data-bs-theme=dark] {
    --iv-table-head-bg: var(--bs-gray-100);
    --iv-table-head-color: var(--bs-gray-700);
    --iv-table-head-border: var(--bs-border-color);
}

.app-header {
    /* Solid lifted-purple bar in both themes (var flips to the same #241046). */
    background-color: var(--iv-header-bg);
    border-bottom: 0;
}

.app-wrapper {
    background-color: var(--bs-body-bg);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    margin-top: -1px;
    /* .app-page is a flex column but Metronic gives .app-wrapper no grow, so on a
     * short page the white panel stops at its content and the lavender page bg
     * (--bs-app-bg-color) shows below it. Grow to fill the column so the white
     * reaches the bottom; the rounded top corners still reveal lavender under the
     * header. */
    flex: 1 0 auto;
}

.app-header .menu .menu-item.here > .menu-link,
.app-header .menu .menu-link.active {
    color: var(--iv-purple-dark);
    background-color: var(--iv-menu-active-bg);
    box-shadow: none;
}

.app-header .menu .menu-link:hover {
    color: var(--iv-purple-dark);
    background-color: var(--iv-menu-hover-bg);
}

/* Always-dark header foreground (light theme only).
 * On the dark bar the resting top-level nav titles (gray-700) would vanish, so
 * lift them to light. Targeted at #kt_app_header_menu specifically — NOT
 * ".app-header .menu" — because the user account dropdown is also a .menu inside
 * the header, and whitening its .menu-title spans ("Mode", "Light"/"Dark"/
 * "System") would render them invisible on the white dropdown. Scoped to lg+ so
 * the mobile drawer (this same menu swapped onto a light background) keeps its
 * dark text, and to light theme because dark mode's gray-700 is already a light
 * grey. Hover/active links get a light lavender pill from the rules above, so
 * their title returns to dark purple for contrast on that pill. */
@media (min-width: 992px) {
    [data-bs-theme=light] #kt_app_header_menu > .menu-item > .menu-link .menu-title {
        color: rgba(255, 255, 255, 0.85);
    }

    [data-bs-theme=light] #kt_app_header_menu > .menu-item > .menu-link:hover .menu-title,
    [data-bs-theme=light] #kt_app_header_menu > .menu-item.here > .menu-link .menu-title,
    [data-bs-theme=light] #kt_app_header_menu > .menu-item > .menu-link.active .menu-title {
        color: var(--iv-purple-dark);
    }
}

/* The mobile menu toggle (hamburger) sits on the always-dark bar, so force its
 * glyph pure white in BOTH themes (ID + !important to beat the button's own
 * colour variable) — its default Metronic grey is invisible on #241046. A bare
 * white burger reads as a menu button on its own; only a faint press background
 * is added for tap feedback, so there's no permanent box beside the avatar. */
#kt_app_header_menu_toggle,
#kt_app_header_menu_toggle i {
    color: #ffffff !important;
}

#kt_app_header_menu_toggle:hover,
#kt_app_header_menu_toggle:active {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* Logo badge: the wordmark is a dark, multi-colour lockup, so sit it on a white
 * chip so it reads on the dark bar and keeps its red accent (both themes). */
.iv-logo-chip {
    background-color: #ffffff;
    padding: 5px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Active dropdown item (light theme): the saturated lavender pill washes out the
 * title, icon and — worst — the normally muted-grey description. Force all three
 * to dark purple so they read on the pill; size/weight still mark the
 * description as secondary. Light-only: in dark mode the active pill is a dark
 * translucent fill, where dark-purple text would be the wrong direction. */
[data-bs-theme=light] .app-header .menu .menu-sub .menu-link.active .menu-title,
[data-bs-theme=light] .app-header .menu .menu-sub .menu-link.active .menu-description,
[data-bs-theme=light] .app-header .menu .menu-sub .menu-link.active .menu-icon i {
    color: var(--iv-purple-dark) !important;
}

/* On dark the deep-purple text token is unreadable on the translucent purple
 * fills, so lift the active/hover/light-primary text to a light purple. */
[data-bs-theme=dark] .app-header .menu .menu-item.here > .menu-link,
[data-bs-theme=dark] .app-header .menu .menu-link.active,
[data-bs-theme=dark] .app-header .menu .menu-link:hover,
[data-bs-theme=dark] .btn.btn-light-primary,
[data-bs-theme=dark] .badge-light-primary {
    color: #B69CF5;
}

.page-heading,
.card.card-custom > .card-header .card-title .card-label,
.card.card-custom > .card-header .card-title h3 {
    color: var(--bs-gray-900);
}

.text-primary,
.text-hover-primary:hover {
    color: var(--iv-purple) !important;
}

.bg-primary {
    background-color: var(--iv-purple) !important;
}

.btn.btn-primary {
    color: #ffffff;
    background-color: var(--iv-purple);
    border-color: var(--iv-purple);
}

.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary.focus,
.btn.btn-primary:not(:disabled):not(.disabled):active,
.btn.btn-primary:not(:disabled):not(.disabled).active {
    color: #ffffff;
    background-color: var(--iv-purple-dark);
    border-color: var(--iv-purple-dark);
}

.btn.btn-primary:focus,
.btn.btn-primary.focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(114, 57, 234, 0.16);
}

.btn.btn-light-primary {
    color: var(--iv-purple-dark);
    background-color: var(--iv-purple-soft);
    border-color: transparent;
}

.btn.btn-light-primary:hover,
.btn.btn-light-primary:focus,
.btn.btn-light-primary.focus,
.btn-active-light-primary:hover,
.btn-active-light-primary:focus {
    color: var(--iv-purple-dark) !important;
    background-color: #EEE5FF !important;
    border-color: transparent !important;
}

[data-bs-theme=dark] .btn.btn-light-primary:hover,
[data-bs-theme=dark] .btn.btn-light-primary:focus,
[data-bs-theme=dark] .btn.btn-light-primary.focus,
[data-bs-theme=dark] .btn-active-light-primary:hover,
[data-bs-theme=dark] .btn-active-light-primary:focus {
    color: #C7B4F8 !important;
    background-color: rgba(114, 57, 234, 0.28) !important;
}

.btn.btn-outline-primary {
    color: var(--iv-purple);
    border-color: var(--iv-purple);
}

.btn.btn-outline-primary:hover,
.btn.btn-outline-primary:focus {
    color: #ffffff;
    background-color: var(--iv-purple);
    border-color: var(--iv-purple);
}

.badge-light-primary {
    color: var(--iv-purple-dark);
    background-color: var(--iv-purple-soft);
}

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

.btn.btn-default,
.btn.btn-light {
    color: var(--bs-gray-700);
}

.card.card-custom {
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.03);
}

.card.card-custom > .card-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--bs-border-color);
    gap: 1rem;
    min-height: 72px;
    padding: 1.5rem 2rem 1rem;
}

.card.card-custom > .card-body {
    padding: 2rem;
}

#kt_app_header_container.app-container,
#kt_app_toolbar_container.app-container,
#kt_app_content_container.app-container,
#kt_app_footer .app-container {
    padding-left: 2rem;
    padding-right: 2rem;
}

.form-inline {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.form-inline .fv-row {
    margin-bottom: 0 !important;
}

.form-inline .form-control,
.form-inline .form-select,
.form-inline .select2-container,
.form-inline .kv-dateinput {
    min-width: 170px;
}

.form-inline .form-check {
    margin-bottom: .35rem;
}

.fv-row > .form-label,
.form-group > .form-label {
    display: block;
}

.form:not(.form-inline) .fv-row > .select2-container {
    display: block;
    width: 100% !important;
}

.form:not(.form-inline) .fv-row > .kv-dateinput,
.form-group > .kv-dateinput {
    width: 100%;
}

.input-icon {
    position: relative;
}

.input-icon .fv-row {
    margin-bottom: 0 !important;
}

.input-icon.text,
.form-inline .input-icon {
    min-width: 220px;
}

.input-icon.text .form-control,
.input-icon.text .form-select {
    padding-left: 2.75rem;
}

.input-icon.text > span {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-gray-500);
    display: inline-flex;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.input-icon.input-xlarge.right > i,
.input-icon > i[id^="iconReveal"] {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-gray-500);
    cursor: pointer;
    z-index: 2;
}

.input-icon.input-xlarge.right .form-control,
.input-icon > .form-control.h-auto {
    padding-right: 2.75rem;
}

.table > thead.table-light > tr > *,
.table > thead.thead-light > tr > *,
.table > thead > tr.iv-table-head-row > * {
    background-color: var(--iv-table-head-bg) !important;
    border-bottom-color: var(--iv-table-head-border);
    color: var(--iv-table-head-color);
}

.table > thead.table-light a,
.table > thead.thead-light a,
.table > thead > tr.iv-table-head-row a {
    color: inherit;
}

table.dataTable > thead > tr > th,
table.dataTable > thead > tr > td {
    background-color: var(--iv-table-head-bg);
    border-bottom-color: var(--iv-table-head-border);
    color: var(--iv-table-head-color);
}

.grid-view .summary {
    color: var(--bs-gray-600);
}

.grid-view .table > :not(caption) > * > * {
    padding: 1rem 0.75rem;
}

.grid-view .table thead th {
    background-color: var(--iv-table-head-bg);
    border-bottom: 1px solid var(--iv-table-head-border);
    color: var(--iv-table-head-color);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.grid-view .table thead th a {
    color: inherit;
}

.grid-view .table tbody td {
    color: var(--bs-gray-700);
    vertical-align: middle;
}

.grid-view .table tbody td:last-child {
    white-space: nowrap;
}

.page-item.active .page-link {
    background-color: var(--iv-purple);
    border-color: var(--iv-purple);
    color: #ffffff;
}

.page-link {
    color: var(--bs-gray-700);
}

.page-link:hover {
    color: var(--iv-purple-dark);
}

.bootstrap-timepicker-widget i.fas.fa-chevron-down {
    vertical-align: bottom;
}

/* Kartik's bootstrap date/datetime picker CSS ships light-mode hover fills
 * (#eee). In dark mode those fills sit under light text, making hovered days
 * and time slots look washed out/unreadable. Keep neutral hover states on the
 * dark surface; active/today/disabled states retain their plugin colours. */
[data-bs-theme=dark] .datetimepicker table tr td.day:not(.active):not(.today):not(.disabled):hover,
[data-bs-theme=dark] .datetimepicker table tr td:not(.active):not(.today):not(.disabled).focused,
[data-bs-theme=dark] .datetimepicker table tr td span:not(.active):not(.disabled):hover,
[data-bs-theme=dark] .datetimepicker table tr td span:not(.active):not(.disabled).focused,
[data-bs-theme=dark] .datetimepicker thead tr:first-child th:hover,
[data-bs-theme=dark] .datetimepicker tfoot th:hover,
[data-bs-theme=dark] .datetimepicker .datetimepicker-switch:hover,
[data-bs-theme=dark] .datetimepicker .prev:hover,
[data-bs-theme=dark] .datetimepicker .next:hover,
[data-bs-theme=dark] .datepicker table tr td.day:not(.active):not(.today):not(.disabled):hover,
[data-bs-theme=dark] .datepicker table tr td:not(.active):not(.today):not(.disabled).focused,
[data-bs-theme=dark] .datepicker table tr td span:not(.active):not(.disabled):hover,
[data-bs-theme=dark] .datepicker table tr td span:not(.active):not(.disabled).focused,
[data-bs-theme=dark] .datepicker .datepicker-switch:hover,
[data-bs-theme=dark] .datepicker .prev:hover,
[data-bs-theme=dark] .datepicker .next:hover,
[data-bs-theme=dark] .datepicker tfoot tr th:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--bs-gray-900);
}

[data-sort]::after,
table.dataTable thead > tr > th span.dt-column-order,
table.dataTable thead > tr > td span.dt-column-order {
    font-family: 'Font Awesome 5 Free';
}

a.asc::after {
    content: "\f077";
    margin-left: 5px;
}

a.desc::after {
    content: "\f078";
    margin-left: 5px;
}

table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order::before,
table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order::before {
    content: "\f077";
}

table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order::after,
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order::after {
    content: "\f078";
}

table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order::before,
table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order::after,
table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order::before,
table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order::after,
table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order::before,
table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order::after,
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order::before,
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order::after {
    opacity: 0.2;
    font-size: 1rem;
    font-weight: 600;
}

table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order::before {
    opacity: 1;
}

table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order::after,
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order::before,
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order::before {
    display: none;
    opacity: 0;
}

table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order::after,
table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order::after {
    opacity: 1;
}

.badge-unassigned {
    color: var(--bs-gray-700);
    background-color: var(--bs-gray-200);
}

.badge-assigned {
    color: var(--bs-warning-text-emphasis);
    background-color: var(--bs-warning-bg-subtle);
}

.badge-checked-in {
    color: var(--bs-success-text-emphasis);
    background-color: var(--bs-success-bg-subtle);
}

.badge-checked-out {
    color: var(--bs-danger-text-emphasis);
    background-color: var(--bs-danger-bg-subtle);
}


.user-photo-standard {
    width: 150px !important;
    height: 150px !important;
    border-radius: 8% !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    object-fit: cover !important;
}

.user-photo-standard.symbol-label,
.user-photo-standard.image-input-wrapper {
    width: 150px !important;
    height: 150px !important;
}

.scrolltop {
    background-color: var(--iv-purple) !important;
}

/* Compatibility utilities still used by older views. */
.font-weight-bold { font-weight: 600 !important; }
.font-weight-bolder,
.font-weight-boldest { font-weight: 700 !important; }
.font-size-sm { font-size: 0.925rem !important; }
.font-size-lg { font-size: 1.075rem !important; }
.font-size-h7 { font-size: 0.95rem !important; }
.font-size-h6 { font-size: 1.075rem !important; }
.font-size-h5 { font-size: 1.15rem !important; }
.font-size-h4 { font-size: 1.25rem !important; }
.font-size-h2 { font-size: 1.5rem !important; }
.font-size-h1-lg { font-size: 1.75rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 0.75rem !important; }
.mr-4 { margin-right: 1rem !important; }
.mr-5 { margin-right: 1.25rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 0.75rem !important; }
.ml-4 { margin-left: 1rem !important; }
.ml-5 { margin-left: 1.25rem !important; }
.pl-4 { padding-left: 1rem !important; }
.pr-3 { padding-right: 0.75rem !important; }
.pr-5 { padding-right: 1.25rem !important; }
.text-right { text-align: right !important; }
.rounded-lg { border-radius: 0.65rem !important; }
.h-auto { height: auto !important; }
.max-h-45px { max-height: 45px !important; }
.max-w-150px { max-width: 150px !important; }
.text-dark-75 { color: var(--bs-gray-700) !important; }

/* ----------------------------------------------------------------------------
 * Kartik Select2 (krajee-bs5 theme) -> Metronic .form-select look-alike.
 *
 * The app runs bsVersion 5.x, so Kartik renders the `krajee-bs5` markup. Its
 * stock theme uses a 0.25rem radius, ~38px height, an inset shadow and a blue
 * focus/open glow that clash with Metronic form controls (0.75rem radius,
 * ~44px height, gray-300 border). These rules make every Select2 widget match a
 * native Metronic .form-select so dropdowns are consistent across all pages.
 * ------------------------------------------------------------------------- */
.select2-container--krajee-bs5 .select2-selection {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-gray-300) !important;
    border-radius: 0.75rem !important;
    box-shadow: none !important;
    color: var(--bs-gray-700);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--krajee-bs5 .select2-selection--single {
    display: flex !important;
    align-items: center;
    height: calc(1.5em + 1.55rem + 2px) !important;
    padding: 0.775rem 3rem 0.775rem 1rem !important;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2378829D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

.select2-container--krajee-bs5.select2-container--open .select2-selection--single {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2378829D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

.select2-container--krajee-bs5 .select2-selection--single .select2-selection__rendered {
    padding: 0;
    color: var(--bs-gray-700);
}

.select2-container--krajee-bs5 .select2-selection__placeholder {
    color: var(--bs-gray-500);
}

/* Focus / open state: gray-400 border + the app's purple focus ring (matches
 * .form-control / .form-select:focus above), never Krajee's blue glow. */
.select2-container--krajee-bs5.select2-container--open:not(.select2-container--disabled) .select2-selection,
.select2-container--krajee-bs5.select2-container--focus:not(.select2-container--disabled) .select2-selection,
.select2-container--krajee-bs5:not(.select2-container--disabled) .select2-selection:focus {
    border-color: var(--bs-gray-400) !important;
    box-shadow: 0 0 0 0.2rem rgba(114, 57, 234, 0.16) !important;
}

/* Keep the rounded box on open; Krajee squares off the bottom to merge with the
 * dropdown, but our dropdown floats with its own shadow. */
.select2-container--krajee-bs5.select2-container--open.select2-container--below .select2-selection,
.select2-container--krajee-bs5.select2-container--open.select2-container--above .select2-selection {
    border-radius: 0.75rem !important;
    border-color: var(--bs-gray-400) !important;
}

.select2-container--krajee-bs5.select2-container--disabled .select2-selection {
    background-color: var(--bs-gray-100);
    border-color: var(--bs-gray-300) !important;
}

/* Multiple selection */
.select2-container--krajee-bs5 .select2-selection--multiple {
    min-height: calc(1.5em + 1.55rem + 2px);
    padding: 0.3rem 0.5rem;
}

.select2-container--krajee-bs5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bs-gray-200);
    border: 0;
    border-radius: 0.475rem;
    color: var(--bs-gray-700);
    font-size: 1rem;
    font-weight: 500;
    margin: 0.2rem 0.35rem 0 0;
    padding: 0.15rem 0.5rem;
}

/* Dropdown panel + results */
.select2-container--krajee-bs5 .select2-dropdown {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-gray-200) !important;
    border-radius: 0.75rem !important;
    box-shadow: var(--bs-dropdown-box-shadow) !important;
    overflow: hidden;
    margin-top: 0.25rem;
    padding: 0.5rem 0;
}

.select2-container--krajee-bs5 .select2-results__option {
    padding: 0.65rem 1.25rem;
    color: var(--bs-gray-700);
}

.select2-container--krajee-bs5 .select2-results__option--highlighted,
.select2-container--krajee-bs5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--bs-gray-100) !important;
    color: var(--bs-gray-800) !important;
}

.select2-container--krajee-bs5 .select2-results__option.select2-results__option--selected,
.select2-container--krajee-bs5 .select2-results__option[aria-selected=true] {
    background-color: var(--iv-purple) !important;
    color: #ffffff !important;
}

.select2-container--krajee-bs5 .select2-search--dropdown .select2-search__field {
    background-image: none;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.475rem;
    box-shadow: none;
    padding: 0.55rem 0.75rem;
    color: var(--bs-gray-700);
}

@media (max-width: 991.98px) {
    #kt_app_header_container.app-container,
    #kt_app_toolbar_container.app-container,
    #kt_app_content_container.app-container,
    #kt_app_footer .app-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .card.card-custom > .card-header,
    .card.card-custom > .card-body {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .form-inline {
        gap: .75rem;
    }

    .form-inline .form-control,
    .form-inline .form-select,
    .form-inline .select2-container,
    .form-inline .kv-dateinput,
    .input-icon.text {
        min-width: 100%;
        width: 100%;
    }
}

/* Department row staged for soft-delete in the company form: dim the editable
 * cells and strike the name so it reads as "will be removed on save", while the
 * trash/restore toggle stays fully visible so the user can undo before saving. */
.department-row-pending-delete .department-name-input,
.department-row-pending-delete .form-check {
    opacity: 0.55;
}

.department-row-pending-delete .department-name-input {
    text-decoration: line-through;
}
