← back to Ventura Claw

server/public/brand.html

355 lines

<!doctype html>
<html lang="en"><head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Brand Kit — VenturaClaw</title>
<link rel="stylesheet" href="/static/style.css" />
<style>
/* ─── Brand Kit page ─────────────────────────────────────────────────── */
.brand-page { max-width: 1480px; margin: 0 auto; padding: 28px; }

/* Section heading: serif-italic h2 with mono kicker (DW editorial pattern) */
.section { margin-bottom: 56px; scroll-margin-top: 72px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin-bottom: 24px;
  /* sticky: label stays visible as the section content scrolls past */
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);                          /* same as page bg, no blur needed */
  padding-top: 14px;                              /* breathing room under topbar */
  margin-top: -14px;                              /* compensate so layout doesn't shift */
}
/* Hairline shadow separates sticky head from scrolling content below */
.section-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 24px;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none;
}
/* Upload slots: fix location + product slots to use the class properly */
.upload-slot {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; border-style: dashed; border-color: var(--rule);
  color: var(--ink-mute); cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}
.upload-slot:hover { border-color: var(--gold); color: var(--gold); }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -.01em; line-height: 1; margin: 0; }
.section-head h2 em { font-style: italic; color: var(--gold); }
.section-head .meta { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.section-head .meta a { color: var(--ink-mute); border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.section-head .meta a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Identity panel (Google Knowledge-Graph header card) ── */
.identity-card { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px; background: var(--bg-elevated); border: 1px solid var(--rule-strong); border-radius: 4px; align-items: start; }
.identity-logo { width: 220px; height: 220px; border-radius: 4px; background: linear-gradient(135deg, var(--gold), #b8843a); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.identity-logo::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 60%); }
.identity-logo .mark { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--bg); font-size: 96px; line-height: 1; letter-spacing: -.02em; position: relative; z-index: 1; }
.identity-meta h1 { font-family: var(--serif); font-weight: 500; font-size: 48px; letter-spacing: -.02em; line-height: 1; margin: 0 0 8px; }
.identity-meta h1 em { font-style: italic; color: var(--gold); }
.identity-meta .tagline { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ink-soft); margin-bottom: 24px; max-width: 60ch; }
.identity-meta .stats { display: flex; gap: 36px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--rule); }
.identity-meta .stat { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.identity-meta .stat b { display: block; font-family: var(--serif); font-style: italic; font-size: 28px; font-weight: 500; color: var(--ink); margin-top: 4px; letter-spacing: -.01em; text-transform: none; }
.palette { display: flex; gap: 8px; margin-top: 18px; }
.palette .swatch { width: 36px; height: 36px; border-radius: 2px; border: 1px solid var(--rule); position: relative; }
.palette .swatch span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 8px; letter-spacing: .08em; color: var(--ink-mute); }

/* ── Team grid (Google "Meet the team" pattern) ── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.team-card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 4px; padding: 24px; transition: border-color 160ms ease, transform 160ms ease; cursor: pointer; }
.team-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.team-photo { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 38px; color: var(--bg); position: relative; overflow: hidden; }
.team-photo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 60%); }
.team-name { text-align: center; font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.2; margin-bottom: 6px; }
.team-role { text-align: center; font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.team-bio { text-align: center; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.team-card.upload-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; border-style: dashed; border-color: var(--rule); color: var(--ink-mute); cursor: pointer; }
.team-card.upload-slot:hover { border-color: var(--gold); color: var(--gold); }
.team-card.upload-slot .plus { font-family: var(--serif); font-style: italic; font-size: 64px; line-height: 1; margin-bottom: 8px; }
.team-card.upload-slot .label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

/* ── Locations (Google Places-style cards) ── */
.locations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.location-card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; transition: border-color 160ms ease; cursor: pointer; }
.location-card:hover { border-color: var(--gold); }
.location-photo { aspect-ratio: 16 / 9; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.location-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55) 100%); }
.location-photo .pin { position: absolute; top: 14px; left: 14px; z-index: 2; font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); background: rgba(14,14,16,0.78); padding: 5px 10px; border-radius: 2px; border: 1px solid var(--gold); }
.location-photo .label { position: absolute; bottom: 14px; left: 14px; right: 14px; z-index: 2; font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: -.005em; line-height: 1.1; }
.location-meta { padding: 16px 18px; }
.location-meta .addr { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 8px; }
.location-meta .phone { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--gold); }

/* ── Products (Google Shopping card pattern) ── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; transition: border-color 160ms ease; cursor: pointer; }
.product-card:hover { border-color: var(--gold); }
.product-photo { aspect-ratio: 1 / 1; background: rgba(244,241,234,0.04); display: flex; align-items: center; justify-content: center; position: relative; }
.product-photo .ph-mark { font-family: var(--serif); font-style: italic; font-size: 88px; line-height: 1; color: var(--ink-faint); letter-spacing: -.02em; }
.product-photo .price-badge { position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--bg); background: var(--gold); padding: 4px 8px; border-radius: 2px; font-weight: 600; }
.product-meta { padding: 14px 16px; }
.product-meta .name { font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.2; margin-bottom: 4px; letter-spacing: -.005em; }
.product-meta .sku { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); }

/* ── Connection logo wall (real business logos) ── */
.conn-cat-block { margin-bottom: 16px; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.conn-cat-label { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); padding: 14px 18px; background: var(--bg-elevated); margin: 0; cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; transition: background 140ms ease; }
.conn-cat-label:hover { background: rgba(212,160,74,0.08); }
.conn-cat-label .caret { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); transition: transform 200ms ease; display: inline-block; margin-right: 4px; }
.conn-cat-block.open .conn-cat-label .caret { transform: rotate(90deg); color: var(--gold); }
.conn-cat-block:not(.open) .logo-wall { display: none; }
.conn-cat-label b { color: var(--ink-soft); font-weight: 400; font-family: var(--serif); font-style: italic; font-size: 18px; letter-spacing: -.005em; text-transform: none; }
.conn-cat-label .cnt { color: var(--ink-mute); }
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.logo-tile { background: var(--bg-elevated); padding: 20px 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 130px; transition: background 160ms ease; cursor: pointer; position: relative; }
.logo-tile:hover { background: rgba(244,241,234,0.04); }
.logo-tile .lt-img { width: 56px; height: 56px; background: rgba(244,241,234,0.96); border-radius: 6px; padding: 8px; display: flex; align-items: center; justify-content: center; }
.logo-tile .lt-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-tile .lt-img .lt-fb { width: 100%; height: 100%; border-radius: 2px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 18px; color: white; }
.logo-tile .lt-name { font-family: var(--mono); font-size: 9px; letter-spacing: .10em; color: var(--ink-soft); text-transform: uppercase; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.logo-tile .lt-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--good); box-shadow: 0 0 4px var(--good); }

/* responsive */
@media (max-width: 880px) {
  .brand-page { padding: 16px; }
  .identity-card { grid-template-columns: 1fr; padding: 24px; }
  .identity-logo { width: 140px; height: 140px; margin: 0 auto; }
  .identity-logo .mark { font-size: 64px; }
  .identity-meta h1 { font-size: 36px; }
  .identity-meta .tagline { font-size: 18px; }
  .section-head h2 { font-size: 24px; }
}
</style></head><body>

<header class="topbar">
  <div class="brand">
    <div class="logo-dot"></div>
    <div>
      <div class="brand-name">Ventura<em style="font-style:italic;color:var(--gold)">Claw</em></div>
      <div class="brand-sub">Connected Operations</div>
    </div>
  </div>
  <div style="display:flex;gap:10px;align-items:center">
    <span class="orb-pill"><span class="orb-dot"></span><span id="who">…</span></span>
    <a href="/chat" class="btn btn-ghost">Chat</a>
    <a href="/connections" class="btn btn-ghost">Connections</a>
    <a href="/connections/import" class="btn btn-ghost">Import</a>
    <a href="/brand" class="btn">Brand</a>
    <a href="#" id="logout" class="btn btn-ghost">Sign out</a>
  </div>
</header>

<main class="brand-page">

  <!-- ── IDENTITY ───────────────────────────────────────────────────── -->
  <section class="section">
    <div class="section-head">
      <h2>The <em>brand.</em></h2>
      <span class="meta"><a href="#">Edit identity →</a></span>
    </div>
    <div class="identity-card">
      <div class="identity-logo"><span class="mark" id="brand-mark">A</span></div>
      <div class="identity-meta">
        <h1 id="brand-name">Acme <em>Boutique</em></h1>
        <div class="tagline" id="brand-tagline">"Hand-curated home & gift goods, shipped from Brooklyn since 2018."</div>
        <div class="palette">
          <div class="swatch" style="background:#d4a04a"><span>D4A04A</span></div>
          <div class="swatch" style="background:#0e0e10"><span>0E0E10</span></div>
          <div class="swatch" style="background:#f4f1ea"><span>F4F1EA</span></div>
          <div class="swatch" style="background:#8fb89a"><span>8FB89A</span></div>
        </div>
        <div class="stats">
          <div class="stat">Connectors<b id="ic-conn">56</b></div>
          <div class="stat">Locations<b id="ic-loc">3</b></div>
          <div class="stat">Team<b id="ic-team">5</b></div>
          <div class="stat">SKUs<b id="ic-sku">142</b></div>
        </div>
      </div>
    </div>
  </section>

  <!-- ── TEAM ──────────────────────────────────────────────────────── -->
  <section class="section">
    <div class="section-head">
      <h2>The <em>team.</em></h2>
      <span class="meta"><a href="#">Manage team →</a></span>
    </div>
    <div class="team-grid" id="team-grid"></div>
  </section>

  <!-- ── LOCATIONS ─────────────────────────────────────────────────── -->
  <section class="section">
    <div class="section-head">
      <h2>The <em>shops.</em></h2>
      <span class="meta"><a href="#">Manage locations →</a></span>
    </div>
    <div class="locations-grid" id="locations-grid"></div>
  </section>

  <!-- ── PRODUCTS ──────────────────────────────────────────────────── -->
  <section class="section">
    <div class="section-head">
      <h2>The <em>goods.</em></h2>
      <span class="meta"><a href="#">Sync from Shopify →</a></span>
    </div>
    <div class="products-grid" id="products-grid"></div>
  </section>

  <!-- ── CONNECTIONS (logo wall) — moved last per UX: infrastructure, not brand -->
  <section class="section">
    <div class="section-head">
      <h2>The <em>connections.</em></h2>
      <span class="meta"><a href="/connections">All connectors →</a></span>
    </div>
    <div id="connections-cats"></div>
  </section>

</main>

<footer class="footer">VenturaClaw · Brand Kit</footer>

<script>
const TEAM = [
  { name: 'Mara Chen',     role: 'Founder · CEO',         bio: 'Designs the line. Approves every order over $500.', tint: '#d4a04a', initial: 'M' },
  { name: 'Jordan Reyes',  role: 'Operations',            bio: 'Inventory + fulfillment + cross-listing.',          tint: '#8fb89a', initial: 'J' },
  { name: 'Sofia Patel',   role: 'Marketing',             bio: 'Owns the IG feed, Mailchimp, TikTok strategy.',     tint: '#7a9aa0', initial: 'S' },
  { name: 'Devon Hayes',   role: 'Customer Care',         bio: 'First-line replies on Gmail + Intercom.',           tint: '#c9856e', initial: 'D' },
  { name: 'Riley Tanaka',  role: 'Finance',               bio: 'QuickBooks reconciliation + payouts.',              tint: '#a78b9c', initial: 'R' },
];

const LOCATIONS = [
  { name: 'Brooklyn Flagship',  addr: '142 Bedford Ave, Brooklyn, NY 11211', phone: '+1 (718) 555-0142', tint: '#d4a04a' },
  { name: 'Soho Boutique',      addr: '88 Spring St, New York, NY 10012',    phone: '+1 (212) 555-0188', tint: '#8fb89a' },
  { name: 'Online Warehouse',   addr: '4400 Hunters Point, Long Island City, NY 11101', phone: '+1 (929) 555-4400', tint: '#7a9aa0' },
];

const PRODUCTS = [
  { name: 'Linen Throw',          sku: 'LN-T-001', price: '$89',  initial: 'L', tint: '#d4a04a' },
  { name: 'Walnut Cutting Board', sku: 'WC-CB-12', price: '$64',  initial: 'W', tint: '#a8865a' },
  { name: 'Brass Candlestick',    sku: 'BR-CD-04', price: '$38',  initial: 'B', tint: '#c9a96a' },
  { name: 'Ceramic Mug Set',      sku: 'CR-MG-04', price: '$48',  initial: 'C', tint: '#8a9a8e' },
  { name: 'Wool Coaster (4-pk)',  sku: 'WL-CS-04', price: '$24',  initial: 'W', tint: '#a78b9c' },
  { name: 'Stoneware Vase',       sku: 'SW-VS-09', price: '$72',  initial: 'S', tint: '#7a9aa0' },
  { name: 'Leather Apron',        sku: 'LT-AP-01', price: '$118', initial: 'L', tint: '#9a7860' },
  { name: 'Hand-Forged Knife',    sku: 'HF-KN-08', price: '$192', initial: 'H', tint: '#5a5e6a' },
];

(async () => {
  try {
    const me = await (await fetch('/api/me')).json();
    document.getElementById('who').textContent = me.user.email + (me.user.role === 'admin' ? ' · admin' : '');
  } catch {}

  const conn = await (await fetch('/api/connectors')).json();
  document.getElementById('ic-conn').textContent = conn.connectors.length;

  // ── Connection logo wall — real brand logos via simpleicons (jsdelivr)
  const esc = (s) => String(s == null ? '' : s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
  const NO_LOGO = new Set(['klaviyo','monday','mondaydotcom']);
  const cats = [...new Set(conn.connectors.map(c => c.category))];
  const wallHost = document.getElementById('connections-cats');
  const CAT_LABELS = { commerce: 'Commerce', payments: 'Payments', email: 'Email', marketing: 'Marketing', social: 'Social', analytics: 'Analytics', advertising: 'Advertising', shipping: 'Shipping', operations: 'Operations', accounting: 'Accounting', communication: 'Communication', design: 'Design', storage: 'Storage', files: 'Files', development: 'Development' };
  wallHost.innerHTML = cats.map((cat, i) => {
    const items = conn.connectors.filter(c => c.category === cat);
    const niceLabel = CAT_LABELS[cat] || cat.charAt(0).toUpperCase() + cat.slice(1);
    return `
      <div class="conn-cat-block ${i === 0 ? 'open' : ''}">
        <div class="conn-cat-label" onclick="this.parentElement.classList.toggle('open')">
          <span><span class="caret">▸</span>${esc(niceLabel)}</span>
          <b>${items.length} <span class="cnt">connector${items.length===1?'':'s'}</span></b>
        </div>
        <div class="logo-wall">
          ${items.map(c => {
            const useLogo = c.logo && !NO_LOGO.has(c.logo);
            const slug = String(c.logo || '').replace(/[^a-z0-9-]/gi,'');
            const tintHex = String(c.tint || '#888').replace(/[^0-9a-fA-F]/g,'').slice(0,6) || '888888';
            const primaryUrl = `https://cdn.simpleicons.org/${slug}/${tintHex}`;
            const fallbackUrl = `https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/${slug}.svg`;
            const letter = esc((c.name || '?')[0]);
            const tintCss = '#' + tintHex;
            const img = useLogo
              ? `<img src="${esc(primaryUrl)}" alt="${esc(c.name)}" loading="lazy" data-fallback="${esc(fallbackUrl)}" data-tint="${tintCss}" data-letter="${letter}" onerror="if(this.dataset.fallbackTried){this.outerHTML='&lt;div class=&quot;lt-fb&quot; style=&quot;background:'+this.dataset.tint+'&quot;&gt;'+this.dataset.letter+'&lt;/div&gt;'.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&quot;/g,'\\'')}else{this.dataset.fallbackTried=1;this.src=this.dataset.fallback}">`
              : `<div class="lt-fb" style="background:${tintCss}">${letter}</div>`;
            return `<a class="logo-tile" href="/connections#${esc(c.id)}" title="${esc(c.name)}">
              <div class="lt-dot" title="connected"></div>
              <div class="lt-img">${img}</div>
              <div class="lt-name">${esc(c.name)}</div>
            </a>`;
          }).join('')}
        </div>
      </div>`;
  }).join('');
  document.getElementById('ic-loc').textContent = LOCATIONS.length;
  document.getElementById('ic-team').textContent = TEAM.length;
  document.getElementById('ic-sku').textContent = PRODUCTS.length * 18; // demo

  // Team
  const teamGrid = document.getElementById('team-grid');
  teamGrid.innerHTML = TEAM.map(p => `
    <div class="team-card">
      <div class="team-photo" style="background:linear-gradient(135deg, ${esc(p.tint)}, #${esc(darken(p.tint))});">${esc(p.initial)}</div>
      <div class="team-name">${esc(p.name)}</div>
      <div class="team-role">${esc(p.role)}</div>
      <div class="team-bio">${esc(p.bio)}</div>
    </div>
  `).join('') + `
    <div class="team-card upload-slot" onclick="alert('Photo upload — wires to /api/team/photo (TODO)')">
      <div class="plus">+</div><div class="label">Add team member</div>
    </div>`;

  // Locations
  const locGrid = document.getElementById('locations-grid');
  locGrid.innerHTML = LOCATIONS.map(l => `
    <div class="location-card">
      <div class="location-photo" style="background:linear-gradient(135deg, ${esc(l.tint)}, #${esc(darken(l.tint))});">
        <span class="pin">📍 NEW YORK</span>
        <span class="label">${esc(l.name)}</span>
      </div>
      <div class="location-meta">
        <div class="addr">${esc(l.addr)}</div>
        <div class="phone">${esc(l.phone)}</div>
      </div>
    </div>
  `).join('') + `
    <div class="location-card upload-slot" style="min-height:240px;" onclick="alert('Location upload — wires to /api/locations (TODO)')">
      <div style="font-family:var(--serif);font-style:italic;font-size:64px;line-height:1;margin-bottom:8px">+</div>
      <div style="font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase">Add storefront</div>
    </div>`;

  // Products
  const prodGrid = document.getElementById('products-grid');
  prodGrid.innerHTML = PRODUCTS.map(p => `
    <div class="product-card">
      <div class="product-photo" style="background:linear-gradient(135deg, ${esc(p.tint)}33, ${esc(p.tint)}11);">
        <span class="ph-mark" style="color:${esc(p.tint)}88">${esc(p.initial)}</span>
        <span class="price-badge">${esc(p.price)}</span>
      </div>
      <div class="product-meta">
        <div class="name">${esc(p.name)}</div>
        <div class="sku">SKU · ${esc(p.sku)}</div>
      </div>
    </div>
  `).join('') + `
    <div class="product-card upload-slot" style="min-height:240px;" onclick="alert('Product sync — pulls from Shopify connector (TODO)')">
      <div style="font-family:var(--serif);font-style:italic;font-size:64px;line-height:1;margin-bottom:8px">+</div>
      <div style="font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase">Sync product</div>
    </div>`;
})();

function darken(hex) {
  const n = parseInt(hex.replace('#',''), 16);
  let r = (n >> 16) & 0xff, g = (n >> 8) & 0xff, b = n & 0xff;
  r = Math.round(r * 0.65); g = Math.round(g * 0.65); b = Math.round(b * 0.65);
  return [r,g,b].map(x => x.toString(16).padStart(2,'0')).join('');
}

document.getElementById('logout').addEventListener('click', async e => {
  e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); location.href = '/login';
});
</script>
</body></html>