# Admin Aside Navigation Design

## Goal

Reorganize the ECOIN admin aside into a professional operational navigation that is easier to scan, adapts to admin permissions, and remains usable on desktop and mobile screens.

## Current Findings

- The admin aside is rendered from `resources/views/components/portal/sidebar.blade.php` for both admin layouts.
- The current `operations` section mixes enrollment, finance, training, corporate, content-adjacent, and facility links in one long stack.
- Several links are already permission-aware, but some admin links are always added even when their routes are protected by `can:*` middleware.
- The sidebar already supports desktop width collapse, mobile overlay, RTL placement, and a scrollable navigation region.

## Approved Information Architecture

The admin aside will use collapsible domain sections:

1. Main
   - Admin dashboard
   - Analytics
   - Admin guide
2. Admissions
   - Registrations
   - Registration pipeline
   - Students
   - Payment review
3. Training Operations
   - Courses
   - Categories
   - Cohorts
   - Rooms
   - Attendance
   - Teachers
   - Certificates
4. Corporate
   - Corporate dashboard
   - B2B leads
   - Organizations
   - Proposals
   - Agreements
   - Corporate cohorts
   - Corporate reports
   - Invoices
   - Corporate payments
   - Credit notes
   - Receivables
5. Finance
   - Finance overview
   - Revenue
   - Expenses
   - Expense management when permitted
   - Cashflow
   - Aging
   - Instructor earnings
6. Communication And Content
   - WhatsApp domain links
   - Messaging settings
   - Notifications
   - Events
   - CMS
   - Blog
   - FAQ
7. Security And System
   - Roles and permissions
   - Reports
   - Audit
   - Health
   - Settings

## UX Behavior

- Sections are collapsible on the expanded desktop sidebar and on mobile.
- The active section opens by default so users keep context after navigation.
- Section headers show an arrow affordance, active-domain styling, and link count only where it improves scanability.
- Empty sections are not rendered when all their links are filtered by permissions.
- The existing icon-only collapsed sidebar remains compact; section toggles must not create unusable hidden text or extra horizontal scroll.
- RTL/LTR placement, current active link indicator, mobile overlay, and scrollable navigation must remain intact.

## RBAC Design

- Every admin link is only rendered when the authenticated user has the same practical permission used by the target route or an existing compatible legacy permission where the route still relies on it.
- Visibility checks are navigation hints only; route middleware and Livewire authorization stay authoritative.
- Finance and corporate finance links remain hidden without their dedicated permissions.

## Testing

- Extend the admin sidebar feature tests to verify new section labels and collapsible semantics render.
- Verify corporate/finance links do not render for a narrow admissions user.
- Preserve the scroll container test and rooms permission test.
- Run the sidebar test and related admin smoke tests after the Blade refactor.
