Prepare the Pan: Preheat the oven to 350°F. Line a 9-inch square baking pan with parchment paper, leaving some parchment hanging over the sides for easy removal. Lightly grease the parchment.
Make the Crumble Mixture: In a large mixing bowl, combine the all-purpose flour, rolled oats, brown sugar, granulated sugar, cinnamon, and salt. Add the softened butter and mix with a pastry cutter or fork until the mixture becomes crumbly. Set aside about one-third of the mixture for the topping.
Bake the Bottom Layer: Press the remaining crumble mixture firmly and evenly into the bottom of the prepared pan. Bake for about 10 minutes, or until the edges are lightly golden.
Prepare the Apples: While the crust bakes, peel and finely chop the apples. Place them in a bowl and gently toss with flour, brown sugar, cinnamon, vanilla extract, and salt until evenly coated.
Add the Apples and Caramel: Spread the seasoned apples evenly over the warm crust. Drizzle the caramel sauce over the apples, making sure it is distributed across the entire layer.
Add the Crumble Topping: Sprinkle the reserved crumble mixture evenly over the caramel and apples. If using pecans, scatter the chopped nuts over the top.
Bake: Return the pan to the oven and bake for about 25 minutes, or until the topping is golden brown and the caramel is bubbling around the edges.
Cool and Slice: Remove the pan from the oven and let the bars cool completely for about 30 minutes. Lift them out using the parchment paper, then cut into squares. Serve with an optional drizzle of caramel sauce.