/* Mailer UI — modern glass theme · green brand · light/dark · responsive */
:root {
  --brand: #00AA4D;
  --brand2: #00AA4D;
  --brand-rgb: 0, 170, 77;

  --bg: #edf3ef;
  --bg2: #f6f9f7;
  --panel: #ffffff;
  --panel2: #fafbfc;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --input-bg: #ffffff;
  --bar-bg: #eceef1;
  --btn-bg: #eef0f3;
  --chip-bg: #e6f9ee;
  --chip-border: #b7ecd0;
  --dropzone-bg: #f6fef9;
  --dropzone-border: #b7ecd0;

  --danger: #dc2626;
  --ok: #00AA4D;
  --warn: #d97706;
  --info: #0284c7;
  --radius: 14px;

  --sidebar: #101418;
  --sidebar-ink: #d1d5db;

  /* glass */
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-blur: 16px;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-hover: 0 16px 40px rgba(0, 170, 77, 0.12);
  --topbar-glass: rgba(237, 243, 239, 0.72);
}

html[data-theme="dark"] {
  --bg: #0a0e11;
  --bg2: #0e1418;
  --panel: #161d21;
  --panel2: #1b2328;
  --ink: #e8ecef;
  --muted: #96a3ab;
  --line: #283138;
  --input-bg: #1b2328;
  --bar-bg: #283138;
  --btn-bg: #242d33;
  --chip-bg: #12301f;
  --chip-border: #1d5233;
  --dropzone-bg: #101a15;
  --dropzone-border: #1d5233;
  --sidebar: #0a0e11;
  --sidebar-ink: #c3ccd3;

  --glass: rgba(22, 29, 33, 0.6);
  --glass-strong: rgba(22, 29, 33, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.45);
  --topbar-glass: rgba(10, 14, 17, 0.72);
}

/* ---------- web fonts ---------- */
@font-face {
  font-family: 'Zona';
  src: url('../fonts/zona-pro-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Helvetica Now';
  src: url('../fonts/helvetica-now-text-medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Helvetica Now';
  src: url('../fonts/helvetica-now-text-light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.fouc * { transition: none !important; animation: none !important; }
html {
  overflow-x: hidden;
  overflow-x: clip; /* clip without creating a scroll container (keeps sticky working) */
  min-height: 100%;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 60%, var(--bg) 100%);
}
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
/* ambient glow blobs (the "glass" backdrop) */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 340px; height: 340px; top: -80px; right: -60px;
  background: radial-gradient(circle, rgba(var(--brand-rgb), 0.22), transparent 70%);
}
body::after {
  width: 300px; height: 300px; bottom: -60px; left: -60px;
  background: radial-gradient(circle, rgba(0, 170, 77, 0.16), transparent 70%);
}
html[data-theme="dark"] body::before { opacity: .5; }
html[data-theme="dark"] body::after { opacity: .45; }

/* ---------- snake divider — syncs with page load via JS ---------- */
.main::before {
  content: '';
  position: fixed;
  top: 0; bottom: 0; left: 230px;
  width: 3px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--brand), var(--brand2));
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  transition: clip-path 0.15s ease-out, opacity 0.2s ease;
}
.main.snake-grow::before {
  clip-path: inset(0 0 0% 0);
  opacity: 1;
}
.main.snake-done::before {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) { .main::before { transition: none; clip-path: inset(0 0 0% 0); } }
@media (max-width: 900px) { .main::before { left: 0; } }

a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { text-decoration: underline; }
/* Clickable recipient email in tables (opens the sent-email audit view) */
.email-link {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: var(--brand); cursor: pointer;
  text-align: left; text-decoration: none;
}
.email-link:hover { text-decoration: underline; }

/* ---------- sidebar (glass) ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: 230px;
  background: linear-gradient(180deg, rgba(16, 20, 24, 0.9), rgba(10, 14, 17, 0.86));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  padding: 18px 12px;
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: #fff;
  padding: 4px 10px 30px;
}
.brand-dot {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, var(--brand2), #00AA4D);
  box-shadow: 0 0 12px rgba(var(--brand-rgb), 0.7);
  display: inline-block;
}
.brand-link { display: flex; align-items: center; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,170,77,.15); color: #00AA4D; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px; line-height: 1; white-space: nowrap;
}
.brand-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #00AA4D;
  animation: pulse-dot 2s infinite;
}
.brand-logo-lg { height: 46px; }
.brand-logo-hover { display: none; }
.brand-link:hover .brand-logo-base { display: none; }
.brand-link:hover .brand-logo-hover { display: block; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(var(--brand-rgb), 0.4);
  overflow: hidden; color: #fff;
}
.login-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 13px;
  color: var(--sidebar-ink);
  padding: 10px 12px; border-radius: 10px;
  font-weight: 500;
  transition: background .2s, color .2s, transform .2s;
}
.nav-link:hover {
  background: rgba(255,255,255,.07); color: #fff;
  transform: translateX(4px);
  text-decoration: none;
}
.nav-link.active {
  background: transparent;
  color: #fff;
}
.nav-link.active .ic {
  width: 32px; height: 32px;
  background: #1a1a1a;
  color: var(--brand);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
html[data-theme="dark"] .nav-link.active .ic {
  background: #fff;
  box-shadow: 0 2px 8px rgba(255,255,255,0.15);
}
.ic {
  width: 18px; height: 18px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
}
.ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ic .ic-base { filter: invert(0); transition: filter .2s; }
.ic .ic-hover { display: none; }
.nav-link:hover:not(.active) .ic .ic-base { display: none; }
.nav-link:hover:not(.active) .ic .ic-hover { display: block; }
.nav-link.active .ic .ic-base { filter: invert(0); }
.nav-link { position: relative; }
.nav-dot {
  width: 8px; height: 8px;
  background: #f85149;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(248,81,73,.6);
  animation: nav-dot-pulse 2s ease-in-out infinite;
}
@keyframes nav-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.2); }
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 6px; }
.userlink { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 4px; border-radius: 10px; transition: background .2s; }
.userlink:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.userlink .uname, .userlink .urole { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userlink:hover .uname { color: #fff; }
.userbox form { margin-left: auto; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.25);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initials { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.logout svg { display: block; }
.uname { color: #fff; font-weight: 600; font-size: 13px; }
.urole { font-size: 11px; color: #9ca3af; }
.logout {
  background: none; border: none; color: #9ca3af;
  font-size: 18px; cursor: pointer; padding: 6px;
  transition: color .2s, transform .2s;
}
.logout:hover { color: #fff; transform: scale(1.15); }

/* ---------- theme toggle (sun / moon switch, nav-width row) ---------- */
.theme-toggle {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 42px;
  margin: 0 0 12px;
  cursor: pointer;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-family: inherit; color: var(--sidebar-ink);
  text-align: left;
  transition: background .2s ease, border-color .2s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tt-track {
  position: relative;
  flex: 0 0 auto;
  width: 84px; height: 28px;
  border-radius: 99px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
}
.tt-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
html[data-theme="dark"] .theme-toggle .tt-thumb { transform: translateX(58px); }
.tt-ic { position: absolute; width: 13px; height: 13px; transition: opacity .25s ease, transform .3s ease; }
.tt-sun { color: #f59e0b; }
.tt-moon { color: #374151; opacity: 0; transform: rotate(-90deg) scale(.4); }
html[data-theme="dark"] .tt-sun { opacity: 0; transform: rotate(90deg) scale(.4); }
html[data-theme="dark"] .tt-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.tt-label { margin-left: auto; text-align: right; font-size: 13px; font-weight: 500; color: var(--sidebar-ink); }

/* ---------- main ---------- */
.main { margin-left: 230px; min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.topbar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 28px 12px; flex-wrap: wrap;
  background: var(--topbar-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; font-family: 'Zona', 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--ink); font-size: 18px; cursor: pointer;
  position: relative; z-index: 5;
  pointer-events: auto;
  touch-action: manipulation;
  transition: transform .2s, border-color .2s;
}
.nav-toggle:hover { transform: scale(1.06); border-color: var(--brand2); }
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 85; opacity: 0; pointer-events: none;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.nav-backdrop.show { opacity: 1; pointer-events: auto; visibility: visible; }
.content { padding: 20px 28px 40px; display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------- cards (glass) ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(var(--brand-rgb), 0.3);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 500; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
/* Dashboard: delivery overview + circular lead-generation progress */
.dash-gen-row { display: flex; gap: 18px; align-items: stretch; }
.dash-gen-row > .card { flex: 1; min-width: 0; }
.delivery-stats { grid-template-columns: repeat(4, 1fr); }
.gen-progress-card { flex: 0 0 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gen-progress-card .card-head { margin-bottom: 8px; }
.gen-progress { position: relative; width: 112px; height: 112px; }
.gp-track { fill: none; stroke: var(--line); stroke-width: 12; }
.gp-fill { fill: none; stroke: var(--ink); stroke-width: 12; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .4s ease; }
.gp-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; color: var(--ink); }
.gp-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .dash-gen-row { flex-direction: column; }
  .gen-progress-card { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .delivery-stats { grid-template-columns: repeat(2, 1fr); }
}
.card.stat { margin-bottom: 0; padding: 16px; }
.card.stat:hover { transform: translateY(-3px); }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-num.live { color: var(--ok); animation: pulse 2s infinite; }
.stat-num.err { color: var(--danger); }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.card > .table, .panel > .table { display: block; overflow-x: auto; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 9px 10px; border-bottom: 1px solid var(--line);
  vertical-align: middle; font-size: 13px;
}
.table tbody tr { transition: background .18s; }
.table tbody tr:hover, .ct-main:hover + .ct-divider { background: rgba(var(--brand-rgb), 0.05); }
.ct-divider:hover, .ct-main:has(+ .ct-divider:hover) { background: rgba(var(--brand-rgb), 0.05); }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }
.table .empty:hover { background: transparent; }
.table tbody tr.row-clickable { cursor: pointer; }
.table tbody tr.row-clickable:hover { background: rgba(var(--brand-rgb), 0.08); }
.btn-csv {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  color: var(--muted); transition: background .15s, color .15s;
}
.btn-csv:hover { background: rgba(var(--brand-rgb), 0.1); color: var(--brand); }
.row-off { opacity: .55; }
.row-off + .ct-divider { opacity: .55; }
.table-scroll { overflow-x: auto; }
.td-actions { white-space: nowrap; text-align: right; }
.td-actions form, .td-actions .btn { display: inline-block; margin-left: 4px; }
.ct-email { font-weight: 500; }
.ct-main td { border-bottom: none; }
.ct-divider td { padding: 4px 10px 8px; border-bottom: 1px solid var(--line); }
.ct-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-actions-row .badge { font-size: 11px; padding: 2px 7px; }
.ct-action-btns { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lists-card .ct-divider .ct-actions-row { justify-content: flex-end; }
.lists-card .ct-divider .ct-action-btns { margin-left: auto; }
.view-card .ct-divider .ct-actions-row { width: fit-content; }
.view-card .ct-divider .ct-action-btns { }
.camp-card .ct-divider .ct-actions-row { justify-content: flex-end; }
.camp-card .ct-divider .ct-action-btns { margin-left: auto; }
.td-progress { min-width: 160px; }
.bar {
  height: 8px; background: var(--bar-bg); border-radius: 99px; overflow: hidden;
  width: 130px; display: inline-block; vertical-align: middle;
}
.bar.big { width: 100%; height: 10px; margin: 10px 0; }
.bar-fill {
  height: 100%; border-radius: 99px; transition: width .4s;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  box-shadow: 0 0 8px rgba(var(--brand-rgb), 0.5);
}
.bar-label { font-size: 12px; color: var(--muted); margin-left: 8px; }
.import-actions { display: flex; align-items: center; gap: 8px; }
.import-actions input[type="text"] { flex: 1; }
.confirm-row { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.confirm-row .cards { margin-bottom: 0; flex: 0 0 auto; }
.import-side { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.import-btn-row { display: flex; gap: 8px; }
#importStartBtn { flex: 1; }
@media (max-width: 640px) {
  .confirm-row { flex-direction: column; }
}
.import-progress { margin-top: 20px; }
.import-progress-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 600; }
.import-progress-stats { font-size: 13px; color: var(--muted); margin-top: 4px; }
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tooltip ---------- */
.tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--border);
  font-size: 10px; font-weight: 700; color: var(--muted); cursor: help;
  vertical-align: middle; margin-left: 4px; line-height: 1;
}
.tip .tip-popup {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); width: 260px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15); font-size: 12px; font-weight: 400;
  line-height: 1.5; color: var(--ink); white-space: normal; z-index: 100;
  pointer-events: none;
}
.tip .tip-popup::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--card);
}
.tip:hover .tip-popup { display: block; }

/* ---------- preview tabs ---------- */
.preview-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--line); margin-bottom: 0;
}
.preview-tab {
  padding: 6px 16px; border: none; background: none; font-size: 13px;
  font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.preview-tab:hover { color: var(--ink); }
.preview-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.preview-tab-body { padding-top: 10px; }
.preview-tab-body iframe {
  width: 100%; height: 380px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--input-bg);
}
.preview-tab-body pre {
  white-space: pre-wrap; background: var(--input-bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; color: var(--ink); font-size: 13px;
  line-height: 1.55; max-height: 380px; overflow-y: auto; margin: 0;
}

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-running, .badge-completed, .badge-opened { background: rgba(0,170,77,.15); color: #00AA4D; }
.badge-accepted { background: #f3e8ff; color: #7e22ce; }
.badge-draft, .badge-paused { background: #e2e8f0; color: #475569; }
.badge-deferred { background: #fef9c3; color: #ca8a04; }
.badge-bounced { background: #f4e3d2; color: #92400e; }
.badge-failed { background: #fee2e2; color: var(--danger); }
.badge-info { background: #e0f2fe; color: #0369a1; }

html[data-theme="dark"] .badge-running, html[data-theme="dark"] .badge-completed,
html[data-theme="dark"] .badge-opened { background: rgba(0,170,77,.16); color: #00AA4D; }
html[data-theme="dark"] .badge-accepted { background: rgba(168,85,247,.18); color: #c084fc; }
html[data-theme="dark"] .badge-draft, html[data-theme="dark"] .badge-paused { background: rgba(148,163,184,.18); color: #cbd5e1; }
html[data-theme="dark"] .badge-deferred { background: rgba(234,179,8,.16); color: #eab308; }
html[data-theme="dark"] .badge-bounced { background: rgba(146,64,14,.22); color: #d2854c; }
html[data-theme="dark"] .badge-failed { background: rgba(239,68,68,.16); color: #f87171; }
html[data-theme="dark"] .badge-info { background: rgba(56,189,248,.18); color: #7dd3fc; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 5px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--input-bg); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(var(--brand-rgb), 0.4); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(var(--brand-rgb), .35); border-color: var(--brand2);
  box-shadow: 0 0 0 5px rgba(var(--brand-rgb), 0.08);
}
/* Dropdowns: glass aesthetic (transparent overlay + blur) */
select {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--glass-border);
  cursor: pointer;
}
textarea { resize: vertical; font-family: Consolas, Menlo, monospace; font-size: 13px; line-height: 1.5; }
textarea.code { min-height: 340px; }
.field { margin-bottom: 12px; }
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px;
}
.form-grid .span2 { grid-column: span 2; }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.form-row .form-row { margin: 0; }
.form-row .grow { flex: 1; min-width: 160px; }
.inline { display: inline; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg label {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  cursor: pointer; font-weight: 500; font-size: 13px; margin: 0;
  background: var(--input-bg);
  transition: background .2s, border-color .2s, transform .2s;
}
.seg label:hover { border-color: var(--brand2); transform: translateY(-1px); }
.seg label:has(input:checked) { background: var(--chip-bg); border-color: var(--brand2); color: var(--brand); }
.seg input { display: none; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; margin: 6px 0; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--btn-bg); color: var(--ink);
  transition: transform .2s, box-shadow .2s, filter .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(.97); text-decoration: none; box-shadow: 0 6px 14px rgba(17,24,39,.08); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.3);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 22px rgba(var(--brand-rgb), 0.4); }
body:not([data-page="dashboard"]) .topbar-actions .btn-primary {
  background: transparent;
  border: 1.5px solid var(--brand);
  color: var(--ink);
  box-shadow: none;
}
body:not([data-page="dashboard"]) .topbar-actions .btn-primary:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.3);
}
html[data-theme="dark"] body:not([data-page="dashboard"]) .topbar-actions .btn-primary {
  color: #fff;
}
html[data-theme="dark"] body:not([data-page="dashboard"]) .topbar-actions .btn-primary:hover {
  color: #fff;
}
body:not([data-page="dashboard"]) .card-head .btn-primary {
  background: transparent;
  border: 1.5px solid var(--brand);
  color: var(--ink);
  box-shadow: none;
}
body:not([data-page="dashboard"]) .card-head .btn-primary:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.3);
}
html[data-theme="dark"] body:not([data-page="dashboard"]) .card-head .btn-primary {
  color: #fff;
}
html[data-theme="dark"] body:not([data-page="dashboard"]) .card-head .btn-primary:hover {
  color: #fff;
}
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: #fff; box-shadow: 0 8px 18px rgba(220,38,38,.3); }
.btn-ghost { background: var(--input-bg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand2); color: var(--brand); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-plus { display: inline-block; font-size: 16px; font-weight: 700; line-height: 1; vertical-align: -2px; margin-right: 3px; }
.btn-block { width: 100%; }

html[data-theme="dark"] .btn-danger { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.3); }
html[data-theme="dark"] .btn-danger:hover { background: var(--danger); color: #fff; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.small, .muted, .stat-label, .urole, .bar-label, .help-desc, .dz-sub, .card-help { font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 300; }
.flash {
  padding: 11px 14px; border-radius: 10px; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-weight: 500;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.flash-success { background: rgba(0,170,77,.14); color: #00AA4D; border-color: rgba(0,170,77,.3); }
.flash-error { background: rgba(239,68,68,.1); color: #7f1d1d; border-color: rgba(239,68,68,.25); }
.flash-info { background: rgba(14,165,233,.1); color: #075985; border-color: rgba(14,165,233,.25); }
.flash-x { background: none; border: none; font-size: 16px; cursor: pointer; color: inherit; }
html[data-theme="dark"] .flash-success { color: #00AA4D; }
html[data-theme="dark"] .flash-error { color: #fca5a5; }
html[data-theme="dark"] .flash-info { color: #7dd3fc; }

.grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.grid-2 > *, .cards > * { min-width: 0; } /* grid items must be allowed to shrink */
.lists-import-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.lists-import-grid .card { margin-bottom: 0; }
.lists-import-grid .att-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.lists-import-grid .att-item:hover { border-color: var(--brand2); background: var(--chip-bg); transform: translateY(-1px); }
.lists-import-grid .att-item .btn { flex-shrink: 0; }
.card-help pre, .card pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 12px; }
.cron-copy-row { display: flex; align-items: center; gap: 10px; }
.cron-copy-row pre { flex: 1; min-width: 0; margin: 0; padding: 10px 14px; }
.cron-copy-row pre code { white-space: normal; word-break: break-all; }
.cron-copy-row .btn { flex-shrink: 0; }
.cron-collapse { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cron-collapse summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--brand);
  user-select: none; transition: background .15s;
}
.cron-collapse summary::-webkit-details-marker { display: none; }
.cron-collapse summary:hover { background: var(--chip-bg); }
.cron-collapse .cron-chev { transition: transform .2s; flex-shrink: 0; }
.cron-collapse[open] .cron-chev { transform: rotate(180deg); }
.cron-collapse .cron-collapse-body { padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip {
  background: var(--chip-bg); color: var(--brand); border: 1px solid var(--chip-border);
  padding: 3px 10px; border-radius: 99px; font-size: 12px; cursor: pointer;
  user-select: none;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.chip:hover { transform: scale(1.06); filter: brightness(.96); box-shadow: 0 4px 10px rgba(var(--brand-rgb), 0.2); }
.chip-mail { background: rgba(0,170,77,.14); color: #00AA4D; border-color: rgba(0,170,77,.3); }
html[data-theme="dark"] .chip { color: #00AA4D; }
html[data-theme="dark"] .chip-mail { background: rgba(0,170,77,.16); color: #00AA4D; border-color: rgba(0,170,77,.35); }
.chip.muted { cursor: default; background: var(--btn-bg); color: var(--muted); border-color: var(--line); }
.chip.muted:hover { transform: none; box-shadow: none; filter: none; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.page-link {
  min-width: 30px; text-align: center; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.page-link:hover { transform: translateY(-2px); border-color: var(--brand2); text-decoration: none; }
.page-link.cur {
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(var(--brand-rgb), 0.35);
}
.panel {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 14px; background: var(--panel2);
}
.pointer { cursor: pointer; font-weight: 600; color: var(--brand); }
.filters {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
#txFilterForm { flex-wrap: nowrap; gap: 8px; }
#txFilterForm select { flex: 0 0 30%; min-width: 0; }
.chart-toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.chart-toggles .check {
  margin: 0; font-size: 12px; cursor: pointer;
  padding: 6px 12px; border-radius: 99px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.chart-toggles .check:hover { border-color: var(--brand2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--brand-rgb), .12); }
.chart-toggles .check:has(input:checked) { background: var(--chip-bg); border-color: var(--brand2); color: var(--brand); }
.chart-toggles .check input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  margin: 0; cursor: pointer; flex-shrink: 0;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
  transition: all .15s;
}
.chart-toggles .check input:checked {
  border-color: var(--brand);
  background: radial-gradient(circle, #fff 0 32%, transparent 34%), var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15), 0 0 10px rgba(var(--brand-rgb), .35);
}
.chart-wrap {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 14px 16px;
  min-height: 320px;
  position: relative;
  box-shadow: var(--shadow);
}
.chart-wrap canvas, .tx-chart-box { display: block; width: 100%; }
#chartStatus { text-align: center; padding: 6px 0 0; }
#txTooltip {
  position: absolute; pointer-events: none; z-index: 5;
  padding: 8px 10px; border-radius: 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  font-size: 12px; line-height: 1.5; color: var(--ink);
  opacity: 0; transition: opacity .12s; white-space: nowrap;
}

/* ---------- spinners & live state ---------- */
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
.spin[hidden] { display: none !important; }
.spin-green {
  border-color: rgba(var(--brand-rgb), .25); border-top-color: var(--brand);
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.live-pill {
  display: inline-flex; align-items: center;
  margin-top: 10px; padding: 7px 14px;
  border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--chip-bg); color: var(--brand);
  border: 1px solid var(--chip-border);
}
.live-pill[hidden] { display: none; }
.live-pill.paused {
  background: var(--btn-bg);
  color: var(--muted);
  border-color: var(--line);
}
.bar-fill.live {
  background: linear-gradient(90deg, var(--brand), var(--brand2), var(--brand));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- modal (glass) ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--glass-strong); color: var(--ink);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  width: min(860px, 100%);
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; }
#confirmMsg { white-space: pre-line; }
.modal-sm { width: min(430px, 100%); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.modal-body { flex: 1; overflow: auto; padding: 14px 18px; }
.modal-body iframe { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.modal-body pre { white-space: pre-wrap; background: var(--panel2); padding: 12px; border-radius: 8px; }

/* ---------- help popover ---------- */
.help { position: relative; display: inline-block; vertical-align: middle; }
.help-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 6px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--muted);
  font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.help-q:hover, .help.open .help-q {
  background: var(--brand); color: #fff; border-color: transparent;
  transform: scale(1.08);
}
.help-pop {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: 360px; max-width: calc(100vw - 48px);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0,0,0,.22);
  padding: 16px;
  z-index: 130;
  opacity: 0; visibility: hidden;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  cursor: default;
  font-weight: 400;
}
.help-pop::before {
  content: '';
  position: absolute; top: -7px; left: 22px;
  width: 12px; height: 12px;
  background: var(--glass-strong);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  transform: rotate(45deg);
}
.help:hover .help-pop, .help.open .help-pop,
.help-q:focus-visible + .help-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.help-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.help-desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.help-desc code {
  background: var(--chip-bg); border: 1px solid var(--chip-border);
  color: var(--brand); border-radius: 4px; padding: 0 4px; font-size: 12px;
}
.help-video {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
  background: #0f172a;
  margin-bottom: 12px;
}
.help-video video { display: block; width: 100%; }
.help-video-placeholder {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px; color: #94a3b8; font-size: 12px; line-height: 1.5;
}
.help-play {
  flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--brand-rgb), 0.2);
  color: var(--brand2); font-size: 16px;
  box-shadow: 0 0 0 6px rgba(var(--brand-rgb), 0.12);
}
.help-video-placeholder code { color: #7dd3fc; }
.help-mini { overflow: hidden; border-radius: 8px; border: 1px solid var(--line); }
.help-sheet { width: 100%; border-collapse: collapse; font-size: 12px; }
.help-sheet th {
  background: rgba(var(--brand-rgb), 0.14); color: var(--brand);
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.help-sheet td {
  padding: 6px 9px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.help-sheet tr:last-child td { border-bottom: none; }
.help-sheet td:first-child { border-right: 1px solid var(--line); }
.help-sheet td:nth-child(2) { border-right: 1px solid var(--line); }

/* ---------- attachments ---------- */
.att-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.att-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; background: var(--input-bg);
  transition: border-color .2s, background .2s;
}
.att-item:hover { border-color: var(--brand2); background: var(--chip-bg); }
.att-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.att-pin { opacity: .7; }

/* ---------- upload dropzone ---------- */
.dropzone {
  border: 2px dashed var(--dropzone-border);
  border-radius: 14px;
  background: var(--dropzone-bg);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.dropzone:hover, .dropzone.dragover, .dropzone:focus {
  background: var(--chip-bg);
  border-color: var(--brand2);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(var(--brand-rgb), 0.15);
  outline: none;
}
.dz-icon {
  font-size: 36px; color: var(--brand2); line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(var(--brand-rgb), 0.4));
}
.dz-title { font-weight: 600; font-size: 15px; margin: 12px 0 4px; }
.dz-sub { color: var(--muted); font-size: 13px; }
.dz-link { color: var(--brand); font-weight: 600; }
.dz-file {
  margin-top: 16px; display: inline-block;
  background: var(--chip-bg); border: 1px solid var(--chip-border); color: var(--brand);
  border-radius: 99px; padding: 6px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.15);
}
.dz-error { color: var(--danger); margin-top: 12px; font-size: 13px; font-weight: 600; }
.dz-progress { margin-top: 16px; text-align: center; }
.dz-progress .bar.big { margin: 6px 0; }
.dz-progress[hidden] { display: none; }

/* ---------- profile picture ---------- */
.profile-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%; aspect-ratio: 1;
  object-fit: cover; flex: 0 0 auto;
  border: 3px solid var(--brand);
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.3);
}
.profile-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; font-size: 30px; font-weight: 700;
}
.profile-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 200px; }
.profile-actions .form-row { margin: 0; flex-wrap: nowrap; }
.profile-actions input[type="file"] { width: auto; max-width: 100%; min-width: 0; }
input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  margin-right: 10px;
  box-shadow: 0 4px 10px rgba(var(--brand-rgb), 0.25);
  transition: filter .2s, transform .2s;
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.05); transform: translateY(-1px); }

.dropzone-sm { padding: 26px 16px; }
.att-progress { margin-top: 14px; text-align: center; }
.att-progress .bar.big { margin: 6px 0; }
.att-progress[hidden] { display: none; }

/* ---------- media library (hosted email-body images) ---------- */
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.field-label-row label { margin-bottom: 0; }
.media-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel2); }
.media-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.media-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 5px; background: var(--panel); min-width: 0; }
.media-item.media-insert { cursor: pointer; text-align: left; font-family: inherit; color: inherit; width: 100%; transition: border-color .2s, transform .2s; }
.media-item.media-insert:hover { border-color: var(--brand2); transform: translateY(-1px); }
.media-thumb { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; background: var(--input-bg); display: block; }
.media-insert .media-thumb { height: 70px; }
.media-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.media-btn-row { display: flex; gap: 6px; }
.media-btn-row .btn { flex: 1; text-align: center; }

.campaign-meta .meta-chunk { display: inline-block; margin-right: 14px; }

/* ---------- rich text editor (formatted text body) ---------- */
.rt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: var(--panel2); border: 1px solid var(--line); border-bottom: none;
  border-radius: 10px 10px 0 0;
}
.rt-btn {
  min-width: 30px; height: 30px; padding: 0 9px;
  font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 7px;
  cursor: pointer; transition: border-color .2s, transform .15s;
}
.rt-btn:hover { border-color: var(--brand2); color: var(--brand); transform: translateY(-1px); }
.rt-select {
  width: auto; height: 30px; padding: 0 6px; font-size: 12px;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 7px;
  color: var(--ink);
}
.rt-color {
  width: 36px; height: 30px; padding: 2px;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 7px;
  cursor: pointer;
}
.rt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.rt-editor {
  min-height: 220px; max-height: 430px; overflow-y: auto;
  padding: 10px 12px; margin: 0;
  background: var(--input-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 0 0 10px 10px;
  font-size: 14px; line-height: 1.6;
  transition: border-color .2s, box-shadow .2s;
}
.rt-editor:focus {
  outline: 2px solid rgba(var(--brand-rgb), .35); border-color: var(--brand2);
  box-shadow: 0 0 0 5px rgba(var(--brand-rgb), 0.08);
}
.rt-editor div { min-height: 1.2em; }
.rt-editor ul, .rt-editor ol { padding-left: 26px; margin: 4px 0; }
.rt-editor a { color: var(--brand); }

/* ---------- login (glass) ---------- */
.login-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: linear-gradient(135deg, #0c1a12 0%, #053d22 60%, #003d1c 100%);
}
.login-body::before {
  content: '';
  position: fixed; width: 560px; height: 560px; border-radius: 50%;
  top: -140px; right: -120px;
  background: radial-gradient(circle, rgba(0, 170, 77, 0.35), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}
.login-card {
  background: var(--glass-strong); color: var(--ink);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 36px;
  width: min(380px, 92vw);
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-brand { padding: 0 0 16px; color: var(--ink); }
.login-sub { color: var(--muted); margin: 22px 0 26px; text-align: center; }
.login-card label { margin-top: 12px; }
.login-card .btn { margin-top: 18px; }
.login-card .btn-primary:hover { transform: translateY(-2px); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: none;
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar, .sidebar.open { z-index: 95; }
  .main { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px 10px; align-items: flex-start; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 14px 14px 32px; overflow-x: hidden; }
  .grid-2 { grid-template-columns: 1fr; }
  .lists-import-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .chart-wrap { min-height: 260px; padding: 8px; }
  textarea.code { min-height: 240px; }
  .dropzone { padding: 28px 14px; }
  .modal-box { width: 100%; }
  .table { font-size: 12px; }
  .bar { width: 90px; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .cards { grid-template-columns: 1fr 1fr; }
  .cards .card.stat { padding: 12px; }
  .stat-num { font-size: 20px; }
  .topbar { flex-wrap: nowrap; align-items: center; }
  .topbar-left { flex: 1 1 auto; min-width: 0; }
  .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { width: auto; flex: 0 0 auto; }
  .topbar-actions .btn { flex: none; }
  .filters .form-row { width: 100%; }
  .filters select { flex: 1; min-width: 120px; }
  #txFilterForm { flex-wrap: nowrap; }
  #txFilterForm select { flex: 0 0 30%; min-width: 0; }
  .card { padding: 14px 12px; }
  .card-head { flex-direction: column; align-items: stretch; }
  .card-head .form-row { width: 100%; margin: 6px 0 0; gap: 8px; row-gap: 8px; }
  .card-head .form-row form.inline { display: flex; flex: 1 1 auto; }
  .card-head .form-row form.inline .btn { flex: 1; text-align: center; }
  .card-head .form-row > .btn { flex: 1 1 auto; text-align: center; }
  .bar.big { height: 12px; width: 100%; }
  .live-pill { width: auto; max-width: 100%; justify-content: flex-start; text-align: left; }
  .live-pill .pill-detail { display: none; }
  /* Keep campaign action buttons compact like desktop instead of stretched full-width */
  body[data-page="campaigns/view"] .card-head .form-row { flex-wrap: wrap; }
  body[data-page="campaigns/view"] .card-head .form-row form.inline { flex: 0 0 auto; }
  body[data-page="campaigns/view"] .card-head .form-row form.inline .btn,
  body[data-page="campaigns/view"] .card-head .form-row > .btn { flex: 0 0 auto; white-space: nowrap; }
  .campaign-meta .meta-chunk { display: block; margin: 0 0 4px 0; }
  .td-actions { white-space: normal; }
  .td-actions .btn, .td-actions form { margin: 2px; }
  .pager { gap: 4px; }
  .profile-actions { min-width: 100%; }
  .view-card > .form-row { flex-direction: column; align-items: stretch; }
  .view-card > .form-row .form-row { flex-direction: row; }
  .placeholder-help { display: none; }
  .camp-card .ct-divider .ct-actions-row { justify-content: flex-start; overflow: visible; flex-wrap: wrap; }
  .camp-card .ct-divider .ct-action-btns { flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }
}

/* Lead Generator wizard */
body[data-page="leads"] .main { height: 100vh; overflow: hidden; }
body[data-page="leads"] .content { overflow: hidden; }
.lead-wizard-wrap { max-width: none; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.lead-wizard-wrap .seg { margin-bottom: 12px; }
.lead-step { flex: 1; min-height: 0; display: none; flex-direction: column; }
.lead-step.active { display: flex; }
.lead-step-scroll { flex: 1; min-height: 0; }
.lead-step-nav { display: flex; gap: 10px; padding: 12px 0 0; flex-shrink: 0; border-top: 1px solid var(--line); margin-top: auto; max-width: 600px; }
.lead-step-nav .btn { flex: 1; }
.chip-preset { cursor: pointer; display: none; }
.chip-preset.selected { background: var(--chip-bg); border-color: var(--brand2); color: var(--brand); }
.lead-custom-cat { margin-top: 12px; }
.lead-sel-heading { font-weight: 600; font-size: .78em; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .5px; }
.lead-sel-heading:first-child { margin-top: 0; }
#selectedCats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-selected { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; background: var(--chip-bg); border: 1px solid var(--chip-border); font-size: .88em; }
.chip-x { background: none; border: none; cursor: pointer; font-size: 1.1em; color: var(--muted); padding: 0 2px; }
.chip-x:hover { color: var(--danger); }

/* Saved category lists in wizard */
.lead-saved-lists { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.lead-saved-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--chip-bg); border: 1px solid var(--chip-border);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.lead-saved-item:hover { background: rgba(0,170,77,.1); border-color: var(--brand); }
.lead-saved-name { font-weight: 600; font-size: .88em; color: var(--ink); }
.lead-saved-count { font-size: .75em; color: var(--muted); }

/* Lead location layout */
.lead-sec-head { font-weight: 700; font-size: 1em; margin-bottom: 2px; }
.lead-map-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: row; }
.lead-map-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; z-index: 10;
  transition: opacity 0.4s ease;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 28px 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.lead-map-overlay-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 1.3em;
  color: var(--muted); cursor: pointer; line-height: 1;
  padding: 4px;
}
.lead-map-overlay-close:hover { color: var(--ink); }
.lead-map-overlay-step {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand);
  color: #fff; font-weight: 700; font-size: 1em; display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 8px;
}
.lead-map-overlay-title { font-size: 1.2em; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.lead-map-overlay-desc { font-size: .88em; color: var(--muted); max-width: 280px; }
.lead-overlay-hide {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; font-size: .82em; font-weight: 500;
  color: var(--muted); cursor: pointer;
}
.lead-overlay-hide input { accent-color: var(--brand); cursor: pointer; }
.lead-overlay-save { display: block; margin: 8px auto 0; }

/* Country selector + search: top bar spanning the map width */
.lead-topbar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 30;
  display: flex; align-items: center; gap: 8px;
}
.lead-country-select { position: relative; flex-shrink: 0; }
.lead-country-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 12px 0 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 13px; font-weight: 500; color: var(--ink);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transition: border-color .2s, transform .2s;
}
.lead-country-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.lead-country-flag {
  display: inline-flex; width: 24px; height: 16px; border-radius: 3px;
  overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.lead-country-flag[hidden] { display: none; }
.lead-country-flag .lead-country-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 3px; }
.lead-country-chev { flex-shrink: 0; opacity: .7; }
.lead-country-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 180px; z-index: 40;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16); overflow: hidden;
}
.lead-country-menu[hidden] { display: none; }
.lead-country-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: none; background: none; cursor: pointer;
  font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 13px; font-weight: 500; color: var(--ink);
  text-align: left; transition: background .12s;
}
.lead-country-opt:hover { background: var(--chip-bg); }
.lead-country-opt + .lead-country-opt { border-top: 1px solid var(--line); }

/* Search inside map (just wider than the country selector) */
.lead-map-search { position: relative; flex: 0 0 240px; width: 240px; min-width: 0; }
.lead-map-search input {
  width: 100%; height: 38px; padding: 0 36px 0 36px; border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px; font-weight: 500; color: var(--ink);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.lead-search-spinner {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(var(--brand-rgb), .25); border-top-color: var(--brand);
  animation: lead-spin .6s linear infinite;
  pointer-events: none;
}
.lead-search-spinner[hidden] { display: none; }
.lead-search-icon {
  position: absolute; top: 50%; left: 12px; transform: translateY(-50%);
  width: 17px; height: 17px; pointer-events: none; opacity: .9;
  color: var(--muted); z-index: 1;
}
.lead-map-search input::placeholder {
  color: var(--muted); font-weight: 300; opacity: .85;
}
.lead-map-search input:focus { outline: none; border-color: var(--brand); }
.lead-map-search .lead-loc-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  margin-top: 4px;
}

/* Bottom bar inside map */
.lead-map-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border);
  border-radius: 0 0 12px 12px;
  gap: 8px;
  flex-shrink: 0;
}
.lead-history-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--glass-border); background: var(--glass-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink); font-size: .82em; font-weight: 500;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.lead-history-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.lead-history-btn svg { flex-shrink: 0; }
.lead-session-progress { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.lead-session-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bar-bg); overflow: hidden; min-width: 60px; }
.lead-session-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .4s; width: 0; }
.lead-session-text { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.lead-map-bottom .btn { flex-shrink: 0; }
.lead-map-chips-wrap {
  flex: 1; min-width: 0; max-width: calc(100% - 180px); position: relative; overflow: hidden;
}
.lead-map-chips-scroll {
  display: flex; flex-wrap: nowrap; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  max-height: 34px;
  white-space: nowrap;
}
.lead-map-chips-scroll::-webkit-scrollbar { display: none; }
.lead-map-chips-scroll:active { cursor: grabbing; }
.lead-map-chips-scroll .chip-selected {
  flex-shrink: 0; white-space: nowrap;
  background: transparent; color: #000; border-color: var(--brand);
}
html[data-theme="dark"] .lead-map-chips-scroll .chip-selected { color: #fff; }
.lead-map-chips-scroll .chip-x { color: rgba(0,0,0,.5); }
.lead-map-chips-scroll .chip-x:hover { color: var(--brand); }
html[data-theme="dark"] .lead-map-chips-scroll .chip-x { color: rgba(255,255,255,.7); }
html[data-theme="dark"] .lead-map-chips-scroll .chip-x:hover { color: #fff; }
#leadMap { width: 100%; flex: 1; border-radius: 12px; border: 1px solid var(--line); min-height: 260px; position: relative; overflow: hidden; }

/* Category tabs scroll wrapper */
.cat-tabs-wrap { position: relative; }
.cat-tabs-scroll {
  display: flex; gap: 4px; overflow-x: auto; padding: 0 4px 10px; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; cursor: grab;
  scroll-padding: 0 4px;
}
.cat-tabs-scroll::-webkit-scrollbar { display: none; }
.cat-tabs-scroll.dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }

.cat-tabs-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all .15s; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cat-tabs-arrow:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.cat-tabs-arrow.hidden { opacity: 0; pointer-events: none; }
.cat-tabs-arrow svg { width: 16px; height: 16px; }
.cat-tabs-arrow.left { left: 2px; }
.cat-tabs-arrow.right { right: 2px; }

.cat-tab {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; transition: all .15s;
  min-width: 80px; flex-shrink: 0; font-size: .78em; color: var(--ink);
  position: relative;
}
.cat-tab:hover { border-color: var(--brand2); background: var(--chip-bg); transform: translateY(-1px); }
.cat-tab:active { transform: scale(.97); }
.cat-tab.active { border-color: var(--brand); background: var(--brand); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--brand-rgb), .25); }
.cat-tab.active .cat-tab-icon svg { stroke: #fff; }
.cat-tab.has-selected { border-color: var(--brand); }
.cat-tab.has-selected .cat-tab-icon svg { stroke: var(--brand); }
.cat-tab.active.has-selected .cat-tab-icon svg { stroke: #fff; }

.cat-tab-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.cat-tab-icon svg { width: 22px; height: 22px; }
.cat-tab-name { font-weight: 600; white-space: nowrap; line-height: 1.2; }
.cat-tab-count {
  position: absolute; top: 4px; right: 4px; font-size: .65em; font-weight: 700;
  background: var(--brand); color: #fff; border-radius: 50%; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.cat-tab.active .cat-tab-count { background: #fff; color: var(--brand); }

/* Category panels */
.cat-panel-wrap { position: relative; min-height: 60px; overflow: hidden; }

.cat-panel { display: none; animation: catPanelDrop .3s ease-out; }
.cat-panel.active { display: block; }
@keyframes catPanelDrop {
  0% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.cat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cat-panel-title { font-weight: 600; font-size: .92em; color: var(--ink); }
.cat-select-all {
  border: none; background: none; color: var(--brand); font-size: .8em;
  font-weight: 600; cursor: pointer; padding: 0;
}
.cat-select-all:hover { text-decoration: underline; }

.cat-panel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.cat-chip {
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); font-size: .82em; color: var(--ink);
  cursor: pointer; transition: all .12s; white-space: nowrap; text-align: left;
}
.cat-chip:hover { border-color: var(--brand2); background: var(--chip-bg); }
.cat-chip.selected { border-color: var(--brand); background: var(--brand); color: #fff; }

.lead-custom-cat input { max-width: 280px; }

.lead-qty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip-qty {
  cursor: pointer; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); text-align: center; transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.chip-qty:hover { border-color: var(--brand2); }
.chip-qty.active { background: var(--chip-bg); border-color: var(--brand2); font-weight: 600; }
.chip-qty-num { font-size: 1em; font-weight: 600; color: var(--ink); }
.chip-qty.active .chip-qty-num { color: var(--brand); }
.chip-qty-price { font-size: .82em; color: var(--muted); }
.chip-qty.active .chip-qty-price { color: var(--brand2); }
.chip-free { border-color: #00AA4D; }
.chip-free .chip-qty-price { color: #00AA4D; font-weight: 600; }
.chip-free:hover { border-color: #00AA4D; background: rgba(0,170,77,.06); }
.chip-free.chip-used { border-color: var(--line); }
.chip-free.chip-used .chip-qty-price { color: var(--muted); font-weight: 400; }
html[data-theme="dark"] .chip-qty-num { color: #fff; }
html[data-theme="dark"] .chip-qty.active .chip-qty-num { color: var(--brand); }

.lead-free-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--brand); color: #fff; font-size: .75em; font-weight: 700; margin-left: 4px; }
.lead-price-display { text-align: center; }
.lead-price-card { display: inline-block; padding: 16px 32px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.lead-price-label { font-size: .85em; color: var(--muted); margin-bottom: 4px; }
.lead-price-value { font-size: 28px; font-weight: 700; color: var(--brand); }
.lead-summary { margin-top: 8px; }
.lead-nav { display: flex; gap: 10px; justify-content: flex-end; padding: 10px 0 0; flex-shrink: 0; }

/* Loading spinner */
.lead-spinner {
  display: inline-block; width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: lead-spin .6s linear infinite;
  vertical-align: middle; margin-right: 4px;
}
@keyframes lead-spin { to { transform: rotate(360deg); } }
.lead-progress-bar { width: 100%; height: 8px; border-radius: 4px; background: var(--bar-bg); overflow: hidden; margin-bottom: 10px; display: none; }
.lead-progress-fill { height: 100%; width: 0; border-radius: 4px; background: var(--brand); transition: width .4s ease; }
.lead-progress-stage { font-size: .92em; color: var(--muted); text-align: center; }

/* --- Location autocomplete --- */
.lead-loc-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 300px; overflow-y: auto;
  margin-top: 4px;
}
.lead-loc-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.lead-loc-item:last-child { border-bottom: none; }
.lead-loc-item:hover { background: var(--chip-bg); }
.lead-loc-item strong { font-size: .95em; color: var(--ink); }
.lead-loc-item span { font-size: .82em; color: var(--muted); }
.lead-loc-empty { color: var(--muted); font-size: .9em; text-align: center; cursor: default; }
.lead-loc-empty:hover { background: none; }
.lead-type-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: .7em; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; margin-left: 6px; vertical-align: middle; }
.lead-type-badge.badge-province { background: rgba(0,170,77,.13); color: #00AA4D; }
.lead-type-badge.badge-mainplace { background: rgba(0,170,77,.13); color: #00AA4D; }

/* Step nav right-justified button */
.seg-right-btn { margin-left: auto; }

/* Previous Generations fullscreen modal */
.lead-gens-modal {
  display: none; position: fixed; inset: 0; left: 230px; z-index: 9999;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.lead-gens-modal.open { display: flex; }
.lead-gens-modal-inner {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; width: 100%; max-width: 960px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
}
.lead-gens-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.lead-gens-modal-head h3 { margin: 0; font-size: 1.1em; }
.lead-gens-modal-close {
  background: none; border: none; font-size: 1.5em;
  color: var(--muted); cursor: pointer; padding: 4px 8px;
  line-height: 1;
}
.lead-gens-modal-close:hover { color: var(--ink); }
.lead-gens-modal-body {
  overflow: auto; padding: 16px 20px; flex: 1;
}
.lead-gens-mobile-row { display: none; }
.lead-gens-country {
  display: inline-block; margin-left: 4px; padding: 1px 6px;
  border-radius: 4px; background: var(--chip-bg); color: var(--brand);
  font-size: .7em; font-weight: 700; vertical-align: middle;
}
.lead-gens-mobile-date { font-size: .85em; color: var(--muted); margin-left: 8px; }
.lead-gens-mobile-actions { margin-left: auto; display: inline-flex; gap: 6px; }

/* Lead results page - 100vh no scroll */
body[data-page="leads/results"] .content {
  overflow: hidden;
  padding: 12px 28px 12px;
}
body[data-page="leads/results"] .card {
  margin-bottom: 12px;
}
body[data-page="leads/results"] .card:last-child {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
body[data-page="leads/results"] .card:last-child > div[style*="overflow-x"] {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}
body[data-page="leads/results"] .card:last-child .card-head {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  body[data-page="leads/results"] .content {
    padding: 10px 14px 10px;
  }
  body[data-page="leads/results"] .card-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  body[data-page="leads/results"] .card-head > div {
    display: flex;
    gap: 6px;
  }
}

@media (max-width: 900px) {
  .main { margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }
  body[data-page="leads"] .main { height: 100vh; overflow: hidden; }
  .lead-wizard-wrap { max-width: 100%; flex: 1; min-height: 0; overflow: hidden; }
  .lead-step { flex: 1; min-height: 0; }
  .lead-wizard-wrap[data-step="1"] #leadSteps { display: none; }
  .lead-map-wrap { position: fixed; top: 50px; left: 0; right: 0; bottom: 0; z-index: 70; border-radius: 0; border: none; }
  #leadMap { width: 100%; height: 100%; flex: none; border-radius: 0; border: none; }
  .lead-map-overlay { position: fixed; top: calc(50% + 25px); left: 50%; transform: translate(-50%, -50%); z-index: 95; }
  .lead-map-bottom { border-radius: 0; }
  .maplibregl-ctrl-top-right { top: 10px; }
  .lead-gens-modal { padding: 10px; left: 0; }
  .lead-gens-modal-inner { max-height: 95vh; }
  /* Step tabs: horizontal scroll, active tab centered */
  .lead-wizard-wrap .seg { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 6px; flex-shrink: 0; padding: 0 8px; scroll-behavior: smooth; }
  .lead-wizard-wrap .seg::-webkit-scrollbar { display: none; }
  .lead-wizard-wrap .seg label { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; font-size: .82em; cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
  .lead-wizard-wrap .seg label.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
  /* Step nav: fixed to the bottom, content scrolls above it */
  .lead-step { overflow: hidden; }
  .lead-step-scroll { padding-bottom: 78px; overflow-y: auto; }
  .lead-step-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    margin: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(0,0,0,.08);
  }
}
@media (max-width: 640px) {
  .main { margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }
  body[data-page="leads"] .main { height: 100vh; overflow: hidden; }
  .lead-wizard-wrap { max-width: 100%; flex: 1; min-height: 0; overflow: hidden; }
  .lead-step { flex: 1; min-height: 0; }
  .lead-map-wrap { position: fixed; top: 50px; left: 0; right: 0; bottom: 0; z-index: 70; border-radius: 0; border: none; }
  #leadMap { width: 100%; height: 100%; flex: none; border-radius: 0; border: none; }
  .lead-map-overlay { position: fixed; top: calc(50% + 25px); left: 50%; transform: translate(-50%, -50%); z-index: 95; }
  .lead-map-bottom { border-radius: 0; }
  .lead-qty-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  /* Search fills half the row on phones; country stays flag-only at its right */
  .lead-map-search { flex: 0 0 50%; width: 50%; min-width: 0; }
  /* Compact flag-only country button on phones, pinned right of the search */
  .lead-country-btn { padding: 0 8px; }
  .lead-country-btn .lead-country-name { display: none; }
  .lead-country-btn .lead-country-chev { display: none; }
  /* Results page: let the "Generating leads…" banner wrap on small screens */
  body[data-page="leads/results"] .flash-info { flex-wrap: wrap; }
  .lead-gens-modal-body { padding: 10px; }
  .lead-step-scroll { overflow-y: auto; }
  .lead-gens-modal-body .table { font-size: .82em; }
  .lead-gens-table thead { display: none; }
  .lead-gens-table tbody { display: block; }
  .lead-gens-table tbody tr { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .lead-gens-table tbody tr:first-child { padding-top: 0; }
  .lead-gens-table td { border: none; padding: 1px 0; font-size: .88em; }
  .lead-gens-table td:first-child { font-weight: 600; }
  .lead-gens-table .lead-gens-mobile-hide { display: none; }
  .lead-gens-table .lead-gens-mobile-row { display: flex !important; flex-basis: 100%; border-bottom: none; padding-top: 0; gap: 8px; align-items: center; }
  .lead-gens-table .lead-gens-mobile-row td { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
}

/* ---------- lead generator mobile: kill the white band on scroll ---------- */
body[data-page="leads"] { overscroll-behavior: none; background: var(--bg); }
body[data-page="leads"] .main { background: var(--bg); }
.lead-map-wrap { background: var(--bg); }
/* MapLibre attribution/logo are white by default — make them glassy */
.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--glass) !important; }
.maplibregl-ctrl-logo { filter: invert(0); }
body[data-page="leads"] .maplibregl-ctrl-group,
body[data-page="leads"] .maplibregl-ctrl-compass { display: none !important; }
html[data-theme="dark"] .maplibregl-ctrl-attrib,
html[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact { background: var(--glass) !important; }

@media (max-width: 900px) {
  body[data-page="leads"] .main { height: 100vh; height: 100dvh; }
  .lead-map-wrap {
    position: fixed; top: 50px; left: 0; right: 0; bottom: 0;
    height: calc(100dvh - 50px);
  }
}
@media (max-width: 640px) {
  body[data-page="leads"] .main { height: 100vh; height: 100dvh; }
  .lead-map-wrap {
    position: fixed; top: 50px; left: 0; right: 0; bottom: 0;
    height: calc(100dvh - 50px);
  }
}

/* Responsive category tabs */
@media (max-width: 640px) {
  .cat-tabs-arrow { width: 28px; height: 28px; }
  .cat-tabs-arrow svg { width: 14px; height: 14px; }
  .cat-tabs-arrow.left { left: 0; }
  .cat-tabs-arrow.right { right: 0; }
  .cat-tab { padding: 8px 10px; min-width: 68px; font-size: .72em; }
  .cat-tab-icon { font-size: 1.1em; }
}

/* ============================================================
   adhere.co.za — top bar + hamburger overlay nav
   ============================================================ */
.main { margin-left: 0; }
.main::before { display: none; }

.app-topbar {
  height: 50px;
  padding: 0 16px;
  flex-wrap: nowrap;
}
.app-topbar h1 { font-size: 16px; }
body[data-page="leads"] .app-topbar h1 { display: none; }

.app-brand { padding: 0; }
.app-brand .brand-logo { height: 28px; }
.app-brand .brand-logo-light { display: none; }
html[data-theme="light"] .app-brand .brand-logo-base { display: none; }
html[data-theme="light"] .app-brand .brand-logo-hover { display: none; }
html[data-theme="light"] .app-brand .brand-logo-light { display: block; }

.icon-btn, .hamburger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--glass);
  color: var(--ink); cursor: pointer; position: relative; z-index: 5;
  transition: transform .2s, border-color .2s;
  padding: 0;
}
.icon-btn:hover, .hamburger:hover { border-color: var(--brand2); }
.icon-btn:focus-visible, .hamburger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn-sun { display: none; }
.icon-btn-moon { display: none; }
.icon-btn-auto { display: none; }
html[data-theme="light"] .icon-btn-sun { display: block; }
html[data-theme="dark"] .icon-btn-moon { display: block; }

.hamburger { display: inline-flex; flex-direction: column; gap: 4px; }
.hb-bar { width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
.hamburger.open .hb-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open .hb-bar:nth-child(2) { opacity: 0; }
.hamburger.open .hb-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* overlay menu (drawer from the right) */
.nav-backdrop { z-index: 95; }
.side-menu {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 300px; max-width: 86vw;
  background: linear-gradient(180deg, rgba(16,20,24,.97), rgba(10,14,17,.95));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255,255,255,.08);
  color: var(--sidebar-ink);
  z-index: 100;
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,.35);
  visibility: hidden;
}
.side-menu.open { transform: translateX(0); visibility: visible; }
.side-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.side-menu-title { color: #fff; font-weight: 700; font-size: 16px; font-family: 'Zona', 'Segoe UI', Roboto, Arial, sans-serif; }
.side-menu-close { background: none; border: none; color: var(--sidebar-ink); font-size: 26px; cursor: pointer; line-height: 1; padding: 4px; }
.side-menu-close:hover { color: #fff; }
.side-menu-scroll { flex: 1; overflow-y: auto; padding: 10px 12px 18px; }
.side-link {
  display: flex; align-items: center; gap: 11px;
  color: var(--sidebar-ink); padding: 9px 12px; border-radius: 10px;
  font-weight: 500; font-size: 14px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; font-family: inherit;
  transition: background .2s, color .2s, transform .2s;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; transform: translateX(-3px); }
.side-link.active { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; box-shadow: 0 6px 16px rgba(var(--brand-rgb),.35); }
.side-link-sub { padding-left: 28px; font-size: 13px; }
.side-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  color: #7c8691; margin: 14px 12px 4px;
}
.side-link-soon { opacity: .45; cursor: default; pointer-events: none; }
.side-link-soon:hover { background: none; color: var(--sidebar-ink); transform: none; }
.side-link .side-ic { width: 16px; height: 16px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.side-logout { margin: 0; }
.side-logout .side-link { color: #f2a0a0; }
.side-logout .side-link:hover { background: rgba(220,38,38,.12); color: #fff; }
.side-menu-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08);
}
.side-menu-user .uname { display: block; }
.side-menu-user .urole { display: block; }

/* immersive map on the landing page */
body[data-page="leads"] .content { padding: 8px 12px; }
body[data-page="leads"] .lead-wizard-wrap .seg { margin-bottom: 8px; }

@media (max-width: 640px) {
  .app-topbar { height: 50px; padding: 0 12px; }
  .app-topbar h1 { font-size: 14px; }
  .app-brand .brand-logo { height: 30px; }
  .icon-btn, .hamburger { width: 36px; height: 36px; }
}

/* Wizard notice modal (required step) */
.lead-notice-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 140;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lead-notice-backdrop[hidden] { display: none; }
.lead-notice {
  width: 100%; max-width: 380px;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  text-align: center;
}
.lead-notice-step {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; font-weight: 700; font-size: 1.15em;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), .4);
}
.lead-notice-title { font-size: 1.15em; font-weight: 700; margin-bottom: 6px; }
.lead-notice-msg { font-size: .9em; color: var(--muted); line-height: 1.55; margin: 0 0 20px; }
.lead-notice-actions { display: flex; gap: 10px; justify-content: center; }

/* Theme picker (side menu) */
.theme-picker { display: flex; gap: 6px; padding: 2px 12px 6px; }
.tp-btn {
  flex: 1; padding: 7px 8px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--sidebar-ink); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s;
  font-family: inherit;
}
.tp-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.tp-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(var(--brand-rgb),.35); }

/* ============================================================
   Traditional desktop layout — sidebar (left) + top bar
   Mobile keeps the slim top bar + hamburger drawer.
   ============================================================ */
.nav-backdrop { z-index: 80; }

.nav-link.nav-sub { padding-left: 26px; font-size: 13px; }
.nav-link.nav-soon { opacity: .45; cursor: default; pointer-events: none; }
.nav-link.nav-soon:hover { background: none; color: var(--sidebar-ink); transform: none; }

@media (min-width: 901px) {
  .main { margin-left: 230px; }
  .app-topbar .app-brand { display: none; }
  .hamburger { display: none; }
}

@media (max-width: 900px) {
  .main { margin-left: 0; }
  body[data-page="leads"] .sidebar { display: flex; } /* usable as an off-canvas drawer */
  .app-topbar .app-brand { display: flex; }
  .hamburger { display: inline-flex; }
}

/* ---------- auth pages extras ---------- */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.password-wrap { position: relative; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; display: inline-flex; }
.password-toggle .eye-off { display: none; }
.password-toggle.visible .eye-on { display: none; }
.password-toggle.visible .eye-off { display: block; }
.strength-bar { display: flex; gap: 4px; margin-top: 6px; }
.strength-segment { flex: 1; height: 4px; border-radius: 3px; background: var(--bar-bg); transition: background .2s; }
.strength-segment.weak { background: #dc2626; }
.strength-segment.fair { background: #d97706; }
.strength-segment.good { background: #0ea5e9; }
.strength-segment.strong { background: var(--brand); }
.strength-text { font-size: 12px; margin-top: 4px; color: var(--muted); }
.strength-text.weak { color: #dc2626; } .strength-text.fair { color: #d97706; } .strength-text.good { color: #0ea5e9; } .strength-text.strong { color: var(--brand); }

/* Theme picker on light panels (profile page) */
.theme-picker-light { padding: 0; }
.tp-btn-light { border: 1px solid var(--line); background: var(--btn-bg); color: var(--ink); }
.tp-btn-light:hover { background: var(--bar-bg); color: var(--ink); }
.tp-btn-light.active { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .3); }

/* Powered-by watermark (above the map bottom bar) */
.lead-powered {
  position: absolute; bottom: 54px; left: 50%; transform: translateX(-50%);
  z-index: 22;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  background: transparent; border: 1px solid transparent;
  opacity: .38; cursor: default;
  transition: opacity .2s, background .2s, border-color .2s, transform .2s;
  pointer-events: auto;
}
.lead-powered:hover {
  opacity: 1;
  background: var(--glass-strong);
  border-color: var(--glass-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translateX(-50%) translateY(-2px);
}
.lead-powered-label {
  font-size: 9px;
  font-family: 'Helvetica Now', 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .25px;
  line-height: 1;
}
.lead-powered-mark { width: 12px; height: 12px; display: block; }
html[data-theme="light"] .lead-powered-mark { filter: invert(1); }

/* ============ Adhere Auto Mailer showcase ============ */
.mailer-showcase { max-width: 860px; margin: 0 auto; width: 100%; }
.mailer-hero { text-align: center; padding: 34px 10px 26px; }
.mailer-hero-pill {
  display: inline-block; padding: 4px 14px; border-radius: 99px;
  background: var(--chip-bg); border: 1px solid var(--chip-border);
  color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .4px;
}
.mailer-hero-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 14px 0 12px; font-family: 'Zona', 'Segoe UI', Roboto, Arial, sans-serif; }
.mailer-hero-sub { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 620px; margin: 0 auto 22px; }
.mailer-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mailer-hero-cta .btn { min-width: 220px; }
.mailer-hero-note { margin: 12px 0 0; font-size: 12px; }
.mailer-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mailer-feature { display: flex; gap: 12px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.mailer-f-ic { font-size: 20px; line-height: 1; }
.mailer-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.mailer-step { display: flex; gap: 10px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.mailer-step-n {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff;
  font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.mailer-price-row { display: flex; justify-content: center; }
.mailer-price-card { max-width: 420px; width: 100%; text-align: center; border: 1px solid var(--chip-border); background: var(--panel2); border-radius: 14px; padding: 22px; }
.mailer-price-amt { font-size: 30px; font-weight: 700; font-family: 'Zona', 'Segoe UI', Roboto, Arial, sans-serif; }
.mailer-price-amt .muted { font-size: 14px; font-weight: 500; }
.mailer-price-list { list-style: none; margin: 16px 0; padding: 0; text-align: left; display: inline-block; }
.mailer-price-list li { padding: 5px 0 5px 24px; position: relative; color: var(--ink); }
.mailer-price-list li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
@media (max-width: 640px) { .mailer-features { grid-template-columns: 1fr; } }

/* Collapsible nav groups (sidebar) */
.side-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 9px 12px; margin-top: 12px;
  background: none; border: none; cursor: pointer;
  color: #7c8691; font-family: inherit; text-align: left;
  border-radius: 10px; transition: background .2s, color .2s;
}
.side-group-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-group-toggle .side-group-title { margin: 0; }
.side-group-chev { transition: transform .2s; flex: 0 0 auto; }
.side-group-toggle.open .side-group-chev { transform: rotate(180deg); }
.side-group-body { display: none; padding: 2px 0 6px; }
.side-group-body.open { display: block; }
.side-group-body .nav-link { padding-left: 26px; font-size: 13px; }

/* Selected-areas silhouette panel (desktop, step 1) */
.lead-map-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lead-map-side {
  flex: 0 0 232px; width: 232px; margin-left: 10px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
}
.lead-side-head { padding: 10px 12px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--glass-border); }
.lead-side-scroll {
  flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.lead-side-card {
  flex: 0 0 150px; scroll-snap-align: start;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; text-align: center;
}
.lead-side-svg { width: 100%; height: 58px; display: block; }
.lead-side-name { font-size: 12px; font-weight: 600; margin-top: 6px; line-height: 1.25; }
.lead-side-type { font-size: 10px; }
.lead-side-empty { padding: 20px 12px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .lead-map-side { display: none; }
  .lead-map-main { height: 100%; }
}

/* Auth pages: brand logo adapts to the effective theme (auto follows sunrise/sunset) */
.login-brand .brand-logo-light { display: none; }
html[data-theme="light"] .login-brand .brand-logo-base { display: none; }
html[data-theme="light"] .login-brand .brand-logo-hover { display: none; }
html[data-theme="light"] .login-brand .brand-logo-light { display: block; }

/* Widen the "Select Location" intro card on mobile */
@media (max-width: 900px) {
  .lead-map-overlay { width: min(86vw, 360px); }
}

/* Steps 2 & 3: 50/50 columns — content left, selected-areas slider right */
.lead-step-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: 0; }
.lead-step-main-col { min-width: 0; display: flex; flex-direction: column; min-height: 0; max-width: 600px; }
.lead-step-main-col .lead-step-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lead-step-main-col .lead-step-scroll > .card { flex: 1; display: flex; flex-direction: column; }
.lead-step-main-col .lead-step-scroll > .card > .lead-summary { flex: 1; }
#leadStep2 .lead-step-scroll { overflow-y: auto; }
.lead-step-side-col { min-width: 0; display: flex; min-height: 0; }
.lead-step-side-col .lead-map-side { flex: 1; width: auto; margin: 0; }

@media (max-width: 900px) {
  .lead-step-2col { grid-template-columns: 1fr; gap: 10px; }
  .lead-step-side-col { display: none; }
}



/* Nav breathing room + sidebar bottom */
.sidebar nav { gap: 5px; }
.sidebar-groups { margin-top: 8px; }
.sidebar-foot { order: 10; margin-top: auto; }
.admin-nav { order: 9; margin-top: 8px; }
.nav-link { padding-top: 11px; padding-bottom: 11px; }
.side-group-toggle { margin-top: 14px; padding-top: 10px; padding-bottom: 10px; }
.side-group-body { padding-top: 4px; padding-bottom: 8px; }

/* Step 3 right column: categories (20vh) above areas (flex) */
.lead-step-side-col { flex-direction: column; gap: 12px; }
.lead-side-cats {
  flex: 0 0 20vh; min-height: 100px;
  display: flex; flex-direction: column;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; overflow: hidden;
}
.lead-side-cats-body {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start;
}
.lead-side-areas { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.lead-side-areas .lead-map-side { flex: 1; }
/* One area card per view — horizontal scroll with peek */
.lead-step-side-col .lead-side-scroll {
  flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; cursor: grab; position: relative;
  mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
}
.lead-step-side-col .lead-side-scroll::-webkit-scrollbar { display: none; }
.lead-step-side-col .lead-side-scroll:active { cursor: grabbing; }
.lead-step-side-col .lead-side-scroll .lead-side-card { flex: 0 0 calc(50% - 4px); scroll-snap-align: start; }
.lead-step-side-col .lead-side-svg { height: 180px; display: flex; align-items: center; justify-content: center; }
.lead-step-side-col .lead-side-svg svg { max-height: 100%; }

/* Scanning line animation */
.lead-scan-line {
  position: absolute; left: 0; right: 0; height: 2px; z-index: 10;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  box-shadow: 0 0 12px var(--brand), 0 0 24px var(--brand);
  animation: lead-scan 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lead-scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

/* Circular progress in sidebar */
.sidebar-progress {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 0; gap: 8px; order: -1;
}
.sidebar-progress.active { display: flex; }
.sidebar-progress-ring { position: relative; width: 56px; height: 56px; }
.sidebar-progress-ring svg { transform: rotate(-90deg); }
.sidebar-progress-ring circle {
  fill: none; stroke-width: 4; stroke-linecap: round;
}
.sidebar-progress-bg { stroke: rgba(255,255,255,.1); }
.sidebar-progress-fill {
  stroke: var(--brand);
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
  transition: stroke-dashoffset .5s ease;
}
.sidebar-progress-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.sidebar-progress { order: unset; }
.sidebar-progress-label { font-size: 11px; color: rgba(255,255,255,.6); text-align: center; }

/* Sidebar wallet widget */
.sidebar-wallet {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; margin: 6px 0;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  text-decoration: none; color: inherit;
  transition: background .2s;
}
.sidebar-wallet:hover { background: rgba(255,255,255,.09); text-decoration: none; color: inherit; }
.sidebar-wallet-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: rgba(255,255,255,.5);
}
.sidebar-wallet-title { font-weight: 600; }
.sidebar-wallet-amt {
  font-size: 20px; font-weight: 700; color: #00AA4D;
  line-height: 1.2;
}
.sidebar-wallet-plan { font-size: 12px; color: rgba(255,255,255,.6); }
.sidebar-wallet-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.1);
  overflow: hidden; margin-top: 2px;
}
.sidebar-wallet-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--brand);
  transition: width .4s ease;
}
.sidebar-wallet-usage { font-size: 11px; color: rgba(255,255,255,.45); }
.sidebar-wallet-topup {
  font-size: 12px; font-weight: 600; color: var(--brand);
  margin-top: 2px;
}

/* ============================================================
   Insights hub
   ============================================================ */
.insights-hub { max-width: 900px; margin: 0 auto; padding: 0 20px 48px; }

.insights-hero { text-align: center; padding: 40px 0 32px; }
.insights-hero-badge { margin-bottom: 12px; }
.insights-hero-pill {
  display: inline-block; padding: 5px 14px; border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.insights-hero-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700;
  color: var(--heading); margin: 0 0 12px; line-height: 1.25;
}
.insights-hero-sub { color: var(--muted); font-size: 15px; max-width: 600px; margin: 0 auto; line-height: 1.6; }

.insights-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 8px;
}

.insights-card {
  display: flex; flex-direction: column; gap: 8px; padding: 24px !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none; color: inherit;
}
a.insights-card { cursor: pointer; }
.insights-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  border-color: var(--brand);
  text-decoration: none; color: inherit;
}
.insights-card-tag {
  display: inline-block; align-self: flex-start;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(var(--brand-rgb), .08); color: var(--brand);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.insights-card-title { font-size: 16px; font-weight: 600; color: var(--heading); margin: 0; line-height: 1.4; }
.insights-card-snippet { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0; flex: 1; }
.insights-card-link { font-size: 13px; font-weight: 500; color: var(--brand); margin-top: auto; }

.insights-cta {
  text-align: center; margin-top: 40px; padding: 32px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 14px;
}
.insights-cta p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

@media (max-width: 600px) {
  .insights-grid { grid-template-columns: 1fr; }
  .insights-card { padding: 18px !important; }
}

/* ---------- Insight article ---------- */
.insight-article { max-width: 740px; margin: 0 auto; padding: 0 20px 56px; }
.insight-article-head { padding: 32px 0 24px; }
.insight-back {
  display: inline-block; font-size: 13px; font-weight: 500; color: var(--brand);
  margin-bottom: 18px; text-decoration: none;
}
.insight-back:hover { text-decoration: underline; }
.insight-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.insight-tag {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  background: rgba(var(--brand-rgb), .08); color: var(--brand);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.insight-reading { font-size: 13px; color: var(--muted); }
.insight-title {
  font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700;
  color: var(--heading); margin: 0 0 10px; line-height: 1.3;
}
.insight-subtitle { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0; }

.insight-article-body { line-height: 1.75; color: var(--ink); font-size: 15.5px; }
.insight-article-body h2 {
  font-size: 1.25rem; font-weight: 700; color: var(--heading);
  margin: 36px 0 12px; padding-top: 12px;
}
.insight-article-body h3 {
  font-size: 1.05rem; font-weight: 600; color: var(--heading);
  margin: 28px 0 10px;
}
.insight-article-body p { margin: 0 0 16px; }
.insight-article-body ul, .insight-article-body ol {
  margin: 0 0 16px; padding-left: 24px;
}
.insight-article-body li { margin-bottom: 8px; }
.insight-article-body strong { color: var(--heading); }
.insight-article-body code {
  background: var(--chip-bg); padding: 2px 6px; border-radius: 4px;
  font-size: 13.5px; font-family: 'SF Mono', 'Consolas', monospace;
}
.insight-article-body pre {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; margin: 0 0 16px;
}
.insight-article-body pre code { background: none; padding: 0; font-size: 13px; }
.insight-article-body blockquote {
  border-left: 3px solid var(--brand); margin: 0 0 16px;
  padding: 12px 18px; background: rgba(var(--brand-rgb), .04); border-radius: 0 8px 8px 0;
}
.insight-article-body a { color: var(--brand); font-weight: 500; }
.insight-article-body img {
  max-width: 100%; border-radius: 10px; margin: 16px 0;
}
.insight-article-body .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  margin-right: 8px; vertical-align: middle;
}
.insight-article-body .step-box {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 18px 20px; margin: 0 0 16px;
}

.insight-article-cta { margin: 40px 0; }
.insight-cta-card {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; border-radius: 14px; padding: 32px; text-align: center;
}
.insight-cta-card h3 { margin: 0 0 8px; font-size: 1.2rem; color: #fff; }
.insight-cta-card p { margin: 0 0 18px; font-size: 14px; opacity: .9; }
.insight-cta-card .btn-primary {
  background: #fff; color: var(--brand); border: none; font-weight: 600;
}
.insight-cta-card .btn-primary:hover { filter: brightness(.95); }

.insight-article-nav {
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.insight-nav-link {
  font-size: 13.5px; font-weight: 500; color: var(--brand);
  text-decoration: none; max-width: 48%;
}
.insight-nav-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .insight-article { padding: 0 16px 40px; }
  .insight-article-body { font-size: 15px; }
  .insight-cta-card { padding: 24px 18px; }
}

/* ============================================================
   Admin dashboard
   ============================================================ */
.admin-dash { padding: 0 20px 48px; }
.admin-stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 20px; }
.admin-stat-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 18px 14px; text-align: center;
  cursor: default; transition: border-color .15s, box-shadow .15s;
}
.admin-stat-card.clickable { cursor: pointer; }
.admin-stat-card.clickable:hover { border-color: var(--brand); box-shadow: 0 2px 12px rgba(0,170,77,.12); }
.admin-stat-card.active { border-color: var(--brand); background: rgba(0,170,77,.06); }
.admin-stat-num { font-size: 26px; font-weight: 700; color: var(--heading); line-height: 1.2; }
.admin-stat-card.online .admin-stat-num { color: #00AA4D; }
.admin-stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }

/* Users panel */
.admin-users-panel { display: none; margin-bottom: 20px; }
.admin-users-panel.open { display: block; }
.admin-users-panel .table-scroll { max-height: 420px; overflow-y: auto; }
.admin-user-email { font-weight: 600; }
.admin-user-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* User profile card modal */
.admin-profile-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9998;
  background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .15s;
}
.admin-profile-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  padding: 28px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.admin-profile-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1;
}
.admin-profile-close:hover { color: var(--ink); }
.admin-profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.admin-profile-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--brand); flex-shrink: 0;
  overflow: hidden;
}
.admin-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-profile-name { font-size: 1.1em; font-weight: 700; color: var(--heading); }
.admin-profile-email { font-size: .85em; color: var(--muted); }
.admin-profile-badges { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.admin-profile-stat {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 12px; text-align: center;
}
.admin-profile-stat-num { font-size: 18px; font-weight: 700; color: var(--heading); }
.admin-profile-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }
.admin-profile-details { margin-bottom: 16px; }
.admin-profile-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--glass-border); font-size: .88em;
}
.admin-profile-row:last-child { border-bottom: none; }
.admin-profile-row-label { color: var(--muted); }
.admin-profile-row-value { font-weight: 500; color: var(--ink); text-align: right; max-width: 60%; word-break: break-word; }
.admin-profile-ledger { margin-bottom: 16px; }
.admin-profile-ledger-title { font-size: .85em; font-weight: 600; color: var(--heading); margin-bottom: 8px; }
.admin-profile-ledger-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--glass-border); font-size: .82em;
}
.admin-profile-ledger-row:last-child { border-bottom: none; }
.ledger-type { font-weight: 500; }
.ledger-type.spend { color: #e74c3c; }
.ledger-type.grant { color: #00AA4D; }
.ledger-type.refund { color: #3498db; }
.admin-profile-actions { display: flex; gap: 8px; margin-top: 8px; }

#adminMap { width: 100%; height: 450px; border-radius: 0 0 12px 12px; border: 1px solid var(--line); border-top: none; }

.admin-map-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 10px 14px; font-size: 12px; color: var(--muted);
}
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

.admin-dot-online {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #00AA4D; margin-right: 4px; vertical-align: middle;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

@media (max-width: 640px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-stat-num { font-size: 22px; }
  #adminMap { height: 300px; }
}

/* Billing grid: balance + payment methods side by side */
.billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.billing-balance-card { display: flex; flex-direction: column; justify-content: center; }
.billing-balance-amt { font-size: 32px; font-weight: 700; color: #00AA4D; }
.billing-balance-label { font-size: 13px; margin-top: 2px; }
.billing-topup-form { display: flex; gap: 10px; align-items: flex-end; }
.billing-topup-btn { flex: 0 0 auto; white-space: nowrap; }
.billing-pm-card .card-head { margin-bottom: 14px; }
.billing-pm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--glass-border); }
.billing-pm-info { display: flex; align-items: center; gap: 10px; }
.billing-pm-icon { flex: 0 0 auto; }
.billing-pm-last4 { font-size: 14px; font-weight: 600; }
.billing-pm-meta { font-size: 12px; }
.billing-pm-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.billing-pm-remove { color: #f85149; }
.billing-pm-empty { padding: 16px 0; text-align: center; }
.billing-modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.billing-modal-backdrop[hidden] { display: none !important; }
.billing-modal { background: var(--card-bg, #161b22); border: 1px solid var(--glass-border); border-radius: 12px; padding: 28px; max-width: 380px; width: 100%; text-align: center; }
.billing-modal h3 { margin-bottom: 8px; }
.billing-modal-actions { margin-top: 20px; }

/* Lead wizard payment modal */
.lead-pay-summary { background: rgba(255,255,255,.05); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.lead-pay-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }

@media (max-width: 700px) {
  .billing-grid { grid-template-columns: 1fr; }
}

/* Lead category lists dropdown */
.lead-custom-cat { margin-bottom: 16px; }
.lead-custom-cat-row { display: flex; gap: 6px; align-items: center; }
.lead-custom-cat-row input { flex: 1; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--input-bg); font-size: .88em; }
.lead-save-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.lead-save-row input { flex: 1; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--input-bg); font-size: .88em; }
.lead-cat-dropdown { position: relative; flex: 0 0 auto; }
.lead-cat-dropdown-menu { position: absolute; top: 100%; right: 0; z-index: 20; min-width: 260px; max-height: 320px; overflow-y: auto; margin-top: 4px; background: rgba(22, 27, 34, 0.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.lead-cat-menu-empty { padding: 16px 12px; text-align: center; }
.lead-cat-menu-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.lead-cat-menu-item:hover { background: rgba(255,255,255,.07); }
.lead-cat-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lead-cat-menu-name { font-size: 13px; font-weight: 600; }
.lead-cat-menu-del { background: none; border: none; color: #7c8691; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px; transition: color .15s, background .15s; flex: 0 0 auto; }
.lead-cat-menu-del:hover { color: #f85149; background: rgba(248,81,73,.12); }
.lead-cat-menu-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip-sm { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 6px; background: rgba(255,255,255,.06); color: #c9d1d9; white-space: nowrap; }

/* Saved Categories management page */
.cat-preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-preset-check { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: background .15s; }
.cat-preset-check:hover { background: rgba(255,255,255,.06); }
.cat-preset-check input { accent-color: #00AA4D; }
.cat-saved-lists { display: flex; flex-direction: column; gap: 12px; }
.cat-saved-item { padding: 14px 0; border-bottom: 1px solid var(--glass-border); }
.cat-saved-item:last-child { border-bottom: none; }
.cat-saved-head { display: flex; align-items: center; justify-content: space-between; }
.cat-saved-actions { display: flex; gap: 4px; }
@media (max-width: 640px) { .cat-preset-grid { grid-template-columns: 1fr; } }

/* Legal pages (privacy, terms) */
.legal-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.legal-tab {
  padding: 10px 18px; font-size: .88em; font-weight: 500; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; transition: all .15s; cursor: pointer;
}
.legal-tab:hover { color: var(--ink); opacity: 1; }
.legal-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.legal-content { line-height: 1.7; color: var(--ink); }
.legal-content h2 { font-size: 1.15em; font-weight: 700; margin: 28px 0 8px; color: var(--ink); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { font-size: 1em; font-weight: 600; margin: 18px 0 6px; color: var(--ink); }
.legal-content p { margin: 0 0 12px; }
.legal-content ul { margin: 0 0 14px; padding-left: 22px; }
.legal-content li { margin-bottom: 4px; }
.legal-content a { color: var(--brand); text-decoration: underline; }
.legal-content a:hover { opacity: .85; }
.legal-footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--glass-border); }

/* Loading overlay */
#loadingOverlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--panel); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loading-text { font-size: .9em; color: var(--muted); }
