/* ===== Chat de WhatsApp dentro del panel ===== */
.wa-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: white; border: 1px solid var(--gris-borde); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-size: 13.5px; }
.wa-barra .ok { color: #1e7b46; font-weight: 700; } .wa-barra .no { color: #8a6100; font-weight: 700; }
.wa-aviso { background: #fff8e1; color: #8a6100; border: 1px solid #f3dc9a; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.6; }
.wa-aviso code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }

.wa-app { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 250px); min-height: 460px; background: white; border: 1px solid var(--gris-borde); border-radius: 12px; overflow: hidden; }
.wa-lista { border-right: 1px solid var(--gris-borde); display: flex; flex-direction: column; min-height: 0; }
.wa-lista input { margin: 10px; padding: 9px 12px; border: 1px solid var(--gris-borde); border-radius: 8px; font-size: 13.5px; }
#wa-contactos { overflow-y: auto; flex: 1; }
.wa-item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f2f5; align-items: center; }
.wa-item:hover { background: #f5f7fa; } .wa-item.activo { background: #e8f0fa; }
.wa-avatar { width: 40px; height: 40px; border-radius: 50%; background: #c9d9ea; color: #2c4a6e; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: 14px; }
.wa-item .cuerpo { flex: 1; min-width: 0; }
.wa-item .nombre { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-item .sub { font-size: 12px; color: var(--gris-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-item .meta { text-align: right; font-size: 11px; color: var(--gris-texto); flex: none; }
.wa-badge { background: #25d366; color: white; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 6px; }
.wa-item .meta .wa-badge { display: inline-block; margin: 4px 0 0; }

.wa-chat { display: flex; flex-direction: column; min-height: 0; background: #efeae2; }
.wa-vacio { margin: auto; text-align: center; color: #667781; font-size: 14px; padding: 20px; max-width: 360px; line-height: 1.6; }
.wa-chat-head { background: #f0f2f5; padding: 11px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #dfe3e7; }
.wa-chat-head .t { font-weight: 700; font-size: 14.5px; } .wa-chat-head .s { font-size: 12px; color: #667781; }
.wa-mensajes { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; }
.wa-burbuja { max-width: 68%; padding: 7px 10px 4px; border-radius: 8px; font-size: 13.5px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.1); line-height: 1.4; }
.wa-in { align-self: flex-start; background: white; } .wa-out { align-self: flex-end; background: #d9fdd3; }
.wa-burbuja.wa-err { background: #fde9ec; border: 1px solid #f0c4be; }
.wa-burbuja .wa-error { color: #b0283f; font-size: 12px; margin-top: 4px; white-space: normal; }
.wa-hora { font-size: 10.5px; color: #667781; text-align: right; margin-top: 2px; }
.wa-dia { align-self: center; background: #e1f2fb; color: #54656f; font-size: 11.5px; padding: 3px 10px; border-radius: 8px; margin: 8px 0 4px; }
.wa-compositor { display: flex; gap: 8px; padding: 10px 12px; background: #f0f2f5; align-items: flex-end; flex-wrap: wrap; }
.wa-compositor textarea { flex: 1; min-width: 200px; resize: none; padding: 9px 12px; border: 1px solid #d1d7db; border-radius: 8px; font-family: inherit; font-size: 13.5px; max-height: 120px; }
.wa-compositor .nota { flex-basis: 100%; font-size: 11.5px; color: #667781; }
.wa-qr { text-align: center; } .wa-qr img { width: 260px; height: 260px; image-rendering: pixelated; border: 1px solid var(--gris-borde); border-radius: 8px; padding: 6px; background: white; }
.wa-pasos { text-align: left; font-size: 13.5px; line-height: 1.8; margin: 0 0 12px 18px; padding: 0; }

@media (max-width: 900px) { .wa-app { grid-template-columns: 1fr; height: auto; } .wa-lista { max-height: 260px; } .wa-chat { min-height: 420px; } }
