/* ===== CRM v2 — Seguimiento ===== */

.crm-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.crm-viewtoggle {
  display: inline-flex;
  background: var(--zm-navy-08);
  border-radius: 10px;
  padding: 3px;
}
.crm-viewtoggle-btn {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--zm-gray);
  cursor: pointer;
}
.crm-viewtoggle-btn.active {
  background: #fff;
  color: var(--zm-navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(17, 29, 52, 0.12);
}
.crm-topline input[type="text"] {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--zm-border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
}
.crm-topline .crm-quick-btn {
  margin-left: auto;
  padding: 10px 18px;
  font-size: 0.9rem;
}

.crm-tablero-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.crm-seg-pane {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 40px;
}

/* métricas */
.crm-seg-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  max-width: 1000px;
}
.crm-seg-stat {
  background: #fff;
  border: 1px solid var(--zm-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.crm-seg-stat .lbl { font-size: 0.75rem; color: var(--zm-gray); }
.crm-seg-stat .num { font-size: 1.35rem; font-weight: 600; color: var(--zm-navy); }
.crm-seg-stat .num small { font-size: 0.8rem; font-weight: 400; color: var(--zm-gray); }
.crm-seg-stat.danger .num { color: var(--zm-red); }
.crm-seg-stat.ok .num { color: #15803d; }

/* grupos */
.crm-seg-list { max-width: 1000px; }
.crm-seg-group { margin-bottom: 18px; }
.crm-seg-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zm-gray);
  margin: 0 0 8px 2px;
}
.crm-seg-group.tone-danger .crm-seg-group-title span { color: var(--zm-red); }
.crm-seg-group.tone-accent .crm-seg-group-title span { color: #1d4ed8; }
.crm-seg-group.tone-warning .crm-seg-group-title span { color: #b45309; }
.crm-seg-hint { margin: -2px 0 8px 2px; font-size: 0.8rem; color: var(--zm-gray); }
.crm-seg-empty { color: var(--zm-gray); font-size: 0.88rem; }
.crm-seg-done {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #14532d;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.crm-link-btn {
  border: 0;
  background: none;
  color: #1d4ed8;
  font: inherit;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

/* filas */
.crm-seg-row {
  background: #fff;
  border: 1px solid var(--zm-border);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.crm-seg-row:hover { border-color: var(--zm-navy-14); box-shadow: var(--shadow-card); }
.tone-danger .crm-seg-row { border-left: 3px solid var(--zm-red); }
.crm-seg-main { flex: 1; min-width: 0; }
.crm-seg-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-seg-name {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--zm-navy);
  cursor: pointer;
  text-align: left;
}
.crm-seg-name:hover { text-decoration: underline; }
.crm-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.crm-pill.temp-caliente { background: #fde8e7; color: #9f1d16; }
.crm-pill.temp-tibio { background: #fef3c7; color: #92400e; }
.crm-pill.temp-frio { background: #e0ecfd; color: #1e40af; }
.crm-pill.temp-none { background: var(--zm-navy-08); color: var(--zm-gray); font-weight: 500; }
.crm-stage {
  font-size: 0.78rem;
  color: var(--zm-gray);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.crm-stage::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stage-color, var(--zm-navy));
}
.crm-due { font-size: 0.78rem; color: var(--zm-gray); }
.crm-due::before { content: "· "; }
.crm-due.danger { color: var(--zm-red); font-weight: 600; }
.crm-due.accent { color: #1d4ed8; font-weight: 600; }
.crm-due.warn { color: #b45309; }
.crm-due.ok { color: #15803d; font-weight: 600; }
.crm-seg-facts { font-size: 0.8rem; color: var(--zm-gray); margin-top: 3px; }
.crm-warn-txt { color: var(--zm-red); }
.crm-seg-note {
  font-size: 0.83rem;
  color: #3b4660;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-seg-actions { display: flex; gap: 8px; flex-shrink: 0; }
.crm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--zm-border);
  background: #fff;
  color: var(--zm-navy);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.crm-btn svg { width: 17px; height: 17px; }
.crm-btn:hover { background: var(--zm-navy-08); }
.crm-btn-wa { color: #128c4b; border-color: #b7e4c9; }
.crm-btn-wa:hover { background: #ecfdf3; }
.crm-btn-check { background: var(--zm-navy); border-color: var(--zm-navy); color: #fff; }
.crm-btn-check:hover { background: #1c2b4a; }
.crm-btn-ghost { color: var(--zm-gray); }

/* modales */
.crm-modal { max-width: 520px; max-height: 92vh; overflow-y: auto; }
.crm-modal-body { display: flex; flex-direction: column; gap: 14px; }
.crm-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; }
.crm-label { font-size: 0.78rem; font-weight: 600; color: var(--zm-navy); }
.crm-modal input[type="text"], .crm-modal input[type="tel"], .crm-modal input[type="date"],
.crm-modal select, .crm-modal textarea {
  padding: 9px 11px;
  border: 1px solid var(--zm-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.crm-modal textarea { resize: vertical; }
.crm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.crm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-chip {
  border: 1px solid var(--zm-border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--zm-navy);
  cursor: pointer;
}
.crm-chip:hover { background: var(--zm-navy-08); }
.crm-chip.on { background: var(--zm-navy); border-color: var(--zm-navy); color: #fff; }
.crm-chips[data-name="temp"] .crm-chip.on[data-v="caliente"] { background: #b3261e; border-color: #b3261e; }
.crm-chips[data-name="temp"] .crm-chip.on[data-v="tibio"] { background: #b45309; border-color: #b45309; }
.crm-chips[data-name="temp"] .crm-chip.on[data-v="frio"] { background: #1d4ed8; border-color: #1d4ed8; }
.crm-date-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--zm-gray); margin-top: 2px; }
.crm-date-row input { width: auto !important; }
.crm-dup {
  margin: -6px 0 0;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
}
.crm-kbd-hint { margin: -4px 0 0; font-size: 0.75rem; color: var(--zm-gray); }
.crm-opp-extras {
  border-top: 1px solid var(--zm-border);
  border-bottom: 1px solid var(--zm-border);
  padding: 12px 0;
}

/* toast */
.crm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--zm-navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
}
.crm-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* celu */

@media (max-width: 600px) {
  .crm-topline { gap: 8px; }
  .crm-viewtoggle { order: 1; }
  .crm-topline .crm-quick-btn { order: 2; padding: 9px 14px; }
  .crm-topline input[type="text"] { order: 3; flex-basis: 100%; max-width: none; }
  .crm-seg-stat { padding: 8px 10px; }
  .crm-seg-stat .num { font-size: 1.1rem; }
  .crm-seg-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .crm-seg-note { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .crm-seg-actions .crm-btn { flex: 1; justify-content: center; padding: 10px; }
  .crm-row2 { grid-template-columns: 1fr; }
  .crm-modal { max-height: 96vh; padding: 18px 16px; }
  .crm-chip { padding: 8px 12px; }
}

/* modal "Editar oportunidad": más ancho y con scroll (ahora tiene más campos) */
#oppModal .modal-box { max-width: 600px; max-height: 92vh; overflow-y: auto; }

/* barra superior en el celu: logo + búsqueda arriba, pestañas deslizables abajo */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .topbar img { height: 38px; width: 38px; }
  .topbar > div:not(.global-search) { display: none; }
  .topbar .global-search { flex: 1; margin-left: 0; min-width: 0; }
  .topbar .global-search input { width: 100%; box-sizing: border-box; }
  .topbar .primary-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 20px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topbar .primary-tabs::-webkit-scrollbar { display: none; }
  .topbar .tab-btn { white-space: nowrap; flex-shrink: 0; }
  .crm-view { height: calc(100vh - 120px); height: calc(100dvh - 120px); }
}

/* ===== CRM v3: tablero con tarjetas tipo etiqueta ===== */
.crm-tablero-pane .crm-column { width: 214px; }
.crm-tablero-pane .crm-column-body { gap: 5px; padding: 2px 8px 10px; }
.opp-card.crm-tag {
  position: relative;
  padding: 7px 9px 7px 10px;
  border-radius: 7px;
  border-left: 4px solid #c5cad5;
  box-shadow: none;
}
.opp-card.crm-tag:hover { border-color: var(--zm-navy-14); border-left-color: inherit; box-shadow: var(--shadow-card); }
.opp-card.crm-tag.temp-caliente { border-left-color: #d64541; }
.opp-card.crm-tag.temp-tibio { border-left-color: #e8a33d; }
.opp-card.crm-tag.temp-frio { border-left-color: #3b7ddd; }
.crm-tag-l1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.crm-tag-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: #16213a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.crm-tag-date { font-size: 0.72rem; color: var(--zm-gray); margin-top: 2px; }
.crm-tag-date::first-letter { text-transform: uppercase; }
.crm-tag-date.danger { color: var(--zm-red); font-weight: 600; }
.crm-tag-date.accent { color: #1d4ed8; font-weight: 600; }
.crm-tag-date.warn { color: #b45309; }
.crm-tag-l2 {
  font-size: 0.74rem;
  color: #4a5570;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-tag-stuck {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 6px;
}
.crm-tag-tools {
  position: absolute;
  right: 4px;
  bottom: 3px;
  display: none;
  gap: 2px;
  background: #fff;
  border-radius: 6px;
}
.opp-card.crm-tag:hover .crm-tag-tools { display: flex; }
.crm-tag-tools button {
  border: 1px solid var(--zm-border);
  background: #fff;
  border-radius: 5px;
  font-size: 0.72rem;
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
  color: var(--zm-navy);
}
.crm-tag-tools button:hover { background: var(--zm-navy-08); }
.crm-tag-tools button:disabled { opacity: 0.35; cursor: default; }
@media (hover: none) {
  .crm-tag-tools { position: static; display: flex; justify-content: flex-end; margin-top: 5px; }
}

/* estancado en Seguimiento */
.crm-stuck {
  font-size: 0.7rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 7px;
}
.crm-seg-stat.warn .num { color: #b45309; }
.crm-seg-facts strong { color: #2a3550; font-weight: 600; }
.crm-seg-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 1100px; }

/* ficha del lead: chips Sí/No */
.crm-opp-extras { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.crm-opp-chips { display: flex; flex-wrap: wrap; gap: 14px 22px; }
#oppModal .crm-chip { font-size: 0.8rem; padding: 5px 12px; }

/* embudo en KPIs */
.crm-funnel { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 20px; }
.crm-funnel-card { background: #fff; border: 1px solid var(--zm-border); border-radius: 12px; padding: 16px 18px; }
.crm-funnel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.crm-funnel-head h3 { margin: 0; font-size: 0.98rem; color: var(--zm-navy); }
.crm-funnel-head span { font-size: 0.82rem; color: var(--zm-gray); }
.crm-funnel-head strong { color: #15803d; }
.crm-funnel-row { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 0.82rem; }
.crm-funnel-lbl { color: #2a3550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-funnel-bar { height: 10px; background: var(--zm-navy-08); border-radius: 5px; overflow: hidden; }
.crm-funnel-bar > span { display: block; height: 100%; border-radius: 5px; min-width: 2px; }
.crm-funnel-num { font-weight: 600; color: var(--zm-navy); }
.crm-funnel-stuck { font-weight: 500; color: #b45309; }
.crm-funnel-note { margin: 10px 0 0; font-size: 0.76rem; color: var(--zm-gray); }

@media (max-width: 900px) {
  .crm-seg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-funnel { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .crm-funnel-row { grid-template-columns: 100px 1fr 70px; }
  .crm-funnel-stuck { display: block; }
}
@media (max-width: 760px) {
  .crm-seg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-seg-stat:nth-child(n+5) { display: none; }
}

/* ===== v5: etiqueta NOMBRE / INTERÉS / FECHA ===== */
.crm-tablero-pane .crm-column { width: 220px; }
.crm-tablero-pane .crm-column-body { gap: 6px; }
.opp-card.crm-tag {
  padding: 8px 10px 8px 11px;
  border-radius: 9px;
  border: 1px solid #e3e7ee;
  border-left: 4px solid #c5cad5;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 29, 52, 0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}
.opp-card.crm-tag:hover { box-shadow: 0 4px 12px rgba(17, 29, 52, 0.1); transform: translateY(-1px); }
.opp-card.crm-tag.temp-caliente { border-left-color: #e5484d; }
.opp-card.crm-tag.temp-tibio { border-left-color: #f0a830; }
.opp-card.crm-tag.temp-frio { border-left-color: #3e82e8; }
.crm-tag-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.crm-tag .crm-tag-name {
  font-size: 0.84rem;
  font-weight: 650;
  color: #111d34;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.crm-tag-valor {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: #166534;
  background: #e8f7ee;
  border-radius: 999px;
  padding: 1px 7px;
}
.crm-tag-interes {
  font-size: 0.74rem;
  color: #56607a;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-tag-when {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #39445e;
}
.crm-tag-when svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.75; }
.crm-tag-when.today { color: #1d4ed8; font-weight: 600; }
.crm-tag-when.warn { color: #b45309; }
.crm-tag-when.late {
  color: #b42318;
  background: #fdecec;
  border-radius: 6px;
  padding: 2px 7px 2px 5px;
  font-weight: 600;
}
.crm-tag-when.late svg { opacity: 1; }
.crm-tag .crm-tag-stuck {
  display: block;
  margin-top: 5px;
  font-size: 0.66rem;
  font-weight: 600;
  color: #92400e;
}
.crm-tag-tools { right: 6px; top: 6px; bottom: auto; }
.crm-tag-tools button { padding: 2px 5px; font-size: 0.68rem; }

/* ===== v6: acción del seguimiento + botones abajo ===== */
.crm-tag-accion {
  font-size: 0.7rem;
  color: #39445e;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opp-card.crm-tag { padding-bottom: 8px; }
.crm-tag-tools { top: auto; bottom: 5px; right: 6px; box-shadow: 0 0 0 3px #fff; }
.crm-modal label.crm-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  color: var(--zm-navy);
  cursor: pointer;
  margin: 0;
}
.crm-modal label.crm-check input { width: 16px !important; height: 16px; margin: 0; flex: none; }
.crm-tag-accion b { font-weight: 600; color: #1d2a44; }
.crm-date-row input[type="time"] { width: auto !important; }
.crm-date-row { flex-wrap: wrap; }

/* ===== v7: nombre e interés completos (hasta 2 líneas) ===== */
.crm-tablero-pane .crm-column { width: 240px; }
.crm-tag .crm-tag-name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  word-break: break-word;
}
.crm-tag-top { align-items: flex-start; }
.crm-tag-valor { margin-top: 1px; }
.crm-tag-interes {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  margin-top: 3px;
}
.crm-tag-accion { white-space: normal; }
.crm-total-sub { display: block; font-size: 0.72rem; color: var(--zm-gray); font-weight: 500; margin-top: 1px; }

/* ===== v8: tableros Viaje / Importación / Por clasificar ===== */
.crm-pipe-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.crm-pipe-tab {
  border: 1px solid var(--zm-border);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--zm-navy);
  cursor: pointer;
}
.crm-pipe-tab:hover { background: var(--zm-navy-08); }
.crm-pipe-tab.active { background: var(--zm-navy); border-color: var(--zm-navy); color: #fff; }
.crm-pipe-count:empty { display: none; }
.crm-pipe-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.crm-pipe {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.crm-pipe-viaje { background: #e8f0fe; color: #1e40af; }
.crm-pipe-impo { background: #fff1e0; color: #9a3412; }
.crm-pipe-bandeja { background: #eef0f4; color: #475569; }

.crm-seg-filters { display: flex; gap: 6px; margin: -4px 0 14px; }
.crm-seg-filter {
  border: 1px solid var(--zm-border);
  background: #fff;
  border-radius: 999px;
  padding: 5px 13px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--zm-navy);
  cursor: pointer;
}
.crm-seg-filter.active { background: var(--zm-navy); border-color: var(--zm-navy); color: #fff; }
.crm-seg-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1000px; }
.crm-seg-stat.accent .num { color: #1d4ed8; }

.crm-bandeja-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f4f6fb;
  border: 1px dashed #b9c2d6;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #2a3550;
  max-width: 1000px;
}

.crm-bandeja { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 40px; }
.crm-bandeja-head p { margin: 0 0 10px; font-size: 0.84rem; color: var(--zm-gray); }
.crm-bandeja-filters { margin-bottom: 12px; }
.crm-bandeja-list { max-width: 1100px; }
.crm-bandeja-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--zm-border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 6px;
}
.crm-bandeja-main { flex: 1; min-width: 0; }
.crm-bandeja-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.crm-bandeja-actions .crm-btn { padding: 6px 10px; font-size: 0.8rem; }
.crm-btn-icon { padding: 6px 8px !important; }
.crm-sug { font-size: 0.7rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.crm-sug.viaje { background: #e8f0fe; color: #1e40af; }
.crm-sug.impo { background: #fff1e0; color: #9a3412; }
.crm-funnel-sec { font-size: 0.78rem; font-weight: 700; color: var(--zm-navy); margin: 12px 0 6px; }
.crm-funnel-sec:first-of-type { margin-top: 0; }

@media (max-width: 760px) {
  .crm-seg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-seg-stat:nth-child(n+5) { display: block; }
  .crm-bandeja-row { flex-direction: column; align-items: stretch; }
  .crm-bandeja-actions { justify-content: flex-start; }
  .crm-bandeja-banner { flex-direction: column; align-items: flex-start; }
}

/* ===== v9: Hoy / Mañana bien claros ===== */
.crm-seg-group.tone-tomorrow .crm-seg-group-title span { color: #6d28d9; }
.crm-due.tomorrow { color: #6d28d9; font-weight: 600; }
.crm-tag-when.tomorrow { color: #6d28d9; font-weight: 600; }
.crm-seg-group.tone-accent .crm-seg-row { border-left: 3px solid #1d4ed8; }

/* ===== v10: Registrar simple ===== */
.crm-modal textarea.crm-note-big { min-height: 120px; font-size: 0.95rem; line-height: 1.45; }

/* ===== v11: ficha compacta (archivos e historial) ===== */
#oppModal .opp-compact { border-top: 1px solid var(--zm-border); padding-top: 10px; margin-top: 10px; }
#oppModal .opp-compact-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#oppModal .opp-compact-label { font-size: 0.78rem; font-weight: 600; color: var(--zm-navy); }
#oppModal .opp-mini-btn {
  border: 1px solid var(--zm-border);
  background: #fff;
  border-radius: 7px;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--zm-navy);
  cursor: pointer;
  white-space: nowrap;
}
#oppModal .opp-mini-btn:hover { background: var(--zm-navy-08); }
#oppModal .opp-compact .tareas-empty { margin: 0; padding: 0; font-size: 0.76rem; color: var(--zm-gray); font-weight: 400; text-align: left; }
#oppModal .opp-files-list { margin-top: 0; }
#oppModal .task-comments { gap: 6px; max-height: 160px; margin-bottom: 8px; }
#oppModal .task-comment { font-size: 0.8rem; }
#oppModal .task-comment-add input { padding: 6px 9px; font-size: 0.8rem; }

/* ===== v12: próximo contacto destacado en la ficha ===== */
#oppModal .opp-next-box {
  background: #eef4ff;
  border: 1px solid #c9dafc;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 4px 0 16px;
}
#oppModal .opp-next-box.late { background: #fdecec; border-color: #f5c2c0; }
#oppModal .opp-next-box.empty { background: #fff7ed; border-color: #fed7aa; }
#oppModal .opp-next-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
#oppModal .opp-next-title { font-size: 0.95rem; font-weight: 700; color: var(--zm-navy); }
#oppModal .opp-next-txt { font-size: 0.9rem; font-weight: 600; color: #1d4ed8; }
#oppModal .opp-next-box.late .opp-next-txt { color: #b42318; }
#oppModal .opp-next-box.empty .opp-next-txt { color: #b45309; }
#oppModal .opp-next-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#oppModal .opp-next-input input { width: auto; padding: 6px 9px; border: 1px solid var(--zm-border); border-radius: 8px; font: inherit; background: #fff; }
#oppModal .opp-next-box .crm-chip { background: #fff; }
#oppModal .opp-next-box .crm-chip.on { background: var(--zm-navy); color: #fff; }
.crm-opp-extras { border-bottom: none !important; }

/* ===== v13: ficha en una sola pantalla (2 columnas) ===== */
#oppModal .modal-box { max-width: 980px; width: 95vw; max-height: 95vh; padding: 18px 22px 16px; }
#oppModal h3 { margin: 0 0 10px; }
#oppModal .opp-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
#oppModal .opp-col-side { border-left: 1px solid var(--zm-border); padding-left: 20px; min-height: 100%; }
#oppModal .opp-col-side .opp-compact { border-top: none; margin-top: 0; padding-top: 0; margin-bottom: 14px; }
#oppModal .opp-col-side .task-comments { max-height: 330px; }
#oppModal .opp-hide, #oppModal #oppTipoCustomLabel { display: none !important; }
#oppModal .grid { gap: 8px 14px; margin: 0; }
#oppModal .grid label, #oppModal .crm-opp-extras label { font-size: 0.74rem; gap: 3px; margin: 0; }
#oppModal .grid input, #oppModal .grid select, #oppModal .crm-opp-extras input, #oppModal .crm-opp-extras select {
  padding: 6px 10px; font-size: 0.88rem; min-height: 0; height: 34px; box-sizing: border-box;
}
#oppModal .opp-next-box { padding: 9px 12px; margin: 0 0 10px; }
#oppModal .opp-next-top { margin-bottom: 6px; }
#oppModal .crm-opp-extras { gap: 8px; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--zm-border); }
#oppModal .crm-opp-chips { gap: 8px 18px; }
#oppModal .crm-opp-extras .crm-label { font-size: 0.74rem; }
#oppModal .crm-chip { padding: 4px 11px; font-size: 0.78rem; }
#oppModal .modal-actions { margin-top: 12px; }
#oppModal .modal-actions .btn { padding: 8px 16px; }
@media (max-width: 760px) {
  #oppModal .opp-cols { grid-template-columns: 1fr; }
  #oppModal .opp-col-side { border-left: none; padding-left: 0; border-top: 1px solid var(--zm-border); padding-top: 10px; }
}
