/* ========================================
   MESSAGES PAGE STYLES
   ======================================== */

:root {
    --primary-color: #0B3C5D;
    --accent-color: #FF7F11;
    --border-color: #e8ecf1;
    --bg-light: #f4f6f9;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
}

[data-theme="dark"] {
    --border-color: #1e293b;
    --bg-light: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    overflow: hidden;
}

.messages-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* ========== HEADER ========== */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d4f7a 50%, var(--accent-color) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-center h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.back-link:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
}

.logout-btn {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 15px;
    border: 1px solid white;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========== MAIN CONTENT ========== */
.messages-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* ========== CONVERSATIONS SIDEBAR ========== */
.conversations-sidebar {
    width: 32%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

[data-theme="dark"] .conversations-sidebar { background: #1a2332; }

.conversations-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-theme="dark"] .conversations-header { background: #1e293b; }

.conversations-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Live total-unread pill under the Conversations title (sums all threads) */
.conv-unread-total {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 127, 17, 0.12);
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 700;
}
.conv-unread-total[hidden] { display: none; }

.conversations-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.loading, .no-conversations {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.conversation-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    align-items: center;
    position: relative;
}

.conversation-item:hover {
    background: rgba(255, 127, 17, 0.04);
}

.conversation-item.active {
    background: linear-gradient(90deg, rgba(255, 127, 17, 0.08), rgba(255, 127, 17, 0.02));
    border-left: 3px solid var(--accent-color);
    padding-left: 13px;
}

[data-theme="dark"] .conversation-item:hover { background: rgba(255, 127, 17, 0.06); }
[data-theme="dark"] .conversation-item.active { background: linear-gradient(90deg, rgba(255, 127, 17, 0.1), rgba(255, 127, 17, 0.03)); }

.conv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.conv-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.conv-product {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-preview {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ========== CHAT AREA ========== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

[data-theme="dark"] .chat-area { background: #0f172a; }

.chat-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.no-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
}

.no-conversation p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.chat-header-info {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.chat-header-info h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.chat-header-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ---------- In-thread message search ---------- */
.chat-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.chat-header-row > div {
    min-width: 0;
}
.chat-search-toggle {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.chat-search-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 127, 17, 0.08);
    box-shadow: 0 2px 6px rgba(255, 127, 17, 0.18);
}
.chat-search-toggle:active { transform: scale(0.94); }
.chat-search-toggle.active {
    border-color: var(--accent-color);
    color: #fff;
    background: var(--accent-color);
    box-shadow: 0 2px 8px rgba(255, 127, 17, 0.35);
}
.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 7px 9px 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: chatSearchIn 0.18s ease;
}
@keyframes chatSearchIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-search-bar[hidden] { display: none; }
.chat-search-bar:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 127, 17, 0.15), 0 2px 8px rgba(0, 0, 0, 0.05);
}
.chat-search-bar > svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}
#chat-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
}
#chat-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
    cursor: pointer;
}
.chat-search-count {
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(100, 116, 139, 0.12);
    border-radius: 999px;
    padding: 3px 8px;
    letter-spacing: 0.02em;
}
.chat-search-nav {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.chat-search-nav:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 127, 17, 0.08);
}
.chat-search-nav:disabled { opacity: 0.45; cursor: default; }
.chat-search-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.chat-search-close:hover {
    background: rgba(100, 116, 139, 0.14);
    color: #dc2626;
    transform: rotate(90deg);
}

/* Non-matching messages are hidden while searching */
.messages-display .message.msg-hidden { display: none; }

/* Friendly hint shown inside the chat when nothing matches */
.messages-display .chat-search-none {
    padding: 22px 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
[data-theme="dark"] .messages-display .chat-search-none { color: #9fb3c8; }

/* Highlighted matches + the active match being navigated to */
.messages-display mark.msg-hl {
    background: #ffd54d;
    color: #4a3200;
    border-radius: 3px;
    padding: 0 1px;
}
.messages-display mark.msg-hl.current {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 127, 17, 0.35);
}

/* Dark mode */
[data-theme="dark"] .chat-search-toggle,
[data-theme="dark"] .chat-search-nav {
    background: #1a2434;
    border-color: #24314b;
    color: #9fb3c8;
}
[data-theme="dark"] .chat-search-toggle:hover,
[data-theme="dark"] .chat-search-nav:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
[data-theme="dark"] .chat-search-toggle.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
[data-theme="dark"] .chat-search-bar {
    background: #121a2b;
    border-color: #24314b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .chat-search-bar:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 127, 17, 0.2);
}
[data-theme="dark"] #chat-search-input { color: #e6edf7; }
[data-theme="dark"] #chat-search-input::placeholder { color: #64748b; }
[data-theme="dark"] .chat-search-count { color: #9fb3c8; }
[data-theme="dark"] .chat-search-close { color: #9fb3c8; }
[data-theme="dark"] .messages-display mark.msg-hl {
    background: #b45309;
    color: #fff;
}
[data-theme="dark"] .messages-display mark.msg-hl.current {
    background: var(--accent-color);
    color: #fff;
}

.messages-display {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, #f8f9fb 0%, #f0f2f5 100%);
}

[data-theme="dark"] .messages-display { background: linear-gradient(180deg, #0f172a 0%, #111827 100%); }

.message {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.message.sent .message-avatar {
    order: 2;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 65%;
}

.message.sent .message-content {
    align-items: flex-end;
}

.message.received .message-content {
    align-items: flex-start;
}

.message-text {
    padding: 10px 16px;
    border-radius: 16px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    width: max-content;
    max-width: 100%;
    font-size: 0.92rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Align bubbles correctly within the message-content column */
.message.sent .message-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d4f7a 100%);
    color: white;
    border-radius: 16px 4px 16px 16px;
    align-self: flex-end;
}

.message.received .message-text {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px 16px 16px 16px;
    align-self: flex-start;
}

[data-theme="dark"] .message.received .message-text {
    background: #1e293b;
    border-color: #2d3a4f;
    color: #e2e8f0;
}

.message-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
}

/* Delivered → Seen receipt under our own sent messages */
.msg-receipt {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9aa9b8;
    white-space: nowrap;
}

.msg-receipt.msg-seen {
    color: #17a05e;
}

.msg-check-ic {
    vertical-align: -1.5px;
    margin-left: 3px;
}

/* ========== MESSAGE INPUT ========== */
.message-input-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-top: 1px solid var(--border-color);
}

.message-input-wrapper {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    align-items: flex-end;
}

[data-theme="dark"] .message-input-wrapper { background: #1a2332; }

#message-text {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: none;
    min-height: 42px;
    max-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#message-text:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 127, 17, 0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--accent-color), #e8680a);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Spinner while a message is being sent (the icon is hidden, a ring shows). */
.send-btn.sending svg { display: none; }
.send-btn.sending::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: send-spin 0.7s linear infinite;
}
@keyframes send-spin {
    to { transform: rotate(360deg); }
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 127, 17, 0.3);
}

.send-btn:active {
    transform: translateY(0);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet */
@media (max-width: 1024px) {
    .messages-header {
        padding: 12px 15px;
    }

    .header-center h1 {
        font-size: 1.4rem;
    }

    .conversations-sidebar {
        width: 35%;
    }

    .message-content {
        max-width: 70%;
    }
}

/* Mobile: the page is a full-screen conversation list only — tapping a
   thread navigates to its own page (message.html?product_id=..&seller_id=..)
   with the composer pinned at the bottom; the browser back button returns
   to the list (real page navigation, no in-page overlay). */
@media (max-width: 768px) {
    .messages-main {
        flex-direction: column;
    }

    .conversations-sidebar {
        width: 100%;
        height: 100%;
        border-right: none;
    }

    .chat-area {
        display: none;
    }

    .message-input-section {
        height: auto;
        min-height: 150px;
    }

    .messages-display {
        max-height: calc(100% - 100px);
    }

    .message-content {
        max-width: 80%;
    }

    /* Smaller text on mobile for readability */
    .message-text {
        font-size: 0.85rem;
    }

    /* Full-screen list: normal vertical rows again (not horizontal chips) */
    .conversations-list {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0;
        gap: 0;
    }

    .conversation-item {
        min-width: 0;
        flex-direction: row;
        padding: 12px 15px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
        align-items: center;
        text-align: left;
    }

    .conversation-item.active {
        border-left: 4px solid var(--accent-color);
        border-bottom: 1px solid #f0f0f0;
        padding-left: 11px;
    }

    .conv-info {
        display: block;
    }

    .conv-avatar {
        width: 46px;
        height: 46px;
    }

    .unread-badge {
        top: -5px;
        right: -5px;
    }

    .messages-header {
        padding: 10px 12px;
        gap: 10px;
    }

    .header-left, .header-center, .header-right {
        flex: 1;
    }

    .header-center {
        justify-content: center;
    }

    .header-right {
        justify-content: flex-end;
    }

    .back-link {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .logout-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .messages-header {
        padding: 8px 10px;
        gap: 5px;
    }

    .header-center h1 {
        font-size: 1.1rem;
    }

    .back-link {
        font-size: 0.7rem;
        padding: 5px 6px;
    }

    .back-link svg {
        width: 18px;
        height: 18px;
    }

    .logout-btn {
        font-size: 0.7rem;
        padding: 5px 8px;
    }

    .conversations-sidebar {
        height: 100%;
    }

    .conversation-item {
        min-width: 0;
    }

    .message-input-wrapper {
        /* Keep the tools + textarea + send button on ONE line. The chip row,
           status and record bar stay on their own wrapped rows (chat-attach.css). */
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
        padding: 10px;
        flex-wrap: wrap;
    }

    #message-text {
        flex: 1;
        min-width: 0; /* allow shrink so the send button never gets pushed out */
        font-size: 0.88rem;
        padding: 9px 12px;
        max-height: 96px;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        align-self: flex-end;
    }

    .message-text {
        font-size: 0.85rem;
    }

    .message-time {
        font-size: 0.75rem;
    }
}

/* Scrollbar Styling */
.conversations-list::-webkit-scrollbar,
.messages-display::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-display::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Product price inside conversation previews / chat header */
.conv-price {
    color: #ff7a00;
    font-weight: 600;
}

/* Live blocked-word warning + character counter under the message box */
.msg-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    min-height: 22px;
}

.msg-block-warn {
    font-size: 1.2rem;
    font-weight: 600;
    color: #b42318;
    background: rgba(229, 72, 77, 0.1);
    border: 1px solid rgba(229, 72, 77, 0.35);
    padding: 3px 12px;
    border-radius: 8px;
    animation: msg-warn-pop 0.18s ease-out;
}

.msg-counter {
    margin-left: auto;
    font-size: 1.15rem;
    color: #7a8699;
    background: rgba(11, 31, 58, 0.06);
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

@keyframes msg-warn-pop {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Reply-to Quote ── */

/* ── Dark mode overrides ── */
[data-theme="dark"] .messages-header {
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 50%, #b45309 100%);
}

[data-theme="dark"] .conversations-header { background: #1e293b; }
[data-theme="dark"] .chat-header-info { background: #1e293b; border-color: #2d3a4f; }
[data-theme="dark"] .chat-header-info h3 { color: #e2e8f0; }
[data-theme="dark"] .chat-header-info p { color: #94a3b8; }

[data-theme="dark"] .no-conversation p { color: #94a3b8; }

[data-theme="dark"] .conv-name { color: #e2e8f0; }
[data-theme="dark"] .conv-preview { color: #94a3b8; }
[data-theme="dark"] .conv-product { color: #94a3b8; }

[data-theme="dark"] .conversation-item { border-color: #1e293b; }
[data-theme="dark"] .conversation-item:hover { background: rgba(255,127,17,0.06); }
[data-theme="dark"] .conversation-item.active { background: linear-gradient(90deg, rgba(255,127,17,0.12), rgba(255,127,17,0.03)); }

[data-theme="dark"] .conv-avatar { background: linear-gradient(135deg, #1e3a5f, #2563eb33); }
[data-theme="dark"] .conv-unread-total { background: rgba(255,127,17,0.15); color: #ff9a3c; }

[data-theme="dark"] .message.sent .message-text {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
}

[data-theme="dark"] #message-text {
    background: #1a2332;
    border-color: #2d3a4f;
    color: #e2e8f0;
}

[data-theme="dark"] .msg-counter { color: #94a3b8; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .msg-receipt { color: #64748b; }

[data-theme="dark"] .conversations-list::-webkit-scrollbar-track { background: #1a2332; }
[data-theme="dark"] .conversations-list::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .messages-display::-webkit-scrollbar-track { background: #0f172a; }
[data-theme="dark"] .messages-display::-webkit-scrollbar-thumb { background: #334155; }
