Act as a senior frontend engineer. Create a complete, single-page React application called "Twinventory" - a digital twin inventory platform for small businesses.
Tech Stack & Environment:
- React 19: Use Functional Components and Hooks.
- Tailwind CSS: Use via CDN in index.html.
- Icons: lucide-react.
- Charts: recharts.
- AI SDK: @google/genai (for Gemini 3 integration).
- Structure: Flat structure (no src folder), use index.html, index.tsx, App.tsx.
Visual Identity:
- Theme: Clean, professional SaaS look.
- Colors: Background slate-50, Primary indigo-600, Success emerald-500, Warning amber-400, Danger red-500.
- Typography: Inter font family.
- Components: Rounded corners (rounded-xl for cards), subtle borders (border-slate-200), soft shadows.
Core Data Types (types.ts):
- InventoryItem: id, sku, name, category, stockLevel, reorderPoint, price, location, lastRestock, salesVelocity, trend (up/down/stable), history (number array).
- SimulationResult: scenario, prediction, impactScore (0-100), riskLevel (Low/Med/High), suggestedAction.
- ViewState: 'landing' | 'dashboard'.
Data (constants.ts):
- Create MOCK_INVENTORY with at least 10 items across categories like Apparel, Electronics, Home Goods. Ensure a mix of stock levels (Critical, Low, Healthy).
Services (services/geminiService.ts):