/* ============================================================
   heka-conectatech.css — ConectaTech · Squad TI
   Encapsulado bajo .ct-root / #modal-ct-* (no toca nada global).
   Paleta del sistema: #05080D #0D151E #111B25 #161A26 #FFD000
   #F5B914 #E8EDF3 #8C9AAA #9AA4B3 #25313D #232937.
   ============================================================ */

/* ---------- Panel ---------- */
.ct-root .ct-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, #12151f, #0b0f17);
  border: 2px solid #f5b914; border-radius: 16px;
  box-shadow: 0 0 30px rgba(245, 185, 20, .1);
}
.ct-root .ct-hero-icon {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, #f5b914, #e1a400); color: #0a0e14;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 0 18px rgba(245, 185, 20, .3);
}
.ct-root .ct-hero h1 { margin: 0 0 3px; font-size: 21px; font-weight: 800; color: #e8edf3; letter-spacing: .04em; }
.ct-root .ct-hero p { margin: 0; font-size: 12.5px; color: #9aa4b3; }
.ct-root .ct-hero-acciones { margin-left: auto; display: flex; gap: 10px; }

.ct-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 800; letter-spacing: .03em;
  transition: filter .2s, transform .2s;
}
.ct-btn:disabled { opacity: .5; cursor: default; }
.ct-btn--dorado { background: linear-gradient(135deg, #F5B914, #E1A400); color: #0a0e14; box-shadow: 0 4px 14px rgba(245,185,20,.22); }
.ct-btn--verde  { background: rgba(46,204,113,.14); color: #2ecc71; border: 1px solid rgba(46,204,113,.5); }
.ct-btn--rojo   { background: rgba(255,71,87,.12); color: #ff4757; border: 1px solid rgba(255,71,87,.5); }
.ct-btn--gris   { background: #161a26; color: #9aa4b3; border: 1px solid #232937; }
.ct-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

/* filtros */
.ct-root .ct-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ct-root .ct-filtro {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: #111b25; color: #9aa4b3; border: 1px solid #25313d;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; transition: all .2s;
}
.ct-root .ct-filtro--activo, .ct-root .ct-filtro:hover {
  background: rgba(245,185,20,.1); color: #F5B914; border-color: rgba(245,185,20,.55);
}

/* tarjetas de ticket */
.ct-root .ct-lista { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.ct-root .ct-ticket {
  background: #12151f; border: 1px solid #232937; border-radius: 14px;
  padding: 13px 15px; cursor: pointer; transition: border-color .2s, transform .2s; position: relative;
}
.ct-root .ct-ticket:hover { border-color: #f5b914; transform: translateY(-1px); }
.ct-root .ct-ticket-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.ct-root .ct-num { color: #F5B914; font-weight: 800; font-size: 13px; }
.ct-root .ct-ticket-tema { color: #e8edf3; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.ct-root .ct-ticket-meta { color: #9aa4b3; font-size: 12px; }
.ct-root .ct-ticket-parts { color: #6f7a89; font-size: 11px; margin-top: 4px; }
.ct-root .ct-ticket-fecha { color: #4d5766; font-size: 10.5px; margin-top: 6px; }

/* badges de estado / prioridad */
.ct-prio, .ct-estado {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.ct-prio--inm { background: rgba(255,71,87,.12); color: #ff4757; border: 1px solid rgba(255,71,87,.55); }
.ct-prio--h24 { background: rgba(253,126,20,.12); color: #fd7e14; border: 1px solid rgba(253,126,20,.55); }
.ct-prio--h48 { background: rgba(90,160,255,.1); color: #5aa0ff; border: 1px solid rgba(90,160,255,.45); }
.ct-estado--pend { background: rgba(154,164,179,.1); color: #b9c2cf; border: 1px solid rgba(154,164,179,.4); }
.ct-estado--gest { background: rgba(245,185,20,.12); color: #F5B914; border: 1px solid rgba(245,185,20,.55); }
.ct-estado--ok   { background: rgba(46,204,113,.1); color: #2ecc71; border: 1px solid rgba(46,204,113,.55); }
.ct-estado--mal  { background: rgba(255,71,87,.1); color: #ff4757; border: 1px solid rgba(255,71,87,.55); }
.ct-badge-rojo {
  margin-left: auto; background: #ff4757; color: #fff; border-radius: 999px;
  min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; padding: 0 6px;
}

/* squad admin */
.ct-root .ct-squad-caja {
  background: #12151f; border: 1px solid #232937; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
}
.ct-root .ct-squad-caja h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .16em; color: #F5B914; text-transform: uppercase; }
.ct-root .ct-squad-agregar { display: flex; gap: 8px; margin-bottom: 10px; }
.ct-root .ct-squad-agregar input {
  flex: 1; background: #0d1118; border: 1px solid #232937; color: #e8edf3;
  border-radius: 9px; padding: 8px 12px; font-size: 13px;
}
.ct-root .ct-miembro {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 11px; background: #161a26; border: 1px solid #232937; border-radius: 9px;
  margin-bottom: 6px; color: #e8edf3; font-size: 12.5px;
}
.ct-root .ct-miembro small { color: #6f7a89; }
.ct-mini-btn { background: none; border: none; cursor: pointer; color: #9aa4b3; padding: 4px 6px; border-radius: 7px; }
.ct-mini-btn--rojo:hover { color: #ff4757; background: rgba(255,71,87,.1); }

/* vacíos / carga */
.ct-root .ct-vacio, .ct-root .ct-cargando {
  grid-column: 1/-1; text-align: center; color: #6f7a89; padding: 34px 10px; font-size: 13px;
}
.ct-root .ct-vacio i { font-size: 30px; color: #2c3542; }
.ct-root .ct-vacio-mini { color: #6f7a89; font-size: 12px; padding: 6px 2px; }

/* ---------- Modales ---------- */
#modal-ct-nuevo .modal-content, #modal-ct-chat .modal-content, #modal-ct-etiquetar .modal-content {
  background: #0c1018; border: 1px solid #232937; border-radius: 16px;
  max-width: 640px; width: calc(100vw - 28px); color: #e8edf3;
  animation: ctEntrada .25s ease-out;
}
#modal-ct-chat .modal-content { max-width: 860px; height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden; }
@keyframes ctEntrada { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.ct-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; background: #12151f; border-bottom: 1px solid #232937;
}
.ct-modal-header h2 { margin: 0; font-size: 16px; font-weight: 800; color: #e8edf3; }
.ct-modal-header .ct-cerrar {
  width: 38px; height: 38px; border-radius: 10px; background: #161a26; color: #9aa4b3;
  border: 1px solid #232937; font-size: 20px; cursor: pointer; transition: all .2s;
}
.ct-modal-header .ct-cerrar:hover { color: #F5B914; border-color: #f5b914; }

.ct-modal-body { padding: 18px; overflow-y: auto; }
.ct-modal-body::-webkit-scrollbar { width: 8px; }
.ct-modal-body::-webkit-scrollbar-thumb { background: #232937; border-radius: 8px; }

.ct-campo { margin-bottom: 14px; }
.ct-campo label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .16em; color: #9aa4b3; text-transform: uppercase; margin-bottom: 6px; }
.ct-campo input[type="text"], .ct-campo textarea, .ct-campo select {
  width: 100%; background: #0d1118; border: 1px solid #232937; color: #e8edf3;
  border-radius: 10px; padding: 10px 13px; font-size: 13.5px;
}
.ct-campo textarea { min-height: 90px; resize: vertical; }

/* prioridad como chips de radio */
.ct-prio-opciones { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-prio-opciones label {
  flex: 1; min-width: 120px; text-align: center; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; background: #111b25; border: 1px solid #25313d;
  font-size: 12px; font-weight: 700; color: #9aa4b3; letter-spacing: .04em; transition: all .2s;
}
.ct-prio-opciones input { display: none; }
.ct-prio-opciones input:checked + span { color: #F5B914; }
.ct-prio-opciones label:has(input:checked) { border-color: #f5b914; background: rgba(245,185,20,.08); color: #F5B914; }

/* chips de etiquetado */
.ct-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 13px; border-radius: 999px; background: #111b25; color: #9aa4b3;
  border: 1px solid #25313d; font-size: 12px; font-weight: 600; transition: all .2s;
}
.ct-chip--on { background: rgba(245,185,20,.12); color: #F5B914; border-color: rgba(245,185,20,.6); }
.ct-adj-item { color: #9aa4b3; font-size: 12px; padding: 4px 0; }
.ct-adj-prev { margin-top: 8px; }

/* ---------- Chat ---------- */
#ct-chat-mensajes {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  background: radial-gradient(900px 300px at 50% -60px, rgba(245,185,20,.04), transparent 70%), #0a0e14;
  display: flex; flex-direction: column; gap: 10px;
}
#ct-chat-mensajes::-webkit-scrollbar { width: 8px; }
#ct-chat-mensajes::-webkit-scrollbar-thumb { background: #232937; border-radius: 8px; }

.ct-msg { max-width: 72%; border-radius: 14px; padding: 9px 13px; position: relative; }
.ct-msg--mio {
  align-self: flex-end; background: linear-gradient(150deg, #1c2433, #151d29);
  border: 1px solid rgba(245,185,20,.35); border-bottom-right-radius: 4px;
}
.ct-msg--otro {
  align-self: flex-start; background: #161a26; border: 1px solid #232937; border-bottom-left-radius: 4px;
}
.ct-msg-autor { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #9aa4b3; text-transform: uppercase; margin-bottom: 3px; }
.ct-msg--mio .ct-msg-autor { color: rgba(245,185,20,.75); }
.ct-msg-texto { font-size: 13.5px; color: #e8edf3; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.ct-msg-hora { font-size: 9.5px; color: #4d5766; text-align: right; margin-top: 3px; }

/* barra de entrada */
.ct-chat-inputbar {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px;
  background: #12151f; border-top: 1px solid #232937;
}
.ct-chat-inputbar textarea {
  flex: 1; background: #0d1118; border: 1px solid #232937; color: #e8edf3;
  border-radius: 12px; padding: 10px 14px; font-size: 13.5px; resize: none;
  min-height: 42px; max-height: 110px; font-family: inherit;
}
.ct-icon-btn {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; cursor: pointer;
  background: #161a26; color: #9aa4b3; border: 1px solid #232937; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center; transition: all .2s;
}
.ct-icon-btn:hover { color: #F5B914; border-color: #f5b914; }
.ct-icon-btn--enviar { background: linear-gradient(135deg, #F5B914, #E1A400); color: #0a0e14; border: none; }
.ct-icon-btn--enviar:hover { filter: brightness(1.1); color: #0a0e14; }

/* emoji picker */
#ct-emojis {
  display: none; flex-wrap: wrap; gap: 4px; padding: 10px;
  background: #12151f; border-top: 1px solid #232937; max-height: 150px; overflow-y: auto;
}
.ct-emoji {
  background: none; border: none; cursor: pointer; font-size: 20px; padding: 5px 7px; border-radius: 8px;
}
.ct-emoji:hover { background: #1a1f2e; }

/* header del chat */
#ct-chat-header-info { min-width: 0; }
.ct-chat-tema { font-size: 15.5px; font-weight: 800; color: #e8edf3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.ct-chat-sub { display: flex; align-items: center; gap: 7px; margin-top: 4px; flex-wrap: wrap; }
.ct-chat-creador { color: #9aa4b3; font-size: 11.5px; }
#ct-chat-acciones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#ct-chat-adjuntos { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 14px; background: #0d1118; border-bottom: 1px solid #232937; }
.ct-adj-link {
  color: #F5B914; font-size: 12px; text-decoration: none; background: rgba(245,185,20,.08);
  border: 1px solid rgba(245,185,20,.3); border-radius: 999px; padding: 4px 11px;
}
.ct-adj-link:hover { filter: brightness(1.15); }

/* badge del menú */
#ct-badge-nav {
  display: none; margin-left: 6px; background: #ff4757; color: #fff;
  border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 800;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ct-root .ct-lista { grid-template-columns: 1fr; }
  .ct-root .ct-hero { flex-wrap: wrap; }
  .ct-root .ct-hero-acciones { margin-left: 0; width: 100%; }
  .ct-msg { max-width: 88%; }
  #modal-ct-chat .modal-content { height: calc(100vh - 24px); }
  .ct-chat-tema { max-width: 200px; font-size: 13.5px; }
}

/* ---------- fotos y buscador (ConectaTech v2) ---------- */
.ct-foto {
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1.5px solid rgba(245,185,20,.45); display: inline-flex; vertical-align: middle;
  background: #0d1118; overflow: hidden;
}
.ct-foto--avatar { align-items: center; justify-content: center; color: #6f7a89; border-style: dashed; }
.ct-root .ct-miembro-nombre { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.ct-chip { padding: 5px 13px 5px 6px; }
.ct-chip .ct-foto { border-color: #25313d; }
.ct-chip--on .ct-foto { border-color: #f5b914; }
.ct-chip-nombre { font-size: 12px; }
.ct-candidato {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; background: #161a26; border: 1px solid #232937;
  border-radius: 11px; margin-bottom: 7px;
}
.ct-candidato-datos { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ct-candidato-datos b { color: #e8edf3; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-candidato-datos small { color: #6f7a89; font-size: 11px; }
#ct-squad-resultados { margin-bottom: 10px; }
@media (max-width: 900px) { .ct-candidato { flex-wrap: wrap; } }

/* etiquetar SIEMPRE por delante del chat abierto */
.modal-overlay#modal-ct-etiquetar { z-index: 9800; }
.modal-overlay#modal-ct-chat { z-index: 9600; }
.modal-overlay#modal-ct-nuevo { z-index: 9700; }

/* mensaje de sistema: la descripción del ticket, centrada en el chat */
.ct-msg--sistema {
  align-self: center; max-width: 86%; text-align: center;
  background: rgba(245,185,20,.07); border: 1px dashed rgba(245,185,20,.4);
  border-radius: 14px; padding: 12px 16px;
}
.ct-msg--sistema .ct-msg-titulo {
  font-size: 10px; font-weight: 800; letter-spacing: .18em; color: #F5B914;
  text-transform: uppercase; margin-bottom: 6px;
}
.ct-msg--sistema .ct-msg-texto { text-align: center; color: #d7dee8; font-size: 13px; }

/* ---------- chat v4: permisos y pulido ---------- */
.ct-chat-inputbar.ct-input-bloqueado { opacity: .55; }
.ct-chat-inputbar.ct-input-bloqueado textarea { cursor: not-allowed; }
.ct-tomado-por {
  display: inline-flex; align-items: center; gap: 6px;
  color: #9aa4b3; font-size: 12px; font-weight: 700;
  background: #161a26; border: 1px solid #232937;
  border-radius: 999px; padding: 7px 14px;
}
.ct-tomado-por i { color: #2ecc71; }
.ct-root .ct-chat-creador { white-space: nowrap; }
.ct-msg--sistema .ct-msg-texto { max-height: 160px; overflow-y: auto; }
.ct-msg--sistema { animation: ctFade .3s ease-out; }
@keyframes ctFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#ct-chat-input { transition: background .2s; }
#ct-chat-input:disabled { background: #0a0d13; }

/* ---------- v5: vistos, SLA, avatares, filtros numerados ---------- */
.ct-visto { margin-left: 4px; color: #333; font-size: 13px; }
.ct-visto--enviado { color: #111; }
.ct-visto--leido { color: #E8A317; } /* amarillo quemado */

.ct-sla {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.ct-sla--ok {
  background: rgba(46,204,113,.1); color: #2ecc71;
  border: 1px solid rgba(46,204,113,.5);
}
.ct-sla--fuera {
  background: rgba(255,71,87,.12); color: #ff4757;
  border: 1px solid rgba(255,71,87,.55);
  animation: ctPulso 2.2s infinite;
}
@keyframes ctPulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,71,87,.25); }
  50% { box-shadow: 0 0 0 4px rgba(255,71,87,.08); }
}
.ct-root .ct-ticket-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.ct-avatares { display: inline-flex; align-items: center; }
.ct-avatares .ct-foto { margin-left: -7px; border: 2px solid #12151f; }
.ct-avatares .ct-foto:first-child { margin-left: 0; }
.ct-avatares-mas {
  margin-left: 5px; font-size: 10px; font-weight: 800; color: #9aa4b3;
  background: #161a26; border: 1px solid #232937; border-radius: 999px;
  padding: 2px 7px;
}

.ct-ya-tag {
  display: inline-flex; align-items: center; gap: 5px;
  color: #2ecc71; font-size: 11px; font-weight: 800;
  border: 1px dashed rgba(46,204,113,.5); border-radius: 999px; padding: 6px 12px;
}

/* ---------- modal etiquetar PREMIUM ---------- */
#modal-ct-etiquetar .modal-content {
  background: linear-gradient(180deg, #12151f, #0c1018);
  border: 1px solid #f5b914;
  box-shadow: 0 0 44px rgba(245,185,20,.14), 0 30px 80px rgba(0,0,0,.7);
  overflow: hidden;
}
#modal-ct-etiquetar .ct-modal-header {
  background: linear-gradient(135deg, #101a24, #071018);
  border-bottom: 1px solid rgba(245,185,20,.3);
}
#modal-ct-etiquetar .ct-modal-header h2 { display: flex; align-items: center; gap: 11px; }
#modal-ct-etiquetar .ct-eti-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #f5b914, #e1a400); color: #0a0e14;
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
  box-shadow: 0 0 16px rgba(245,185,20,.35);
}
#modal-ct-etiquetar .ct-modal-body { background: radial-gradient(700px 220px at 50% -40px, rgba(245,185,20,.05), transparent 70%), #0a0e14; }
#modal-ct-etiquetar .ct-squad-agregar input {
  border: 1px solid #25313d; border-radius: 12px; padding: 12px 15px; font-size: 13.5px;
  background: #0d1118; color: #e8edf3;
}
#modal-ct-etiquetar .ct-squad-agregar input:focus { border-color: #f5b914; outline: none; box-shadow: 0 0 0 3px rgba(245,185,20,.12); }
#modal-ct-etiquetar .ct-candidato {
  border: 1px solid #232937;
  background: linear-gradient(135deg, #161a26, #11151f);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  animation: ctFade .25s ease-out both;
}
#modal-ct-etiquetar .ct-candidato:hover { border-color: rgba(245,185,20,.55); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
#modal-ct-etiquetar .ct-candidato--ya { opacity: .65; border-style: dashed; }
#modal-ct-etiquetar .ct-vacio-mini { text-align: center; padding: 14px; }
.ct-eti-hint {
  margin-top: 12px; text-align: center; color: #4d5766; font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase;
}

/* v6: tarjeta con mensajes sin leer */
.ct-root .ct-ticket--nuevo { border-color: rgba(255,71,87,.6); animation: ctNuevoTicket 2.4s infinite; }
@keyframes ctNuevoTicket {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,71,87,.18); }
  50% { box-shadow: 0 0 0 5px rgba(255,71,87,.06); }
}


/* ---- refresco silencioso (sin texto "Cargando") ---- */
.ct-root .ct-lista.ct-lista--refrescando {
  opacity: .72;
  transition: opacity .25s ease;
  pointer-events: none;
}
.ct-root .ct-skeleton {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ct-root .ct-skeleton-card {
  height: 92px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.07) 50%, rgba(255,255,255,.03) 100%);
  background-size: 200% 100%;
  animation: ctShimmer 1.2s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,.05);
}
@keyframes ctShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (max-width: 900px) {
  .ct-root .ct-skeleton { grid-template-columns: 1fr; }
}

/* badge menú: forzar visibilidad cuando hay conteo */
#ct-badge-nav.ct-badge-nav--on {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* ============================================================
   CHAT FUTURISTA + VISOR DE SOPORTES
   ============================================================ */
#modal-ct-chat.modal-overlay {
  background: radial-gradient(ellipse at 30% 20%, rgba(245,185,20,.08), transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(90,160,255,.06), transparent 45%),
              rgba(2, 6, 12, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#modal-ct-chat .modal-content.ct-chat-shell {
  max-width: 920px;
  height: min(92vh, 860px);
  background: linear-gradient(165deg, rgba(14,18,28,.97), rgba(8,11,18,.98));
  border: 1px solid rgba(245,185,20,.18);
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 30px 90px rgba(0,0,0,.65), 0 0 60px rgba(245,185,20,.06);
  overflow: hidden;
}
#modal-ct-chat .ct-chat-header {
  background: linear-gradient(180deg, rgba(22,26,38,.95), rgba(14,18,28,.9));
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 14px 16px;
  gap: 10px;
  flex-wrap: wrap;
}
#modal-ct-chat .ct-chat-tema {
  background: linear-gradient(90deg, #fff, #F5B914);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 16px;
  letter-spacing: -.02em;
}
#ct-chat-mensajes.ct-chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(600px 200px at 10% 0%, rgba(245,185,20,.04), transparent 60%),
    radial-gradient(500px 180px at 90% 100%, rgba(90,160,255,.04), transparent 55%),
    #0a0e14;
}
#ct-chat-mensajes::-webkit-scrollbar { width: 6px; }
#ct-chat-mensajes::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(245,185,20,.35), rgba(90,160,255,.25));
  border-radius: 8px;
}

/* Burbujas */
.ct-msg {
  max-width: 74%;
  border-radius: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  animation: ctMsgIn .28s ease-out;
}
@keyframes ctMsgIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.ct-msg-burbuja {
  padding: 11px 14px 8px;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.ct-msg--mio {
  align-self: flex-end;
  margin-left: auto;
}
.ct-msg--mio .ct-msg-burbuja {
  background: #F8F4E9; /* blanco marfil */
  border: 1px solid rgba(200,190,170,.4);
  border-bottom-right-radius: 5px;
  color: #1a1a1a;
}
.ct-msg--otro {
  align-self: flex-start;
}
.ct-msg--otro .ct-msg-burbuja {
  background: linear-gradient(145deg, rgba(30,38,52,.95), rgba(18,24,34,.9));
  border: 1px solid rgba(255,255,255,.07);
  border-bottom-left-radius: 5px;
}
.ct-msg--sistema {
  align-self: center;
  max-width: 88%;
  margin: 4px auto 10px;
}
.ct-msg--sistema .ct-msg-burbuja,
.ct-msg.ct-msg--sistema {
  background: linear-gradient(145deg, rgba(90,160,255,.08), rgba(14,20,30,.9)) !important;
  border: 1px dashed rgba(90,160,255,.3) !important;
  border-radius: 16px !important;
  padding: 12px 16px !important;
  box-shadow: none;
}
.ct-msg-autor {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #8b98a8;
}
.ct-msg--mio .ct-msg-autor { color: rgba(245,185,20,.85); }
.ct-msg-texto {
  font-size: 13.5px;
  color: #e8edf3;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.ct-msg-hora {
  font-size: 10px;
  color: #5a6575;
  text-align: right;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.ct-visto--leido { color: #E8A317; } /* amarillo quemado */

/* Input bar glass */
#modal-ct-chat .ct-chat-inputbar {
  background: linear-gradient(180deg, rgba(16,20,30,.9), rgba(12,16,24,.98));
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px 14px 14px;
  gap: 10px;
}
#modal-ct-chat .ct-chat-inputbar textarea {
  background: rgba(8,12,18,.9);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
#modal-ct-chat .ct-chat-inputbar textarea:focus {
  outline: none;
  border-color: rgba(245,185,20,.45);
  box-shadow: 0 0 0 3px rgba(245,185,20,.1);
}
#modal-ct-chat .ct-icon-btn {
  border-radius: 14px;
  width: 44px; height: 44px;
  background: rgba(22,26,38,.9);
}
#modal-ct-chat .ct-icon-btn--enviar {
  background: linear-gradient(135deg, #F5B914, #e09a00);
  box-shadow: 0 6px 20px rgba(245,185,20,.28);
}

/* Chips de soportes en el chat */
#ct-chat-adjuntos.ct-chat-adjuntos {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 14px;
  background: rgba(8,12,18,.85);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ct-adj-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6f7a89;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ct-adj-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(245,185,20,.28);
  background: linear-gradient(135deg, rgba(245,185,20,.1), rgba(245,185,20,.03));
  color: #f0d78a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  max-width: 220px;
}
.ct-adj-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-adj-chip:hover {
  border-color: rgba(245,185,20,.6);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245,185,20,.15);
}
.ct-adj-chip i { font-size: 14px; color: #F5B914; }

/* ---------- VISOR MODAL ---------- */
#modal-ct-visor {
  z-index: 9900;
  background: rgba(2,6,12,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#modal-ct-visor .ct-visor-shell {
  max-width: min(960px, calc(100vw - 24px));
  width: 100%;
  height: min(90vh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #0e1420, #080c14);
  border: 1px solid rgba(245,185,20,.22);
  border-radius: 20px;
  box-shadow: 0 30px 100px rgba(0,0,0,.7), 0 0 40px rgba(245,185,20,.08);
  overflow: hidden;
  color: #e8edf3;
  animation: ctEntrada .28s ease-out;
}
.ct-visor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(24,30,42,.95), rgba(14,18,28,.9));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ct-visor-titulo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ct-visor-ico {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(245,185,20,.2), rgba(245,185,20,.05));
  border: 1px solid rgba(245,185,20,.35);
  color: #F5B914; font-size: 18px; flex-shrink: 0;
}
.ct-visor-label {
  font-size: 10px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: #6f7a89;
}
.ct-visor-nombre {
  font-size: 14px; font-weight: 700; color: #e8edf3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.ct-visor-acciones { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ct-visor-cuerpo {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(245,185,20,.05), transparent 50%),
    #070a10;
  overflow: hidden;
}
.ct-visor-media {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto;
}
.ct-visor-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.06);
}
.ct-visor-iframe {
  width: 100%; height: 100%;
  border: 0; background: #111;
}
.ct-visor-pre {
  width: 100%; height: 100%; margin: 0; padding: 18px 20px;
  overflow: auto; font-size: 12.5px; line-height: 1.5;
  color: #d0d8e4; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ct-visor-placeholder, .ct-visor-fallback {
  width: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: #8b98a8; text-align: center; padding: 28px;
}
.ct-visor-spin {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid rgba(245,185,20,.2);
  border-top-color: #F5B914;
  animation: ctSpin .7s linear infinite;
}
@keyframes ctSpin { to { transform: rotate(360deg); } }
.ct-visor-file-ico {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #F5B914;
  background: linear-gradient(145deg, rgba(245,185,20,.15), rgba(245,185,20,.04));
  border: 1px solid rgba(245,185,20,.3);
  margin-bottom: 4px;
}
.ct-visor-file-name { font-size: 15px; font-weight: 700; color: #e8edf3; margin: 0; }
.ct-visor-hint { font-size: 12.5px; color: #6f7a89; margin: 0 0 8px; max-width: 320px; }

@media (max-width: 700px) {
  #modal-ct-chat .modal-content.ct-chat-shell { height: calc(100vh - 12px); border-radius: 14px; }
  .ct-msg { max-width: 90%; }
  .ct-visor-nombre { max-width: 140px; }
  #modal-ct-visor .ct-visor-shell { height: calc(100vh - 12px); border-radius: 14px; }
}


/* X grande del visor de soportes */
#modal-ct-visor .ct-cerrar,
#modal-ct-visor .ct-visor-acciones .ct-cerrar {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px;
  min-height: 52px;
  border-radius: 14px !important;
  font-size: 32px !important;
  line-height: 1 !important;
  font-weight: 300;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(255,71,87,.12) !important;
  border: 1px solid rgba(255,71,87,.45) !important;
  color: #ff6b7a !important;
  cursor: pointer;
  transition: all .18s ease;
}
#modal-ct-visor .ct-cerrar:hover,
#modal-ct-visor .ct-visor-acciones .ct-cerrar:hover {
  background: rgba(255,71,87,.22) !important;
  border-color: #ff4757 !important;
  color: #fff !important;
  transform: scale(1.06);
}
/* También un poco más grande en chat ConectaTech */
#modal-ct-chat .ct-cerrar {
  width: 46px !important;
  height: 46px !important;
  font-size: 28px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   MEJORAS DE DINAMISMO, BADGES Y TRANSICIONES (2026-11-10)
   ============================================================ */

/* Badges profesionales */
.ct-badge-pro {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(239, 68, 68, .4);
  animation: ctPulse .45s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@keyframes ctPulse {
  0%   { transform: scale(.82); opacity: .65; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* Transiciones suaves en tarjetas */
.ct-ticket {
  transition: transform .18s cubic-bezier(.2,.8,.2,1),
              box-shadow .18s ease,
              background .18s ease,
              border-color .18s ease;
}
.ct-ticket:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}

/* Chips de etiquetado */
.ct-chip {
  transition: all .15s ease;
}
.ct-chip--on {
  transform: scale(1.02);
  box-shadow: 0 0 0 1px rgba(245,185,20,.35);
}

/* Resultados de búsqueda de colaboradores */
.ct-eti-resultados {
  max-height: 240px;
  overflow-y: auto;
  background: #0f172a;
  border-radius: 10px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.07);
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.ct-candidato {
  transition: background .12s ease;
}
.ct-candidato:hover {
  background: rgba(245,185,20,.09);
}

/* Input bar del chat */
.ct-chat-inputbar {
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ct-chat-inputbar:focus-within {
  border-color: #F5B914;
  box-shadow: 0 0 0 3px rgba(245,185,20,.12);
}

/* Emoji picker más fluido */
#ct-emojis {
  transition: opacity .15s ease, transform .15s ease;
}
#ct-emojis:not([style*="display: none"]) {
  animation: ctFadeIn .18s ease;
}
@keyframes ctFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Preview de adjunto en chat */
#ct-chat-file-preview {
  animation: ctFadeIn .2s ease;
}

/* Dropzone moderno para adjuntos */
.ct-dropzone {
  border: 2px dashed #334155;
  border-radius: 14px;
  background: rgba(15, 23, 42, .6);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  margin-top: 6px;
}
.ct-dropzone:hover,
.ct-dropzone.ct-dropzone--over {
  border-color: #F5B914;
  background: rgba(245, 185, 20, .06);
  transform: translateY(-1px);
}
.ct-dropzone-inner {
  pointer-events: none;
}
.ct-adj-prev {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ct-adj-item {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #eaf1f8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buscador estilo WhatsApp */
#ct-buscar-tickets:focus {
  border-color: #F5B914 !important;
  box-shadow: 0 0 0 3px rgba(245,185,20,.12);
}
.ct-buscador {
  animation: ctFadeIn .25s ease;
}

/* ========== CHAT FUTURISTA ========== */
#modal-ct-chat .modal-content {
  background: linear-gradient(180deg, #0c1220 0%, #0a0f18 100%);
  border: 1px solid rgba(245,185,20,.15);
  box-shadow: 0 25px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(245,185,20,.08);
  border-radius: 18px;
}

.ct-chat-header {
  background: rgba(15,23,42,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245,185,20,.12);
  padding: 14px 18px;
}

.ct-chat-header h2, #ct-chat-header-info {
  font-weight: 700;
  letter-spacing: -.02em;
}

#ct-chat-mensajes {
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(245,185,20,.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(59,130,246,.03) 0%, transparent 50%),
    #0a0f18;
  padding: 20px 16px;
}

.ct-msg {
  max-width: 75%;
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 8px;
  position: relative;
  animation: ctMsgIn .25s ease;
}

@keyframes ctMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ct-msg--mio {
  background: #F8F4E9;
  color: #1a1a1a;
  margin-left: auto;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.ct-msg--mio .ct-msg-autor { color: rgba(30,30,30,.7); }
.ct-msg--mio .ct-msg-texto { color: #1a1a1a; }
.ct-msg--mio .ct-msg-hora { color: rgba(30,30,30,.55); }

.ct-msg--otro {
  background: rgba(30,41,59,.9);
  border: 1px solid rgba(255,255,255,.06);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

.ct-msg-autor {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: .8;
}

.ct-msg-texto {
  font-size: 14px;
  line-height: 1.5;
}

.ct-msg-hora {
  font-size: 10px;
  margin-top: 4px;
  opacity: .6;
}

.ct-chat-inputbar {
  background: rgba(15,23,42,.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(245,185,20,.1);
  padding: 12px 16px;
  gap: 10px;
}

.ct-chat-inputbar textarea {
  background: rgba(30,41,59,.8);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px 14px;
  color: #e8edf3;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.ct-chat-inputbar textarea:focus {
  border-color: rgba(245,185,20,.4);
  box-shadow: 0 0 0 3px rgba(245,185,20,.1);
  outline: none;
}

.ct-icon-btn--enviar {
  background: linear-gradient(135deg, #F5B914, #e5a800);
  color: #0a0f18;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  box-shadow: 0 4px 15px rgba(245,185,20,.3);
  transition: transform .15s, box-shadow .15s;
}

.ct-icon-btn--enviar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(245,185,20,.4);
}

.ct-icon-btn {
  background: rgba(30,41,59,.6);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  transition: background .15s, border-color .15s;
}

.ct-icon-btn:hover {
  background: rgba(245,185,20,.15);
  border-color: rgba(245,185,20,.3);
}

/* Botón etiquetar mejorado */
.ct-btn--outline {
  background: transparent;
  border: 1px solid rgba(245,185,20,.4);
  color: #F5B914;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  transition: all .15s;
}
.ct-btn--outline:hover {
  background: rgba(245,185,20,.1);
  border-color: #F5B914;
}

/* Panel de emojis */
#ct-emojis {
  display: none;
  position: absolute;
  bottom: 70px;
  left: 16px;
  background: #1e293b;
  border: 1px solid rgba(245,185,20,.2);
  border-radius: 12px;
  padding: 10px;
  max-width: 280px;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
#ct-emojis.active {
  display: flex;
}
.ct-emoji {
  background: transparent;
  border: none;
  font-size: 22px;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .1s;
}
.ct-emoji:hover {
  background: rgba(245,185,20,.15);
}

.ct-visto--enviado { color: #111 !important; }
.ct-visto--leido { color: #D4A017 !important; }
