20:    const f = $("#filters");
27:        `<input id="fSearch" placeholder="Search email or message id…" value="${esc(st._q || "")}">` +
28:        `<button class="btn sm" id="fGo">Apply</button>`;
29:      $("#fGo").onclick = applyFilters;
30:      $("#fSearch").onkeydown = e => { if (e.key === "Enter") applyFilters(); };
37:        `<button class="btn sm" id="fGo">Apply</button>`;
38:      $("#fGo").onclick = applyFilters;
48:        `<button class="btn sm" id="fGo">Apply</button>`;
49:      $("#fGo").onclick = applyFilters;
57:      st._camp = $("#fCamp").value; st._out = $("#fOutcome").value; st._q = $("#fSearch").value.trim();
103:          : `<div class="empty-state"><div class="e-ico">≡</div><p>No send attempts match these filters yet.</p></div>`;
---gmail html---
<body>
<div id="layout"></div>
<main id="content">
  <div class="page-head">
    <div>
      <h1>Gmail Accounts</h1>
      <p class="sub">Connect up to <span id="maxAcc">10</span> authenticated Gmail accounts via Google OAuth 2.0. Tokens are encrypted at rest.</p>
    </div>
    <div class="btns">
      <button class="btn" id="btnConnect">Connect Gmail Account</button>
      <button class="btn secondary" id="btnImportCfg">Import Gmail Configuration</button>
      <button class="btn danger-o" id="btnClearAll">Clear All</button>
    </div>
  </div>

  <div id="cfgCard" class="card" style="display:none">
    <div class="card-hd"><h2>Import Google OAuth Client Configuration</h2></div>
    <div class="card-bd">
      <div class="cfg-note">
        Upload the <b>client_secret_*.json</b> file from Google Cloud Console → APIs &amp; Services → Credentials.
        The file is validated, encrypted, and stored locally; the secret is <b>never echoed back</b>.
        Redirect URI for this app: <span class="mono" id="cfgRedirect">/auth/google/callback</span>
      </div>
      <form id="cfgForm" class="form" style="margin-top:14px">
        <input type="file" id="cfgFile" accept=".json,application/json" required>
        <button class="btn" type="submit">Upload &amp; Validate</button>
      </form>
    </div>
  </div>

  <div class="card">
    <div class="card-hd">
      <h2>Connected Accounts <span class="badge b-gray" id="accCount">0</span></h2>
      <input type="text" id="accSearch" class="inp" placeholder="Search accounts…" style="width:220px">
    </div>
    <div class="card-bd" id="accWrap">
      <table class="tbl acc-tbl" id="accTbl">
        <thead><tr>
          <th>Gmail Address</th><th>Status</th><th>Sending Method</th>
          <th>Daily / Campaign Limit</th><th>Today</th><th>Last Success</th>
          <th>Errors</th><th>Actions</th>
        </tr></thead>
        <tbody id="accBody"></tbody>
      </table>
      <div id="accEmpty" class="empty" style="display:none">
        <div class="empty-t">No Gmail accounts connected</div>
        <p>Click <b>Connect Gmail Account</b> to start the Google OAuth 2.0 flow. You must import the OAuth client configuration first.</p>
      </div>
    </div>
  </div>
</main>
<script src="/static/js/app.js"></script>
<script src="/static/js/pages/gmail-accounts.js"></script>
</body>
</html>
