/* Estilos base para el campo */
.acf-field-input-container-artesan .admin_style_texto_artesan {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.input_container {
    display: block;
    width: 100%;
}

/* Botón moderno de configuración */
.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    width: auto;
    height: auto;
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button:hover::before {
    left: 100%;
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button:active {
    transform: translateY(0);
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.3s ease;
    color: white;
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button:hover svg {
    transform: rotate(90deg);
}

.acf-field-input-container-artesan .admin_style_texto_artesan>div.icon_button svg path {
    color: white;
}

/* === MODAL SIMPLIFICADO PARA CLIENTES === */
.modern-config-dialog {
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    overflow: hidden !important;
}

.ui-dialog.ui-widget.ui-widget-content {
    border-radius: 20px !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    overflow: hidden !important;
    max-height: 85vh !important;
}

.ui-dialog-titlebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 24px !important;
    border-radius: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    text-align: center !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.ui-dialog-titlebar-close {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: all 0.3s ease !important;
}

.ui-dialog-titlebar-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.ui-dialog-titlebar-close .ui-icon {
    background: none !important;
    color: white !important;
    font-size: 18px !important;
    width: auto !important;
    height: auto !important;
    text-indent: 0 !important;
}

.ui-dialog-titlebar-close .ui-icon::before {
    content: '×';
    font-size: 20px;
    line-height: 1;
}

/* Estilos para las pestañas modernas */
.modern-tabs-container {
    font-family: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modern-main-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    flex-shrink: 0;
}

.modern-main-tab {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 3px solid transparent;
    overflow: hidden;
}

.modern-main-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-main-tab:hover {
    color: #475569;
    background: rgba(102, 126, 234, 0.05);
}

.modern-main-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.modern-main-tab .tab-icon {
    font-size: 18px;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.modern-main-tab:hover .tab-icon {
    transform: scale(1.2) rotate(5deg);
}

.modern-main-tab .tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.modern-main-tab.active .tab-indicator {
    transform: scaleX(1);
}

.modern-main-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.modern-main-tab-content.active {
    display: flex;
    flex-direction: column;
}

.modern-sub-tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    margin: 0;
    padding: 0 24px;
    list-style: none;
    overflow-x: auto;
    flex-shrink: 0;
}

.modern-sub-tab {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-right: 8px;
}

.modern-sub-tab:hover {
    color: #475569;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px 6px 0 0;
}

.modern-sub-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px 6px 0 0;
    font-weight: 600;
}

.modern-sub-tab .subtab-icon {
    font-size: 14px;
    margin-right: 6px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.modern-sub-tab:hover .subtab-icon,
.modern-sub-tab.active .subtab-icon {
    opacity: 1;
    transform: scale(1.1);
}

.modern-sub-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modern-sub-tab-content.active {
    display: block;
}

/* === ESTILOS MEJORADOS PARA CAMPOS === */
.config-field {
    position: relative;
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.config-field:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.config-field .field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    letter-spacing: 0.025em;
}

.config-field .field-input-container {
    position: relative;
}

.field-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.field-input:hover {
    border-color: #cbd5e1;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.field-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.field-input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* Estilos para los campos de formulario */
.modern-field {
    position: relative;
    padding: 16px;
    margin-bottom: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px);
    animation: fieldFadeIn 0.5s ease forwards;
}

.modern-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.modern-field:hover::before {
    transform: scaleX(1);
}

.modern-field:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.modern-field:nth-child(1) {
    animation-delay: 0.1s;
}

.modern-field:nth-child(2) {
    animation-delay: 0.2s;
}

.modern-field:nth-child(3) {
    animation-delay: 0.3s;
}

.modern-field:nth-child(4) {
    animation-delay: 0.4s;
}

.modern-field:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fieldFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    position: relative;
    cursor: help;
}

.modern-field-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.modern-field:hover .modern-field-label::after {
    width: 30px;
}

.modern-field-input-container {
    position: relative;
}

.modern-field-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modern-field-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.modern-field-input:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* === ESTILOS MEJORADOS PARA SELECTS === */
.modern-field-select {
    position: relative;
    margin-bottom: 12px;
}

.modern-field-select::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #667eea;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.modern-field-select:hover::after {
    transform: translateY(-50%) scale(1.1) rotate(180deg);
    color: #764ba2;
}

.modern-field-select select {
    appearance: none;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    width: 100%;
    padding: 14px 45px 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.modern-field-select select:hover {
    border-color: #cbd5e1;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.modern-field-select select:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.modern-field-select select:focus+.modern-field-select::after {
    color: #667eea;
    transform: translateY(-50%) scale(1.2) rotate(180deg);
}

/* Estilos para opciones del select */
.modern-field-select select option {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    background: #ffffff;
}

.modern-field-select select option:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-field-select select option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

/* Estilos especiales para select_or_text y select_or_color */
.field-select,
.field-select-color {
    appearance: none;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    width: 100%;
    padding: 14px 45px 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.field-select:hover,
.field-select-color:hover {
    border-color: #cbd5e1;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.field-select:focus,
.field-select-color:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

/* Wrapper para select personalizado */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 12px;
}

.custom-select-wrapper::after {
    content: '⌄';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-wrapper:hover::after {
    transform: translateY(-50%) scale(1.2);
    color: #764ba2;
}

.custom-select-wrapper.focused::after {
    transform: translateY(-50%) scale(1.2) rotate(180deg);
    color: #667eea;
}

/* === ESTILOS MEJORADOS PARA CAMPOS PERSONALIZADOS === */
.field-text-custom,
.field-color-text {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 8px;
}

.field-text-custom:hover,
.field-color-text:hover {
    border-color: #cbd5e1;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.field-text-custom:focus,
.field-color-text:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.field-text-custom::placeholder,
.field-color-text::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* Color picker personalizado mejorado */
.color-picker-custom {
    margin-top: 8px;
    padding: 12px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.color-picker-custom:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.field-color {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.field-color:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.field-color:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* Estilos específicos para inputs modernos */
.modern-color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modern-color-picker:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-color-picker:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-input {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-input:hover {
    transform: scale(1.05);
}

.color-preview {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.color-text-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 0 !important;
    box-shadow: none !important;
}

.color-text-input:focus {
    outline: none;
}

.modern-number-input {
    position: relative;
    display: flex;
    align-items: center;
}

.modern-number-input .modern-field-input {
    padding-right: 40px;
}

.number-controls {
    position: absolute;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.number-controls button {
    width: 24px;
    height: 16px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-controls button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.modern-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Contenedor de campos con scroll personalizado */
.fields-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.modern-sub-tab-content::-webkit-scrollbar {
    width: 6px;
}

.modern-sub-tab-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.modern-sub-tab-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.modern-sub-tab-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Estados de loading */
.modern-tabs-container.loading {
    position: relative;
}

.modern-tabs-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-tabs-container.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-right: 4px solid #764ba2;
    border-radius: 50%;
    animation: modernSpin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: 1001;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes modernSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

/* Tooltips para mejor UX */
.modern-field-label:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
    to {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Responsive */
@media (max-width: 768px) {

    .modern-main-tabs,
    .modern-sub-tabs {
        padding: 0 16px;
    }

    .modern-sub-tab-content {
        padding: 16px;
    }

    .modern-main-tab,
    .modern-sub-tab {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 900px) {
    .modern-main-tabs {
        flex-wrap: wrap;
    }

    .modern-main-tab .tab-text {
        display: none;
    }

    .modern-sub-tab .subtab-text {
        font-size: 12px;
    }

    .modern-field {
        padding: 12px;
        margin-bottom: 16px;
    }
}

@media (max-width: 600px) {
    .modern-sub-tabs {
        flex-direction: column;
        gap: 4px;
    }

    .modern-sub-tab {
        text-align: center;
        padding: 10px 16px;
    }

    .color-text-input {
        font-size: 12px;
    }
}

/* ========================================
   ESTILOS PARA ESTRUCTURA ANIDADA
======================================== */

.modern-nested-config {
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100%;
}

/* Contenedor Principal */
.main-container-section {
    background: white;
    border-radius: 12px;
    margin: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
}

.container-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    text-align: center;
}

.container-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.container-content {
    padding: 24px;
}

/* Secciones Globales */
.global-fields-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid #667eea;
}

.global-fields-section h3 {
    color: #4a5568;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sección de Dispositivos */
.devices-section {
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.devices-section h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding: 16px 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pestañas de Dispositivos Anidadas */
.device-tabs-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.device-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.device-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.device-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.device-tab.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.device-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.field-count {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
}

/* Paneles de Dispositivos */
.device-panels {
    background: white;
}

.device-panel {
    display: none;
    padding: 24px;
}

.device-panel.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

.device-content h4 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

/* Secciones de Campos */
.device-fields-section,
.device-states-section {
    margin-bottom: 24px;
}

.device-fields-section h5,
.state-section h5 {
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-section {
    background: #f8fafc;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid #a855f7;
}

/* === GRID DE CAMPOS SIMPLIFICADA === */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 0;
    background: transparent;
    border: none;
}

.section-content .fields-grid {
    padding: 0;
    margin-top: 12px;
}

/* === CAMPOS REORGANIZADOS PARA SIMPLICIDAD === */
.field-group {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.field-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-group-icon {
    font-size: 16px;
    opacity: 0.7;
}

/* === RESPONSIVE MEJORADO === */
@media (max-width: 768px) {
    .fields-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .config-section {
        margin-bottom: 16px;
    }

    .section-header {
        padding: 16px 20px;
        font-size: 15px;
    }

    .section-content {
        padding: 20px !important;
    }
}

@media (min-width: 1200px) {
    .fields-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

/* Controles Globales */
.config-controls {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 20px 24px;
    margin: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    gap: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Animaciones */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === DISEÑO SIMPLIFICADO SIN SCROLL MÚLTIPLE === */
.simple-config-container {
    padding: 24px;
    background: #f8fafc;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea transparent;
}

.simple-config-container::-webkit-scrollbar {
    width: 8px;
}

.simple-config-container::-webkit-scrollbar-track {
    background: transparent;
}

.simple-config-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

/* === SECCIONES COLAPSABLES === */
.config-section {
    background: white;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.config-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.section-header:hover::before {
    left: 100%;
}

.section-icon {
    font-size: 20px;
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.section-toggle {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.config-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: 0;
    max-height: 0;
    overflow: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

.config-section:not(.collapsed) .section-content {
    padding: 24px;
    max-height: 1000px;
}

/* === CONTENEDOR JERÁRQUICO ORIGINAL (MANTENER PARA COMPATIBILIDAD) === */
.hierarchical-tabs-container {
    margin: 0;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* === PESTAÑAS PRINCIPALES === */
.main-tabs-container {
    margin: 0;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.main-tabs-nav {
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.main-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 16px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    min-width: 120px;
}

.main-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.main-tab.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.main-tab.active::after {
    width: 80%;
}

.main-tabs-content {
    background: white;
    min-height: 400px;
}

.main-tab-content {
    display: none;
    padding: 24px;
    animation: fadeInUp 0.3s ease;
}

.main-tab-content.active {
    display: block;
}

/* === PESTAÑAS ANIDADAS === */
.nested-tabs-container {
    margin-top: 20px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    max-height: none;
    display: flex;
    flex-direction: column;
}

/* === SECCIÓN DE NIVEL 3 CON SCROLL MEJORADO === */
.nested-tabs-section {
    margin-top: 20px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #cbd5e1;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nested-tabs-section .nested-tabs-nav {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.nested-tabs-section .nested-tabs-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

.nested-tabs-section .nested-tabs-content::-webkit-scrollbar {
    width: 8px;
}

.nested-tabs-section .nested-tabs-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.nested-tabs-section .nested-tabs-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    border: 1px solid #f1f5f9;
}

.nested-tabs-section .nested-tabs-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.nested-tabs-section .nested-tab-content {
    padding: 16px 8px 16px 0;
    max-height: none;
}

.nested-tabs-nav {
    display: flex;
    background: #e2e8f0;
    padding: 4px;
    overflow-x: auto;
}

.nested-tab {
    background: none;
    border: none;
    color: #64748b;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-radius: 6px;
    margin: 0 2px;
    min-width: 100px;
}

.nested-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.7);
}

.nested-tab.active {
    color: #667eea;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nested-tabs-content {
    background: white;
    min-height: 200px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nested-tab-content {
    display: none;
    padding: 20px;
    animation: fadeInUp 0.2s ease;
    max-height: none;
    overflow-y: visible;
}

.nested-tab-content.active {
    display: block;
}

/* === CONTENEDOR PRINCIPAL DEL MODAL MEJORADO === */
.hierarchical-tabs-container .main-tabs-content {
    max-height: 550px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f8fafc;
}

.hierarchical-tabs-container .main-tabs-content::-webkit-scrollbar {
    width: 8px;
}

.hierarchical-tabs-container .main-tabs-content::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.hierarchical-tabs-container .main-tabs-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    border: 1px solid #f8fafc;
}

.hierarchical-tabs-container .main-tabs-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.main-tab-content {
    display: none;
    padding: 24px;
    animation: fadeInUp 0.3s ease;
    overflow-y: visible;
    max-height: none;
}

.main-tab-content.active {
    display: block;
}

/* === SECCIONES JERÁRQUICAS === */
.section-direct-fields {
    margin-bottom: 20px;
}

.section-direct-fields .fields-grid {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.nested-tabs-section {
    margin-top: 20px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #cbd5e1;
}

/* === SECCIONES === */
.section-container {
    margin-bottom: 20px;
}

.section-fields {
    margin-bottom: 24px;
}

.single-nested-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.single-nested-section h3 {
    margin: 0 0 16px 0;
    color: #334155;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

/* === SECCIÓN DE DISPOSITIVOS PREDETERMINADOS === */
.default-devices-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.default-devices-section h2 {
    margin: 0 0 20px 0;
    color: #334155;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

/* === MEJORAS PARA CAMPOS ANIDADOS === */
.nested-sections .fields-grid {
    gap: 16px;
}

.nested-sections .field-group {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}

.nested-sections .field-label {
    color: #475569;
    font-size: 13px;
    font-weight: 500;
}

/* === INDICADORES DE CONTENIDO === */
.main-tab-content:empty::before {
    content: '📭 No hay configuraciones disponibles en esta sección';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #94a3b8;
    font-style: italic;
}

.nested-tab-content:empty::before {
    content: '📄 Sección vacía';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #cbd5e1;
    font-size: 14px;
    font-style: italic;
}

/* Responsive para estructura anidada */
@media (max-width: 768px) {
    .main-container-section {
        margin: 10px;
    }

    .container-content {
        padding: 16px;
    }

    .fields-grid {
        grid-template-columns: 1fr;
    }

    .device-tabs {
        flex-wrap: wrap;
    }

    .device-tab {
        flex: none;
        min-width: 120px;
    }

    .main-tabs-nav {
        flex-wrap: wrap;
    }

    .main-tab {
        min-width: auto;
        flex: 1 1 auto;
    }

    .nested-tabs-nav {
        flex-wrap: wrap;
    }

    .nested-tab {
        min-width: auto;
        flex: 1 1 auto;
    }

    .main-tab-content {
        padding: 16px;
    }

    .nested-tab-content {
        padding: 16px;
    }
}

/* === MEJORAS ADICIONALES PARA SCROLL Y UX === */

/* Mejorar la experiencia de scroll en todos los niveles */
.hierarchical-tabs-container,
.main-tabs-container,
.nested-tabs-container {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

.hierarchical-tabs-container *::-webkit-scrollbar,
.main-tabs-container *::-webkit-scrollbar,
.nested-tabs-container *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.hierarchical-tabs-container *::-webkit-scrollbar-track,
.main-tabs-container *::-webkit-scrollbar-track,
.nested-tabs-container *::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.8);
    border-radius: 4px;
}

.hierarchical-tabs-container *::-webkit-scrollbar-thumb,
.main-tabs-container *::-webkit-scrollbar-thumb,
.nested-tabs-container *::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    border: 1px solid rgba(241, 245, 249, 0.8);
}

.hierarchical-tabs-container *::-webkit-scrollbar-thumb:hover,
.main-tabs-container *::-webkit-scrollbar-thumb:hover,
.nested-tabs-container *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Animaciones mejoradas */
.config-field {
    animation: fadeInUp 0.3s ease;
}

.config-field:nth-child(odd) {
    animation-delay: 0.1s;
}

.config-field:nth-child(even) {
    animation-delay: 0.2s;
}

/* Indicadores visuales mejorados */
.main-tab,
.nested-tab {
    position: relative;
    overflow: hidden;
}

.main-tab::before,
.nested-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.main-tab:hover::before,
.nested-tab:hover::before {
    left: 100%;
}

/* Estados de loading mejorados */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.config-field.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Tooltips para campos */
.field-label[title] {
    cursor: help;
    border-bottom: 1px dotted #cbd5e1;
}

.field-label[title]:hover {
    border-bottom-color: #667eea;
    color: #667eea;
}

/* === DISEÑO SIMPLIFICADO PARA CLIENTES === */
.simple-config-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

.simple-config-container::-webkit-scrollbar {
    width: 8px;
}

.simple-config-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.simple-config-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    border: 1px solid #f1f5f9;
}

.simple-config-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Secciones colapsables */
.config-section {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.config-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.section-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    user-select: none;
}

.section-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.section-icon {
    font-size: 20px;
    margin-right: 12px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.section-toggle {
    font-size: 18px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
}

.config-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.config-section:not(.collapsed) .section-icon {
    transform: scale(1.1);
}

.section-content {
    padding: 24px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 1000px;
    overflow: auto;
}

.config-section.collapsed .section-content {
    max-height: 0;
    padding: 0 24px;
    opacity: 0;
}

/* Grid de campos simplificado */
.simple-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
}

@media (max-width: 768px) {
    .simple-fields-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (min-width: 1200px) {
    .simple-fields-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 24px;
    }
}

/* Campos mejorados para diseño simple */
.simple-config-field {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.simple-config-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.simple-config-field:hover {
    border-color: #cbd5e1;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.simple-config-field:hover::before {
    transform: scaleX(1);
}

.simple-field-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    letter-spacing: 0.025em;
    position: relative;
}

.simple-field-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
}

/* Controles del modal simplificado */
.simple-modal-controls,
.config-controls {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 20px 24px;
    margin: 20px -16px -16px -16px;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: center;
    gap: 16px;
    border-top: 1px solid #e2e8f0;
    z-index: 10;
}

.btn-simple-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-simple-save:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.btn-simple-cancel {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-simple-cancel:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.6);
}

/* Estilos para botones genéricos del modal */
.btn-save,
.btn-cancel {
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-save:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.btn-cancel {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.6);
}

/* Animaciones para el diseño simple */
.config-section {
    animation: slideInUp 0.3s ease;
}

.config-section:nth-child(1) {
    animation-delay: 0.1s;
}

.config-section:nth-child(2) {
    animation-delay: 0.2s;
}

.config-section:nth-child(3) {
    animation-delay: 0.3s;
}

.config-section:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados vacíos mejorados */
.empty-section-message {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
    font-size: 16px;
}

.empty-section-message::before {
    content: '📭';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

/* === SUBSECCIONES (NIVEL 2) === */
.sub-sections-container {
    margin-top: 16px;
}

.sub-config-section {
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sub-config-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.sub-section-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    user-select: none;
    border-bottom: 1px solid #e2e8f0;
}

.sub-section-header:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #334155;
}

.sub-section-icon {
    font-size: 16px;
    margin-right: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.sub-section-toggle {
    font-size: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
    color: #667eea;
}

.sub-config-section.collapsed .sub-section-toggle {
    transform: rotate(-90deg);
}

.sub-config-section:not(.collapsed) .sub-section-icon {
    transform: scale(1.05);
}

.sub-section-content {
    padding: 20px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 1000px;
    overflow: auto;
}

.sub-config-section.collapsed .sub-section-content {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
}

/* === SUB-SUBSECCIONES (NIVEL 3) === */
.sub-sub-sections-container {
    margin-top: 20px;
}

.sub-sub-section {
    padding: 16px;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.sub-sub-section:hover {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.sub-sub-section h5 {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 16px !important;
}

/* Campos directos en secciones */
.direct-fields-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.sub-direct-fields {
    margin-bottom: 16px;
}