/* =====================================================================================
   Adjuntos del chat del asistente (5-nov-2026): clip, chips de lo pendiente, zona de soltar y miniaturas en el mensaje.
   Usa las variables de los 4 temas (--bg-surface, --bg-page, --text-primary, --text-muted, --bar-border): el ícono de
   «quitar» es un bi-x-lg con el color del texto (btn-close no se ve en el tema oscuro).
   ===================================================================================== */

/* Zona de soltar: todo el panel se resalta mientras se arrastra un archivo encima. */
.chat-panel.asis-adj-arrastrando { outline: 3px dashed #667eea; outline-offset: -6px; }
.chat-panel.asis-adj-arrastrando::after {
    content: "Soltá acá para adjuntar";
    position: absolute; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center;
    background: rgba(102, 126, 234, 0.14);
    color: var(--text-primary, #1f2937);
    font-weight: 600; font-size: 1.05rem;
    border-radius: inherit;
    pointer-events: none;
}

/* Lo pendiente de mandar (arriba del cuadro de texto). */
.asis-adj-pendientes {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    padding: 8px 12px 0;
    background: var(--bg-surface, #fff);
    border-top: 1px solid var(--bar-border, #e9ecef);
}
.asis-adj-chip {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 100%;
    padding: 4px 4px 4px 10px;
    border-radius: 16px;
    border: 1px solid var(--bar-border, #dee2e6);
    background: var(--bg-page, #f8f9fa);
    color: var(--text-primary, #333);
    font-size: 0.85rem; line-height: 1.2;
}
.asis-adj-chip > .bi { font-size: 1rem; color: #667eea; }
.asis-adj-chip__nombre { min-width: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asis-adj-chip__tam { color: var(--text-muted, #6c757d); white-space: nowrap; }
.asis-adj-chip__quitar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    border: none; border-radius: 50%;
    background: transparent;
    color: var(--text-primary, #333);
    cursor: pointer;
}
.asis-adj-chip__quitar:hover, .asis-adj-chip__quitar:focus-visible { background: rgba(245, 87, 108, 0.15); color: #f5576c; outline: none; }
.asis-adj-chip--enviado { padding-right: 10px; }
.asis-adj-leyendo { font-size: 0.85rem; color: var(--text-muted, #6c757d); }
.asis-adj-error {
    flex: 1 1 100%;
    font-size: 0.82rem;
    color: #b02a37;
    background: rgba(220, 53, 69, 0.08);
    border-radius: 8px;
    padding: 4px 8px;
}
/* Temas oscuros (esmeralda y linear): el rojo claro se lee sobre el fondo oscuro. */
html[data-theme="linear"] .asis-adj-error,
html[data-theme="esmeralda"] .asis-adj-error { color: #ff8a95; background: rgba(255, 138, 149, 0.12); }

/* Lo adjuntado en el mensaje del usuario: miniatura (imágenes) o chip (documentos). */
.asis-adj-msg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.asis-adj-msg__mini {
    max-width: 160px; max-height: 120px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--bar-border, #dee2e6);
    background: var(--bg-page, #f8f9fa);
    cursor: zoom-in;
}
/* Mensaje solo con adjunto (sin texto): no se dibuja la burbuja vacía. */
.mensaje.usuario .texto-msg:empty { display: none; }

@media (max-width: 480px) {
    .chat-panel .chat-input { gap: 6px; padding: 10px; }
    .asis-adj-chip__nombre { max-width: 110px; }
    .asis-adj-chip__quitar { width: 44px; height: 44px; margin: -8px -4px -8px 0; }
    .asis-adj-msg__mini { max-width: 130px; }
}
