@yield('styles')

@yield('title', 'Dashboard')

{{ now()->format('D, d M Y') }} {{ now()->hour >= 6 && now()->hour < 14 ? 'Morning' : (now()->hour < 22 ? 'Afternoon' : 'Night') }} {{-- Notification Bell --}} @php $unreadCount = \App\Models\HmisNotification::where('user_id', Auth::id())->where('is_read', false)->count(); @endphp
{{-- Dropdown panel --}}
@if(Auth::user()->isImpersonating())
Viewing as: {{ session('impersonate_role') }} Sidebar and permissions reflect this role's view. Actions still execute as Admin.
Exit Role View
@endif @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if(session('upload_warning')) {{-- Surfaces silent upload failures (file too large, storage not writable, etc.) — without this the controller's session flash never renders and the user thinks documents attached when they didn't. --}}
Upload warning: {{ session('upload_warning') }}
@endif @php // $errors is normally Laravel's ViewErrorBag. Guard against the rare // case where a controller hand-passes an array, or where validation // hasn't initialized it (some print/redirect paths). $errBag = isset($errors) && is_object($errors) && method_exists($errors, 'any') ? $errors : null; @endphp @if($errBag && $errBag->any())
@foreach($errBag->all() as $error)

{{ $error }}

@endforeach
@endif
@yield('content')
@stack('scripts') @yield('scripts') @auth {{-- ════════════════════════════════════════════════════════════════════ IDLE-TIMER WARNING (Apr 2026 security patch) ──────────────────────────────────────────────────────────────────── Server-side idle expiry is enforced by app/Http/Middleware/IdleTimeout. This client-side timer adds a 60-second warning banner BEFORE the server-side cutoff so users have a chance to save their work or dismiss the prompt. Activity is detected via mouse, keyboard, scroll, and touch; any of those resets both timers. Idle thresholds match the middleware exactly. If you change one, change the other. ═══════════════════════════════════════════════════════════════════ --}} @endauth {{-- Global: clickable table rows (progressive enhancement). One handler for the whole HMIS — clicking anywhere in a row navigates to its primary link (an Open/View/Show/Manage-type link, an explicit data-row-link, or the row's single navigation link). Clicks on buttons, links, inputs, selects and forms still behave normally; Ctrl/Cmd-click opens in a new tab; text selection never triggers navigation. Rows with no clear destination stay non-clickable. --}}