/* ========================================================
   Modal - overlay + dialog + form layout
   ======================================================== */

/* --- Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

/* --- Dialog --- */
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: modal-in 150ms ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Header --- */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    font-size: 1.4rem;
}

/* --- Form --- */
.modal-form {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 14px;
    overflow-y: auto;
}

.modal-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --- Actions row --- */
.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.modal-actions-right {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
