Combine 2 cups flour, baking powder, salt and sugar in your food processor. Pulse 3 or 4 times, then add cubed butter. Continue to pulse for 20 seconds until it combines into a crumbly paste.
Add eggs and vanilla, pulsing a few more times, until dough forms and pulls away from the walls.
Transfer the dough to a lightly floured work surface and roll into a disc. Wrap in plastic wrap and chill for at least 1 hour.
Coat a 9x13 baking dish with cooking spray. Line the bottom and sides with parchment paper with some hanging over the edge. These bars are sticky and without the parchment, you'll be scooping it out instead of nicely cutting it.
Preheat oven to 350 degrees and place rack in the lower part of the oven.
Using your fingers, press three-quarters of the chilled dough evenly into the bottom of the prepared pan. I find that thinly slicing the chilled dough and placing together like puzzle pieces works the best. It will be sticky.
Add 1 tablespoon of flour and 1 tablespoon brown sugar to the remaining dough until a dry, crumbly dough forms, this will be the topping, so it doesn't need to be smooth. Set aside.
Spread the dulce de leche evenly over the first layer of dough. Drop the remaining dough over top in crumbles. It will not cover the whole top.
Bake for 25-30 minutes in the lower third of the oven, or until the dulce de leche darkens (it will be bubbly, this is normal) and the crumb topping is lightly browned.
Remove and allow to cool. The filling will set and thicken.
While cooling, sprinkle with flaky sea salt, if desired.
Lift the bars (in one big bar) out of the baking dish and onto a cutting board. Run a sharp knife under hot water and slice into 16 bars. Clean knife and re-wet to get clean slices.
Store bars at room temperature in an airtight container for up to 5 days, although they are best devoured within the first day of baking.
If you've tried this recipe, come back and let us know how it was in the comments or ratings.