<?php $this->push('styles') ?><link rel="stylesheet" href="<?= module_asset('sports', 'css/sports.css') ?>"><?php $this->endPush() ?>
<div class="d-flex justify-content-between align-items-center mb-3">
    <h4 class="mb-0"><i class="fas fa-users me-2"></i><?= lang('sports.teams') ?></h4>
    <?php if (auth_can('teams.manage')): ?><a href="/sports/teams/create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>New Team</a><?php endif; ?>
</div>
<div class="card"><div class="card-body">
<table id="teams-table" class="table table-striped table-hover w-100" data-url="/api/sports/teams/datatable"
       data-columns='[{"data":"team_code","title":"Code"},{"data":"name_en","title":"Team"},{"data":"sport_name","title":"Sport"},{"data":"team_type","title":"Type"},{"data":"players","title":"Players"},{"data":"record","title":"Record"},{"data":"status_badge","title":"Status","orderable":false},{"data":"actions","title":"","orderable":false}]'></table>
</div></div>
<?php $this->push('scripts') ?><script src="<?= module_asset('sports', 'js/sports.js') ?>"></script><script>document.addEventListener('DOMContentLoaded',()=>DataTableHelper.init('teams-table'));</script><?php $this->endPush() ?>