    /* Chat Item Container */
.chat-item {
    padding: 12px 1.2rem;
    border-bottom: 1px solid var(--color-border-2);
    transition: var(--transition);
}

.chat-item:hover {
    background: var(--color-gray-light);
}

.chat-item.active {
    background: var(--secondary-opacity);
    border-left: 3px solid var(--color-secondary); /* Gold accent for active chat */
}

/* Chat Avatar */
.chat-avatar-wrapper {
    position: relative;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-initials {
    width: 42px;
    height: 42px;
    background: var(--color-gray-light);
    color: var(--color-primary); /* Deep Red Initials */
    border: 1px solid var(--color-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* Text Styling */
.chat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0;
}

.chat-time {
    font-size: 11px;
    color: var(--color-body);
    font-weight: 400;
}

.chat-preview {
    font-size: 12px;
    color: var(--color-body);
    margin: 0;
    opacity: 0.8;
}

/* Badges */
.unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border: 2px solid var(--color-white);
    border-radius: 50%;
}

.unread-count {
    background: var(--color-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Empty State */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--color-body);
}

.empty-state i {
    font-size: 2rem;
    opacity: 0.2;
    color: var(--color-primary);
}

.empty-state p {
    font-size: 13px;
    font-weight: 500;
}

/* Favorites Section */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 5px 1.2rem;
}

.fav-img {
    width: 46px; /* Slightly smaller for a tighter grid */
    height: 46px;
    border-radius: 12px; /* Matches the brand's dashboard radius */
    object-fit: cover;
    border: 1.5px solid var(--color-border-2);
}

.fav-name {
    font-size: 10px;
    font-weight: 600;
    margin-top: 6px;
    color: var(--color-bodyest);
}

/* Status Indicator (Online Dot) */
.status-indicator.online {
    background: var(--color-success); /* Use your Forest Green */
    border: 2px solid var(--color-white);
}

/* Contact List Typography */
.contact-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-heading);
}

.contact-handle {
    font-size: 11px;
    color: var(--color-body);
}

/* Hover State Accents */
.contact-card:hover .contact-name {
    color: var(--color-primary); /* Deep Red highlight on hover */
}

.contact-card:hover .contact-arrow {
    color: var(--color-secondary); /* Gold arrow on hover */
    transform: translateX(3px);
}
/* Ensure the sidebar container stays contained */
#chat-sidebar-container {
    overflow: hidden;
}

/* Custom Scrollbar Styling */
.custom-scrollbar {
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: transparent transparent; /* Hide by default on Firefox */
    transition: scrollbar-color 0.3s ease;
}

/* Show scrollbar on hover */
.custom-scrollbar:hover {
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

/* Webkit (Chrome, Safari, Edge) styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px; /* Slim width */
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent; 
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: transparent; /* Hidden by default */
    border-radius: 10px;
}

/* Show thumb on hover */
.custom-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1); /* Subtle slim bar appears */
}

/* Force children to respect width to prevent horizontal scroll */
#sidebar-chat-slot > *, 
#sidebar-contact-slot > * {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
/* Clean Hover State */
.contact-card:hover {
    background-color: var(--color-gray-light) !important;
    border-color: var(--color-border) !important;
}

/* Arrow Animation on Hover */
.contact-card:hover .contact-arrow {
    opacity: 1 !important;
    transform: translateX(4px);
    color: var(--color-primary) !important;
}

/* Active State (Clicking) */
.contact-card:active {
    transform: scale(0.98);
    background-color: var(--secondary-opacity) !important;
}

/* Remove blue tap highlight on mobile and blue focus outlines */
.contact-card {
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
    user-select: none;
}

.contact-card * {
    pointer-events: none; /* Ensures the click event always registers on the main card */
}

/* Hover effect for chat items */
.chat-item-container:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Ensure the preview text cuts off nicely */
.chat-preview {
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Limits text to one line */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Optional: Pulse effect for unread messages */
.unread-badge {
    animation: pulse-light 2s infinite;
}

@keyframes pulse-light {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

