/* ============================================================
   FAZZY · FENACI 2026 — Formulário + Admin
   Paleta oficial extraída de fazzy.com.br
   ============================================================ */

:root {
  --brand: #DF572A;
  --brand-dark: #B8451F;
  --brand-light: #F2764E;
  --brand-glow: rgba(223, 87, 42, 0.18);

  --ink: #1E1B1A;
  --ink-2: #55504D;
  --muted: #8A827E;

  --bg: #FFFFFF;
  --bg-soft: #FDF8F4;
  --bg-warm: #F6EEE7;
  --border: #EADFD5;
  --border-strong: #D9C9BB;

  --success: #2E8B57;
  --success-bg: #E6F4EC;
  --warning: #E8A100;
  --warning-bg: #FFF7E0;
  --danger: #C13B2E;
  --danger-bg: #FBE8E5;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(30, 27, 26, 0.06), 0 1px 3px rgba(30, 27, 26, 0.04);
  --shadow: 0 4px 14px rgba(30, 27, 26, 0.08), 0 2px 4px rgba(30, 27, 26, 0.04);
  --shadow-lg: 0 20px 50px -12px rgba(223, 87, 42, 0.25), 0 10px 20px -8px rgba(30, 27, 26, 0.15);
  --shadow-brand: 0 12px 28px -8px rgba(223, 87, 42, 0.5);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* ============================================================
   ÍCONES SVG (sprite inline — sem requisição externa)
   ============================================================ */
.sprite { display: none; }
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: -0.14em;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Background decorativo — gradiente laranja Fazzy */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(242, 118, 78, 0.28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(223, 87, 42, 0.18), transparent 60%),
    linear-gradient(180deg, #FFFCF9 0%, #FDF6EF 100%);
  pointer-events: none;
}

/* ============================================================
   SHELL
   ============================================================ */
.shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  animation: fadeSlide 0.45s var(--ease);
  flex: 1;
}
.screen.is-active { display: flex; flex-direction: column; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BRAND / TOPBAR
   ============================================================ */
.brand {
  display: flex;
  justify-content: center;
  padding: 12px 0 24px;
}
.brand__logo {
  height: 54px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(223, 87, 42, 0.15));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 20px;
}
.topbar__back {
  background: white;
  border: 1px solid var(--border);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.topbar__back:hover { border-color: var(--brand); color: var(--brand); }
.topbar__back:active { transform: scale(0.95); }

.topbar__logo {
  height: 36px;
  width: auto;
  margin-left: 4px;
}
.topbar__step {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: white;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
  height: 6px;
  background: var(--bg-warm);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 32px;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-light) 100%);
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}

/* ============================================================
   INTRO / LANDING
   ============================================================ */
.intro__hero {
  text-align: center;
  padding: 12px 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-glow);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.intro__title {
  font-size: clamp(28px, 8vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.intro__title .hl {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.intro__sub {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0 0 28px;
  padding: 0 8px;
}
.intro__perks {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.intro__perks li {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.perk-icon {
  font-size: 21px;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.intro__legal {
  font-size: 12px;
  color: var(--muted);
  margin: 20px 8px 0;
  line-height: 1.5;
}

/* ============================================================
   FORM
   ============================================================ */
.form-body { padding: 4px 0 40px; }

.form__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.2;
}
.form__sub {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 28px;
}

.form { display: flex; flex-direction: column; gap: 20px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.field__hint {
  font-size: 12.5px;
  color: var(--muted);
}
.field__error {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 0;
  transition: min-height 0.2s;
}
.field.has-error .field__error { min-height: 18px; }
.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px evita zoom no iOS */
  color: var(--ink);
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.2s var(--ease);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23DF572A'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 011.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 44px;
}
.field input::placeholder,
.field textarea::placeholder { color: #B8ADA6; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
  background: white;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  padding: 14px 22px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: none;
  text-decoration: none;
  min-height: 48px;
}
.btn--xl { padding: 18px 26px; font-size: 17px; width: 100%; min-height: 58px; }
.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -8px rgba(223, 87, 42, 0.6); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--border);
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn--secondary {
  background: white;
  color: var(--brand-dark);
  border: 1.5px solid var(--brand);
}
.btn--secondary:hover { background: var(--brand-glow); }

.btn--danger {
  background: white;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn--danger:hover { background: var(--danger-bg); }

/* ============================================================
   CHOICE CARDS (é cliente?)
   ============================================================ */
.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.choice {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.choice:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.choice:active { transform: translateY(0); }
.choice__icon {
  font-size: 32px;
  line-height: 1;
  color: var(--brand);
  display: block;
  margin-bottom: 2px;
}
.choice__title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.choice__desc {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
}

/* ============================================================
   NPS SCALE
   ============================================================ */
.nps { margin: 8px 0 4px; }
.nps__scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.nps__btn {
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  padding: 0;
  display: grid;
  place-items: center;
}
.nps__btn:hover { transform: translateY(-2px); border-color: var(--brand); }
/* Cores por bucket */
.nps__btn[data-nps="0"], .nps__btn[data-nps="1"], .nps__btn[data-nps="2"],
.nps__btn[data-nps="3"], .nps__btn[data-nps="4"], .nps__btn[data-nps="5"], .nps__btn[data-nps="6"] { color: #B23A2C; }
.nps__btn[data-nps="7"], .nps__btn[data-nps="8"] { color: #B67C00; }
.nps__btn[data-nps="9"], .nps__btn[data-nps="10"] { color: #2E8B57; }

.nps__btn.is-selected[data-nps="0"], .nps__btn.is-selected[data-nps="1"], .nps__btn.is-selected[data-nps="2"],
.nps__btn.is-selected[data-nps="3"], .nps__btn.is-selected[data-nps="4"], .nps__btn.is-selected[data-nps="5"], .nps__btn.is-selected[data-nps="6"] {
  background: var(--danger); color: white; border-color: var(--danger);
}
.nps__btn.is-selected[data-nps="7"], .nps__btn.is-selected[data-nps="8"] {
  background: var(--warning); color: white; border-color: var(--warning);
}
.nps__btn.is-selected[data-nps="9"], .nps__btn.is-selected[data-nps="10"] {
  background: var(--success); color: white; border-color: var(--success);
}

/* Campo com prefixo @ (Instagram) */
.input-at { position: relative; display: block; }
.input-at__prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}
.input-at input { padding-left: 34px !important; }
.field.has-error .input-at__prefix { color: var(--danger); }

.nps__legend {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin: 6px 2px 8px;
}
.nps__legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nps__legend-icon { font-size: 15px; }
.nps__legend-icon--low  { color: var(--danger); }
.nps__legend-icon--high { color: var(--success); }

/* ============================================================
   SUCESSO
   ============================================================ */
.screen--success { justify-content: center; }
.success {
  text-align: center;
  padding: 20px 0;
}
.success__badge {
  width: 88px; height: 88px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: var(--shadow-brand);
  animation: pop 0.5s var(--ease) both;
}
@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.success__title {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.success__sub {
  color: var(--ink-2);
  font-size: 16px;
  margin: 0 0 28px;
  padding: 0 8px;
}
.success__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.step-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.step-card__num {
  width: 34px; height: 34px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.step-card strong { font-size: 15px; display: block; }
.step-card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.success__helper {
  margin: 18px 4px 24px;
  font-size: 14px;
  color: var(--ink-2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.footer img { height: 26px; opacity: 0.6; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  z-index: 1000;
  transition: transform 0.35s var(--ease);
  max-width: 90vw;
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }
.toast.is-error { background: var(--danger); }
.toast.is-success { background: var(--success); }

/* ============================================================
   ============================================================
   ADMIN
   ============================================================
   ============================================================ */
.page-admin {
  background: #F5F1EC;
}
.page-admin .bg-decor {
  background:
    radial-gradient(1400px 700px at 100% -10%, rgba(242, 118, 78, 0.18), transparent 55%),
    linear-gradient(180deg, #FBF7F2 0%, #F5EFE8 100%);
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: 100dvh;
}

/* --- LOGIN --- */
.login {
  max-width: 400px;
  margin: 60px auto;
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login__logo { height: 48px; margin-bottom: 24px; }
.login__title { font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.login__sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

/* --- HEADER --- */
.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 32px;
  flex-wrap: wrap;
}
.admin-header__logo { height: 42px; }
.admin-header__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1;
}
.admin-header__title small {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.admin-header__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- STATS --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--brand);
}
.stat--success::before { background: var(--success); }
.stat--warning::before { background: var(--warning); }
.stat--danger::before { background: var(--danger); }

.stat__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.stat__value {
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.stat__pct { color: var(--brand); font-weight: 700; }

/* --- NPS BAR --- */
.nps-bar {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.nps-bar__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.nps-bar__title .score {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand);
}
.nps-bar__track {
  display: flex;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-warm);
}
.nps-bar__seg {
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 12.5px;
  transition: width 0.5s var(--ease);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.nps-bar__seg.det { background: var(--danger); }
.nps-bar__seg.pas { background: var(--warning); }
.nps-bar__seg.prm { background: var(--success); }
.nps-bar__legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.nps-bar__legend .dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* --- FILTROS --- */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  display: flex;
}
.filter-search__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
}
.filter-search .filter-input { padding-left: 38px; }

.filter-input {
  flex: 1;
  min-width: 220px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  background: white;
  outline: none;
  transition: all 0.2s var(--ease);
}
.filter-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.chip-filter {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}
.chip-filter:hover { border-color: var(--brand); color: var(--brand); }
.chip-filter.is-active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* --- ALERTA DETRATORES --- */
.alert-panel {
  background: var(--danger-bg);
  border: 1px solid #F5C6C0;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.alert-panel__icon {
  width: 32px; height: 32px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-weight: 700;
}
.alert-panel h4 { margin: 0 0 4px; font-size: 15px; color: var(--danger); font-weight: 700; }
.alert-panel p { margin: 0; font-size: 13.5px; color: var(--ink); }

/* --- TABELA / CARDS DE LEAD --- */
.leads {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lead {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  transition: all 0.2s var(--ease);
}
.lead:hover { box-shadow: var(--shadow); }
.lead__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 16px;
}
.lead__main { min-width: 0; }
.lead__name {
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead__meta {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead__handle { font-weight: 700; color: var(--ink-2); }
.lead__handle + .lead__sub::before { content: ' · '; }
.lead__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-warm);
  color: var(--ink-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tag .icon { font-size: 13px; }
.tag--cliente { background: #E4EFFC; color: #1E5CA8; }
.tag--lead { background: #FFF0E4; color: var(--brand-dark); }
.tag--det { background: var(--danger-bg); color: var(--danger); }
.tag--pas { background: var(--warning-bg); color: #A67300; }
.tag--prm { background: var(--success-bg); color: var(--success); }
.lead__actions {
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--muted);
  transition: all 0.15s var(--ease);
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.icon-btn.view:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-glow); }
.icon-btn.wa {
  color: #1E9E4F;
  border-color: #BFE8CE;
  background: #F0FAF4;
  text-decoration: none;
}
.icon-btn.wa:hover { color: white; background: #1E9E4F; border-color: #1E9E4F; }
.icon-btn .icon { font-size: 16px; }

/* Ações no detalhe do cadastro */
.detail__acoes {
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.detail__acoes .btn { flex: 1; min-width: 150px; }
.btn--wa {
  background: #1E9E4F;
  color: white;
  border: 1.5px solid #1E9E4F;
}
.btn--wa:hover { background: #17853F; border-color: #17853F; }

/* --- LIXEIRA / DELETE --- */
.chip-filter--trash { margin-left: auto; }
.chip-filter--trash.is-active {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.detail__perigo {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.detail__perigo .btn { width: 100%; }
.detail__perigo-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}
.btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid #F0C4BE;
}
.btn--danger:hover { background: var(--danger); color: white; border-color: var(--danger); }
.btn--restore {
  background: var(--success);
  color: white;
  border: 1.5px solid var(--success);
}
.btn--restore:hover { background: #24704A; border-color: #24704A; }

.detail__deletado {
  grid-column: 1 / -1;
  margin-top: 16px;
  background: var(--bg-warm);
  border-left: 3px solid var(--muted);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* cadastro na lixeira aparece esmaecido na lista */
.lead.is-deleted { opacity: 0.6; background: var(--bg-soft); }
.lead.is-deleted .lead__avatar { filter: grayscale(1); }

.leads__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: white;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}
.leads__empty h3 { margin: 0 0 6px; color: var(--ink); }
.leads__empty p { margin: 0; font-size: 14px; }

/* --- MODAL / DETALHE --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 27, 26, 0.5);
  backdrop-filter: blur(4px);
  padding: 20px;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}
.modal.is-open { display: flex; }
.modal__card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: pop 0.3s var(--ease);
}
.modal__close {
  float: right;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}
.modal__title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.modal__sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.detail {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 16px;
  font-size: 14px;
}
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; color: var(--ink); word-break: break-word; }
.detail__comentario {
  grid-column: 1 / -1;
  background: var(--bg-warm);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 8px;
  font-style: italic;
  color: var(--ink-2);
  border-left: 3px solid var(--brand);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- RESPONSIVIDADE --- */
@media (max-width: 640px) {
  .admin-shell { padding: 18px 14px 48px; }

  /* Cabeçalho: logo + título numa linha, ações em grade 2x2 igual */
  .admin-header { padding-bottom: 20px; gap: 12px; }
  .admin-header__logo { height: 34px; }
  .admin-header__title { flex: 1; font-size: 19px; }
  .admin-header__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .admin-header__actions .btn {
    width: 100%;
    min-height: 46px;
    padding: 10px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Estatísticas em 2 colunas; o NPS ocupa a linha inteira */
  .stats { grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 22px; }
  .stat { padding: 15px 14px; }
  .stat::before { width: 3px; }
  .stat__label { font-size: 10.5px; letter-spacing: 0.3px; }
  .stat__value { font-size: 26px; }
  .stat__hint { font-size: 10.5px; margin-top: 4px; }
  #stat-nps-card { grid-column: 1 / -1; }

  /* Busca ocupa a linha toda; os chips quebram embaixo */
  .filters { gap: 7px; margin-bottom: 16px; }
  .filter-search { flex: 1 0 100%; min-width: 0; }
  .chip-filter { padding: 7px 12px; font-size: 12.5px; }

  /* Card de lead: avatar + dados + olho na MESMA linha, tags embaixo */
  .lead {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    row-gap: 10px;
    padding: 14px;
  }
  .lead__avatar { grid-column: 1; grid-row: 1; width: 40px; height: 40px; font-size: 14px; }
  .lead__main   { grid-column: 2; grid-row: 1; }
  .lead__actions{ grid-column: 3; grid-row: 1; align-self: center; }
  .lead__tags   { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  /* @ numa linha, telefone/hora na outra — em vez de quebrar em lugar aleatório */
  .lead__meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.4;
  }
  .lead__handle + .lead__sub::before { content: none; }
  .lead__sub { font-size: 12.5px; }

  .day-group { margin-bottom: 22px; }
  .day-group__head { gap: 9px; margin-bottom: 10px; }
  .day-group__date { display: none; }

  .detail { grid-template-columns: 1fr; gap: 4px 0; }
  .detail dt { margin-top: 8px; }
}

/* Hide scrollbar for scale on tiny screens */
@media (max-width: 380px) {
  .nps__btn { font-size: 12px; }
  .form__title { font-size: 22px; }
  .intro__title { font-size: 26px; }
}

/* ============================================================
   ============================================================
   ABAS DO PAINEL
   ============================================================
   ============================================================ */
.admin-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.admin-nav__tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 20px;
  margin-bottom: -2px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.admin-nav__tab .icon { font-size: 18px; }
.admin-nav__tab:hover { color: var(--brand); }
.admin-nav__tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ============================================================
   AGRUPAMENTO POR DIA
   ============================================================ */
.day-group { margin-bottom: 30px; }
.day-group__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.day-group__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.day-group__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: #FFF0E4;
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.day-group__date {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.day-group__line {
  flex: 1;
  min-width: 20px;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   ============================================================
   SORTEIO
   ============================================================
   ============================================================ */
.draw {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  margin-bottom: 30px;
  align-items: start;
}

/* --- CONFIGURAÇÕES --- */
.draw__config {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.draw__config h3 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.draw__config h3 .icon { font-size: 17px; color: var(--brand); }
.draw__history h3 .icon { font-size: 18px; color: var(--brand); }
.detail__comentario .icon { font-size: 15px; vertical-align: -0.15em; margin-right: 4px; }
.cfg { display: block; margin-bottom: 15px; }
.cfg__label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.cfg input[type="text"],
.cfg select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cfg input[type="text"]:focus,
.cfg select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
}
.cfg--check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.cfg--check input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

.draw__count {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.draw__count strong {
  font-size: 38px;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
  letter-spacing: -0.03em;
}
.draw__count span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
}

/* --- PALCO --- */
.draw__stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(700px 340px at 50% -12%, rgba(242, 118, 78, 0.45), transparent 65%),
    linear-gradient(150deg, #2C1E18 0%, #58291A 55%, #8C3617 100%);
  padding: 26px 24px 24px;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 24px 60px -20px rgba(140, 54, 23, 0.55);
}
.draw__confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.draw__rule {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFE9DE;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 999px;
  text-align: center;
  max-width: 100%;
}

.draw__display {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 240px;
}

/* Estado parado */
.draw__idle {
  text-align: center;
  color: #FFD9C7;
  animation: fadeSlide 0.5s var(--ease);
}
.draw__gift {
  font-size: 62px;
  line-height: 1;
  color: #FFD9C7;
  display: flex;
  justify-content: center;
  animation: giftFloat 3s ease-in-out infinite;
}
.draw__gift .icon { stroke-width: 1.4; }
@keyframes giftFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-12px) rotate(4deg); }
}
.draw__idle-text {
  margin: 14px 0 3px;
  font-size: 21px;
  font-weight: 800;
  color: white;
}
.draw__idle-sub { margin: 0; font-size: 13.5px; opacity: 0.72; }

/* Rolagem dos nomes */
.draw__reel {
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 800;
  color: white;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.15;
  padding: 0 10px;
  max-width: 100%;
  text-shadow: 0 0 34px rgba(255, 190, 150, 0.75);
  animation: reelPulse 0.4s ease-in-out infinite alternate;
}
@keyframes reelPulse {
  from { transform: scale(0.985); filter: blur(0.4px); }
  to   { transform: scale(1.015); filter: blur(0); }
}

/* Ganhador */
.draw__winner {
  text-align: center;
  animation: winnerIn 0.75s var(--ease) both;
}
@keyframes winnerIn {
  0%   { opacity: 0; transform: scale(0.6) translateY(20px); }
  60%  { opacity: 1; transform: scale(1.06) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.draw__winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #FFD166, #FFB020);
  color: #4A2D00;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 15px;
  box-shadow: 0 8px 22px -6px rgba(255, 177, 32, 0.8);
}
.draw__winner-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 15px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #FFF2E8, #FFD3BC);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
  animation: winnerGlow 2.2s ease-in-out infinite;
}
.draw__winner-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fadeIn 0.4s var(--ease);
}
@keyframes winnerGlow {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.2), 0 14px 34px -8px rgba(0, 0, 0, 0.5); }
  50%      { box-shadow: 0 0 0 13px rgba(255, 255, 255, 0.06), 0 14px 46px -6px rgba(255, 190, 150, 0.65); }
}
.draw__winner-name {
  margin: 0 0 7px;
  font-size: clamp(24px, 4.4vw, 38px);
  font-weight: 900;
  color: white;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.draw__winner-realname {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #FFE4D6;
  opacity: 0.92;
}
.draw__winner-realname:empty { display: none; }
.draw__winner-meta {
  margin: 0 0 13px;
  font-size: 13.5px;
  color: #FFD9C7;
  font-weight: 500;
  opacity: 0.8;
}
.draw__winner-tags {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
}
.draw__winner-tags .tag {
  background: rgba(255, 255, 255, 0.16);
  color: #FFEDE3;
}
.draw__winner-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.draw__winner-link.is-wa {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
  color: #D9FFE7;
}
.draw__winner-link.is-wa:hover {
  background: rgba(37, 211, 102, 0.3);
  border-color: rgba(37, 211, 102, 0.7);
}
.draw__winner-link[hidden] { display: none; }

.draw__winner-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #FFEDE3;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.draw__winner-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}
.draw__winner-link .icon { font-size: 15px; }

.draw__winner-premio {
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFD166;
}

.draw__btn {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.draw__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- HISTÓRICO --- */
.draw__history {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.draw__history h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 9px;
}
.draw__history-count {
  background: var(--bg-warm);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
/* Discreto de propósito: fica de canto, sem cor de alerta */
.draw__history-clear {
  margin-left: auto;
  background: none;
  border: none;
  padding: 2px 0;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.draw__history-clear:hover { color: var(--ink-2); }
.draw__history-clear[hidden] { display: none; }
.hist {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.hist:last-child { border-bottom: none; }
.hist__medal {
  font-size: 22px;
  flex-shrink: 0;
  display: inline-flex;
  color: var(--border-strong);
}
.hist__medal.is-gold   { color: #E0A526; }
.hist__medal.is-silver { color: #9AA3AB; }
.hist__medal.is-bronze { color: #B87333; }
.hist__main { flex: 1; min-width: 0; }
.hist__name {
  margin: 0;
  font-weight: 700;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist__meta {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.hist__premio {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: #FFF0E4;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hist__empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

/* --- RESPONSIVO DO SORTEIO --- */
@media (max-width: 900px) {
  .draw { grid-template-columns: 1fr; }
  /* No celular o palco vem primeiro — é o que interessa na hora do sorteio */
  .draw__stage { order: -1; min-height: 420px; }
}
@media (max-width: 640px) {
  .admin-nav { gap: 0; margin-bottom: 22px; }
  .admin-nav__tab {
    flex: 1;
    justify-content: center;
    padding: 12px 6px;
    font-size: 13.5px;
  }
  .admin-nav__tab .icon { font-size: 16px; }

  .draw { gap: 16px; margin-bottom: 22px; }
  .draw__stage { padding: 20px 16px; min-height: 400px; }
  .draw__rule { font-size: 10.5px; padding: 8px 13px; letter-spacing: 0.04em; }
  .draw__gift { font-size: 54px; }
  .draw__idle-text { font-size: 18px; }
  .draw__idle-sub { font-size: 12.5px; }
  .draw__winner-avatar { width: 78px; height: 78px; font-size: 26px; }
  .draw__winner-name { font-size: 27px; }
  .draw__winner-realname { font-size: 14.5px; }
  .draw__winner-meta { font-size: 12.5px; }
  .draw__btn { font-size: 15px; max-width: none; }

  .draw__config { padding: 18px 16px; }
  .draw__count strong { font-size: 32px; }

  .draw__history { padding: 18px 16px; }
  .hist { flex-wrap: wrap; row-gap: 8px; }
  .hist__premio { margin-left: 36px; }
}

/* Respeita quem pediu menos animação no sistema */
@media (prefers-reduced-motion: reduce) {
  .draw__gift,
  .draw__reel,
  .draw__winner,
  .draw__winner-avatar {
    animation: none !important;
  }
}
