{{-- ── Chat Panel ──────────────────────────────────────────────────────── --}} @if($isOpen)
{{-- ── Header ── --}}
Report Assistant ⒶⓇ {{-- Mode badge --}} @if($mode !== 'select') {{ $mode }} @endif
{{-- Back to mode select (only when in a mode) --}} @if($mode !== 'select') @endif {{-- Reset --}} {{-- Close --}}
{{-- ══════════════════════════════════════════════════════════════════ --}} {{-- ── MODE SELECT SCREEN ── --}} {{-- ══════════════════════════════════════════════════════════════════ --}} @if($mode === 'select')

How would you like to query?

Choose a mode to get started

{{-- Basic card --}} {{-- Advanced card --}}
{{-- Hint --}}

💡 Tip: Use Advanced to just describe what you need in plain English — Gemini will figure out the rest

@endif {{-- ══════════════════════════════════════════════════════════════════ --}} {{-- ── BASIC MODE ── --}} {{-- ══════════════════════════════════════════════════════════════════ --}} @if($mode === 'basic')
{{-- ── Report Type Selector (dropdown) ──────────────────────────── --}}
{{-- Custom wrapper gives us the chevron icon and accent border on selection --}}
{{-- Chevron icon --}}
{{-- ── Placeholder when no report type selected ─────────────────── --}} @if($reportType === '')

Select a report type from the dropdown to get started

@endif {{-- ══════════════════════════════════════════════════════════════ --}} {{-- ── PRODUCTION REPORT FORM ── --}} {{-- ══════════════════════════════════════════════════════════════ --}} @if($reportType === 'production') {{-- Plant --}}
{{-- Line --}}
@if(!$selectedPlantId)

Select a plant first

@endif
{{-- Date Range --}}
{{-- Fetch Button --}} {{-- Production Result --}} @if($hasResult)

{{ $result }}

@endif @endif {{-- end production --}} {{-- ══════════════════════════════════════════════════════════════ --}} {{-- ── INVOICE REPORT FORM (type lookup) ── --}} {{-- ══════════════════════════════════════════════════════════════ --}} @if($reportType === 'invoice') {{-- Plant --}}
{{-- Item Code --}}

Press Enter or click the button below

{{-- Fetch Button --}} {{-- Invoice Report Result --}} @if($hasInvoiceResult)
@if(str_contains($invoiceResult, 'serial invoice')) @elseif(str_contains($invoiceResult, 'material invoice')) @elseif(str_contains($invoiceResult, 'does not exist') || str_contains($invoiceResult, 'not found')) @else @endif

{{ $invoiceResult }}

@endif @endif {{-- end invoice report --}} {{-- ══════════════════════════════════════════════════════════════ --}} {{-- ── INVOICE STATUS FORM (scan status) ── NEW ── --}} {{-- ══════════════════════════════════════════════════════════════ --}} @if($reportType === 'invoice_status') {{-- Description banner --}}

Enter an invoice number to see how many serial numbers have been scanned, how many are pending, and the list of unscanned serials.

{{-- Invoice Number input --}}

Press Enter or click the button below

{{-- Fetch Button --}} {{-- Invoice Status Result --}} @if($hasInvoiceStatusResult)
@if(str_contains($invoiceStatusResult, '✅')) {{-- All scanned — green check --}} @elseif(str_contains($invoiceStatusResult, 'No records') || str_contains($invoiceStatusResult, 'valid') || str_contains($invoiceStatusResult, "couldn't")) {{-- Not found / error — warning --}} @else {{-- Partial / none scanned — barcode --}} @endif

{{ $invoiceStatusResult }}

@endif @endif {{-- end invoice_status --}}
@endif {{-- ══════════════════════════════════════════════════════════════════ --}} {{-- ── ADVANCED MODE ── --}} {{-- ══════════════════════════════════════════════════════════════════ --}} @if($mode === 'advanced')
{{-- ── Conversation area ── --}}
@if(empty($chatHistory)) {{-- ── Empty state ── --}}

AI-Powered Assistant

Ask anything in plain English — tap an example below to get started

{{-- Example prompt cards --}}
{{-- Card 1 — Invoice scan status --}} {{-- Card 2 — Invoice type lookup --}} {{-- Card 3 — Production report --}}
@endif {{-- ── Chat bubbles ── --}} @foreach($chatHistory as $message) @if($message['role'] === 'user')
{{ $message['content'] }}
@else
{{ $message['content'] }}
@endif @endforeach {{-- ── Typing indicator ── --}} @if($isAdvancedLoading)
@endif
{{-- ── Input bar ── --}}

Press Enter to send · Ask anything in plain English

@endif
@endif {{-- ── FAB Toggle Button ───────────────────────────────────────────────── --}}