<?php
// includes/sidebar.php
// expects $data to be available (account info)
$balance = isset($data['account']['balance']) ? $data['account']['balance'] : 0;
?>
<aside class="sidebar">
  <div class="brand">
    <img src="logo.png" alt="Imperial Premium">
    <div style="font-weight:700; color:var(--imp-dark-blue)">Imperial Premium</div>
  </div>

  <div class="side-balance card-imp">
    <div class="small-muted">AVAILABLE BALANCE</div>
    <div style="font-size:22px; font-weight:800; color:var(--imp-dark-blue)"><?php echo '$ ' . number_format($balance,0, '.', ','); ?> <small style="font-weight:700; font-size:12px; color:#cfe9ff">USD</small></div>
    <div class="small-muted" style="margin-top:6px"><?php echo '$ ' . number_format($balance,0, '.', ','); ?> USD</div>

    <div class="d-flex gap-2 mt-3">
      <a href="deposit.php" class="btn btn-sm btn-outline-primary cta-btn"><i class="bi bi-arrow-down-left"></i> Transfer</a>
      <a href="paybills.php" class="btn btn-sm btn-danger cta-btn"><i class="bi bi-receipt"></i> Pay Bills</a>
    </div>
  </div>

  <nav class="menu">
    <ul class="nav nav-pills flex-column gap-1">
      <li class="nav-item">
        <a class="nav-link active d-flex align-items-center" href="dashboard.php"><i class="bi bi-grid-3x3-gap me-2"></i> Dashboard</a>
      </li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="myaccount.php"><i class="bi bi-person me-2"></i> My Account</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="account_summary.php"><i class="bi bi-briefcase me-2"></i> Account summary</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="transfer.php"><i class="bi bi-arrow-right-left me-2"></i> Transfer</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="crossborder.php"><i class="bi bi-globe2 me-2"></i> Cross-border Transfer</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="deposit_check.php"><i class="bi bi-card-image me-2"></i> Deposit Check</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="paybills.php"><i class="bi bi-wallet2 me-2"></i> Pay Bills</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="#"><i class="bi bi-credit-card-2-front me-2"></i> Visual Cards</a></li>
      <li class="nav-item"><a class="nav-link d-flex align-items-center" href="#"><i class="bi bi-currency-bitcoin me-2"></i> Crypto Currency</a></li>
      <li class="nav-item mt-3"><a class="nav-link d-flex align-items-center" href="support.php"><i class="bi bi-question-circle me-2"></i> Support</a></li>
    </ul>
  </nav>
</aside>
