
@if(auth()->check() && (auth()->user()->hasRole('admin') || auth()->user()->hasRole('director')))
    @php
        $currentDay = now()->day;
        $adminCanApprove = ($currentDay >= 28 || $currentDay <= 7);
    @endphp
    
    @if(!$adminCanApprove && auth()->user()->hasRole('admin'))
        <div class="alert alert-warning alert-dismissible fade show" role="alert">
            <i class="fas fa-clock"></i> 
            <strong>⚠️ Approval Window Restriction:</strong> 
            Admin approvals are only allowed between the <strong>28th and 7th</strong> of each month.
            <br>
            <small>Current date: {{ now()->format('l, d-m-Y') }}. Next approval window starts on the 28th.</small>
            <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
        </div>
    @endif
    
    <div class="alert alert-info alert-dismissible fade show" role="alert">
        <i class="fas fa-check-circle"></i> 
        <strong>✓ Submission Privileges:</strong> 
        You can submit deductions and payments at <strong>any time</strong> when losses occur.
        <br>
        <small>
            @if(auth()->user()->hasRole('admin'))
                📋 As an Administrator: You can submit anytime, but approvals are restricted to the approval window (28th - 7th).
            @else
                👔 As a Director: You can both submit and approve at any time.
            @endif
        </small>
        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
    </div>
@endif