/* =============================================================
   LUXA NEED HELP PILL & 3-STATE MINI FRAME CSS
   ============================================================= */

/* 1. Floating Bottom-Left Pill (Mirrors Bottom-Right Wallet Pill) */
.need-help-container {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.need-help-pill {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(150, 15, 250, 0.28);
    box-shadow: 0 8px 30px rgba(45, 26, 107, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    user-select: none;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #2d1a6b;
    font-weight: 600;
    font-size: 0.92rem;
}

.need-help-pill:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: #960ffa;
    box-shadow: 0 12px 36px rgba(150, 15, 250, 0.22);
}

.pill-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(150, 15, 250, 0.15) 0%, rgba(104, 5, 181, 0.1) 100%);
    color: #960ffa;
    font-size: 1.05rem;
}

.pill-pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 2. Floating Mini Frame Popover (Docked on Left, Styled like AI Frame) */
.need-help-frame {
    position: fixed;
    bottom: 84px;
    left: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 570px;
    max-height: calc(100vh - 110px);
    background: #ffffff;
    border-radius: 22px;
    border: 1.5px solid rgba(150, 15, 250, 0.22);
    box-shadow: 0 20px 60px rgba(45, 26, 107, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpFrame 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpFrame {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.need-help-frame-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #2d1a6b 0%, #1c0e48 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(150, 15, 250, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #e9d5ff;
}

.header-meta h4 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.header-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-top: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-frame-action {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-frame-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Frame Body States */
.frame-body-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fdfdfd;
}

/* Tab Bar */
.portal-tab-bar {
    display: flex;
    background: #f4f3f8;
    padding: 6px 12px;
    border-bottom: 1px solid #ebe9f2;
    gap: 6px;
}

.portal-tab {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b6b8a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.portal-tab.active {
    background: #ffffff;
    color: #2d1a6b;
    box-shadow: 0 2px 8px rgba(45, 26, 107, 0.06);
}

/* Portal Views */
.portal-view-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 14px 16px;
}

/* Mini FAQ */
.mini-faq-search {
    position: relative;
    margin-bottom: 12px;
}

.mini-faq-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 12px;
    border: 1px solid #e2e0eb;
    background: #ffffff;
    font-size: 0.84rem;
    box-sizing: border-box;
}

.mini-faq-search input:focus {
    outline: none;
    border-color: #960ffa;
}

.mini-faq-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: #960ffa;
}

.mini-faq-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.mini-faq-item {
    border: 1px solid #ebe8f4;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #ffffff;
    overflow: hidden;
}

.mini-faq-q {
    padding: 12px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d1a6b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.mini-faq-q i {
    font-size: 0.8rem;
    color: #960ffa;
    transition: transform 0.2s ease;
}

.mini-faq-item.open .mini-faq-q i {
    transform: rotate(180deg);
}

.mini-faq-a {
    padding: 0 14px 12px 14px;
    font-size: 0.8rem;
    color: #555570;
    line-height: 1.5;
    display: none;
}

.mini-faq-item.open .mini-faq-a {
    display: block;
}

/* Portal CTA Card */
.portal-cta-card {
    background: linear-gradient(135deg, rgba(150, 15, 250, 0.08) 0%, rgba(45, 26, 107, 0.04) 100%);
    border: 1px solid rgba(150, 15, 250, 0.2);
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: auto;
}

.cta-text strong {
    display: block;
    font-size: 0.85rem;
    color: #2d1a6b;
}

.cta-text span {
    display: block;
    font-size: 0.78rem;
    color: #6b6b8a;
    margin-bottom: 10px;
}

.btn-open-request-cta {
    width: 100%;
    padding: 9px;
    background: #960ffa;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-open-request-cta:hover {
    background: #7a08d1;
}

/* Mini Request Form */
.mini-form-group {
    margin-bottom: 12px;
}

.mini-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.mini-label-row label {
    margin-bottom: 0 !important;
}

.mini-char-counter {
    font-size: 0.72rem;
    color: #8E8EA8;
    font-weight: 500;
    transition: color 0.15s ease;
}

.mini-char-counter.limit-near {
    color: #D97706;
    font-weight: 600;
}

.mini-char-counter.limit-reached {
    color: #DC2626;
    font-weight: 700;
}

.support-chat-char-counter {
    font-size: 0.68rem;
    color: #94A3B8;
    position: absolute;
    right: 12px;
    bottom: -15px;
    font-weight: 500;
    pointer-events: none;
    transition: color 0.2s ease;
}

.mini-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d1a6b;
    margin-bottom: 4px;
}

.mini-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e0e0ea;
    font-size: 0.84rem;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.mini-input:focus {
    outline: none;
    border-color: #960ffa;
}

.mini-dropzone {
    border: 1.5px dashed #d1c4e9;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    background: #faf8ff;
    cursor: pointer;
    font-size: 0.8rem;
    color: #6b6b8a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mini-dropzone i {
    color: #960ffa;
    font-size: 1.1rem;
}

.mini-file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mini-chip {
    background: #ede7f6;
    color: #512da8;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mini-chip .remove-c {
    cursor: pointer;
    font-weight: bold;
}

.btn-mini-submit {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #960ffa 0%, #6805b5 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    box-shadow: 0 4px 14px rgba(150, 15, 250, 0.25);
}

/* ==================== STATE 2 & 3: CHAT VIEW ==================== */
.pending-notice-banner {
    background: #fffbeb;
    border-bottom: 1px solid #fef3c7;
    color: #92400e;
    padding: 10px 14px;
    font-size: 0.78rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-notice-banner i {
    font-size: 1.1rem;
    flex-shrink: 0;
    color: #d97706;
}

.active-ticket-infobar {
    background: #f3e8ff;
    border-bottom: 1px solid #e9d5ff;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.infobar-ticket {
    font-weight: 700;
    color: #6b21a8;
    font-family: monospace;
    font-size: 0.88rem;
}

.infobar-admin-presence-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.infobar-admin {
    background: #960ffa;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

.admin-presence-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.70rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.25);
    line-height: 1;
}

.admin-presence-pill.recent {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.25);
}

.admin-presence-pill.offline {
    background: rgba(148, 163, 184, 0.12);
    color: #64748B;
    border-color: rgba(148, 163, 184, 0.25);
}

.presence-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
}

.presence-dot.online {
    background: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulseGreen 2s infinite;
}

.presence-dot.recent {
    background: #F59E0B;
}

.presence-dot.offline {
    background: #94A3B8;
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    70% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafc;
}

.support-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
}

.support-bubble.customer {
    align-self: flex-end;
    background: linear-gradient(135deg, #960ffa 0%, #790bc9 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.support-bubble.staff {
    align-self: flex-start;
    background: #ffffff;
    color: #2d1a6b;
    border: 1px solid #e5e3ee;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(45, 26, 107, 0.04);
}

.bubble-sender-tag {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #960ffa;
}

.bubble-time {
    font-size: 0.68rem;
    margin-top: 4px;
    text-align: right;
    opacity: 0.75;
}

/* Chat Attachments inside Bubbles */
.bubble-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.bubble-att-card {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.support-bubble.staff .bubble-att-card {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #5b21b6;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #ebe8f2;
}

.btn-chat-attach {
    background: #f3f0fb;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #960ffa;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-chat-attach:hover {
    background: #e9e2fa;
}

.chat-text-input {
    flex: 1;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid #e0e0eb;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

.chat-text-input:focus {
    border-color: #960ffa;
}

.need-help-frame .btn-chat-send {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 8px 14px !important;
    width: auto !important;
    height: 36px !important;
    min-width: 68px !important;
    background: #960ffa !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 2px 8px rgba(150, 15, 250, 0.25) !important;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.need-help-frame .btn-chat-send:hover:not(:disabled) {
    background: #790bc9 !important;
    box-shadow: 0 4px 12px rgba(150, 15, 250, 0.38) !important;
}

.need-help-frame .btn-chat-send:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* WhatsApp Animated Typing Bubble & Double Ticks */
.need-help-frame .whatsapp-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 18px;
    background: #F3E8FF;
    color: #6B21A8;
    font-size: 11.5px;
    animation: fadeIn 0.2s ease;
    width: fit-content;
    box-shadow: 0 1px 4px rgba(107, 33, 168, 0.08);
}

.need-help-frame .whatsapp-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.need-help-frame .whatsapp-typing-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9333EA;
    display: inline-block;
    animation: whatsappDotBounce 1.4s infinite ease-in-out both;
}

.need-help-frame .whatsapp-typing-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.need-help-frame .whatsapp-typing-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.need-help-frame .whatsapp-typing-dots .dot:nth-child(3) { animation-delay: 0s; }

/* Consecutive Messages Wait Banner */
.support-chat-wait-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #FFFBEB;
    border-top: 1px solid #FDE68A;
    border-bottom: 1px solid #FDE68A;
    color: #92400E;
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 500;
}

.support-chat-wait-banner span.material-symbols-outlined {
    color: #D97706;
    flex-shrink: 0;
}

/* Image Attachment Thumbnails in Chat Bubbles & Previews */
.bubble-img-thumbnail {
    display: block;
    width: 140px;
    max-width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.support-bubble.staff .bubble-img-thumbnail {
    border-color: #E2E8F0;
}

.bubble-img-thumbnail:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

.chat-pending-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d1c4e9;
    flex-shrink: 0;
}

.chat-pending-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-pending-thumb .remove-thumb {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.chat-pending-thumb .remove-thumb:hover {
    background: #ef4444;
}

/* Grayed Out / Disabled state for State 2 (Pending) and Limit Locked */
.chat-input-bar.disabled,
.chat-input-bar.wait-locked {
    opacity: 0.45;
    pointer-events: none;
    background: #f8f8fb;
}

.chat-pending-files-bar {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    background: #f8f6fc;
    border-top: 1px solid #eee;
    overflow-x: auto;
    align-items: center;
}

/* Dark Mode Tokens */
[data-theme="dark"] .need-help-pill {
    background: rgba(26, 20, 48, 0.9);
    border-color: rgba(150, 15, 250, 0.4);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .need-help-frame {
    background: #18132b;
    border-color: rgba(150, 15, 250, 0.35);
    color: #ffffff;
}

[data-theme="dark"] .frame-body-state {
    background: #151026;
}

[data-theme="dark"] .portal-tab-bar {
    background: #1f1838;
    border-color: #2b224c;
}

[data-theme="dark"] .portal-tab {
    color: #a5a0c0;
}

[data-theme="dark"] .portal-tab.active {
    background: #2a204d;
    color: #ffffff;
}

[data-theme="dark"] .mini-form-group label {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .mini-faq-search input,
[data-theme="dark"] .mini-input,
[data-theme="dark"] .chat-text-input {
    background: #1f1838;
    border-color: #312658;
    color: #ffffff;
}

[data-theme="dark"] select.mini-input option {
    background: #1f1838;
    color: #ffffff;
}

/* Mini Dropzone Attachment Bar in Dark Mode */
[data-theme="dark"] .mini-dropzone {
    background: #1c1533 !important;
    border: 1.5px dashed rgba(167, 139, 250, 0.35) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .mini-dropzone:hover {
    background: #251b44 !important;
    border-color: #c084fc !important;
    color: #ffffff !important;
}

[data-theme="dark"] .mini-dropzone i {
    color: #c084fc !important;
}

[data-theme="dark"] .mini-dropzone span {
    color: #cbd5e1 !important;
}

/* File Chips in Dark Mode */
[data-theme="dark"] .mini-chip {
    background: #2b1f48 !important;
    color: #e9d5ff !important;
    border: 1px solid rgba(167, 139, 250, 0.35) !important;
}

[data-theme="dark"] .mini-chip .remove-c {
    color: #fca5a5 !important;
}

[data-theme="dark"] .mini-chip .remove-c:hover {
    color: #ef4444 !important;
}

/* CTA Card in Dark Mode */
[data-theme="dark"] .portal-cta-card {
    background: linear-gradient(135deg, rgba(150, 15, 250, 0.15) 0%, rgba(45, 26, 107, 0.25) 100%) !important;
    border: 1px solid rgba(167, 139, 250, 0.25) !important;
}

[data-theme="dark"] .cta-text strong {
    color: #ffffff !important;
}

[data-theme="dark"] .cta-text span {
    color: #a5a0c0 !important;
}

[data-theme="dark"] .mini-faq-item {
    background: #1f1838;
    border-color: #312658;
}

[data-theme="dark"] .mini-faq-q {
    color: #ffffff;
}

[data-theme="dark"] .mini-faq-a {
    color: #a5a0c0;
}

[data-theme="dark"] .pending-notice-banner {
    background: #2b1c10 !important;
    border-bottom: 1px solid #4a2f14 !important;
    color: #fde68a !important;
}

[data-theme="dark"] .pending-notice-banner i {
    color: #f59e0b !important;
}

[data-theme="dark"] .active-ticket-infobar {
    background: #221a3b !important;
    border-bottom: 1px solid #36295c !important;
}

[data-theme="dark"] .infobar-ticket {
    color: #c4b5fd !important;
}

[data-theme="dark"] .chat-messages-area {
    background: #140f24;
}

[data-theme="dark"] .support-bubble.staff {
    background: #221b3d;
    border-color: #342a5c;
    color: #ffffff;
}

[data-theme="dark"] .chat-input-bar {
    background: #1a1330;
    border-color: #2a204c;
}

[data-theme="dark"] .btn-chat-attach {
    background: #251b42 !important;
    color: #c084fc !important;
}

[data-theme="dark"] .btn-chat-attach:hover {
    background: #312356 !important;
}

[data-theme="dark"] .chat-pending-files-bar {
    background: #18122d !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .need-help-frame .whatsapp-typing-bubble {
    background: #271a3d !important;
    color: #c4b5fd !important;
    border: 1px solid rgba(167, 139, 250, 0.2) !important;
}

[data-theme="dark"] .need-help-frame .whatsapp-typing-dots .dot {
    background: #A78BFA !important;
}

[data-theme="dark"] .support-chat-wait-banner {
    background: #2d2416 !important;
    border-top-color: #5c431d !important;
    border-bottom-color: #5c431d !important;
    color: #fde68a !important;
}

[data-theme="dark"] .need-help-frame .btn-chat-send {
    background: #960ffa !important;
}

[data-theme="dark"] .need-help-frame .btn-chat-send:hover:not(:disabled) {
    background: #8b5cf6 !important;
}

[data-theme="dark"] .chat-pending-thumb {
    border-color: rgba(167, 139, 250, 0.35) !important;
}

[data-theme="dark"] .active-ticket-infobar {
    background: #18112c !important;
    border-bottom-color: #2e2352 !important;
}

[data-theme="dark"] .infobar-ticket {
    color: #c084fc !important;
}

[data-theme="dark"] .admin-presence-pill {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

[data-theme="dark"] .admin-presence-pill.recent {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .admin-presence-pill.offline {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

/* =============================================================
   PAST TICKETS / RESOLVED HISTORY STYLES
   ============================================================= */
.history-count-badge {
    background: #960ffa;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.2;
    margin-left: 2px;
}

.history-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f0f5;
}

.history-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #2d1a6b;
}

.btn-history-refresh {
    background: transparent;
    border: none;
    color: #6b6b8a;
    cursor: pointer;
    font-size: 0.88rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-history-refresh:hover {
    background: #f4f3f8;
    color: #960ffa;
}

.history-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.history-ticket-card {
    background: #ffffff;
    border: 1.5px solid #ebe9f2;
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-ticket-card:hover {
    transform: translateY(-2px);
    border-color: #960ffa;
    box-shadow: 0 6px 18px rgba(150, 15, 250, 0.12);
}

.history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-ticket-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: #960ffa;
    background: rgba(150, 15, 250, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
}

.history-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.history-card-subject {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e1248;
    line-height: 1.35;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-preview {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed #f1f0f5;
}

.history-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.history-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(150, 15, 250, 0.08);
    color: #960ffa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.resolved-notice-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ecfdf5;
    border-bottom: 1px solid #a7f3d0;
}

.btn-history-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #10b981;
    color: #059669;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-history-back:hover {
    background: #10b981;
    color: #ffffff;
}

/* Dark Mode Overrides for Past Tickets */
[data-theme="dark"] .history-header-bar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .history-title {
    color: #e9d5ff;
}

[data-theme="dark"] .btn-history-refresh {
    color: #a78bfa;
}

[data-theme="dark"] .btn-history-refresh:hover {
    background: #251b42;
    color: #c084fc;
}

[data-theme="dark"] .history-ticket-card {
    background: #1a1330;
    border-color: #2e2352;
}

[data-theme="dark"] .history-ticket-card:hover {
    border-color: #a78bfa;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .history-ticket-num {
    background: rgba(167, 139, 250, 0.15);
    color: #c084fc;
}

[data-theme="dark"] .history-card-subject {
    color: #ffffff;
}

[data-theme="dark"] .history-card-preview {
    color: #94a3b8;
}

[data-theme="dark"] .history-card-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    color: #8174a0;
}

[data-theme="dark"] .history-empty-icon {
    background: rgba(167, 139, 250, 0.15);
    color: #c084fc;
}

[data-theme="dark"] .resolved-notice-banner {
    background: #064e3b;
    border-bottom-color: #047857;
}

[data-theme="dark"] #resolvedNoticeText {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .btn-history-back {
    background: #047857;
    border-color: #10b981;
    color: #ecfdf5;
}

[data-theme="dark"] .btn-history-back:hover {
    background: #10b981;
    color: #ffffff;
}

[data-theme="dark"] .mini-char-counter {
    color: #94A3B8 !important;
}

[data-theme="dark"] .mini-char-counter.limit-near {
    color: #FBBF24 !important;
}

[data-theme="dark"] .mini-char-counter.limit-reached {
    color: #F87171 !important;
}

[data-theme="dark"] .support-chat-char-counter {
    color: #94A3B8 !important;
}

