/* ========================================
   Collaboration chat — shared by the supplier
   Compliance Test page and the buyer Hub dashboard.
   Scoped by (tradingPartnerId, testScenarioId, vnId).
   ======================================== */

/* ---- trigger icon (scenario header / supplier row) ---- */
.collab-msg-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #2968E9;
    font-size: 15px;
    padding: 4px 6px;
    position: relative;
    line-height: 1;
    transition: color 0.15s;
}

    .collab-msg-icon:hover {
        color: #1e50b5;
    }

/* unread-message count badge (replaces the old red dot).
   Shown top-right of the icon whenever there are unread messages. */
.collab-msg-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 8px;
    background: #e24c4c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    font-style: normal; /* parent <i> may be italic */
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

/* ---- floating chat panel ---- */
.collab-chat-panel {
    position: fixed;
    bottom: 0;
    right: 24px;
    width: 380px;
    max-height: 540px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.16);
    z-index: 12000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.collab-chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .collab-chat-header h5 {
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
    }

    .collab-chat-header span {
        font-size: 12px;
        color: #888;
    }

.collab-chat-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.collab-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
    background: #fafafa;
}

.collab-chat-empty {
    text-align: center;
    color: #aaa;
    padding: 40px 0;
    font-size: 13px;
}

.collab-chat-msg {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

    .collab-chat-msg.incoming {
        background: #f3f0ff;
        color: #333;
        align-self: flex-start;
        border-bottom-left-radius: 4px;
    }

    .collab-chat-msg.outgoing {
        background: #eef2f8;
        color: #333;
        align-self: flex-end;
        border-bottom-right-radius: 4px;
    }

    .collab-chat-msg .collab-chat-sender {
        font-size: 11px;
        font-weight: 700;
        color: #7c3aed;
        margin-bottom: 4px;
    }

    .collab-chat-msg.outgoing .collab-chat-sender {
        color: #2968e9;
    }

    .collab-chat-msg .collab-chat-time {
        font-size: 10px;
        color: #bbb;
        margin-top: 4px;
    }

    .collab-chat-msg .collab-chat-attachment {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-top: 6px;
        font-size: 12px;
        color: #555;
    }

        .collab-chat-msg .collab-chat-attachment a {
            color: #2968e9;
            text-decoration: none;
        }

.collab-chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 10px 16px 4px;
    flex-wrap: wrap;
}

    .collab-chat-suggestions button {
        padding: 6px 14px;
        border-radius: 999px;
        border: 1.5px solid #d6d0f0;
        background: #fff;
        color: #7c3aed;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }

        .collab-chat-suggestions button:hover {
            background: #f3f0ff;
        }

.collab-chat-pending {
    padding: 6px 16px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .collab-chat-pending .chip {
        background: #f3f0ff;
        border-radius: 8px;
        padding: 4px 10px;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

        .collab-chat-pending .chip .rm {
            cursor: pointer;
            color: #e24c4c;
            font-weight: 700;
        }

.collab-chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #eee;
}

    .collab-chat-footer input[type="text"] {
        flex: 1;
        height: 36px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid #ddd;
        font-size: 13px;
        outline: none;
    }

        .collab-chat-footer input[type="text"]:focus {
            border-color: #7c3aed;
        }

    .collab-chat-footer .collab-send-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: #2968E9;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex: 0 0 auto;
    }

    .collab-chat-footer .collab-attach-btn {
        background: none;
        border: none;
        color: #aaa;
        font-size: 16px;
        cursor: pointer;
        margin: 0;
    }
