/* Enhanced modal z-index and interaction fixes */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1060 !important;
    position: relative;
    margin: 1.75rem auto;
    pointer-events: none;
}

.modal-content {
    position: relative;
    background: white;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
    pointer-events: auto;
}

/* Ensure all interactive elements work properly */
.modal-header,
.modal-body,
.modal-footer {
    pointer-events: auto;
}

.modal-header .btn-close,
.modal-footer .btn {
    pointer-events: auto;
    cursor: pointer;
}

/* Form elements in modals */
.modal input,
.modal textarea,
.modal select,
.modal button {
    pointer-events: auto;
    cursor: default;
}

.modal button {
    cursor: pointer;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Ensure proper modal display */
.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.show {
    display: block;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Corporate theme for modal headers */
.modal-header.gradient-primary {
    background: var(--primary-gradient);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header.gradient-danger {
    background: var(--danger-gradient);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}