{% set current_path = request.url.path %}
{% set _tab_base = "inline-flex shrink-0 items-center rounded-xl px-3 py-2 text-sm font-semibold whitespace-nowrap transition" %}
{% set _tab_active = "bg-brand-600 text-white shadow-soft" %}
{% set _tab_idle = "border border-slate-300 bg-white text-slate-700 hover:bg-slate-50" %}
<div class="rounded-2xl border border-slate-200 bg-white p-3 shadow-soft">
  <div class="mb-2 px-1 text-xs font-semibold uppercase tracking-wide text-slate-500">My Workspace</div>
  <div class="overflow-x-auto pb-1">
    <div class="flex min-w-max flex-nowrap gap-2">
    {% if can_view_employee_portal(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/dashboard" class="{{ _tab_base }} {{ _tab_active if current_path == '/employee/dashboard' else _tab_idle }}">Overview</a>
    {% endif %}
    {% if can_view_own_employee_work(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/work" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/work') else _tab_idle }}">My Work Board</a>
    {% endif %}
    {% if can_view_own_employee_attendance(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/attendance" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/attendance') else _tab_idle }}">My Attendance</a>
    {% endif %}
    {% if can_view_employee_portal(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/profile" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/profile') else _tab_idle }}">My Profile</a>
    {% endif %}
    {% if can_view_own_employee_leave(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/leave" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/leave') else _tab_idle }}">My Leave</a>
    {% endif %}
    {% if can_view_own_employee_documents(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/documents" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/documents') else _tab_idle }}">My Documents</a>
    {% endif %}
    {% if can_view_own_employee_payslips(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/payslips" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/payslips') else _tab_idle }}">My Payslips</a>
    {% endif %}
    {% if can_request_own_employee_offboarding(current_user, current_user_permissions, current_user_roles) %}
    <a href="/employee/offboarding" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/employee/offboarding') else _tab_idle }}">My Offboarding</a>
    {% endif %}
    <a href="/alerts" class="{{ _tab_base }} {{ _tab_active if current_path.startswith('/alerts') else _tab_idle }}">
      My Alert{% if unread_alert_count is defined and unread_alert_count > 0 %}<span class="ml-2 rounded-full bg-white/20 px-2 py-0.5 text-[10px]">{{ unread_alert_count }}</span>{% endif %}
    </a>
    </div>
  </div>
</div>
