/* Nexus Control — Modal Base */

#nxctl-portal .nc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nc-space-4);
    animation: ncBackdropIn var(--nc-dur) var(--nc-ease);
}

@keyframes ncBackdropIn { from { opacity: 0; } to { opacity: 1; } }

#nxctl-portal .nc-modal {
    background: var(--nc-surface);
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-xl);
    box-shadow: var(--nc-shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: ncModalIn var(--nc-dur-md) var(--nc-ease);
    overflow: hidden;
}

@keyframes ncModalIn {
    from { opacity: 0; transform: scale(.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#nxctl-portal .nc-modal--lg { max-width: 680px; }
#nxctl-portal .nc-modal--sm { max-width: 380px; }

#nxctl-portal .nc-modal__header {
    padding: var(--nc-space-5) var(--nc-space-6);
    border-bottom: 1px solid var(--nc-border);
    display: flex;
    align-items: center;
    gap: var(--nc-space-3);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--nc-accent) 0%, rgba(var(--nc-accent-rgb),.6) 100%);
    color: #fff;
}

#nxctl-portal .nc-modal__icon {
    width: 38px; height: 38px;
    border-radius: var(--nc-radius);
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
#nxctl-portal .nc-modal__icon svg { width: 20px; height: 20px; stroke: #fff; }

#nxctl-portal .nc-modal__title { font-size: var(--nc-fs-md); font-weight: 700; color: #fff; }
#nxctl-portal .nc-modal__subtitle { font-size: var(--nc-fs-xs); color: rgba(255,255,255,.75); margin-top: 1px; }

#nxctl-portal .nc-modal__close {
    margin-left: auto;
    width: 30px; height: 30px;
    border-radius: var(--nc-radius);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--nc-dur);
    color: rgba(255,255,255,.8);
    flex-shrink: 0;
}
#nxctl-portal .nc-modal__close:hover { background: rgba(255,255,255,.2); color: #fff; }
#nxctl-portal .nc-modal__close svg { width: 18px; height: 18px; stroke: currentColor; }

#nxctl-portal .nc-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--nc-space-6);
}

#nxctl-portal .nc-modal__footer {
    padding: var(--nc-space-4) var(--nc-space-6);
    border-top: 1px solid var(--nc-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--nc-space-3);
    flex-shrink: 0;
    background: var(--nc-surface2);
}

/* Stacked modals */
#nxctl-portal .nc-modal-backdrop:nth-child(2) { background: rgba(0,0,0,.4); }
