On the Subject of Puzzle Panels

So you're telling me I went through all the trouble to unlock this, only to have to think?

A Puzzle Panel module has a 4×4 grid of bright and dark colored sand panels, a number display, and an LED.

The module will initially show a pattern of bright and dark panels. To start, click any square to move to a blank screen.

Clicking any panel will flip that panel and all orthogonally and diagonally adjacent panels.

You must flip a certain set of squares in such a way that the panels are equal to the initial pattern. The number display at the right shows you the maximum number of panels you may flip to get to the pattern.

The module will reset if you run out of flips, but will not strike.

After completing the first puzzle, a second pattern will appear, which will require even more flips. Successfuly completing the second puzzle will disarm the module.

A blue LED indicates that you are on the first stage. A yellow LED indicates that you are on the second stage. A green LED indicates that the module has been solved.