  body {
            margin: 0;
            font-family: 'Segoe UI', sans-serif;
            background: #f7f7f7;
        }

        .chat-container {
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        .sidebar {
            width: 300px;
            background: #fff;
            border-right: 1px solid #ccc;
            display: flex;
            flex-direction: column;
        }

        .sidebar-header {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #ddd;
            display: flex;
            justify-content: space-between;
            align-items: center;

        }

        .sidebar-header img {
            max-height: 40px;
            object-fit: contain;
            cursor: pointer;
        }

        .conversation-list-title {
            font-size: 1rem;
            font-weight: bold;
            color: #000;
            text-align: right;
            flex-grow: 1;
        }

        .search-input {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #eee;
            background: #fff;
        }

        .search-input .input-group {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid #ccc;
        }

        .search-input input {
            border: none;
            box-shadow: none;
        }

        .search-input input:focus {
            outline: none;
        }

        .conversation-list {
            flex: 1;
            overflow-y: auto;
        }

        .conversation-list a {
            padding: 0.75rem 1rem;
            display: flex;
            align-items: center;
            text-decoration: none;
            color: #333;
            border-bottom: 1px solid #eee;
            transition: 0.2s;
        }





        .conversation-list a:hover {
            background: #f2f2f2;
        }

        .conversation-list img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
        }

        .chat-box {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #f7f7f7;
        }

        .chat-header {
            padding: 0.75rem 1rem;
            background: #fff;
            color: #000;
            display: flex;
            align-items: center;
            border-bottom: 1px solid #ccc;
        }

        .chat-header img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
        }

        .chat-info .name {
            font-weight: bold;
            font-size: 1rem;
        }

        .chat-info .status {
            font-size: 0.75rem;
            color: #000;
        }

        .chat-messages {
            flex: 1;
            padding: 1rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .message {
            max-width: 80%;
            display: flex;
            align-items: flex-end;
            gap: 8px;
            margin-bottom: 1rem;
        }

        .message .content {
            padding: 0.6rem 1rem;
            border-radius: 12px;
        }

        .sent {
            align-self: flex-end;
            flex-direction: row-reverse;
        }

        .sent .content {
            background: #000;
            color: white;
            border-bottom-right-radius: 0;
        }

        .received .content {
            background: #fff;
            color: #333;
            border-bottom-left-radius: 0;
        }

        .message img.avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
        }

        .meta {
            font-size: 0.7rem;
            color: #777;
            margin-top: 4px;
        }

        .chat-input {
            padding: 0.75rem;
            background: #fff;
            border-top: 1px solid #ccc;
        }

        .chat-input form {
            display: flex;
            gap: 0.5rem;
        }

        .chat-input input {
            flex: 1;
        }

        .btn-primary {
            background-color: #000 !important;
            border-color: #000 !important;
        }

        .back-btn {
            display: none;
            background: none;
            border: none;
            font-size: 1.25rem;
            color: #000;
            margin-right: 10px;
        }

        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }

            .chat-container.show-list .sidebar {
                display: block;
                width: 100%;
            }

            .chat-container.show-list .chat-box {
                display: none;
            }

            .back-btn {
                display: inline-block;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                transition: all 0.3s ease;
            }

            .chat-container.show-list .sidebar {
                animation: slideIn 0.3s ease forwards;
            }

            .chat-container.show-list .chat-box {
                display: none;
            }

            @keyframes slideIn {
                from {
                    transform: translateX(-100%);
                }

                to {
                    transform: translateX(0);
                }
            }
        }

        .conversation-list img {
            width: 40px;
            height: 40px;
        }

        .message img.avatar {
            width: 32px;
            height: 32px;
        }

        .conversation-list a {
            flex-direction: row;
            gap: 10px;
        }

        .conversation-list a>div {
            display: flex;
            flex-direction: column;
        }

        .conversation-list a .small.text-success {
            color: #28a745 !important;
            font-weight: 500;
        }


        .conversation-list .badge {
            font-size: 0.7rem;
            padding: 4px 7px;
        }

        .unread-badge {
            position: absolute;
            bottom: 0.75rem;
            right: 1rem;
            font-size: 0.65rem;
            padding: 4px 7px;
            line-height: 1;
        }




        body.dark-mode {
            background: #1e1e1e;
            color: #fff;
        }

        body.dark-mode .sidebar,
        body.dark-mode .chat-box {
            background: #121212;
        }

        body.dark-mode .chat-header {
            background: #1e1e1e;
            color: #fff;
        }

        body.dark-mode .conversation-list a {
            color: #eee;
            border-bottom: 1px solid #333;
        }

        body.dark-mode .conversation-list a:hover {
            background: #222;
        }

        body.dark-mode .chat-input,
        body.dark-mode .chat-input input {
            background: #1f1f1f;
            color: #fff;
            border-color: #444;
        }

        body.dark-mode .search-input .form-control {
            background: #2a2a2a;
            color: #eee;
        }

        body.dark-mode .text-muted {
            color: rgb(174 182 190 / 75%) !important
        }

        body.dark-mode .received .content {
            background: #242323;
            color: #fff8f8;
            border-bottom-left-radius: 0;
        }

        body.dark-mode .search-input,
        body.dark-mode .search-input .form-control {
            background: #242323;
            color: #fff !important;
        }
        .chat-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  object-fit: cover;
}

.avatar-wrapper {
  width: 40px;
  height: 40px;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Status indicator dot */
.avatar-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #adb5bd; /* default = away */
}

/* Online color */
.avatar-online::after {
  background-color: #28a745 !important;
}







.text-primary{
  color: #000!important;
}


#chatMessages {
    height: 400px;
    overflow-y: auto;
}
