# Sidebar Audit — 2026-05-30

## Summary
Two completely separate sidebar implementations existed simultaneously, causing different menus on different pages.

## Sidebar Sources Found (2 total)

### 1. Custom Sidebar (Dashboard only)
- **File:** `resources/views/filament/pages/chat-workspace.blade.php`
- **Implementation:** Hardcoded `<aside class="sidebar">` HTML with JavaScript-driven navigation
- **Triggered by:** `body.fi-body:has(.app)` CSS selector
- **Pages affected:** `/admin` (Dashboard) only
- **Labels:** Arabic, icons: emoji
- **Behavior:** JS `selectView()` navigated to Filament pages via `window.location.href`

### 2. Filament Default Navigation (all other pages)
- **File:** Auto-discovered from `app/Filament/Pages/*.php` and `app/Filament/Resources/*.php`
- **Configuration:** Per-file `$navigationGroup` and `$navigationLabel` properties
- **Pages affected:** WaitingList, Settings, Reports, Permissions, MyProfile, Conversations, Contacts, Assignments, Users, Teams, AutoReplies, WebhookEvents
- **Labels:** Mixed Arabic and English (inconsistent)
- **Groups:** "Management" (English), "WhatsApp" (English), "واتساب" (Arabic), "الإدارة" (Arabic), "النظام" (Arabic) — 5 inconsistent groups

## Root Cause of Different Menu on Waiting List
`crm-theme.css` (section 15) and `chat-workspace.css` both contained:
```css
body.fi-body:has(.app) .fi-sidebar { display: none !important; }
body.fi-body:has(.app) .fi-layout { display: block !important; }
```
The `.app` class only exists on the Dashboard page (chat-workspace view), so Filament's sidebar was hidden ONLY on the Dashboard. All other pages (WaitingList, Settings, etc.) showed Filament's default navigation with its mixed-language groups.

## Broken/Inconsistent Items
- `WaitingList`: group "WhatsApp" (English), label "Waiting List" (English)
- `Settings`: group "Management" (English), label "Settings" (English)
- `Reports`: group "Management" (English), label "Reports" (English)
- `Permissions`: group "Management" (English), label "Permissions" (English)
- `MyProfile`: group "Management" (English), label "My Profile" (English)
- `UserResource`: group "Management" (English), label "Team / Employees" (English)
- `AutoReplyResource`: group "Management" (English), label "Auto Replies" (English)

## Layout Issues
- Dashboard: `.fi-layout { display: block }` → full-width layout, custom sidebar on right
- All other pages: Filament default flex layout → sidebar on right (RTL)
- Different visual appearance despite both being RTL
