<?php $title = 'Sent Messages'; ?>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-white font-weight-bold"><i class="fas fa-paper-plane mr-2"></i>Sent Messages</h1>
    <a href="<?= $baseUrl ?>/messages/compose" class="glass-btn glass-btn-primary"><i class="fas fa-plus mr-1"></i>Compose</a>
</div>
<div class="glass-card p-0">
    <div class="list-group list-group-flush">
        <?php if (!empty($messages)): ?>
            <?php foreach ($messages as $msg): ?>
            <div class="list-group-item" style="background: transparent; color: white; border-color: rgba(255,255,255,0.05);">
                <div class="d-flex justify-content-between">
                    <strong><?= htmlspecialchars($msg->subject) ?></strong>
                    <small style="color: rgba(255,255,255,0.4);"><?= date('M d, Y H:i', strtotime($msg->created_at)) ?></small>
                </div>
                <small style="color: rgba(255,255,255,0.5);">To: <?= $msg->recipient_count ?> recipient(s)</small>
            </div>
            <?php endforeach; ?>
        <?php else: ?>
            <div class="empty-state"><i class="fas fa-paper-plane"></i><p>No sent messages</p></div>
        <?php endif; ?>
    </div>
</div>
