Consumer surplus before quota: red plus green plus purple plus light blue plus dark blue

Consumer surplus after quota: red

(Domestic) producer surplus before quota: yellow

(Domestic) Producer surplus after tariff: yellow plus green

Foreign producers who are able to sell to us get the light blue region as additional producer surplus (because they can sell at a higher price).

Government gain from quota: none.  Government never gets anything from a simple quota.

Why there is a net national loss: the nation consists of consumers plus government plus domestic producers.

The green area just passes from consumers to domestic producers, but is not lost by the nation.  The light blue area  passes from consumers to foreign producers, and is lost by the nation.  The purple and dark blue areas are lost by consumers and not gained by anyone else, and there are no other gains anywhere else.  Hence there is a net national loss, larger than in the tariff case.

(You may notice that this graph looks just like the graph for the tariff problem.  It's the same picture -- the only difference is that the light blue area goes to the lucky foreign producers who get in under the quota, instead of to government.  This shows that if you just want to protect a domestic industry, you cn do so with either a tariff or a quota.)