# Vital Health Monitor — Android App Design

## Overview
Private, offline wellness tracking app. All data stored locally on device using AsyncStorage. No accounts, no cloud sync.

## Color Palette
- Primary / Accent: `#7c3aed` (violet)
- Background: `#0f172a` (dark navy) / `#f8fafc` (light)
- Surface / Card: `#1e293b` (dark) / `#ffffff` (light)
- Text: `#f1f5f9` (dark) / `#0f172a` (light)
- Muted: `#94a3b8` (dark) / `#64748b` (light)
- OK/Green: `#4ade80` / `#16a34a`
- Warning/Yellow: `#fbbf24` / `#d97706`
- Critical/Red: `#f87171` / `#dc2626`

## Screen List

1. **Welcome / Onboarding** — Patient name + 4-digit PIN setup on first launch; name+PIN verification on subsequent launches
2. **Dashboard** — 8 metric cards (BP, Heart Rate, SpO2, Glucose, Weight, Temperature, AGP, Sleep) + Last 3 readings + Manage Recent list
3. **Blood Pressure Entry** — Systolic, Diastolic, Context, Device/Method, Notes
4. **Heart Rate Entry** — Heart Rate BPM, Context, Device/Method, Notes
5. **SpO2 Entry** — Blood Oxygen %, Heart Rate (optional), Context, Device/Method, Notes
6. **Blood Glucose Entry** — Blood Glucose mg/dL, Context, Device/Method, Notes
7. **Weight Entry** — Weight kg (lb auto-calculated), Context, Device/Method, Notes
8. **Temperature Entry** — Temperature °F (°C auto-calculated), Context, Device/Method, Notes
9. **HRV Entry** — HRV ms, Context, Device/Method, Notes
10. **Sleep Entry** — Sleep Hours, Context, Device/Method, Notes
11. **Recent Readings** — Full list of last 20 readings with edit/delete actions
12. **Settings** — Theme toggle (dark/light), Clear all data, About

## Navigation Structure
- **Tab Bar**: Dashboard | Add Reading | Recent | Settings
- **Stack within "Add Reading"**: Category picker → specific entry screen
- **Dashboard cards** tap → navigate to that category's entry screen

## Key User Flows
1. First launch → Welcome screen (name + PIN setup) → Dashboard
2. Subsequent launch → Welcome screen (name + PIN verify) → Dashboard
3. Dashboard card tap → Entry screen → fill fields → Save → back to Dashboard
4. Dashboard "Recent" list → tap Edit → pre-filled entry screen → Save updates row
5. Dashboard "Recent" list → tap Delete → confirm → row removed
6. AGP card tap → Document picker for LibreView PDF → parse → import rows → Dashboard refreshes

## Data Model (AsyncStorage)
- Key `vhm_profile`: `{ name: string, pin: string }`
- Key `vhm_readings`: `Reading[]` array (JSON)
- Key `vhm_agp_thresholds`: AGP threshold config object
- Key `vhm_theme`: `"dark" | "light"`

## Reading Schema
```ts
{
  id: string;           // uuid
  date: string;         // YYYY-MM-DD
  time: string;         // HH:MM
  patientName: string;
  readingType: string;  // BP | Heart Rate | SpO2 | Glucose | Weight | Temperature | HRV | Sleep
  context: string;
  deviceMethod: string;
  systolicBP?: number;
  diastolicBP?: number;
  heartRate?: number;
  spo2?: number;
  bloodGlucose?: number;
  weightKg?: number;
  weightLb?: number;
  temperatureF?: number;
  temperatureC?: number;
  hrv?: number;
  sleepHours?: number;
  notes: string;
  alertStatus: string;
}
```
