.aims-chat-button {
    position: fixed;
    right: 24px;
    bottom: 55px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #ffffff;
    border-radius: 50%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    font-size: 22px;
    transition: all 0.2s ease;
}

.aims-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.42);
}

.aims-chat-total-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 999px;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    font-weight: 700;
}

.aims-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 118px;
    width: 430px;
    height: 640px;
    background: #ffffff;
    border-radius: 18px;
    z-index: 99999;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.aims-chat-header {
    height: 60px;
    background: linear-gradient(135deg, #111827, #253244);
    color: #ffffff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aims-chat-header strong {
    font-size: 17px;
    font-weight: 700;
    display: block;
    line-height: 20px;
    text-transform: capitalize;
}

.aims-chat-subtitle {
    font-size: 12px;
    color: #d1d5db;
    margin-top: 5px;
    line-height: 16px;
}

.aims-chat-close {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aims-chat-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.aims-chat-tabs {
    height: 54px;
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.aims-chat-tab {
    flex: 1;
    border: 0;
    background: #ffffff;
    font-size: 14px;
    cursor: pointer;
    color: #6b7280;
    font-weight: 600;
    position: relative;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.aims-chat-tab:hover {
    color: #111827;
    background: #f9fafb;
}

.aims-chat-tab.active {
    color: #111827;
    background: #ffffff;
}

.aims-chat-tab.active:after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 0;
    height: 3px;
    background: #111827;
    border-radius: 8px 8px 0 0;
}

.aims-chat-list-box {
    height: 512px;
    overflow: hidden;
    background: #f8fafc;
}

.aims-chat-list {
    height: 512px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 10px;
}

.aims-chat-list::-webkit-scrollbar,
.aims-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.aims-chat-list::-webkit-scrollbar-thumb,
.aims-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.aims-chat-list-item {
    padding: 13px 14px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aims-chat-list-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.aims-chat-list-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 18px;
}

.aims-chat-list-message {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aims-chat-unread {
    float: right;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
}

.aims-chat-user-row {
    padding: 13px;
    margin-bottom: 9px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.aims-chat-user-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.aims-chat-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f2937, #475569);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.aims-chat-user-info {
    flex: 1;
    min-width: 0;
}

.aims-chat-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aims-chat-user-dept {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aims-user-chat-btn {
    min-width: 64px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.aims-user-chat-btn:hover {
    background: #374151;
}

.aims-department-chat-btn {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.aims-department-chat-btn:hover {
    background: #374151;
}

.aims-chat-help-text {
    margin-top: 12px;
    padding: 13px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
}

.aims-chat-window {
    height: 566px;
    background: #ffffff;
}

.aims-chat-window-header {
    height: 58px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    background: #ffffff;
    padding-right: 14px;
}

.aims-chat-back {
    width: 48px;
    height: 58px;
    border: 0;
    background: transparent;
    font-size: 30px;
    cursor: pointer;
    color: #374151;
}

.aims-chat-window-title {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    width: calc(100% - 56px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aims-chat-messages {
    height: 390px;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
}

.aims-chat-message-row {
    margin-bottom: 14px;
    clear: both;
}

.aims-chat-message-row.me {
    text-align: right;
}

.aims-chat-message-bubble {
    display: inline-block;
    /* max-width: 85%; */
    padding: 10px 12px;
    border-radius: 16px 16px 16px 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-size: 13px;
    text-align: left;
    word-wrap: break-word;
    line-height: 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.aims-chat-message-row.me .aims-chat-message-bubble {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
    border-radius: 16px 16px 4px 16px;
}

.aims-chat-message-name {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 600;
}

.aims-chat-message-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 5px;
}

.aims-chat-input-box {
    height: 94px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    padding: 14px;
    gap: 10px;
    align-items: center;
}

.aims-chat-message-input {
    resize: none;
    height: 48px;
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    padding: 13px 14px;
    font-size: 13px;
    outline: none;
    color: #111827;
    background: #ffffff;
}

.aims-chat-message-input:focus {
    border-color: #111827;
}

.aims-chat-send {
    width: 74px;
    height: 48px;
    border: 0;
    border-radius: 13px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
}

.aims-chat-send:hover {
    background: #374151;
}

.aims-chat-empty {
    margin: 16px;
    padding: 24px 18px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

.aims-chat-panel .aims-chat-message-wrap {
    position: relative;
    display: inline-block;
    max-width: 78%;
}

.aims-chat-panel .aims-chat-message-row.me .aims-chat-message-wrap {
    text-align: right;
}

.aims-chat-panel .aims-chat-message-own-bubble {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 10px 8px 10px 12px !important;
    overflow: visible !important;
    white-space: normal !important;
}

.aims-chat-panel .aims-chat-message-text {
    display: inline-block !important;
    color: #ffffff !important;
    line-height: 18px !important;
}

.aims-chat-panel .aims-message-menu-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 18px !important;
    line-height: 18px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.85 !important;
    border-radius: 50% !important;
}

.aims-chat-panel .aims-message-menu-btn:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.16) !important;
}

.aims-chat-panel .aims-message-action-menu {
    display: none;
    position: absolute !important;
    right: 0 !important;
    top: calc(100% + 6px) !important;
    width: 132px !important;
    min-width: 132px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18) !important;
    z-index: 999999 !important;
    padding: 5px !important;
    text-align: left !important;
}

.aims-chat-panel .aims-message-delete-option {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100% !important;
    height: 32px !important;
    padding: 0 9px !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #dc2626 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-align: left !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    text-transform: capitalize !important;
}

.aims-chat-panel .aims-message-delete-option:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

@media (max-width: 576px) {
    .aims-chat-panel {
        right: 10px;
        left: 10px;
        width: auto;
        height: 610px;
        bottom: 84px;
    }

    .aims-chat-list-box,
    .aims-chat-list {
        height: 482px;
    }

    .aims-chat-window {
        height: 536px;
    }

    .aims-chat-messages {
        height: 384px;
    }

    .aims-chat-button {
        right: 16px;
        bottom: 55px;
    }

    .aims-chat-tab {
        font-size: 13px;
    }

    .aims-chat-panel .aims-message-action-menu {
        right: 0;
        top: calc(100% + 6px);
    }
}
.aims-chat-search-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8fafc;
    padding: 8px 6px 12px 6px;
}

.aims-chat-search-wrap::after {
    content: "";
    display: block;
    clear: both;
}

.aims-chat-search-icon {
    position: absolute;
    left: 21px;
    top: 20px;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
    z-index: 2;
}

.aims-chat-search-input {
    width: 100% !important;
    height: 42px !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 0 14px 0 40px !important;
    outline: none !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05) !important;
    box-sizing: border-box !important;
}

.aims-chat-search-input:focus {
    border-color: #111827 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09) !important;
}

.aims-chat-search-input::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
}