<main class="container py-4 py-md-5">
    <div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3 mb-4">
        <div>
            <h1 class="h3 fw-bold text-cfc-dark mb-1"><i class="bi bi-link-45deg"></i> Links rápidos</h1>
            <p class="text-muted mb-0">Toque no botão do serviço desejado. Os endereços longos não ficam expostos na tela.</p>
        </div>
        <a class="btn btn-outline-primary rounded-pill" href="<?= e(url('dashboard')) ?>"><i class="bi bi-arrow-left"></i> Voltar ao início</a>
    </div>

    <div class="row g-4">
        <?php foreach ($links as $link): ?>
            <div class="col-md-6 col-xl-4">
                <div class="card border-0 shadow-soft rounded-4 h-100"><div class="card-body p-4 d-flex flex-column">
                    <span class="action-icon mb-3"><i class="bi bi-box-arrow-up-right"></i></span>
                    <h2 class="h5 fw-bold"><?= e($link['name']) ?></h2>
                    <?php if (!empty($link['notes'])): ?><p class="text-muted flex-grow-1"><?= nl2br(e($link['notes'])) ?></p><?php else: ?><div class="flex-grow-1"></div><?php endif; ?>
                    <a class="btn btn-success rounded-pill w-100 mt-3" target="_blank" rel="noopener" href="<?= e($link['url']) ?>"><i class="bi bi-box-arrow-up-right"></i> Acessar</a>
                </div></div>
            </div>
        <?php endforeach; ?>
        <?php if (empty($links)): ?><div class="col-12"><div class="alert alert-info rounded-4">Nenhum link rápido foi publicado pelo administrador.</div></div><?php endif; ?>
    </div>
</main>
