@extends('pdf.layout')

@section('title', $title)
@section('doc_name', strtoupper($title))
@section('doc_number', __('Report Period') . ': ' . ($dateRange ?? __('All Time')))

@section('content')
    <table class="data-table">
        <thead>
            <tr>
                @foreach($headers as $header)
                    <th>{{ $header }}</th>
                @endforeach
            </tr>
        </thead>
        <tbody>
            @forelse($rows as $row)
                <tr>
                    @foreach($row as $cell)
                        <td>{!! $cell !!}</td>
                    @endforeach
                </tr>
            @empty
                <tr>
                    <td colspan="{{ count($headers) }}" class="text-center">{{ __('No data available') }}</td>
                </tr>
            @endforelse
        </tbody>
        @if(isset($footers) && count($footers) > 0)
            <tfoot style="background-color: #f5f5f5; font-weight: bold;">
                <tr>
                    @foreach($footers as $footer)
                        <td>{!! $footer !!}</td>
                    @endforeach
                </tr>
            </tfoot>
        @endif
    </table>
@endsection
