/* TaxResearch — Leads particulares (mesma linguagem visual do WhatsTax) */

/* ============ Tokens ============ */
/* Drawer e modal vivem no <body>, fora do layout, e reusam os mesmos tokens. */
.lp-page,
.lp-overlay {
  --wa-green: #1f9d57;
  --wa-green-strong: #168048;
  --wa-green-soft: rgba(31, 157, 87, 0.12);
  --wa-panel: var(--surface);
  --wa-panel-2: var(--surface-2);
  --wa-line: var(--border);
  --wa-hover: rgba(21, 32, 29, 0.045);
  --wa-active: rgba(21, 32, 29, 0.085);
  --wa-chat-bg: #efeadb;
  --wa-doodle: rgba(21, 32, 29, 0.055);
  --wa-bubble-out: #d8f1cf;
  --wa-bubble-time: rgba(21, 32, 29, 0.48);
  --wa-bubble-shadow: 0 1px 0.5px rgba(21, 32, 29, 0.14);
  --wa-radius: var(--radius-lg);
  --lp-accent: #8a8450;
  --lp-accent-strong: #747040;
  --lp-accent-soft: rgba(184, 178, 122, 0.18);
  --lp-on-accent: #fff;
}

[data-theme="dark"] .lp-page,
[data-theme="dark"] .lp-overlay {
  --wa-green: #2fbf7a;
  --wa-green-strong: #3fd08a;
  --wa-green-soft: rgba(47, 191, 122, 0.14);
  --wa-hover: rgba(240, 236, 217, 0.04);
  --wa-active: rgba(240, 236, 217, 0.08);
  --wa-chat-bg: #17211e;
  --wa-doodle: rgba(237, 232, 207, 0.035);
  --wa-bubble-out: #1d4b3e;
  --wa-bubble-time: rgba(240, 236, 217, 0.52);
  --wa-bubble-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.35);
  --lp-accent: #d9d49e;
  --lp-accent-strong: #ebe7bd;
  --lp-accent-soft: rgba(207, 203, 150, 0.12);
  --lp-on-accent: var(--brand-charcoal);
}

/* ============ Page shell ============ */
.lp-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.lp-page .topbar { padding-top: 14px; padding-bottom: 14px; }
.lp-page .page {
  flex: 1;
  display: flex;
  min-height: 0;
  max-width: none;
  padding: 16px 18px;
}

.lp-app {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  border: 1px solid var(--wa-line);
  border-radius: var(--wa-radius);
  overflow: hidden;
  background: var(--wa-panel);
  box-shadow: var(--shadow);
}

/* ============ Generic controls ============ */
.lp-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.lp-icon-btn:hover { background: var(--wa-hover); color: var(--ink); }
.lp-icon-btn:active { transform: scale(.94); }
.lp-icon-btn:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.lp-icon-btn:disabled { opacity: .4; cursor: default; }
.lp-icon-btn-sm { width: 30px; height: 30px; font-size: .88rem; }
.lp-icon-btn.is-spinning i { animation: lpSpin .8s linear infinite; }
.lp-icon-btn.is-danger:hover { color: var(--danger); background: oklch(from var(--danger) l c h / 0.12); }
.lp-icon-btn.is-send:hover { color: var(--wa-green); background: var(--wa-green-soft); }

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .12s;
}
.lp-btn:active:not(:disabled) { transform: scale(.97); }
.lp-btn:disabled { opacity: .5; cursor: default; }
.lp-btn:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.lp-btn-primary { background: var(--lp-accent); color: var(--lp-on-accent); }
.lp-btn-primary:hover:not(:disabled) { background: var(--lp-accent-strong); }
.lp-btn-wa { background: var(--wa-green); color: #fff; }
.lp-btn-wa:hover:not(:disabled) { background: var(--wa-green-strong); }
.lp-btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--wa-line); }
.lp-btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--wa-hover); border-color: var(--border-strong); }
.lp-btn-danger { background: var(--danger); color: #fff; }
.lp-btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.lp-btn-sm { height: 30px; padding: 0 12px; font-size: .74rem; }
.lp-btn.is-loading i { animation: lpSpin .8s linear infinite; }
.lp-btn.is-loading i::before { content: "\F130"; } /* bi-arrow-repeat */

.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--wa-line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.lp-chip:hover { color: var(--ink); border-color: var(--border-strong); }
.lp-chip:active { transform: scale(.96); }
.lp-chip.is-active { background: var(--lp-accent-soft); color: var(--lp-accent); border-color: oklch(from var(--lp-accent) l c h / 0.45); }
.lp-chip-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--wa-active);
  color: inherit;
  font-size: .64rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.lp-chip.is-active .lp-chip-count { background: var(--lp-accent); color: var(--lp-on-accent); }

/* ============ Lista ============ */
.lp-list {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--wa-line);
  background: var(--wa-panel);
}

.lp-list-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--hairline); }

.lp-list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.lp-list-title h2 {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.lp-list-title h2 small {
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Cadastro rápido */
.lp-quickadd {
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--wa-panel-2);
  border: 1px solid var(--hairline);
  transition: border-color .15s, box-shadow .15s;
}
.lp-quickadd:focus-within {
  border-color: oklch(from var(--lp-accent) l c h / 0.45);
  box-shadow: 0 0 0 3px var(--lp-accent-soft);
}
.lp-qa-row { display: flex; gap: 8px; align-items: stretch; }
.lp-qa-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--wa-panel);
  border: 1px solid var(--hairline);
  transition: border-color .15s;
}
.lp-qa-field:focus-within { border-color: oklch(from var(--lp-accent) l c h / 0.55); }
.lp-qa-field > i { color: var(--muted-soft); font-size: .9rem; flex-shrink: 0; transition: color .15s; }
.lp-qa-field:focus-within > i { color: var(--lp-accent); }
.lp-qa-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.lp-qa-field input::placeholder { color: var(--muted-soft); }
.lp-qa-field { flex: 1.3; }
.lp-qa-field.is-cnpj { flex: 1; }
.lp-qa-field.is-invalid { border-color: var(--danger); animation: lpShake .32s ease-in-out; }
.lp-qa-add {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: var(--lp-on-accent);
  background: var(--lp-accent);
  box-shadow: 0 8px 18px -10px var(--lp-accent);
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.lp-qa-add:hover:not(:disabled) { background: var(--lp-accent-strong); transform: scale(1.05); }
.lp-qa-add:active:not(:disabled) { transform: scale(.94); }
.lp-qa-add:disabled { opacity: .6; cursor: wait; }
.lp-qa-add:disabled i { animation: lpSpin .8s linear infinite; }
.lp-qa-add:disabled i::before { content: "\F130"; }
.lp-qa-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 2px 8px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lp-qa-title i { color: var(--lp-accent); font-size: .85rem; }
.lp-qa-title small { margin-left: auto; font-size: .66rem; font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--muted-soft); }
.lp-quickadd.is-hinting { animation: lpHintPulse 1s ease-out 2; }
.lp-enrich-note {
  margin: 7px 2px 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .2s ease, opacity .2s ease;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: .7rem;
  line-height: 1.45;
  color: var(--muted);
}
.lp-quickadd:focus-within .lp-enrich-note { max-height: 40px; opacity: 1; }
.lp-quickadd:not(:focus-within) .lp-qa-row + .lp-enrich-note { margin-top: 0; }
.lp-new-msg-btn { flex-shrink: 0; }
.lp-list.is-hinting-select .lp-item:not(.is-sent) .lp-avatar-hover {
  opacity: 1;
  background: rgba(0, 0, 0, .3);
  animation: lpHintBlink 1s ease-in-out 2;
}
.lp-list.is-hinting-select .lp-item:not(.is-sent) .lp-avatar-hover i::before { content: "\F28A"; }
@keyframes lpHintPulse {
  0% { box-shadow: 0 0 0 0 oklch(from var(--lp-accent) l c h / 0.7); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes lpHintBlink { 50% { opacity: .35; } }
.lp-enrich-note .lp-star { color: var(--accent-strong); font-size: .66rem; flex-shrink: 0; }

/* Busca + filtros */
.lp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin-top: 10px;
  padding: 0 10px 0 14px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: var(--wa-panel-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lp-search:focus-within {
  background: var(--wa-panel);
  border-color: oklch(from var(--lp-accent) l c h / 0.55);
  box-shadow: 0 0 0 3px var(--lp-accent-soft);
}
.lp-search > i { color: var(--muted); font-size: .9rem; flex-shrink: 0; transition: color .15s; }
.lp-search:focus-within > i { color: var(--lp-accent); }
.lp-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .85rem;
}
.lp-search input::placeholder { color: var(--muted-soft); }
.lp-search input::-webkit-search-cancel-button { display: none; }
.lp-search-clear {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted-soft);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: .95rem;
}
.lp-search-clear:hover { color: var(--ink); }
.lp-search-clear[hidden] { display: none; }

.lp-filters {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.lp-filters::-webkit-scrollbar { display: none; }

/* Banner de enriquecimento */
.lp-enrich-banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--gold-line);
  font-size: .74rem;
  color: var(--ink-2);
  animation: lpFadeUp .25s ease-out both;
}
.lp-enrich-banner .farol-loader { flex-shrink: 0; }

/* Linha "selecionar todos" */
.lp-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 4px;
  font-size: .72rem;
  color: var(--muted);
}
.lp-select-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.lp-select-row label:hover { color: var(--ink); }
.lp-select-row input { accent-color: var(--lp-accent); width: 15px; height: 15px; cursor: pointer; }
.lp-select-row .lp-select-info { margin-left: auto; font-variant-numeric: tabular-nums; }

.lp-list-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 12px;
  scroll-behavior: smooth;
}
.lp-list:has(.lp-selbar.is-visible) .lp-list-items { padding-bottom: 76px; }

/* Item */
.lp-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 11px 14px 11px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  outline: none;
  transition: background .12s;
  animation: lpItemIn .22s ease-out both;
}
.lp-item:hover { background: var(--wa-hover); }
.lp-item:focus-visible { box-shadow: inset 0 0 0 2px oklch(from var(--lp-accent) l c h / 0.6); }
.lp-item.row-selected { background: linear-gradient(90deg, var(--lp-accent-soft), oklch(from var(--lp-accent-soft) l c h / 0) 85%); }
.lp-item.row-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lp-accent);
}
.lp-item.is-checked { background: var(--lp-accent-soft); }
.lp-item.is-checked:hover { background: color-mix(in oklch, var(--lp-accent-soft), var(--wa-hover)); }
.lp-list-items.no-anim .lp-item { animation: none; }

.lp-avatar {
  --av-hue: 150;
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid hsl(var(--av-hue) 30% 45% / .35);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: hsl(var(--av-hue) 45% 30%);
  background: hsl(var(--av-hue) 38% 90%);
  cursor: pointer;
  user-select: none;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.4);
}
[data-theme="dark"] .lp-avatar {
  color: hsl(var(--av-hue) 55% 80%);
  background: hsl(var(--av-hue) 20% 24%);
  border-color: hsl(var(--av-hue) 30% 55% / .28);
}
.lp-recipient .lp-avatar,
.lp-preview-head .lp-avatar { border-radius: var(--radius-sm); }
.lp-camp-lead .lp-avatar { border-radius: var(--radius); }
.lp-avatar:active { transform: scale(.92); }
.lp-avatar:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.lp-avatar-txt { transition: opacity .15s, transform .2s; }
.lp-avatar-check {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: var(--lp-on-accent);
  background: var(--lp-accent);
  opacity: 0;
  transform: scale(.4) rotate(-40deg);
  transition: opacity .16s, transform .25s cubic-bezier(.2, .9, .3, 1.5);
}
.lp-avatar:hover .lp-avatar-hover { opacity: 1; }
.lp-avatar-hover {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: rgba(0, 0, 0, .38);
  color: #fff;
  opacity: 0;
  transition: opacity .15s;
}
.lp-item.is-checked .lp-avatar-check { opacity: 1; transform: none; }
.lp-item.is-checked .lp-avatar-hover { display: none; }
.lp-list.has-selection .lp-avatar-hover { opacity: 1; background: rgba(0, 0, 0, .22); }
.lp-list.has-selection .lp-avatar-hover i::before { content: "\F28A"; } /* bi-circle */
.lp-list.has-selection .lp-item.is-sent .lp-avatar-hover,
.lp-item.is-sent .lp-avatar:hover .lp-avatar-hover { opacity: 0; }
.lp-item.is-sent .lp-avatar { cursor: default; }

.lp-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lp-item-top,
.lp-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.lp-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.lp-item-time {
  flex-shrink: 0;
  font-size: .68rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.lp-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.35;
}
.lp-item-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-item-sub .lp-dot { color: var(--muted-soft); font-size: .6rem; flex-shrink: 0; }
.lp-item-sub .lp-phone { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lp-item-tags { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.lp-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 600;
  white-space: nowrap;
}
.lp-status.is-sent { color: var(--wa-green); }
.lp-status.is-new { color: var(--accent-strong); }
.lp-status i { font-size: .82rem; }
.lp-source {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: var(--radius);
  background: var(--wa-panel-2);
  color: var(--muted);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Ações rápidas (hover) */
.lp-item-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--wa-panel);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity .14s, transform .18s ease-out;
}
.lp-item:hover .lp-item-actions,
.lp-item:focus-within .lp-item-actions,
.lp-item.is-confirming .lp-item-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}
.lp-confirm {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  font-size: .74rem;
  font-weight: 600;
  color: var(--danger);
  white-space: nowrap;
}
.lp-item.is-confirming .lp-confirm { display: inline-flex; }
.lp-item.is-confirming .lp-item-actions > .lp-icon-btn { display: none; }
.lp-item.is-removing {
  animation: lpItemOut .28s ease-in forwards;
  pointer-events: none;
}

/* Paginação */
.lp-pager {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  font-size: .72rem;
  color: var(--muted);
}
.lp-pager[hidden] { display: none; }
.lp-pager span { flex: 1; text-align: center; font-variant-numeric: tabular-nums; }

/* Barra de seleção (estilo WhatsApp) */
.lp-selbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 6px;
  border-radius: var(--radius-lg);
  background: var(--wa-panel);
  border: 1px solid var(--wa-line);
  box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(.98);
  transition: opacity .18s, transform .26s cubic-bezier(.2, .9, .3, 1.2);
}
.lp-selbar.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.lp-selbar-count {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.lp-selbar-count b { font-size: .86rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.lp-selbar-count span { font-size: .68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-selbar-count b.is-bump { animation: lpBump .3s cubic-bezier(.2, .9, .3, 1.6); }

/* Skeleton + vazio */
.lp-skel-item { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.lp-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.lp-skel {
  display: block;
  height: 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--wa-panel-2) 25%, var(--wa-active) 50%, var(--wa-panel-2) 75%);
  background-size: 200% 100%;
  animation: lpShimmer 1.4s ease-in-out infinite;
}
.lp-skel-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; }

.lp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 240px;
  padding: 36px 28px;
  text-align: center;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
}
.lp-empty strong { color: var(--ink); font-size: .92rem; }
.lp-empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--lp-accent);
  background: var(--lp-accent-soft);
}
.lp-empty.is-error .lp-empty-icon { color: var(--danger); background: oklch(from var(--danger) l c h / 0.12); }
.lp-empty .lp-btn { margin-top: 10px; }

/* ============ Painel da direita ============ */
.lp-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--wa-panel);
}
.lp-detail-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.lp-back-btn { display: none; }
.lp-tabs {
  display: inline-flex;
  gap: 18px;
  align-self: stretch;
}
.lp-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s;
}
.lp-tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 2px;
  border-radius: 2px;
  background: var(--lp-accent);
  transform: scaleX(0);
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.1);
}
.lp-tab-btn:hover { color: var(--ink); }
.lp-tab-btn.active { color: var(--ink); }
.lp-tab-btn.active i { color: var(--lp-accent); }
.lp-tab-btn.active::after { transform: scaleX(1); }
.lp-tab-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
}

.lp-detail-content { width: 100%; max-width: 760px; margin: 0 auto; padding: 22px 26px 30px; }
.lp-detail-content.is-entering { animation: lpFadeUp .26s ease-out both; }

/* Cabeçalho do lead (decoração sobre o painel compartilhado) */
.lp-detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -4px 0 14px;
}
.lp-detail-hero .lp-avatar { width: 56px; height: 56px; font-size: 1.1rem; cursor: default; }
.lp-detail-hero .lp-avatar:active { transform: none; }
.lp-detail-hero-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lp-detail-hero-actions a { text-decoration: none; }
.lp-detail-hero-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lp-detail-hero-text small { font-size: .7rem; color: var(--muted); }

/* Botões do painel compartilhado (lead_detail_panel.js) no visual desta tela */
.lp-detail-content .btn-primary {
  border: 0 !important;
  border-radius: var(--radius) !important;
  background: var(--wa-green) !important;
  color: #fff !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  box-shadow: 0 10px 22px -14px var(--wa-green);
}
.lp-detail-content .btn-primary:hover { background: var(--wa-green-strong) !important; }
.lp-detail-content .btn-ghost > i + span { margin-left: 6px; }
.lp-detail-content .btn-ghost {
  border-radius: var(--radius) !important;
  font-family: var(--font-body) !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Welcome (nenhum lead aberto) */
.lp-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100%;
  padding: 36px 28px;
  text-align: center;
}
.lp-welcome-art {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 8px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  color: var(--lp-accent);
  background: linear-gradient(150deg, var(--lp-accent-soft), oklch(from var(--lp-accent-soft) l c h / 0) 80%), var(--wa-panel-2);
  border: 1px solid var(--gold-line);
  transform: rotate(-4deg);
}
.lp-welcome-art > i { transform: rotate(4deg); }
.lp-welcome-ring {
  position: absolute;
  inset: -9px;
  border-radius: calc(var(--radius-lg) + 9px);
  border: 1px dashed oklch(from var(--lp-accent) l c h / 0.4);
  transform: rotate(8deg);
}
.lp-welcome h2 { margin: 0; font-size: 1.7rem; }
.lp-welcome p { max-width: 440px; margin: 0; font-size: .88rem; line-height: 1.55; color: var(--muted); }

.lp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 460px;
  margin-top: 14px;
}
.lp-stat {
  padding: 12px 10px;
  border-radius: var(--radius-lg);
  background: var(--wa-panel-2);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  font-family: var(--font-body);
  color: inherit;
}
.lp-stat:hover { border-color: oklch(from var(--lp-accent) l c h / 0.45); transform: translateY(-1px); }
.lp-stat b {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.lp-stat span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lp-stat.is-pending b { color: var(--accent-strong); }
.lp-stat.is-sent b { color: var(--wa-green); }

.lp-steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  text-align: left;
}
.lp-steps button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  background: var(--wa-panel-2);
  color: var(--ink-2);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.lp-steps button:hover { border-color: oklch(from var(--lp-accent) l c h / 0.5); background: var(--wa-panel); }
.lp-steps button:active { transform: scale(.99); }
.lp-step-n {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--lp-accent);
  background: var(--lp-accent-soft);
}
.lp-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lp-step-text b { font-size: .84rem; font-weight: 600; color: var(--ink); }
.lp-step-text small { font-size: .72rem; color: var(--muted); }
.lp-steps button > .bi-arrow-right { color: var(--muted-soft); transition: transform .15s, color .15s; }
.lp-steps button:hover > .bi-arrow-right { color: var(--lp-accent); transform: translateX(3px); }

/* Formulário de edição */
.lp-form { display: flex; flex-direction: column; gap: 14px; animation: lpFadeUp .22s ease-out both; }
.lp-form-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.lp-form-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.lp-form-head p { margin: 1px 0 0; font-size: .74rem; color: var(--muted); }
.lp-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

.lp-field { display: flex; flex-direction: column; gap: 6px; }
.lp-field > span {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lp-field > span small { text-transform: none; letter-spacing: normal; font-weight: 500; color: var(--muted-soft); margin-left: auto; }
.lp-field input,
.lp-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--wa-line);
  background: var(--wa-panel-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .86rem;
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lp-field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.lp-field input:focus,
.lp-field textarea:focus {
  background: var(--wa-panel);
  border-color: oklch(from var(--lp-accent) l c h / 0.55);
  box-shadow: 0 0 0 3px var(--lp-accent-soft);
}
.lp-field input::placeholder,
.lp-field textarea::placeholder { color: var(--muted-soft); }
.lp-field-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px dashed var(--wa-line);
  color: var(--muted);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}

/* Acompanhamento */
.lp-camp-wrap { padding: 18px 22px 26px; max-width: 760px; width: 100%; margin: 0 auto; }
.lp-camp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.lp-camp-head h3 { margin: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.lp-camp-head p { margin: 1px 0 0; font-size: .74rem; color: var(--muted); }
.lp-camp-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--wa-panel);
  transition: border-color .15s, box-shadow .15s;
  animation: lpFadeUp .22s ease-out both;
}
.lp-camp-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.lp-camp-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.lp-camp-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--lp-accent);
  background: var(--lp-accent-soft);
}
.lp-camp-title { flex: 1; min-width: 0; }
.lp-camp-title b { display: block; font-size: .84rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-camp-title span { font-size: .7rem; color: var(--muted); }
.lp-camp-badge { flex-shrink: 0; padding: 3px 9px; border-radius: var(--radius); font-size: .64rem; font-weight: 700; }
.lp-camp-badge.is-waiting { color: var(--warning); background: oklch(from var(--warning) l c h / 0.14); }
.lp-camp-badge.is-sent { color: var(--wa-green); background: var(--wa-green-soft); }
.lp-camp-badge.is-replied { color: var(--accent-strong); background: var(--accent-soft); }
.lp-camp-metrics { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hairline); }
.lp-camp-metric { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 8px; color: var(--muted); }
.lp-camp-metric + .lp-camp-metric { border-left: 1px solid var(--hairline); }
.lp-camp-metric b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.lp-camp-metric span { font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; }
.lp-camp-metric.has-value.is-sent { color: var(--wa-green); }
.lp-camp-metric.has-value.is-replied { color: var(--accent-strong); }
.lp-camp-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lp-camp-toggle:hover { background: var(--wa-hover); color: var(--ink); }
.lp-camp-toggle .bi-chevron-down { font-size: .62rem; transition: transform .2s; }
.lp-camp-leads { border-top: 1px solid var(--hairline); animation: lpFadeUp .2s ease-out both; }
.lp-camp-summary { display: flex; gap: 14px; padding: 7px 14px; background: var(--wa-panel-2); font-size: .7rem; font-weight: 600; }
.lp-camp-lead { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--hairline); }
.lp-camp-lead:last-child { border-bottom: 0; }
.lp-camp-lead .lp-avatar { width: 30px; height: 30px; font-size: .66rem; cursor: default; }
.lp-camp-lead-main { flex: 1; min-width: 0; }
.lp-camp-lead-main b { display: block; font-size: .78rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-camp-lead-main span { display: block; font-size: .66rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-camp-lead-status { flex-shrink: 0; text-align: right; font-size: .68rem; font-weight: 600; }
.lp-camp-lead-status small { display: block; font-weight: 500; color: var(--muted); font-size: .62rem; }

/* ============ Overlays (composer + importação) ============ */
.lp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  justify-content: flex-end;
  background: rgba(8, 12, 11, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: lpFade .2s ease-out both;
}
.lp-overlay[hidden] { display: none; }
.lp-overlay.is-leaving { animation: lpFadeOut .2s ease-in forwards; }
.lp-overlay-center { justify-content: center; align-items: center; padding: 20px; }

.lp-drawer {
  width: min(560px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--wa-panel);
  border-left: 1px solid var(--wa-line);
  box-shadow: -24px 0 60px -24px rgba(0, 0, 0, .55);
  color: var(--ink);
  animation: lpDrawerIn .32s cubic-bezier(.2, .9, .3, 1.05) both;
}
.lp-overlay.is-leaving .lp-drawer { animation: lpDrawerOut .2s ease-in forwards; }

.lp-modal {
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--wa-panel);
  border: 1px solid var(--wa-line);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  overflow: hidden;
  animation: lpModalIn .28s cubic-bezier(.2, .9, .3, 1.2) both;
}
.lp-overlay.is-leaving .lp-modal { animation: lpModalOut .18s ease-in forwards; }

.lp-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.lp-sheet-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--lp-accent-soft);
  color: var(--lp-accent);
  font-size: 1.15rem;
}
.lp-sheet-head-text { flex: 1; min-width: 0; }
.lp-sheet-head-text h3 { margin: 0; font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; }
.lp-sheet-head-text p { margin: 1px 0 0; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.lp-sheet-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--hairline);
  background: var(--wa-panel);
  flex-shrink: 0;
}
.lp-sheet-foot .lp-foot-hint { flex: 1; min-width: 0; font-size: .72rem; color: var(--muted); }
.lp-sheet-foot .lp-foot-hint.is-warn { color: var(--warning); }
.lp-overlay [hidden] { display: none !important; }

/* Importar lead: manual ou planilha */
.lp-add-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 18px 0;
  flex-shrink: 0;
}
.lp-add-mode {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--wa-line);
  background: var(--wa-panel-2);
  color: var(--ink-2);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lp-add-mode > i {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--muted);
  background: var(--wa-panel);
  transition: color .15s, background .15s;
}
.lp-add-mode span { display: flex; flex-direction: column; min-width: 0; }
.lp-add-mode b { font-size: .84rem; font-weight: 600; color: var(--ink); }
.lp-add-mode small { font-size: .7rem; color: var(--muted); }
.lp-add-mode:hover { border-color: oklch(from var(--lp-accent) l c h / 0.45); }
.lp-add-mode.is-active {
  border-color: var(--lp-accent);
  background: var(--lp-accent-soft);
  box-shadow: 0 0 0 3px oklch(from var(--lp-accent) l c h / 0.15);
}
.lp-add-mode.is-active > i { color: var(--lp-on-accent); background: var(--lp-accent); }
.lp-add-panel { animation: lpFadeUp .2s ease-out both; }

.lp-input-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--wa-line);
  background: var(--wa-panel-2);
  transition: border-color .15s, box-shadow .15s;
}
.lp-input-icon:focus-within { border-color: oklch(from var(--lp-accent) l c h / 0.55); box-shadow: 0 0 0 3px var(--lp-accent-soft); }
.lp-input-icon > i { color: var(--muted-soft); font-size: 1rem; transition: color .15s; }
.lp-input-icon:focus-within > i { color: var(--lp-accent); }
.lp-field .lp-input-icon input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.lp-input-icon.is-invalid { border-color: var(--danger); animation: lpShake .32s ease-in-out; }
.lp-add-note {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--lp-accent-soft);
  font-size: .76rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.lp-add-note .lp-star { color: var(--lp-accent); flex-shrink: 0; }
.lp-add-another { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.lp-add-another input { accent-color: var(--lp-accent); width: 15px; height: 15px; cursor: pointer; }

/* Destinatários */
.lp-recipients { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lp-recipient {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 3px;
  border-radius: var(--radius);
  background: var(--wa-panel-2);
  border: 1px solid var(--hairline);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 200px;
  animation: lpPop .2s cubic-bezier(.2, .9, .3, 1.4) both;
}
.lp-recipient .lp-avatar { width: 24px; height: 24px; font-size: .58rem; cursor: default; }
.lp-recipient > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-recipient button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: .8rem;
  cursor: pointer;
  flex-shrink: 0;
}
.lp-recipient button:hover { background: var(--wa-active); color: var(--ink); }
.lp-recipient.is-sent { opacity: .55; text-decoration: line-through; }
.lp-recipient-more { font-size: .74rem; font-weight: 600; color: var(--muted); padding: 0 6px; }
.lp-recipients-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--wa-line);
  font-size: .78rem;
  color: var(--muted);
}
.lp-recipients-empty i { color: var(--warning); }

/* Tags */
.lp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px dashed oklch(from var(--lp-accent) l c h / 0.5);
  background: transparent;
  color: var(--lp-accent);
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.lp-tag:hover { background: var(--lp-accent-soft); }
.lp-tag:active { transform: scale(.95); }
.lp-tag code { font-family: var(--font-mono); font-size: .66rem; color: inherit; background: none; padding: 0; opacity: .7; }

.lp-msg-block { display: flex; flex-direction: column; gap: 8px; }
.lp-msg-box {
  border-radius: var(--radius-lg);
  border: 1px solid var(--wa-line);
  background: var(--wa-panel-2);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.lp-msg-box:focus-within { border-color: oklch(from var(--lp-accent) l c h / 0.55); box-shadow: 0 0 0 3px var(--lp-accent-soft); }
.lp-msg-box textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .86rem;
  line-height: 1.5;
}
.lp-msg-box textarea::placeholder { color: var(--muted-soft); }
.lp-msg-box .lp-tags {
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--hairline);
  background: oklch(from var(--wa-panel) l c h / 0.6);
}
.lp-tags-label { font-size: .68rem; font-weight: 600; color: var(--muted); margin-right: 2px; }
.lp-tags-extra { display: contents; }
.lp-tags-extra[hidden] { display: none; }
.lp-tag-more { border-style: solid; border-color: var(--wa-line); color: var(--muted); }
.lp-tag-more i { font-size: .6rem; transition: transform .2s; }
.lp-tag-more.is-open i { transform: rotate(180deg); }
.lp-composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .68rem; color: var(--muted-soft); }
.lp-composer-meta kbd { font-family: var(--font-mono); font-size: .62rem; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--wa-panel-2); color: var(--muted); border: 1px solid var(--hairline); }

/* Pré-visualização no estilo WhatsApp */
.lp-preview {
  position: relative;
  padding: 14px 14px 16px;
  border-radius: var(--radius-lg);
  background-color: var(--wa-chat-bg);
  background-image:
    radial-gradient(var(--wa-doodle) 1.2px, oklch(from var(--wa-doodle) l c h / 0) 1.3px),
    radial-gradient(var(--wa-doodle) 1.2px, oklch(from var(--wa-doodle) l c h / 0) 1.3px);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
  border: 1px solid var(--hairline);
}
.lp-preview-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .68rem; color: var(--muted); }
.lp-preview-head .lp-avatar { width: 22px; height: 22px; font-size: .52rem; cursor: default; }
.lp-preview-head b { color: var(--ink-2); font-weight: 600; }
.lp-bubble {
  position: relative;
  margin-left: auto;
  max-width: 88%;
  width: fit-content;
  padding: 7px 10px 8px;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  background: var(--wa-bubble-out);
  box-shadow: var(--wa-bubble-shadow);
  font-size: .86rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.lp-bubble::after {
  content: "";
  position: absolute;
  top: 0;
  right: -7px;
  border-left: 8px solid var(--wa-bubble-out);
  border-bottom: 9px solid transparent;
}
.lp-bubble.is-empty { color: var(--muted); font-style: italic; }
.lp-bubble-time {
  float: right;
  position: relative;
  top: 6px;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .64rem;
  color: var(--wa-bubble-time);
  font-style: normal;
}
.lp-bubble-time i { color: #53bdeb; font-size: .82rem; }
.lp-tag-missing {
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: oklch(from var(--warning) l c h / 0.2);
  color: var(--warning);
  font-weight: 600;
}
.lp-bubble.is-updating { animation: lpBubblePulse .35s ease-out; }

/* Templates */
.lp-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lp-tpl-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.lp-tpl-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--wa-panel-2);
  text-align: left;
  font-family: var(--font-body);
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.lp-tpl-card:hover { border-color: oklch(from var(--lp-accent) l c h / 0.5); background: var(--wa-panel); }
.lp-tpl-card:active { transform: scale(.99); }
.lp-tpl-card > i { color: var(--lp-accent); flex-shrink: 0; }
.lp-tpl-card-main { flex: 1; min-width: 0; }
.lp-tpl-card-main b { display: block; font-size: .76rem; color: var(--ink); }
.lp-tpl-card-main span { display: block; font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-tpl-card-use { font-size: .7rem; font-weight: 700; color: var(--lp-accent); opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.lp-tpl-card:hover .lp-tpl-card-use { opacity: 1; }
.lp-tpl-empty { padding: 12px; font-size: .76rem; color: var(--muted); text-align: center; border: 1px dashed var(--wa-line); border-radius: var(--radius-lg); }
#tplPickerSection .lp-tpl-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
.lp-tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--wa-line);
  background: var(--wa-panel-2);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.lp-tpl-chip i { color: var(--lp-accent); }
.lp-tpl-chip:hover { border-color: oklch(from var(--lp-accent) l c h / 0.5); }
.lp-tpl-chip:active { transform: scale(.96); }
.lp-tpl-chip.is-active { border-color: var(--lp-accent); background: var(--lp-accent-soft); color: var(--ink); }

.lp-more-opts { border-radius: var(--radius-lg); border: 1px solid var(--hairline); background: var(--wa-panel-2); }
.lp-more-opts summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  cursor: pointer;
}
.lp-more-opts summary::-webkit-details-marker { display: none; }
.lp-more-opts summary > i:first-child { color: var(--muted); }
.lp-more-opts summary .bi-chevron-down { margin-left: auto; font-size: .7rem; color: var(--muted); transition: transform .2s; }
.lp-more-opts[open] summary .bi-chevron-down { transform: rotate(180deg); }
.lp-more-opts-body { display: flex; flex-direction: column; gap: 14px; padding: 2px 14px 14px; }
.lp-more-opts-body .lp-save-tpl { margin-top: 0; }

.lp-save-tpl { display: flex; gap: 8px; margin-top: 8px; }
.lp-save-tpl input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--wa-line);
  background: var(--wa-panel-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .78rem;
  outline: 0;
}
.lp-save-tpl input:focus { border-color: oklch(from var(--lp-accent) l c h / 0.55); box-shadow: 0 0 0 3px var(--lp-accent-soft); }

/* Importação */
.lp-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 26px 18px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--wa-line);
  background: var(--wa-panel-2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .8rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.lp-dropzone:hover,
.lp-dropzone.is-dragover { border-color: var(--lp-accent); background: var(--lp-accent-soft); }
.lp-dropzone.is-dragover { transform: scale(1.01); }
.lp-dropzone > i { font-size: 2rem; color: var(--lp-accent); margin-bottom: 4px; }
.lp-dropzone b { color: var(--ink); font-size: .9rem; }
.lp-dropzone.has-file { border-style: solid; border-color: oklch(from var(--lp-accent) l c h / 0.6); }
.lp-file-chosen {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: var(--radius);
  background: var(--wa-panel);
  color: var(--ink);
  font-size: .76rem;
  font-weight: 600;
  max-width: 100%;
}
.lp-file-chosen:not(:empty) { display: inline-flex; }

.lp-format {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--wa-panel-2);
}
.lp-format summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
  user-select: none;
}
.lp-format summary::-webkit-details-marker { display: none; }
.lp-format summary > i:first-child { color: var(--accent-strong); }
.lp-format summary .bi-chevron-down { margin-left: auto; font-size: .7rem; color: var(--muted); transition: transform .2s; }
.lp-format[open] summary .bi-chevron-down { transform: rotate(180deg); }
.lp-format-body { padding: 0 14px 12px; font-size: .76rem; color: var(--ink-2); line-height: 1.55; }
.lp-format-body ul { margin: 6px 0 0; padding-left: 1.1rem; }
.lp-format-body code { font-family: var(--font-mono); font-size: .7rem; background: var(--wa-panel); padding: 1px 5px; border-radius: var(--radius-sm); color: var(--ink); }
.lp-format-sample {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--wa-panel);
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ink-2);
  white-space: pre;
  overflow-x: auto;
}
.lp-model-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ Toasts ============ */
#toastContainer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
#toastContainer .alert-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 11px 14px;
  font-size: .82rem;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: lpToastIn .3s cubic-bezier(.2, .9, .3, 1.2) both;
}

/* ============ Animações ============ */
@keyframes lpToastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lpSpin { to { transform: rotate(360deg); } }
@keyframes lpShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes lpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lpFadeOut { to { opacity: 0; } }
@keyframes lpFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lpItemIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lpItemOut {
  0%   { opacity: 1; transform: none; max-height: 80px; }
  60%  { opacity: 0; transform: translateX(-24px); max-height: 80px; }
  100% { opacity: 0; transform: translateX(-24px); max-height: 0; padding-top: 0; padding-bottom: 0; }
}
@keyframes lpDrawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lpDrawerOut { to { transform: translateX(40px); opacity: 0; } }
@keyframes lpModalIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lpModalOut { to { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes lpPop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lpBump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes lpShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes lpBubblePulse { from { transform: scale(.985); } to { transform: none; } }
@keyframes lpFlash {
  0%   { background: oklch(from var(--lp-accent) l c h / 0.3); }
  100% { background: transparent; }
}
.lp-list-items .lp-item.is-new,
.lp-list-items.no-anim .lp-item.is-new { animation: lpItemIn .22s ease-out both, lpFlash 1.6s ease-out .1s; }

/* ============ Responsivo ============ */
@media (max-width: 1100px) {
  .lp-app { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .lp-detail-content { padding: 18px 18px 26px; }
}

@media (max-width: 768px) {
  .lp-page .page { padding: 0; }
  .lp-page .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .lp-page .topbar-title { flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
  .lp-page .topbar h1 { font-size: 18px; }
  .lp-page .leads-top-subnav {
    display: flex;
    flex-wrap: nowrap;
    max-width: 100%;
    margin-top: 4px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .lp-page .leads-top-subnav::-webkit-scrollbar { display: none; }
  .lp-page .leads-top-subnav .nav-tab-btn { white-space: nowrap; flex-shrink: 0; }
  .lp-import-label { display: none; }
  .lp-list-head { padding: 10px 12px 8px; }
  .lp-enrich-note { display: none; }

  .lp-app {
    display: block;
    min-height: 0;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .lp-list,
  .lp-detail { position: absolute; inset: 0; border-right: 0; transition: transform .28s cubic-bezier(.2, .9, .3, 1); }
  .lp-app.show-list .lp-detail { transform: translateX(100%); }
  .lp-app.show-detail .lp-list { transform: translateX(-30%); visibility: hidden; }
  .lp-back-btn { display: inline-grid; }
  .lp-item-actions { display: none; }
  .lp-detail-hero { align-items: flex-start; gap: 12px; }
  .lp-detail-hero > .lp-avatar { width: 44px; height: 44px; font-size: .9rem; }
  .lp-detail-hero > div > div:first-child { flex-wrap: wrap; row-gap: 8px; }
  .lp-detail-hero-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .lp-drawer { width: 100%; border-left: 0; }
  .lp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .lp-sheet-foot { flex-wrap: wrap; }
  .lp-sheet-foot > .lp-foot-hint { flex: 1 0 100%; margin-right: 0; }
  .lp-sheet-foot > .lp-btn { flex: 1 1 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-page *,
  .lp-page *::before,
  .lp-page *::after,
  .lp-overlay,
  .lp-overlay * {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
