/* ==================================================================
   ProspectZyra — Design System "CORPORATE"
   Sério · limpo · profissional
   Azul (acento) · Preto/grafite (cabeçalho) · Branco · Cinza
   Tipografia: Inter (display/corpo) · JetBrains Mono (dados)
   ================================================================== */

:root {
  color-scheme: light;

  /* ---- superfícies ---- */
  --bg: #f4f6fa;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #f1f4f9;
  --line: #e4e8f0;
  --line-2: #d3dae6;

  /* ---- texto ---- */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  /* ---- acento (azul corporativo) ---- */
  --acc: #1d4ed8;
  --acc-2: #2563eb;
  --acc-soft: #e8effc;
  --acc-ink: #ffffff;

  /* ---- sinal secundário ---- */
  --sig: #2563eb;
  --sig-2: #1e40af;
  --sig-soft: #eaf1fe;

  /* ---- semânticos ---- */
  --green: #0f9d63;
  --green-soft: #e6f6ef;
  --red: #d92d20;
  --red-soft: #fdecea;
  --pink: #c11574;
  --pink-soft: #fbe8f2;
  --violet: #6938ef;
  --violet-soft: #efeafd;

  /* compatibilidade (usado pelo app.js) */
  --amber: #b45309;
  --amber-2: #d97706;
  --amber-soft: #fdf3e6;

  /* ---- cabeçalho escuro ---- */
  --hud-bg: #0b1220;
  --hud-bg-2: #111a2e;
  --hud-ink: #f8fafc;
  --hud-muted: #9aa7bd;
  --hud-line: rgba(255, 255, 255, 0.10);

  /* ---- tipografia ---- */
  --display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* ---- forma ---- */
  --r-xs: 6px;
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-3: 0 24px 56px rgba(16, 24, 40, 0.18);
  --ring: 0 0 0 3px rgba(29, 78, 216, 0.20);
  --ring-2: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --glow-acc: 0 1px 2px rgba(16, 24, 40, 0.06);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --container: 1360px;
}

/* ------------------------------ base ------------------------------ */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* atmosfera: fundo corporativo discreto (sem grade/glow) */
.bg-grid, .glow { display: none; }

::selection { background: var(--acc); color: #fff; }

strong, b { font-weight: 600; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea, option, optgroup, summary, label, dt, dd { color: var(--ink); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }

.hidden { display: none !important; }

/* ícones inline */
.ic { flex: none; display: inline-block; vertical-align: -2px; }
.tab .ic { width: 15px; height: 15px; }
.btn .ic { width: 15px; height: 15px; }
.stat-ico { display: inline-flex; }
.stat-ico .ic { width: 20px; height: 20px; }
.fn-ico { display: inline-flex; }
.ph-ico .ic { width: 22px; height: 22px; }
.t-top .ic { color: var(--muted); vertical-align: -2px; }
.t-ico .ic { color: currentColor; }
.edge .ic, .kri .ic { color: var(--muted); }
.a-go .ic, .e-cond .ic { vertical-align: -2px; }

/* --------------------------- tipografia --------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.logo, #levelNum, .fn-val, .stat b, .ab-row b, .score, .xp-label,
.kv dd, .ti-meta, .oi-meta, .a-sched, .a-last, .rawjson, pre, code,
.edge, .delay-badge, .ss-meta, .t-when, .when, .xp, .streak b, .d-stat {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ============================== HUD ============================== */
.hud {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  padding: 15px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--hud-line);
  background: var(--hud-bg);
  color: var(--hud-ink);
  box-shadow: 0 10px 30px -18px rgba(2, 6, 23, 0.6);
}
.hud::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc-2), transparent);
  opacity: 0.7;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 46px; font-size: 24px; color: #fff;
  background: var(--acc);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--r-sm);
}
.logo::after { display: none; }
.brand h1 { margin: 0; font-size: clamp(18px, 2.2vw, 24px); letter-spacing: 0.02em; font-weight: 800; color: var(--hud-ink); }
.brand h1 span { color: #7aa2ff; }
.tagline {
  margin: 4px 0 0;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--hud-muted);
}
.player { display: flex; align-items: center; gap: 18px; }
.level-ring {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(#3b82f6 var(--p, 0%), #93c5fd calc(var(--p, 0%) + 10%), rgba(255, 255, 255, 0.14) 0);
}
.level-ring::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--hud-bg-2); }
.level-ring span { position: relative; font-size: 22px; font-weight: 800; color: #fff; font-family: var(--display); }
.level-ring small { position: absolute; bottom: 8px; font-family: var(--display); font-size: 7px; letter-spacing: 0.16em; color: var(--hud-muted); }
.player-info { min-width: 214px; }
.player-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.player-top strong { font-family: var(--display); font-size: 14px; letter-spacing: 0.01em; color: var(--hud-ink); }
.streak { font-size: 12px; color: #fbbf24; }
.xp-bar { position: relative; height: 18px; border-radius: var(--r-pill); overflow: hidden; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--hud-line); }
.xp-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width 0.6s var(--ease); }
.xp-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; letter-spacing: 0.04em; color: #fff; font-weight: 700; }
.conn { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--hud-muted); }
.conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.conn[data-status='connected'] i { background: #34d399; }
.conn[data-status='qr'] i, .conn[data-status='connecting'] i { background: #fbbf24; animation: pulse 1.1s infinite; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; }
.dot.on { background: var(--green); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ============================== NAV ============================== */
.tabs { position: relative; z-index: 40; display: flex; gap: 6px; flex-wrap: wrap; padding: 14px clamp(16px, 4vw, 44px) 0; max-width: var(--container); margin: 0 auto; width: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--body); font-weight: 600; font-size: 13.5px; letter-spacing: 0;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  padding: 9px 15px; border-radius: var(--r-sm); cursor: pointer; transition: 0.15s var(--ease);
}
.tab:hover { color: var(--ink); background: var(--panel-3); }
.tab.active { color: #fff; background: var(--acc); border-color: var(--acc); box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25); }
.menu-toggle.active { color: #fff; background: var(--acc); }
.subnav { position: relative; z-index: 39; display: none; flex-wrap: wrap; gap: 6px; padding: 12px clamp(16px, 4vw, 44px) 0; max-width: var(--container); margin: 0 auto; width: 100%; animation: fade 0.2s var(--ease); }
.subnav.open { display: flex; }
.subnav .tab { font-size: 12.5px; padding: 7px 13px; background: var(--panel); border-color: var(--line); }
.subnav .tab.active { color: #fff; background: var(--acc); border-color: var(--acc); }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }

/* ============================== MAIN ============================= */
main {
  position: relative; z-index: 2;
  max-width: var(--container); margin: 0 auto; width: 100%;
  padding: 16px clamp(16px, 4vw, 44px) 80px;
}
.page-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.page-head .ph-ico {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  font-size: 22px; color: var(--acc);
  background: var(--acc-soft);
  border: 1px solid #d7e2fb; border-radius: var(--r-sm);
}
.page-head .ph-text { flex: 1; min-width: 200px; }
.page-head h2 { font-size: 20px; }
.page-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.page-head .ph-crumb {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 3px;
}
.page-head .ph-crumb b { color: var(--acc); }
.panel { display: none; }
.panel.active { display: flex; flex-direction: column; gap: 16px; animation: fade 0.3s var(--ease); }

/* ============================= CARDS ============================= */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.card::before { display: none; }
.card h2 {
  margin: 0 0 12px; font-size: 13px; font-family: var(--display);
  letter-spacing: 0.02em; text-transform: none; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.card h2::before { content: ''; width: 4px; height: 16px; background: var(--acc); border-radius: 2px; }
.card.narrow { max-width: 620px; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.tiny { font-size: 11.5px; }
code { font-family: var(--mono); font-size: 12px; background: var(--acc-soft); color: var(--acc-2); padding: 1px 6px; border-radius: 6px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; overflow: hidden; }
.stat::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--acc); }
.stat-ico { font-size: 18px; color: var(--acc); }
.stat b { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat small { color: var(--muted); font-size: 11px; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.08em; }
.badges-card { margin-top: 0; }
.section-title { font-family: var(--display); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.list-head .section-title { margin: 0; }

/* ============================ MISSOES =========================== */
.missions, .events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mission {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px;
  background: var(--panel-3);
}
.mission .m-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 9px; }
.mission .reward { color: var(--acc); font-family: var(--mono); font-size: 11.5px; }
.mission .track { height: 7px; border-radius: var(--r-pill); background: #e9edf4; overflow: hidden; }
.mission .track i { display: block; height: 100%; background: var(--acc-2); transition: width 0.5s var(--ease); }
.mission.ready { border-color: #bcd0f7; background: var(--acc-soft); }
.mission.claimed { opacity: 0.55; }
.events li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 9px 11px; border-radius: var(--r-xs); background: var(--panel-3); }
.events .xp { color: var(--acc); }
.events .when { color: var(--muted-2); font-size: 10.5px; }
.badges { display: flex; flex-wrap: wrap; gap: 9px; }
.badge {
  padding: 7px 14px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  font-family: var(--body); letter-spacing: 0;
  background: var(--acc-soft);
  border: 1px solid #d7e2fb; color: var(--acc-2);
}
.empty { color: var(--muted-2); font-size: 13px; font-style: normal; }

/* =========================== FORM / BTN ========================== */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.bulkbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.lead-check { width: auto !important; accent-color: var(--acc); cursor: pointer; flex: none; }
input, select, textarea {
  font-family: var(--body); font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-xs);
  padding: 11px 14px; outline: none; transition: 0.15s var(--ease); width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: var(--ring); }
select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { resize: vertical; min-height: 44px; }
/* dropdown e autofill em tema claro */
select, option, optgroup { color-scheme: light; }
select option, select optgroup { background-color: #fff; color: var(--ink); }
option:checked, option:hover { background-color: var(--acc-soft); color: var(--ink); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--body); font-weight: 600; font-size: 13.5px; letter-spacing: 0;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r-xs);
  padding: 10px 16px; cursor: pointer; transition: 0.15s var(--ease); white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--muted-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { color: #fff; background: var(--acc); border-color: var(--acc); box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25); }
.btn.primary:hover { background: var(--acc-2); border-color: var(--acc-2); }
.btn.sm { padding: 8px 13px; font-size: 12.5px; }
.btn.xs { padding: 2px 8px; font-size: 11px; border-radius: var(--r-xs); }
.btn.danger { color: var(--red); border-color: #f4c2bd; background: var(--red-soft); }
.btn.danger:hover { background: #fbdad5; border-color: var(--red); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form { display: flex; flex-direction: column; gap: 13px; margin-top: 6px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-family: var(--body); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.form-inline { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.form-inline input { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 13px; }
.chk { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px !important; text-transform: none !important; letter-spacing: 0 !important; font-family: var(--body) !important; color: var(--ink-2) !important; cursor: pointer; }
.chk input { width: auto !important; accent-color: var(--acc); }
.tags {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-xs);
  padding: 8px 10px; min-height: 44px;
}
.tags-input { flex: 1; min-width: 110px; border: none !important; background: transparent !important; padding: 4px 2px !important; }
.tags-input:focus { box-shadow: none !important; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 6px 5px 11px; border-radius: var(--r-pill); background: var(--acc-soft); border: 1px solid #d7e2fb; color: var(--acc-2); }
.tag button { border: none; background: transparent; color: var(--acc); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.tags-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sugg { font-size: 12px; padding: 5px 11px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: 0.15s var(--ease); }
.sugg:hover { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }
.result { margin-top: 12px; font-size: 13px; color: var(--muted); }
.result b { color: var(--acc); }

/* ===================== CARD HEAD / EMPTY / SKEL ================= */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 34px 20px; color: var(--muted-2); }
.empty-state .ic { color: var(--muted); }
.empty-state p { margin: 0; max-width: 320px; font-size: 13px; }
.skel { height: 14px; border-radius: 8px; background: linear-gradient(90deg, #eef1f6, #e2e7f0, #eef1f6); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================ LEADS ============================= */
.lead-list { display: flex; flex-direction: column; gap: 11px; }
.lead {
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px;
  background: var(--panel);
  transition: 0.16s var(--ease);
}
.lead:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.lead h3 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 0 0 7px; font-size: 15px; font-family: var(--display); }
.lead .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.lead .actions { display: flex; flex-direction: column; gap: 7px; flex: none; align-items: stretch; }
.lead .actions .btn { justify-content: center; }
.pill { font-size: 10px; padding: 3px 10px; border-radius: var(--r-pill); font-family: var(--body); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--panel-3); color: var(--ink-2); }
.pill.novo { background: var(--sig-soft); color: var(--sig-2); }
.pill.contatado { background: var(--amber-soft); color: var(--amber); }
.pill.respondeu { background: var(--pink-soft); color: var(--pink); }
.pill.convertido { background: var(--green-soft); color: var(--green); }
.pill.perdido { background: var(--red-soft); color: var(--red); }
.pill.agendado { background: var(--violet-soft); color: var(--violet); }
.pill.qualificado { background: var(--acc-soft); color: var(--acc); }
.pill.oportunidade { background: var(--violet-soft); color: var(--violet); }
.score { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); }
.score.hi { background: var(--green-soft); color: var(--green); }
.score.mid { background: var(--amber-soft); color: var(--amber); }
.score.lo { background: var(--red-soft); color: var(--red); }
.mbadge { font-size: 10.5px; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); padding: 2px 9px; border-radius: var(--r-pill); }
.mbadge.ok { color: var(--green); border-color: #bfe6d2; }
.mbadge.ai { color: var(--acc); border-color: #cdddf9; }
.mbadge.ag { color: var(--violet); border-color: #d9cdfa; }
.last-act { font-size: 11.5px; color: var(--muted); margin: 7px 0; }
.lead-contacts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.cico { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 11px; border-radius: var(--r-pill); background: var(--panel-3); border: 1px solid var(--line-2); color: var(--ink-2); text-decoration: none; cursor: pointer; transition: 0.15s var(--ease); font-family: var(--body); }
.cico:hover { border-color: var(--acc); color: var(--acc); }
.cico.wa { background: var(--green-soft); border-color: #bfe6d2; color: var(--green); }
.cico.wa:hover { border-color: var(--green); }
.cico.ig { background: var(--pink-soft); border-color: #f3c6de; color: var(--pink); }
.cico.ig:hover { border-color: var(--pink); }
.cico.primary { background: var(--green-soft); border-color: var(--green); }
.cico .ic { color: currentColor; }

/* ========================== DESCOBRIR =========================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { font-size: 12px; padding: 6px 13px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: 0.15s var(--ease); font-family: var(--body); }
.chip:hover { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }
.cat-wrap { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.cat-wrap > summary { cursor: pointer; padding: 11px 14px; font-family: var(--display); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cat-wrap[open] > summary { border-bottom: 1px solid var(--line); color: var(--ink); }
.cat-wrap .inner, #nicheCatalog { padding: 12px 14px; }
.cat-group { border: 1px solid var(--line); border-radius: var(--r-xs); padding: 10px 12px; margin-bottom: 10px; }
.cat-group b { display: block; font-family: var(--display); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc); margin-bottom: 8px; }

/* ============================ HERMES ============================ */
.kv { margin: 14px 0 0; padding: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); font-family: var(--body); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.kv dd { margin: 0; color: var(--ink); }
.qr-box {
  display: grid; place-items: center; min-height: 280px;
  border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 16px;
  background: var(--panel-3);
}
.qr-box img { width: 270px; height: 270px; border-radius: var(--r-xs); background: #fff; padding: 10px; }

/* ============================== IA ============================== */
.providers { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.providers li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 11px 13px; border-radius: var(--r-xs); background: var(--panel-3); border: 1px solid var(--line); }
.providers small { color: var(--muted); font-size: 11px; display: block; }
.chat { display: flex; flex-direction: column; gap: 9px; height: 300px; overflow: auto; padding: 6px; margin-bottom: 10px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--acc); color: #fff; border: 1px solid var(--acc); border-bottom-right-radius: 4px; }
.msg.me .who { color: rgba(255, 255, 255, 0.75); }
.msg.ai { align-self: flex-start; background: var(--panel-3); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .who { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; font-family: var(--mono); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* ============================ FLUXO ============================= */
.flowbar {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.flow-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.flow-head h2 { margin: 0; }
.flow-head h2 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted-2); margin-left: 6px; font-size: 10.5px; font-family: var(--body); }
.flowwrap { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.flow-node {
  position: relative; min-width: 150px; flex: 1 1 150px; max-width: 210px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; transition: 0.18s var(--ease); cursor: pointer;
}
.flow-node:hover { border-color: var(--acc); box-shadow: var(--shadow-2); }
.flow-node::after { content: '↗'; position: absolute; top: 8px; right: 11px; font-size: 11px; color: var(--muted-2); opacity: 0; transition: 0.2s; }
.flow-node:hover::after { opacity: 1; color: var(--acc); }
.flow-node .fn-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; font-family: var(--display); }
.flow-node .fn-ico { font-size: 16px; color: var(--acc); }
.flow-node .fn-val { font-size: 22px; font-weight: 700; margin-top: 6px; color: var(--ink); }
.flow-node .fn-hint { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.flow-node.ready { border-color: #bfe6d2; }
.flow-node.ready .fn-val { color: var(--green); }
.flow-node.active { border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }
.flow-arrow { align-self: center; color: var(--muted-2); font-size: 16px; padding: 0 1px; }
.flow-arrow small { display: block; font-size: 8.5px; color: var(--muted-2); text-align: center; }
.flowbar.collapsed > .flowwrap, .flowbar.collapsed > .automations { display: none; }
.flowbar.collapsed .flow-head { margin-bottom: 0; }

/* automacoes */
.automations { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.automation { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px; background: var(--panel-3); transition: 0.15s var(--ease); }
.automation .a-top { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; font-family: var(--display); }
.automation .a-sched { margin-left: auto; font-size: 10px; color: var(--acc); }
.automation .a-desc { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.automation .a-last { font-size: 10px; color: var(--muted-2); margin-top: 7px; }
.automation.clickable { cursor: pointer; }
.automation.clickable:hover { border-color: var(--acc); box-shadow: var(--shadow-2); }
.automation .a-go { margin-top: 9px; font-size: 11.5px; color: var(--acc); font-weight: 600; font-family: var(--body); }
.automations.full { grid-template-columns: 1fr; }

/* ============================ OFERTAS =========================== */
.offer-list, .tpl-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.offer-item, .tpl-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px; background: var(--panel-3); transition: 0.15s var(--ease); }
.offer-item.active, .tpl-item.active { border-color: #bcd0f7; background: var(--acc-soft); }
.offer-item.editing { border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }
.offer-item.saved { animation: savedflash 3s var(--ease); }
.offer-item .oi-body, .tpl-item .ti-body { flex: 1; min-width: 0; }
.offer-item h4, .tpl-item h4 { margin: 0 0 5px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-item .oi-meta, .tpl-item .ti-meta { font-size: 11px; color: var(--muted); }
.offer-item .oi-desc { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; line-height: 1.45; }
.tpl-item .ti-actions, .offer-item .ti-actions { display: flex; flex-direction: column; gap: 6px; }
.mode-badge { padding: 2px 9px; border-radius: var(--r-pill); font-size: 9.5px; font-weight: 700; font-family: var(--body); text-transform: uppercase; letter-spacing: 0.05em; }
.mode-badge.auto { background: var(--sig-soft); color: var(--sig-2); }
.mode-badge.fixed { background: var(--amber-soft); color: var(--amber); }
.mode-badge.editando { background: var(--green-soft); color: var(--green); }
.mode-badge.inativo { background: var(--panel-3); color: var(--muted); }
.delay-badge { font-size: 10px; color: var(--muted-2); margin-left: 8px; }

/* ===================== TEMPLATES (previa) ======================= */
.preview-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 16px 0 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.pt-lead select { min-width: 180px; }
.pt-var { display: flex; gap: 6px; align-items: center; }
.variations { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.variation { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px; background: var(--panel-3); }
.variation .v-idx { font-family: var(--mono); font-size: 9.5px; color: var(--acc); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.08em; }
.variation .v-text { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.variation .v-actions { display: flex; gap: 7px; margin-top: 11px; }
.seq-step { border-left: 2px solid var(--acc); padding: 9px 0 9px 13px; margin-bottom: 9px; }
.seq-step b { font-size: 12.5px; font-family: var(--display); }
.seq-step .ss-meta { font-size: 9.5px; color: var(--muted-2); margin-left: 8px; }
.seq-step .ss-text { font-size: 13px; white-space: pre-wrap; margin-top: 6px; color: var(--ink-2); }

/* ===================== TEMPLATES (sequencia) ==================== */
.seq-summary { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.schip { font-size: 11px; padding: 4px 11px; border-radius: var(--r-pill); background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.schip b { color: var(--acc); }
.seq { position: relative; list-style: none; margin: 12px 0 0; padding: 0; }
.seq::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.seq-item { position: relative; display: flex; gap: 13px; align-items: flex-start; padding: 12px 14px 12px 0; cursor: pointer; transition: 0.15s var(--ease); }
.seq-item:hover { background: var(--panel-3); }
.seq-item.editing { background: var(--acc-soft); }
.seq-item.off { opacity: 0.5; }
.seq-num { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--acc); color: var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 700; }
.seq-num.small { width: 26px; height: 26px; font-size: 11px; }
.seq-body { flex: 1; min-width: 0; }
.seq-title { font-family: var(--display); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seq-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.seq-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }

/* =========================== ANTI-BAN =========================== */
.antiban-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.antiban-head .ab-summary { display: flex; flex-direction: column; gap: 4px; }
.antiban-head .ab-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-family: var(--display); font-weight: 700; }
.risk { padding: 4px 12px; border-radius: var(--r-pill); font-weight: 700; font-size: 10px; font-family: var(--body); text-transform: uppercase; letter-spacing: 0.06em; }
.risk.low { background: var(--green-soft); color: var(--green); }
.risk.medium { background: var(--amber-soft); color: var(--amber); }
.risk.high { background: #fce6cf; color: var(--amber-2); }
.risk.critical { background: var(--red-soft); color: var(--red); }
.risk.off { background: var(--panel-3); color: var(--muted); }
.ab-reasons { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.ab-reasons li::before { content: '▸ '; color: var(--acc); }
.antiban-stats { margin-top: 0; }
.ab-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; }
.ab-card h3 { margin: 0 0 10px; font-size: 11px; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.ab-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; border-bottom: 1px solid var(--line); padding: 7px 0; }
.ab-row:last-child { border-bottom: none; }
.ab-row span:first-child { color: var(--muted); }
.meter { height: 7px; border-radius: var(--r-pill); background: #e9edf4; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--acc-2); transition: width 0.5s var(--ease); }
.meter.warn i { background: var(--amber); }
.meter.danger i { background: var(--red); }
.rawjson { max-height: 340px; overflow: auto; background: #0b1220; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 12px; font-size: 11px; white-space: pre-wrap; color: #93c5fd; }
.ab-controls { margin-top: 12px; width: 100%; }

/* ======================== DIAG / BRIEF ========================== */
.diag { margin: 14px 0; padding: 15px 17px; border-radius: var(--r-sm); background: var(--panel-3); border: 1px solid var(--line); }
.diag-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 10px; font-family: var(--display); }
.diag-score { font-weight: 700; }
.diag-bar { height: 7px; border-radius: var(--r-pill); background: #e9edf4; overflow: hidden; margin-bottom: 11px; }
.diag-bar i { display: block; height: 100%; transition: width 0.5s var(--ease); }
.diag ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.diag li::before { content: '▸ '; color: var(--acc); }
.brief { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.brief > summary { cursor: pointer; padding: 11px 14px; font-family: var(--display); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.brief[open] > summary { border-bottom: 1px solid var(--line); color: var(--ink); }
.brief pre, .brief p, .brief textarea { margin: 12px 14px; width: calc(100% - 28px); }
.brief .row { margin: 8px 14px; }
.brief #playbookLearnings { margin: 0 14px 14px; }

/* ==================== FLUXO DETALHADO / EDGES =================== */
.flowfull { display: flex; flex-direction: column; gap: 10px; }
.ff-node { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; background: var(--panel-3); }
.ff-node .ff-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-xs); background: var(--acc-soft); border: 1px solid #d7e2fb; color: var(--acc); }
.ff-node .ff-body { flex: 1; min-width: 0; }
.ff-node h4 { margin: 0; font-size: 14.5px; font-family: var(--display); }
.ff-node .ff-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.ff-node .ff-val { font-size: 24px; font-weight: 700; color: var(--green); min-width: 40px; text-align: right; }
.ff-node .ff-hint { font-size: 10px; color: var(--muted-2); margin-top: 4px; }
.ff-conn { text-align: center; color: var(--muted-2); padding: 3px 0; font-size: 12px; }
.edges { display: flex; flex-direction: column; gap: 8px; }
.edge { display: flex; align-items: center; gap: 8px; font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.edge .e-arrow { color: var(--muted-2); }
.edge .e-cond { color: var(--acc); font-size: 10.5px; margin-left: auto; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; color: var(--muted); }
.legend .dot { display: inline-block; margin-right: 6px; }

/* ============================= MODAL ============================ */
.modal { position: fixed; inset: 0; z-index: 60; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(3px); animation: fade 0.2s var(--ease); }
.modal-card {
  position: absolute; top: 0; right: 0; height: 100%; width: min(700px, 97vw);
  background: #fff;
  border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  overflow-y: auto; padding: 28px; animation: slidein 0.28s var(--ease);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.modal-x { position: absolute; top: 18px; right: 20px; width: 36px; height: 36px; border-radius: 50%; background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); cursor: pointer; font-size: 15px; transition: 0.15s var(--ease); }
.modal-x:hover { background: var(--red-soft); color: var(--red); border-color: #f4c2bd; }
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 16px 0; }
.contact-grid div { background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 10px 12px; }
.contact-grid dt { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-family: var(--body); font-weight: 600; }
.contact-grid dd { margin: 3px 0 0; font-size: 13px; word-break: break-word; }

.timeline { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 16px 30px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px #fff; }
.timeline li[data-type='message_in']::before { background: var(--pink); }
.timeline li[data-type='status']::before { background: var(--amber); }
.timeline li[data-type='enriched']::before { background: var(--green); }
.timeline li[data-type='note']::before { background: var(--muted); }
.timeline .t-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; font-family: var(--display); }
.timeline .t-when { color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }
.timeline .t-body { color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: pre-wrap; }
.thread { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; }
.bubble.out { align-self: flex-end; background: var(--acc); color: #fff; border: 1px solid var(--acc); }
.bubble.in { align-self: flex-start; background: var(--panel-3); border: 1px solid var(--line); }
.note-form { display: flex; gap: 8px; margin-top: 8px; }
.note-form input { flex: 1; }

/* contatos & redes (ficha 360) */
.contacts { display: flex; flex-direction: column; gap: 12px; }
.cg { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--panel-3); }
.cg-title { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.cg-items { display: flex; flex-wrap: wrap; gap: 7px; }
.cc { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 11px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); text-decoration: none; transition: 0.15s var(--ease); max-width: 100%; }
.cc:hover { border-color: var(--acc); color: var(--acc); }
.cc .ic { color: currentColor; }
.cc.wa { background: var(--green-soft); border-color: #bfe6d2; color: var(--green); }
.cc.wa:hover { border-color: var(--green); }
.cc a { color: inherit; text-decoration: none; }
.cc.primary { background: var(--green-soft); border-color: var(--green); }
.cc .pstar { font-size: 10px; font-weight: 700; color: var(--green); }

/* números de envio (prospecção) */
.senders-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sender-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-3); }

/* preferencias de notificacao */
.nevents { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.nevent { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); font-family: var(--body); text-transform: none; letter-spacing: 0; cursor: pointer; }
.nevent input { width: auto !important; accent-color: var(--acc); }
.sw-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-family: var(--body); text-transform: none; letter-spacing: 0; }
.sw-lbl input { width: 96px; }

/* dossier IA (ficha) */
.dossier { font-size: 13px; white-space: pre-wrap; line-height: 1.55; color: var(--ink-2); background: var(--acc-soft); border: 1px solid #d7e2fb; border-radius: var(--r-sm); padding: 12px 14px; }

/* ============================ INBOX (atendimento) =============== */
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 250px); min-height: 480px; }
.inbox-list { border: 1px solid var(--line); border-radius: var(--r); overflow-y: auto; background: var(--panel); }
.inbox-empty { padding: 20px; }
.conv { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: none; background: transparent; color: var(--ink); padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: 0.14s var(--ease); }
.conv:hover { background: var(--panel-3); }
.conv.active { background: var(--acc-soft); box-shadow: inset 3px 0 0 var(--acc); }
.conv-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: #fff; font-weight: 700; font-family: var(--display); font-size: 14px; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.conv-top b { font-family: var(--display); }
.conv-top small { color: var(--muted-2); font-size: 10.5px; font-family: var(--mono); }
.conv-last { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badge { flex: none; background: var(--green); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 2px 7px; }
.inbox-chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-3); }
.chat-title { display: flex; flex-direction: column; }
.chat-title small { color: var(--muted-2); font-size: 11px; font-family: var(--mono); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-empty { margin: auto; }
.chat-body .bubble { max-width: 72%; }
.b-time { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 4px; text-align: right; font-family: var(--mono); }
.bubble.sending { opacity: 0.6; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel-3); }
.chat-input input { flex: 1; }

/* ============================ TOASTS ============================ */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 92vw; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff;
  border: 1px solid var(--line-2); border-left: 3px solid var(--acc);
  padding: 13px 16px; border-radius: var(--r-sm); font-size: 13px; min-width: 240px;
  box-shadow: var(--shadow-3); animation: slide 0.28s var(--ease);
}
.toast .t-ico { flex: none; }
.toast.err { border-left-color: var(--red); }
.toast.xp { border-left-color: var(--acc); }
@keyframes slide { from { opacity: 0; transform: translateX(28px); } }
@keyframes savedflash {
  0%, 20% { border-color: var(--green); background: var(--green-soft); }
  100% { box-shadow: none; }
}

/* =========================== RESPONSIVO ========================= */
@media (max-width: 980px) {
  .hud { gap: 14px; }
  .player-info { min-width: 160px; }
}
@media (max-width: 820px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox-list { max-height: 320px; }
  .inbox-chat { min-height: 420px; }
  .lead { flex-direction: column; }
  .lead .actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hud { padding: 12px 16px; }
  .brand h1 { font-size: 17px; }
  .player-info { min-width: 0; flex: 1; }
  .toolbar { gap: 8px; }
  .form-inline { flex-direction: column; align-items: stretch; }
  .stat b { font-size: 24px; }
}

/* acessibilidade: respeita quem pede menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}


/* ---------- Atendimento: barra de ferramentas, scroll e separadores ---------- */
.inbox-list { display: flex; flex-direction: column; overflow: hidden; }
.inbox-tools { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--panel-3); }
.inbox-tools .inbox-search { flex: 1; }
.btn.icon { padding: 8px 10px; line-height: 1; }
.inbox-scroll { flex: 1; overflow-y: auto; }
.day-sep { align-self: center; font-size: 10.5px; color: var(--muted-2); background: var(--panel-3); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; margin: 8px 0; font-family: var(--mono); }
.b-tick { margin-left: 4px; color: #bfe6d2; }
.b-tick.err { color: #f4c2bd; }

/* ---------- Atendimento: toolbar de resposta + popover de templates ---------- */
.chat-input .btn.icon { flex: none; }
.reply-pop { border-top: 1px solid var(--line); background: var(--panel); max-height: 280px; overflow-y: auto; }
.reply-pop[hidden] { display: none; }
.reply-pop .rp-head { padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted-2); font-family: var(--mono); border-bottom: 1px solid var(--line); }
.reply-pop .rp-item { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.reply-pop .rp-item:hover { background: var(--acc-soft); }
.reply-pop .rp-pick { flex: 1; min-width: 0; text-align: left; border: none; background: transparent; color: var(--ink); padding: 10px 12px; cursor: pointer; }
.reply-pop .rp-item b { font-family: var(--display); font-size: 13px; }
.reply-pop .rp-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.reply-pop .rp-send { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; border: none; border-left: 1px solid var(--line); background: transparent; color: var(--acc); cursor: pointer; }
.reply-pop .rp-send:hover { background: var(--acc); color: #fff; }
.reply-pop .rp-badge { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 1px 8px; margin-left: 6px; }
.reply-pop .rp-badge.auto { background: var(--acc-soft); color: var(--acc); }
.reply-pop .rp-badge.fixed { background: var(--panel-3); color: var(--muted); }
#inboxAutoReply.on { background: var(--green); color: #fff; border-color: var(--green); }

/* ============================== Painel (dashboard) ============================== */
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.dash-kpis .kpi { display: flex; align-items: center; gap: 14px; padding: 16px; }
.kpi-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); }
.kpi-ico svg { width: 22px; height: 22px; }
.kpi b { font-family: var(--display); font-size: 26px; line-height: 1; }
.kpi small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi-sub { display: block; color: var(--muted-2); font-size: 11px; margin-top: 3px; }
.dash-hint { color: var(--muted-2); font-size: 11.5px; font-family: var(--mono); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.funnel { display: flex; flex-direction: column; gap: 11px; }
.fn-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; }
.fn-label { font-size: 12.5px; color: var(--muted); }
.fn-track { height: 16px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.fn-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); border-radius: 99px; transition: width 0.5s var(--ease); }
.fn-val { text-align: right; font-family: var(--mono); font-size: 13px; }

.rates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rate { background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-align: center; }
.rate b { font-family: var(--display); font-size: 24px; display: block; color: var(--acc); }
.rate small { color: var(--muted); font-size: 11.5px; }

.week { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.wk-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.wk-bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.wk-bars i { width: 10px; min-height: 2px; border-radius: 3px 3px 0 0; }
.wk-bars .s { background: var(--acc); }
.wk-bars .r { background: var(--green); }
.wk-day { font-size: 10px; color: var(--muted-2); font-family: var(--mono); }
.wk-num { font-size: 10.5px; color: var(--muted); }

.ops { display: flex; flex-direction: column; gap: 2px; }
.op { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.op:last-child { border-bottom: none; }
.op b { font-family: var(--display); font-size: 15px; }
.op small { display: block; color: var(--muted); font-size: 11.5px; }

.toplist { display: flex; flex-direction: column; }
.top-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: none; background: transparent; border-bottom: 1px solid var(--line); padding: 10px 4px; cursor: pointer; color: var(--ink); }
.top-item:hover { background: var(--panel-3); }
.ti-score { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; }
.ti-score.hi { background: var(--green-soft); color: var(--green); }
.ti-score.mid { background: var(--acc-soft); color: var(--acc); }
.ti-score.lo { background: var(--panel-3); color: var(--muted); }
.ti-main { flex: 1; min-width: 0; }
.ti-main b { font-family: var(--display); font-size: 13.5px; }
.ti-main small { display: block; color: var(--muted); font-size: 11.5px; }
.ti-go { color: var(--acc); }

@media (max-width: 900px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Templates de resposta: blocos + anexos ---------- */
.small { font-size: 12px; }
#replyBlocksHint { margin: 4px 0 2px; }
#replyBlocksHint.multi { color: var(--acc); font-weight: 600; }
.att-block { margin: 10px 0 4px; padding: 11px 13px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: var(--panel-3); }
.att-head { font-family: var(--display); font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.att-head .small { font-weight: 400; color: var(--muted); }
.att-uploads { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.att-list { display: flex; flex-wrap: wrap; gap: 7px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 4px 6px 4px 10px; font-size: 12px; max-width: 100%; }
.att-chip .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.att-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.att-del:hover { color: #c0392b; background: #fff; }

/* ---------- Painel: cockpit de prospecção ---------- */
.cockpit-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cockpit-title { font-family: var(--display); font-size: 20px; letter-spacing: .06em; margin: 0; }
.game-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 14px; font-size: 12.5px; }
.game-strip .gs-lvl b { font-family: var(--display); }
.game-strip .gs-xp { display: flex; align-items: center; gap: 7px; }
.gs-bar { display: inline-block; width: 90px; height: 7px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.gs-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); }
.game-strip .badges { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.game-strip .badge { font-size: 11px; }

.dash-hero { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-sub.up { color: var(--green); }
.kpi-sub.down { color: #c0392b; }

.actions-card #dashActions { display: flex; flex-direction: column; gap: 10px; }
.act { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-3); }
.act.primary { border-color: var(--acc); background: var(--acc-soft); }
.act-ico { font-size: 22px; }
.act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-main > b { font-size: 10px; letter-spacing: .08em; color: var(--acc); }
.act-big { font-family: var(--display); font-size: 15px; font-weight: 600; }
.act-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fn-row { grid-template-columns: 96px 1fr 46px 52px; }
.fn-rate { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--acc); }

.bottleneck { text-align: center; padding: 6px 0 12px; }
.bn-flow { font-size: 13px; color: var(--muted); }
.bn-num { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.bn-gap { font-size: 12px; font-family: var(--mono); margin-bottom: 10px; }
.bn-gap.bad { color: #c0392b; }
.bn-gap.ok { color: var(--green); }
.sep { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; text-align: center; }
.stat b { font-family: var(--display); font-size: 20px; display: block; }
.stat small { color: var(--muted); font-size: 11px; }
.goal { margin-bottom: 12px; }
.goal-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.goal .track { height: 12px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.goal .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); }
.goal-foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.prod-week > b { font-family: var(--display); font-size: 12.5px; }

.proj-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.proj ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.proj li { background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; font-size: 12.5px; }

.perf-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.perf-card { background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.perf-card small { color: var(--muted); font-size: 11px; }
.perf-card b { font-family: var(--display); font-size: 15px; }
.perf-card span { font-size: 11.5px; color: var(--muted-2); }
.perf-hours { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.perf-hours .hr { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.perf-hours .hr i { width: 100%; max-width: 26px; min-height: 2px; background: linear-gradient(180deg, var(--acc), var(--acc-2)); border-radius: 3px 3px 0 0; }
.perf-hours .hr span { font-size: 9.5px; color: var(--muted-2); font-family: var(--mono); }

.top-item { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 4px; background: transparent; cursor: default; }
.ti-reason { display: block; font-size: 11px; color: var(--muted-2); }
.top-item .btn { flex: none; }

@media (max-width: 1100px) { .dash-hero { grid-template-columns: repeat(3, 1fr); } .perf-cards { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .dash-hero { grid-template-columns: repeat(2, 1fr); } .stat-row { grid-template-columns: repeat(2, 1fr); } .proj ul { grid-template-columns: 1fr; } .act { flex-wrap: wrap; } }

