/* HiveView Command Center -- admin surface theme */
/* Dark (#0b0d12) + gold (#e8b24a). Dense, precise, distinctive. */

:root {
  --bg:        #0b0d12;
  --bg-raised: #13161f;
  --bg-panel:  #191c27;
  --border:    #252836;
  --border-hi: #333650;
  --gold:      #e8b24a;
  --gold-dim:  #c4902e;
  --gold-faint:#e8b24a22;
  --text:      #e4e6f0;
  --text-dim:  #8b8fa8;
  --text-mute: #8b8fa8;
  --danger:    #e05c5c;
  --success:   #4eca82;
  --radius:    6px;
  --topbar-h:  52px;
  --font:      'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100dvh;
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: #000;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus-visible {
  left: 0;
}

/* Focus visible -- global consistent ring */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius);
}
:focus:not(:focus-visible) { outline: none; }

/* ---- TOP BAR ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1.5rem;
  z-index: 100;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
/* h1.brand resets browser h1 defaults so the topbar brand looks identical to the old span */
h1.brand {
  margin: 0;
  padding: 0;
  line-height: inherit;
}
.brand span { color: var(--gold); }
.brand em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

/* Tab nav */
.topbar nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.3125rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text);
  background: var(--border);
}
.tab-btn[aria-current="true"] {
  color: var(--gold);
  background: var(--gold-faint);
}

/* Sign out button */
.btn-signout {
  background: none;
  border: 1px solid var(--border-hi);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-signout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---- MAIN CONTENT ---- */
main {
  padding-top: var(--topbar-h);
  min-height: 100dvh;
}

#panel {
  padding: 1.5rem 1.25rem;
  min-height: calc(100dvh - var(--topbar-h));
}

/* ---- AUTH / LOGIN PAGE ---- */
main.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1rem;
  padding-top: 2rem; /* no topbar on login */
}

.auth-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.5rem 2rem 2rem;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
}
.auth-brand span { color: var(--gold); }

.auth-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

/* Forms inside auth card */
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.auth-card label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.auth-card input[type="email"],
.auth-card input[type="text"],
.auth-card input[inputmode="numeric"] {
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.5625rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s;
  letter-spacing: 0.02em;
}
.auth-card input:focus-visible {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-faint);
}
.auth-card input::placeholder { color: var(--text-mute); }

.auth-card button[type="submit"], #enroll-btn, #enroll-done {
  margin-top: 0.375rem;
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  color: #000;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.auth-card button[type="submit"]:hover, #enroll-btn:hover, #enroll-done:hover { background: var(--gold-dim); }
.auth-card button[type="submit"]:active, #enroll-btn:active, #enroll-done:active { opacity: 0.9; }
.auth-card button[type="submit"]:disabled, #enroll-btn:disabled, #enroll-done:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Ghost button (back) */
.btn-ghost {
  background: none;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  width: 100%;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

/* Status / error message */
#status {
  margin-top: 0.75rem;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-align: center;
}
#status.is-error { color: var(--danger); }
#status.is-ok    { color: var(--success); }

/* ---- TWO-FACTOR (TOTP verify + enrollment) ---- */
.auth-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 0.4rem;
}
.enroll { display: flex; flex-direction: column; gap: 0.55rem; text-align: left; }
.enroll-h { font-size: 0.95rem; color: var(--text); font-weight: 600; margin-top: 0.25rem; }
.enroll-key {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  word-break: break-all;
  user-select: all;
}
.enroll-codes {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin: 0.2rem 0;
  white-space: pre;
  user-select: all;
}
#enroll button, #totp button { margin-top: 0.35rem; }

/* ---- DATA TABLES (for dashboard panels) ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  background: var(--bg-raised);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-panel); }

/* ---- STATUS CHIPS ---- */
.chip {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.chip-new    { background: #1a2a4a; color: #5ba8ff; }
.chip-active { background: #1a3a25; color: var(--success); }
/* #8b8fa8 on #222 = ~4.6:1, clears WCAG AA */
.chip-done   { background: #222; color: #8b8fa8; }
/* #f07070 on #3a1a1a = ~5.1:1, clears WCAG AA (was ~4.36:1 with #e05c5c) */
.chip-hot    { background: #3a1a1a; color: #f07070; }

/* ---- PANEL SKELETON (loading state) ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-panel) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  height: 1rem;
  width: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.4s infinite; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---- UTILITY ---- */
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.muted { color: var(--text-mute); }
.gold { color: var(--gold); }
.danger { color: var(--danger); }
.ok { color: var(--success); }

/* Section headings inside panels */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

/* ---- LEADS FILTER BAR ---- */
.leads-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.filter-select {
  background: var(--bg-raised);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.filter-select:focus-visible {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-faint);
}

/* ---- TABLE WRAP (scrollable region) ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.table-wrap:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- STATUS SELECT (inline row action) ---- */
.status-select {
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.1875rem 0.375rem;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
  min-width: 7rem;
}
.status-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.status-select:focus-visible {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-faint);
}

/* ---- PAGINATION ---- */
.leads-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn-page {
  background: var(--bg-raised);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-page:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--gold);
}
.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .topbar { gap: 0.75rem; }
  .brand em { display: none; }
  .tab-btn { padding: 0.3125rem 0.5rem; font-size: 0.75rem; }
  .auth-card { padding: 2rem 1.25rem 1.5rem; }
}

/* ===================== SOCIAL MODULE ===================== */
.btn-primary {
  background: var(--gold);
  color: #16110a;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font: 600 0.85rem/1 var(--font);
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.subnav { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin: 0 0 1.1rem; flex-wrap: wrap; }
.subnav-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); padding: 0.5rem 0.75rem; font: 500 0.85rem/1 var(--font);
  cursor: pointer; margin-bottom: -1px;
}
.subnav-btn:hover { color: var(--text); }
.subnav-btn.is-active { color: var(--gold); border-bottom-color: var(--gold); }

.social-banner { border-radius: var(--radius); padding: 0.6rem 0.9rem; margin: 0 0 1rem; font-size: 0.85rem; }
.social-banner.is-ok { background: #142a1d; border: 1px solid #234e35; color: var(--success); }
.social-banner.is-error { background: #2c1717; border: 1px solid #5a2b2b; color: var(--danger); }

.social-body { max-width: 760px; }
.composer { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label { font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); }
.composer-caption, .composer-input {
  width: 100%; box-sizing: border-box; background: var(--bg-panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.7rem;
  font: 0.9rem/1.5 var(--font); resize: vertical;
}
.composer-caption:focus, .composer-input:focus { outline: none; border-color: var(--gold); }
.composer-row { display: flex; gap: 0.5rem; align-items: center; }
.composer-row .composer-input { flex: 1; }
.composer-actions { display: flex; gap: 0.6rem; align-items: center; padding-top: 0.4rem; }

.lint-host:empty { display: none; }
.lint-box { display: flex; flex-direction: column; gap: 0.3rem; }
.lint-box.lint-ok { color: var(--success); font-size: 0.8rem; }
.lint-row { border-radius: 5px; padding: 0.4rem 0.6rem; font-size: 0.8rem; line-height: 1.4; }
.lint-row.lint-block { background: #2c1717; border: 1px solid #5a2b2b; color: #f1a3a3; }
.lint-row.lint-warn { background: #2a2415; border: 1px solid #54462155; color: #e8cf8a; }

.ai-options { display: flex; flex-direction: column; gap: 0.5rem; }
.ai-options:empty { display: none; }
.ai-opt { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ai-opt-text { white-space: pre-wrap; font-size: 0.85rem; line-height: 1.5; color: var(--text); }
.ai-opt .btn-page { align-self: flex-start; }

.media-thumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.media-thumbs:empty { display: none; }
.media-thumb { position: relative; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; color: var(--text-dim); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.9rem; line-height: 1; cursor: pointer; }

.target-list { display: flex; flex-direction: column; gap: 0.35rem; }
.target-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text); cursor: pointer; }
.target-item input { accent-color: var(--gold); }

.social-connect { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.acct-list { display: flex; flex-direction: column; gap: 0.5rem; }
.acct-card { display: flex; align-items: center; gap: 0.7rem; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.8rem; }
.acct-name { font-size: 0.88rem; color: var(--text); flex: 1; }

.post-list { display: flex; flex-direction: column; gap: 0.7rem; }
.post-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; }
.post-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.post-top .muted { margin-left: auto; }
.post-cap { font-size: 0.88rem; line-height: 1.5; color: var(--text); white-space: pre-wrap; }
.post-actions { display: flex; gap: 0.5rem; }

/* ---- Monitor ---- */
.mon-killswitch { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.mon-killswitch .ks-on { color: var(--danger); font-weight: 600; }
.mon-killswitch .ks-off { color: var(--success); font-weight: 600; }
.mon-killswitch button { margin-left: auto; }
.mon-bee { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 0.9rem; margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.bee-total { font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.mon-section { margin-bottom: 1.4rem; }
.mon-h3 { font-size: 0.95rem; margin: 0 0 0.6rem; color: var(--text); }
.mon-target { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-dim); padding-left: 0.2rem; }
.mon-target a { color: var(--gold); }
.metric { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 4px; padding: 0.1rem 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text); }

/* ---- Lead detail expander (imported meta + worked-field editor) ---- */
.lead-detail td { background: #10131c; border-top: 1px solid var(--gold-faint); padding: 0.9rem 1rem 1rem; }
.ld-grid { display: flex; flex-wrap: wrap; gap: 0.45rem 1.6rem; margin: 0 0 0.9rem; }
.ld-item { display: flex; align-items: baseline; gap: 0.45rem; font-size: 0.82rem; }
.ld-k { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.ld-item a { color: var(--gold); }
.ld-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.75rem 1rem; }
.ld-editor input, .ld-editor textarea, .ld-editor select {
  background: #0b0e15; color: inherit; border: 1px solid #262b3d; border-radius: 8px;
  padding: 0.45rem 0.6rem; font: inherit; font-size: 0.85rem;
}
.ld-editor input:focus-visible, .ld-editor textarea:focus-visible, .ld-editor select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ld-actions { display: flex; align-items: center; gap: 0.8rem; grid-column: 1 / -1; }
.ld-msg.is-error { color: var(--danger); }
.ld-note { font-size: 0.74rem; margin: 0.7rem 0 0; }
.lead-detail-btn { margin-left: 0.375rem; }

/* ==== HAPPYDALE CARD GRAMMAR (2026-07-02 polish) - HiveView gold identity ==== */

/* Shell: warm radial washes + grain + 1px hairline frame (pseudo-elements, no markup) */
body {
  background:
    radial-gradient(70vw 60vh at 50% -10%, rgba(232, 178, 74, 0.07), transparent 60%),
    radial-gradient(60vw 55vh at 50% 115%, rgba(120, 80, 20, 0.10), transparent 60%),
    var(--bg);
}
body::before {
  content: ''; position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: soft-light;
  background-image: url("/admin/grain.svg"); /* real file: img-src 'self' stays tight */
}
body::after {
  content: ''; position: fixed; inset: clamp(10px, 1.2vw, 18px); z-index: 98;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 3px; pointer-events: none;
}
.corner-label {
  position: fixed; z-index: 99; bottom: clamp(18px, 2.2vw, 28px); left: clamp(24px, 2.6vw, 36px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim); pointer-events: none;
}

/* Panel = card */
#panel {
  position: relative; z-index: 2;
  border: 1px solid var(--border); border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.1rem 1.35rem 1.35rem;
}
.panel-kicker {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-mono); font-size: 0.71rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--text-dim);
  margin: 0.15rem 0 0.9rem;
}
.panel-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #f5cf7d, var(--gold));
  box-shadow: 0 0 12px rgba(232, 178, 74, 0.55);
  animation: hv-breathe 3.2s ease-in-out infinite;
}
@keyframes hv-breathe {
  0%, 100% { box-shadow: 0 0 8px rgba(232, 178, 74, 0.35); }
  50%      { box-shadow: 0 0 18px rgba(232, 178, 74, 0.85); }
}

/* Telemetry band */
.telemetry {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; margin: 0 0 1rem;
}
.tl-tile { background: rgba(255, 255, 255, 0.02); padding: 0.85rem 1rem 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.tl-n {
  font-size: 1.9rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #f5cf7d, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tl-k { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }

/* Auth card: the full happydale treatment, gold */
.auth-card {
  border: 1px solid var(--border); border-radius: 16px;
  background: rgba(255, 255, 255, 0.02); position: relative; z-index: 2;
}
.auth-brandrow { display: inline-flex; align-items: center; gap: 11px; margin: 0 0 0.3rem; }
.auth-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, #f5cf7d, var(--gold));
  box-shadow: 0 0 16px rgba(232, 178, 74, 0.6);
  animation: hv-breathe 3.2s ease-in-out infinite;
}
.auth-card input { border-radius: 12px; }
.auth-card button[type="submit"], .auth-card #req-btn { border-radius: 999px; }
.auth-otp { text-align: center; font-family: var(--font-mono); font-size: 1.45rem; letter-spacing: 0.5em; padding-left: calc(0.75rem + 0.5em); }
.auth-row { display: flex; justify-content: space-between; gap: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  .panel-dot, .auth-dot { animation: none; }
}

/* Fixes: author display on .auth-card form was overriding [hidden]; password input had no skin */
.auth-card form[hidden] { display: none; }
.auth-card input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.5625rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s;
  letter-spacing: 0.02em;
}

/* ==== FACELIFT 2026-07-02: Space Grotesk + JetBrains Mono, deeper ink, hairline discipline ==== */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('/admin/fonts/space-grotesk-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('/admin/fonts/jetbrains-mono-latin.woff2') format('woff2');
}
:root {
  --bg: #08090d;
  --bg-raised: rgba(255, 255, 255, 0.025);
  --bg-panel: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.16);
  --font: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
body { font-family: var(--font); letter-spacing: 0.005em; }

/* Topbar: floating hairline bar, mono tabs, breathing brand dot */
.topbar {
  background: rgba(8, 9, 13, 0.82);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid var(--border);
  height: 56px;
}
h1.brand { display: inline-flex; align-items: center; gap: 10px; letter-spacing: 0.05em; }
h1.brand::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #f5cf7d, var(--gold));
  box-shadow: 0 0 14px rgba(232, 178, 74, 0.6);
  animation: hv-breathe 3.2s ease-in-out infinite;
}
.brand em { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.28em; }
.tab-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.tab-btn:hover { color: var(--text); border-color: var(--border); }
.tab-btn[aria-current="true"] {
  color: var(--gold);
  background: var(--gold-faint);
  border-color: rgba(232, 178, 74, 0.35);
}
.btn-signout { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; border-radius: 999px; }

/* Tables: mono headers, tighter rhythm, sticky header, hover raise */
.table-wrap { max-height: calc(100dvh - 320px); overflow: auto; border-radius: 12px; border: 1px solid var(--border); }
.data-table { border: none; font-size: 0.8rem; }
.data-table th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  background: #0d0f15;
  position: sticky; top: 0; z-index: 3;
}
.data-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid rgba(255, 255, 255, 0.055); }
.data-table tr:hover td { background: rgba(232, 178, 74, 0.035); }
.mono, .data-table a { font-family: var(--font-mono); }
.data-table a { font-size: 0.74rem; text-decoration: none; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.18); }
.data-table a:hover { color: var(--gold); border-color: var(--gold); }

/* Lead cell: name over mono context line */
.lead-title { font-weight: 600; letter-spacing: 0.01em; }
.lead-sub { display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.next-action { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.03em; color: #d8b96a; }
.td-date { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); white-space: nowrap; }

/* Chips: hairline outline style */
.chip { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; border-radius: 999px; padding: 0.14rem 0.55rem; border: 1px solid var(--border); background: transparent; }
.chip-new    { color: #6fb2ff; border-color: rgba(111, 178, 255, 0.35); background: rgba(111, 178, 255, 0.07); }
.chip-active { color: var(--success); border-color: rgba(78, 202, 130, 0.35); background: rgba(78, 202, 130, 0.07); }
.chip-done   { color: var(--text-dim); }
.chip-hot    { color: #f08a8a; border-color: rgba(240, 112, 112, 0.35); background: rgba(240, 112, 112, 0.07); }

/* Filter bar + search */
.filter-select, .status-select { font-family: var(--font-mono); font-size: 0.72rem; border-radius: 8px; background: var(--bg-raised); }
.lead-search {
  background: var(--bg-raised); border: 1px solid var(--border-hi); border-radius: 999px;
  color: var(--text); font: inherit; font-size: 0.78rem; padding: 0.3rem 0.9rem; min-width: 200px;
}
.lead-search:focus-visible { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-faint); }

/* Telemetry tiles: clickable filters */
.tl-tile { transition: background 0.2s; }
button.tl-tile { border: none; cursor: pointer; text-align: left; font: inherit; }
button.tl-tile:hover { background: rgba(232, 178, 74, 0.06); }
button.tl-tile[aria-pressed="true"] { background: rgba(232, 178, 74, 0.09); box-shadow: inset 0 -2px 0 var(--gold); }

/* Buttons */
.btn-primary { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; padding: 0.45rem 1.1rem; }
.btn-page, .btn-ghost { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; border-radius: 999px; }

/* Detail expander polish */
.lead-detail td { background: rgba(255, 255, 255, 0.018); border-left: 2px solid rgba(232, 178, 74, 0.45); border-radius: 0; }
.ld-k { font-family: var(--font-mono); }
.ld-editor input, .ld-editor textarea, .ld-editor select { border-radius: 10px; background: rgba(0, 0, 0, 0.28); }

/* Pagination + misc mono touches */
.leads-pagination, .panel-kicker, .tl-k, .filter-label { font-family: var(--font-mono); }
/* Keep content clear of the fixed corner label */
main#main { padding-bottom: 72px; }
.corner-label { opacity: 0.7; }

/* ==== COMMAND HOME: hub cards, funnel, wizard, lead timeline ==== */
.hub-section { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.3em; color: var(--text-dim); margin: 1.4rem 0 0.65rem; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hub-card {
  position: relative; text-align: left; font: inherit; color: inherit;
  border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
  display: flex; flex-direction: column; gap: 0.3rem; cursor: default;
}
button.hub-card { cursor: pointer; }
button.hub-card:hover { border-color: rgba(232, 178, 74, 0.5); background: rgba(255, 255, 255, 0.035); transform: translateY(-2px); }
.hub-kicker { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); margin: 0; }
.hub-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: rgba(255,255,255,0.35); }
.hub-live .hub-dot { background: linear-gradient(135deg, #7de0a8, var(--success)); box-shadow: 0 0 10px rgba(78, 202, 130, 0.7); animation: hv-breathe-g 3.2s ease-in-out infinite; }
.hub-warn .hub-dot { background: linear-gradient(135deg, #f5cf7d, var(--gold)); box-shadow: 0 0 10px rgba(232, 178, 74, 0.75); animation: hv-breathe 3.2s ease-in-out infinite; }
.hub-off .hub-dot { background: rgba(255, 255, 255, 0.28); }
@keyframes hv-breathe-g { 0%,100% { box-shadow: 0 0 6px rgba(78,202,130,0.4); } 50% { box-shadow: 0 0 14px rgba(78,202,130,0.9); } }
.hub-big {
  font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; margin: 0.35rem 0 0;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #f5cf7d, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hub-title { margin: 0; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em; }
.hub-sub { margin: 0; font-size: 0.78rem; color: var(--text-dim); line-height: 1.45; }
.hub-arrow { margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); transition: color 0.2s, transform 0.2s; align-self: flex-start; }
button.hub-card:hover .hub-arrow { color: var(--gold); transform: translateX(3px); }

.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.funnel-seg { border: none; font: inherit; color: inherit; cursor: pointer; background: rgba(255, 255, 255, 0.02); padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; text-align: left; transition: background 0.2s; }
.funnel-seg:hover { background: rgba(232, 178, 74, 0.06); }
.funnel-n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.funnel-k { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.funnel-won .funnel-n { color: var(--success); }
.funnel-lost .funnel-n { color: var(--text-dim); }
.funnel-new .funnel-n { color: #6fb2ff; }

.wiz-steps { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 1rem; }
.wiz-body { border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.02); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; max-width: 680px; }
.wiz-audience { font-weight: 600; margin: 0; }

.ld-act-h { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.26em; color: var(--text-dim); margin: 1rem 0 0.4rem; }
.ld-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; max-height: 170px; overflow: auto; }
.ld-ev { display: flex; gap: 0.8rem; font-size: 0.76rem; align-items: baseline; }
.ld-ev-when { font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-dim); white-space: nowrap; }
.ld-ev-what { color: var(--text); }
.ld-ev-email .ld-ev-what::before { content: '✉ '; color: var(--gold); }
.ld-ev-call .ld-ev-what::before { content: '☎ '; color: #6fb2ff; }
.ld-ev-edit .ld-ev-what::before { content: '✎ '; color: var(--text-dim); }

/* ==== SIDEBAR SHELL + LEADS MASTER-DETAIL (2026-07-02) ==== */
body.has-sidebar { overflow-x: hidden; }
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100dvh; position: relative; z-index: 2; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: 100;
  display: flex; flex-direction: column; gap: 1.6rem;
  padding: 1.2rem 0.9rem 1rem;
  border-right: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.7);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.sidebar h1.brand { font-size: 0.92rem; padding: 0.2rem 0.35rem; }
.sidebar .brand em { display: block; margin: 0.35rem 0 0 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar .tab-btn {
  text-align: left; width: 100%; border-radius: 10px;
  padding: 0.6rem 0.85rem; position: relative;
}
.sidebar .tab-btn::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  display: inline-block; margin-right: 0.65rem; vertical-align: 1px;
  background: rgba(255, 255, 255, 0.18); transition: background 0.2s, box-shadow 0.2s;
}
.sidebar .tab-btn:hover::before { background: rgba(255, 255, 255, 0.4); }
.sidebar .tab-btn[aria-current="true"]::before { background: var(--gold); box-shadow: 0 0 8px rgba(232, 178, 74, 0.8); }
.side-foot { display: flex; flex-direction: column; gap: 0.7rem; }
.side-foot .btn-signout { width: 100%; }
.side-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--text-dim); opacity: 0.7; margin: 0; text-align: center; }
body.has-sidebar main#main { padding: 1.4rem 1.6rem 2rem; max-width: none; min-height: auto; }
body.has-sidebar .corner-label { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar nav { flex-direction: row; }
  .sidebar .brand em, .side-label { display: none; }
}

/* Leads master-detail */
.leads-split { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 14px; align-items: start; }
.lead-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: calc(100dvh - 330px); overflow: auto; padding-right: 2px;
}
.lead-item {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.28rem;
  transition: border-color 0.2s, background 0.2s;
}
.lead-item:hover { border-color: var(--border-hi); background: rgba(255, 255, 255, 0.035); }
.lead-item.selected { border-color: rgba(232, 178, 74, 0.55); background: rgba(232, 178, 74, 0.06); }
.li-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.li-name { font-weight: 600; font-size: 0.88rem; letter-spacing: 0.01em; }
.li-sub { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.li-next { font-family: var(--font-mono); font-size: 0.66rem; color: #d8b96a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lead-profile {
  border: 1px solid var(--border); border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.2rem 1.4rem 1.3rem;
  min-height: 300px;
  max-height: calc(100dvh - 330px); overflow: auto;
}
.lp-empty { margin: 2rem 0; text-align: center; }
.lp-head { border-bottom: 1px solid var(--border); padding-bottom: 0.9rem; margin-bottom: 1rem; }
.lp-name { margin: 0 0 0.3rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.lp-sub { margin: 0 0 0.8rem; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.lp-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.lp-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.lp-call { font-variant-numeric: tabular-nums; }
.lead-dossier .ld-grid { margin-top: 0.2rem; }
@media (max-width: 1100px) {
  .leads-split { grid-template-columns: 1fr; }
  .lead-list, .lead-profile { max-height: none; }
}

/* ==== HYBRID SHELL: topbar back on the main column (sidebar keeps sections) ==== */
.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar2 {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 1.6rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.82);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.crumb { margin: 0; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-dim); }
.top-actions { display: flex; align-items: center; gap: 0.5rem; }
.top-actions .btn-page { padding: 0.35rem 0.85rem; }

/* ==== COMPLIANCE PASS 2026-07-02: login legal footer, sr-only, WCAG 2.5.8 target size ==== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.auth-legal { font-size: 0.72rem; line-height: 1.5; color: var(--text-dim); margin: 0.2rem 0 0.2rem; }
.auth-legal a { color: var(--gold); }
.auth-foot { position: relative; z-index: 2; margin: 1.1rem auto 0; text-align: center; max-width: 460px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; color: var(--text-dim); }
.auth-foot a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.14); }
.auth-foot a:hover { color: var(--gold); border-color: var(--gold); }
/* WCAG 2.5.8 Target Size (Minimum, AA): rescue the small inline controls to >=24px CSS px */
.btn-page { min-height: 24px; }
.status-select { min-height: 24px; }
