graph TB
    subgraph "Actors"
        Staff[👥 Staff/Employee]
        Client[🏢 Client/Business]
        Admin[⚙️ KROW Admin]
    end
    
    subgraph "KROW Staff App"
        SA_Auth[Authentication & Onboarding]
        SA_Shifts[Shift Management]
        SA_Earnings[Earnings & Payments]
        SA_Profile[Profile Management]
    end
    
    subgraph "KROW Client App"
        CA_Events[Event Creation]
        CA_Staff[Staff Management]
        CA_Time[Time Tracking - QR Code]
        CA_Invoice[Invoicing]
    end
    
    subgraph "Backend System"
        API[Backend API]
        DB[(Database)]
    end
    
    %% Staff interactions
    Staff -->|Registers & Manages Profile| SA_Auth
    Staff -->|Views & Accepts Shifts| SA_Shifts
    Staff -->|Scans QR Code - Clock In/Out| SA_Shifts
    Staff -->|Tracks Earnings| SA_Earnings
    Staff -->|Updates Skills & Documents| SA_Profile
    
    %% Client interactions
    Client -->|Creates Events & Shifts| CA_Events
    Client -->|Views Assigned Staff| CA_Staff
    Client -->|Generates QR Code| CA_Time
    Client -->|Manual Clock In/Out| CA_Time
    Client -->|Rates Staff| CA_Staff
    Client -->|Reviews & Approves Invoices| CA_Invoice
    
    %% Admin interactions
    Admin -->|Assigns Staff to Shifts| API
    Admin -->|Validates Staff Profiles| API
    
    %% App to Backend connections
    SA_Auth -.->|Profile Data| API
    SA_Shifts -.->|Shift Status Updates| API
    SA_Earnings -.->|Payment Data| API
    SA_Profile -.->|User Data| API
    
    CA_Events -.->|Event & Shift Data| API
    CA_Staff -.->|Staff Ratings| API
    CA_Time -.->|Time Records| API
    CA_Invoice -.->|Invoice Data| API
    
    API <-->|Data Storage & Retrieval| DB
    
    style Staff fill:#e1f5ff
    style Client fill:#fff4e1
    style Admin fill:#f0e1ff