<div class="d-flex justify-content-between align-items-center mb-3">
    <h5 class="fw-bold mb-0"><i class="fas fa-cogs me-2 text-primary"></i>New Asset</h5>
    <a href="<?= url('/Assets') ?>" class="btn btn-sm btn-outline-secondary"><i class="fas fa-arrow-left me-1"></i>Back</a>
</div>

<p class="text-muted small">Pick the asset type — this determines which fields you'll fill out.</p>

<?php if (empty($types)): ?>
    <p>No asset types yet. <a href="<?= url('/AssetTypes/create') ?>">Create one</a>.</p>
<?php else: ?>
    <div class="type-picker">
        <?php foreach ($types as $t): ?>
            <a href="<?= url('/Assets/create?type=' . (int) $t['asset_type_id']) ?>" style="border-left-color: <?= e($t['color'] ?? '#0f172a') ?>">
                <strong><?= e($t['name']) ?></strong>
                <small><code><?= e($t['code']) ?></code></small>
            </a>
        <?php endforeach; ?>
    </div>
<?php endif; ?>
