Simply be creative with the Power Supplies within your circuit. The supply to the PIC on it's OWN can be 'isolated' from the main supply to the rest of the circuitry through a Diode with a large Capacitor acting as a Reservoir connected on its output. Power-fail detect is taken to a PIC pin from before the Diode. This way the PIC can detect power fail (or Power-OFF) and will continue to function for a few seconds after main power is removed - certainly enough to save your variables into EEPROM. If additional ON time is required, increase the size of the Capacitor.