<header class="header glass">
    <div class="header-left">
        <button class="toggle-btn" id="sidebar-toggle">
            <i class='bx bx-menu'></i>
        </button>
    </div>
    
    <div class="header-right" style="display: flex; align-items: center; gap: 20px;">
        <?php
        $taModel = new \App\Models\TahunAkademikModel();
        $activeTa = $taModel->where('status', 'Aktif')->first();
        $activeTaName = $activeTa ? $activeTa['nama_ta'] : 'Belum Diatur';
        ?>
        <div style="text-align: right; margin-right: 15px; border-right: 1px solid #e2e8f0; padding-right: 20px;">
            <div style="font-weight: 600; font-size: 0.9rem; color: #1e293b;">Institut Teknologi dan Kesehatan Aspirasi</div>
            <div style="font-size: 0.8rem; color: #64748b;">Semester : [ <?= $activeTaName ?> ]</div>
        </div>

        <div class="user-profile">
            <div class="user-info" style="text-align: right;">
                <div style="font-weight: 600; font-size: 0.9rem;"><?= session()->get('username') ?? 'User' ?></div>
                <div style="font-size: 0.75rem; color: var(--text-muted);"><?= session()->get('nama_role') ?? 'Role' ?></div>
            </div>
            <div class="user-avatar">
                <?= strtoupper(substr(session()->get('username') ?? 'U', 0, 2)) ?>
            </div>
            <a href="<?= base_url('logout') ?>" class="btn btn-sm btn-danger" style="margin-left: 1rem; text-decoration: none;" title="Logout">
                <i class='bx bx-log-out'></i>
            </a>
        </div>
    </div>
</header>
