/* ============================================================
   HTB Dashboard - Main Stylesheet
   Identidade visual aprovada v0.2 (Mai/2026)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,100..900,0..100;1,9..144,100..900,0..100&family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-base: #0A0E18;
  --bg-card: #11172A;
  --bg-card-hover: #161D33;
  --bg-elevated: #1B2340;
  --border: rgba(201, 167, 101, 0.12);
  --border-strong: rgba(201, 167, 101, 0.28);
  --gold: #D4A85F;
  --gold-soft: #F0DBA8;
  --gold-deep: #8C6E37;
  --gold-glow: rgba(212, 168, 95, 0.4);
  --burgundy: #4D1F2E;
  --plum: #2A1530;
  --text-primary: #FAF6EE;
  --text-secondary: #B0AAA0;
  --text-muted: #6B6760;
  --emerald: #5DD9A8;
  --crimson: #FF6B7A;
  --amber: #FFB35A;
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Bricolage Grotesque', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text-primary);
  line-height: 1.55;
  background: var(--bg-base);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background com profundidade */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(212, 168, 95, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 25%, rgba(77, 31, 46, 0.32) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 50% 60%, rgba(212, 168, 95, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(42, 21, 48, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 0% 80%, rgba(140, 110, 55, 0.14) 0%, transparent 70%);
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.085 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}
.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.aurora-1 {
  width: 600px; height: 600px;
  top: -200px; right: -150px;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
  animation: drift1 20s ease-in-out infinite;
}
.aurora-2 {
  width: 500px; height: 500px;
  bottom: 20%; left: -200px;
  background: radial-gradient(circle, rgba(77, 31, 46, 0.6), transparent 70%);
  animation: drift2 25s ease-in-out infinite;
}
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(-100px,80px) scale(1.1);} }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(120px,-60px) scale(1.15);} }

main, header, footer { position: relative; z-index: 2; }

/* ============================================================
   APP HEADER (sticky topo)
   ============================================================ */
.app-header {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.7) 0%, rgba(17, 23, 42, 0.85) 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 80, 'wght' 400;
  font-style: italic;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand small {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  color: var(--text-muted);
  margin-left: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: 24px;
  font-family: var(--sans);
  font-size: 13px;
}
.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: all 0.3s;
}
.nav a:hover { color: var(--text-primary); }
.nav a.active { color: var(--gold); border-bottom-color: var(--gold); }

.period-selector {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 100px;
  border: 1px solid var(--border);
}
.period-selector button {
  padding: 7px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.3s;
}
.period-selector button:hover { color: var(--text-primary); }
.period-selector button.active {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 100%);
  color: var(--bg-base);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px;
}
.section-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-eyebrow::before { content: ''; width: 24px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

.section-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'wght' 350;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 350;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.section-title em { font-style: italic; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 300; color: var(--gold); font-weight: 300; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.kpi-card {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.5) 0%, rgba(17, 23, 42, 0.8) 100%);
  border: 1px solid var(--border);
  padding: 24px 22px;
  border-radius: 18px;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.kpi-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.kpi-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 12px;
}
.kpi-value {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 72, 'SOFT' 70, 'wght' 350;
  font-size: 36px;
  font-weight: 350;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.025em;
}
.kpi-value .currency {
  font-style: italic;
  font-variation-settings: 'opsz' 36, 'SOFT' 100, 'wght' 300;
  color: var(--gold);
  margin-right: 4px;
  font-size: 20px;
  vertical-align: 0.4em;
}
.kpi-value .small {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  vertical-align: 0.5em;
}
.kpi-delta { font-family: var(--mono); font-size: 10px; font-weight: 500; }
.kpi-delta.up { color: var(--emerald); }
.kpi-delta.down { color: var(--crimson); }
.kpi-delta.good-down { color: var(--emerald); }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.panel {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.4) 0%, rgba(17, 23, 42, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(8px);
  margin-bottom: 24px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.panel-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 70, 'wght' 450;
  font-size: 20px;
  letter-spacing: -0.01em;
}

/* ============================================================
   TABLES
   ============================================================ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
}
.tbl thead th {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.tbl thead th.right { text-align: right; }
.tbl tbody td {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody td.right { text-align: right; }
.tbl tbody tr { transition: background 0.3s; }
.tbl tbody tr:hover { background: rgba(212, 168, 95, 0.04); }
.tbl tbody td.name {
  color: var(--text-primary);
  font-weight: 500;
}
.tbl tbody td.name small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 2px;
  font-family: var(--mono);
}
.tbl tbody td.num { font-family: var(--mono); }
.tbl tbody td.num.gold { color: var(--gold-soft); }
.thumb {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold-deep) 0%, var(--bg-card) 100%);
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-soft);
  font-size: 16px;
  background-size: cover;
  background-position: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 12px 22px;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  color: var(--bg-base);
  box-shadow: 0 6px 20px rgba(212, 168, 95, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(212, 168, 95, 0.4), 0 0 32px rgba(212, 168, 95, 0.18);
}
.btn-ghost {
  background: rgba(212, 168, 95, 0.06);
  color: var(--gold-soft);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(212, 168, 95, 0.12); border-color: var(--gold); }
.btn-danger {
  background: rgba(255, 107, 122, 0.1);
  color: var(--crimson);
  border: 1px solid rgba(255, 107, 122, 0.3);
}
.btn-danger:hover { background: rgba(255, 107, 122, 0.2); }
.btn-sm { padding: 8px 16px; font-size: 11px; }
.btn-xs { padding: 6px 12px; font-size: 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ============================================================
   TAGS
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 100px;
  border: 1px solid;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.tag::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.tag.gold { color: var(--gold); border-color: var(--border-strong); background: rgba(212, 168, 95, 0.08); }
.tag.positive { color: var(--emerald); border-color: rgba(93, 217, 168, 0.3); background: rgba(93, 217, 168, 0.08); }
.tag.negative { color: var(--crimson); border-color: rgba(255, 107, 122, 0.3); background: rgba(255, 107, 122, 0.08); }
.tag.neutral { color: var(--text-secondary); border-color: var(--border); background: rgba(255, 255, 255, 0.02); }
.tag.amber { color: var(--amber); border-color: rgba(255, 179, 90, 0.3); background: rgba(255, 179, 90, 0.08); }

/* ============================================================
   FILTER CHIPS
   ============================================================ */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.chip .count {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 7px;
  border-radius: 100px;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active { border-color: var(--gold); color: var(--gold-soft); background: rgba(212, 168, 95, 0.1); }
.chip.active .count { color: var(--gold); background: rgba(212, 168, 95, 0.15); }

/* ============================================================
   FORM INPUTS
   ============================================================ */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border 0.3s;
}
.input:focus,
input:focus,
textarea:focus,
select:focus { border-color: var(--gold); }
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--text-muted); }
input.search-pill { border-radius: 100px; padding-left: 22px; padding-right: 22px; }
textarea { min-height: 120px; resize: vertical; font-family: var(--sans); line-height: 1.5; }
.label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 8px;
  display: block;
}

/* ============================================================
   FUNNEL STATS (aba leads)
   ============================================================ */
.funnel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}
.funnel-stat { text-align: center; position: relative; }
.funnel-stat:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 30%; right: -6px;
  width: 1px; height: 40%;
  background: var(--border);
}
.funnel-num {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 72, 'SOFT' 80, 'wght' 350;
  font-size: 28px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.funnel-num.gold { color: var(--gold-soft); font-style: italic; }
.funnel-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-top: 6px;
}

/* ============================================================
   LEAD CARDS (aba comercial)
   ============================================================ */
.lead-list { display: flex; flex-direction: column; gap: 8px; }
.lead-card {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.4) 0%, rgba(17, 23, 42, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 48px 1.6fr 1.4fr auto auto;
  align-items: center;
  gap: 18px;
  transition: all 0.4s var(--ease);
}
.lead-card:hover {
  transform: translateX(3px);
  border-color: var(--border-strong);
}
.lead-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-deep) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--gold-soft);
}
.lead-name {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.lead-name small {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
  font-size: 11px;
}
.lead-quals { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.lead-meta {
  display: flex; gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 6px;
  flex-wrap: wrap;
}
.lead-source {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-secondary);
}
.source-thumb {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-deep), var(--bg-card));
  border: 1px solid var(--border-strong);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.source-info { display: flex; flex-direction: column; min-width: 0; }
.source-info strong { font-weight: 500; color: var(--text-primary); font-size: 11px; line-height: 1.3; }
.source-info small {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 2px;
}
.lead-actions { display: flex; gap: 6px; }

/* ============================================================
   MODAL / DRAWER
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 24, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.95) 0%, rgba(17, 23, 42, 0.98) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: transparent;
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s;
}
.modal-close:hover { background: rgba(255, 107, 122, 0.1); color: var(--crimson); border-color: var(--crimson); }
.modal-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 70, 'wght' 450;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.modal-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   QUALIFICATION CARDS (pizzas dinâmicas)
   ============================================================ */
.qual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.qual-card {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.4) 0%, rgba(17, 23, 42, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}
.qual-question {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 24, 'SOFT' 70, 'wght' 450;
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.3;
}
.qual-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}
.qual-bar-label {
  flex: 1;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 12px;
}
.qual-bar-track {
  flex: 1.5;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.qual-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}
.qual-bar-pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-soft);
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.5) 0%, rgba(17, 23, 42, 0.85) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 56px 48px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.login-brand {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 80, 'wght' 320;
  font-style: italic;
  font-size: 42px;
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.login-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 36px;
}
.login-error {
  background: rgba(255, 107, 122, 0.1);
  border: 1px solid rgba(255, 107, 122, 0.3);
  color: var(--crimson);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-top: 16px;
  display: none;
}
.login-error.show { display: block; }

/* ============================================================
   TOGGLE SWITCH (filtros visíveis)
   ============================================================ */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  user-select: none;
}
.toggle input { display: none; }
.toggle::before {
  content: '';
  width: 36px;
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  transition: all 0.3s var(--ease);
}
.toggle::after {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  margin-left: 3px;
  transition: all 0.3s var(--ease);
}
.toggle:has(input:checked) {
  color: var(--gold-soft);
}
.toggle:has(input:checked)::before {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: var(--gold);
}
.toggle:has(input:checked)::after {
  background: var(--bg-base);
  margin-left: 19px;
}

/* ============================================================
   PRODUCT CARDS (análise por produto)
   ============================================================ */
.product-card {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.5) 0%, rgba(17, 23, 42, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease);
  cursor: pointer;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.product-card[data-product="evento"]::before { background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.product-card[data-product="mentoria"]::before { background: linear-gradient(90deg, transparent, #B57EDC, transparent); }
.product-card[data-product="distribuicao"]::before { background: linear-gradient(90deg, transparent, var(--emerald), transparent); }
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 2px;
  opacity: 0.7;
}
.product-name {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 70, 'wght' 450;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.product-name em {
  font-style: italic;
  font-variation-settings: 'opsz' 36, 'SOFT' 100, 'wght' 350;
  color: var(--gold);
}
.product-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 18px;
}
.product-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
.product-stat-num {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 72, 'SOFT' 70, 'wght' 350;
  font-size: 28px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}
.product-stat-num .currency {
  font-style: italic;
  color: var(--gold);
  font-size: 16px;
  margin-right: 3px;
  vertical-align: 0.4em;
}
.product-stat-num.gold { color: var(--gold-soft); }
.product-stat-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-top: 6px;
}

/* ============================================================
   LEAD GROUP HEADERS (separação visual de leads)
   ============================================================ */
.lead-group {
  margin-bottom: 32px;
}
.lead-group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(212, 168, 95, 0.12) 0%, rgba(17, 23, 42, 0.4) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  border-bottom: none;
  margin-bottom: -1px;
  position: relative;
}
.lead-group-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.lead-group-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--bg-base);
  font-size: 18px;
  flex-shrink: 0;
}
.lead-group-title {
  flex: 1;
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 60, 'wght' 450;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.lead-group-title em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: 'opsz' 36, 'SOFT' 100, 'wght' 350;
}
.lead-group-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}
.lead-group-body {
  background: rgba(17, 23, 42, 0.3);
  border: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   LEAD SOURCE BADGE (origem destacada)
   ============================================================ */
.lead-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: linear-gradient(135deg, rgba(212, 168, 95, 0.15), rgba(212, 168, 95, 0.05));
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gold-soft);
  font-weight: 500;
  margin-bottom: 6px;
}
.lead-source-badge .badge-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--bg-base);
  font-size: 11px;
  flex-shrink: 0;
}

/* ============================================================
   ANALYSIS PAGE (drill-down)
   ============================================================ */
.level-tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px;
  border-radius: 100px;
  border: 1px solid var(--border);
  gap: 4px;
}
.level-tabs button {
  padding: 10px 22px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.level-tabs button:hover { color: var(--text-primary); }
.level-tabs button.active {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 100%);
  color: var(--bg-base);
  box-shadow: 0 4px 16px rgba(212, 168, 95, 0.25);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s;
}
.breadcrumb a:hover { color: var(--gold-soft); }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   STATES (loading / empty / error)
   ============================================================ */
.state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 14px;
}
.state-icon {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 250;
  font-style: italic;
  font-size: 64px;
  color: var(--gold);
  opacity: 0.4;
  margin-bottom: 12px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  max-width: 360px;
}
.toast {
  background: linear-gradient(155deg, rgba(27, 35, 64, 0.95) 0%, rgba(17, 23, 42, 0.98) 100%);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-primary);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.4s var(--ease);
}
.toast.success { border-left-color: var(--emerald); }
.toast.error { border-left-color: var(--crimson); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .container { padding: 20px; }
  .app-header { padding: 14px 18px; }
  .nav { gap: 14px; font-size: 12px; }
  .lead-card {
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding: 14px;
  }
  .lead-card > .lead-source,
  .lead-card > .lead-actions { grid-column: 1 / -1; }
  .lead-card > [data-status] { grid-column: 2; }
  .kpi-value { font-size: 28px; }
  .panel { padding: 20px; }
}
