/* ════════════════════════════════════════════════════
   MODAL PROFESIONAL  –  reemplaza el panel lateral
════════════════════════════════════════════════════ */

/* Overlay + centrador */
.modal-pro {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: modal-pro-bg-in 0.2s ease both;
}

@keyframes modal-pro-bg-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Cuadro de diálogo */
.modal-pro-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 840px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modal-pro-in 0.3s cubic-bezier(0.34, 1.45, 0.64, 1) both;
    overflow: hidden;
}

.modal-pro-dialog.modal-pro-lg {
    max-width: 980px;
}

@keyframes modal-pro-in {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(-18px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Cabecera con tabs integrados */
.modal-pro-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 0 1rem 0 0.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 18px 18px 0 0;
    flex-shrink: 0;
    min-height: 52px;
}

/* Pestañas */
.modal-pro-tabs {
    display: flex;
    align-items: stretch;
    flex: 1;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.modal-pro-tabs::-webkit-scrollbar { display: none; }

.modal-pro-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0 1.1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-pro-tab:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.06);
}

.modal-pro-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 700;
}

/* Botón cerrar */
.modal-pro-close {
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.modal-pro-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

/* Cuerpo scrollable */
.modal-pro-body {
    padding: 1.6rem 1.75rem 1.4rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.modal-pro-body::-webkit-scrollbar {
    width: 5px;
}
.modal-pro-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}

/* Spinner de guardado */
.modal-pro-saving {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    border-radius: 18px;
    backdrop-filter: blur(2px);
}

.modal-pro-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #dbeafe;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: modal-pro-spin 0.65s linear infinite;
}

@keyframes modal-pro-spin {
    to { transform: rotate(360deg); }
}

/* Botones de acción dentro del modal mejorados */
.modal-pro-body .edit-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.modal-pro-body .save-btn,
.modal-pro-body .cancel-btn {
    padding: 0.55rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
}

.modal-pro-body .save-btn {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.modal-pro-body .save-btn:hover {
    opacity: 0.92;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45);
    transform: translateY(-1px);
}

.modal-pro-body .cancel-btn {
    background: #f1f5f9;
    color: #475569;
}

.modal-pro-body .cancel-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 640px) {
    .modal-pro-dialog,
    .modal-pro-dialog.modal-pro-lg {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 14px;
    }
    .modal-pro-body {
        padding: 1.1rem;
    }
}
