<div class="ticket-grid" style="grid-template-columns:1fr 340px">
  <div class="card">
    <div class="table-wrap">
      <table class="table">
        <thead><tr><th>Queue</th><th>Team</th><th>Auto-assign</th><th>Status</th></tr></thead>
        <tbody>
        <?php foreach ($queues as $q) : ?>
          <tr>
            <td><?= e($q['name']) ?><div class="text-faint text-sm"><?= e($q['description']) ?></div></td>
            <td class="text-sm"><?= e($q['team_name'] ?? '—') ?></td>
            <td><span class="badge badge-outline"><?= e(ucwords(str_replace('_',' ',$q['auto_assign']))) ?></span></td>
            <td><span class="badge <?= $q['is_active']?'badge-resolved':'badge-closed' ?>"><?= $q['is_active']?'Active':'Inactive' ?></span></td>
          </tr>
        <?php endforeach; ?>
        </tbody>
      </table>
    </div>
  </div>
  <div class="card">
    <div class="card-header"><h3>Add queue</h3></div>
    <div class="card-body">
      <form method="post" action="<?= url('/admin/queues') ?>">
        <?= csrf_field() ?>
        <div class="form-group"><label>Name <span class="req">*</span></label><input type="text" name="name" required></div>
        <div class="form-group">
          <label>Team</label>
          <select name="team_id"><option value="">—</option><?php foreach ($teams as $t) : ?><option value="<?= $t['id'] ?>"><?= e($t['name']) ?></option><?php endforeach; ?></select>
        </div>
        <div class="form-group"><label>Description</label><input type="text" name="description"></div>
        <div class="form-group">
          <label>Auto-assignment</label>
          <select name="auto_assign"><option value="none">None (manual)</option><option value="round_robin">Round robin</option><option value="least_loaded">Least loaded</option></select>
        </div>
        <button class="btn btn-primary btn-block">Add queue</button>
      </form>
    </div>
  </div>
</div>
