:root {
  --bg: #0b0e14;
  --card: #131722;
  --card2: #1a1f2e;
  --border: #232a3b;
  --border2: #2f3850;
  --text: #e8ecf4;
  --muted: #8b93a8;
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, .12);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, .12);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, .12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, .12);
  --violet: #a78bfa;
  --violet-bg: rgba(167, 139, 250, .12);
}

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

body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(96, 165, 250, .08), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(167, 139, 250, .07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ─── Nav ─────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px;
  background: rgba(11, 14, 20, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.brand span {
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 12px; font-weight: 900;
}
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-link {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; transition: all .15s;
}
.nav-link:hover { color: var(--text); background: var(--card2); }
.nav-link.on { color: #fff; background: var(--blue); }
.nav-live {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--red-bg); color: var(--red); border: 1px solid rgba(248, 113, 113, .25);
}
.nav-live.on { background: var(--green-bg); color: var(--green); border-color: rgba(52, 211, 153, .25); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 20px; }

/* ─── Cabeçalho de página ─────────────────────────────── */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head .acc {
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.back {
  display: inline-block; margin-bottom: 10px; color: var(--blue); text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.back:hover { text-decoration: underline; }

/* ─── KPIs ────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
  transition: transform .15s, border-color .15s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--border2); }
.kpi b { font-size: 26px; font-weight: 800; }
.kpi span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi.b b { color: var(--blue); } .kpi.g b { color: var(--green); }
.kpi.a b { color: var(--amber); } .kpi.v b { color: var(--violet); } .kpi.r b { color: var(--red); }
.ok { color: var(--green); }

/* ─── Colunas / painéis ───────────────────────────────── */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.panel {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  margin-bottom: 14px;
}
.panel h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 13px; }

/* ─── Barras de categoria ─────────────────────────────── */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; }
.bar-label { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--card2); border: 1px solid var(--border); border-radius: 999px; height: 22px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px; min-width: 22px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
}
.bar-num { font-size: 13px; font-weight: 700; text-align: right; }

/* ─── Tabelas ─────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-weight: 700; }

/* ─── Lista de recentes ───────────────────────────────── */
.rec-list { display: flex; flex-direction: column; }
.rec-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; text-decoration: none; color: var(--text);
  transition: background .15s;
}
.rec-row:hover { background: var(--card2); }
.rec-nome { font-weight: 600; font-size: 13.5px; flex: 1; }
.rec-dom { color: var(--blue); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-g { background: var(--green); } .dot-b { background: var(--blue); }

/* ─── Toolbar / busca ─────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search {
  flex: 1; min-width: 220px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 16px; color: var(--text); font-size: 14px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(96, 165, 250, .15); }
.toolbar select {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; outline: none; cursor: pointer;
}
.btn {
  background: var(--blue); color: #fff; border: none; border-radius: 12px;
  padding: 10px 18px; font-size: 13px; font-weight: 700; cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(1.15); }
.stats-line { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }

/* ─── Grid de cards ───────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 14px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  display: flex; flex-direction: column; gap: 12px;
}
.card:hover { transform: translateY(-3px); border-color: var(--border2); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); }
.card .corner { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.card.prio-0 .corner { background: linear-gradient(90deg, var(--green), transparent); }
.card.prio-1 .corner { background: linear-gradient(90deg, var(--blue), transparent); }
.card.prio-2 .corner { background: linear-gradient(90deg, var(--amber), transparent); }
.card.prio-3 .corner { background: linear-gradient(90deg, var(--muted), transparent); }
.name-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card h3 { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.dom { color: var(--blue); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.dom:hover { text-decoration: underline; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  background: var(--card2); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 11px; font-size: 11px; color: var(--muted); font-weight: 600;
}
.chip.status-enriquecido { color: var(--green); border-color: rgba(52, 211, 153, .3); }
.chip.status-novo { color: var(--amber); border-color: rgba(251, 191, 36, .3); }
.chip.status-fantasma { color: var(--red); border-color: rgba(248, 113, 113, .3); }
.contatos { display: flex; flex-direction: column; gap: 7px; }
.ct {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: filter .15s, transform .15s; word-break: break-all;
}
.ct:hover { filter: brightness(1.15); transform: translateX(2px); }
.ct-tel { background: var(--green-bg); color: var(--green); border: 1px solid rgba(52, 211, 153, .25); }
.ct-mail { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(96, 165, 250, .25); }
.ct-nc { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248, 113, 113, .2); font-weight: 500; }
.card .open-link { margin-top: auto; font-size: 12.5px; color: var(--muted); text-decoration: none; font-weight: 600; }
.card .open-link:hover { color: var(--blue); }
.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 14px; }

/* ─── Detalhe ─────────────────────────────────────────── */
.dossier { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.dd { display: flex; gap: 10px; }
.dd span { flex: 0 0 150px; color: var(--muted); }
.dd b { flex: 1; font-weight: 600; word-break: break-word; }
.panel-contatos { margin-top: 0; }

.foot {
  text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px;
}
