/* =========================================================
   Pulso — CRM e negócios (.crm-)
   ========================================================= */
.crm-pip-select { width: auto; min-width: 200px; height: 36px; border-radius: var(--r-pill); }
.crm-search { flex: 1 1 220px; max-width: 360px; }
.crm-owner { width: auto; min-width: 190px; }
.crm-lost-toggle { cursor: pointer; white-space: nowrap; }

/* Faixa do funil */
.crm-strip { display: flex; gap: 4px; height: 8px; margin: 0 0 16px; }
.crm-strip span { border-radius: 99px; background: var(--c); opacity: 0.85; transition: flex 0.6s var(--ease), opacity 0.2s; min-width: 10px; }
.crm-strip span:hover { opacity: 1; }

/* Quadro */
.crm-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px;
  overflow-x: auto; padding: 2px 2px 14px; align-items: start; scroll-snap-type: x proximity;
}
.crm-col {
  position: relative; display: flex; flex-direction: column; min-height: 420px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line); scroll-snap-align: start; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.crm-col::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 0 0 3px 3px; background: var(--c); box-shadow: 0 0 14px var(--c); }
.crm-col.crm-drop { border-color: var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(255, 255, 255, 0.01)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.crm-col.is-lost-col { background: linear-gradient(180deg, rgba(244, 63, 94, 0.06), rgba(255, 255, 255, 0.01)); }
.crm-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 4px 16px; }
.crm-col-dot { width: 10px; height: 10px; border-radius: 4px; background: var(--c); flex-shrink: 0; box-shadow: 0 0 10px var(--c); }
.crm-col-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 16px 12px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.crm-col-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 120px; }
.crm-col-empty {
  flex: 1; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.1); border-radius: 16px; color: var(--subtle); font-size: 12px; padding: 16px;
}
.crm-col-empty .iconify { font-size: 22px; }
.crm-body-hint { display: none; }
#crm-body.is-dragging-any .crm-col:not(.crm-drop) .crm-col-body { background: rgba(255, 255, 255, 0.01); }

/* Card de negócio */
.crm-card {
  position: relative; padding: 14px; border-radius: 16px; cursor: grab; user-select: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)); border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.8); transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  animation: rise 0.4s var(--ease) both;
}
.crm-card::after { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); opacity: 0.8; }
.crm-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 18px 34px -16px rgba(0, 0, 0, 0.9); }
.crm-card:active { cursor: grabbing; }
.crm-card:focus-visible { outline: 2px solid var(--cyan-2); outline-offset: 2px; }
.crm-card.is-dragging { opacity: 0.35; transform: rotate(2deg) scale(0.98); }
.crm-card.is-lost { opacity: 0.62; }
.crm-card.is-lost::after { background: var(--rose-2); }
.crm-card.is-won { background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.04)); border-color: rgba(52, 211, 153, 0.28); }
.crm-card.crm-flash { animation: crm-flash 1.2s ease; }
.crm-card-title { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-card-value { font-size: 17px; letter-spacing: -0.02em; }
.crm-won-ic { color: var(--yellow); font-size: 16px; flex-shrink: 0; }
.crm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.crm-prob { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.crm-prob i { width: 36px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--emerald-2) calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0); }

/* Lista */
.crm-table .crm-tt { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-table th .iconify { font-size: 12px; vertical-align: -1px; }

/* Modal novo negócio: busca de contato */
.crm-pick-results { margin-top: 6px; max-height: 240px; overflow-y: auto; padding: 4px; border-radius: 14px; background: #1c1c1f; border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.crm-pick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px; text-align: left; }
.crm-pick-item:hover { background: rgba(255, 255, 255, 0.07); }
.crm-pick-sel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(34, 211, 238, 0.07); border: 1px solid rgba(34, 211, 238, 0.25); animation: pop-in 0.25s var(--ease) both; }

/* Drawer */
.crm-hero .big-num { font-size: 32px; }
.crm-hero .iconify { vertical-align: -2px; }
.crm-contact { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s; }
.crm-contact:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line-2); }
.crm-note { padding: 10px 12px; border-radius: 12px; background: rgba(250, 204, 21, 0.06); border: 1px solid rgba(250, 204, 21, 0.18); }
.crm-timeline { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 4px; }
.crm-timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.crm-tl-item { position: relative; display: flex; gap: 14px; }
.crm-tl-dot { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--bg-3); border: 2px solid var(--cyan-2); flex-shrink: 0; }
.crm-tl-item:first-child .crm-tl-dot { background: var(--cyan-2); box-shadow: 0 0 10px var(--cyan-2); }

/* Confete */
.crm-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.crm-confetti i { position: absolute; top: -24px; display: block; animation-name: crm-fall; animation-timing-function: cubic-bezier(0.25, 0.6, 0.4, 1); animation-fill-mode: forwards; }

@keyframes crm-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate3d(var(--dx), 108vh, 0) rotate(var(--r)); opacity: 0; }
}
@keyframes crm-flash { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(34, 211, 238, 0); } }

/* Responsivo */
@media (max-width: 1024px) {
  .crm-board { grid-auto-columns: minmax(260px, 44%); scroll-snap-type: x mandatory; }
}
@media (max-width: 760px) {
  .crm-toolbar .crm-search { max-width: none; flex-basis: 100%; }
  .crm-owner { flex: 1; min-width: 0; }
  #crm-count { width: 100%; margin-left: 0; }
  .crm-pip-select { flex: 1 1 100%; }
  .page-actions:has(.crm-pip-select) { width: 100%; }
}
@media (max-width: 560px) {
  .crm-board { grid-auto-columns: 86%; gap: 10px; margin: 0 -16px; padding: 2px 16px 14px; scroll-padding: 0 16px; }
  .crm-col { min-height: 360px; }
  .crm-hero .big-num { font-size: 26px; }
}
