<!-- ===================== ACCOUNT TAB ===================== -->
<div class="tab-pane <?= ($requested_tab === 'account') ? 'active' : '' ?>" id="tab-account">
  <div class="card" style="max-width:600px">
    <div class="card-header"><span class="card-title">Account Settings</span></div>
    <div class="card-body">
      <div class="form-grid" style="margin-bottom:16px">
        <div class="card" style="padding:12px;background:var(--bg-base)"><div class="text-xs text-muted">Current User</div><strong><?= htmlspecialchars($current_user_full['name'] ?? '') ?></strong><div class="text-xs"><?= htmlspecialchars($current_user_full['email'] ?? '') ?></div></div>
        <div class="card" style="padding:12px;background:var(--bg-base)"><div class="text-xs text-muted">WhatsApp Sent</div><strong><?= number_format($wa_count) ?></strong></div>
        <div class="card" style="padding:12px;background:var(--bg-base)"><div class="text-xs text-muted">SMS Sent</div><strong><?= number_format($sms_count) ?></strong></div>
        <div class="card" style="padding:12px;background:var(--bg-base)"><div class="text-xs text-muted">Emails Sent</div><strong><?= number_format($email_count) ?></strong></div>
      </div>
      <form id="accountForm">
        <div class="form-grid">
          <div class="form-group">
            <label class="form-label">Client Name</label>
            <input type="text" name="client_name" class="form-control" value="<?= htmlspecialchars($account['client_name']) ?>">
          </div>
          <div class="form-group">
            <label class="form-label">Business Name</label>
            <input type="text" name="business_name" class="form-control" value="<?= htmlspecialchars($account['business_name']) ?>">
          </div>
          <div class="form-group">
            <label class="form-label">Phone</label>
            <input type="text" name="phone" class="form-control" value="<?= htmlspecialchars($account['phone']) ?>">
          </div>
          <div class="form-group">
            <label class="form-label">Email</label>
            <input type="email" name="email" class="form-control" value="<?= htmlspecialchars($account['email']) ?>">
          </div>
          <div class="form-group">
            <label class="form-label">Currency</label>
            <select name="currency" class="form-control">
              <?php foreach (['USD','EUR','GBP','AED','SAR','LBP','QAR'] as $c): ?>
              <option value="<?= $c ?>" <?= $account['currency']===$c?'selected':'' ?>><?= $c ?></option>
              <?php endforeach; ?>
            </select>
          </div>
          <div class="form-group">
            <label class="form-label">Status</label>
            <select name="status" class="form-control">
              <option value="active" <?= $account['status']==='active'?'selected':'' ?>>Active</option>
              <option value="inactive" <?= $account['status']==='inactive'?'selected':'' ?>>Inactive</option>
            </select>
          </div>
          <div class="form-group">
            <label class="form-label">Business Logo</label>
            <?php if (!empty($account['logo'])): ?>
              <div style="margin-bottom:8px"><img src="<?= htmlspecialchars($account['logo']) ?>" alt="Logo" style="max-width:140px;max-height:70px;object-fit:contain;border:1px solid var(--border);border-radius:8px;padding:6px;background:#fff"></div>
            <?php endif; ?>
            <input type="file" name="logo" class="form-control" accept="image/*">
            <div class="text-xs text-muted" style="margin-top:6px">This logo appears on quotation/invoice print pages.</div>
          </div>
        </div>
        <button type="button" class="btn btn-primary" onclick="saveAccount()">Save Changes</button>
      </form>
    </div>
  </div>
</div>
