/* ============================================================
   FLUJOS MODULE - ESTILOS
   ============================================================ */

/* TABLA DE FLUJOS */
.flujos-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flujos-table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
}

.flujos-table {
    width: 100%;
    border-collapse: collapse;
    background: #181828;
}

.flujos-table thead {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom: 2px solid var(--accent-cyan);
}

.flujos-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flujos-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.flujos-table tbody tr:hover {
    background: rgba(0, 217, 255, 0.05);
}

.flujos-table td {
        color: #fff;
    padding: 16px;
    vertical-align: middle;
}

/* INFORMACIÓN DEL FLUJO */
.flujo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flujo-name {
    display: block;
    font-weight: 600;
    color: #fff;
     background: rgba(0, 217, 255, 0.25);
     border: 1px solid #00d9ff;
     color: #fff;
.flujo-desc {
    display: block;
    color: #b0b0b0;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* BADGES Y ESTADO */
.trigger-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.badge-success {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border: 1px solid #10b981;
}

.status-badge.badge-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

/* CONTADORES */
.node-count {
    display: inline-block;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid #00d9ff;
    color: #00d9ff;
    color: var(--accent-cyan);
    text-align: center;
    line-height: 24px;
    font-weight: 600;
    font-size: 0.85rem;
}

.text-center {
    text-align: center;
}

/* BOTONES DE ACCIÓN */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
     background: #23233a;
     border-radius: var(--border-radius);
     cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
     color: #fff;
    transition: var(--transition-fast);
    font-size: 1rem;
}

.btn-icon:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-icon.duplicate:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

/* ============================================================
   FLUJO EDITOR MODAL
   ============================================================ */
.flujo-editor {
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.flujo-editor .modal-header {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom: 2px solid var(--accent-cyan);
    padding: 20px;
}

.flujo-editor-body {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 280px 1fr 200px;
    gap: 16px;
    padding: 24px;
}

/* CONFIGURACIÓN BÁSICA */
.flujo-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: var(--light-bg);
    border-radius: var(--border-radius-lg);
}

.flujo-config .form-group {
    margin-bottom: 0;
}

/* CANVAS DISEÑADOR */
.flujo-designer {
    border: 2px dashed var(--accent-cyan);
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.02) 0%, rgba(59, 130, 246, 0.02) 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.designer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.designer-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.designer-controls {
    display: flex;
    gap: 8px;
}

#flujo-canvas {
    flex: 1;
    position: relative;
    min-height: 300px;
    overflow: auto;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 217, 255, 0.03) 0px,
        rgba(0, 217, 255, 0.03) 1px,
        transparent 1px,
        transparent 40px
    );
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
    margin: 0;
}

/* PALETA DE NODOS */
.node-palette {
    padding: 16px;
    background: white;
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
}

.node-palette h5 {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.node-types {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.node-item {
    padding: 10px 12px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 600;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    font-size: 0.75rem;
    transition: var(--transition-fast);
    user-select: none;
}

.node-item:active {
    cursor: grabbing;
    opacity: 0.8;
}

.node-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px currentColor;
}

.node-item i {
    font-size: 1.2rem;
}

/* FOOTER MODAL */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    min-width: 120px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state h3 {
    margin: 16px 0 8px 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0 0 16px 0;
    max-width: 400px;
}

.empty-state .btn {
    margin-top: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1400px) {
    .flujo-editor-body {
        grid-template-columns: 1fr;
    }

    .flujo-config,
    .node-palette {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .flujo-editor {
        max-width: 100vw;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
    }

    .flujo-editor-body {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .flujos-table {
        font-size: 0.85rem;
    }

    .flujos-table th,
    .flujos-table td {
        padding: 10px 8px;
    }

    .action-buttons {
        gap: 4px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}
