== Version 0.4.3 ==

* **Light Theme** — New admin-theme.css with full light-mode overrides for all RC pages. Theme dropdown in Settings > Display (Light/Dark). rc_theme WP option. Body class switching via admin_body_class filter.
* **Iframe theme support** — Theme choice (rc_theme) passed as URL parameter to Suppliers/Areas/Users iframe modals for consistent light/dark theming.
* **Button hover consistency** — All RC buttons (print, filter, inventory, settings) now darken properly on hover in light mode.
* **Recipe edit panel fix** — Panel backgrounds, labour cards, and recipe lines table now light-themed.
* **Ingredient modal fix** — Body text and label colors corrected for light theme.
* **Menu types + Column Reference modals** — Table striping now light-theme aware.
* **Button hover polish** — Icing on the cake.

== Version 0.4.2 ==

* **Dark theme** — Full dark theme CSS for all RC admin pages (Dashboard, Ingredients, Recipes, Inventory, Settings, modals).
* **Display Settings modal** — New modal on Settings page for Nutrition show/hide toggle.
* **Plugin details + Changelog modals** — Viewable from Settings page header.
* **Print/Order modal** — Per-supplier print buttons, supplier-grouped layout, 11px gap, 3px divider.
* **Inventory WE improvements** — View/Prep List toggle, collapsible area headers, Save & Close button, Print Prep List.
* **Recipe filter bar** — Menu Type filter added. Checkbox toggle for Show Inactive on Ingredients.
* **Media library support** — Logo upload via WP media library in restaurant info modal.
* **Admin notice styling** — Custom confirm/alert dialogs dark-themed.
* **Bandaid fix** — Radio button visibility on dark backgrounds in Display Settings modal.

== Version 0.4.1 ==

* **Internal error handling system** — `RC_Exception` class with typed error codes (DB_ERROR, VALIDATION, PERMISSION, etc.) and context data. `RC_Notice` transient-based admin notices replace all `wp_die()` calls and `rc_msg`/`rc_type` URL params. All repositories now check `$wpdb->last_error` and throw on DB failure.
* **try/catch on all handlers** — Every admin-post and AJAX handler wrapped in try/catch. Exceptions from repositories are caught and displayed as user-friendly notices.
* **Custom confirm/alert dialogs** — `rcConfirm()` replaces all browser-native `confirm()` and `alert()` calls with RC-styled DOM modals. Applied to ingredient delete, recipe delete, supplier delete, recipe status toggle.
* **Missing CSS created** — `admin-ingredient-modal.css` with modal dialog styles for the ingredient modal (was missing, causing 404). `.rc-modal-cancel` styled globally.
* **AJAX error standardization** — All `wp_send_json_error()` calls now include descriptive `message` arrays for user feedback.
* **Menu Types (Recipe Sub-categories)** — New `menu_types` DB table with 6 seed categories (Liquor, Appetizers, Main Courses, Beverages, Desserts, Open Food). `menu_type_id` column on recipes. Dropdown on recipe edit page. Column 2 on recipe list. Manage Menu Types modal on Settings page.
* **Supplier modal fixed** — Replaced `alert()` and `confirm()` with inline error display and `rcConfirm()` custom dialog.

== Version 0.3.7 ==

* **Missing AJAX handlers fixed** — `ajax_search_ingredients` and `ajax_check_recipe_name` were registered but body missing, causing 500 errors on recipe autocomplete and save. Both restored.
* **ea unit label fix** — weight label shows "g" instead of "ea" when reference unit is "each" (weight is always grams).
* **Recipe portion weight** — total weight per portion calculated and displayed under Nutrition/portion on recipe edit and print pages.
* **Show Inactive on ingredients** — added `is_active` column, Show Inactive checkbox filter, red row highlighting for inactive ingredients.
* **Suppliers/Areas to Settings** — Suppliers and Areas submenus hidden from sidebar, accessible via Management card on Settings page alongside My Restaurant Info and Manage Users.
* **Standardized button colors** — plain `.button` for section actions, `button-primary` only for actual saves.
* **Full nutrition grid** — Added Vit A, Vit C, Potassium, Calcium, Iron fields to ingredient modal. PHP handler patched to save them.
* **Nutrition inaccuracy warning** — red bold warning on recipe edit and print when ingredients are missing nutrition data.
* **Permissions configured** — `opencode.json` external_directory allowlist for common paths.
* **autonomy framework** — safeguards DB, audit_log, system_status (pause autonomy), hal_changelog, SMTP relay with Postfix mynetworks, IMAP inbox checking, email rules codified.

== Version 0.3.6 ==

* **Delete ingredient functionality** — red Delete button on Ingredient Details modal (hidden on create, shown on edit), AJAX handler, repository method.
* **Print/Order modal overhaul** — combined Print + Order into single action, per-supplier "Print [Supplier]" and "Email [Supplier]" buttons, "Print All" / "Print Not Ordered" / "Close" footer, items grouped by supplier in print view with 11px gap and 3px divider line.
* **Areas listing** — Sort Order moved to first column (80px narrow). "Edit Areas" button on Inventory page opens Areas page in modal iframe.
* **Removed (CAD) labels** — all "(CAD)" and "CAD" stripped from file labels and stored DB text.
* **Cost formatting** — recipe JS recalc now uses toFixed(2) for consistent 2-decimal cost display.
* **Ingredients table** — explicit colgroup with fixed widths, center-aligned Weight/Food cost/Sub Recipe columns.
* **Renamed Type → Product Type** — ingredient list column, filter, and modal labels.
* **Renamed Labour → Prep** — "Labour item" → "Prep item", "Labour/portion" → "Prep/portion", etc.
* **Removed Labour Qty** — Qty field removed from Prep cards; calculation uses portions directly. Prep cards default to no rows on new recipes.
* **Renamed Size label → Product Size** — field moved into Costing section, placeholder "ie. 355ml".
* **Renamed Business Name → Supplier** — suppliers list header, modal label, and error message.

== Version 0.3.5 ==

* **Defense-in-depth security hardening**
  * Fixed `ajax_get_ingredient()` — method body was accidentally overwritten with food-type handler code, causing "Name is required" error on ingredient edit.
  * Added capability guard checks (`wp_die` on unauthorized) to all 12 `render_*()` methods in `class-rc-admin.php` so the plugin doesn't rely solely on WP menu routing for access control.
  * Verified RC_User and RC_Manager role capabilities are correctly assigned and enforced.

== Version 0.3.3 ==

* **Fresh v0.3.3 baseline**
  * Forked from v0.3.2.
  * Updated zip naming: `restaurant-costing-v[x.x.x].zip`.
  * build.ps1 now auto-detects version from plugin header.

== Version 0.3.2 ==

* **Modal CSS fixes + session wrap-up**
  * Added missing inline positioning CSS for Restaurant Info modal (settings page) and Supplier modal — both were falling back to inline display instead of fixed overlay.
  * Fixed undefined `$on_inventory` / `$on_areas` variables in `enqueue_assets()` causing PHP notices and missing inventory CSS/JS.
  * Removed duplicate changelog block left from mid-task crash in MAMP settings.php.
  * Git init, commit, push for v0.3.2 baseline.

* **Recipes List: Sub-recipe column**
  * New `is_ingredient` column on `wp_rc_recipes` (DB v9, backfilled from ingredients table)
  * Sub-recipe column with ☑/☐ checkbox visual in recipes list
  * Filter dropdown: All / Menu items only / Sub-recipes only
  * Sortable column (ascending/descending)

* **Recipe Photo via WP Media Manager**
  * Replaced broken file-upload with wp.media() (WP API since 3.5)
  * Set Photo / Remove Photo buttons with inline preview
  * `rc_menu_item` taxonomy registered for attachment media filtering
  * Print image block uncommented (was hidden from broken file-upload days)
  * Live print_image toggle via AJAX on checkbox change (no save needed)
  * Fixed: checkbox was missing id="rc-print-image" preventing JS delegation

* **NEW: Inventory Management Module**
  * `rc_areas`, `rc_inventories`, `rc_inventory_items` tables
  * DB v7: `min_level` + `area` columns on `rc_ingredients`
  * DB v7: `email_order` column on `rc_suppliers`
  * Areas submenu with add/edit/delete/move-up/move-down
  * Working Environment (WE): mobile-optimized inventory entry
    - Ingredients sorted by Area then alphabetically
    - Min Level column, Order Qty entry, Add One Time Item
    - Auto-named "Inventory [date]" on new
  * Administrative Environment (AE): inventory list dashboard
    - Filterable, sortable, striped, most-recent-first default
    - Actions: Edit / Delete / Print / Order
    - "Do Not Print Empty Rows" toggle, Print grouped by Area
    - 2-column layout, "Local Brick and Mortar" label
    - Centered title + Print/Close buttons
  * Order modal with supplier-grouped collapsible list
    - "Order by Email" button per supplier (outside collapsible)
    - Custom resend prompt: "NO, Don't send" / "Yes, Send Again"
    - Emailed items flagged + highlighted green
    - "Print Remaining" prints unemailed items only
    - "Brick and Mortar" section for items without supplier
    - Supplier "Email Orders" checkbox controls button visibility
  * DB v8: ordered_flag → emailed column rename
  * Areas list with move up/down

== Version 0.3.1 ==

* **Recipe Active/Inactive Toggle**
  * is_active column, DB upgrade to v6.
  * List: "Show Inactive" filter, red inactive rows.
  * Edit page: red "Set Inactive" / "Reactivate" button.
  * Reactivation enforces unique active name.

* **Security Fix: Backup/Restore Hardening**
  * handle_backup(): replaced `$wpdb->_escape()` with `$wpdb->prepare()`.
  * handle_restore(): allows only DROP/CREATE/INSERT on rc_* tables.
  * handle_restore(): automatic prefix rewriting for cross-site transfer.

* **New Tool: Google Sheets Recipe Import**
  * import-recipes.php — fetches 26 sauce recipes from Sheet tabs.
  * Overwrites existing recipes; logs unmatched ingredients.
  * Must be deleted after use (single-purpose file).

* **Ingredient Modal: Sub-Recipe Read-Only View**
  * Sub-recipes open read-only (disabled fields, info banner).
  * "Edit Source Recipe →" button navigates to recipe editor.
  * `ajax_get_ingredient()` returns `recipe_id` when `is_recipe=1`.

* **Recipes List**
  * Bordered filter bar, rows-per-page, pagination.
  * Actions: Edit | Print (new tab). Removed toggle link.
  * Sortable: Recipe name only. Portions/Menu Price plain text.

* **Food Types**
  * New `rc_food_types` table seeded from existing types.
  * Ingredient Type field: DB dropdown with inline "+" add.
  * Importer auto-registers types; filter uses table.

* **Suppliers**
  * New `rc_suppliers` table with full CRUD submenu.
  * Supplier dropdown + inline add in ingredient modal.
  * Filter, sort, pagination, CSV export on list.
  * Importer auto-registers new suppliers.

* **Miscellaneous**
  * "Copy to New Ingredient" button in ingredient modal.
  * Export Sub-Recipes checkbox (default off) on Settings export.
  * Duplicate ingredient name check on create + edit.
  * "View Changelog" button + modal on Settings page.
  * Plugin version bumped to 0.3.1, `readme.txt` stable tag.

== Version 0.2.2 ==

* **Settings Page**
    * Added Settings submenu under Restaurant Costing.
    * Moved Re-import FoodMaster.csv from Ingredients to Settings under "Ingredients Data".
    * Added CSV file upload: replace foodmaster.csv directly from the admin.
    * CSV column reference table with Excel-style labels (A–X), descriptions, and examples.
    * Option to skip existing ingredients on re-import (only add new rows).
    * Added Export CSV button to Settings page.
* **Database Fixes**
    * Supplier column now correctly writes text values instead of zeros.
    * Restored nutrition columns (VitA, VitC, Potassium, Calcium, Iron, Ingredients text).
    * Removed stale column drops from DB upgrade routine.
    * Upsert logic handles columns conditionally; importer never overwrites recipe-managed flags.
* **Ingredient Details Modal**
    * Added all FoodMaster columns: supplier, package size, package cost, full nutrition grid.
    * Calculate button: computes FoodCost from Package Cost ÷ Package Size × Weight with missing-field warnings.
    * All fields populated on edit and saved correctly through AJAX.
* **Ingredients Page UX**
    * Filters combined into a single bordered box with placeholder text and right-justified controls.
    * Sort/filter now preserves rows-per-page setting.
    * Alternating row colors for readability.
    * Subtitle shows "Showing X of Y" filtered vs. total count.
    * Export CSV moved to bottom-right below the table.
* **Recipe Builder Overhaul**
    * Menu Price moved to right column above Summary.
    * Portions label changed to "Recipe Makes (Portions)".
    * Scale Factor replaced with "Scale Recipe" in a bordered box alongside "Print Scaled Recipe" checkbox.
    * Scale removed from base costing: Summary and Nutrition calculated as sum of ingredients ÷ portions only.
    * Scale applied only when printing with checkbox enabled.
    * Prep Labour moved to right column below Nutrition, redesigned as stacked cards with header bars and remove buttons.
    * Labour Rate moved into the Prep Labour panel.
    * Scale preset buttons removed.
    * "Add as ingredient" checkbox beside Recipe Name: mirrors recipe cost/weight to ingredients table as a dynamic ingredient.
    * Ingredient mirroring handles creates, updates, renames, and deletes automatically.
    * Print page "Edit Recipe" replaced with "Close" button.
    * Scaled/unscaled print logic with highlighted banner on scaled output.
* **Costing & Units**
    * Fixed ea (each) unit costing: cost = food_cost × quantity / portions.
    * Nutrition for ea units reflects full reference amount per unit.
    * All number inputs standardized to 2 decimal places.
* **Backup & Restore**
    * Download full database backup as compressed .sql.gz file from Settings page.
    * Restore backup by uploading .sql.gz file — drops and recreates all tables.
    * Backup includes all recipe, ingredient, and POS data tables.
* **Miscellaneous**
    * New ingredient line auto-focuses cursor for immediate typing.
    * Labour card remove button works alongside table-row remove button.
* **Today's Fixes**
    * Settings page redesigned: Backup/Restore side-by-side, Upload/Import/Export in 3-column grid.
    * Column reference table moved to modal with template CSV download button.
    * "View Plug-in Details" button opens readme in a modal.
    * Print recipe now uses Roboto font loaded from local TTF files; font size reduced by 0.8em.
    * "Edit" button replaced with "Copy to New Recipe" — duplicates recipe without name so user must provide one.
    * Duplicate recipe name check added on save; redirects with error "Recipe Names must be unique".
    * Menu icon changed from carrot to dashicons-food (plate with utensils).

== Version 0.1.2 (BETA) ==

* **Ingredient Management Enhancements**
    * Added full Edit capability for ingredients via an interactive modal.
    * Implemented dynamic sorting for all main ingredient columns.
    * Added advanced column-specific filtering (Name, Type, Supplier, and Cost).
    * Introduced pagination with custom record limits (25, 50, 100, or All).
* **Recipe Builder UI Refinements**
    * Redesigned "Prep Labour" module with a stacked layout for better readability.
    * Improved visual consistency with standardized red "Remove" buttons.
    * Optimized layout by relocating Menu Price and Labour Rate to the Summary column.
    * Simplified interface by removing scale preset buttons.
* **Stability & Compatibility**
    * Full compatibility audit for PHP 8.2.31.
    * Resolved critical errors related to admin screen initialization.

== Phase 0.2.0 ==

* Recipe builder (metric g/ml, imperial display, density per line)
* Scale presets, labour lines, method, menu price
* Live cost, food cost %, gross margin, nutrition per portion
* Print recipe view

== Phase 0.1.0 ==

* Custom MySQL tables
* FoodMaster.csv import on first activation
* Ingredients list, re-import, CSV export
* Name matcher foundation (POS aliases with category/group)
* Imperial converter (density on recipe line only, not in DB)
