# Flow Master UI/UX Revamp Design

**Branch:** `feature/ui-ux-revamp`  
**Date:** 2026-08-06  
**Status:** Approved direction — awaiting spec review  

## Goal

Deliver a modern, clean, premium admin experience with consistent **Light** and **Dark** modes. Revamp is limited to the visual/UI layer. Business logic, APIs, auth flows, and workflows stay unchanged.

## Product context

Flow Master is a Next.js ops/admin app for:

- Role-based dashboards (Super Admin → Member)
- User management and org structure (departments, designations)
- Performance KPIs and report cards
- Projects / WBS
- Analytics

Primary users are managers, leads, and admins who work in dense tables and metric views daily.

## Design direction (chosen)

**Refined Ops Shell** — Linear density + Mercury admin tables + Mixpanel/June metric clarity + 15Five performance readability + Profound-style auth presence.

| Rejected | Why |
|----------|-----|
| Warm people-ops (15Five/Charma soft) | Too soft for project/KPI power use |
| Dark-first analytics | Makes light mode an afterthought |

### North-star Mobbin references

- Shell / density: Linear issues & project views
- Admin tables: Mercury Users, Asana Admin Users
- Metrics: Mixpanel, June
- Performance: 15Five, Workable Outcomes, Deel progress tables
- Auth: Profound split login, WorkOS focused login

## Non-goals

- No API, Prisma, or auth logic changes
- No new product features (command palette, kanban, etc.)
- No route or permission model changes
- No rewriting form validation or data-fetch workflows
- Functional changes only when required for theming (e.g. `ThemeProvider` + toggle)

## Scope

### In scope

1. Design tokens (light + dark CSS variables)
2. Typography (replace Inter with a distinctive but readable pairing)
3. App shell: sidebar, header, main canvas
4. Login page visual redesign
5. Dashboard / KPI card visual pass
6. Users, departments, designations table chrome
7. Role dashboard pages visual consistency
8. Shared UI primitives polish (button, card, badge, input, table) via tokens
9. Light/Dark mode via `next-themes` (already a dependency)
10. Light motion: page enter fade, nav active transition

### Out of scope

- Backend, middleware auth rules, role redirects
- Performance scoring formulas, Excel import logic
- New pages or IA restructuring beyond nav visual grouping
- Mobile-native redesign (keep responsive; no separate mobile product)

## Architecture

### Token system

Update `app/globals.css` HSL CSS variables for `:root` and `.dark`.

| Token | Role |
|-------|------|
| `--background` / `--foreground` | App canvas and body text |
| `--card` / `--card-foreground` | Elevated surfaces |
| `--muted` / `--muted-foreground` | Secondary surfaces / captions |
| `--border` / `--input` / `--ring` | Borders and focus |
| `--primary` / `--primary-foreground` | Teal accent CTAs and active nav |
| `--secondary` | Quiet fills |
| `--destructive` | Errors / danger |
| `--success` / `--warning` | Status semantics (extended in `tailwind.config.ts`) |
| `--chart-1`…`--chart-5` | Chart series (theme-aware) |
| `--sidebar` / `--sidebar-foreground` / `--sidebar-muted` / `--sidebar-border` / `--sidebar-accent` | Shell-specific surfaces |
| `--radius` | `0.5625rem` (9px) — soft, not pill-heavy |

**Accent:** deep teal — light `174 55% 32%`, dark `174 50% 45%`. Avoid purple-on-white and blue-indigo login gradients.

**Surfaces:** background < card < muted hover. Borders low-contrast. No heavy multi-layer shadows; prefer hairline borders + subtle elevation.

### Theming infrastructure (minimal functional addition)

- Add `ThemeProvider` wrapping the app (`next-themes`, `attribute="class"`, `defaultTheme="system"`, `enableSystem`)
- Header control: sun/moon icon toggle that cycles **light → dark → system**
- Set `suppressHydrationWarning` on `<html>` for class theme
- Sonner already imports `useTheme` — wire provider so it works

No persistence beyond `next-themes` localStorage default behavior.

### Typography

- **UI font:** Plus Jakarta Sans (Google font) for all UI — not Inter
- Brand/login wordmark: same family, semibold/bold, slight tracking tighten (`tracking-tight`)
- Scale: page title (`text-2xl`/`text-3xl` semibold), section (`text-lg` semibold), body (`text-sm`), caption (`text-xs` muted)

### App shell

**Sidebar**

- Collapsible (keep existing behavior)
- Quiet active state: `primary/10` background + `primary` text/icon (light); similar in dark
- Grouped sections: Main, Organisation (role-gated as today), account/footer user block
- Brand mark: **Flow Master** (replace “AdminPanel” label in sidebar)
- No rainbow icon colors

**Header**

- Single slim bar: left spacer or contextual title slot (empty by default — pages own their H1), theme toggle, user menu
- Remove the hardcoded static “Dashboard” header title from `dashboard-layout.tsx`

**Main**

- `bg-background`, content padding consistent (`p-6` / `p-8`)
- Prefer token classes (`bg-card`, `border-border`, `text-muted-foreground`) over hardcoded `gray-*` / `blue-*`

### Page-level visual patterns

**Login**

- Split layout on desktop: brand panel (subtle pattern/gradient using primary tokens) + form panel
- Mobile: stacked, form first
- Same credentials flow; visual only

**Dashboard**

- Metric strip: fewer competing colors; icon mono + one accent
- Section headers with muted subtitles
- Charts inherit theme chart tokens

**Users / org tables**

- Mercury-style: avatar + name/email, status pills, filter row, primary CTA
- Replace ad-hoc color utilities with semantic badges where practical without changing badge meaning

**Performance / role dashboards**

- Same shell + token pass; keep existing widgets and data wiring
- Score/status colors stay semantic (green/amber/red), tuned for both themes

**Projects**

- Visual token pass only; no WBS logic changes

### Motion

- Page content: short opacity/translate fade (~150–200ms)
- Sidebar active / collapse: existing duration or slight polish
- Respect `prefers-reduced-motion`

## Components & data flow

- **Components touched:** `globals.css`, root layout, theme provider, sidebar, dashboard layout, login page, KPI cards, high-traffic dashboard pages, shared `components/ui/*` only if classNames need token alignment
- **Data flow:** unchanged — pages keep existing hooks, fetches, and session usage
- **Error handling:** toast/alert visuals follow theme tokens; copy and triggers unchanged

## Consistency rules for implementation

1. Prefer semantic tokens over raw Tailwind palette colors
2. One accent for interactive primary actions
3. Status color only for status, not decoration
4. Light and dark must both be checked for contrast on text, borders, and charts
5. Do not alter `onSubmit`, API routes, Prisma, or middleware except if a file must import the theme provider higher in the tree

## Testing / verification

- Manual: login → each role landing page → users → departments → designations → analytics → settings → project detail
- Toggle light/dark on shell, login, tables, charts, modals
- Confirm create/edit/delete/filter still work (no logic regressions)
- `npm run build` succeeds

## Rollout

- All work on `feature/ui-ux-revamp` only
- Do not merge to `live` until reviewed
- Prior WIP on `live` remains in stash `wip-before-ui-ux-revamp`

## Success criteria

- App feels cohesive and premium in both themes
- No broken flows or API behavior
- Diff is overwhelmingly CSS/className/layout chrome
- Theme toggle works and persists across refresh
