/* =========================================================================
 *  rbnd-messages.css — Khung chat nổi (chi tiết tin / người bán) + Hộp thư
 * ========================================================================= */

.msg-widget {
    margin-top: 12px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.msg-widget__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f0f8f4;
    border-bottom: 1px solid #e9ecef;
}

.msg-widget__title { font-weight: 700; color: #212529; }

.msg-widget__status {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
    padding-left: 14px;
    position: relative;
}
.msg-widget__status::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 8px; height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: #adb5bd;
}
.msg-widget__status.is-online { color: #198754; }
.msg-widget__status.is-online::before { background: #198754; }

.msg-widget__close {
    border: 0; background: none; font-size: 20px; line-height: 1;
    color: #6c757d; cursor: pointer; padding: 0 2px;
}

.msg-widget__list,
.msg-thread__list {
    max-height: 320px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-widget__loading,
.msg-widget__error {
    color: #6c757d;
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
}
.msg-widget__error { color: #dc3545; }

.msg-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}
.msg-bubble.is-other { align-self: flex-start; background: #f1f3f5; color: #212529; border-bottom-left-radius: 3px; }
.msg-bubble.is-me    { align-self: flex-end;   background: #0a603d; color: #fff;    border-bottom-right-radius: 3px; }

.msg-bubble__role {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: .75;
    margin-bottom: 2px;
}

.msg-bubble__text { margin: 0; white-space: pre-wrap; word-break: break-word; }

.msg-bubble__time {
    display: block;
    font-size: 11px;
    opacity: .7;
    margin-top: 3px;
    text-align: right;
}

.msg-widget__suggest,
.msg-thread__suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
}
.msg-widget__suggest button,
.msg-thread__suggest button {
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
}
.msg-widget__suggest button:hover,
.msg-thread__suggest button:hover { background: #f0f8f4; border-color: #0a603d; color: #0a603d; }

.msg-widget__form,
.msg-thread__form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e9ecef;
}
.msg-widget__form textarea,
.msg-thread__form textarea {
    flex: 1;
    resize: none;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
}
.msg-widget__form button,
.msg-thread__form button { align-self: flex-end; }

/* ---------------- Trang "Hộp thư" — danh sách cuộc trò chuyện ---------------- */

.msg-thread-list { list-style: none; margin: 0; padding: 0; }
.msg-thread-list li + li { border-top: 1px solid #e9ecef; }

.msg-thread-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 6px;
    text-decoration: none;
    color: inherit;
}
.msg-thread-list li.is-unread a { background: #f8fbf9; }

.msg-thread-list img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-thread-list__body { flex: 1; min-width: 0; }
.msg-thread-list__name { font-weight: 700; color: #212529; display: flex; align-items: center; gap: 6px; }
.msg-thread-list__preview {
    margin: 2px 0 0;
    color: #6c757d;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-thread-list li.is-unread .msg-thread-list__preview { color: #212529; font-weight: 600; }

.msg-thread-list__meta { text-align: right; flex-shrink: 0; }
.msg-thread-list__time { display: block; font-size: 12px; color: #adb5bd; }

.msg-online-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #adb5bd;
}
.msg-online-dot.is-online { background: #198754; }

.msg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.msg-thread-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.msg-thread-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* ---------------- Tab "Giới thiệu / Tin đang đăng" ở trang người bán ---------------- */

.seller-tabs__nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 16px;
}
.seller-tabs__nav button {
    border: 0;
    background: none;
    padding: 10px 16px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.seller-tabs__nav button.is-active { color: #0a603d; border-bottom-color: #0a603d; }

.seller-intro { line-height: 1.7; color: #343a40; white-space: pre-wrap; }
