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

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

<?= view('partials/workspace_hero', [
    'workspaceCrumbPill'    => 'Contracts',
    'workspaceCrumbCurrent' => 'Overview',
    'workspaceTitle'        => 'Contracts Workspace',
    'workspaceDesc'         => 'Manage customers and commercial contracts by product, service, or project.',
]) ?>

<div class="row g-4 mb-4">
    <div class="col-md-3">
        <article class="enterprise-settings-card h-100">
            <div class="text-muted small text-uppercase mb-1">Customers</div>
            <div class="fs-3 fw-semibold"><?= (int) $customerCount ?></div>
            <a href="<?= base_url('contracts/customers') ?>" class="small">View customers</a>
        </article>
    </div>
    <div class="col-md-3">
        <article class="enterprise-settings-card h-100">
            <div class="text-muted small text-uppercase mb-1">Contracts</div>
            <div class="fs-3 fw-semibold"><?= (int) $contractCount ?></div>
            <a href="<?= base_url('contracts/active') ?>" class="small">View contracts</a>
        </article>
    </div>
    <div class="col-md-3">
        <article class="enterprise-settings-card h-100">
            <div class="text-muted small text-uppercase mb-1">Active</div>
            <div class="fs-3 fw-semibold"><?= (int) $activeContracts ?></div>
            <a href="<?= base_url('contracts/active') ?>" class="small">View active</a>
        </article>
    </div>
    <div class="col-md-3">
        <article class="enterprise-settings-card h-100">
            <div class="text-muted small text-uppercase mb-1">Draft</div>
            <div class="fs-3 fw-semibold"><?= (int) $draftContracts ?></div>
        </article>
    </div>
</div>

<div class="d-flex flex-wrap gap-2">
    <a href="<?= base_url('contracts/customers/create') ?>" class="btn btn-primary">
        <i class="fa-solid fa-user-plus me-1"></i> Add Customer
    </a>
    <a href="<?= base_url('contracts/contracts/create') ?>" class="btn btn-outline-primary">
        <i class="fa-solid fa-file-contract me-1"></i> New Contract
    </a>
</div>

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