You did everything right. You kept your income moderate, sold a few appreciated stocks, and assumed most of your profits would fall into the 0% capital gains category. Then you filed, and your capital gains tax was an unpleasant surprise. Capital gains and qualified dividends can quietly push you into a higher capital gains category as they figure on top of taxable income in your return.
