:root {
  --void: #0a0a0f;
  --depth: #0f0f16;
  --surface: #14141b;
  --border: rgba(255, 255, 255, .08);
  --mint: #7fffd4;
  --mint-dim: #4ecca3;
  --indigo: #6366f1;
  --indigo-lt: #818cf8;
  --white: #f5f5f7;
  --white-60: rgba(255, 255, 255, .6);
  --white-30: rgba(255, 255, 255, .3);
  --danger: #f87171;
  --warn: #fbbf24;
  --f-display: 'Fraunces', serif;
  --f-body: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--void);
  color: var(--white);
  font-family: var(--f-body);
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; }

a { color: var(--indigo-lt); text-decoration: none; }

/* ── topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--depth);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar .logo { font-family: var(--f-display); font-size: 1.2rem; }
.topbar .logo span { color: var(--mint); }
.topbar nav { display: flex; gap: 6px; align-items: center; }
.topbar nav a {
  color: var(--white-60); padding: 7px 14px; border-radius: 8px;
  font-size: .9rem;
}
.topbar nav a.ativo, .topbar nav a:hover { color: var(--white); background: var(--surface); }
.usuario-chip { color: var(--white-30); font-size: .85rem; margin-right: 8px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* ── botões ── */
.btn {
  border: none; border-radius: 10px; padding: 9px 16px; cursor: pointer;
  font-family: var(--f-body); font-size: .88rem; font-weight: 500;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--mint); color: #05231a; }
.btn-secondary { background: var(--indigo); color: #fff; }
.btn-outline {
  background: transparent; color: var(--white-60);
  border: 1px solid var(--border);
}
.btn-ghost { background: transparent; color: var(--indigo-lt); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }

/* ── cards / lista ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; margin-bottom: 12px;
}
.contato-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contato-nome { font-weight: 600; font-size: 1.02rem; }
.contato-meta { color: var(--white-60); font-size: .85rem; margin-top: 4px; }
.contato-meta a { color: var(--mint-dim); }
.contato-acoes { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

/* ── badges de status ── */
.badge {
  padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600;
  letter-spacing: .02em;
}
.badge-novo { background: rgba(99, 102, 241, .18); color: var(--indigo-lt); }
.badge-mensagem { background: rgba(251, 191, 36, .15); color: var(--warn); }
.badge-ligacao { background: rgba(251, 146, 60, .15); color: #fb923c; }
.badge-interessado { background: rgba(127, 255, 212, .12); color: var(--mint); }
.badge-proposta { background: rgba(96, 165, 250, .15); color: #60a5fa; }
.badge-convertido { background: rgba(74, 222, 128, .15); color: #4ade80; }
.badge-perdido { background: rgba(255, 255, 255, .08); color: var(--white-30); }

/* ── formulários ── */
label { display: block; font-size: .8rem; color: var(--white-60); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; background: var(--depth); color: var(--white);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-family: var(--f-body); font-size: .9rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--mint-dim);
}
select.status-select { width: auto; padding: 6px 10px; font-size: .8rem; }

/* ── filtros ── */
.filtros {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px;
  align-items: center;
}
.filtros input, .filtros select { width: auto; flex: 1; min-width: 140px; }

/* ── modal ── */
.modal-bg {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .7);
  z-index: 100; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-bg.aberto { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; width: 100%; max-width: 480px;
}
.modal h2 { font-size: 1.2rem; margin-bottom: 4px; }
.modal .acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── timeline ── */
.timeline { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.timeline-item {
  padding: 8px 0 8px 16px; border-left: 2px solid var(--border);
  margin-left: 4px; font-size: .84rem;
}
.timeline-item .quando { color: var(--white-30); font-size: .74rem; }
.timeline-item .detalhe { color: var(--white-60); margin-top: 2px; white-space: pre-wrap; }

/* ── dashboard ── */
.funil-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.funil-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; text-align: center;
}
.funil-card .num { font-size: 2rem; font-family: var(--f-display); color: var(--mint); }
.funil-card .rotulo { color: var(--white-60); font-size: .8rem; margin-top: 4px; }

/* ── toast ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--mint-dim);
  color: var(--white); padding: 12px 20px; border-radius: 12px;
  font-size: .88rem; z-index: 200; display: none; max-width: 90vw;
}
#toast.erro { border-color: var(--danger); }

/* ── login ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 36px; width: 100%; max-width: 380px;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 2px; }
.login-card h1 span { color: var(--mint); }
.login-card p { color: var(--white-60); font-size: .88rem; margin-bottom: 12px; }
.login-card .btn { width: 100%; margin-top: 20px; padding: 12px; }

.vazio { text-align: center; color: var(--white-30); padding: 40px 0; }

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .contato-acoes .btn { flex: 1; }
}
