/* Default platform modal chrome. Matches the organization table, with shorter controls. */

.modal {
    --wms-modal-ink: #1f2937;
    --wms-modal-muted: #5e6c84;
    --wms-modal-line: #dde2eb;
    --wms-modal-soft: #f4f6f8;
    --wms-modal-green: #1b7a48;
    --wms-modal-green-hover: #15663c;
    --wms-modal-slate: #5e6c84;
    --wms-modal-slate-hover: #4b5563;
    --wms-modal-focus: rgba(31, 122, 77, 0.16);
}

@media (min-width: 768px) {
    .modal .modal-dialog {
        max-width: 36rem;
        overflow: visible;
    }
}

.modal.show {
    overflow: visible;
}

.modal .modal-content {
    overflow: visible;
    border: 1px solid var(--wms-modal-line);
    border-radius: 0.85rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.modal .modal-header {
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid #eef1f4;
    border-radius: 0.85rem 0.85rem 0 0;
    background: #fff;
}

.modal .modal-title {
    margin: 0;
    color: var(--wms-modal-ink);
    font-size: 1.28rem;
    font-weight: 600;
    line-height: 1.25;
}

.modal .modal-body {
    padding: 1rem 1.1rem 0.35rem;
    overflow: visible;
    background: #fff;
}

.modal .modal-body fieldset {
    margin: 0;
    min-width: 0;
    overflow: visible;
}

.modal .modal-body fieldset + fieldset {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #eef1f4;
}

.modal .modal-body .bg-white {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0 !important;
    overflow: visible;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.modal .form-group {
    margin-bottom: 0;
    min-width: 0;
    overflow: visible;
}

.modal .form-label {
    margin-bottom: 0.35rem;
    color: var(--wms-modal-ink);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.modal .form-text {
    margin-top: 0.35rem;
    color: var(--wms-modal-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.modal .form-control,
.modal .ts-wrapper.form-control {
    width: 100%;
    min-height: 2.25rem;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.modal input.form-control,
.modal textarea.form-control,
.modal select.form-control:not(.tomselected),
.modal .ts-control {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.3rem 2rem 0.3rem 0.75rem;
    border: 1px solid var(--wms-modal-line);
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: none;
    color: var(--wms-modal-ink);
    font-size: 0.875rem;
    line-height: 1.35;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.modal textarea.form-control {
    display: block;
    min-height: 5rem;
    padding: 0.5rem 0.75rem;
    line-height: 1.45;
    resize: vertical;
}

.modal input.form-control {
    padding-right: 0.75rem;
}

.modal .input-icon input.form-control {
    padding-right: 2.5rem;
}

.modal .wms-password-field {
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
}

.modal .wms-password-field .input-icon {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.modal .wms-password-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    border: 1px solid var(--wms-modal-line);
    border-radius: 0.5rem;
    background: #fff;
    color: var(--wms-modal-muted);
    box-shadow: none;
    appearance: none;
    cursor: pointer;
}

.modal .wms-password-generate svg {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.modal .wms-password-generate:hover,
.modal .wms-password-generate:focus {
    border-color: var(--wms-modal-green);
    background: #e5f6ec;
    color: #146c43;
    outline: 0;
}

.modal input.form-control::placeholder,
.modal textarea.form-control::placeholder,
.modal .ts-control input::placeholder,
.modal .ts-control .item-placeholder {
    color: var(--wms-modal-muted);
    font-weight: 500;
    opacity: 1;
}

.modal input.form-control:hover,
.modal textarea.form-control:hover,
.modal .ts-wrapper:hover .ts-control {
    border-color: #b7c2d0;
    background: #fff;
}

.modal input.form-control:focus,
.modal textarea.form-control:focus,
.modal .ts-wrapper.focus .ts-control,
.modal .ts-wrapper.dropdown-active .ts-control {
    border-color: var(--wms-modal-green);
    background: #fff;
    box-shadow: 0 0 0 3px var(--wms-modal-focus);
    outline: 0;
}

.modal .ts-wrapper {
    position: relative;
    min-width: 0;
}

.modal .ts-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.8rem;
    z-index: 2;
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid #6b7788;
    border-bottom: 2px solid #6b7788;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.modal .ts-wrapper.dropdown-active::after {
    transform: translateY(-20%) rotate(225deg);
}

.modal .ts-wrapper .ts-control {
    flex-wrap: wrap;
    gap: 0.25rem;
    cursor: pointer;
}

.modal .ts-wrapper .ts-control > input {
    min-width: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.875rem;
}

.modal .ts-wrapper.multi:not(.has-items) .ts-control > input {
    flex: 1 1 auto;
    min-width: 8rem;
}

.modal .ts-wrapper.multi.has-items .ts-control > input::placeholder,
.modal .ts-wrapper.multi.has-items .item-placeholder {
    color: transparent;
    opacity: 0;
}

.modal .ts-wrapper.multi.has-items .item-placeholder {
    display: none;
}

.modal .ts-wrapper.multi .ts-control {
    padding: 0.28rem 2rem 0.28rem 0.45rem;
}

.modal .ts-wrapper.is-placeholder .ts-control,
.modal .ts-wrapper.multi:not(.has-items) .ts-control {
    background: var(--wms-modal-soft);
}

.modal .ts-wrapper.is-placeholder .ts-control,
.modal .ts-control .item[data-value=""] {
    color: var(--wms-modal-muted);
    font-weight: 500;
}

.modal .ts-control .item[data-value=""] {
    margin: 0;
    padding: 0;
    background: transparent;
}

.modal .ts-control .item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0.1rem 0.5rem;
    border: 0;
    border-radius: 999px;
    background: #e5f6ec;
    color: #146c43;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.modal .ts-control .item .remove {
    margin-left: 0.25rem;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.7;
}

.modal .ts-dropdown,
.wms-modal-select-dropdown {
    margin-top: 0.3rem;
    border: 1px solid var(--wms-modal-line);
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    z-index: 2000;
}

.modal .ts-dropdown .ts-dropdown-content,
.wms-modal-select-dropdown .ts-dropdown-content {
    max-height: min(18rem, calc(100vh - 6rem));
    overflow-y: auto;
}

.modal .ts-dropdown .option,
.modal .ts-dropdown .create,
.modal .ts-dropdown .no-results,
.wms-modal-select-dropdown .option,
.wms-modal-select-dropdown .create,
.wms-modal-select-dropdown .no-results {
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
}

.modal .ts-dropdown .option.active,
.modal .ts-dropdown .option.selected,
.wms-modal-select-dropdown .option.active,
.wms-modal-select-dropdown .option.selected {
    background: #e5f6ec;
    color: #146c43;
}

.modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid #eef1f4;
    border-radius: 0 0 0.85rem 0.85rem;
    background: var(--wms-modal-soft);
}

.modal .modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    height: 2rem;
    padding: 0 0.9rem;
    border: 0;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: none;
}

.modal .modal-footer .btn-link {
    --bs-btn-color: var(--wms-modal-slate);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--wms-modal-line);
    --bs-btn-hover-color: var(--wms-modal-ink);
    --bs-btn-hover-bg: #eef1f4;
    --bs-btn-hover-border-color: #c5ced8;
    background: #fff;
    border: 1px solid var(--wms-modal-line);
    color: var(--wms-modal-slate);
    text-decoration: none;
}

.modal .modal-footer .btn-link:hover,
.modal .modal-footer .btn-link:focus {
    background: #eef1f4;
    border-color: #c5ced8;
    color: var(--wms-modal-ink);
    text-decoration: none;
}

.modal .modal-footer .btn-default,
.modal .modal-footer .btn-default:hover,
.modal .modal-footer .btn-default:focus,
.modal .modal-footer .btn-default:active {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--wms-modal-green);
    --bs-btn-border-color: var(--wms-modal-green);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wms-modal-green-hover);
    --bs-btn-hover-border-color: var(--wms-modal-green-hover);
    background: var(--wms-modal-green) !important;
    background-color: var(--wms-modal-green) !important;
    border-color: var(--wms-modal-green) !important;
    box-shadow: none !important;
    color: #fff !important;
}

.modal .modal-footer .btn-default:hover,
.modal .modal-footer .btn-default:focus,
.modal .modal-footer .btn-default:active {
    --bs-btn-bg: var(--wms-modal-green-hover);
    --bs-btn-border-color: var(--wms-modal-green-hover);
    background: var(--wms-modal-green-hover) !important;
    background-color: var(--wms-modal-green-hover) !important;
    border-color: var(--wms-modal-green-hover) !important;
    color: #fff !important;
}

.form-group:has(.wms-employee-avatar) {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.form-group:has(.wms-employee-avatar) .form-text {
    max-width: 16rem;
}

.wms-employee-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.wms-employee-avatar__frame {
    position: relative;
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #f4f6f8 0%, #e8edf3 100%);
    box-shadow: inset 0 0 0 1px var(--wms-modal-line, #dde2eb);
}

.wms-employee-avatar__image {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
}

.wms-employee-avatar__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b97a8;
    pointer-events: none;
}

.wms-employee-avatar__placeholder svg {
    width: 2.4rem;
    height: 2.4rem;
}

.wms-employee-avatar__image:not(.none) ~ .wms-employee-avatar__placeholder {
    display: none;
}

.wms-employee-avatar__pick {
    position: absolute;
    inset: 0;
    margin: 0;
    border-radius: inherit;
    cursor: pointer;
}

.wms-employee-avatar__camera {
    position: absolute;
    right: 0.15rem;
    bottom: 0.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #1b7a48;
    color: #fff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.wms-employee-avatar__camera svg {
    width: 0.9rem;
    height: 0.9rem;
}

.wms-employee-avatar__pick:hover .wms-employee-avatar__camera,
.wms-employee-avatar__pick:focus-within .wms-employee-avatar__camera {
    background: #146c43;
}

.wms-employee-avatar__remove {
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #fff;
    color: #6b7788;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
    appearance: none;
    cursor: pointer;
}

.wms-employee-avatar__remove svg {
    width: 0.75rem;
    height: 0.75rem;
}

.wms-employee-avatar__remove:hover,
.wms-employee-avatar__remove:focus {
    background: #dc3545;
    color: #fff;
    outline: 0;
}

.wms-employee-avatar__caption {
    color: var(--wms-modal-ink, #1f2937);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}
