/* ESSV2 dialog */
body.ess-dialog-open {
    overflow: hidden;
}

.ess-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.58);
}

.ess-dialog-overlay.show {
    display: flex;
}

.ess-dialog {
    width: min(var(--ess-dialog-width, 560px), calc(100vw - 2rem));
    max-height: min(var(--ess-dialog-max-height, 720px), calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.ess-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.ess-dialog-title {
    margin: 0;
    color: #111827;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.35;
}

.ess-dialog-subtitle {
    margin: 0.25rem 0 0;
    color: #6b7280;
    font-size: 0.88rem;
    line-height: 1.35;
}

.ess-dialog-close {
    flex: 0 0 auto;
}

.ess-dialog-body {
    padding: 1.25rem;
    overflow: auto;
    color: #1f2937;
}

.ess-dialog-body table {
    max-width: 100%;
}

.ess-dialog-body input,
.ess-dialog-body select,
.ess-dialog-body textarea {
    max-width: 100%;
}

.ess-dialog-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ess-dialog-footer:empty {
    display: none;
}

.ess-dialog-button {
    min-width: 5.75rem;
}

@media (max-width: 575.98px) {
    .ess-dialog-overlay {
        align-items: stretch;
        padding: 0.75rem;
    }

    .ess-dialog {
        width: 100%;
        max-height: calc(100vh - 1.5rem);
    }

    .ess-dialog-footer {
        flex-direction: column-reverse;
    }

    .ess-dialog-button {
        width: 100%;
    }
}
