/* ═══════════════════════════════════════════
   HEAVENSY — CHAT INTERNO
   assets/css/chat_interno.css
═══════════════════════════════════════════ */

/* ── DATEPICKER PERSONALIZADO ── */
.ci-datepicker-wrap { position: relative; }

.ci-dp-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ci-bg);
  border: 1.5px solid var(--ci-border);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ci-text);
  transition: border-color .15s;
  user-select: none;
}
.ci-dp-trigger:hover { border-color: var(--ci-purple); }
.ci-dp-trigger span { flex: 1; }

.ci-dp-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ci-muted);
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 11px;
  line-height: 1;
}
.ci-dp-clear:hover { color: #e74c3c; }

.ci-dp-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1.5px solid var(--ci-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(100,90,200,.13);
  padding: 16px;
  z-index: 300;
  width: 280px;
}
.ci-dp-popup.open { display: block; }

.ci-dp-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ci-dp-cal-header span {
  font-size: 14px;
  font-weight: 700;
  color: var(--ci-text);
}
.ci-dp-cal-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ci-muted);
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  transition: background .12s, color .12s;
  line-height: 1;
}
.ci-dp-cal-header button:hover {
  background: rgba(142,132,250,.12);
  color: var(--ci-purple);
}

.ci-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.ci-dp-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ci-muted);
  padding: 3px 0;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.ci-dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.ci-dp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ci-text);
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: background .1s, color .1s;
  line-height: 1;
}
.ci-dp-day:hover:not(:disabled) {
  background: rgba(142,132,250,.13);
  color: var(--ci-purple);
}
.ci-dp-day.selected {
  background: linear-gradient(135deg,#8e84fa 0%,#91c0ff 100%);
  color: #fff !important;
  font-weight: 700;
}
.ci-dp-day.today {
  font-weight: 800;
  color: var(--ci-purple);
}
.ci-dp-day.other-month { color: #c8cfe6; }
.ci-dp-day:disabled { color: #dce0ee; cursor: default; }

.ci-dp-time {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ci-border);
  font-size: 12px;
  color: var(--ci-text);
  font-weight: 600;
}
.ci-dp-time-sel {
  border: 1.5px solid var(--ci-border);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 13px;
  color: var(--ci-text);
  background: var(--ci-bg);
  outline: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  flex: 1;
  transition: border-color .15s;
}
.ci-dp-time-sel:focus { border-color: var(--ci-purple); }

.ci-dp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.ci-dp-btn-clear {
  border: none;
  background: none;
  color: var(--ci-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  transition: background .12s;
}
.ci-dp-btn-clear:hover { background: #f0f1f8; }
.ci-dp-btn-ok {
  border: none;
  background: linear-gradient(135deg,#8e84fa,#91c0ff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 18px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  transition: opacity .12s;
}
.ci-dp-btn-ok:hover { opacity: .88; }

/* ── MODAL PROGRAMADO (inline calendar) ── */
.ci-prog-modal { width: 400px; }

/* Aviso de confirmación dentro del modal de programado */
.ci-prog-aviso {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #E1F5EE;
  border: 0.5px solid #5DCAA5;
  border-radius: 8px;
  padding: 8px 11px;
  margin-bottom: 14px;
  animation: ci-pin-in .2s ease;
}
.ci-prog-aviso i { color: #0F6E56; font-size: 15px; }
.ci-prog-aviso span { font-size: 12px; color: #085041; font-weight: 600; }

/* Calendario + hora lado a lado */
.ci-prog-fecha-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.ci-prog-cal {
  flex: 1;
  border: 0.5px solid var(--ci-border, #e4e9f5) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  width: auto !important;
  margin: 0 !important;
}
/* Calendario compacto: días y header más chicos */
.ci-prog-cal .ci-dp-cal-header { margin-bottom: 6px; }
.ci-prog-cal .ci-dp-cal-header span { font-size: 12px; }
.ci-prog-cal .ci-dp-cal-header button { padding: 3px 7px; }
.ci-prog-cal .ci-dp-weekdays span { font-size: 9px; padding: 2px 0; }
.ci-prog-cal .ci-dp-days { gap: 2px; }
.ci-prog-cal .ci-dp-day {
  font-size: 10px;
  padding: 3px 0;
  min-height: 22px;
}

/* Caja de hora al costado (arriba) */
.ci-prog-hora-box {
  min-width: 92px;
  border: 0.5px solid var(--ci-border, #e4e9f5);
  border-radius: 8px;
  padding: 8px;
}
.ci-prog-hora-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ci-purple, #8e84fa);
  font-weight: 600;
  margin-bottom: 7px;
}
.ci-prog-hora-label i { font-size: 12px; }
.ci-prog-hora-selects {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.ci-prog-hora-sep { font-weight: 700; color: var(--ci-muted, #9ba3c0); font-size: 14px; }

/* Lista de programados pendientes dentro del modal */
.ci-prog-pendientes {
  border-top: 1px solid var(--ci-border, #e4e9f5);
  margin: 14px -16px 0;
  padding: 14px 16px 0;
}
.ci-prog-pendientes-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-text, #383838);
}
.ci-prog-pendientes-header i { color: #378ADD; font-size: 13px; }
.ci-prog-pendientes-count {
  background: #E6F1FB;
  color: #0C447C;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
}
.ci-prog-pendientes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.ci-prog-pend-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border: 0.5px solid var(--ci-border, #e4e9f5);
  border-left: 3px solid #378ADD;
  border-radius: 0 8px 8px 0;
  padding: 9px 11px;
}
.ci-prog-pend-main { flex: 1; min-width: 0; }
.ci-prog-pend-text {
  font-size: 12px;
  color: var(--ci-text, #383838);
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}
.ci-prog-pend-time {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #185FA5;
  font-weight: 600;
}
.ci-prog-pend-time i { font-size: 11px; }
.ci-prog-pend-rel { color: var(--ci-muted, #9BA3C0); font-weight: 400; }
.ci-prog-cancel-btn {
  padding: 3px 9px;
  font-size: 10px;
  border: 0.5px solid #F7C1C1;
  border-radius: 7px;
  background: #fff;
  color: #A32D2D;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background .15s;
}
.ci-prog-cancel-btn:hover { background: #FCEBEB; }
.ci-prog-cancel-btn i { font-size: 10px; }

/* Usa las mismas clases del popup pero estático */
.ci-pdp-inline-fixed {
  display: block !important;
  position: static !important;
  box-shadow: none;
  border: none !important;
  width: 280px;
  margin: 0 auto;
  padding: 0;
}

:root {
  --ci-purple:   #8e84fa;
  --ci-blue:     #5a79d4;
  --ci-light:    #91c0ff;
  --ci-bg:       #f4f6fb;
  --ci-white:    #ffffff;
  --ci-border:   #e4e9f5;
  --ci-text:     #383838;
  --ci-muted:    #9BA3C0;
  --ci-online:   #22c55e;
  --ci-offline:  #d1d5db;
}

/* ── LAYOUT ── */
.ci-page {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--ci-bg);
  font-family: 'DM Sans', 'Poppins', sans-serif;
  position: relative; /* Necesario para anclar .ci-sidebar absoluta en móvil */
}

/* ── PANEL IZQUIERDO ── */
.ci-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--ci-white);
  border-right: 1px solid var(--ci-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ci-sidebar-header {
  padding: 12px 10px 10px;
  border-bottom: 1px solid var(--ci-border);
  flex-shrink: 0;
}

.ci-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ci-blue);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Tabs General / Privados */
.ci-tabs {
  display: flex;
  gap: 2px;
  background: #e8eaf2;
  border-radius: 10px;
  padding: 3px;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.ci-tab {
  flex: 1;
  padding: 5px 2px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ci-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
  text-align: center;
}

.ci-tab.active {
  background: var(--ci-white);
  color: var(--ci-blue);
  box-shadow: 0 1px 4px rgba(90,121,212,.15);
}

/* Lista de chats en sidebar */
.ci-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 0;
}

.ci-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  position: relative;
  margin-bottom: 2px;
}

.ci-chat-item:hover { background: var(--ci-bg); }
.ci-chat-item.active { background: rgba(142,132,250,.1); }

.ci-chat-item-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.ci-chat-item-avatar.general {
  background: linear-gradient(135deg, var(--ci-blue) 0%, var(--ci-light) 55%);
  font-size: 14px;
}

.ci-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: var(--ci-offline);
}

.ci-online-dot.online { background: var(--ci-online); }

/* Punto de estado en el header del chat (inline junto al texto) */
.ci-header-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  background: var(--ci-offline);
}
.ci-header-dot.online { background: var(--ci-online); }

.ci-chat-item-info { flex: 1; min-width: 0; }

.ci-chat-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ci-chat-item-last {
  font-size: 10px;
  color: var(--ci-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
/* Nombre de quien escribió el último mensaje (prefijo en el preview) */
.ci-chat-item-sender {
  color: var(--ci-purple);
  font-weight: 600;
}

.ci-unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--ci-purple);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

/* Sección de online users en sidebar */
.ci-online-section {
  border-top: 1px solid var(--ci-border);
  padding: 10px 8px;
  flex-shrink: 0;
}

.ci-online-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ci-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 0 6px;
  margin-bottom: 6px;
}

.ci-online-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 80px;
  overflow-y: auto;
}

.ci-online-user {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 20px;
  background: var(--ci-bg);
  cursor: pointer;
  transition: background .15s;
}

.ci-online-user:hover { background: rgba(142,132,250,.12); }

.ci-online-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

.ci-online-user-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: var(--ci-online);
}

.ci-online-user-name {
  font-size: 11px;
  color: var(--ci-text);
  white-space: nowrap;
}

/* Admin button */
.ci-admin-btn {
  margin: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px dashed var(--ci-border);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--ci-muted);
  cursor: pointer;
  width: calc(100% - 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}

.ci-admin-btn:hover {
  border-color: var(--ci-purple);
  color: var(--ci-purple);
  background: rgba(142,132,250,.06);
}

/* ── AREA PRINCIPAL ── */
.ci-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
  background: var(--ci-bg);
}

.ci-main-header {
  background: transparent;
  border-bottom: 1px solid var(--ci-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ci-main-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-blue) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.ci-main-header-info { flex: 1; min-width: 0; }

.ci-main-header-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ci-text);
}

.ci-main-header-sub {
  font-size: 11px;
  color: var(--ci-muted);
}

/* Feed de mensajes */
.ci-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Separador de fecha */
.ci-date-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
}

.ci-date-sep span {
  font-size: 10px;
  font-weight: 600;
  color: var(--ci-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.ci-date-sep::before,
.ci-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ci-border);
}

/* Mensaje */
.ci-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0;
  position: relative;
}

.ci-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.ci-msg-body {
  min-width: 0;
  flex: 0 1 auto;
}
/* Contenedor del contenido (reply+attach+texto): ancla para las acciones flotantes */
.ci-msg-content {
  position: relative;
}
.ci-msg.own .ci-msg-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Las acciones quedan junto al mensaje, no en el extremo derecho.
   Ocultas: no reservan espacio (width:0). Al hover: se expanden. */
.ci-msg-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  opacity: 0;
  transition: opacity .15s;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.ci-msg:hover .ci-msg-actions {
  opacity: 1;
}
/* Mientras el menú "..." está abierto, mantener acciones visibles aunque no haya hover */
.ci-msg-actions.menu-open {
  opacity: 1;
}

.ci-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.ci-msg-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--ci-blue);
}

.ci-msg-author.me { color: var(--ci-purple); }

.ci-msg-time {
  font-size: 10px;
  color: var(--ci-muted);
}

.ci-msg-role {
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: var(--ci-muted);
  border-radius: 4px;
  padding: 1px 5px;
  text-transform: uppercase;
}

.ci-msg-role.admin { background: var(--ci-blue); }
.ci-msg-role.profesional { background: var(--ci-purple); }
.ci-msg-role.secretaria { background: #22c55e; }
.ci-msg-role.aliado { background: #f59e0b; }

.ci-msg-text {
  font-size: 13px;
  color: var(--ci-text);
  line-height: 1.5;
  word-break: break-word;
}

/* Mención */
.ci-mention {
  color: var(--ci-blue);
  font-weight: 700;
  background: rgba(90,121,212,.1);
  border-radius: 4px;
  padding: 0 3px;
}

.ci-mention.me {
  color: var(--ci-purple);
  background: rgba(142,132,250,.15);
}

/* Acciones flotantes sobre el mensaje (estilo overlay semitransparente) */
.ci-msg-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--ci-purple);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: all .15s;
}

.ci-msg-action-btn:hover { background: #fff; color: var(--ci-blue); }

/* Mensaje continuo (mismo autor seguido) */
.ci-msg.continued .ci-msg-avatar { visibility: hidden; }
.ci-msg.continued .ci-msg-meta { display: none; }

/* Mensaje propio */
.ci-msg.own {
  flex-direction: row-reverse;
}

.ci-msg.own .ci-msg-body { align-items: flex-end; display: flex; flex-direction: column; }
.ci-msg.own .ci-msg-meta { flex-direction: row-reverse; }
.ci-msg.own .ci-msg-text {
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  color: #fff;
  border-radius: 14px 14px 2px 14px;
  padding: 8px 12px;
  display: inline-block;
  max-width: 420px;
  box-shadow: 0 2px 6px rgba(90, 100, 180, .18);
}

.ci-msg:not(.own) .ci-msg-text {
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: 2px 14px 14px 14px;
  padding: 8px 12px;
  display: inline-block;
  max-width: 420px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

/* Typing indicator */
.ci-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 8px;
  min-height: 28px;
}

.ci-typing-text {
  font-size: 11px;
  color: var(--ci-muted);
  font-style: italic;
}

.ci-typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.ci-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ci-muted);
  animation: ci-bounce .9s infinite;
}

.ci-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ci-typing-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes ci-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ── TOOLBAR + EXPANDIBLE ── */
.ci-plus-btn.active { color: var(--ci-purple); background: rgba(142,132,250,.12); }

.ci-plus-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 50;
  min-width: 140px;
}
.ci-plus-menu.open { display: block; }

.ci-plus-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-text);
  font-family: 'DM Sans', sans-serif;
  transition: background .12s;
  text-align: left;
}
.ci-plus-item:hover { background: rgba(142,132,250,.08); }
.ci-plus-item i { color: var(--ci-purple); width: 14px; text-align: center; }

/* ── FORM HELPERS ── */
.ci-form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--ci-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}

.ci-form-input {
  width: 100%;
  border: 1.5px solid var(--ci-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--ci-text);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
  background: var(--ci-bg);
}
.ci-form-input:focus { border-color: var(--ci-purple); background: #fff; }

/* ── VOTACIÓN MODAL ── */
.ci-vot-opcion-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.ci-vot-remove-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 7px; border: 1px solid #fee2e2;
  background: #fff; color: #ef4444; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all .15s;
}
.ci-vot-remove-btn:hover { background: #fee2e2; }
.ci-vot-add-btn {
  font-size: 11px; font-weight: 600; color: var(--ci-purple);
  background: rgba(142,132,250,.08); border: 1.5px dashed var(--ci-purple);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .15s; width: 100%;
}
.ci-vot-add-btn:hover { background: rgba(142,132,250,.15); }

/* ── CARDS EN EL FEED ── */

/* Votación card */
.ci-card-votacion {
  background: var(--ci-white);
  border: 1.5px solid var(--ci-border);
  border-left: 4px solid var(--ci-purple);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 4px 0;
  max-width: 420px;
}
.ci-card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.ci-card-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(142,132,250,.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--ci-purple); font-size: 12px; flex-shrink: 0;
}
.ci-card-title { font-size: 13px; font-weight: 700; color: var(--ci-text); }
.ci-card-meta  { font-size: 10px; color: var(--ci-muted); margin-top: 1px; }

.ci-vot-option-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; margin-bottom: 6px;
  border-radius: 9px; border: 1.5px solid var(--ci-border);
  background: var(--ci-bg); cursor: pointer; transition: all .15s;
  font-family: 'DM Sans', sans-serif; position: relative; overflow: hidden;
}
.ci-vot-option-btn:hover { border-color: var(--ci-purple); }
.ci-vot-option-btn.voted { border-color: var(--ci-purple); background: rgba(142,132,250,.08); }
.ci-vot-option-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(142,132,250,.12); transition: width .4s ease; border-radius: 7px;
}
.ci-vot-option-text { font-size: 12px; font-weight: 600; color: var(--ci-text); position: relative; z-index:1; flex:1; text-align:left; }
.ci-vot-option-pct  { font-size: 11px; font-weight: 700; color: var(--ci-purple); position: relative; z-index:1; }
.ci-vot-voters { font-size: 10px; color: var(--ci-muted); margin-top: 4px; }

/* Programado card */
.ci-card-programado {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-left: 4px solid #0ea5e9;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 4px 0;
  max-width: 420px;
}
.ci-card-programado .ci-card-icon { background: rgba(14,165,233,.1); color: #0ea5e9; }
.ci-card-prog-text { font-size: 13px; color: #0c4a6e; margin: 8px 0 4px; }
.ci-card-prog-time { font-size: 11px; font-weight: 700; color: #0ea5e9; display:flex; align-items:center; gap:5px; }

/* Tarea card */
.ci-card-tarea {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-left: 4px solid #22c55e;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 4px 0;
  max-width: 420px;
}
.ci-card-tarea .ci-card-icon { background: rgba(34,197,94,.1); color: #22c55e; }
.ci-card-tarea-desc { font-size: 13px; color: #14532d; margin: 6px 0 8px; line-height:1.4; }
.ci-card-tarea-meta { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.ci-tarea-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 600;
}
.ci-tarea-chip.responsable { background: rgba(142,132,250,.12); color: var(--ci-purple); }
.ci-tarea-chip.fecha { background: rgba(34,197,94,.12); color: #15803d; }
.ci-tarea-chip.urgente { background: #fee2e2; color: #ef4444; }
.ci-tarea-chip.alta { background: #fef3c7; color: #b45309; }

/* ── PRIORITY CHIPS (modal) ── */
.ci-prio-group {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
}
.ci-prio-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: 11px;
  border: 1.5px solid var(--ci-border);
  background: var(--ci-bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .15s;
}
.ci-prio-chip:hover { border-color: #c5c0f5; color: var(--ci-text); background: #f5f4fe; }

/* Normal activo */
.ci-prio-chip[data-value="normal"].active {
  border-color: var(--ci-purple);
  background: rgba(142,132,250,.1);
  color: var(--ci-purple);
}
/* Alta activo */
.ci-prio-chip[data-value="alta"].active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}
/* Urgente activo */
.ci-prio-chip[data-value="urgente"].active {
  border-color: #ef4444;
  background: #fff0f0;
  color: #ef4444;
}
.ci-tarea-check-btn {
  margin-top: 8px; width: 100%; padding: 7px;
  border-radius: 8px; border: 1.5px solid #86efac;
  background: #fff; color: #15803d; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ci-tarea-check-btn:hover { background: #22c55e; color: #fff; border-color: #22c55e; }
.ci-tarea-check-btn.done { background: #dcfce7; color: #15803d; cursor: default; }

/* ── NOTA ANCLADA ── */
/* ── FEED WRAPPER ── */
.ci-feed-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ── VOTACIÓN ANCLADA ── */
.ci-pinned-vot {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 220px;
  background: var(--ci-white);
  border: 1.5px solid var(--ci-border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(100,90,200,.12);
  z-index: 20;
  animation: ci-pin-in .25s ease;
}

.ci-pinned-vot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ci-pvot-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(142,132,250,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ci-purple);
  font-size: 11px;
  flex-shrink: 0;
}
.ci-pvot-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ci-text);
  flex: 1;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-pinned-vot-meta {
  font-size: 10px;
  color: var(--ci-muted);
  font-weight: 600;
  white-space: nowrap;
  display: block;
  margin-bottom: 8px;
}

#ci-pinned-vot-opciones { display: flex; flex-direction: column; gap: 5px; }

.ci-pinned-vot-btn {
  width: 100%;
  text-align: left;
  background: var(--ci-bg);
  border: 1.5px solid var(--ci-border);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ci-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  transition: all .12s;
  position: relative;
  overflow: hidden;
}
.ci-pinned-vot-btn:hover:not(:disabled) {
  border-color: var(--ci-purple);
  background: rgba(142,132,250,.06);
}
.ci-pinned-vot-btn.voted {
  border-color: var(--ci-purple);
  background: rgba(142,132,250,.08);
}
.ci-pinned-vot-btn:disabled { cursor: default; }

.ci-pinned-vot-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(142,132,250,.1);
  transition: width .35s ease;
}
.ci-pinned-vot-label { position: relative; flex: 1; }
.ci-pinned-vot-pct {
  position: relative;
  font-size: 10px;
  color: var(--ci-purple);
  font-weight: 700;
}

/* Opción ganadora */
.ci-pinned-vot-btn.winner {
  background: linear-gradient(135deg,#8e84fa 0%,#91c0ff 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 700;
}
.ci-pinned-vot-btn.winner .ci-pinned-vot-bar { display: none; }
.ci-pinned-vot-btn.winner .ci-pinned-vot-pct { color: rgba(255,255,255,.85) !important; }

/* Botón confirmar */
.ci-pvot-confirm {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ci-border);
}
.ci-pvot-confirm-btn {
  width: 100%;
  padding: 7px;
  border-radius: 9px;
  border: 1.5px solid #86efac;
  background: #fff;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all .15s;
}
.ci-pvot-confirm-btn:hover:not(:disabled) { background: #dcfce7; }
.ci-pvot-confirm-btn.confirmed {
  border-color: var(--ci-purple);
  color: var(--ci-purple);
  background: rgba(142,132,250,.07);
  cursor: default;
}

/* ── Pila de notas ancladas (múltiples) ── */
.ci-pinned-stack {
  background: var(--ci-bg, #f4f6fb);
  border-bottom: 1px solid var(--ci-border, #e4e9f5);
  flex-shrink: 0;
  animation: ci-pin-in .25s ease;
  max-height: 240px;
  overflow-y: auto;
}

@keyframes ci-pin-in {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}

.ci-pinned-stack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px 4px;
}
.ci-pinned-stack-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-text, #383838);
}
.ci-pinned-stack-title i { color: var(--ci-purple, #8e84fa); font-size: 12px; transform: rotate(45deg); }
.ci-pinned-count {
  background: #eeedfe;
  color: #3c3489;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
}
.ci-pinned-toggle-all {
  font-size: 11px;
  color: var(--ci-muted, #9BA3C0);
  cursor: pointer;
}
.ci-pinned-toggle-all:hover { color: var(--ci-purple, #8e84fa); }

.ci-pinned-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 10px 10px;
}

/* Tarjeta de nota individual */
.ci-pinned-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 0 8px 8px 0;
}
.ci-pinned-card.casual {
  background: #eeedfe;
  border-left: 3px solid #534ab7;
}
.ci-pinned-card.importante {
  background: #faeeda;
  border-left: 3px solid #ba7517;
}

.ci-pinned-card-main { flex: 1; min-width: 0; }
.ci-pinned-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.ci-pinned-author {
  font-size: 11px;
  font-weight: 600;
}
.ci-pinned-card.casual .ci-pinned-author { color: #3c3489; }
.ci-pinned-card.importante .ci-pinned-author { color: #633806; }

.ci-pinned-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: #fac775;
  color: #633806;
}

.ci-pinned-text {
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}
.ci-pinned-card.casual .ci-pinned-text { color: #26215c; }
.ci-pinned-card.importante .ci-pinned-text { color: #412402; }

.ci-pinned-confirmations {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
}

.ci-pinned-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}
.ci-pinned-chip.confirmed { background: #d1fae5; color: #065f46; }
.ci-pinned-chip.pending   { background: #fef3c7; color: #92400e; opacity: .7; }
.ci-pinned-chip i { font-size: 9px; }
.ci-pinned-frac { font-size: 10px; color: #854f0b; margin-left: 4px; }

.ci-pinned-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ci-pinned-confirm-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1.5px solid #ba7517;
  background: #fff;
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ci-pinned-confirm-btn:hover { background: #ba7517; color: #fff; }
.ci-pinned-confirm-btn.confirmed {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
  cursor: default;
}

/* Selector de tipo de nota en el input */
.ci-nota-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.ci-nota-type-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ci-muted, #9BA3C0);
}
.ci-nota-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1.5px solid var(--ci-border, #e4e9f5);
  background: #fff;
  color: var(--ci-muted, #9BA3C0);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
}
.ci-nota-type-btn i { font-size: 11px; }
.ci-nota-type-btn.active[data-tipo="casual"] {
  border-color: #534ab7;
  background: #eeedfe;
  color: #3c3489;
}
.ci-nota-type-btn.active[data-tipo="importante"] {
  border-color: #ba7517;
  background: #faeeda;
  color: #633806;
}
.ci-nota-type-hint {
  font-size: 10px;
  color: var(--ci-muted, #9BA3C0);
  margin-left: auto;
}
.ci-nota-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1.5px solid var(--ci-border, #e4e9f5);
  background: #fff;
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
}
.ci-nota-cancel-btn:hover { background: #fee2e2; border-color: #fecaca; }
.ci-nota-cancel-btn i { font-size: 11px; }

/* Modo nota activo en el input */
.ci-input-box.nota-mode {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245,158,11,.12);
}

#ci-nota-toggle.active {
  color: #f59e0b;
  background: #fef3c7;
}

/* ── MENÚ 3 PUNTOS ── */
.ci-menu-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--ci-border);
  background: var(--ci-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ci-muted);
  font-size: 14px;
  transition: all .15s;
}
.ci-menu-btn:hover { background: var(--ci-bg); color: var(--ci-blue); }

.ci-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  min-width: 200px;
  z-index: 50;
  overflow: hidden;
}
.ci-menu-dropdown.open { display: block; }

.ci-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--ci-text);
  cursor: pointer;
  transition: background .12s;
}
.ci-menu-item:hover { background: rgba(142,132,250,.07); }
.ci-menu-item i { color: var(--ci-purple); font-size: 13px; width: 16px; text-align: center; }

/* ── SCROLL TO BOTTOM BTN ── */
.ci-scroll-btn {
  position: absolute;
  bottom: 90px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ci-border);
  background: var(--ci-white);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ci-blue);
  font-size: 13px;
  z-index: 10;
  transition: opacity .2s, transform .2s;
}
.ci-scroll-btn:hover { background: var(--ci-bg); transform: translateY(-2px); }

/* ── INPUT AREA ── */
.ci-input-wrap {
  background: transparent;
  padding: 12px 16px 16px;
  flex-shrink: 0;
}

.ci-input-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--ci-white);
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 12px;
  transition: border-color .15s;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.ci-input-box:focus-within {
  border-color: var(--ci-purple);
}

.ci-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ci-text);
  font-family: 'DM Sans', sans-serif;
  resize: none;
  max-height: 120px;
  min-height: 22px;
  line-height: 1.5;
}

.ci-input::placeholder { color: var(--ci-muted); }

.ci-input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ci-input-btn {
  padding: 6px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  transition: all .15s;
}

.ci-input-btn:hover { background: #f3f4f6; color: var(--ci-purple); }

.ci-send-btn {
  padding: 7px 9px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  transition: opacity .15s, transform .1s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(142, 132, 250, .3);
}

.ci-send-btn:hover { opacity: .9; transform: scale(1.04); }
.ci-send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Mention autocomplete */
.ci-mention-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 100;
  min-width: 200px;
  display: none;
}

.ci-mention-popup.open { display: block; }

.ci-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .12s;
}

.ci-mention-item:hover,
.ci-mention-item.focused { background: rgba(142,132,250,.08); }

.ci-mention-item-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ci-mention-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-text);
}

.ci-mention-item-role {
  font-size: 10px;
  color: var(--ci-muted);
  margin-left: auto;
}

/* ── MODAL PARTICIPANTES (admin) ── */
.ci-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.ci-modal-overlay.open { display: flex; }

.ci-modal {
  background: var(--ci-white);
  border-radius: 16px;
  width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
}

.ci-modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--ci-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ci-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ci-text);
}

.ci-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--ci-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ci-muted);
}

.ci-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.ci-modal-sub {
  font-size: 11px;
  color: var(--ci-muted);
  margin-bottom: 14px;
}

.ci-participant-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ci-bg);
}

.ci-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ci-participant-info { flex: 1; min-width: 0; }

.ci-participant-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ci-text);
}

.ci-participant-role {
  font-size: 11px;
  color: var(--ci-muted);
}

.ci-toggle {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--ci-offline);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  border: none;
}

.ci-toggle.on { background: var(--ci-purple); }

.ci-toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.ci-toggle.on::after { left: 19px; }

.ci-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--ci-border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.ci-modal-save {
  padding: 9px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity .15s;
}

.ci-modal-save:hover { opacity: .9; }

/* ── SIDEBAR BADGE (icono en nav lateral) ── */
.ci-sidebar-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  display: none;
}

.ci-sidebar-link-wrap {
  position: relative;
  display: inline-flex;
}

/* Notification toast para menciones */
.ci-notif-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-left: 4px solid var(--ci-purple);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  z-index: 9999;
  max-width: 300px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: ci-toast-in .3s ease;
  cursor: pointer;
}

@keyframes ci-toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.ci-notif-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ci-notif-toast-body {
  flex: 1;
  min-width: 0;
}

.ci-notif-toast-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ci-text);
}

.ci-notif-toast-msg {
  font-size: 11px;
  color: var(--ci-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* Empty state */
.ci-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ci-muted);
  gap: 12px;
  padding: 40px;
}

.ci-empty i { font-size: 36px; opacity: .4; }
.ci-empty p { font-size: 13px; text-align: center; }

/* ── MODAL INFO SALA ── */
.ci-info-modal {
  background: var(--ci-white);
  border-radius: 20px;
  width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,.2);
  position: relative;
}

.ci-info-hero {
  background: var(--ci-bg);
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--ci-border);
}

.ci-info-avatar-wrap {
  position: relative;
  cursor: pointer;
  width: 80px;
  height: 80px;
}

.ci-info-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 3px solid rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.ci-info-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

.ci-info-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transition: opacity .2s;
}
.ci-info-avatar-wrap:hover .ci-info-avatar-overlay { opacity: 1; }

.ci-info-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--ci-border);
  background: var(--ci-white);
  color: var(--ci-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all .15s;
}
.ci-info-close:hover { background: var(--ci-border); color: var(--ci-text); }

.ci-info-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ci-info-field {
  display: flex;
  flex-direction: column;
}

.ci-info-field-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ci-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}

.ci-info-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ci-info-input {
  flex: 1;
  border: 1.5px solid var(--ci-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--ci-text);
  outline: none;
  transition: border-color .15s;
  background: var(--ci-bg);
}
.ci-info-input:focus { border-color: var(--ci-purple); background: #fff; }

.ci-info-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none;
  background: rgba(142,132,250,.12);
  color: var(--ci-purple);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
  flex-shrink: 0;
}
.ci-info-edit-btn:hover { background: var(--ci-purple); color: #fff; }

/* Lista miembros */
.ci-info-members-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}

.ci-info-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .12s;
}
.ci-info-member-row:hover { background: var(--ci-bg); }

.ci-info-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.ci-info-member-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: var(--ci-offline);
}
.ci-info-member-dot.online { background: var(--ci-online); }

.ci-info-member-info { flex: 1; min-width: 0; }
.ci-info-member-name { font-size: 12px; font-weight: 600; color: var(--ci-text); }
.ci-info-member-role { font-size: 10px; color: var(--ci-muted); }

.ci-info-member-remove {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ci-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all .15s;
  opacity: 0;
}
.ci-info-member-row:hover .ci-info-member-remove { opacity: 1; }
.ci-info-member-remove:hover { background: #fee2e2; color: #ef4444; }

.ci-info-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--ci-border);
  flex-shrink: 0;
}

.ci-info-save-btn {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity .15s;
}
.ci-info-save-btn:hover { opacity: .9; }

/* ── BOTÓN + CIRCULAR ── */
.ci-add-sala-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ci-purple);
  background: transparent;
  color: var(--ci-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.ci-add-sala-circle:hover {
  background: var(--ci-purple);
  color: #fff;
}

/* ── SALAS ── */
.ci-new-sala-btn {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--ci-border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ci-muted);
  font-size: 10px;
  transition: all .15s;
}
.ci-new-sala-btn:hover { background: rgba(142,132,250,.1); border-color: var(--ci-purple); color: var(--ci-purple); }

.ci-sala-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  position: relative;
  margin-bottom: 2px;
}
.ci-sala-item:hover { background: var(--ci-bg); }
.ci-sala-item.active { background: rgba(142,132,250,.1); }

.ci-sala-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.ci-sala-info { flex: 1; min-width: 0; }
.ci-sala-name { font-size: 12px; font-weight: 700; color: var(--ci-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-sala-last { font-size: 10px; color: var(--ci-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ci-sala-members { font-size: 9px; color: var(--ci-muted); margin-top: 2px; }

.ci-sala-edit-btn {
  width: 22px; height: 22px; border-radius: 6px; border: none;
  background: transparent; cursor: pointer; color: var(--ci-muted);
  font-size: 10px; display: none; align-items: center; justify-content: center;
  transition: all .15s;
}
.ci-sala-item:hover .ci-sala-edit-btn { display: flex; }
.ci-sala-edit-btn:hover { background: var(--ci-border); color: var(--ci-blue); }

/* Member checkbox row */
.ci-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  transition: background .12s;
}
.ci-member-row:hover { background: rgba(142,132,250,.07); }
.ci-member-row input[type="checkbox"] { accent-color: var(--ci-purple); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.ci-member-row-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ci-member-row-name { font-size: 12px; font-weight: 600; color: var(--ci-text); }
.ci-member-row-role { font-size: 10px; color: var(--ci-muted); margin-left: auto; }

/* Sala header badge */
.ci-sala-header-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ci-muted);
  background: var(--ci-bg); border-radius: 20px;
  padding: 3px 9px;
}

/* Scrollbar */
.ci-feed::-webkit-scrollbar,
.ci-chat-list::-webkit-scrollbar,
.ci-online-list::-webkit-scrollbar,
.ci-modal-body::-webkit-scrollbar { width: 4px; }
.ci-feed::-webkit-scrollbar-thumb,
.ci-chat-list::-webkit-scrollbar-thumb,
.ci-online-list::-webkit-scrollbar-thumb,
.ci-modal-body::-webkit-scrollbar-thumb {
  background: var(--ci-border);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Toggle sidebar + Móvil
═══════════════════════════════════════════ */

/* Botón toggle: anclado al borde izquierdo de ci-main, debajo del header,
   completamente DENTRO del área del chat para que nunca choque con la
   sidebar ni con el header del sitio */
.ci-toggle-sidebar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 56px;
  background: #fff;
  border: 1px solid var(--ci-border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: var(--ci-blue);
  font-size: 11px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 6px rgba(0, 0, 0, .06);
  transition: background .15s ease, color .15s ease;
  padding: 0;
}
.ci-toggle-sidebar:hover {
  background: #f5f6fa;
  color: #547fff;
}
.ci-toggle-sidebar i { pointer-events: none; }

/* Transición suave de la sidebar */
.ci-sidebar {
  transition: margin-left .25s ease;
}

/* Estado: sidebar colapsada en desktop */
.ci-page.sidebar-collapsed .ci-sidebar {
  margin-left: -280px;
}

/* Overlay (solo visible en móvil cuando sidebar abierta) */
.ci-sidebar-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 15;
}

/* ── MÓVIL ── */
@media (max-width: 768px) {
  .ci-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    min-width: 0;
    z-index: 18;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .12);
  }

  /* En móvil la sidebar empieza OCULTA por defecto */
  .ci-page .ci-sidebar {
    margin-left: -100%;
  }
  /* Y se muestra cuando NO está colapsada (toggle al revés en móvil) */
  .ci-page.sidebar-open .ci-sidebar {
    margin-left: 0;
  }

  /* Overlay visible solo cuando sidebar abierta en móvil */
  .ci-page.sidebar-open .ci-sidebar-overlay {
    display: block;
  }

  /* En móvil el botón conserva los estilos base (left:0, vertical centrado).
     Solo aseguramos que esté visible sobre el overlay de la sidebar. */
  .ci-toggle-sidebar {
    z-index: 25;
  }
}

/* Botón eliminar en tarjeta de nota */
.ci-pinned-delete-btn {
  background: transparent;
  border: 1px solid #fee2e2;
  color: #ef4444;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.ci-pinned-delete-btn:hover { background: #fee2e2; }

/* Botón eliminar en votación pinned */
.ci-pvot-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity .15s ease, background .15s ease;
}
.ci-pvot-delete-btn:hover { opacity: 1; background: #fee2e2; }

/* Opción seleccionada pendiente de confirmar (antes de enviar el voto) */
.ci-pinned-vot-btn.pending {
  border-color: #8e84fa;
  background: linear-gradient(135deg, #f3f1ff 0%, #e8edff 100%);
}
.ci-pinned-vot-btn.pending .ci-pinned-vot-label {
  color: #5a79d4;
  font-weight: 600;
}
/* ═══════════════════════════════════════════
   ADJUNTOS — Preview y mensajes con archivos
═══════════════════════════════════════════ */

/* Preview de adjuntos pendientes (arriba del input, antes de enviar) */
.ci-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  max-height: 140px;
  overflow-y: auto;
}

.ci-attach-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  padding: 6px 10px 6px 6px;
  max-width: 240px;
  min-width: 0;
}

.ci-attach-thumb {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eef0fa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ci-attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ci-attach-thumb-icon {
  color: var(--ci-purple);
  font-size: 18px;
}

.ci-attach-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ci-attach-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ci-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-attach-size {
  font-size: 10px;
  color: var(--ci-muted);
}

.ci-attach-remove {
  background: transparent;
  border: none;
  color: var(--ci-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.ci-attach-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* ── Drag & drop ── */
.ci-feed-wrapper.ci-dnd-active::before,
.ci-feed.ci-dnd-active::before {
  content: 'Suelta los archivos aquí';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 132, 250, .15);
  color: var(--ci-purple);
  font-size: 16px;
  font-weight: 600;
  border: 2px dashed var(--ci-purple);
  border-radius: 12px;
  pointer-events: none;
  z-index: 5;
}

/* ── Mensaje con attachment ── */
.ci-msg-attach {
  margin-top: 4px;
  width: 100%;
  max-width: 320px;
}

.ci-attach-image {
  border-radius: 10px;
  overflow: hidden;
  background: #f0f1f5;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}
.ci-msg-img {
  max-width: 100%;
  max-height: 320px;
  display: block;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s;
}
.ci-msg-img:hover {
  transform: scale(1.01);
}

.ci-attach-video,
.ci-msg-video {
  max-width: 100%;
  max-height: 360px;
  display: block;
  border-radius: 10px;
  background: #000;
}

/* ── Reproductor de audio custom (estilo WhatsApp) ── */
.ci-audio-player {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 14px;
  min-width: 240px;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid var(--ci-border);
  box-shadow: 0 2px 8px rgba(90, 100, 180, .15);
}
/* Mensaje propio: celeste suave para distinguirlo del ajeno (blanco) */
.ci-msg.own .ci-audio-player {
  background: #eaf2ff;
  border: 1px solid #d4e4fb;
}
/* Fila 1: botón play + barra/tiempo */
.ci-audio-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Fila 2: controles extra alineados a la derecha */
.ci-audio-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: -2px;
}
.ci-audio-ctrl {
  background: transparent;
  border: none;
  padding: 0;
  color: #9ca3af;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.ci-audio-ctrl:hover { color: var(--ci-purple); }
.ci-audio-speed {
  font-size: 12px;
  font-weight: 700;
  color: var(--ci-purple);
  min-width: 22px;
  justify-content: center;
}
.ci-audio-engine {
  display: none;
}
.ci-audio-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--ci-purple) 0%, var(--ci-light) 55%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform .1s;
}
.ci-audio-play:hover { transform: scale(1.06); }
.ci-audio-play:active { transform: scale(.96); }
/* Centrar el ícono play (que es ópticamente asimétrico) */
.ci-audio-play .fa-play { margin-left: 2px; }

.ci-audio-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ci-audio-track {
  height: 5px;
  background: rgba(120, 130, 170, .25);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.ci-audio-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--ci-purple);
  border-radius: 999px;
}
.ci-audio-track-handle {
  position: absolute;
  left: 0%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ci-purple);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.ci-audio-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ci-muted);
}

.ci-attach-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  transition: background .15s, border-color .15s;
}
.ci-attach-doc:hover {
  background: #fafbfd;
  border-color: var(--ci-purple);
}
.ci-attach-doc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef0fa;
  color: var(--ci-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ci-attach-doc-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ci-attach-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ci-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-attach-doc-size {
  font-size: 11px;
  color: var(--ci-muted);
}
.ci-attach-doc-download {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--ci-purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s;
}
.ci-attach-doc-download:hover {
  background: #eef0fa;
}

/* ═══════════════════════════════════════════
   LIGHTBOX (preview pantalla completa)
═══════════════════════════════════════════ */
.ci-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.ci-lb-content {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ci-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.ci-lb-pdf {
  width: 90vw;
  height: 90vh;
  max-width: 1100px;
  border: none;
  border-radius: 8px;
  background: #fff;
}

.ci-lb-close, .ci-lb-download, .ci-lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .15s;
}
.ci-lb-close:hover,
.ci-lb-download:hover,
.ci-lb-nav:hover {
  background: rgba(255, 255, 255, .25);
}
.ci-lb-close    { top: 20px; right: 20px; }
.ci-lb-download { top: 20px; right: 76px; }
.ci-lb-nav      { top: 50%; transform: translateY(-50%); }
.ci-lb-prev     { left: 20px; }
.ci-lb-next     { right: 20px; }

@media (max-width: 768px) {
  .ci-lightbox { padding: 16px; }
  .ci-lb-close    { top: 12px; right: 12px; }
  .ci-lb-download { top: 12px; right: 64px; }
}

/* ═══════════════════════════════════════════
   REPLY — Cita de mensajes (estilo WhatsApp)
═══════════════════════════════════════════ */

/* Banner arriba del input cuando hay cita pendiente */
.ci-reply-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-left: 3px solid var(--ci-purple);
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.ci-reply-icon {
  color: var(--ci-purple);
  font-size: 13px;
  flex-shrink: 0;
}
.ci-reply-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ci-reply-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ci-purple);
}
.ci-reply-preview {
  font-size: 12px;
  color: var(--ci-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-reply-cancel {
  background: transparent;
  border: none;
  color: var(--ci-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.ci-reply-cancel:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Cita renderizada dentro de un mensaje */
.ci-msg-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  background: rgba(142, 132, 250, .08);
  border-left: 3px solid var(--ci-purple);
  border-radius: 6px;
  cursor: pointer;
  max-width: 320px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  transition: background .15s;
}
.ci-msg-reply:hover {
  background: rgba(142, 132, 250, .15);
}
.ci-msg-reply-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--ci-purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-msg-reply-text {
  font-size: 12px;
  color: var(--ci-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Highlight cuando saltamos al mensaje original */
.ci-msg.ci-msg-highlight {
  animation: ciMsgHighlight 2s ease;
}
@keyframes ciMsgHighlight {
  0%   { background: rgba(142, 132, 250, .25); }
  100% { background: transparent; }
}

/* Menú "..." dentro del mensaje */
.ci-msg-menu-wrap {
  position: relative;
}
.ci-msg-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--ci-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  min-width: 180px;
  padding: 4px;
  z-index: 50;
}
.ci-msg-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ci-text);
  transition: background .15s;
}
.ci-msg-menu-item:hover {
  background: #f5f3ff;
  color: var(--ci-purple);
}
.ci-msg-menu-item i {
  width: 14px;
  text-align: center;
  color: var(--ci-muted);
}

/* ── Thumbnail en cita (banner del input y mensaje embebido) ── */
.ci-reply-texts {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ci-reply-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.ci-msg-reply-texts {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ci-msg-reply-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Micrófono grabando ── */
.ci-mic-recording {
  color: #ef4444 !important;
  animation: ciMicPulse 1s ease-in-out infinite;
}
.ci-input-btn.recording {
  background: #fef2f2;
}
@keyframes ciMicPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ── Indicador de carga al subir adjuntos ── */
@keyframes ciSpin {
  to { transform: rotate(360deg); }
}
/* Overlay sobre el thumbnail (oculto por defecto) */
.ci-attach-uploading {
  position: absolute;
  inset: 0;
  background: rgba(40, 45, 70, .55);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}
/* Se muestra solo cuando el preview está en estado .uploading */
.ci-attach-preview.uploading .ci-attach-uploading {
  display: flex;
}
/* Mientras sube, deshabilitar el botón de quitar */
.ci-attach-preview.uploading .ci-attach-remove {
  pointer-events: none;
  opacity: .4;
}
.ci-attach-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ciSpin .7s linear infinite;
}
/* Spinner dentro del botón enviar */
.ci-send-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ciSpin .7s linear infinite;
  display: inline-block;
}