/* Reusable compact detail modal (badge + title + description + form + footer) */

.detail-modal {
    max-width: 40rem;
    display: flex;
    flex-direction: column;
}

.detail-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.detail-modal__intro {
    flex: 1;
    min-width: 0;
}

.detail-modal__title {
    margin: 0.75rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.dark .detail-modal__title {
    color: #f9fafb;
}

.detail-modal__description {
    margin: 0.625rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #6b7280;
}

.dark .detail-modal__description {
    color: #9ca3af;
}

.detail-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 0.375rem;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    background: transparent;
    cursor: pointer;
}

.detail-modal__close:hover {
    color: #111827;
    background: #f3f4f6;
}

.dark .detail-modal__close:hover {
    color: #f9fafb;
    background: #374151;
}

.detail-modal__divider {
    margin: 1.25rem 0;
    border-top: 1px solid #e5e7eb;
}

.dark .detail-modal__divider {
    border-top-color: #374151;
}

.detail-modal__body {
    margin-top: 0;
}

.detail-modal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.dark .detail-modal__footer {
    border-top-color: #374151;
}

/* Filament action modal variant */
.fi-detail-modal .fi-modal-header {
    display: none;
}

.fi-detail-modal.fi-modal-window {
    max-width: 40rem;
}

.fi-detail-modal .fi-modal-content {
    padding-top: 1.5rem;
}

.fi-detail-modal .fi-modal-footer {
    margin-top: 0;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.dark .fi-detail-modal .fi-modal-footer {
    border-top-color: #374151;
}

.detail-modal__error {
    margin-top: 0.25rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #b91c1c;
}

.dark .detail-modal__error {
    border-color: #991b1b;
    background: rgb(127 29 29 / 0.25);
    color: #fca5a5;
}

@media (max-width: 767px) {
    .detail-modal__footer {
        flex-direction: column;
    }

    .detail-modal__footer .fi-btn {
        width: 100%;
    }

    .fi-detail-modal .fi-modal-footer {
        flex-direction: column;
    }

    .fi-detail-modal .fi-modal-footer .fi-btn {
        width: 100%;
    }
}
