/* ══════════════════════════════════════════════
   MODALS — overlay, caja, cabecera, cuerpo, footer
══════════════════════════════════════════════ */
.modal-bg {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadein 0.15s ease;
    backdrop-filter: blur(4px);
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    width: 520px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slidein 0.18s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    font-weight: 600;
    font-size: 1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--ink-3);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}