@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --purple: #6e0ad6;
  --purple-dark: #4f0a99;
  --purple-deep: #33055f;
  --orange: #f28000;
  --green: #8ce563;
  --ink: #16121c;
  --muted: #726b7c;
  --line: #e7e3ec;
  --bg: #f6f4f9;
  --card: #fff;
  --danger: #c62828;
  --ok: #1f8a3b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--purple); }

.hidden { display: none !important; }

/* ------------------------------------------------------------ login */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(242, 128, 0, .18), transparent 60%),
    radial-gradient(800px 500px at 90% 100%, rgba(140, 229, 99, .14), transparent 55%),
    var(--purple-deep);
  padding: 22px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 30px;
  width: 100%;
  max-width: 390px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.login-card img { width: 74px; height: auto; display: block; margin-bottom: 20px; }
.login-card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.02em; }
.login-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; line-height: 1.5; }

.login-card label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }

.login-card input {
  width: 100%;
  height: 47px;
  border: 1.5px solid #ccc6d4;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 15px;
  outline: 0;
  margin-bottom: 16px;
}
.login-card input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110, 10, 214, .14); }

.login-card .btn-primary { width: 100%; height: 47px; font-size: 15px; }

.login-error {
  background: #fdecec;
  border: 1px solid #f4c2c2;
  color: #a11d1d;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }

.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.5; }

/* ------------------------------------------------------------ base */
.btn {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn.ghost { border-color: transparent; color: var(--muted); padding: 8px 10px; }
.btn:hover { background: #f4f1f8; border-color: #cfc7db; }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fdecec; border-color: #efbdbd; }

/* foto do produto nos ajustes */
.product-photo {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.product-photo-preview {
  width: 96px;
  height: 96px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #b9aecb;
  border-radius: 10px;
  background: #faf9fc;
  color: #7a7189;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
}
.product-photo-preview:hover { border-color: var(--purple); color: var(--purple); }
.product-photo-preview.has-image { border-style: solid; background: #fff; }
.product-photo-preview.has-image > svg,
.product-photo-preview.has-image .photo-hint { display: none; }
.photo-hint { font-size: 10px; line-height: 1.1; font-weight: 600; }
.product-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-photo-preview img[hidden] { display: none; }
.product-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.product-photo-actions .settings-note { flex-basis: 100%; }

/* ------------------------------------------------------------ topbar */
.topbar {
  background: var(--purple-deep);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar img { width: 58px; height: auto; }
.topbar .titles { display: flex; flex-direction: column; line-height: 1.2; }
.topbar .titles strong { font-size: 14.5px; }
.topbar .titles span { font-size: 11.5px; color: #c8b5dd; }

.live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #b8f79c;
  background: rgba(140, 229, 99, .1);
  border: 1px solid rgba(140, 229, 99, .28);
  padding: 5px 10px;
  border-radius: 999px;
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(140, 229, 99, .5); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(140, 229, 99, 0); opacity: .65; }
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.topbar .settings-top { font-size: 12.5px; padding: 8px 12px; }
.topbar .settings-top span { white-space: nowrap; }
@media (max-width: 560px) { .topbar .settings-top span { display: none; } }

.ad-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e3dcee;
  border-radius: 10px;
  background: #faf8fd;
}
.ad-banner-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.ad-banner-text b { font-size: 13px; color: var(--ink); }
.ad-banner-text span { font-size: 12px; color: var(--muted); }

.items-head { display: flex; justify-content: flex-end; margin: 4px 0 10px; }
.items-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #ece8f1;
  border-radius: 8px;
}
.item-row .thumb {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 6px;
  background: #eef0f3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8d8697;
}
.item-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-row .info { flex: 1; min-width: 0; }
.item-row .info b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .info span { font-size: 12px; color: var(--muted); }
.item-link {
  display: inline-block;
  max-width: 100%;
  margin-top: 2px;
  font-size: 11.5px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--purple) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.item-link:hover { text-decoration: underline; }
.lead-link {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--purple);
  overflow-wrap: anywhere;
}
.lead-link:hover { text-decoration: underline; }
.items-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.items-foot .field-inline { min-width: 220px; }
.item-row .acts { display: flex; gap: 6px; flex: none; }
.item-row .acts .btn { padding: 6px 9px; font-size: 12px; }
.items-empty { font-size: 12.5px; color: var(--muted); padding: 10px 2px; }
.modal-card-wide { max-width: 560px; }
#itemPhoneWrap[hidden] { display: none; }
.modal-card-wide .settings-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.topbar .btn:hover { background: rgba(255, 255, 255, .18); }
.topbar .btn.icon-only { padding: 8px; }

/* ------------------------------------------------------------ layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 20px 70px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat b { display: block; font-size: 25px; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat.hl b { color: var(--purple); }
.stat.ok b { color: var(--ok); }

/* ------------------------------------------------------------ settings */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: #fbfafd;
}
.panel-head svg { width: 16px; height: 16px; color: var(--purple); }
.panel-body { padding: 16px; }

.settings-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }

.switch-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }

.switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  background: #cfc9d8;
  border-radius: 999px;
  transition: background .16s;
  pointer-events: none;
}
.switch span::after {
  content: '';
  position: absolute;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform .16s;
}
.switch input:checked + span { background: var(--purple); }
.switch input:checked + span::after { transform: translateX(19px); }

.field-inline { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 240px; }
.field-inline label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-inline input {
  height: 38px;
  border: 1.5px solid #d8d3df;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 13px;
  outline: 0;
  width: 100%;
}
.field-inline input:focus { border-color: var(--purple); }

.settings-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }

.password-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.password-grid .field-inline { min-width: 180px; }

/* ------------------------------------------------------------ toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.tabs { display: flex; gap: 4px; background: #ece7f2; padding: 4px; border-radius: 9px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: #5d5666;
  padding: 7px 12px;
  border-radius: 6px;
}
.tab.active { background: #fff; color: var(--purple); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.search-box { flex: 1; min-width: 190px; position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; color: #8d8697; }
.search-box input {
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0 12px 0 34px;
  font-size: 13px;
  outline: 0;
}
.search-box input:focus { border-color: var(--purple); }

.toolbar-right { display: flex; gap: 8px; margin-left: auto; }

/* ------------------------------------------------------------ leads */
.leads { display: flex; flex-direction: column; gap: 10px; }

.lead {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
}
.lead.fresh { animation: fresh 1.4s ease; }
@keyframes fresh { 0%, 55% { background: #f6ecff; border-color: #cba9f2; } 100% { background: #fff; } }

.lead-main { flex: 1; min-width: 0; }

.lead-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 7px; }

.badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.visit { background: #eeeaf3; color: #615a6b; }
.badge.login { background: #fff0dd; color: #a25c00; }
.badge.sms { background: #fff0dd; color: #8a5200; }
.badge.code { background: #e6f8de; color: #226d15; }
.badge.nfe { background: #e4edfd; color: #17458f; }
.badge.done { background: #1f8a3b; color: #fff; }
.badge.screen { background: #eef2f8; color: #3a4a63; border: 1px solid #dfe6f0; }
.badge.screen.loading { background: #fff4e5; color: #8a5200; }
.badge.screen.loading::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: screen-spin .8s linear infinite;
}
@keyframes screen-spin { to { transform: rotate(360deg); } }
.stage-note { font-size: 10.5px; color: var(--muted); }

.online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #1f8a3b;
  white-space: nowrap;
}
.online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fae52;
  animation: pulse 1.6s infinite;
}

.email { font-size: 14px; font-weight: 700; word-break: break-all; }
.email.empty { color: #9b94a4; font-weight: 500; font-style: italic; }

.when { font-size: 11.5px; color: #8b8494; white-space: nowrap; margin-left: auto; }

.secret-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 5px; }

.secret {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f7f5fa;
  border: 1px solid #e9e4ef;
  border-radius: 7px;
  padding: 4px 6px 4px 10px;
  max-width: 100%;
}
.secret .k { font-size: 10px; font-weight: 800; color: #8b8494; text-transform: uppercase; letter-spacing: .05em; }
.secret .v { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; word-break: break-all; }
.secret.blank .v { color: #aaa3b2; }
.secret .mini {
  border: 0;
  background: transparent;
  padding: 3px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: #6f6879;
}
.secret .mini:hover { background: #e6dff0; color: var(--purple); }
.secret .mini svg { width: 14px; height: 14px; }

.code-list { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.code-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .18em;
  background: #e6f8de;
  border: 1px solid #c6e9b8;
  color: #1d5f11;
  padding: 4px 9px 4px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.code-chip small {
  font-family: var(--font, inherit);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}
.code-chip.mail { background: #fff3e2; border-color: #f0d6b4; color: #8a5200; }
.code-chip.sms { background: #e6f8de; border-color: #c6e9b8; color: #1d5f11; }
.code-chip.old { opacity: .55; font-size: 13px; background: #f2f6f0; border-color: #dfe8db; color: #4f604a; letter-spacing: .1em; }

.doc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  padding: 8px 11px;
  background: #f4f7fd;
  border: 1px solid #dde6f5;
  border-radius: 8px;
  font-size: 12px;
  color: #33455f;
  word-break: break-word;
}
.doc-row b { font-weight: 700; color: #21334d; }

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed #ece8f1;
}
.stage-btn {
  border: 1.5px solid #ddd6e6;
  background: #fff;
  color: #4b4356;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background .15s, border-color .15s;
}
.stage-btn:hover { background: #f3eff8; border-color: #c2b7d2; }
.stage-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.stage-btn.primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }
.stage-btn.current { box-shadow: inset 0 0 0 1px var(--purple); border-color: var(--purple); color: var(--purple-dark); }
.stage-btn.gear { padding: 6px 7px; }
.stage-btn.gear svg { width: 15px; height: 15px; display: block; }

.meta { font-size: 11.5px; color: #847d8d; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 12px; height: 12px; }

.lead-side { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.lead-side .btn { padding: 7px; }
.lead-side .btn svg { width: 14px; height: 14px; }

.empty {
  background: #fff;
  border: 1.5px dashed #d8d1e1;
  border-radius: 12px;
  padding: 52px 20px;
  text-align: center;
  color: #8c8595;
}
.empty svg { width: 34px; height: 34px; color: #b7afc3; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 13.5px; }
.empty small { display: block; margin-top: 5px; font-size: 12px; }

.footnote { text-align: center; color: #928b9b; font-size: 11.5px; margin-top: 24px; }
.footnote.stale { color: #b3261e; font-size: 12.5px; }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(14px);
  background: #211a2a;
  color: #fff;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 60;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar .titles span { display: none; }
  .topbar .titles { min-width: 0; }
  .topbar .titles strong { font-size: 12.5px; line-height: 1.15; }
  .topbar-inner { gap: 8px; }
  .topbar-actions { gap: 4px; }
  .topbar .btn.icon-only { padding: 6px; }
  .live { display: none; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .toolbar-right .btn { flex: 1; justify-content: center; }
  .lead { flex-direction: column; }
  .lead-side { flex-direction: row; width: 100%; justify-content: flex-end; }
  .when { margin-left: 0; }
  .settings-grid { flex-direction: column; align-items: stretch; }
  .wrap { padding: 16px 14px 60px; }
  .topbar-inner { padding: 11px 14px; }
  .topbar img { width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================  tema 2.0: tabela escura ===================== */
.topbar { background: #101114; }
.topbar .titles span { color: #9a9a9a; }
.topbar .titles strong { letter-spacing: .01em; }
body { background: #f4f4f5; }

.table-head, .lead {
  display: grid;
  grid-template-columns: 190px minmax(180px, 1fr) 130px 110px 300px;
  gap: 12px;
  align-items: center;
}
.table-head {
  padding: 8px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7a7a7a;
  border-bottom: 1px solid var(--line);
}
.lead { padding: 10px 14px; border-radius: 8px; }
.lead .cell { min-width: 0; }
.cell.pass b { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.cell.pass b.blank { color: #aaa; font-weight: 400; }
.cell.pass b.email { font-family: var(--font-body, inherit); }
.pass-tools { display: inline-flex; gap: 2px; margin-left: 6px; }
.pass-row { display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.pass-row b { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #333; overflow-wrap: anywhere; cursor: pointer; }
.pass-row b.hidden-pass { letter-spacing: .12em; color: #777; }
.cell.sms .email { display: block; font-size: 12px; color: #333; overflow: hidden; text-overflow: ellipsis; }
.cell.sms .email.empty { color: #999; }
.cell.status { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cell.when span { font-size: 12px; color: #333; }
.cell.when small { display: block; font-size: 11px; color: #8a8a8a; }
.cell.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.action-col { display: flex; flex-direction: column; gap: 3px; }
.gate { display: flex; gap: 3px; }
.gate-btn {
  flex: 1;
  min-width: 0;
  padding: 1px 4px;
  border: 1px solid;
  border-radius: 4px;
  background: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
  text-transform: lowercase;
}
.gate-btn.on { color: #1d6b2c; border-color: #bfe3c6; }
.gate-btn.on.active { background: #1f8a3b; border-color: #1f8a3b; color: #fff; }
.gate-btn.off { color: #a12b22; border-color: #ecc8c4; }
.gate-btn.off.active { background: #c0392b; border-color: #c0392b; color: #fff; }
.code-chip.invalid { text-decoration: line-through; opacity: .8; }

.stage-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: #222;
  cursor: pointer;
}
.stage-btn:hover { border-color: #999; }
.stage-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.stage-btn.primary:hover { background: var(--purple-dark); }
.stage-btn.current { box-shadow: inset 0 0 0 1px var(--purple); border-color: var(--purple); color: var(--purple-dark); }
.stage-btn.primary.current { color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.stage-btn.ghost { color: var(--danger); display: inline-flex; align-items: center; }
.stage-btn svg { width: 14px; height: 14px; }

.lead-extra { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.lead-extra:empty { display: none; }
.doc-row, .meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #444; }
.meta { color: #7b7b7b; font-size: 11.5px; }

.badge.processing { background: #ece3fb; color: #5a2ea6; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 18px;
  font-size: 11.5px;
  color: #777;
}

.mini { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); background: #fff; color: #444; cursor: pointer; }
.mini:hover { background: #f1f1f1; }
.mini svg { width: 13px; height: 13px; }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 17, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
  overflow-y: auto;
}
.modal[hidden] { display: none; }
@media (max-height: 720px) { .modal { align-items: flex-start; } }
.modal-card {
  width: 340px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}
.confirm-card { width: 390px; padding: 20px; }
.confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #fdecec;
  color: #b3261e;
}
.confirm-icon svg { width: 17px; height: 17px; }
.confirm-card b { display: block; font-size: 15px; }
.confirm-card p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.confirm-card .modal-actions { margin-top: 18px; }
.confirm-card .btn-danger { border-color: #efbdbd; }
.modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.modal-text { font-size: 13px; color: #444; margin: 12px 0 10px; }
.modal-note { font-size: 11.5px; color: #888; margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pin { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pin input {
  width: 100%;
  height: 46px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  border: 1px solid #c2c2c2;
  border-radius: 8px;
  outline: none;
}
.pin input:focus { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }

@media (max-width: 860px) {
  .table-head { display: none; }
  .lead { grid-template-columns: 1fr 1fr; }
  .cell.actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.nf-box { border: 1px dashed #cfc3e2; background: #faf7ff; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nf-box b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6e0ad6; }
.nf-line { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #333; }
.nf-key { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: #777; word-break: break-all; }
