/* ============================================================
   Radar FBPNEU v3.0 — Estilos globais
   ============================================================ */

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

:root {
  --roxo:      #534AB7;
  --roxo-bg:   #EEEDFE;
  --verde:     #1D9E75;
  --verde-bg:  #E1F5EE;
  --ambar:     #BA7517;
  --ambar-bg:  #FAEEDA;
  --vermelho:  #A32D2D;
  --verm-bg:   #FCEBEB;
  --cinza-txt: #666;
  --cinza-brd: #e5e5e5;
  --cinza-bg:  #f7f7f9;
  --txt:       #222;
  --sidebar-w: 188px;
  --radius:    10px;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--txt);
  background: #fff;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ── LAYOUT PRINCIPAL ────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #1e1b3a;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

#sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

#sidebar-brand .brand-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
}

#sidebar-brand .brand-sub {
  color: rgba(255,255,255,.45);
  font-size: 11px;
  margin-top: 2px;
}

#sidebar nav {
  flex: 1;
  padding: 10px 0;
}

#sidebar nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14.5px;
  border-radius: 0;
  transition: background .15s, color .15s;
  cursor: pointer;
  user-select: none;
}

#sidebar nav a:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

#sidebar nav a.active {
  background: var(--roxo-bg);
  color: var(--roxo);
  font-weight: 600;
}

/* ── SVG ICONS ───────────────────────────────────────────── */
.ic {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  flex-shrink: 0;
}

#sidebar nav a .ic {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  opacity: .85;
}

#sidebar nav a:hover .ic,
#sidebar nav a.active .ic {
  opacity: 1;
}

.btn .ic,
button .ic {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ghost action buttons (Editar/Excluir) */
.btn-ghost-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--cinza-brd);
  border-radius: 6px;
  background: transparent;
  color: var(--cinza-txt);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  font-family: inherit;
}

.btn-ghost-edit:hover {
  background: var(--cinza-bg);
  color: var(--txt);
  border-color: #ccc;
}

.btn-ghost-del {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid #f2c1c1;
  border-radius: 6px;
  background: var(--verm-bg);
  color: var(--vermelho);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s, color .12s;
  font-family: inherit;
}

.btn-ghost-del:hover {
  background: var(--vermelho);
  color: #fff;
}

/* star / ban inline icon buttons */
.star-btn .ic {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 0;
}

#sidebar nav a .icon { font-style: normal; width: 18px; text-align: center; display: none; }

#sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: rgba(255,255,255,.4);
}

/* badge contador */
.badge-count {
  margin-left: auto;
  background: var(--roxo);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

/* ── CONTEÚDO PRINCIPAL ──────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background: var(--cinza-bg);
}

.page-header {
  background: #fff;
  border-bottom: 1px solid var(--cinza-brd);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
}

.page-header .header-sub {
  font-size: 14px;
  color: var(--cinza-txt);
}

.page-header .tab-status {
  margin-left: auto;
  font-size: 13px;
  color: var(--cinza-txt);
  white-space: nowrap;
}

.page-body {
  flex: 1;
  padding: 24px 28px;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  padding: 20px;
}

.card-sm { padding: 14px 18px; }

.cards-row {
  display: grid;
  gap: 16px;
}

/* Grades fluidas: o nº de colunas se adapta à largura disponível,
   sem estourar a tela (nada de rolagem horizontal). */
.cards-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.funil-hoje { margin: 6px 0 2px; display: flex; flex-direction: column; gap: 2px; }
.funil-linha { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; line-height: 1.4; }
.funil-linha b { color: #222; font-variant-numeric: tabular-nums; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.metric-label {
  font-size: 12.5px;
  color: var(--cinza-txt);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1;
}

.metric-sub {
  font-size: 13px;
  color: var(--cinza-txt);
  margin-top: 6px;
}

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-roxo   { background: var(--roxo-bg);  color: var(--roxo); }
.badge-verde  { background: var(--verde-bg);  color: var(--verde); }
.badge-ambar  { background: var(--ambar-bg);  color: var(--ambar); }
.badge-verm   { background: var(--verm-bg);   color: var(--vermelho); }
.badge-cinza  { background: #f0f0f0;           color: var(--cinza-txt); }
.badge-azul   { background: #E6F1FB;           color: #185FA5; }

/* Bloco de provas na ficha do lead — o que fecha o briefing */
.ficha-provas { background: var(--roxo-bg); border: 1px solid #d9d6f5; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.provas-title { font-weight: 500; color: var(--roxo); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.prova-item   { display: grid; grid-template-columns: minmax(150px, 280px) 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid #e4e1f7; font-size: 14px; }
.prova-item:first-of-type { border-top: none; }
.prova-lbl    { color: var(--cinza-txt); font-weight: 500; }
.ficha-briefing-wrap summary { cursor: pointer; color: var(--roxo); font-size: 13px; margin-top: 6px; }
.ficha-value.opcional, .opcional { color: #bbb; }

/* origem badges */
.badge-lista   { background: #EEF2FF; color: #4338ca; }
.badge-ativa   { background: var(--verde-bg); color: var(--verde); }

/* fila badges */
.badge-q100    { background: var(--verde-bg); color: var(--verde); }
.badge-inc     { background: var(--ambar-bg); color: var(--ambar); }
.badge-nao     { background: var(--verm-bg);  color: var(--vermelho); }

/* ── TABELAS ─────────────────────────────────────────────── */
/* Sem rolagem horizontal: a tabela ocupa 100% e o conteúdo QUEBRA
   linha (cabeçalhos e células), em vez de empurrar para o lado. */
.table-wrap {
  overflow-x: auto; /* só entra em ação em telas muito estreitas */
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table thead th {
  background: var(--cinza-bg);
  padding: 10px 12px;
  text-align: left;
  font-size: 12.5px;
  color: var(--cinza-txt);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--cinza-brd);
  white-space: normal;
}

table tbody tr {
  border-bottom: 1px solid var(--cinza-brd);
  transition: background .12s;
}

table tbody tr:last-child { border-bottom: none; }
table tbody tr:hover { background: #fafafa; }

table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  /* break-word (e NÃO "anywhere"): "anywhere" deixa a coluna encolher
     até 1 letra de largura e o nome empilha em pé. break-word quebra
     só quando a palavra não cabe, sem colapsar a coluna. */
  overflow-wrap: break-word;
}

/* ── BOTÕES ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .08s;
  text-decoration: none;
}

.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }

.btn-primary   { background: var(--roxo); color: #fff; }
.btn-green     { background: var(--verde); color: #fff; }
.btn-red       { background: var(--vermelho); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--cinza-brd); color: var(--txt); }
.btn-ghost     { background: transparent; color: var(--cinza-txt); }
.btn-sm        { padding: 5px 11px; font-size: 13px; }
.btn-xs        { padding: 3px 8px; font-size: 12.5px; }

/* veredito buttons */
.btn-sim  { background: var(--verde-bg); color: var(--verde); border: 1px solid #b2dfce; }
.btn-nao  { background: var(--verm-bg);  color: var(--vermelho); border: 1px solid #f2c1c1; }
.btn-sim:hover { background: var(--verde); color: #fff; }
.btn-nao:hover { background: var(--vermelho); color: #fff; }

/* ── FORM ELEMENTS ───────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  color: var(--txt);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px rgba(83,74,183,.12);
}

input[type="range"] {
  accent-color: var(--roxo);
  cursor: pointer;
}

label { font-size: 13.5px; color: var(--cinza-txt); display: block; margin-bottom: 4px; }

.form-group { margin-bottom: 16px; }

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

/* ── BARRA DE PROGRESSO ──────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--roxo);
  transition: width .4s ease;
}

.progress-fill.green { background: var(--verde); }
.progress-fill.ambar { background: var(--ambar); }
.progress-fill.red   { background: var(--vermelho); }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.modal h2 { font-size: 17px; margin-bottom: 20px; }

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--cinza-txt);
  line-height: 1;
}

/* ── TOAST ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.toast {
  background: #1e1b3a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  animation: slideIn .2s ease;
  max-width: 360px;
}

.toast.green { background: var(--verde); }
.toast.red   { background: var(--vermelho); }
.toast.amber { background: var(--ambar); }

/* ── Aviso honesto do MOTOR (tela Listas) ─────────────────── */
.btn-danger { background: var(--vermelho); color: #fff; }
.motor-banner {
  border-radius: var(--radius, 8px);
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.motor-banner b { font-weight: 600; }
.motor-ok     { background: var(--verde-bg); color: var(--verde);    border-color: #bfe9d8; }
.motor-parado { background: var(--verm-bg);  color: var(--vermelho); border-color: #eccaca; }
.motor-neutro { background: #f4f4f6;         color: var(--cinza-txt); border-color: #e2e2e6; }
.motor-ctrls {
  display: flex; align-items: center; gap: 12px;
  margin: 0 2px 16px; flex-wrap: wrap;
}
.ciclo-tag {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--roxo);
  background: var(--roxo-bg);
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-block;
  white-space: nowrap;
}

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── FICHA EXPANDIDA (lead) ──────────────────────────────── */
.ficha-row {
  background: var(--cinza-bg);
  border-bottom: 2px solid var(--cinza-brd);
}

.ficha-inner {
  padding: 18px 20px;
}

.ficha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ficha-field { }

.ficha-label {
  font-size: 11.5px;
  color: var(--cinza-txt);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}

.ficha-value {
  font-size: 14.5px;
  color: var(--txt);
  word-break: break-word;
}

.ficha-value.opcional { color: var(--cinza-txt); font-style: italic; }

.ficha-briefing {
  font-family: "Cascadia Code", "Consolas", "Monaco", monospace;
  font-size: 13.5px;
  background: #1e1b3a;
  color: #c8d3f5;
  border-radius: 7px;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  margin-top: 12px;
}

/* estrelas inline */
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 0 3px;
  opacity: .55;
  transition: opacity .15s, color .15s;
  vertical-align: middle;
}

.star-btn:hover { opacity: 1; }
.star-btn.ativo { opacity: 1; color: var(--ambar); }
.star-btn.excl  { opacity: 1; color: var(--vermelho); }

/* ── CHAT ────────────────────────────────────────────────── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px - 48px - 90px);
  min-height: 300px;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--cinza-bg);
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--roxo);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.system {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--cinza-brd);
  color: var(--txt);
  border-bottom-left-radius: 4px;
}

.bubble-meta {
  font-size: 11px;
  opacity: .65;
  margin-top: 4px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 120px;
}

/* ── STATUS CHIPS ────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip-ok   { background: var(--verde-bg); color: var(--verde); border-color: #b2dfce; }
.chip-warn { background: var(--ambar-bg); color: var(--ambar); border-color: #f5d59a; }
.chip-err  { background: var(--verm-bg);  color: var(--vermelho); border-color: #f2c1c1; }
.chip-idle { background: #f0f0f0;          color: var(--cinza-txt); }

/* ── FILTROS ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 140px;
}

/* ── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--cinza-brd);
  margin-bottom: 20px;
}

.tab {
  padding: 9px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--cinza-txt);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--txt); }
.tab.active { color: var(--roxo); border-bottom-color: var(--roxo); }

/* ── KNOWLEDGE CARDS ─────────────────────────────────────── */
.roda-card {
  background: #fff;
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.roda-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  flex-shrink: 0;
}

.roda-thumb-placeholder {
  width: 72px;
  height: 72px;
  background: #eee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

/* ── SLIDER GROUP ────────────────────────────────────────── */
.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-group input[type="range"] {
  flex: 1;
  width: auto;
}

.slider-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--roxo);
  min-width: 36px;
  text-align: center;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--cinza-txt);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── SECTION TITLE ───────────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cinza-txt);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
  margin-top: 24px;
}

.section-title:first-child { margin-top: 0; }

/* ── TOGGLE SWITCH ───────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--cinza-brd);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
  font-size: 13.5px;
  color: var(--txt);
}

.toggle-btn {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  transition: all .15s;
}

.toggle-btn.ativa  { background: var(--verde-bg); color: var(--verde); border-color: #b2dfce; }
.toggle-btn.pausada{ background: var(--ambar-bg); color: var(--ambar); border-color: #f5d59a; }

/* ── SELETOR DE FOCO DE SEGMENTO (Prospecção Ativa) ──────── */
.seg-chip {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #ddd;
  background: #f6f6f6;
  color: var(--cinza-txt, #777);
  transition: all .15s;
}
.seg-chip:hover { border-color: #c4c4c4; }
.seg-chip.on {
  background: var(--verde-bg);
  color: var(--verde);
  border-color: #b2dfce;
}

/* ── FAVORITOS/EXCLUSOES CHIPS ───────────────────────────── */
.fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12.5px;
  background: var(--ambar-bg);
  color: var(--ambar);
  border: 1px solid #f5d59a;
  margin: 3px;
}

.excl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12.5px;
  background: var(--verm-bg);
  color: var(--vermelho);
  border: 1px solid #f2c1c1;
  margin: 3px;
}

.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  margin: 0;
  color: inherit;
  opacity: .6;
}

.chip-remove:hover { opacity: 1; }

/* ── COTA BAR ────────────────────────────────────────────── */
.cota-bar-wrap {
  position: relative;
  margin: 10px 0;
}

.cota-bar-track {
  height: 16px;
  background: #eee;
  border-radius: 100px;
  overflow: visible;
  position: relative;
}

.cota-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--verde);
  transition: width .5s ease;
  position: relative;
}

.cota-gatilho-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 24px;
  background: var(--ambar);
  border-radius: 2px;
  transform: translateX(-50%);
}

.cota-gatilho-label {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--ambar);
  font-weight: 700;
  white-space: nowrap;
}

/* ── FREIO STAGES ────────────────────────────────────────── */
.stage-card {
  background: #fff;
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 4px solid;
}

.stage-card.cruzeiro { border-left-color: var(--verde); }
.stage-card.backoff  { border-left-color: var(--ambar); }
.stage-card.pause    { border-left-color: var(--vermelho); }

.stage-card h4 { font-size: 14px; margin-bottom: 6px; }
.stage-card p  { font-size: 13px; color: var(--cinza-txt); line-height: 1.5; }

/* ── SCROLL ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-outer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinza-bg);
}

.login-card {
  width: 380px;
  background: #fff;
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--roxo);
  letter-spacing: -.3px;
}

.login-logo .logo-sub {
  font-size: 13px;
  color: var(--cinza-txt);
  margin-top: 4px;
}

.login-error {
  background: var(--verm-bg);
  color: var(--vermelho);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ── MISC UTILS ──────────────────────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-sm { font-size: 13.5px; }
.text-gray { color: var(--cinza-txt); }
.bold { font-weight: 700; }
.wrap { flex-wrap: wrap; }

/* loading spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid #ddd;
  border-top-color: var(--roxo);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* CNAE chip */
.cnae-chip {
  display: inline-block;
  padding: 4px 10px;
  background: #f0f0f0;
  border-radius: 100px;
  font-size: 12px;
  margin: 3px;
  color: var(--txt);
}

.cnae-chip .star-btn { font-size: 13px; }

/* motor card */
.motor-card {
  background: #fff;
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  padding: 16px;
}

.motor-card h4 { font-size: 14px; margin-bottom: 6px; }
.motor-card .motor-foco { font-size: 12.5px; color: var(--cinza-txt); font-style: italic; }

/* ── Quadro de 3 colunas da Prospecção Ativa ───────────────────────────── */
.prosp-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) { .prosp-board { grid-template-columns: 1fr; } }
.prosp-col {
  background: var(--cinza-bg, #f6f7f9);
  border: 1px solid var(--cinza-brd);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 80px;
}
.prosp-col-head {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.prosp-col-body { display: flex; flex-direction: column; gap: 8px; }
.prosp-empty { font-size: 12.5px; color: var(--cinza-txt); font-style: italic; padding: 8px 4px; }
.prosp-card {
  background: #fff;
  border: 1px solid var(--cinza-brd);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow .12s, border-color .12s;
}
.prosp-card:hover { border-color: var(--roxo); box-shadow: 0 1px 6px rgba(83,74,183,.12); }
.prosp-card-nome { font-weight: 600; font-size: 14px; }
.prosp-card-meta { margin: 6px 0 4px; display: flex; gap: 5px; flex-wrap: wrap; }
.prosp-card-sub { font-size: 12.5px; color: var(--cinza-txt); }
.prosp-ficha { margin-top: 10px; cursor: default; }

/* ── SEM ROLAGEM HORIZONTAL (overrides p/ estilos injetados) ─ */
/* Fluxo do Dash Radar FB: quebra linha em vez de rolar de lado */
#main .drf-flow { flex-wrap: wrap; row-gap: 10px; }
/* Tabela Origens/Missões da aba Operação: deixa o texto quebrar */
#main .oper-origens th, #main .oper-origens td { white-space: normal; overflow-wrap: anywhere; }

/* ── RESPONSIVO ──────────────────────────────────────────── */
@media (max-width: 1280px) {
  .page-header { padding: 12px 18px; flex-wrap: wrap; row-gap: 6px; }
  .page-header .tab-status { white-space: normal; }
  .page-body { padding: 16px 18px; }
}

@media (max-width: 980px) {
  /* Sidebar compacta (só ícones) para sobrar espaço de leitura */
  :root { --sidebar-w: 60px; }
  #sidebar-brand { padding: 12px 6px; }
  #sidebar-brand .brand-title { font-size: 10px; text-align: center; letter-spacing: 0; }
  #sidebar-brand .brand-sub { display: none; }
  #sidebar nav a { position: relative; justify-content: center; padding: 12px 0; gap: 0; font-size: 0; }
  #sidebar nav a .badge-count { position: absolute; top: 4px; right: 5px; margin-left: 0; font-size: 9.5px; padding: 0 4px; min-width: 15px; }
  #sidebar-footer { padding: 10px 4px; font-size: 10px; text-align: center; }

  .form-row { grid-template-columns: 1fr; }
  .prova-item { grid-template-columns: 1fr; gap: 2px; }
  .chat-bubble { max-width: 90%; }
  .flex-between { flex-wrap: wrap; }
}

/* ── SEM BARRA HORIZONTAL — SEMPRE, em qualquer largura/zoom ──────────────
   Pedido Alexandre 02/07: barra de rolagem horizontal atrapalha — a tela tem
   que ACOMPANHAR o zoom, como o Painel/Dash (cartões) fazem. Sem gatilho de
   largura (zoom de 1920 a 150% dá 1280px e escapava do media query): célula
   SEMPRE pode quebrar linha (anula os nowrap inline) e espremer (anywhere
   zera a largura mínima da coluna — break-word NÃO faz isso). Em tela larga
   nada muda visualmente: só quebra quem não coube. Botão nunca parte. */
.table-wrap table { width: 100%; }
.table-wrap th, .table-wrap td { white-space: normal !important; overflow-wrap: anywhere; }
.table-wrap .btn { white-space: nowrap; }
.table-wrap .badge, .table-wrap .chip { white-space: normal; }

/* ── ajuste fino p/ zoom/janela estreita (≤1200px efetivos) ──────────────── */
@media (max-width: 1200px) {
  .table-wrap th { font-size: 11px; letter-spacing: 0; padding: 8px 6px; }
  .page-body { overflow-wrap: anywhere; }
}

/* ── ZOOM FORTE / CELULAR (≤900px efetivos) ──────────────────────────────── */
@media (max-width: 900px) {
  .page-header { padding: 10px 12px; }
  .page-header h1 { font-size: 18px; }
  .page-body { padding: 12px 10px; }
  table thead th, table tbody td { padding: 8px 8px; font-size: 13px; }
  .modal { padding: 16px 14px; width: 95vw; }
  .cards-5, .cards-4, .cards-3, .cards-2 { gap: 8px; }

  /* Aprovar/Revisar: 8 colunas não cabem — no celular ficam SÓ Empresa+motivo,
     Contato e os botões de decisão (✓ ✗ ★ ⚑). Data/Setor/Roda/Origem/Fila
     aparecem na ficha (toque na linha). Sem nowrap: era ele que empurrava a
     coluna Ação pra fora da tela (botão cortado = tela "quebrada").
     Obs: a linha da ficha tem 1 só td (colspan) — nth-child não a afeta. */
  .tbl-revisar th:nth-child(2), .tbl-revisar td:nth-child(2),
  .tbl-revisar th:nth-child(3), .tbl-revisar td:nth-child(3),
  .tbl-revisar th:nth-child(4), .tbl-revisar td:nth-child(4),
  .tbl-revisar th:nth-child(5), .tbl-revisar td:nth-child(5),
  .tbl-revisar th:nth-child(7), .tbl-revisar td:nth-child(7) { display: none; }
  .tbl-revisar td, .tbl-revisar th { white-space: normal !important; }
  .tbl-revisar td:first-child { overflow-wrap: anywhere; }
  .tbl-revisar td:last-child { width: 96px; }

  /* botões de ação com dedo: alvo de toque maior */
  .tbl-revisar .btn-xs { padding: 7px 11px; font-size: 15px; }

  /* Tabela das FILAS (Sem site / Em processo / Pré / Qualificados): 11 colunas.
     No celular ficam Empresa, Contato, Veredito e Ação — Data/Setor/Roda/
     Origem/Decisor/Fila/Revisado moram na ficha (toque na linha abre). */
  .tbl-fila th:nth-child(2),  .tbl-fila td:nth-child(2),
  .tbl-fila th:nth-child(3),  .tbl-fila td:nth-child(3),
  .tbl-fila th:nth-child(4),  .tbl-fila td:nth-child(4),
  .tbl-fila th:nth-child(5),  .tbl-fila td:nth-child(5),
  .tbl-fila th:nth-child(7),  .tbl-fila td:nth-child(7),
  .tbl-fila th:nth-child(8),  .tbl-fila td:nth-child(8),
  .tbl-fila th:nth-child(10), .tbl-fila td:nth-child(10) { display: none; }
  .tbl-fila td, .tbl-fila th { white-space: normal !important; }
  .tbl-fila td:first-child { overflow-wrap: anywhere; }
  .tbl-fila .btn-xs { padding: 7px 11px; font-size: 14px; }

  /* rede de segurança geral: conteúdo longo sem quebra não estoura a página */
  .ficha-inner, .ficha-value, .prova-item { overflow-wrap: anywhere; }
}
