/* ===== Custom RTE Editor (no Syncfusion) ===== */
.rteEditorWrap {
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    transition: border-color .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    overflow: hidden;
}

    .rteEditorWrap:focus-within {
        border-color: #4CAF50;
        box-shadow: 0 0 0 3px rgba(76,175,80,.12);
    }

    .rteEditorWrap.rte-disabled {
        opacity: .6;
        pointer-events: none;
    }

.rteToolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: linear-gradient(180deg,#fafafa,#f1f3f4);
    border-bottom: 1px solid #e0e0e0;
    user-select: none;
}

    .rteToolbar .rteBtn {
        border: 0;
        background: transparent;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        color: #455A64;
        font-size: 13px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background .12s ease, color .12s ease, transform .12s ease;
    }

        .rteToolbar .rteBtn:hover {
            background: #e8f5e9;
            color: #2E7D32;
            transform: translateY(-1px);
        }

        .rteToolbar .rteBtn:active {
            transform: translateY(0);
            background: #c8e6c9;
        }

    .rteToolbar .rteSep {
        width: 1px;
        height: 18px;
        background: #cfd8dc;
        margin: 0 4px;
    }

.rteContent {
    min-height: 90px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px 14px;
    outline: none;
    font-size: 13px;
    line-height: 20px;
    color: #212121;
    word-break: break-word;
}

    .rteContent[contenteditable="true"]:empty:before {
        content: attr(data-placeholder);
        color: #9e9e9e;
        pointer-events: none;
        display: block;
    }

    .rteContent blockquote {
        border-left: 3px solid #4CAF50;
        margin: 6px 0;
        padding: 4px 10px;
        background: #f1f8e9;
        color: #33691E;
        border-radius: 4px;
    }

    .rteContent ul, .rteContent ol {
        padding-left: 22px;
        margin: 4px 0;
    }

    .rteContent a {
        color: #1976D2;
        text-decoration: underline;
    }

/* Mentions inside editor + render output */
.rteContent .mentionUserName,
.divCrewCommentThread .remark .mentionUserName {
    background: #E8F5E9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #388E3C;
    font-weight: 500;
    cursor: default;
}

    .rteContent .mentionUserName:before,
    .divCrewCommentThread .remark .mentionUserName:before {
        font-family: "Font Awesome 6 Pro";
        content: "\40";
        margin-right: 3px;
    }

.rteContent .mentionDepartment,
.divCrewCommentThread .remark .mentionDepartment {
    background: #F3E5F5;
    padding: 2px 6px;
    border-radius: 4px;
    color: #7B1FA2;
    font-weight: 500;
    cursor: default;
}

    .rteContent .mentionDepartment:before,
    .divCrewCommentThread .remark .mentionDepartment:before {
        font-family: "Font Awesome 6 Pro";
        content: "\f02c";
        margin-right: 3px;
    }

/* RTE popups (color/size/emoji/link) - rendered into document.body */
.rte-popup {
    position: fixed;
    z-index: 2147483600;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 8px;
    animation: rtePopIn .12s ease-out;
}

@keyframes rtePopIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rte-popup-color {
    display: grid;
    grid-template-columns: repeat(8, 22px);
    gap: 4px;
}

.rte-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,.08);
    transition: transform .1s ease;
}

    .rte-color-swatch:hover {
        transform: scale(1.15);
    }

.rte-color-custom {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
    margin-top: 4px;
    font-size: 12px;
    color: #555;
}

.rte-popup-size {
    min-width: 100px;
}

.rte-size-item {
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1.2;
}

    .rte-size-item:hover {
        background: #e8f5e9;
        color: #2E7D32;
    }

.rte-popup-emoji {
    width: 280px;
    max-height: 220px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(10, 24px);
    gap: 2px;
}

.rte-emoji-item {
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 4px;
    transition: transform .1s ease, background .1s ease;
}

    .rte-emoji-item:hover {
        background: #fff3e0;
        transform: scale(1.25);
    }

.rte-popup-link {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 6px;
}

    .rte-popup-link input {
        border: 1px solid #cfd8dc;
        border-radius: 6px;
        padding: 5px 8px;
        font-size: 12px;
        min-width: 240px;
        outline: none;
    }

        .rte-popup-link input:focus {
            border-color: #4CAF50;
        }

    .rte-popup-link button {
        border: 0;
        border-radius: 6px;
        background: #4CAF50;
        color: #fff;
        padding: 5px 12px;
        cursor: pointer;
        font-weight: 500;
    }

        .rte-popup-link button:hover {
            background: #2E7D32;
        }

/* Mention popup */
.rte-mention-popup {
    position: fixed;
    z-index: 2147483600;
    width: 290px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    padding: 4px;
    animation: rtePopIn .12s ease-out;
}

.rte-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

    .rte-mention-item:last-child {
        border-bottom: 0;
    }

    .rte-mention-item.active,
    .rte-mention-item:hover {
        background: #E8F5E9;
    }

.rte-mention-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.rte-mention-username {
    font-weight: 600;
    color: #D32F2F;
    font-size: 12px;
}

.rte-mention-fullname {
    color: #455A64;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rte-mention-empty {
    padding: 10px;
    text-align: center;
    color: #9e9e9e;
    font-size: 12px;
    font-style: italic;
}

/* ===== Inline composer ===== */
.composerSlot {
    padding: 10px;
    background: #f5f5f5;
    animation: composerSlide .25s ease-out;
}

.composerSlotTop {
    border-bottom: 1px solid #e0e0e0;
}

.composerSlotReply,
.composerSlotEdit {
    margin-top: 6px;
    background: #FFFDE7;
    border-left: 3px solid #FFB300;
    border-radius: 6px;
}

@keyframes composerSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
        max-height: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 1500px;
    }
}

.inlineComposer {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    overflow: hidden;
    transition: box-shadow .15s ease;
}

    .inlineComposer:focus-within {
        box-shadow: 0 6px 18px rgba(76,175,80,.18);
    }

    .inlineComposer.isReply {
        background: #FFFEF7;
    }

.composerHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(180deg,#fafafa,#f1f3f4);
    border-bottom: 1px solid #eee;
    user-select: none;
}

.composerTitle {
    font-weight: 700;
    color: #C2185B;
    font-size: 11px;
    letter-spacing: 1px;
}

    .composerTitle i {
        margin-right: 6px;
        font-weight:700 !important;
    }

.composerClose {
    cursor: pointer;
    color: #B71C1C;
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease;
}

    .composerClose:hover {
        background: #FFEBEE;
    }

.composerBody {
    display: flex;
    gap: 10px;
    padding: 10px;
}

.composerAvatar img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #4CAF50;
    background: #fff;
    object-fit: cover;
}

.composerEditor {
    flex: 1;
    min-width: 0;
}

.composerExistingFiles {
    padding: 0 10px 6px;
}

    .composerExistingFiles .lstFiles {
        background: #ECEFF1;
        padding: 4px 10px;
        border-radius: 4px;
        margin-bottom: 4px;
        font-size: 12px;
        color: #455A64;
    }

.composerUploader {
    padding: 0 10px 6px;
}

.composerUploaderBox {
    border: 1px dashed #cfd8dc;
    border-radius: 8px;
    background: #fafafa;
    padding: 4px;
}

.composerActions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

    .composerActions .e-control.e-btn.btnPostInline {
        background: #388E3C !important;
        color: #fff !important;
        border: 0 !important;
        border-radius: 6px !important;
        height: 30px !important;
        font-weight: 500 !important;
        box-shadow: 0 2px 6px rgba(76,175,80,.35) !important;
    }

        .composerActions .e-control.e-btn.btnPostInline:hover {
            background: #2E7D32 !important;
        }

    .composerActions .e-control.e-btn.btnCancelInline {
        background: #ECEFF1 !important;
        color: red !important;
        border: 0 !important;
        border-radius: 6px !important;
        height: 30px !important;
        font-weight: 500 !important;
    }

        .composerActions .e-control.e-btn.btnCancelInline:hover {
            color: #B71C1C !important;
        }

.composerHint {
    margin-left: auto;
    font-size: 11px;
    color: #78909C;
    font-style: italic;
}

    .composerHint i {
        margin-right: 4px;
    }

    .composerHint b {
        color: #2E7D32;
        font-weight: 600;
    }

.divCrewCommentThread.isEditing {
    opacity: .55;
}

/* ===== Parent quote (multi-level reply context) ===== */
.parentQuote {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 8px 50px;
    padding: 6px 12px;
    background: linear-gradient(90deg,#f1f8ff 0%,#fafafa 100%);
    border-left: 3px solid #1976d2;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #455a64;
    transition: background .15s ease, transform .15s ease;
    max-width: calc(100% - 60px);
}

    .parentQuote:hover {
        background: linear-gradient(90deg,#e3f2fd 0%,#f5f5f5 100%);
        transform: translateX(2px);
    }

.parentQuoteIco {
    color: #1976d2;
    font-size: 11px;
}

.parentQuoteUser {
    font-weight: 600;
    color: #1565c0;
    flex-shrink: 0;
}

.parentQuoteText {
    color: #607d8b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
}

/* ===== Reactions bar ===== */
.rxBar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 6px 50px;
    padding-top: 4px;
}

.rxPickerWrap {
    position: relative;
}

.rxAddBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    cursor: pointer;
    font-size: 12px;
    color: #546e7a;
    transition: all .15s ease;
    line-height: 1;
}

    .rxAddBtn:hover:not(:disabled) {
        background: #fff;
        border-color: #1976d2;
        color: #1976d2;
        box-shadow: 0 2px 6px rgba(25,118,210,.15);
    }

    .rxAddBtn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

    .rxAddBtn .rxIcon {
        font-size: 16px;
    }

.rxPicker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    display: none;
    gap: 2px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    z-index: 50;
    white-space: nowrap;
    animation: rxPickerIn .18s ease both;
}

.rxPickerWrap:hover .rxPicker,
.rxPickerWrap:focus-within .rxPicker {
    display: inline-flex;
}

.rxItem {
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}

    .rxItem:hover {
        transform: scale(1.35) translateY(-3px);
        background: #f5f5f5;
    }

    .rxItem.active {
        background: #e3f2fd;
        box-shadow: 0 0 0 2px #1976d2 inset;
    }

@keyframes rxPickerIn {
    from { opacity: 0; transform: translateY(6px) scale(.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rxChip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 14px;
    background: #f5f5f5;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 12px;
    color: #455a64;
    transition: all .12s ease;
    user-select: none;
}

    .rxChip:hover {
        background: #eceff1;
        transform: translateY(-1px);
    }

    .rxChip.mine {
        background: #e3f2fd;
        border-color: #90caf9;
        color: #0d47a1;
        font-weight: 600;
    }

.rxChipIco {
    font-size: 14px;
    line-height: 1;
}

.rxChipNum {
    font-size: 11px;
    font-weight: 600;
}

/* ===== Chat button next to Reply ===== */
.chatRemark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #00897b;
    margin-right: 10px;
    transition: color .12s ease;
}

    .chatRemark:hover {
        color: #00695c;
    }

/* Sub-thread paging — active state */
.subThreadCommentPage .pNo.active {
    background: #1976d2;
    color: #fff;
    border-color: #1976d2;
}

