{
  "schema_version": "visual-recipe-v0.5",
  "module_id": "pantry",
  "name": "My Cupboard (Pantry Inventory)",
  "source_nav_id": "cupboard",
  "user_facing_name": "My Cupboard",
  "purpose": "Manage what's in your kitchen. Two tabs: My Stock (current items) + Browse All (ingredient database).",
  "behaviour": {
    "sub_tabs": [
      {"id": "stock", "label": "📦 My Stock", "purpose": "current inventory"},
      {"id": "browse", "label": "🔍 Browse All", "purpose": "500+ ingredient database"}
    ],
    "filters": {
      "category": ["Produce", "Dairy", "Meat", "Bakery", "Frozen", "Pantry", "Beverages", "Pet Supplies", "Household", "Other"],
      "stock_status": ["All Stock", "In Stock", "Running Low", "Out of Stock"],
      "expiring_soon": "toggle filter (red, shows count badge)"
    },
    "natural_language_input": "e.g., '2 eggs, milk' (commandInput field)",
    "search": "fuzzy on ingredient name"
  },
  "data": {
    "inventory": "pantry_inventory, pantry_inventory_v2 (localStorage)",
    "custom_ingredients": "pantry_custom_ingredients (localStorage)",
    "ingredient_database": "pantry_custom_ingredientDB (localStorage)",
    "custom_categories": "pantry_customCategories (localStorage)",
    "category_order": "pantry_categoryOrder (localStorage)",
    "dislikes": "pantry_dislikes_v3, pantry_ingredientDislikes (localStorage)",
    "restrictions": "pantry_ingredientRestrictions (localStorage)",
    "view_mode": "ingredientViewMode (localStorage)",
    "unit_prefs": "pantry_unitPrefs (localStorage)",
    "recently_finished": "pantry_recentlyFinished (localStorage)",
    "price_cache": "pantry_priceCache (localStorage)"
  },
  "key_functions": [
    "processCommandToCupboard",
    "addIngredientToCupboard",
    "addCupboardItemToList",
    "showSuggestions",
    "renderInventory",
    "renderBrowseIngredientsDB",
    "showCupboardTab",
    "showBrowseSuggestions",
    "applyBrowseFilters",
    "applyIngFilters",
    "setBrowseIngSmartFilter",
    "toggleExpiringFilter",
    "adjustIngredientDBQty"
  ],
  "files": {
    "html": "app/index.html#cupboard-tab",
    "css": "app/styles.css (cupboard + browse + filter classes)",
    "js": "app/modules/pantry.js"
  },
  "tests": [
    "Stock tab shows current inventory",
    "Browse tab shows 500+ ingredients",
    "Add via natural language works ('2 eggs')",
    "Category filter narrows results",
    "Expiring badge shows correct count",
    "Search filters by name (case-insensitive)"
  ]
}