/*
   Neuthinking proportional select control.
   The native select remains in the form for submission and existing JavaScript logic;
   the visible control uses the same compact, capped menu treatment as Admin Users.
*/
.nt-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.nt-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

/* The wrapper mirrors the original select classes so existing width/grid rules still apply. */
.nt-select.form-select,
.nt-select.form-select.form-select-sm {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.nt-select__toggle {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem 2.25rem .45rem .75rem;
    border: 1px solid var(--vz-input-border-custom, var(--vz-border-color, #ced4da));
    border-radius: var(--vz-border-radius, .25rem);
    background: var(--vz-input-bg-custom, var(--vz-secondary-bg, #fff));
    color: var(--vz-body-color, #212529);
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    box-shadow: none;
}

.nt-select__toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    right: .78rem;
    width: .48rem;
    height: .48rem;
    margin-top: -.32rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: var(--vz-secondary-color, #878a99);
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform .16s ease, margin-top .16s ease;
}

.nt-select.is-open .nt-select__toggle::after {
    margin-top: -.08rem;
    transform: rotate(225deg);
}

.nt-select__toggle:hover:not(:disabled) {
    border-color: #b8c0cf;
}

.nt-select__toggle:focus-visible,
.nt-select.is-open .nt-select__toggle {
    border-color: #a0a8c4;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(64, 81, 137, .1);
}

.nt-select__toggle:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.nt-select__value {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nt-select__menu {
    position: absolute;
    z-index: 1085;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: min(440px, calc(100dvh - 8rem));
    overflow-x: hidden;
    overflow-y: auto;
    padding: .3rem;
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: .45rem;
    background: var(--vz-secondary-bg, #fff);
    box-shadow: 0 8px 20px rgba(30, 32, 37, .14);
    scrollbar-width: thin;
}

.nt-select.is-open .nt-select__menu,
.nt-select__menu.is-open {
    display: grid;
    gap: .12rem;
}

/* Fix942 - opened custom-select menus are portaled to the document body so table/card
   overflow rules cannot clip them or make the containing card grow. */
.nt-select__menu.is-portaled {
    position: fixed;
    right: auto;
    bottom: auto;
    z-index: 2140;
}

.nt-select__group-label {
    padding: .38rem .65rem .24rem;
    color: var(--vz-secondary-color, #878a99);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .035em;
    line-height: 1.25;
    text-transform: uppercase;
}

.nt-select__option {
    display: block;
    width: 100%;
    min-height: 32px;
    padding: .44rem .65rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: var(--vz-body-color, #212529);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
}

.nt-select__option:hover:not(:disabled),
.nt-select__option:focus-visible,
.nt-select__option.is-selected {
    background: rgba(64, 81, 137, .08);
    color: #405189;
    outline: 0;
}

.nt-select__option.is-selected {
    font-weight: 500;
}

.nt-select__option:disabled {
    color: var(--vz-secondary-color, #878a99);
    cursor: not-allowed;
    opacity: .58;
}

.nt-select.is-invalid .nt-select__toggle,
.was-validated .nt-select-native:invalid + .nt-select .nt-select__toggle {
    border-color: var(--vz-form-invalid-border-color, #f06548);
}

.nt-select.is-valid .nt-select__toggle,
.was-validated .nt-select-native:valid + .nt-select .nt-select__toggle {
    border-color: var(--vz-form-valid-border-color, #0ab39c);
}

.nt-select--sm .nt-select__toggle {
    min-height: 34px;
    padding-top: .34rem;
    padding-bottom: .34rem;
    font-size: .8rem;
}

.nt-select--sm .nt-select__option {
    min-height: 30px;
    padding-top: .38rem;
    padding-bottom: .38rem;
    font-size: .78rem;
}

@media (max-width: 767.98px) {
    .nt-select__menu {
        max-height: min(360px, calc(100dvh - 6rem));
    }
}

.nt-select.is-dropup .nt-select__menu {
    top: auto;
    bottom: calc(100% + 4px);
}
