* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #541690 0%, #3E0D61 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #541690 0%, #3E0D61 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.tabs {
    display: flex;
    background: #F0FDFF;
    border-bottom: 2px solid #1EDFAE;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #541690;
    transition: all 0.3s;
}

.tab-button:hover {
    background: rgba(30, 223, 174, 0.1);
}

.tab-button.active {
    background: white;
    color: #541690;
    border-bottom: 3px solid #1EDFAE;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.card {
    background: #F0FDFF;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #1EDFAE;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.card h3 {
    color: #555;
    margin: 15px 0 10px 0;
    font-size: 1.2em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 223, 174, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #1EDFAE 0%, #81F79E 100%);
    color: #1A0037;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #81F79E 0%, #1EDFAE 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #541690 0%, #3E0D61 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3E0D61 0%, #1A0037 100%);
}

.btn-success {
    background: linear-gradient(135deg, #1EDFAE 0%, #81F79E 100%);
    color: #1A0037;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #81F79E 0%, #1EDFAE 100%);
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    margin-top: 10px;
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    display: none;
}

.status-message.success {
    display: block;
    background: rgba(30, 223, 174, 0.1);
    color: #1A0037;
    border: 1px solid #1EDFAE;
}

.status-message.error {
    display: block;
    background: rgba(255, 209, 36, 0.1);
    color: #1A0037;
    border: 1px solid #FFD124;
}

.summary-box {
    background: white;
    border: 2px solid #1EDFAE;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-box h3 {
    color: #541690;
    margin-bottom: 15px;
}

.summary-box p {
    margin: 8px 0;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(84, 22, 144, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1EDFAE 0%, #81F79E 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
    width: 0%;
}

.status-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.status-info p {
    margin: 10px 0;
    font-size: 1em;
}

.success-message {
    background: rgba(30, 223, 174, 0.1);
    border: 2px solid #1EDFAE;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.success-message h3 {
    color: #541690;
    margin-bottom: 15px;
}

.error-message {
    background: rgba(255, 209, 36, 0.1);
    border: 2px solid #FFD124;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.error-message h3 {
    color: #1A0037;
    margin-bottom: 15px;
}

.files-list {
    margin-top: 20px;
}

.file-item {
    background: white;
    border: 1px solid #1EDFAE;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #541690;
    margin-bottom: 5px;
}

.file-meta {
    font-size: 0.85em;
    color: #666;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Info box */
.info-box {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    font-size: 0.9em;
    color: #004085;
}

.info-box strong {
    display: block;
    margin-bottom: 5px;
}

/* Logs section */
.logs-section {
    margin-top: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.logs-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.logs-container {
    max-height: 300px;
    overflow-y: auto;
    background: white;
}

.logs-content {
    padding: 10px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #999;
    margin-right: 10px;
    min-width: 80px;
    font-size: 0.85em;
}

.log-icon {
    margin-right: 8px;
}

.log-message {
    flex: 1;
    color: #333;
}

.log-info {
    background: #f8f9fa;
}

.log-success {
    background: #d4edda;
}

.log-success .log-message {
    color: #155724;
}

.log-warning {
    background: #fff3cd;
}

.log-warning .log-message {
    color: #856404;
}

.log-error {
    background: #f8d7da;
}

.log-error .log-message {
    color: #721c24;
}

#categories-tree {
    margin-top: 15px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

.category-tree-container {
    font-size: 0.95em;
}

.category-node {
    margin: 2px 0;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

.category-header:hover {
    background: #f5f5f5;
}

.category-toggle {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.category-toggle.collapsed {
    transform: rotate(0deg);
}

.category-toggle:not(.collapsed) {
    transform: rotate(0deg);
}

.category-spacer {
    width: 20px;
    display: inline-block;
    margin-right: 5px;
}

.category-checkbox {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

.category-label {
    cursor: pointer;
    user-select: none;
    flex: 1;
    display: flex;
    align-items: center;
    color: #333;
}

.category-id {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 8px;
    min-width: 45px;
    text-align: center;
}

.category-children {
    margin-left: 25px;
    border-left: 2px solid #e0e0e0;
    padding-left: 10px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-children.collapsed {
    display: none;
}

.category-header.level-1 {
    font-weight: 600;
    font-size: 1em;
}

.category-header.level-2 {
    font-weight: 500;
}

.category-header.level-3 {
    font-size: 0.95em;
}

.category-header.level-4 {
    font-size: 0.9em;
    color: #555;
}

/* Controles de categorías */
.category-controls {
    margin-top: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

.search-box {
    margin-bottom: 12px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.selection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.selection-info span {
    font-weight: 500;
    color: #667eea;
}

.control-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-mini {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-select-all {
    background: #28a745;
    color: white;
}

.btn-select-all:hover {
    background: #218838;
}

.btn-deselect-all {
    background: #dc3545;
    color: white;
}

.btn-deselect-all:hover {
    background: #c82333;
}

.btn-expand-all,
.btn-collapse-all {
    background: #6c757d;
    color: white;
}

.btn-expand-all:hover,
.btn-collapse-all:hover {
    background: #5a6268;
}

.category-item {
    padding: 5px 0;
    color: #333;
}

.category-item.level-1 {
    font-weight: bold;
    margin-top: 10px;
}

.category-item.level-2 {
    padding-left: 20px;
}

.category-item.level-3 {
    padding-left: 40px;
}

.category-item.level-4 {
    padding-left: 60px;
    font-size: 0.9em;
}

/* ============================================================ */
/* ESTILOS PARA COMPARACIÓN DE ARCHIVOS */
/* ============================================================ */

.file-input-wrapper {
    margin-top: 8px;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #1EDFAE;
    border-radius: 6px;
    background: rgba(30, 223, 174, 0.05);
    cursor: pointer;
    font-size: 0.95em;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: #541690;
    background: rgba(30, 223, 174, 0.1);
}

.file-info {
    margin-top: 10px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #1EDFAE;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.file-placeholder {
    color: #999;
    font-style: italic;
}

.file-loading {
    color: #541690;
    font-weight: 500;
}

.file-success {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    color: #541690;
    font-weight: 600;
}

.file-details {
    color: #666;
    font-size: 0.9em;
}

.file-error {
    color: #FFD124;
    font-weight: 500;
}

.required {
    color: #541690;
    font-weight: bold;
    margin-left: 3px;
}

.info-text {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.05em;
}

.progress-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-text {
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
    color: #541690;
}

.result-section {
    margin-top: 25px;
}

.info-card {
    background: rgba(30, 223, 174, 0.05);
    border-left: 4px solid #1EDFAE;
}

.info-card h3 {
    color: #541690;
    margin-bottom: 15px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(30, 223, 174, 0.2);
    color: #555;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list code {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #541690;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .file-success {
        font-size: 0.9em;
    }
}

/* ============================================================ */
/* ESTILOS PARA PASO 2 */
/* ============================================================ */

.paso2-section {
    background: rgba(129, 247, 158, 0.05);
    border-left: 4px solid #81F79E;
    margin-top: 30px;
}

.paso2-section h2 {
    color: #541690;
}

.stats-box {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #1EDFAE;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(30, 223, 174, 0.05);
    border-radius: 6px;
    border: 1px solid #1EDFAE;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #541690;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #3E0D61;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-message {
    color: #1A0037;
    font-size: 1em;
    text-align: center;
    padding: 15px;
    background: rgba(30, 223, 174, 0.1);
    border-radius: 6px;
    border-left: 3px solid #1EDFAE;
}

/* Responsive para stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-number {
        font-size: 1.5em;
    }
    
    .stat-label {
        font-size: 0.8em;
    }
}

/* ============================================================ */
/* ESTILOS PARA PASO 3 */
/* ============================================================ */

.paso3-section {
    background: rgba(255, 209, 36, 0.05);
    border-left: 4px solid #FFD124;
    margin-top: 30px;
}

.paso3-section h2 {
    color: #541690;
}

.stats-warning {
    color: #1A0037;
    background: rgba(255, 209, 36, 0.1);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #FFD124;
    margin-top: 10px;
    font-weight: 500;
}

.btn-warning {
    background: linear-gradient(135deg, #FFD124 0%, #f0c010 100%);
    color: #1A0037;
    font-weight: 600;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f0c010 0%, #e0b000 100%);
    transform: translateY(-2px);
}

/* ============================================================ */
/* ESTILOS PARA REMOVER GARANTÍAS */
/* ============================================================ */

.remover-section {
    background: #ffebee;
    border-left: 4px solid #f44336;
    margin-top: 30px;
}

.remover-section h2 {
    color: #f44336;
}

.stats-info {
    color: #0277bd;
    background: #e1f5fe;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #03a9f4;
    margin-top: 10px;
    font-weight: 500;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-2px);
}


/* ============================================================ */
/* ESTILOS PARA BARRAS DE PROGRESO DE CARGA */
/* ============================================================ */

.file-uploading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.file-uploading .file-name {
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.upload-progress-bar {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.upload-progress-text {
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: absolute;
    width: 100%;
    text-align: center;
}

.upload-size {
    font-size: 0.85em;
    color: #666;
    text-align: right;
}

/* Animación para la barra de progreso */
@keyframes progress-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.upload-progress-fill {
    background: linear-gradient(90deg, 
        #4CAF50 0%, 
        #66BB6A 25%, 
        #4CAF50 50%, 
        #66BB6A 75%, 
        #4CAF50 100%);
    background-size: 200% 100%;
    animation: progress-animation 2s ease infinite;
}

/* Responsive para barras de progreso */
@media (max-width: 768px) {
    .upload-progress-bar {
        height: 20px;
    }
    
    .upload-progress-text {
        font-size: 0.8em;
    }
    
    .file-uploading .file-name {
        font-size: 0.9em;
    }
    
    .upload-size {
        font-size: 0.8em;
    }
}

/* ============================================================ */
/* ESTILOS PARA EXPORTACIÓN DE SKUs */
/* ============================================================ */

.sku-export-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #2196F3;
}

.sku-export-card h3 {
    color: #1976D2;
    margin-bottom: 10px;
}

.export-config-toggle {
    margin: 15px 0;
}

#export-advanced-config {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #BBDEFB;
}

.files-download-list {
    margin-top: 15px;
}

.files-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.file-download-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #E0E0E0;
}

.file-icon {
    font-size: 1.5em;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.error-list li {
    padding: 8px;
    margin: 5px 0;
    background: #FFEBEE;
    border-left: 3px solid #F44336;
    border-radius: 4px;
    color: #C62828;
}

.status-subtext {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .file-download-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-download-item button {
        width: 100%;
    }
}

/* ── Paso 4: Migrar al Nuevo Formato ── */
.paso4-section {
    background: rgba(30, 223, 174, 0.05);
    border-left: 4px solid #1EDFAE;
    margin-top: 0;
}

.paso4-section h2 {
    color: #541690;
}
/* ================================================================
   v2.0 — Estilos para tarjetas de procesos paralelos en Extracción
   ================================================================ */

.extraction-process-card {
    border-left: 4px solid #4A90E2;
    background: rgba(74, 144, 226, 0.04);
    margin-top: 16px;
}

.extraction-process-card:nth-child(3) {
    border-left-color: #7B2D8B;
    background: rgba(123, 45, 139, 0.04);
}

.proc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.proc-header h3 {
    margin: 0;
    font-size: 1.05em;
    color: #333;
}

.proc-filename {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-bottom: 10px;
}

.proc-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.proc-badge-running {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEAA7;
}

.proc-badge-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.proc-badge-error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.proc-badge-idle {
    background: #E2E3E5;
    color: #495057;
    border: 1px solid #D6D8DB;
}

.proc-badge-cancelled {
    background: #E2E3E5;
    color: #495057;
    border: 1px solid #D6D8DB;
}

.proc-result-success {
    margin-top: 12px;
    padding: 10px 14px;
    background: #D4EDDA;
    border: 1px solid #C3E6CB;
    border-radius: 6px;
    color: #155724;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.proc-result-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #F8D7DA;
    border: 1px solid #F5C6CB;
    border-radius: 6px;
    color: #721C24;
}

.btn-sm {
    padding: 5px 14px;
    font-size: 0.85em;
}

.proc2-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

/* ================================================================
   Pipeline automático — Comparar Archivos v2.0
   ================================================================ */

/* Grid de archivos externos */
.external-files-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}
@media (max-width: 700px) {
    .external-files-grid { grid-template-columns: 1fr; }
}

.ext-file-card {
    border: 2px dashed #CBD5E1;
    border-radius: 10px;
    padding: 16px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .2s, background .2s;
}
.ext-file-card.loaded {
    border-color: #22C55E;
    background: #F0FDF4;
}

.ext-file-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.ext-file-icon { font-size: 1.6em; }
.ext-file-header > div { display: flex; flex-direction: column; gap: 3px; }
.ext-file-header small { color: #64748B; font-size: 0.78em; }

.ext-file-status { font-size: 0.88em; }
.badge-missing  { color: #92400E; background: #FEF3C7; padding: 2px 8px; border-radius: 10px; }
.badge-loaded   { color: #166534; background: #DCFCE7; padding: 2px 8px; border-radius: 10px; }

.btn-upload { display: inline-block; cursor: pointer; text-align: center; }

.upload-progress { margin-top: 4px; }
.upload-fill { background: linear-gradient(90deg, #4A90E2, #7B2D8B); }

/* Pipeline select */
.pipeline-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-size: 0.92em;
    background: #fff;
    color: #333;
    margin-top: 6px;
}

/* Diagrama del pipeline */
.pipeline-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 14px;
}

.pipeline-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F8FAFC;
    transition: background .2s, border-color .2s;
}
.pipeline-step.step-active  { background: #EFF6FF; border-color: #3B82F6; }
.pipeline-step.step-done    { background: #F0FDF4; border-color: #22C55E; }
.pipeline-step.step-error   { background: #FFF1F2; border-color: #F43F5E; }

.pstep-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #CBD5E1;
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.step-active  .pstep-num { background: #3B82F6; }
.step-done    .pstep-num { background: #22C55E; }
.step-error   .pstep-num { background: #F43F5E; }

.pstep-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pstep-body strong { font-size: 0.95em; }
.pstep-body small  { color: #64748B; font-size: 0.8em; }

.pstep-badge {
    font-size: 0.8em;
    padding: 2px 10px;
    border-radius: 10px;
    background: #E2E8F0;
    color: #475569;
    white-space: nowrap;
}

.pipeline-arrow {
    text-align: center;
    color: #94A3B8;
    font-size: 1.1em;
    padding: 2px 0;
}

/* Progress steps */
.pipeline-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.pp-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92em;
    padding: 6px 0;
    border-bottom: 1px solid #F1F5F9;
}
.pp-dot {
    font-size: 1.2em;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.pp-result {
    margin-left: auto;
    font-size: 0.82em;
    color: #64748B;
    max-width: 55%;
    text-align: right;
}

/* ================================================================
   Pestaña Archivos v2.0 — con eliminación y selección múltiple
   ================================================================ */

.files-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.files-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88em;
    color: #475569;
    cursor: pointer;
    margin-left: auto;
}

.file-item-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
    transition: background .15s, border-color .15s;
}
.file-item-v2:hover { background: #F8FAFC; border-color: #CBD5E1; }
.file-item-v2.selected { background: #EFF6FF; border-color: #3B82F6; }

.file-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.file-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: #3B82F6; }

.file-type-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.file-item-v2 .file-info { flex: 1; min-width: 0; }
.file-item-v2 .file-name {
    font-weight: 500;
    color: #1E293B;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-item-v2 .file-meta { font-size: 0.78em; color: #64748B; margin-top: 2px; }

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Leyenda de colores */
.files-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 0.8em;
    color: #64748B;
}
.legend-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
