/* ============================================================
   messages.css — Page Messagerie Premium (BADEL)
   ============================================================ */

/* ── Layout principal ── */
.messages-page {
    margin-top: 64px;
    background: transparent;
    gap: 16px;
    padding: 16px;
    display: flex;
    height: calc(100vh - 75px); /* Adjusted for header height */
    background: var(--light-bg);
    overflow: hidden;
}

/* ── État Vide (Placeholder) ── */
.chat-empty-state {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fcfb;
    text-align: center;
    padding: 40px;
}

.messages-page.is-empty #chatMain,
.messages-page.is-empty #userInfoPanel {
    display: none !important;
}

.messages-page.is-empty .chat-empty-state {
    display: flex !important;
}

.empty-state-content {
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    background: #e8f5ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.empty-state-icon i {
    font-size: 3rem;
    color: var(--accent-green-2);
}

.empty-state-content h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.empty-state-content p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SIDEBAR CONVERSATIONS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.conv-sidebar {
    border-radius: 24px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden;
    width: 340px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid #e8f5ee;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 2px 0 15px rgba(17, 40, 54, 0.06);
}

.conv-sidebar-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 12px 20px 15px;
    border-bottom: 1px solid #e8f5ee;
}

.conv-sidebar-header h2 {
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.conv-sidebar-header h2 i {
    color: #00e475;
}

.conv-search-box {
    position: relative;
}

.conv-search-box input {
    width: 100%;
    padding: 10px 15px 10px 38px;
    border-radius: 25px;
    border: none;
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.conv-search-box input::placeholder {
    color: #94a3b8;
}

.conv-search-box input:focus {
    background: #e2e8f0;
}

.conv-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Tabs */
.conv-tabs {
    display: flex;
    padding: 10px 15px 0;
    gap: 5px;
    border-bottom: 1px solid #e8f5ee;
}

.conv-tab {
    flex: 1;
    padding: 9px 8px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.conv-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--accent-green);
}

.conv-tab:hover:not(.active) {
    color: var(--text-dark);
    background: #f5fdf8;
    border-radius: 8px 8px 0 0;
}

/* Tab count badges */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 5px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--accent-green);
    color: var(--primary-dark);
    line-height: 1;
}

.conv-tab.active .tab-count {
    background: var(--primary-dark);
    color: var(--accent-green);
}

/* Deal tag indicator on conversation items */
.conv-deal-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e6f9ef, #d0f0e0);
    color: var(--accent-green-2);
    font-size: 0.6rem;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Liste conversations */
.conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.conv-list::-webkit-scrollbar {
    width: 4px;
}

.conv-list::-webkit-scrollbar-track {
    background: transparent;
}

.conv-list::-webkit-scrollbar-thumb {
    background: #d0e8dd;
    border-radius: 4px;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.conv-item:hover {
    background: #f5fdf8;
}

.conv-item.active {
    background: linear-gradient(to right, #e8f9f0, #f5fdf8);
    border-left-color: var(--accent-green);
}

.conv-item.unread .conv-name {
    font-weight: 700;
}

.conv-item.unread .conv-last-msg {
    color: var(--text-dark);
    font-weight: 500;
}

.conv-avatar {
    position: relative;
    flex-shrink: 0;
}

.conv-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8f5ee;
}

.conv-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: var(--accent-green);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.conv-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.conv-last-msg {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-badge {
    background: var(--accent-green);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   ZONE CHAT PRINCIPALE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.chat-main {
    border-radius: 24px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f8fcfb;
}

/* Empty state */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 15px;
}

.chat-empty i {
    font-size: 4rem;
    color: #c0ddd4;
}

.chat-empty p {
    font-size: 1rem;
}

/* Chat header */
.chat-top-bar {
    padding: 14px 24px;
    background: var(--white);
    border-bottom: 1px solid #e8f5ee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.chat-top-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-top-avatar {
    position: relative;
}

.chat-top-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-green);
}

.chat-top-info .chat-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-dark);
}

.chat-top-info .chat-user-status {
    font-size: 0.78rem;
    color: var(--accent-green-2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chat-top-actions {
    display: flex;
    gap: 8px;
}

.chat-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #f0f8f4;
    color: var(--primary-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-icon-btn:hover {
    background: var(--accent-green);
    color: var(--primary-dark);
    transform: scale(1.05);
}

/* Messages zone */
.messages-zone {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.messages-zone::-webkit-scrollbar {
    width: 5px;
}

.messages-zone::-webkit-scrollbar-track {
    background: transparent;
}

.messages-zone::-webkit-scrollbar-thumb {
    background: #c8e6d8;
    border-radius: 4px;
}

/* Date separator */
.date-separator {
    text-align: center;
    margin: 12px 0;
}

.date-separator span {
    background: #e0f0e8;
    color: var(--text-light);
    font-size: 0.75rem;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 500;
}

/* Messages */
.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 4px;
    width: 100%;
}

.msg-row>div:not(.msg-avatar-sm) {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    flex: 1;
}

.msg-row.sent>div:not(.msg-avatar-sm) {
    align-items: flex-end;
}

.msg-row.received>div:not(.msg-avatar-sm) {
    align-items: flex-start;
}

.msg-row.sent {
    flex-direction: row-reverse;
}

.msg-avatar-sm img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.msg-bubble {
    max-width: 50%;
    padding: 11px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.msg-row.received .msg-bubble {
    background: var(--white);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(17, 40, 54, 0.08);
}

.msg-row.sent .msg-bubble {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark-2));
    color: var(--white);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(17, 40, 54, 0.25);
}

.msg-time {
    font-size: 0.68rem;
    margin-top: 4px;
    opacity: 0.6;
}

.msg-row.sent .msg-time {
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.typing-dots {
    background: var(--white);
    border-radius: 18px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(17, 40, 54, 0.08);
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: #b0ccc4;
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
        background: var(--accent-green);
    }
}

/* Deal offer card dans le chat */
.deal-card-msg {
    background: linear-gradient(135deg, #e8f9f0, #f0fdf5);
    border: 1px solid #b0e0c8;
    border-radius: 14px;
    padding: 14px;
    margin: 4px 0;
    max-width: 320px;
}

.msg-row.sent .deal-card-msg {
    background: linear-gradient(135deg, rgba(0, 255, 132, 0.15), rgba(0, 212, 106, 0.1));
    border-color: rgba(0, 255, 132, 0.4);
}

.deal-card-msg .deal-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deal-card-msg .deal-card-title i {
    color: var(--accent-green-2);
}

.deal-card-products {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.deal-product-chip {
    background: var(--white);
    border: 1px solid #c8e6d8;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-dark);
}

.deal-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.deal-accept-btn,
.deal-refuse-btn {
    flex: 1;
    padding: 7px;
    border-radius: 8px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.deal-accept-btn {
    background: var(--accent-green);
    color: var(--primary-dark);
}

.deal-accept-btn:hover {
    background: var(--accent-green-2);
    transform: translateY(-1px);
}

.deal-refuse-btn {
    background: #ffe8e8;
    color: #d40000;
}

.deal-refuse-btn:hover {
    background: #ffd0d0;
}

/* Input zone */
.chat-input-bar {
    padding: 16px 20px;
    background: var(--white);
    border-top: 1px solid #e8f5ee;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    box-shadow: 0 -2px 15px rgba(17, 40, 54, 0.05);
}

.input-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.input-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #f0f8f4;
    color: var(--text-medium);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon-btn:hover {
    background: #e0f5ea;
    color: var(--accent-green-2);
}

.msg-textarea-wrap {
    flex: 1;
    background: #f5fdf8;
    border: 1.5px solid #d0ecdc;
    border-radius: 22px;
    padding: 10px 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    transition: var(--transition);
}

.msg-textarea-wrap:focus-within {
    border-color: var(--accent-green-2);
    box-shadow: 0 0 0 3px rgba(0, 196, 106, 0.1);
}

.msg-textarea-wrap textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    max-height: 120px;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.msg-textarea-wrap textarea::placeholder {
    color: #aac;
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark-2));
    color: var(--accent-green);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(17, 40, 54, 0.3);
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(17, 40, 54, 0.4);
}

.send-btn:active {
    transform: scale(0.96);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PANNEAU PROFIL UTILISATEUR (droite)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.user-info-panel {
    width: 380px;
    flex-shrink: 0;
    background: #f8faf9;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 20px;
    gap: 15px;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.03);
}

.user-info-panel.hidden {
    display: none;
}

.panel-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--primary-dark);
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

@media (max-width: 900px) {
    .panel-close-btn {
        display: flex;
    }
}

.panel-profile {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef6f2;
}

.panel-profile img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-green);
    margin: 0 auto 12px;
}

.panel-profile h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.panel-profile .panel-location {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.panel-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.panel-rating .stars {
    color: #f59e0b;
    font-size: 0.8rem;
}

.panel-rating span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.panel-section {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #eef6f2;
    border-radius: 24px;
    padding: 25px;
    margin-bottom: 20px;
}

.panel-section h4 {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.panel-section h4 i {
    font-size: 1.1rem !important;
    color: var(--accent-green-2) !important;
}

.exchange-side-label {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    margin: 0 0 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.exchange-side-label i {
    color: var(--accent-green-2) !important;
    font-size: 1rem !important;
}

.panel-annonces {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-annonce-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8fdfb;
    border-radius: 10px;
    border: 1px solid #e8f5ee;
    cursor: pointer;
    transition: var(--transition);
}

.panel-annonce-item:hover {
    background: #edfaf3;
    border-color: var(--accent-green-3);
    transform: translateX(3px);
}

.panel-annonce-item img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.panel-annonce-info .panel-annonce-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
}

.panel-annonce-info .panel-annonce-status {
    font-size: 0.73rem;
    color: var(--text-muted);
}

.panel-deal-btn {
    width: 100% !important;
    background: #112836 !important;
    color: #fff !important;
    border: none !important;
    padding: 15px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.panel-deal-btn i {
    color: var(--accent-green-2) !important;
    font-size: 1.1rem !important;
}

.panel-deal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 40, 54, 0.3);
}

/* â”€â”€ DÃ©tails de l'Ã©change (panel) â”€â”€ */
.panel-exchange-details {
    background: linear-gradient(135deg, #f0fdf5, #f8fdfb);
    border: 1px solid #c8e6d8;
    border-radius: 14px;
    padding: 24px 20px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.panel-exchange-details.contact-view {
    justify-content: flex-start;
    gap: 16px;
    min-height: auto;
}

.panel-exchange-details h4 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.exchange-side {
    margin-bottom: 12px;
}

.exchange-side-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.exchange-mine {
    color: var(--accent-green-2);
}

.exchange-theirs {
    color: #e0722a;
}

.exchange-products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exchange-prod-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #e0f0e8;
}

.exchange-prod-item img {
    width: 44px;
    height: 44px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
}

.exchange-prod-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.exchange-prod-cat {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.exchange-vs-row {
    text-align: center;
    margin: 16px 0;
}

.exchange-vs-row span {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark-2));
    color: var(--accent-green);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.08em;
}

/* â”€â”€ Boutons Accepter / Refuser (panel) â”€â”€ */
.panel-deal-response {
    display: flex;
    gap: 8px;
}

.panel-accept-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-2));
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.panel-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 255, 132, 0.35);
}

.panel-refuse-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1.5px solid #f0c0c0;
    background: #fff5f5;
    color: #d40000;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.panel-refuse-btn:hover {
    background: #ffe0e0;
    border-color: #f09090;
    transform: translateY(-2px);
}

/* â”€â”€ Mobile Navigation & Back Button â”€â”€ */
.chat-back-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #f0f8f4;
    color: var(--primary-dark);
    margin-right: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .user-info-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        padding-top: 80px;
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        z-index: 10000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        /* Force display flex but keep it off-screen */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .user-info-panel.active {
        right: 0;
    }

    .conv-sidebar {
        width: 280px;
    }
}

@media (max-width: 600px) {
    .chat-back-btn {
        display: flex;
    }

    .messages-page {
        position: relative;
        overflow: hidden;
        margin-top: 80px; /* Header is h-20 (80px) */
        height: calc(100dvh - 80px - 85px); /* Full height minus header and bottom nav */
    }

    .conv-sidebar {
        width: 100%;
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 50;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .messages-page.chat-active .conv-sidebar {
        transform: translateX(-100%);
    }

    .chat-main {
        width: 100%;
        position: absolute;
        left: 100%;
        top: 0;
        height: 100%;
        z-index: 60;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .messages-page.chat-active .chat-main {
        transform: translateX(-100%);
    }

    .chat-top-bar {
        padding: 10px 15px;
    }

    .messages-zone {
        padding: 15px;
    }

    .chat-input-bar {
        padding: 12px 15px;
    }
}

/* â”€â”€ RECORDING OVERLAY â”€â”€ */
.recording-overlay {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    border: 2px solid var(--accent-green);
    animation: slideUp 0.3s ease;
}

.recording-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recording-pulse {
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: recPulse 1s infinite;
}

@keyframes recPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.recording-timer {
    font-weight: 700;
    color: var(--primary-dark);
    font-family: monospace;
    font-size: 1.1rem;
}

.recording-hint {
    font-size: 0.9rem;
    color: #64748b;
}

.recording-cancel {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* â”€â”€ AUDIO MESSAGE BUBBLE â”€â”€ */
.audio-player-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    padding: 5px 0;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-green);
    color: var(--primary-dark);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.audio-play-btn:hover {
    transform: scale(1.1);
}

.msg-row.sent .audio-play-btn {
    background: white;
    color: var(--primary-dark);
}

.audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-progress-bg {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.msg-row.sent .audio-progress-bg {
    background: rgba(255, 255, 255, 0.2);
}

.audio-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent-green);
    width: 0%;
    transition: width 0.1s linear;
}

.msg-row.sent .audio-progress-fill {
    background: white;
}

.audio-duration {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* ============================================================
   CHAT THREADS BAR & SUB-DISCUSSIONS
   ============================================================ */
.chat-threads-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e8f5ee;
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-threads-bar::-webkit-scrollbar {
    height: 4px;
}

.chat-threads-bar::-webkit-scrollbar-thumb {
    background: #c8e6d8;
    border-radius: 4px;
}

.thread-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f0fbf6;
    border: 1px solid #c8e6d8;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 196, 106, 0.04);
}

.thread-pill:hover {
    background: #e6f7ef;
    border-color: var(--accent-green-3);
    transform: translateY(-1px);
}

.thread-pill.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark-2));
    color: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 4px 12px rgba(0, 255, 132, 0.15);
}

.thread-thumb {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
}

.thread-pill.active .thread-thumb {
    border-color: rgba(255, 255, 255, 0.2);
}

.thread-pill i {
    font-size: 0.85rem;
}