/* ═══════════════════════════════════════════════════════════════════════
   RAVVO — V19 CRM de Leads: funil, retornos, relatório     2026-09-10
   ═══════════════════════════════════════════════════════════════════════ */

/* ── abas ── */
.crm-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:-4px 0 18px; }
.crm-tab {
  background:none; border:1px solid var(--border,#2a2c33); color:var(--text-muted,#8b8f9a);
  font-family:var(--font-body,inherit); font-size:.86rem; font-weight:600;
  padding:8px 16px; border-radius:999px; cursor:pointer; transition:all .15s;
}
.crm-tab:hover { color:var(--text-primary,#fff); border-color:var(--text-muted,#8b8f9a); }
.crm-tab.on { background:var(--accent,#ff6b00); border-color:var(--accent,#ff6b00); color:#fff; }
.crm-tab:focus-visible { outline:2px solid var(--accent,#ff6b00); outline-offset:2px; }
.crm-tab-alt { margin-left:auto; }

/* ── kanban ── */
.crm-board {
  display:grid; grid-template-columns:repeat(4,minmax(190px,1fr)); gap:12px;
  overflow-x:auto; padding-bottom:6px; align-items:start;
}
.crm-col { background:var(--bg-input,#101115); border:1px solid var(--border,#2a2c33);
  border-radius:var(--radius-md,12px); overflow:hidden; }
.crm-col-head {
  display:flex; justify-content:space-between; align-items:center;
  padding:11px 13px; border-bottom:1px solid var(--border,#2a2c33);
  font-family:var(--font-display,inherit); font-size:.72rem; font-weight:700;
  letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted,#8b8f9a);
}
.crm-col-head b { color:var(--text-primary,#fff); font-size:.95rem; letter-spacing:0; }
.crm-col-body { padding:10px; display:flex; flex-direction:column; gap:9px; min-height:110px; transition:background .15s; }
.crm-col-body.sobre { background:var(--accent-dim,rgba(255,107,0,.12)); }
.crm-vazio { color:var(--text-muted,#8b8f9a); font-size:.75rem; text-align:center; padding:22px 6px; font-style:italic; }

/* ── card do lead ── */
.crm-card {
  background:var(--bg-card,#17181c); border:1px solid var(--border,#2a2c33);
  border-radius:var(--radius-sm,9px); padding:11px; cursor:grab;
  border-left:3px solid transparent; transition:border-color .15s, transform .1s;
}
.crm-card:hover { border-color:var(--text-muted,#8b8f9a); }
.crm-card:active { cursor:grabbing; }
.crm-card.arrastando { opacity:.45; transform:scale(.97); }
.crm-card.fria { border-left-color:var(--warning,#ffaa00); }
.crm-card.atrasado { border-left-color:var(--danger,#ef4444); }

.crm-card-top { display:flex; align-items:center; gap:8px; }
.crm-ini {
  width:26px; height:26px; flex-shrink:0; border-radius:50%;
  background:var(--accent-dim,rgba(255,107,0,.15)); color:var(--accent,#ff6b00);
  font-size:.62rem; font-weight:800; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display,inherit);
}
.crm-nome { font-weight:600; font-size:.88rem; color:var(--text-primary,#fff); overflow-wrap:anywhere; }
.crm-origem { font-size:.7rem; color:var(--text-muted,#8b8f9a); margin:5px 0 0 34px; }
.crm-retorno, .crm-sem-retorno { font-size:.71rem; margin:7px 0 0; }
.crm-retorno { color:var(--warning,#ffaa00); }
.crm-retorno.vencido { color:var(--danger,#ef4444); font-weight:700; }
.crm-sem-retorno { color:var(--text-muted,#8b8f9a); font-style:italic; opacity:.75; }
.crm-parado { font-size:.66rem; color:var(--text-muted,#8b8f9a); margin-top:6px; }

.crm-card-acoes { display:flex; gap:3px; margin-top:9px; flex-wrap:wrap; }
.crm-mini {
  background:var(--bg-input,#101115); border:1px solid var(--border,#2a2c33);
  color:var(--text-secondary,#c9ccd4); border-radius:6px; cursor:pointer;
  width:27px; height:27px; display:inline-flex; align-items:center; justify-content:center;
  font-size:.78rem; text-decoration:none; transition:all .13s; padding:0;
}
.crm-mini:hover { border-color:var(--accent,#ff6b00); color:var(--accent,#ff6b00); }
.crm-mini:focus-visible { outline:2px solid var(--accent,#ff6b00); outline-offset:1px; }
.crm-mini-ok:hover { border-color:var(--success,#22c55e); color:var(--success,#22c55e); }
.crm-mini-no:hover { border-color:var(--danger,#ef4444); color:var(--danger,#ef4444); }

.crm-rodape {
  display:flex; gap:18px; flex-wrap:wrap; align-items:center;
  margin-top:14px; padding:11px 14px; font-size:.8rem; color:var(--text-muted,#8b8f9a);
  background:var(--bg-input,#101115); border:1px solid var(--border,#2a2c33);
  border-radius:var(--radius-sm,9px);
}
.crm-rodape b { color:var(--text-primary,#fff); }
.crm-legenda { margin-left:auto; display:flex; align-items:center; gap:6px; }
.crm-dot-fria { width:9px; height:3px; background:var(--warning,#ffaa00); border-radius:2px; display:inline-block; }

/* ── modal de retorno ── */
.crm-modal-ov {
  position:fixed; inset:0; z-index:9400; background:rgba(0,0,0,.6);
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.crm-modal {
  background:var(--bg-card,#17181c); border:1px solid var(--border,#2a2c33);
  border-radius:var(--radius-md,14px); padding:22px; width:100%; max-width:400px;
  box-shadow:0 20px 50px rgba(0,0,0,.5);
}
.crm-modal h3 { margin:0 0 14px; font-size:1.1rem; }
.crm-modal .form-input { width:100%; }

/* ── retornos ── */
.crm-bloco { margin-bottom:18px; }
.crm-bloco h3 {
  font-size:.74rem; letter-spacing:1.4px; text-transform:uppercase;
  color:var(--text-muted,#8b8f9a); margin:0 0 9px; display:flex; align-items:center; gap:8px;
}
.crm-bloco h3 span {
  background:var(--border,#2a2c33); color:var(--text-primary,#fff);
  border-radius:999px; padding:1px 8px; font-size:.72rem; letter-spacing:0;
}
.crm-bloco.atrasado h3 { color:var(--danger,#ef4444); }
.crm-bloco.atrasado h3 span { background:var(--danger,#ef4444); color:#fff; }
.crm-tarefa {
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  background:var(--bg-card,#17181c); border:1px solid var(--border,#2a2c33);
  border-radius:var(--radius-sm,9px); padding:12px 14px; margin-bottom:8px;
}
.crm-bloco.atrasado .crm-tarefa { border-left:3px solid var(--danger,#ef4444); }
.crm-tarefa-h {
  font-family:var(--font-display,inherit); font-weight:700; font-size:.8rem;
  color:var(--text-muted,#8b8f9a); width:74px; flex-shrink:0; font-variant-numeric:tabular-nums;
}
.crm-tarefa-c { flex:1; min-width:170px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.crm-tarefa-t { width:100%; font-size:.82rem; color:var(--text-secondary,#c9ccd4); }
.crm-tarefa-a { display:flex; gap:6px; flex-shrink:0; }

/* ── relatório ── */
.crm-perfiltro { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.crm-chip {
  background:var(--bg-input,#101115); border:1px solid var(--border,#2a2c33);
  color:var(--text-muted,#8b8f9a); border-radius:999px; padding:5px 14px;
  font-size:.78rem; cursor:pointer;
}
.crm-chip.on { background:var(--accent,#ff6b00); border-color:var(--accent,#ff6b00); color:#fff; }
.crm-chip:focus-visible { outline:2px solid var(--accent,#ff6b00); outline-offset:2px; }

.crm-aviso {
  background:rgba(255,170,0,.09); border:1px solid var(--warning,#ffaa00);
  border-radius:var(--radius-sm,9px); padding:13px 15px; margin-bottom:16px;
  font-size:.83rem; line-height:1.55; color:var(--text-secondary,#c9ccd4);
}
.crm-nums { display:grid; grid-template-columns:repeat(auto-fit,minmax(112px,1fr)); gap:9px; margin-bottom:16px; }
.crm-num {
  background:var(--bg-card,#17181c); border:1px solid var(--border,#2a2c33);
  border-radius:var(--radius-sm,9px); padding:13px; text-align:center;
}
.crm-num b {
  display:block; font-family:var(--font-display,inherit); font-size:1.7rem; font-weight:800;
  color:var(--text-primary,#fff); font-variant-numeric:tabular-nums; line-height:1.1;
}
.crm-num span { font-size:.68rem; text-transform:uppercase; letter-spacing:1px; color:var(--text-muted,#8b8f9a); }
.crm-num-perda b { color:var(--danger,#ef4444); }

.card.crm-sec { padding:18px; margin-bottom:14px; }
.card.crm-sec h3 { margin:0 0 14px; font-size:.95rem; }
.crm-taxa { display:flex; align-items:center; gap:12px; margin-bottom:11px; flex-wrap:wrap; }
.crm-taxa-l { width:200px; flex-shrink:0; font-size:.82rem; color:var(--text-secondary,#c9ccd4); }
.crm-barra { flex:1; min-width:110px; height:9px; background:var(--bg-input,#101115); border-radius:999px; overflow:hidden; }
.crm-barra i { display:block; height:100%; background:var(--accent,#ff6b00); border-radius:999px; transition:width .3s; }
.crm-taxa-v {
  width:130px; flex-shrink:0; text-align:right; font-weight:700; font-size:.9rem;
  color:var(--text-primary,#fff); font-variant-numeric:tabular-nums;
}
.crm-taxa-v .dim { color:var(--text-muted,#8b8f9a); font-weight:500; }
.crm-taxa-f { display:block; font-size:.68rem; font-weight:400; color:var(--text-muted,#8b8f9a); }
.crm-nota { font-size:.76rem; color:var(--text-muted,#8b8f9a); line-height:1.55; margin:12px 0 0; }

.crm-duo { display:grid; grid-template-columns:repeat(auto-fit,minmax(270px,1fr)); gap:14px; }
table.crm-tab { width:100%; border-collapse:collapse; font-size:.83rem; }
table.crm-tab th {
  text-align:left; font-size:.66rem; text-transform:uppercase; letter-spacing:1px;
  color:var(--text-muted,#8b8f9a); padding:5px 8px; border-bottom:1px solid var(--border,#2a2c33);
}
table.crm-tab td { padding:7px 8px; border-bottom:1px solid var(--border,#2a2c33); color:var(--text-secondary,#c9ccd4); }
table.crm-tab tr:last-child td { border-bottom:none; }
table.crm-tab td:not(:first-child), table.crm-tab th:not(:first-child) { text-align:right; width:74px; font-variant-numeric:tabular-nums; }

.crm-tempo { display:flex; gap:26px; align-items:flex-end; flex-wrap:wrap; }
.crm-tempo b {
  display:block; font-family:var(--font-display,inherit); font-size:2rem; font-weight:800;
  color:var(--accent,#ff6b00); line-height:1;
}
.crm-tempo span { font-size:.7rem; text-transform:uppercase; letter-spacing:1px; color:var(--text-muted,#8b8f9a); }
.crm-tempo-n { font-size:.78rem; color:var(--text-muted,#8b8f9a); margin-left:auto; }

@media (max-width:900px){ .crm-board { grid-template-columns:repeat(4,minmax(178px,1fr)); } }
@media (max-width:560px){
  .crm-taxa-l { width:100%; }
  .crm-taxa-v { width:auto; text-align:left; }
  .crm-tarefa-h { width:auto; }
}
@media (prefers-reduced-motion:reduce){ .crm-card, .crm-barra i { transition:none; } }

/* ── card do Dashboard: retornos de hoje ── */
.card.crm-hoje {
  padding:0; margin-bottom:18px; overflow:hidden;
  border-left:4px solid var(--accent,#ff6b00);
}
.card.crm-hoje.tem-atraso { border-left-color:var(--danger,#ef4444); }
.crm-hoje-head {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:15px 18px; border-bottom:1px solid var(--border,#2a2c33);
}
.crm-hoje-head > div:first-child { flex:1; min-width:180px; }
.crm-hoje-t { font-family:var(--font-display,inherit); font-weight:800; font-size:1.02rem; color:var(--text-primary,#fff); }
.crm-hoje-s { font-size:.8rem; color:var(--text-muted,#8b8f9a); margin-top:2px; }
.crm-hoje-list { display:flex; flex-direction:column; max-height:250px; overflow-y:auto; overscroll-behavior:contain; }
.crm-hoje-row {
  display:flex; align-items:center; gap:13px;
  padding:10px 18px; border-bottom:1px solid var(--border,#2a2c33);
}
.crm-hoje-row:last-child { border-bottom:none; }
.crm-hoje-d {
  flex-shrink:0; width:74px; font-family:var(--font-display,inherit); font-weight:700;
  font-size:.78rem; color:var(--text-muted,#8b8f9a); font-variant-numeric:tabular-nums;
}
.crm-hoje-d.atr { color:var(--danger,#ef4444); }
.crm-hoje-n { flex:1; min-width:0; font-weight:600; color:var(--text-primary,#fff); font-size:.88rem; }
.crm-hoje-n i { display:block; font-style:normal; font-size:.76rem; font-weight:400; color:var(--text-muted,#8b8f9a); overflow-wrap:anywhere; }
.crm-hoje-row [aria-disabled="true"] { opacity:.45; pointer-events:none; }
.crm-hoje-mais { padding:9px 18px; font-size:.78rem; color:var(--text-muted,#8b8f9a); border-top:1px solid var(--border,#2a2c33); }
@media (max-width:560px){ .crm-hoje-row{ gap:9px; padding:9px 13px; } .crm-hoje-d{ width:auto; } }
