>     function performLocationSearch() {
          let kw = document.getElementById('locSearchInput').value;
          let tbody = document.getElementById('locationSearchResults');
          tbody.innerHTML = '<tr><td colspan="3" class="text-center py-4"><i class="fa-solid fa-spinner fa-spin me-2"></i>Searching...</td></tr>';
          
          let url = (typeof baseUrl !== 'undefined' ? baseUrl : (window.location.origin + '/flystarcourier/public')) + '/admin/bookings/geocodeSearch';
          if (window.location.href.indexOf('/branch/') !== -1) {
              url = url.replace('/admin/', '/branch/');
          }
          
          fetch(url, {
              method: 'POST',
              headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'X-Requested-With': 'XMLHttpRequest' },
              body: 'keyword=' + encodeURIComponent(kw)
          })
          .then(r => r.json())
          .then(res => {
              if(res.status === 'success' && res.data && res.data.length > 0) {
                  let html = '';
                  res.data.forEach(item => {
                      let code = item.code || item.name.substring(0,3).toUpperCase();
                      let fullAddr = (item.full_address || item.name).replace(/'/g, "\\'");
                      html += `<tr>
                          <td>
                              <div class="fw-bold">${item.name}</div>
                              <div class="small text-muted" style="font-size:0.7rem;">${fullAddr}</div>
                          </td>
                          <td><span class="badge bg-secondary">${item.pincode || code}</span></td>
                          <td><button type="button" class="btn btn-sm btn-light border py-0 px-2" onclick="selectLocation('${item.name.replace(/'/g, "\\'")}', '${code.replace(/'/g, "\\'")}', '${(item.state || '').replace(/'/g, "\\'")}', '${item.pincode || ''}', '${item.lat || ''}', '${item.lon || ''}', '${(item.country || 'INDIA').replace(/'/g, "\\'")}')"><i class="fa-solid fa-check me-1"></i>Select</button></td>
                      </tr>`;
                  });
                  tbody.innerHTML = html;
              } else {
                  tbody.innerHTML = '<tr><td colspan="3" class="text-center text-muted py-4">No locations found.</td></tr>';
              }
          })
          .catch(e => {
              tbody.innerHTML = '<tr><td colspan="3" class="text-center text-danger py-4">Error searching.</td></tr>';
          });
      }
  
