/**
 * Estilos del inbox WhatsApp (bandeja del taller).
 */

.wa-inbox {
    height: min(72vh, 680px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wa-inbox > .row {
    flex: 1 1 auto;
    min-height: 0;
}

.wa-inbox-list,
.wa-inbox-thread {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.wa-inbox-list {
    display: flex;
    flex-direction: column;
}

.wa-conversation-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.wa-conversation-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0.85rem 1rem;
    cursor: pointer;
}

.wa-conversation-item:hover,
.wa-conversation-item.active {
    background: #f0f4ff;
}

.wa-conversation-item .wa-conv-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.wa-conversation-item .wa-conv-preview {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-inbox-thread {
    display: flex;
    flex-direction: column;
}

#wa-thread-empty,
#wa-thread {
    min-height: 0;
}

#wa-thread {
    height: 100%;
    overflow: hidden;
}

.wa-thread-header,
.wa-thread-composer {
    flex: 0 0 auto;
}

.wa-thread-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #f8f9fa;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wa-bubble {
    max-width: 75%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.925rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.wa-bubble-cliente {
    align-self: flex-end;
    background: #0d6efd;
    color: #fff;
}

.wa-bubble-bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e9ecef;
}

.wa-bubble-humano {
    align-self: flex-start;
    background: #d1e7dd;
    border: 1px solid #badbcc;
}

.wa-bubble-meta {
    display: block;
    font-size: 0.7rem;
    opacity: 0.75;
    margin-top: 0.25rem;
}

@media (max-width: 767.98px) {
    .wa-inbox {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .wa-inbox > .row {
        min-height: 0;
    }

    .wa-inbox-list {
        max-height: 240px;
        height: auto;
    }

    .wa-inbox-thread {
        height: min(65vh, 520px);
        min-height: 420px;
    }
}
