html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #10b981;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #10b981;
    border-color: #059669;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #059669;
    border-color: #047857;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(16, 185, 129, 0.25);
}

.content {
    padding-top: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10b981;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #ef4444;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fef2f2;
    color: #991b1b;
    border-top: 1px solid #fecaca;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
    font-size: 0.88rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    font-size: 1.1rem;
}

/* ==========================================================================
   Crm Modern Chat UI Styles
   ========================================================================== */

:root {
    --chat-bg: #f8fafc;
    --feed-bg: #efeae2;
    --header-bg: #ffffff;
    --bubble-inbound-bg: #ffffff;
    --bubble-outbound-bg: #d9fdd3;
    --primary: #10b981;
    --primary-dark: #059669;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 380px;
}

.chat-layout {
    display: flex;
    height: 100%; /* Fix: 100% instead of 100vh so it fits inside the MainLayout Content area perfectly */
    width: 100%;
    background-color: var(--chat-bg);
    overflow: hidden;
}

.chat-workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    background-color: var(--feed-bg);
    position: relative;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem; /* Reduced padding */
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    z-index: 10;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.contact-meta .contact-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-meta .contact-phone {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.indicator-online {
    background-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.indicator-connecting {
    background-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.chat-feed-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-empty {
    margin: auto;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.timeline-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.timeline-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Message Bubble Rows */
.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 0.25rem;
}

.message-row-inbound {
    justify-content: flex-start;
}

.message-row-outbound {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    min-width: 120px;
    padding: 0.5rem 0.75rem 0.35rem;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.bubble-inbound {
    background-color: var(--bubble-inbound-bg);
    color: var(--text-primary);
    border-top-left-radius: 2px;
}

.bubble-outbound {
    background-color: var(--bubble-outbound-bg);
    color: var(--text-primary);
    border-top-right-radius: 2px;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0284c7;
    margin-bottom: 0.25rem;
}

.message-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.double-check-read {
    color: #0ea5e9;
    font-weight: bold;
}

/* Media styling */
.media-preview {
    margin: 0.35rem 0;
}

.custom-audio-player {
    width: 100%;
    min-width: 240px;
    height: 38px;
    border-radius: 20px;
}

.chat-video, .chat-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    display: block;
}

.media-caption {
    font-size: 0.88rem;
    margin-top: 0.4rem;
    margin-bottom: 0;
}

.document-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.doc-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.doc-download-btn {
    font-size: 0.75rem;
    color: #0284c7;
    text-decoration: underline;
}

.chat-footer {
    padding: 0.75rem 1.5rem;
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.chat-input-bar:focus-within {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.chat-input-field {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 0.92rem;
    color: var(--text-primary);
    padding: 0.2rem 0;
}

.chat-input-field::placeholder {
    color: #94a3b8;
}

.attachment-btn {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    margin-bottom: 0;
}

.attachment-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.template-trigger-btn {
    color: #25D366;
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.template-trigger-btn:hover {
    background: #dcf8c6;
    color: #128C7E;
}

.btn-send-message {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background-color: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.45rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.btn-send-message:hover:not(:disabled) {
    background-color: #059669;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35);
}

@keyframes pulse-opacity {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.pulse-animation {
    animation: pulse-opacity 1.5s infinite;
}

.btn-send-message:active:not(:disabled) {
    transform: translateY(0);
}

.btn-send-message:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.expired-window-bar {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px dashed #fbbf24;
    border-radius: 12px;
}

.btn-expired-template {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.btn-expired-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
    color: white;
}

.attachment-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.2s ease-in-out;
}

.attachment-preview-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
}

.attachment-preview-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.attachment-preview-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.attachment-preview-filename {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-preview-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.attachment-remove-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.attachment-remove-btn:hover {
    background: #fee2e2;
}


    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ==========================================================================
   Header Channel Badge & Status
   ========================================================================== */

.badge-wa-channel {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-wa-channel i {
    font-size: 0.8rem;
    color: #10b981;
}

/* ==========================================================================
   Conversation Sidebar Styles (Modernized)
   ========================================================================== */

.conversation-sidebar {
    width: var(--sidebar-width);
    min-width: 320px;
    max-width: 420px;
    height: 100%;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 20;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

/* Top Branding Header */
.sidebar-top-brand {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #047857);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-total-chats {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

/* Search Section */
.sidebar-search-section {
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.search-input-wrapper .search-icon {
    color: #94a3b8;
    font-size: 0.9rem;
}

.search-input-wrapper .search-input {
    border: none;
    background: transparent;
    font-size: 0.88rem;
    color: #0f172a;
    outline: none;
    width: 100%;
}

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

.btn-clear-search {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.btn-clear-search:hover {
    color: #64748b;
}

/* Conversation List */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 1rem; /* Mais compacto */
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
    border-left: 3px solid transparent;
}

.conversation-item:hover {
    background-color: #f8fafc;
}

.conversation-item.selected {
    background-color: #f0fdf4;
    border-left-color: #10b981;
}

.conversation-item.has-unread {
    background-color: #fcfefe;
}

/* Avatar in Sidebar */
.contact-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.avatar-unread-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #10b981;
    border: 2px solid #ffffff;
}

/* Conversation Details Typography */
.conversation-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.conv-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.conv-row-top .contact-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
}

.conv-row-top .message-time {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}

.text-emerald {
    color: #10b981 !important;
}

.conv-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.preview-text-wrapper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.message-status-tick {
    font-size: 0.85rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.preview-media-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0284c7;
    flex-shrink: 0;
}

.last-message-preview {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background-color: #10b981;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.4);
}

/* Empty Conversation State */
.empty-conversation-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.empty-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.empty-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
    margin-bottom: 0;
}

/* User Profile Footer */
.sidebar-user-footer {
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.user-profile-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.user-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status-label {
    font-size: 0.7rem;
    color: #059669;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.btn-logout {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.auth-callout {
    width: 100%;
}

.btn-login-ms {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-login-ms:hover {
    background: #059669;
    color: #ffffff;
}

/* ==========================================================================
   Chat Empty Workspace State
   ========================================================================== */

.chat-empty-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    background: radial-gradient(circle at center, #f8fafc 0%, #f1f5f9 100%);
}

.chat-empty-card {
    max-width: 460px;
    width: 100%;
    text-align: center;
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.chat-empty-icon-bubble {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.chat-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.chat-empty-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

.chat-empty-features {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    text-align: left;
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.empty-feature-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.82rem;
    color: #334155;
    font-weight: 500;
}

.empty-feature-item i {
    font-size: 1rem;
}

.text-amber {
    color: #f59e0b !important;
}

/* ==========================================================================
   Connection Status Badge Styles
   ========================================================================== */

.connection-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-connected {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-connected .status-dot {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.status-reconnecting {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-reconnecting .status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.status-disconnected {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-disconnected .status-dot {
    background: #ef4444;
}

.btn-reconnect {
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-reconnect:hover {
    background: #fee2e2;
}

/* Scrollbar refinement */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* ==========================================================================
   Unread Messages Divider
   ========================================================================== */

.unread-messages-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.25rem 0;
    position: relative;
    width: 100%;
}

.unread-messages-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #cbd5e1;
    z-index: 1;
}

.unread-messages-divider span {
    position: relative;
    z-index: 2;
    background: #ffffff;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* ==========================================================================
   Reply Feature Styles
   ========================================================================== */

.message-quoted-block {
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.9;
}

.bubble-outbound .message-quoted-block {
    background-color: rgba(0, 0, 0, 0.06);
    border-left-color: #047857;
}

.quoted-sender {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 2px;
    font-size: 0.8rem;
}

.quoted-text {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.message-reply-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    border-left: 4px solid var(--primary);
    padding: 8px 12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid var(--border-color);
}

.reply-preview-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reply-preview-sender {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary);
}

.reply-preview-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-cancel-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
}

.reply-cancel-btn:hover {
    color: #ef4444;
}

.reply-button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 8px;
}

.message-row:hover .reply-button {
    opacity: 1;
}

.reply-button:hover {
    color: var(--primary);
}
