/* Scoped Bootstrap-style modal — only .stage-reason-bs-modal* so Filament UI stays intact */

.stage-reason-bs-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.stage-reason-bs-modal.is-open {
    display: block;
}

.stage-reason-bs-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background-color: rgba(0, 0, 0, 0.5);
}

.stage-reason-bs-modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 32rem;
    pointer-events: none;
    /* Center vertically on short content */
    min-height: calc(100% - 3.5rem);
    display: flex;
    align-items: center;
}

.stage-reason-bs-modal--wide .stage-reason-bs-modal-dialog {
    max-width: 48rem;
}

.stage-reason-bs-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    outline: 0;
}

.stage-reason-bs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.stage-reason-bs-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.stage-reason-bs-modal-close {
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 0.375rem;
}

.stage-reason-bs-modal-close:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.stage-reason-bs-modal-body {
    padding: 1rem 1.25rem;
}

.stage-reason-bs-modal-stage {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.stage-reason-bs-modal-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.stage-reason-bs-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.stage-reason-bs-modal-btn {
    appearance: none;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
}

.stage-reason-bs-modal-btn:hover {
    background: #f9fafb;
}

.stage-reason-bs-modal-footer-actions {
    gap: 0.5rem;
}

.stage-reason-bs-modal-footer-actions--start {
    justify-content: flex-start;
}

.stage-reason-bs-modal-btn-primary {
    border-color: #d97706;
    background: #d97706;
    color: #fff;
}

.stage-reason-bs-modal-btn-primary:hover {
    background: #b45309;
    border-color: #b45309;
}

.stage-reason-bs-modal-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.stage-reason-bs-modal-btn-success {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.stage-reason-bs-modal-btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.stage-reason-bs-modal-btn-success:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.stage-reason-bs-modal-description {
    margin: 0.4rem 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    font-weight: 400;
    color: #6b7280;
}

.stage-reason-bs-modal-field-help {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #6b7280;
}

.stage-reason-bs-modal-required {
    color: #dc2626;
    font-weight: 700;
}

.stage-reason-bs-modal-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 7.5rem;
    border: 1px dashed #d1d5db;
    border-radius: 0.75rem;
    background: #f9fafb;
    padding: 1.25rem;
    overflow: hidden;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.stage-reason-bs-modal-dropzone-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.stage-reason-bs-modal-dropzone.is-dragover {
    border-color: #16a34a;
    background: #f0fdf4;
}

.stage-reason-bs-modal-dropzone-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #6b7280;
    font-size: 0.875rem;
    pointer-events: none;
}

.stage-reason-bs-modal-dropzone-browse {
    color: #16a34a;
    font-size: 0.875rem;
    font-weight: 700;
}

.stage-reason-bs-modal-dropzone-file {
    position: relative;
    z-index: 1;
    margin-top: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
    text-align: center;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.stage-reason-bs-modal-label {
    display: block;
    margin: 0.85rem 0 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.stage-reason-bs-modal-optional {
    font-weight: 400;
    color: #6b7280;
}

.stage-reason-bs-modal-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #111827;
    resize: vertical;
    min-height: 4.5rem;
}

.stage-reason-bs-modal-select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #111827;
    background-color: #fff;
}

.stage-reason-bs-modal-select:focus,
.stage-reason-bs-modal-textarea:focus {
    outline: 2px solid rgba(217, 119, 6, 0.35);
    border-color: #d97706;
}

.stage-reason-bs-modal-error {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #b91c1c;
}

.stage-reason-bs-modal-help {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #4b5563;
}

.stage-reason-bs-modal-loading {
    margin: 0.75rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.stage-reason-bs-modal-input,
.stage-reason-bs-modal-file {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #111827;
    background: #fff;
}

.stage-reason-bs-modal-input[readonly] {
    background: #f9fafb;
    color: #374151;
}

.stage-reason-bs-modal-textarea--tall {
    min-height: 14rem;
}

.stage-reason-bs-modal-cc-box {
    display: flex;
    min-height: 2.5rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.35rem 0.5rem;
}

.stage-reason-bs-modal-cc-chip {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.375rem;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
}

.stage-reason-bs-modal-cc-chip-remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.stage-reason-bs-modal-cc-input {
    min-width: 12rem;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.875rem;
    padding: 0.25rem;
}

.stage-reason-bs-modal-cc-dropdown {
    position: absolute;
    z-index: 10100;
    margin-top: 0.25rem;
    width: 100%;
    max-height: 16rem;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.stage-reason-bs-modal-cc-dropdown-empty,
.stage-reason-bs-modal-cc-dropdown-item,
.stage-reason-bs-modal-cc-dropdown-add {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    color: #111827;
}

.stage-reason-bs-modal-cc-dropdown-item:hover,
.stage-reason-bs-modal-cc-dropdown-add:hover {
    background: #f9fafb;
}

.stage-reason-bs-modal-cc-dropdown-add {
    border-top: 1px solid #e5e7eb;
    color: #c2410c;
}

body.stage-reason-bs-modal-open {
    overflow: hidden;
}

.stage-reason-bs-processing {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.35);
}

.stage-reason-bs-processing.is-visible {
    display: flex;
}

.stage-reason-bs-processing-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 14rem;
    max-width: 22rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 0.95rem 1.15rem;
}

.stage-reason-bs-processing-spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #e5e7eb;
    border-top-color: #d97706;
    border-radius: 9999px;
    animation: stage-reason-bs-spin 0.7s linear infinite;
}

.stage-reason-bs-processing-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

body.stage-reason-bs-processing-open {
    overflow: hidden;
}

@keyframes stage-reason-bs-spin {
    to {
        transform: rotate(360deg);
    }
}
