/* CRM Bynari · base */
:root {
  --crm-azul: #134486;
  --crm-turquesa: #00aeb5;
  --crm-azul-osc: #0d3266;
  --crm-fondo: #f3f5f9;
  /* nombres usados por las vistas del embudo/chat */
  --siga-verde: #134486;
  --siga-burdeo: #0d3266;
}
body { background: var(--crm-fondo); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .9rem; color: #1f2329; }
body.con-menu { padding-left: 76px; }

.crm-lateral { position: fixed; inset: 0 auto 0 0; width: 76px; background: #fff; border-right: 1px solid #e6e8ee; display: flex; flex-direction: column; align-items: center; padding: .7rem 0; gap: .25rem; z-index: 1030; }
.crm-logo img { width: 46px; height: 46px; object-fit: contain; margin-bottom: .8rem; display: block; }
.crm-logo { text-decoration: none; }
.crm-nav { display: flex; flex-direction: column; align-items: center; gap: .1rem; width: 64px; padding: .45rem 0; border-radius: 10px; color: #6b7280; text-decoration: none; font-size: .66rem; }
.crm-nav i { font-size: 1.15rem; }
.crm-nav:hover { background: #f1f4ff; color: var(--crm-azul); }
.crm-nav.activo { background: #e8edff; color: var(--crm-azul); font-weight: 600; }

.crm-superior { height: 52px; display: flex; align-items: center; padding: 0 1.1rem; background: #fff; border-bottom: 1px solid #e6e8ee; position: sticky; top: 0; z-index: 1020; }
.crm-migas { font-size: .88rem; color: #374151; }
.crm-marca { font-size: 1.05rem; color: #374151; letter-spacing: -.01em; }
.crm-marca b { color: var(--crm-azul); }
.crm-yo { width: 32px; height: 32px; border-radius: 50%; background: var(--crm-azul); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.crm-main { padding: .75rem; }

.crm-card, .siga-card { border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.07); border-radius: 12px; }
.btn-crm, .btn-siga { background: var(--crm-azul); color: #fff; border: 0; }
.btn-crm:hover, .btn-crm:focus, .btn-siga:hover, .btn-siga:focus { background: var(--crm-azul-osc); color: #fff; }
.titulo-tabla { font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .8rem; color: #1f2329; border-left: 4px solid var(--crm-azul); padding-left: 8px; }

/* Ajustes de altura de las vistas a la barra superior de 52px */
body.pagina-embudo .embudo-tablero { height: calc(100vh - 150px); }
body.pagina-embudo .embudo-lista { max-height: calc(100vh - 150px); }
body.pagina-chat .chat-app { height: calc(100vh - 80px); }
.tabla-embudo thead th { background: #1f2937; }

/* Login */
body.pagina-login { background: #070b1a; }
body.pagina-login .crm-main { padding: 0; }
.lg { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; color: #e7eaf6; }
.lg-fondo { position: absolute; inset: 0; background:
  linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 44px 44px, #070b1a; }
.lg-luz { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: flotar 14s ease-in-out infinite alternate; }
.lg-luz.l1 { width: 520px; height: 520px; background: #134486; left: -120px; top: -140px; }
.lg-luz.l2 { width: 420px; height: 420px; background: #00aeb5; left: 38%; bottom: -180px; animation-delay: -5s; }
.lg-luz.l3 { width: 300px; height: 300px; background: #06b6d4; left: 30%; top: 20%; opacity: .25; animation-delay: -9s; }
@keyframes flotar { to { transform: translate(60px, 40px) scale(1.08); } }

.lg-marca { position: relative; z-index: 1; padding: 3.2rem 3.5rem; display: flex; flex-direction: column; justify-content: center; }
.lg-logo { display: flex; align-items: center; gap: .6rem; font-size: 1.25rem; color: #fff; }
.lg-logo b { color: #8ea2ff; }
.lg-isotipo { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #3b5bfd, #8b5cf6); box-shadow: 0 8px 24px rgba(59,91,253,.45); }
.lg-marca h1 { font-size: clamp(2rem, 3.4vw, 3.1rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; color: #fff; margin: 2.2rem 0 1rem; }
.lg-resalte { background: linear-gradient(90deg, #2dd4da, #00aeb5, #6aa8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-bajada { color: #a7b0cf; max-width: 470px; font-size: 1rem; }

.lg-preview { position: relative; height: 300px; margin-top: 2.2rem; max-width: 560px; }
.lg-tarjeta { position: absolute; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 16px; padding: .9rem 1rem; box-shadow: 0 20px 50px rgba(0,0,0,.35); font-size: .82rem; color: #e7eaf6; animation: subir 6s ease-in-out infinite alternate; }
.lg-tarjeta.t1 { width: 330px; left: 0; top: 0; z-index: 2; }
.lg-tarjeta.t2 { width: 250px; right: 0; top: 30px; animation-delay: -2s; }
.lg-tarjeta.t3 { width: 230px; left: 110px; top: 160px; animation-delay: -4s; }
@keyframes subir { to { transform: translateY(-10px); } }
.lg-av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .72rem; color: #fff; }
.lg-chip { margin-left: auto; font-size: .62rem; padding: .1rem .45rem; border-radius: 6px; }
.lg-chip.rojo { background: rgba(239,68,68,.18); color: #fca5a5; }
.lg-msg { margin: .55rem 0; color: #cfd5ea; }
.lg-pie { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: #9aa3c4; }
.lg-sla { color: #fbbf24; }
.lg-mini-tit { font-size: .72rem; color: #9aa3c4; margin-bottom: .55rem; }
.lg-columnas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.lg-columnas div { display: flex; flex-direction: column; gap: .3rem; }
.lg-columnas span { font-size: .62rem; color: var(--c); font-weight: 600; white-space: nowrap; }
.lg-columnas i { height: 18px; border-radius: 5px; background: rgba(255,255,255,.12); }
.lg-kpi { font-size: 1.7rem; font-weight: 700; color: #fff; display: flex; align-items: baseline; gap: .5rem; }
.lg-kpi small { font-size: .72rem; color: #4ade80; font-weight: 600; }
.lg-barras { display: flex; align-items: flex-end; gap: 5px; height: 42px; margin-top: .4rem; }
.lg-barras i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #2dd4da, #00aeb5); }

.lg-lado { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.lg-form { width: 100%; max-width: 410px; background: #fff; color: #1f2329; border-radius: 22px; padding: 2.4rem 2.2rem; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.lg-saludo { font-size: .85rem; color: #6b7280; }
.lg-form h2 { font-weight: 700; letter-spacing: -.02em; font-size: 1.7rem; margin: .2rem 0 .3rem; }
.lg-sub { color: #6b7280; margin-bottom: 1.6rem; }
.lg-label { font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }
.lg-campo { position: relative; display: flex; align-items: center; margin-bottom: 1.1rem; }
.lg-campo > i { position: absolute; left: .95rem; color: #9ca3af; font-size: 1rem; pointer-events: none; }
.lg-campo input { width: 100%; height: 48px; border: 1.5px solid #e5e7eb; border-radius: 12px; padding: 0 2.8rem 0 2.6rem; font-size: .95rem; background: #f9fafb; transition: border-color .15s, box-shadow .15s, background .15s; }
.lg-campo input:focus { outline: none; border-color: #00aeb5; background: #fff; box-shadow: 0 0 0 4px rgba(0,174,181,.18); }
.lg-campo:focus-within > i { color: #00aeb5; }
.lg-ojo { position: absolute; right: .5rem; border: 0; background: transparent; color: #9ca3af; width: 36px; height: 36px; border-radius: 8px; }
.lg-ojo:hover { color: #374151; background: #f3f4f6; }
.lg-mayus { font-size: .75rem; color: #b45309; margin: -.6rem 0 .8rem; }
.lg-boton { width: 100%; height: 50px; border: 0; border-radius: 12px; color: #fff; font-weight: 600; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: linear-gradient(135deg, #134486, #0b7f9e 70%, #00aeb5); box-shadow: 0 10px 24px rgba(19,68,134,.35); transition: transform .15s, box-shadow .15s; margin-top: .4rem; }
.lg-boton:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(19,68,134,.45); }
.lg-boton:hover i { transform: translateX(3px); }
.lg-boton i { transition: transform .15s; }
.lg-boton:disabled { opacity: .8; transform: none; }
.lg-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; margin-bottom: 1rem; }
.lg-legal { text-align: center; font-size: .75rem; color: #9ca3af; margin-top: 1.4rem; }
@media (max-width: 991px) { .lg { grid-template-columns: 1fr; } .lg-marca { display: none; } .lg-form { padding: 2rem 1.5rem; } }
@media (prefers-reduced-motion: reduce) { .lg-luz, .lg-tarjeta { animation: none; } }

@media (max-width: 767px) {
  body.con-menu { padding-left: 0; padding-bottom: 64px; }
  .crm-lateral { inset: auto 0 0 0; width: auto; height: 62px; flex-direction: row; justify-content: space-around; padding: 0 .3rem; border-right: 0; border-top: 1px solid #e6e8ee; }
  .crm-logo, .crm-lateral form { display: none; }
  .crm-nav { width: auto; flex: 1; }
}

/* Logo de la empresa */
.crm-logo-empresa { height: 32px; width: auto; max-width: 160px; object-fit: contain; margin-right: .7rem; }
.logo-muestra { width: 170px; height: 90px; border: 1px dashed #cfd4de; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; background: #f9fafb; padding: 8px; }
.logo-muestra img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lg-logo-empresa { display: block; max-height: 96px; max-width: 240px; object-fit: contain; margin-bottom: 1.2rem; }

/* Marca Bynari */
.crm-marca-logo { height: 17px; width: auto; }
.crm-marca { font-size: .7rem; font-weight: 700; letter-spacing: .14em; color: var(--crm-turquesa); margin-left: -.6rem; border: 1px solid currentColor; border-radius: 5px; padding: 0 .3rem; }
.lg-logo-bynari { height: 70px; width: auto; }
.lg-crm { align-self: flex-end; font-weight: 700; letter-spacing: .2em; font-size: .85rem; color: #2dd4da; border: 1px solid rgba(45,212,218,.45); border-radius: 6px; padding: .1rem .45rem; margin-bottom: .4rem; }
.crm-nav.activo { box-shadow: inset 3px 0 0 var(--crm-turquesa); }
/* Esquina superior izquierda con el logo de la empresa (cabe en 60×60) */
.crm-logo.con-empresa img { width: 60px; height: 60px; object-fit: contain; border-radius: 10px; }
/* Fondo del logo de la empresa: los logos blancos van sobre un recuadro oscuro */
.crm-logo.con-empresa.fondo-oscuro img, .logo-muestra.fondo-oscuro, .lg-logo-empresa.fondo-oscuro { background: #0f1d36; }
.crm-logo.con-empresa.fondo-oscuro img { padding: 6px; }
.lg-logo-empresa.fondo-oscuro { padding: 10px 14px; border-radius: 12px; }
.logo-muestra.fondo-oscuro { border-color: #0f1d36; }

/* Horario por día (Ajustes) */
.horario-semana { display: flex; flex-direction: column; gap: .35rem; }
.horario-dia { display: grid; grid-template-columns: 130px 110px auto 110px 1fr; align-items: center; gap: .5rem; padding: .35rem .6rem; border: 1px solid #e6e8ee; border-radius: 10px; background: #fff; }
.horario-dia .texto-cerrado { display: none; }
.horario-dia.cerrado { background: #f6f7f9; }
.horario-dia.cerrado input[type="time"], .horario-dia.cerrado > span.text-muted:not(.texto-cerrado) { display: none; }
.horario-dia.cerrado .texto-cerrado { display: inline; grid-column: 2 / 5; }
@media (max-width: 575px) { .horario-dia { grid-template-columns: 1fr 1fr auto 1fr; } .horario-dia .form-switch { grid-column: 1 / -1; } }

/* Campana de notificaciones */
.crm-campana { position: relative; border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; color: #4b5563; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; }
.crm-campana:hover { background: #f1f4ff; color: var(--crm-azul); }
.crm-campana-num { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.crm-notif { width: 340px; padding: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.14); border: 1px solid #eceef2; }
#notifLista { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: .6rem; padding: .65rem .9rem; color: #1f2329; text-decoration: none; border-bottom: 1px solid #f3f4f6; font-size: .86rem; }
.notif-item:hover { background: #f7f8fa; }
.notif-item.nueva { background: #f0f6ff; }
.notif-item > .bi { color: var(--crm-azul); font-size: 1.1rem; }
.notif-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 3000; display: flex; align-items: center; gap: .6rem; background: #1f2937; color: #fff; text-decoration: none; padding: .75rem 1rem; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.3); max-width: 360px; animation: entraToast .25s ease-out; }
.notif-toast:hover { color: #fff; background: #111827; }
.notif-toast .bi { color: #fbbf24; }
@keyframes entraToast { from { opacity: 0; transform: translateY(10px); } }

/* Mi panel */
.panel-saludo { display: flex; align-items: center; gap: 1rem; background: #fff; border-radius: 12px; padding: 1rem 1.2rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.panel-kpi { display: flex; align-items: center; gap: .8rem; background: #fff; border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); height: 100%; }
.panel-kpi-ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex: 0 0 auto; }
.panel-kpi-num { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.panel-tabla tbody tr { cursor: pointer; }
.panel-tabla th { font-size: .74rem; color: #6b7280; font-weight: 600; }
.panel-etapa { font-size: .74rem; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); padding: .15rem .5rem; border-radius: 6px; white-space: nowrap; }
.panel-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .3rem; border-bottom: 1px solid #f1f2f5; color: #1f2329; text-decoration: none; font-size: .87rem; }
.panel-item:hover { background: #f7f8fa; }
.panel-fecha { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: #eef4ff; color: var(--crm-azul); font-size: .7rem; text-transform: uppercase; flex: 0 0 auto; line-height: 1.1; }
.panel-fecha b { font-size: 1.05rem; }

/* Aviso lateral de mensaje nuevo (estilo WhatsApp) */
.msg-avisos { position: fixed; right: 1rem; top: 64px; z-index: 3500; display: flex; flex-direction: column; gap: .55rem; width: 340px; max-width: calc(100vw - 2rem); pointer-events: none; }
.msg-aviso { pointer-events: auto; position: relative; display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 2rem .7rem .75rem; background: #fff; border-radius: 14px; text-decoration: none; color: #1f2329;
  box-shadow: 0 10px 30px rgba(16,24,40,.18); border-left: 4px solid #25d366; opacity: 0; transform: translateX(30px); transition: opacity .25s, transform .25s; }
.msg-aviso.visible { opacity: 1; transform: none; }
.msg-aviso:hover { color: #1f2329; box-shadow: 0 14px 36px rgba(16,24,40,.24); }
.msg-av { position: relative; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }
.msg-av .bi { position: absolute; right: -3px; bottom: -3px; background: #fff; border-radius: 50%; font-size: .8rem; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.msg-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-cab { display: flex; align-items: center; gap: .5rem; }
.msg-cab b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-hora { margin-left: auto; font-size: .7rem; color: #25a35a; font-weight: 600; white-space: nowrap; }
.msg-texto { font-size: .84rem; color: #4b5563; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.msg-cuenta { position: absolute; right: .7rem; bottom: .65rem; background: #25d366; color: #fff; font-size: .68rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.msg-cerrar { position: absolute; top: .35rem; right: .45rem; border: 0; background: transparent; color: #9ca3af; font-size: 1.15rem; line-height: 1; padding: 0 .2rem; }
.msg-cerrar:hover { color: #374151; }
.notif-opciones { display: flex; flex-direction: column; gap: .35rem; padding: .6rem .9rem; border-top: 1px solid #f0f1f4; background: #fafbfc; }
@media (max-width: 575px) { .msg-avisos { top: auto; bottom: 74px; right: .5rem; } }

/* Ojito en los campos de contraseña */
.campo-clave { position: relative; }
.campo-clave input { padding-right: 2.4rem; }
.btn-ojo { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); border: 0; background: transparent; color: #6b7280; width: 30px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.btn-ojo:hover { background: #f1f3f6; color: #111827; }
