Short answer: no output VAT to declare, provided each employee's gifts stay within HMRC's £50 business-gifts limit over any 12-month period.
The rule (VAT Notice 700/7, section 2.3) is straightforward: you do not have to account for VAT on gifts of goods to the same person where the total cost of gifts to that person in any 12-month period is £50 or less. The test is on the cost to you of the goods, excluding VAT, and it is per recipient on a rolling 12-month basis. Your £40 hampers are comfortably inside that.
Where it can bite: if you also give the same employee another gift during the year — say a £20 birthday hamper — the two are added together (£60) and the £50 limit is exceeded. At that point you must account for output VAT on the full cost value of the goods, not just the excess, in the return covering the period the gifts were given.
Two practical points for your situation. First, being on the flat rate scheme does not change the position: you cannot reclaim input VAT on day-to-day purchases under the flat rate anyway, and the £50 gift rule still means no output VAT to declare while you are within the limit. Just book the hampers as staff welfare costs as normal. Second, keep a simple log of what you gave, to whom, and when — it makes the 12-month test easy to evidence if HMRC ever asks.
One common confusion to avoid: this £50 VAT rule is separate from the £50 trivial benefits exemption for income tax purposes — same number, different rules, and one does not guarantee the other. And note this applies to gifts of goods: cash bonuses are taxed through payroll, and vouchers have their own VAT treatment.
With one £40 hamper per employee each Christmas, you are well within the limit — no output VAT to declare. Enjoy the festive season!