<nav class="main-header navbar navbar-expand navbar-dark navbar-primary">
  <ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
    </li>
  </ul>
  <ul class="navbar-nav ml-auto">
    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown">
        <?php
        $logo = '../img/logobyz.png';
        if (isset($_SESSION['tenant_id'])) {
          $logo_path = "../img/firmalar/logo_{$_SESSION['tenant_id']}.png";
          if (file_exists($logo_path)) $logo = $logo_path;
        }
        ?>
        <img src="<?= $logo ?>" alt="Logo" style="width: 120px; height: 35px; object-fit: contain;" class="mr-2">
        <?= htmlspecialchars($_SESSION['site_adi'] ?? $_SESSION['ad_soyad'] ?? 'Kullanıcı') ?>
      </a>
      <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
        <?php if (!isset($_SESSION['yonetici'])): // Yönetici değilse Profil göster ?>
          <a href="profil.php" class="dropdown-item"><i class="fas fa-user mr-2"></i> Profil</a>
        <?php endif; ?>
        <a href="site_profil.php" class="dropdown-item"><i class="fas fa-building mr-2"></i> Site Profil</a>
        <div class="dropdown-divider"></div>
        <a href="logout.php" class="dropdown-item text-danger"><i class="fas fa-sign-out-alt mr-2"></i> Çıkış Yap</a>
      </div>
    </li>
  </ul>
</nav>