<?= $this->extend('layouts/main') ?>
<?= $this->section('content') ?>

<div class="row justify-content-center">
    <div class="col-lg-7">
        <div class="card">
            <div class="card-header d-flex align-items-center gap-2">
                <i class="bi bi-cash-stack" style="color: var(--brand);"></i> New Payroll Run
            </div>
            <div class="card-body">
                <form action="<?= site_url('payroll') ?>" method="post">
                    <?= csrf_field() ?>

                    <div class="mb-3">
                        <label class="form-label small fw-semibold">Pay Period</label>
                        <input type="month" class="form-control" name="period_month" value="<?= date('Y-m') ?>" required>
                        <div class="form-text">Creates a draft payslip for every currently-active staff member, pre-filled from their basic salary (0 if not set). You can adjust each one, add allowance/deduction lines, then finalize.</div>
                    </div>

                    <div class="d-flex gap-2">
                        <button type="submit" class="btn btn-primary"><i class="bi bi-check2 me-1"></i>Create Run</button>
                        <a href="<?= site_url('payroll') ?>" class="btn btn-outline-secondary">Cancel</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

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