/* Dialog — alert / confirm overlay. */
.dialog-background {
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.45);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: dialog-fade-in 0.12s ease;
}
@keyframes dialog-fade-in { from { opacity: 0; } to { opacity: 1; } }

.dialog {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 24px 24px 18px;
    box-shadow: var(--sh-lg);
    width: 100%;
    max-width: 440px;
}
.dialog-title { margin: 0 0 8px; font-size: 16px; color: var(--c-ink); }
.dialog-message { margin: 0 0 20px; color: var(--text-mut); font-size: 14px; line-height: 1.5; }

.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-button {
    padding: 8px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.dialog-button:hover { background: var(--n-100); }
.dialog-button--primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-white); }
.dialog-button--primary:hover { background: var(--c-primary-1); border-color: var(--c-primary-1); }

/* Modal — bulk-action dialogs (e.g. the Viewers Excel import) that need more than the
   alert/confirm shape above. Mounted into the persistent #bodyModal container declared
   in menu.html; toggled via .show. Same "no third-party modal library, a few dozen
   lines" philosophy as the dialog above (12-dialog.md) — module code (viewers.js)
   only ever adds/removes the .show class and re-renders #bodyModal's content. */
#bodyModal.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.45);
    z-index: 90;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
#bodyModal.modal.show { display: flex; }

.modal-dialog {
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    width: 100%;
    max-width: 860px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; }
.modal-body   { padding: 20px 24px; overflow-y: auto; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}
.modal-close {
    background: transparent;
    border: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--text-mut);
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--c-ink); }
