/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-overlay.hidden { display: none; }

.modal-dialog {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
}
.modal-close:hover { color: var(--accent); }

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* ===== PROGRESS OVERLAY ===== */
.progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.progress-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-width: 340px;
    text-align: center;
}

.progress-box h3 { margin-bottom: 1rem; font-size: 1rem; }

.progress-bar-wrap {
    background: var(--bg-input);
    border-radius: var(--radius);
    height: 8px;
    overflow: hidden;
    margin-bottom: .75rem;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width .2s;
    border-radius: var(--radius);
}

#progress-text { font-size: .85rem; color: var(--text-muted); }

.progress-errors {
    margin-top: .75rem;
    text-align: left;
    max-height: 120px;
    overflow-y: auto;
}

.progress-errors .error-line {
    font-size: .78rem;
    color: var(--danger);
    padding: .15rem 0;
}
