# Flow Master UI/UX Revamp Implementation Plan

> **For agentic workers:** Execute task-by-task on branch `feature/ui-ux-revamp`. Steps use checkbox syntax. Do not commit unless the user asks.

**Goal:** Apply a Refined Ops Shell visual system with light/dark themes across Flow Master without changing business logic or APIs.

**Architecture:** Token-first redesign via CSS variables + Tailwind semantic colors; `next-themes` ThemeProvider; shell/pages migrate from hardcoded `gray-*`/`blue-*` to tokens. Auth, fetches, and role logic untouched.

**Tech Stack:** Next.js 13 App Router, Tailwind, shadcn/Radix, next-themes, Plus Jakarta Sans, Lucide

## Global Constraints

- Branch: `feature/ui-ux-revamp` only
- UI/UX and palette only; ThemeProvider + toggle are the only intentional functional adds
- No API, Prisma, middleware auth, or form business-logic changes
- Accent: deep teal; font: Plus Jakarta Sans; brand: Flow Master
- Light + dark + system themes must work

## File map

| File | Responsibility |
|------|----------------|
| `app/globals.css` | Light/dark tokens, motion utilities |
| `tailwind.config.ts` | success/warning/sidebar color extensions |
| `components/providers/theme-provider.tsx` | next-themes wrapper |
| `components/layout/theme-toggle.tsx` | light→dark→system cycle control |
| `app/layout.tsx` | Font, ThemeProvider, html suppressHydrationWarning |
| `components/layout/sidebar.tsx` | Tokenized nav shell |
| `components/layout/dashboard-layout.tsx` | Header without duplicate title; theme toggle |
| `app/auth/login/page.tsx` | Split login visual (logic unchanged) |
| `components/dashboard/kpi-cards.tsx` | Quiet metric strip |
| `components/dashboard/project-kpi-cards.tsx` | Quiet metric strip |
| `app/dashboard/page.tsx` | Tokenized page chrome |
| High-traffic role/org pages | ClassName token pass only |

---

### Task 1: Design tokens + Tailwind extensions

**Files:**
- Modify: `app/globals.css`
- Modify: `tailwind.config.ts`

- [x] **Step 1:** Replace `:root` / `.dark` HSL variables with teal ops palette; add sidebar + success/warning; add `.animate-page-enter` and `prefers-reduced-motion` rules
- [x] **Step 2:** Extend Tailwind `colors` with `success`, `warning`, `sidebar.*`
- [x] **Step 3:** Verify `npm run dev` still loads

---

### Task 2: Theme infrastructure + typography

**Files:**
- Create: `components/providers/theme-provider.tsx`
- Create: `components/layout/theme-toggle.tsx`
- Modify: `app/layout.tsx`

- [x] **Step 1:** Add ThemeProvider (`attribute="class"`, `defaultTheme="system"`, `enableSystem`)
- [x] **Step 2:** Add ThemeToggle cycling light → dark → system
- [x] **Step 3:** Wire Plus Jakarta Sans + ThemeProvider in root layout; `suppressHydrationWarning` on `<html>`

---

### Task 3: App shell

**Files:**
- Modify: `components/layout/sidebar.tsx`
- Modify: `components/layout/dashboard-layout.tsx`

- [x] **Step 1:** Restyle sidebar with sidebar tokens, Flow Master brand, primary active state (keep nav hrefs + `canAccessHR`)
- [x] **Step 2:** Restyle dashboard layout: `bg-background`, remove hardcoded Dashboard title, add ThemeToggle beside UserMenu

---

### Task 4: Login visual

**Files:**
- Modify: `app/auth/login/page.tsx`

- [x] **Step 1:** Split-panel layout (brand + form); keep `handleSubmit` / role redirects identical; tokenized inputs/alerts

---

### Task 5: Dashboard metrics + home page

**Files:**
- Modify: `components/dashboard/kpi-cards.tsx`
- Modify: `components/dashboard/project-kpi-cards.tsx`
- Modify: `app/dashboard/page.tsx`

- [x] **Step 1:** Replace rainbow KPI cards with card + muted icon treatment
- [x] **Step 2:** Tokenize dashboard page headings/spacing; add page-enter motion class

---

### Task 6: High-traffic page chrome pass

**Files:**
- Modify key pages under `app/dashboard/**` (users, departments, designations, analytics, settings, admin/manager/lead/member as needed) — classNames only

- [x] **Step 1:** Replace obvious `bg-white`/`bg-gray-50`/`text-gray-900`/`blue-*` page chrome with semantic tokens where safe
- [x] **Step 2:** Do not change handlers, filters, or API calls

---

### Task 7: Verification

- [x] **Step 1:** `npx tsc --noEmit` succeeds (full `next build` blocked by environment EPERM)
- [x] **Step 2:** Manually spot-check light/dark on login via browser
- [x] **Step 3:** Confirm stash `wip-before-ui-ux-revamp` untouched on `live`
