/* Inbox */

.chat-inbox-window .x-window-body {
    background: #fff;
}

.chat-inbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    cursor: pointer;
    border-bottom: 1px solid #e6edf7;
}

.chat-inbox-row:hover {
    background: #eef5ff;
}

.chat-inbox-row__main {
    min-width: 0;
    flex: 1;
}

.chat-inbox-row__title {
    font-weight: 600;
    color: #17406f;
    margin-bottom: 4px;
}

.chat-inbox-row__message {
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-inbox-row__sender {
    font-weight: 600;
    color: #555;
}

.chat-inbox-row__time {
    margin-top: 3px;
    font-size: 11px;
    color: #888;
}

.chat-inbox-row__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
}

/* Task modal */

.task-chat-modal__summary {
    background: #fff;
    border-right: 1px solid #d9d9d9;
}

.task-chat-summary__row {
    display: flex;
    margin-bottom: 12px;
}

.task-chat-summary__label {
    width: 120px;
    color: #555;
}

.task-chat-summary__value {
    flex: 1;
    color: #222;
    font-weight: 600;
}

.task-chat-summary__divider {
    height: 1px;
    background: #ddd;
    margin: 20px 0;
}

.task-chat-summary__section-title {
    color: #555;
    margin-bottom: 8px;
}

.task-chat-summary__text {
    padding: 14px;
    border: 1px solid #d5d0c7;
    border-radius: 8px;
    background: #f7f5ef;
    color: #222;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Chat panel */

.task-chat-panel {
    background: #fff;
}

.task-chat-message {
    display: flex;
    align-items: flex-start;
    max-width: 78%;
    margin: 0 0 18px 0;
    clear: both;
}

.task-chat-message--own {
    justify-content: flex-end;
    margin-left: auto;
}

.task-chat-message__avatar {
    width: 28px;
    height: 28px;
    margin: 4px 8px 0 0;
    border-radius: 50%;
    background: #efe8da;
    color: #555;
    font-size: 11px;
    line-height: 28px;
    text-align: center;
    font-weight: 600;
    flex: 0 0 28px;
}

.task-chat-message__content {
    min-width: 0;
}

.task-chat-message--own .task-chat-message__content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.task-chat-message__bubble {
    display: inline-block;
    max-width: 100%;
    padding: 8px 12px 9px;
    border-radius: 12px;
    background: #f7f5ef;
    border: 1px solid #d5d0c7;
    color: #222;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    white-space: normal;
}

.task-chat-message__text {
    color: inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

.task-chat-message--own .task-chat-message__bubble {
    background: #d9ecff;
    border-color: #9fc7ef;
}

.task-chat-message__author {
    margin-bottom: 3px;
    color: #2f7d32;
    font-size: 13px;
    line-height: 16px;
    font-weight: 600;
}

.task-chat-message__time {
    margin-top: 6px;
    font-size: 12px;
    line-height: 14px;
    color: #888;
}

.task-chat-message--own .task-chat-message__time {
    text-align: right;
}

.task-chat-panel__messages {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #fff;
    border-bottom: 1px solid #d7e3f3;
    padding: 16px;
    box-sizing: border-box;
    min-height: 0;
}

.task-chat-panel__empty {
    color: #888;
    text-align: center;
    padding-top: 32px;
}

.task-chat-panel__messages--loading {
    visibility: hidden;
}


/*Composer-box*/
.task-chat-panel__composer {
    background: #f4f8fd;
    border-top: 1px solid #d7e3f3;
}

.task-chat-panel__message-field,
.task-chat-panel__message-field:focus,
.x-form-focus .task-chat-panel__message-field {
    min-height: 36px !important;
    padding: 7px 12px !important;
    border: 1px solid #cfd9e6 !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    resize: none;
    overflow-y: hidden;
    font-size: 13px;
    line-height: 18px;
    outline: none !important;
}

.task-chat-panel__message-field:focus,
.x-form-focus .task-chat-panel__message-field {
    border-color: #9fc7ef !important;
}

.task-chat-panel__message-field:focus::placeholder {
    color: transparent;
}

.task-chat-panel__send-wrapper {
    height: 100%;
}

.task-chat-panel__send-wrapper .x-box-inner{
    height: 100%;
}

.task-chat-panel__send-button {
    border-radius: 18px !important;
    font-weight: bold;
    font-size: 14px;
}

.task-chat-message__avatar--image {
    color: transparent;
}

.task-chat-date-separator {
    position: sticky;
    top: 8px;
    z-index: 2;
    display: flex;
    justify-content: center;
    margin: 8px 0 18px;
    clear: both;
    pointer-events: none;
}

.task-chat-date-separator span {
    padding: 5px;
    width: 110px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 14px;
    background: #eef0f2;
    border: 1px solid #d5d9de;
    color: #4f5b66;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0.025em;
}

.task-chat-icon--empty {
    color: #9aa6b2;
}

.task-chat-icon--has-messages {
    color: #2f80d1;
}

.task-chat-icon--unread {
    color: #2f80d1;
}

.task-chat-icon:hover {
    color: #1f5f9f;
}

.task-chat-icon-cell {
    overflow: visible !important;
}

.task-chat-icon-cell .x-grid-cell-inner {
    overflow: visible !important;
    padding: 3px 0 !important;
}

.task-chat-icon {
    position: relative;
    display: inline-flex;
    width: 28px;
    height: 24px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    vertical-align: middle;
    overflow: visible;
}

.task-chat-icon__svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.task-chat-icon__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #e53935;
    color: #fff;
    font-size: 9px;
    line-height: 14px;
    text-align: center;
    font-weight: bold;
    box-sizing: border-box;
}
