<div class="bar">
  <div>
    <div class="title">{{ $pageTitle ?? '' }}</div>
    <div class="subtitle">{{ $pageSubtitle ?? '' }}</div>
  </div>

  <div class="navRow">
    <a class="btn2 {{ ($activeMain ?? '')==='sales' ? 'active' : '' }}"
       href="{{ route('dashboard.sales') }}">المبيعات</a>

    <a class="btn2 {{ ($activeMain ?? '')==='purchases' ? 'active' : '' }}"
       href="{{ route('purchases.index') }}">المشتريات</a>

    <a class="btn2 {{ ($activeMain ?? '')==='expenses' ? 'active' : '' }}"
       href="{{ route('expenses.index') }}">المصروفات</a>

    <a class="btn2 {{ ($activeMain ?? '')==='reports' ? 'active' : '' }}"
       href="{{ route('dashboard.reports') }}">التقارير</a>

    <a class="btn2 {{ ($activeMain ?? '')==='settings' ? 'active' : '' }}"
       href="{{ route('settings.index') }}">الإعدادات</a>

    @if(auth()->check() && (auth()->user()->role ?? 'user') === 'admin')
      <a class="btn2 {{ ($activeMain ?? '')==='branches' ? 'active' : '' }}"
         href="{{ route('branches.index') }}">إدارة الفروع</a>

      <a class="btn2 {{ ($activeMain ?? '')==='users' ? 'active' : '' }}"
         href="{{ route('users.index') }}">إدارة المستخدمين</a>
    @endif

    <form method="POST" action="{{ route('logout') }}" style="display:inline">
      @csrf
      <button class="btnLogout" type="submit">خروج</button>
    </form>
  </div>
</div>
