/* ══════ CHAT ══════ */
.chat-panel { width: 340px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border); display: none; flex-direction: column; overflow: hidden; }
.chat-panel.open { display: flex; }
.chat-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: .5rem; }
.chat-header .nombre { font-size: .82rem; font-weight: 600; color: #fff; }
.chat-header .modelo { font-size: .7rem; color: var(--muted); margin-top: .1rem; }
.chat-header-actions { display: flex; gap: .35rem; align-items: center; }
.btn-edit { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 5px; padding: .2rem .5rem; font-size: .7rem; cursor: pointer; }
.btn-edit:hover { color: var(--accent); border-color: var(--accent); }
.btn-trash { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 5px; padding: .2rem .5rem; font-size: .7rem; cursor: pointer; }
.btn-trash:hover { color: var(--offline); border-color: var(--offline); background: rgba(248,81,73,.08); }
.btn-cerrar { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.btn-cerrar:hover { color: #fff; }

.btn-historial { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 5px; padding: .2rem .5rem; font-size: .7rem; cursor: pointer; }
.btn-historial:hover { color: var(--accent); border-color: var(--accent); }
.btn-historial.active { color: var(--accent); border-color: var(--accent); background: rgba(88,166,255,.1); }

/* ══════ ALERTAS DEL CHAT ══════ */
.alertas-chat { background: rgba(210,153,34,.08); border-bottom: 1px solid rgba(210,153,34,.25); max-height: 140px; overflow-y: auto; }
.alertas-chat.oculto { display: none; }
.alerta-item { padding: .4rem .8rem; font-size: .72rem; display: flex; gap: .4rem; align-items: flex-start; border-bottom: 1px solid rgba(210,153,34,.15); }
.alerta-item:last-child { border-bottom: none; }
.alerta-item .icon { flex-shrink: 0; }
.alerta-item .fecha { color: var(--muted); font-size: .65rem; margin-left: auto; white-space: nowrap; }

/* ══════ MENSAJES ══════ */
.chat-messages { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.burbuja { max-width: 80%; padding: .5rem .75rem; border-radius: 10px; font-size: .78rem; line-height: 1.45; word-break: break-word; transition: opacity .2s; }
.burbuja.empleado { background: #21262D; align-self: flex-start; border-bottom-left-radius: 3px; }
.burbuja.central  { background: #1C3557; color: #9ECAFF; align-self: flex-end; border-bottom-right-radius: 3px; }
.burbuja .hora { font-size: .65rem; color: var(--muted); margin-top: .25rem; }
.burbuja img { max-width: 100%; border-radius: 6px; margin-top: .25rem; }
.chat-vacio { color: var(--muted); font-size: .78rem; text-align: center; padding: 2rem 0; }

/* ══════ INPUT DEL CHAT ══════ */
.chat-input-area { padding: .65rem; border-top: 1px solid var(--border); display: flex; gap: .4rem; flex-shrink: 0; }
.chat-input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .45rem .7rem; font-size: .8rem; resize: none; outline: none; font-family: inherit; }
.chat-input:focus { border-color: var(--accent); }
.btn-enviar { background: var(--accent); color: #0D1117; border: none; border-radius: 8px; padding: .45rem .75rem; font-size: .8rem; font-weight: 600; cursor: pointer; }
.btn-enviar:hover { opacity: .85; }

.btn-adjuntar {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .6rem;
  font-size: .9rem;
  cursor: pointer;
  line-height: 1;
}
.btn-adjuntar:hover { color: var(--accent); border-color: var(--accent); }
.btn-adjuntar:disabled { opacity: .5; cursor: not-allowed; }

