<?= $this->extend('layouts/enterprise') ?>

<?= $this->section('content') ?>

<?= view('partials/workspace_hero', [
    'workspaceCrumbPill'    => 'Reports',
    'workspaceCrumbCurrent' => 'Accounting',
    'workspaceTitle'        => 'Financial Reports',
    'workspaceDesc'         => 'Trial balance, ledger, and financial statements from posted journals.',
]) ?>

<?php
$cards = [
    [
        'title' => 'Trial Balance',
        'desc'  => 'Net debit and credit balances by account.',
        'path'  => 'accounting/reports/trial-balance',
        'icon'  => 'fa-scale-balanced',
    ],
    [
        'title' => 'General Ledger',
        'desc'  => 'Posted movements with running balances.',
        'path'  => 'accounting/reports/general-ledger',
        'icon'  => 'fa-book',
    ],
    [
        'title' => 'Profit & Loss',
        'desc'  => 'Revenue and expenses for the selected period.',
        'path'  => 'accounting/reports/profit-and-loss',
        'icon'  => 'fa-chart-area',
    ],
    [
        'title' => 'Balance Sheet',
        'desc'  => 'Assets, liabilities, and equity as of period end.',
        'path'  => 'accounting/reports/balance-sheet',
        'icon'  => 'fa-file-invoice-dollar',
    ],
    [
        'title' => 'Cash Flow',
        'desc'  => 'Cash movements classified by operating, investing, and financing.',
        'path'  => 'accounting/reports/cash-flow',
        'icon'  => 'fa-water',
    ],
];
?>

<div class="row g-4">
    <?php foreach ($cards as $card): ?>
        <div class="col-md-6 col-xl-4">
            <div class="enterprise-data-panel h-100">
                <div class="enterprise-data-panel__head">
                    <h2 class="enterprise-data-panel__title">
                        <i class="fa-solid <?= esc($card['icon']) ?> me-2"></i><?= esc($card['title']) ?>
                    </h2>
                    <p class="enterprise-data-panel__subtitle"><?= esc($card['desc']) ?></p>
                </div>
                <div class="enterprise-data-panel__footer">
                    <a href="<?= base_url($card['path']) ?>" class="btn btn-primary btn-sm">Open <?= esc($card['title']) ?></a>
                </div>
            </div>
        </div>
    <?php endforeach; ?>
</div>

<?= $this->endSection() ?>
