[data-ajax-page] {
    transition: opacity 160ms ease;
}

[data-ajax-page].ajax-crud-loading {
    opacity: .58;
    pointer-events: none;
}

.ajax-crud-button--busy {
    cursor: wait !important;
    opacity: .65;
}

.crud-dialog {
    position: fixed;
    inset: 0;
    width: min(34rem, calc(100% - 2rem));
    max-height: min(85vh, 48rem);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--glass-border, #e2e8f0);
    border-radius: var(--radius-md, .9rem);
    background: var(--bg-elevated, #fff);
    color: var(--text-primary, #0f172a);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
}

.crud-dialog::backdrop {
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
}

.crud-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border, #e2e8f0);
}

.crud-dialog__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.crud-dialog__close {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
}

.crud-dialog__close:hover {
    background: rgba(148, 163, 184, .15);
}

.crud-dialog__body {
    max-height: calc(85vh - 4.1rem);
    padding: 1.25rem;
    overflow-y: auto;
}

.ajax-crud-dialog-loading {
    margin: 1rem 0;
    color: var(--text-secondary, #64748b);
    text-align: center;
    font-size: .875rem;
}

.dark .crud-dialog {
    border-color: #334155;
    background: #0f172a;
    color: #f8fafc;
}

.dark .crud-dialog__header {
    border-color: #334155;
}

.ajax-crud-notices {
    position: fixed;
    z-index: 10000;
    inset-block-start: 1rem;
    inset-inline-start: 1rem;
    display: grid;
    width: min(24rem, calc(100% - 2rem));
    gap: .5rem;
}

.ajax-crud-notice {
    padding: .8rem 1rem;
    border: 1px solid;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .22);
    font-size: .875rem;
}

.ajax-crud-notice--error {
    border-color: #fecaca;
    color: #b91c1c;
}
