<table class="table table-hover align-middle mb-0">
    <thead>
        <tr>
            <th style="width:120px;"><?php echo $t['cert_image']; ?></th>
            <th><?php echo $t['cert_title']; ?></th>
            <th><?php echo $t['cert_description']; ?></th>
            <th style="width:100px;"><?php echo $isRTL ? 'الترتيب' : 'Order'; ?></th>
            <th style="width:200px;text-align:center;"><?php echo $t['users_table_actions']; ?></th>
        </tr>
    </thead>
    <tbody>
        <?php if (empty($certifications)): ?>
            <tr><td colspan="5" class="text-center py-5 text-muted">😶 <?php echo $t['cert_no_certs']; ?></td></tr>
        <?php else: ?>
            <?php foreach ($certifications as $cert): ?>
                <tr>
                    <td><img src="../public/<?php echo htmlspecialchars($cert['image_url']); ?>" alt="<?php echo htmlspecialchars($cert['title']); ?>" style="width: 100px; height: auto; object-fit: cover; border-radius: 8px;"></td>
                    <td class="fw-bold text-dark"><?php echo htmlspecialchars($cert['title']); ?></td>
                    <td class="text-muted small"><?php echo htmlspecialchars(mb_strimwidth($cert['description'], 0, 90, '…')); ?></td>
                    <td class="text-muted fw-bold"><?php echo htmlspecialchars($cert['sort_order']); ?></td>
                    <td style="text-align:center;">
                        <a href="certifications.php?edit=<?php echo $cert['id']; ?>#add-form" class="btn btn-edit btn-sm px-3 py-1 me-1">✏️ <?php echo $t['users_edit_btn']; ?></a>
                        <a href="delete_certification.php?id=<?php echo $cert['id']; ?>" class="btn btn-delete btn-sm px-3 py-1" data-confirm="<?php echo htmlspecialchars($t['cert_delete_confirm']); ?>">🗑️ <?php echo $t['users_delete_btn']; ?></a>
                    </td>
                </tr>
            <?php endforeach; ?>
        <?php endif; ?>
    </tbody>
</table>