# Projectify Sales — Design Documentation

Designer-facing reference for the **current** product UI.

**Stack:** Laravel 12 API (Sanctum) + Next.js 16 App Router + React 19 + Tailwind 4 + custom CSS + Lucide icons  
**Live design source of truth:** `frontend/src/app/globals.css` + `frontend/src/components/AppShell.tsx`

---

## 1. Product snapshot

**Projectify Sales** is a Lead CRM rebuilt from the legacy “hi-leads” system. It supports real-estate-style sales ops:

- Capture and manage leads
- Allocate leads to salespeople / lead bank
- Track attendance and tasks (follow-up, site visit, appointment)
- Approve / review activities
- Convert to prospects
- Run role-scoped reports and analytics

**Brand direction:** navy shell + blue actions — dark navy sidebar, light slate workspace, blue primary CTAs. Fraunces display + Source Sans 3 body. Soft navy/sky page wash (not flat white). Icons via Lucide. No third-party component library beyond icons.

**Local URLs:** Frontend `http://localhost:3000` · API `http://127.0.0.1:8000/api`

---

## 2. Users & roles

| Role slug | Lead visibility | Typical nav |
|---|---|---|
| `super-admin` | All leads | Full nav |
| `sales-head` | Multi-branch / headed branches | Pipeline + Activities + Insights + Admin |
| `branch-head` | Own `branch_id` | Pipeline + Activities + Insights + Admin |
| `team-leader` | Self + reporting tree | Pipeline + Activities + Insights |
| `sales-person` | Own attended leads | Pipeline + Activities + Insights (fewer team widgets) |

Optional per-user module permissions can lock the sidebar. Super-admin always sees everything.

**Demo logins** (password `password`): `admin@` / `head@` / `bh@` / `tl@` / `sp@` `@projectify.local`

---

## 3. Information architecture

### Navigation (dark navy sidebar + Lucide icons)

```
Dashboard                         LayoutDashboard
├── Pipeline
│   ├── All Leads                 Users
│   ├── Add Lead                  UserPlus
│   ├── Lead Bank                 Landmark
│   ├── Unattended                UserX
│   └── Allocation                GitBranchPlus
├── Activities
│   ├── Tasks                     ListTodo
│   ├── Activity Approval         BadgeCheck
│   ├── Activity Review           ClipboardCheck
│   └── Lead Masters              Contact
├── Insights
│   ├── Reports Hub               BarChart3
│   ├── Lead Prospect Report      FileSpreadsheet
│   ├── Lead Analytics            LineChart
│   ├── Campaigns                 Megaphone
│   └── Campaign Report           PieChart
└── Admin
    ├── Users                     Shield
    ├── Masters                   Database
    ├── Sources                   Radio
    └── Projects                  Building2
```

Brand mark: blue “P” tile + **Projectify** / `Sales · Lead CRM` on dark navy. User card at bottom with Sign out.

### Route inventory

| Route | Screen |
|---|---|
| `/` | Redirect → `/dashboard` |
| `/login` | Sign-in (no shell) |
| `/dashboard` | Home KPIs & queues |
| `/leads`, `/leads/new`, `/leads/[id]` | Leads list / create / detail |
| `/lead-bank`, `/unattended`, `/allocation` | Queues & allocation |
| `/tasks`, `/activity-approval`, `/activity-review` | Activities |
| `/lead-masters`, `/lead-masters/[id]` | Lead masters |
| `/reports`, `/reports/[slug]` | Reports |
| `/lead-prospect-report`, `/analytics` | Prospects & funnel |
| `/campaigns`, `/campaigns/report` | Campaigns |
| `/users`… | User admin + permissions |
| `/masters`, `/sources`, `/projects` | Reference masters |

### IA diagram

```mermaid
flowchart LR
  Login["/login"] --> Dash["/dashboard"]
  Dash --> Pipeline["Pipeline"]
  Dash --> Activities["Activities"]
  Dash --> Insights["Insights"]
  Dash --> Admin["Admin"]
  Pipeline --> AllLeads["/leads"]
  Pipeline --> Alloc["/allocation"]
  Activities --> Tasks["/tasks"]
  Activities --> ActAppr["/activity-approval"]
  Insights --> Hub["/reports"]
  Insights --> Prospect["/lead-prospect-report"]
  Admin --> Users["/users"]
  Admin --> Masters["/masters"]
```

---

## 4. Core product flows

```mermaid
flowchart TD
  Capture["Lead capture"] --> Bank["Lead bank / unallocated"]
  Bank --> Alloc["Allocation"]
  Alloc --> Attend["Attended by salesperson"]
  Attend --> Tasks["Tasks"]
  Tasks --> Complete["Mark complete"]
  Complete --> Approval["Activity approval"]
  Approval --> Prospect["Lead prospect"]
  Attend --> Reports["Reports and analytics"]
  Prospect --> Reports
```

---

## 5. Design tokens

Defined on `:root` in `frontend/src/app/globals.css`.

### Color

| Token | Value | Use |
|---|---|---|
| `--brand` | `#1e3a5f` | Navy primary / brand text |
| `--brand-dark` | `#0f172a` | Titles, ink emphasis |
| `--brand-mid` | `#2563eb` | Actions, links, active accents |
| `--brand-soft` | `#dbeafe` | Soft fills, selection |
| `--brand-glow` | `rgba(37, 99, 235, 0.28)` | Button shadows |
| `--sidebar` | `#0f172a` | Dark sidebar base |
| `--sidebar-mid` | `#1e293b` | Sidebar gradient mid |
| `--sidebar-text` | `#cbd5e1` | Nav labels |
| `--sidebar-muted` | `#94a3b8` | Group labels / meta |
| `--ink` | `#0f172a` | Body text |
| `--muted` | `#64748b` | Secondary text |
| `--surface` | `#f1f5f9` | Subtle fills |
| `--card` | `#ffffff` | Cards |
| `--danger` / `--success` / `--warning` / `--info` | Semantic status |

### Typography

| Token | Family | Use |
|---|---|---|
| `--font-display` | Fraunces | Brand, page titles |
| `--font-body` | Source Sans 3 | UI, forms, tables |

### Shape & motion

`--radius` 14px · `--radius-sm` 10px · button radius 10px · soft slate shadows · `rise-in` / `fade-in` enter motions · `prefers-reduced-motion` respected.

### Page atmosphere

Fixed navy/sky radial washes over slate linear background (`#f8fafc` → `#eef2f7`).

---

## 6. UI kit & patterns

| Class | Role |
|---|---|
| `.ps-card` | White card; hover lifts |
| `.ps-btn-primary` / `.ps-btn-ghost` | Blue gradient CTA / outline |
| `.ps-input`, `.ps-select` | Controls with blue focus ring |
| `.ps-table` | Sticky header tables |
| `.ps-badge-*` | Status chips |
| `.ps-page-header` / `.ps-page-title` | Page chrome |
| `.ps-form-*` | Sectioned forms |
| `.ps-report-card` | Reports hub cards |
| `.ps-shell` / `.ps-sidebar` / `.ps-nav-link` | Dark navy chrome |
| `.ps-nav-icon` | Lucide icon slot in nav |

**Shared React components:** `AppShell`, `MultiSelect`

### Shell
- `268px` dark navy sticky sidebar
- Active nav: blue gradient pill + white label + icon
- User card: translucent dark panel + ghost Sign out

### Login
- Split navy brand panel | form card
- Lucide feature icons (ShieldCheck, Gauge, BarChart3)

### Dashboard / Allocation
- KPI tiles with accent top edge
- Allocation: filters + table + sticky green allocate rail

---

## 7. Layout rules

Authenticated template:

```
AppShell
  └─ .ps-page.rise
       ├─ .ps-page-header
       └─ .ps-card / .ps-table / feature grids
```

| Width | Behavior |
|---|---|
| ≤1100px | Dash grid stacks; report grid → 2 cols |
| ≤960px | Shell stacks; login stacks; alloc rail static |
| ≤720px | Form grid → 1 col |
| ≤640px | Tiles → 2 cols; report grid → 1 col |

---

## 8. Screen briefs

- **Login** — navy brand story + sign-in form
- **Dashboard** — greeting, activity KPIs, queues, performance, DWE, lead bank, project types
- **Pipeline pages** — filterable lists, forms, allocation rail
- **Activities** — tasks + approval/review queues with status badges
- **Insights** — report cards, funnel bars, campaign charts (blue navy gradients)
- **Admin** — users, permissions, masters CRUD

---

## 9. Do / don’t for redesign

**Do**
- Keep navy + blue tokens and dark sidebar
- Keep Lucide icons on every nav item
- Preserve Pipeline / Activities / Insights / Admin grouping
- Honor role / permission visibility
- Support ≤960px shell stack

**Don’t**
- Reintroduce teal brand colors
- Default to purple/indigo “AI theme” or cream/terracotta brochure looks
- Drop icons from the sidebar
- Treat “Projects” as sold-property PM — they are lead interest masters
- Flatten the page to a single flat white background

---

## 10. Source files

| Concern | Path |
|---|---|
| Tokens & primitives | `frontend/src/app/globals.css` |
| Fonts / root layout | `frontend/src/app/layout.tsx` |
| Sidebar, icons, nav IA | `frontend/src/components/AppShell.tsx` |
| Multi-select chips | `frontend/src/components/MultiSelect.tsx` |
| Auth / API | `frontend/src/lib/auth.tsx`, `frontend/src/lib/api.ts` |
| Screens | `frontend/src/app/**/page.tsx` |
| Dashboard tile colors | `backend/app/Http/Controllers/Api/V1/DashboardController.php` |
| Product README | `README.md` |

---

*Updated for the navy + blue enterprise redesign with iconized, regrouped sidebar.*
