<?php
/**
 * Restore UI Unify v1.1.1 backup files.
 * Run: php restore-ui-unify.php
 */
$bakDir = __DIR__ . '/.bak-ui-unify-20260606-164108';
$targets = [
    'dashboard.php'        => __DIR__ . '/admin/views/dashboard.php',
    'settings.php'         => __DIR__ . '/admin/views/settings.php',
    'ingredients-list.php' => __DIR__ . '/admin/views/ingredients-list.php',
    'recipes-list.php'     => __DIR__ . '/admin/views/recipes-list.php',
    'suppliers-list.php'   => __DIR__ . '/admin/views/suppliers-list.php',
    'areas-list.php'       => __DIR__ . '/admin/views/areas-list.php',
    'users-list.php'       => __DIR__ . '/admin/views/users-list.php',
    'inventory-ae.php'     => __DIR__ . '/admin/views/inventory-ae.php',
    'admin-common.css'     => __DIR__ . '/admin/assets/admin-common.css',
];
echo "Restoring UI Unify v1.1.1 backups...\n";
foreach ($targets as $file => $dest) {
    $src = $bakDir . '/' . $file;
    if (!file_exists($src)) {
        echo "  MISSING: $src\n";
        continue;
    }
    if (!copy($src, $dest)) {
        echo "  FAILED: $dest\n";
        exit(1);
    }
    echo "  OK: $dest\n";
}
echo "Restore complete.\n";
