/* crm.css: vista del duenio. Replica la estetica del CRM de InteliaFlow (crm-enterprise.css, mensajeria.css):
   paleta de la landing, tarjetas de 10px, punto de color por etapa (nunca franjas laterales). */

.crm {
  --st-nuevo: #4cc3ff;
  --st-interesado: #a78bfa;
  --st-cotizado: #ffb547;
  --st-negociacion: #4ecdc4;
  --st-ganado: #22c55e;
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--if-border-strong);
  background: #071527;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  font-family: var(--if-display);
}

/* ------------------------------------------------------------ Barra lateral */
.crm-rail {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0;
  border-right: 1px solid var(--if-border); background: #061120;
}
.crm-rail img { width: 30px; height: 30px; margin-bottom: 12px; object-fit: contain; }
.crm-rail-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--if-text-faint); font-size: 17px; cursor: pointer;
}
.crm-rail-btn:hover { color: var(--if-text-strong); background: var(--if-glass); }
.crm-rail-btn.is-active { color: var(--if-brand-primary); border-color: color-mix(in srgb, var(--if-brand-primary) 35%, transparent); background: var(--if-soft-primary); }
.crm-rail-btn.is-static { cursor: default; }
.crm-rail-btn.is-static:hover { background: transparent; color: var(--if-text-faint); }
.crm-rail-sep { flex: 1; }
.crm-rail-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  display: grid; place-items: center; font: 600 10px/1 var(--if-sans); color: #04121f; background: var(--if-brand-primary);
}
.crm-rail-badge[hidden] { display: none; }

/* ------------------------------------------------------------ Principal */
.crm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.crm-top {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px 12px; border-bottom: 1px solid var(--if-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}
.crm-title { min-width: 0; }
.crm-title h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-title small { display: block; font-size: 12px; color: var(--if-text-faint); }
.crm-live {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 13px; flex: none;
  font: 500 11.5px/1 var(--if-mono); letter-spacing: .04em; text-transform: uppercase; color: #86efac;
  border: 1px solid color-mix(in srgb, var(--if-success) 35%, transparent); background: color-mix(in srgb, var(--if-success) 8%, transparent);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--if-success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--if-success) 60%, transparent);
  animation: live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }

.crm-tabs { display: flex; gap: 4px; margin-left: auto; padding: 3px; border-radius: 10px; border: 1px solid var(--if-border); background: rgba(255, 255, 255, 0.02); }
.crm-tab {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--if-text-muted); font: 600 13px/1 var(--if-sans); cursor: pointer;
}
.crm-tab:hover { color: var(--if-text-strong); }
.crm-tab.is-active { color: var(--if-text-strong); border-color: color-mix(in srgb, var(--if-brand-primary) 40%, transparent); background: var(--if-soft-primary); }
.crm-tab.is-active i { color: var(--if-brand-primary); }
.crm-tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center;
  font: 600 10.5px/1 var(--if-sans); color: #04121f; background: var(--if-brand-primary);
}
.crm-tab-count[hidden] { display: none; }

/* KPIs */
.crm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--if-border); }
.kpi { padding: 10px 12px; border-radius: 11px; border: 1px solid var(--if-border); background: rgba(255, 255, 255, 0.025); min-width: 0; }
.kpi span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--if-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi span i { color: var(--if-text-muted); }
.kpi strong { display: block; margin-top: 4px; font: 600 20px/1.1 var(--if-display); color: var(--if-text-strong); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi em { font-style: normal; font-size: 11px; color: #86efac; margin-left: 4px; font-family: var(--if-mono); }
.kpi.is-bump strong { animation: kpi-bump .6s ease; }
@keyframes kpi-bump { 30% { color: var(--if-brand-primary); transform: translateY(-1px); } }

.crm-views { position: relative; flex: 1; min-height: 0; }
.crm-view { position: absolute; inset: 0; display: flex; min-height: 0; }
.crm-view[hidden] { display: none; }

/* ------------------------------------------------------------ Conversaciones */
.ib-list { flex: none; width: 290px; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--if-border); }
.ib-search {
  display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; height: 36px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--if-border); background: rgba(255, 255, 255, 0.025); color: var(--if-text-faint); font-size: 13px;
}
.ib-filters { display: flex; gap: 6px; padding: 0 12px 10px; }
.ib-filter { height: 26px; padding: 0 10px; border-radius: 7px; display: inline-flex; align-items: center; font: 500 12px/1 var(--if-sans); color: var(--if-text-muted); border: 1px solid var(--if-border); }
.ib-filter.is-active { color: var(--if-text-strong); border-color: color-mix(in srgb, var(--if-brand-primary) 40%, transparent); background: var(--if-soft-primary); }
.ib-items { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 10px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.ib-item {
  position: relative; width: 100%; display: flex; gap: 10px; padding: 10px; margin-bottom: 2px; border-radius: 11px; text-align: left;
  border: 1px solid transparent; background: transparent; color: inherit; font: inherit; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.ib-item:hover { background: rgba(255, 255, 255, 0.035); }
.ib-item.is-active { background: rgba(255, 255, 255, 0.05); border-color: var(--if-border-strong); }
.ib-item.is-live { border-color: color-mix(in srgb, var(--if-brand-primary) 45%, transparent); background: color-mix(in srgb, var(--if-brand-primary) 6%, transparent); }
.ib-item.is-live.is-active { box-shadow: 0 0 0 1px color-mix(in srgb, var(--if-brand-primary) 25%, transparent); }
.ib-item.is-enter { animation: ib-enter .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes ib-enter { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.ib-item.is-ping { animation: ib-ping .9s ease; }
@keyframes ib-ping { 0% { background: color-mix(in srgb, var(--if-brand-primary) 16%, transparent); } 100% { background: transparent; } }

.avatar {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font: 600 13px/1 var(--if-display); color: #eef4fb; background: hsl(var(--h, 210) 45% 32%);
  border: 1px solid hsl(var(--h, 210) 55% 50% / .45);
}
.avatar.is-live { background: var(--if-brand-gradient); color: #04121f; border-color: transparent; }
.avatar .ch {
  position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9.5px; color: #fff; border: 2px solid #071527;
}
.ch.is-whatsapp { background: var(--if-whatsapp); }
.ch.is-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); }
.ch.is-facebook { background: var(--if-facebook); }

.ib-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ib-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ib-row strong { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--if-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row time { flex: none; font: 400 11px/1 var(--if-mono); color: var(--if-text-faint); }
.ib-item.has-unread .ib-row time { color: var(--if-brand-primary); }
.ib-preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--if-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-item.has-unread .ib-preview { color: var(--if-text-strong); }
.ib-unread { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font: 600 10.5px/1 var(--if-sans); color: #04121f; background: var(--if-brand-primary); }
.ib-unread.is-pop { animation: badge-pop .4s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes badge-pop { 0% { transform: scale(.4); } 100% { transform: none; } }
.ib-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.stage-chip {
  --c: var(--st-nuevo);
  display: inline-flex; align-items: center; gap: 6px; height: 21px; padding: 0 8px; border-radius: 6px;
  font: 500 11px/1 var(--if-mono); color: color-mix(in srgb, var(--c) 80%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent);
  transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}
.stage-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.live-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 6px;
  font: 500 10.5px/1 var(--if-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--if-brand-primary);
  border: 1px solid color-mix(in srgb, var(--if-brand-primary) 40%, transparent); background: var(--if-soft-primary);
}
.live-chip .live-dot { width: 6px; height: 6px; background: var(--if-brand-primary); animation-name: live-pulse-cyan; }
@keyframes live-pulse-cyan { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .55); } 80%, 100% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); } }

/* Chat */
.ib-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ib-chat-head { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--if-border); }
.ib-chat-head .who { flex: 1; min-width: 0; }
.ib-chat-head .who strong { display: block; font-size: 14.5px; color: var(--if-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-chat-head .who small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--if-text-faint); }
.ai-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; flex: none;
  font: 500 12px/1 var(--if-sans); color: #c4b5fd;
  border: 1px solid color-mix(in srgb, var(--if-brand-secondary) 40%, transparent); background: color-mix(in srgb, var(--if-brand-secondary) 10%, transparent);
}

.ib-lead { display: flex; align-items: center; gap: 16px; padding: 9px 16px; border-bottom: 1px solid var(--if-border); background: rgba(255, 255, 255, 0.015); flex-wrap: wrap; }
.ib-lead-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ib-lead-item span { font-size: 10.5px; color: var(--if-text-faint); text-transform: uppercase; letter-spacing: .05em; font-family: var(--if-mono); }
.ib-lead-item strong { font-size: 13px; color: var(--if-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; transition: color .3s ease; }
.ib-lead-item strong.is-changed { color: var(--if-brand-primary); }
.funnel { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.funnel i { width: 22px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); transition: background-color .4s ease, box-shadow .4s ease; }
.funnel i.is-on { background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }

.ib-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.ib-messages > :first-child { margin-top: auto; }
.msg { max-width: min(440px, 78%); padding: 8px 11px 6px; border-radius: 14px; font: 400 13.5px/1.42 var(--if-sans); animation: msg-in .3s ease; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.is-in { align-self: flex-start; color: var(--if-text-strong); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-bottom-left-radius: 5px; }
.msg.is-out { align-self: flex-end; color: var(--if-text-strong); background: color-mix(in srgb, var(--if-brand-primary) 10%, transparent); border: 1px solid color-mix(in srgb, var(--if-brand-primary) 28%, transparent); border-bottom-right-radius: 5px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg footer { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 3px; font: 400 10.5px/1 var(--if-mono); color: var(--if-text-faint); }
.msg .ai { color: #c4b5fd; display: inline-flex; align-items: center; gap: 3px; }
.msg.is-typing { display: inline-flex; gap: 4px; padding: 11px 13px; align-self: flex-end; }
.msg.is-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--if-brand-primary); opacity: .35; animation: ph-dot 1.2s ease-in-out infinite; }
.msg.is-typing i:nth-child(2) { animation-delay: .2s; }
.msg.is-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ph-dot { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
.ib-day { align-self: center; font: 500 11px/1 var(--if-mono); color: var(--if-text-faint); padding: 5px 10px; border-radius: 7px; border: 1px solid var(--if-border); margin-bottom: 4px; }

.ib-composer { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--if-border); }
.ib-composer .fake-input { flex: 1; height: 38px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--if-text-faint); border: 1px solid var(--if-border); background: rgba(255, 255, 255, 0.02); }
.ib-composer .fake-input i { color: #c4b5fd; }

.ib-empty { margin: auto; text-align: center; color: var(--if-text-faint); font-size: 13.5px; padding: 30px; }
.ib-empty i { display: block; font-size: 28px; margin-bottom: 10px; color: var(--if-text-muted); }

/* ------------------------------------------------------------ Pipeline */
.pl-board { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 10px; padding: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.pl-col { display: flex; flex-direction: column; min-height: 0; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.022); }
.pl-col-head { padding: 11px 12px 9px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); background: rgba(8, 25, 44, .9); border-radius: 14px 14px 0 0; }
.pl-col-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--if-text-strong); }
.pl-col-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.pl-col-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; font: 500 11.5px/1 var(--if-mono); color: var(--if-text-muted); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07); }
.pl-col-total { display: block; margin-top: 5px; font: 500 12.5px/1 var(--if-mono); color: var(--if-text-muted); font-variant-numeric: tabular-nums; }
.pl-cards { flex: 1; min-height: 0; overflow-y: auto; padding: 9px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: none; }
.pl-cards::-webkit-scrollbar { display: none; }

.pl-card {
  position: relative; padding: 10px 11px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.045);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
  will-change: transform;
}
.pl-card:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, .14); }
.pl-card.is-live { border-color: color-mix(in srgb, var(--if-brand-primary) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--if-brand-primary) 30%, transparent), 0 10px 28px -14px color-mix(in srgb, var(--if-brand-primary) 70%, transparent); background: color-mix(in srgb, var(--if-brand-primary) 7%, rgba(255,255,255,.03)); }
.pl-card.is-enter { animation: pl-enter .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes pl-enter { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.pl-card.is-flash { animation: pl-flash 1.6s ease; }
@keyframes pl-flash { 0%, 40% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--if-brand-primary)) 60%, transparent), 0 0 24px -4px var(--c, var(--if-brand-primary)); } 100% { box-shadow: none; } }
.pl-card.is-live.is-flash { animation-name: pl-flash-live; }
@keyframes pl-flash-live { 0%, 40% { box-shadow: 0 0 0 2px var(--if-brand-primary), 0 0 30px -4px var(--if-brand-primary); } }
.pl-card.is-won::after {
  content: ""; position: absolute; inset: -1px; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-ganado) 50%, transparent);
}
.pl-card-head { display: flex; align-items: center; gap: 9px; }
.pl-card .avatar { width: 30px; height: 30px; font-size: 11px; }
.pl-card .avatar .ch { width: 14px; height: 14px; font-size: 8px; right: -4px; bottom: -4px; }
.pl-card-who { flex: 1; min-width: 0; }
.pl-card-who strong { display: block; font-size: 13px; font-weight: 600; color: var(--if-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-who small { display: block; font: 400 11px/1.3 var(--if-mono); color: var(--if-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-deal { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.pl-product { min-width: 0; font: 500 10.5px/1 var(--if-mono); padding: 4px 7px; border-radius: 6px; color: var(--if-text-muted); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-amount { flex: none; font: 600 13px/1 var(--if-display); color: var(--if-text-strong); font-variant-numeric: tabular-nums; }
.pl-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11px; color: var(--if-text-faint); }
.pl-card-foot .unread { color: var(--if-brand-primary); display: inline-flex; align-items: center; gap: 4px; }

/* ------------------------------------------------------------ Avisos */
.crm-toasts { position: absolute; right: 14px; bottom: 14px; z-index: 20; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(320px, calc(100% - 28px)); }
.toast {
  --t: var(--if-brand-primary);
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; pointer-events: auto;
  border: 1px solid color-mix(in srgb, var(--t) 40%, transparent);
  background: color-mix(in srgb, var(--t) 7%, rgba(8, 22, 40, 0.97));
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .7);
  animation: toast-in .4s cubic-bezier(.2, .8, .2, 1);
}
.toast.is-out { animation: toast-out .35s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
.toast > i { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent); }
.toast div { min-width: 0; }
.toast strong { display: block; font-size: 13px; color: var(--if-text-strong); }
.toast span { display: block; font-size: 12px; color: var(--if-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast button { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--t); font: 600 12px/1 var(--if-sans); cursor: pointer; }
.toast.is-success { --t: var(--if-success); }
.toast.is-lead { --t: var(--if-info); }
.toast.is-move { --t: var(--if-brand-secondary); }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1500px) {
  .kpi.is-secondary { display: none; }
  .crm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .ib-list { width: 240px; }
}
@media (max-width: 760px) {
  .crm { grid-template-columns: 1fr; border-radius: 14px; }
  .crm-rail { display: none; }
  .crm-top { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .crm-tabs { margin-left: 0; width: 100%; }
  .crm-tab { flex: 1; justify-content: center; }
  .crm-kpis { padding: 10px 12px; gap: 6px; }
  .kpi { padding: 8px 9px; }
  .kpi span { font-size: 10.5px; }
  .kpi span i { display: none; }
  .kpi strong { font-size: 15.5px; }
  .ai-pill { display: none; }
  .ib-chat-head { padding: 10px 12px; gap: 9px; }
  .ib-chat-head .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .ib-lead { padding: 8px 12px; gap: 12px; }
  .ib-messages { padding: 12px; }
  .msg { max-width: 86%; }
  .ib-list { width: 100%; border-right: 0; }
  .crm-view.is-chat-open .ib-list { display: none; }
  .crm-view:not(.is-chat-open) .ib-chat { display: none; }
  .ib-back { display: inline-grid !important; }
  .pl-board { grid-auto-columns: 78%; scroll-snap-type: x mandatory; }
  .pl-col { scroll-snap-align: start; }
}
.ib-back { display: none; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--if-border); background: transparent; color: var(--if-text-muted); cursor: pointer; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
