/**
 * Oxford Lizzy - Frontend Styles
 * Styles for public-facing shortcodes and widgets
 */

/* =====================================================
   CONVERSATIONS LIST SHORTCODE
   ===================================================== */

.oxford-lizzy-conversations-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.oxford-lizzy-conversations-widget .conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.oxford-lizzy-conversations-widget .conversations-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.oxford-lizzy-conversations-widget .conversations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.oxford-lizzy-conversations-widget .conversation-item {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.oxford-lizzy-conversations-widget .conversation-item:hover {
    background-color: #f8f9fa;
}

.oxford-lizzy-conversations-widget .conversation-item:last-child {
    border-bottom: none;
}

.oxford-lizzy-conversations-widget .conversation-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
}

.oxford-lizzy-conversations-widget .conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.oxford-lizzy-conversations-widget .conversation-content {
    flex: 1;
    min-width: 0;
}

.oxford-lizzy-conversations-widget .conversation-name {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
    margin-bottom: 2px;
}

.oxford-lizzy-conversations-widget .conversation-preview {
    font-size: 13px;
    color: #646970;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oxford-lizzy-conversations-widget .conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.oxford-lizzy-conversations-widget .conversation-time {
    font-size: 11px;
    color: #a7aaad;
}

.oxford-lizzy-conversations-widget .conversation-unread {
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.oxford-lizzy-conversations-widget .no-conversations {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
}

.oxford-lizzy-conversations-widget .no-conversations p {
    margin: 0;
}

/* =====================================================
   CHAT WIDGET SHORTCODE
   ===================================================== */

.oxford-lizzy-chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Chat Header */
.oxford-lizzy-chat-widget .chat-header {
    background: #2271b1;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.oxford-lizzy-chat-widget .chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.oxford-lizzy-chat-widget .chat-header-info {
    flex: 1;
}

.oxford-lizzy-chat-widget .chat-header-name {
    font-weight: 600;
    font-size: 15px;
}

.oxford-lizzy-chat-widget .chat-header-status {
    font-size: 12px;
    opacity: 0.8;
}

.oxford-lizzy-chat-widget .chat-header-actions {
    display: flex;
    gap: 8px;
}

.oxford-lizzy-chat-widget .chat-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.oxford-lizzy-chat-widget .chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.oxford-lizzy-chat-widget .chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f6f7f7;
}

.oxford-lizzy-chat-widget .chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oxford-lizzy-chat-widget .chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.oxford-lizzy-chat-widget .chat-message-received {
    align-self: flex-start;
}

.oxford-lizzy-chat-widget .chat-message-sent {
    align-self: flex-end;
}

.oxford-lizzy-chat-widget .chat-message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.oxford-lizzy-chat-widget .chat-message-received .chat-message-bubble {
    background: #fff;
    color: #1d2327;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.oxford-lizzy-chat-widget .chat-message-sent .chat-message-bubble {
    background: #2271b1;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.oxford-lizzy-chat-widget .chat-message-time {
    font-size: 11px;
    color: #a7aaad;
    margin-top: 4px;
    padding: 0 4px;
}

.oxford-lizzy-chat-widget .chat-message-sent .chat-message-time {
    text-align: right;
}

.oxford-lizzy-chat-widget .chat-message-status {
    font-size: 10px;
    margin-left: 4px;
}

/* Date separator */
.oxford-lizzy-chat-widget .chat-date-separator {
    text-align: center;
    margin: 15px 0;
}

.oxford-lizzy-chat-widget .chat-date-separator span {
    background: #e9ecef;
    color: #646970;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 10px;
}

/* Loading state */
.oxford-lizzy-chat-widget .chat-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.oxford-lizzy-chat-widget .chat-loading-dots {
    display: flex;
    gap: 4px;
}

.oxford-lizzy-chat-widget .chat-loading-dots span {
    width: 8px;
    height: 8px;
    background: #a7aaad;
    border-radius: 50%;
    animation: chatLoadingDot 1.4s infinite ease-in-out;
}

.oxford-lizzy-chat-widget .chat-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.oxford-lizzy-chat-widget .chat-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes chatLoadingDot {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* No messages */
.oxford-lizzy-chat-widget .chat-no-messages {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.oxford-lizzy-chat-widget .chat-no-messages-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.oxford-lizzy-chat-widget .chat-no-messages p {
    margin: 0;
}

/* Chat Input */
.oxford-lizzy-chat-widget .chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.oxford-lizzy-chat-widget .chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #dcdcde;
    border-radius: 20px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

.oxford-lizzy-chat-widget .chat-input-field:focus {
    border-color: #2271b1;
    outline: none;
}

.oxford-lizzy-chat-widget .chat-input-field::placeholder {
    color: #a7aaad;
}

.oxford-lizzy-chat-widget .chat-send-btn {
    background: #2271b1;
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.oxford-lizzy-chat-widget .chat-send-btn:hover {
    background: #135e96;
}

.oxford-lizzy-chat-widget .chat-send-btn:disabled {
    background: #dcdcde;
    cursor: not-allowed;
}

.oxford-lizzy-chat-widget .chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   TYPING INDICATOR
   ===================================================== */

.oxford-lizzy-chat-widget .typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 80px;
    align-self: flex-start;
}

.oxford-lizzy-chat-widget .typing-indicator span {
    width: 6px;
    height: 6px;
    background: #a7aaad;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.oxford-lizzy-chat-widget .typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.oxford-lizzy-chat-widget .typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        opacity: 0.4;
    }
    40% {
        opacity: 1;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
    .oxford-lizzy-chat-widget .chat-message {
        max-width: 85%;
    }

    .oxford-lizzy-chat-widget .chat-header {
        padding: 12px 15px;
    }

    .oxford-lizzy-chat-widget .chat-messages {
        padding: 15px;
        height: 350px;
    }

    .oxford-lizzy-chat-widget .chat-input {
        padding: 12px 15px;
    }

    .oxford-lizzy-conversations-widget .conversation-link {
        padding: 10px 12px;
    }

    .oxford-lizzy-conversations-widget .conversation-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */

.oxford-lizzy-chat-widget .chat-input-field:focus,
.oxford-lizzy-chat-widget .chat-send-btn:focus,
.oxford-lizzy-chat-widget .chat-header-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.oxford-lizzy-conversations-widget .conversation-link:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

/* Screen reader only */
.oxford-lizzy-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================
   SHORTCODE: [oxford_lizzy_conversations]
   ===================================================== */

.oxford-lizzy-conversations-shortcode {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 500px;
}

.oxford-lizzy-conversations-shortcode .conversations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.oxford-lizzy-conversations-shortcode .conversation-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.oxford-lizzy-conversations-shortcode .conversation-item:last-child {
    border-bottom: none;
}

.oxford-lizzy-conversations-shortcode .conversation-item:hover {
    background-color: #f8f9fa;
}

.oxford-lizzy-conversations-shortcode .conversation-item.has-unread {
    background-color: #fff8e5;
}

.oxford-lizzy-conversations-shortcode .conversation-item.has-unread:hover {
    background-color: #fff3d0;
}

.oxford-lizzy-conversations-shortcode .conversation-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
}

.oxford-lizzy-conversations-shortcode .conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.oxford-lizzy-conversations-shortcode .conversation-info {
    flex: 1;
    min-width: 0;
}

.oxford-lizzy-conversations-shortcode .conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.oxford-lizzy-conversations-shortcode .conversation-name {
    font-size: 15px;
    color: #1d2327;
}

.oxford-lizzy-conversations-shortcode .conversation-time {
    font-size: 12px;
    color: #8c8f94;
}

.oxford-lizzy-conversations-shortcode .conversation-preview {
    font-size: 13px;
    color: #646970;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oxford-lizzy-conversations-shortcode .unread-badge {
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.oxford-lizzy-conversations-shortcode .no-conversations {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
}

/* =====================================================
   SHORTCODE: [oxford_lizzy_chat]
   ===================================================== */

.oxford-lizzy-chat-shortcode {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 600px;
}

/* Chat Header */
.oxford-lizzy-chat-shortcode .chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oxford-lizzy-chat-shortcode .chat-contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.oxford-lizzy-chat-shortcode .contact-name {
    font-weight: 600;
    font-size: 16px;
}

.oxford-lizzy-chat-shortcode .contact-phone {
    font-size: 13px;
    opacity: 0.85;
}

.oxford-lizzy-chat-shortcode .btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
}

.oxford-lizzy-chat-shortcode .btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Chat Messages */
.oxford-lizzy-chat-shortcode .chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 20px;
    background: #f6f7f7;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oxford-lizzy-chat-shortcode .chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.oxford-lizzy-chat-shortcode .chat-message-received {
    align-self: flex-start;
}

.oxford-lizzy-chat-shortcode .chat-message-sent {
    align-self: flex-end;
}

.oxford-lizzy-chat-shortcode .message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.oxford-lizzy-chat-shortcode .chat-message-received .message-bubble {
    background: #fff;
    color: #1d2327;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.oxford-lizzy-chat-shortcode .chat-message-sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.oxford-lizzy-chat-shortcode .message-time {
    font-size: 11px;
    color: #8c8f94;
    margin-top: 4px;
    padding: 0 4px;
}

.oxford-lizzy-chat-shortcode .chat-message-sent .message-time {
    text-align: right;
}

.oxford-lizzy-chat-shortcode .no-messages {
    text-align: center;
    color: #646970;
    margin: auto;
}

/* Chat Input */
.oxford-lizzy-chat-shortcode .chat-input-area {
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 16px 20px;
}

.oxford-lizzy-chat-shortcode .chat-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.oxford-lizzy-chat-shortcode .chat-form textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dcdcde;
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
}

.oxford-lizzy-chat-shortcode .chat-form textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.oxford-lizzy-chat-shortcode .chat-form textarea::placeholder {
    color: #a7aaad;
}

.oxford-lizzy-chat-shortcode .btn-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.2s;
}

.oxford-lizzy-chat-shortcode .btn-send:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.oxford-lizzy-chat-shortcode .btn-send:active {
    transform: translateY(0);
}

/* Notices */
.oxford-lizzy-notice {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
    background: #f6f7f7;
    border-radius: 8px;
}

.oxford-lizzy-error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #fcf0f1;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 600px) {
    .oxford-lizzy-conversations-shortcode,
    .oxford-lizzy-chat-shortcode {
        border-radius: 0;
        max-width: 100%;
    }

    .oxford-lizzy-chat-shortcode .chat-messages {
        height: 350px;
        padding: 15px;
    }

    .oxford-lizzy-chat-shortcode .chat-message {
        max-width: 85%;
    }

    .oxford-lizzy-chat-shortcode .chat-form {
        flex-direction: column;
    }

    .oxford-lizzy-chat-shortcode .btn-send {
        width: 100%;
    }
}

/* =====================================================
   WEBCHAT STATS DASHBOARD
   ===================================================== */

.webchat-stats-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.webchat-stats-dashboard .stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.webchat-stats-dashboard .stats-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.webchat-stats-dashboard .stats-date {
    font-size: 13px;
    color: #646970;
}

.webchat-stats-dashboard .stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.webchat-stats-dashboard .stats-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 160px;
    flex: 1;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.webchat-stats-dashboard .stats-card:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.webchat-stats-dashboard .stats-card.stats-totals {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    border: none;
}

.webchat-stats-dashboard .stats-card.stats-totals .stats-label {
    color: rgba(255, 255, 255, 0.9);
}

.webchat-stats-dashboard .stats-card.stats-totals .stat-name {
    color: rgba(255, 255, 255, 0.8);
}

.webchat-stats-dashboard .stats-card.stats-totals .stat-value {
    color: #fff;
}

.webchat-stats-dashboard .stats-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.webchat-stats-dashboard .stats-icon {
    font-size: 16px;
}

.webchat-stats-dashboard .stats-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.webchat-stats-dashboard .stats-card-body {
    display: flex;
    gap: 16px;
}

.webchat-stats-dashboard .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.webchat-stats-dashboard .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.webchat-stats-dashboard .stat-name {
    font-size: 10px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Highlight values with color coding */
.webchat-stats-dashboard .stat-unread.has-value .stat-value {
    color: #d63638;
}

.webchat-stats-dashboard .stat-new.has-value .stat-value {
    color: #00a32a;
}

.webchat-stats-dashboard .stat-sent.has-value .stat-value {
    color: #2271b1;
}

/* Totals card overrides */
.webchat-stats-dashboard .stats-totals .stat-unread.has-value .stat-value {
    color: #ffb3b3;
}

.webchat-stats-dashboard .stats-totals .stat-new.has-value .stat-value {
    color: #90ee90;
}

.webchat-stats-dashboard .stats-totals .stat-sent.has-value .stat-value {
    color: #add8e6;
}

/* Responsive */
@media (max-width: 768px) {
    .webchat-stats-dashboard {
        padding: 12px;
    }

    .webchat-stats-dashboard .stats-grid {
        gap: 8px;
    }

    .webchat-stats-dashboard .stats-card {
        min-width: calc(50% - 4px);
        flex: 0 0 calc(50% - 4px);
        padding: 10px 12px;
    }

    .webchat-stats-dashboard .stats-card.stats-totals {
        flex: 0 0 100%;
    }

    .webchat-stats-dashboard .stats-card-body {
        gap: 12px;
    }

    .webchat-stats-dashboard .stat-value {
        font-size: 18px;
    }

    .webchat-stats-dashboard .stat-name {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .webchat-stats-dashboard .stats-card {
        min-width: 100%;
        flex: 0 0 100%;
    }
}

/* =====================================================
   WEBCHAT - Full Interface (WhatsApp Web Style)
   [oxford_lizzy_webchat]
   ===================================================== */

.oxford-webchat {
    display: flex;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Allow modals to overflow when active */
.oxford-webchat.modal-open,
.oxford-webchat:has(.webchat-ai-duration-modal.active),
.oxford-webchat:has(.webchat-template-modal.active) {
    overflow: visible;
}

/* =====================================================
   SIDEBAR - Conversations List (Left Panel)
   ===================================================== */

.oxford-webchat .webchat-sidebar {
    width: 380px;
    min-width: 380px;
    background: #fff;
    border-right: 1px solid #e9edef;
    display: flex;
    flex-direction: column;
}

.oxford-webchat .webchat-sidebar-header {
    padding: 16px;
    background: #f0f2f5;
    border-bottom: 1px solid #e9edef;
}

.oxford-webchat .webchat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Tabs for switching between conversations and pending leads */
.oxford-webchat .webchat-tabs {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.oxford-webchat .webchat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #e9edef !important;
    border: none !important;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #54656f !important;
    transition: all 0.2s ease;
    outline: none !important;
    box-shadow: none !important;
}

.oxford-webchat .webchat-tab:hover {
    background: #d9dbdd !important;
}

.oxford-webchat .webchat-tab.active {
    background: #00a884 !important;
    color: #fff !important;
}

.oxford-webchat .webchat-tab .tab-icon {
    font-size: 14px;
    line-height: 1;
}

.oxford-webchat .webchat-tab .tab-label {
    display: inline;
}

.oxford-webchat .webchat-tab .tab-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

.oxford-webchat .webchat-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Pending Leads List */
.oxford-webchat .webchat-pending-leads-list {
    flex: 1;
    overflow-y: auto;
}

.oxford-webchat .pending-leads-loading,
.oxford-webchat .pending-leads-empty {
    padding: 30px 15px;
    text-align: center;
    color: #667781;
}

.oxford-webchat .pending-leads-hint {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.8;
}

.oxford-webchat .pending-lead-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.oxford-webchat .pending-lead-item:hover {
    background-color: #f0f2f5;
}

.oxford-webchat .pending-lead-item .lead-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #dfe5e7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #667781;
    flex-shrink: 0;
}

.oxford-webchat .pending-lead-item .lead-details {
    flex: 1;
    min-width: 0;
}

.oxford-webchat .pending-lead-item .lead-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.oxford-webchat .pending-lead-item .lead-name {
    font-size: 15px;
    font-weight: 500;
    color: #111b21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oxford-webchat .pending-lead-item .lead-date {
    font-size: 12px;
    color: #667781;
    flex-shrink: 0;
}

.oxford-webchat .pending-lead-item .lead-info {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: #667781;
}

.oxford-webchat .pending-lead-item .lead-phone {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oxford-webchat .pending-lead-item .lead-consultor {
    background: #fff3e0;
    color: #e65100;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    flex-shrink: 0;
}

.oxford-webchat .pending-lead-item .lead-action-icon {
    font-size: 18px;
    opacity: 0.5;
    flex-shrink: 0;
}

.oxford-webchat .pending-lead-item:hover .lead-action-icon {
    opacity: 1;
}

.oxford-webchat .btn-load-more-leads {
    display: block;
    width: calc(100% - 30px);
    margin: 15px;
    padding: 10px;
    background: #f0f2f5;
    border: none;
    border-radius: 8px;
    color: #00a884;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.oxford-webchat .btn-load-more-leads:hover {
    background: #e1e4e8;
}

.oxford-webchat .btn-load-more-leads:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Pending Leads Filters */
.oxford-webchat .webchat-pending-filters {
    background: #f0f2f5;
    border-bottom: 1px solid #e9edef;
}

.oxford-webchat .webchat-pending-filters .pending-filters-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 16px;
    gap: 12px;
}

.oxford-webchat .webchat-pending-filters .pending-show-all-toggle,
.oxford-webchat .webchat-pending-filters .pending-include-sem-consultor {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #54656f;
    cursor: pointer;
    padding: 6px 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.oxford-webchat .webchat-pending-filters .pending-show-all-toggle:hover,
.oxford-webchat .webchat-pending-filters .pending-include-sem-consultor:hover {
    background: #f8f9fa;
    border-color: #d5dadf;
}

.oxford-webchat .webchat-pending-filters .pending-show-all-toggle input[type="checkbox"],
.oxford-webchat .webchat-pending-filters .pending-include-sem-consultor input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #00a884;
    cursor: pointer;
    margin: 0;
}

.oxford-webchat .webchat-pending-filters .pending-show-all-toggle:has(input:checked) {
    background: #e7f8f5;
    border-color: #00a884;
    color: #00a884;
}

.oxford-webchat .webchat-pending-filters .pending-include-sem-consultor:has(input:checked) {
    background: #fff3e0;
    border-color: #e65100;
    color: #e65100;
}

.oxford-webchat .webchat-pending-filters .pending-leads-search {
    padding: 0 16px 10px 16px;
}

.oxford-webchat .webchat-pending-filters .pending-leads-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9edef;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.oxford-webchat .webchat-pending-filters .pending-leads-search input:focus {
    outline: none;
    border-color: #00a884;
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
}

.oxford-webchat .webchat-pending-filters .pending-leads-search input::placeholder {
    color: #8696a0;
}

.oxford-webchat .webchat-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111b21;
}

/* Notification button */
.oxford-webchat .btn-enable-notifications {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.oxford-webchat .btn-enable-notifications:hover {
    background: rgba(0, 0, 0, 0.05);
}

.oxford-webchat .btn-enable-notifications .notification-icon {
    font-size: 18px;
    display: block;
    line-height: 1;
}

.oxford-webchat .btn-enable-notifications.notifications-enabled {
    color: #00a884;
}

.oxford-webchat .btn-enable-notifications.notifications-blocked {
    opacity: 0.5;
}

.oxford-webchat .webchat-search {
    margin-top: 12px;
}

/* New conversation animation */
.oxford-webchat .webchat-conversation-item.new-conversation {
    animation: highlight-new 3s ease-out;
}

@keyframes highlight-new {
    0% { background: #90ee90; }
    100% { background: transparent; }
}

.oxford-webchat .webchat-search input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.oxford-webchat .webchat-search input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}

.oxford-webchat .webchat-search input::placeholder {
    color: #8696a0;
}

/* Filters Section */
.oxford-webchat .webchat-filters {
    background: #f0f2f5;
    border-bottom: 1px solid #e9edef;
}

.oxford-webchat .webchat-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 12px;
}

.oxford-webchat .btn-toggle-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e9edef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #54656f;
    transition: all 0.15s;
}

.oxford-webchat .btn-toggle-filters:hover {
    background: #f5f6f6;
    border-color: #00a884;
}

.oxford-webchat .btn-toggle-filters .filter-icon {
    font-size: 14px;
}

.oxford-webchat .btn-toggle-filters .filter-count {
    background: #00a884;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.oxford-webchat .show-all-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #54656f;
    cursor: pointer;
}

.oxford-webchat .show-all-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00a884;
    cursor: pointer;
}

.oxford-webchat .webchat-filters-body {
    display: none;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e9edef;
}

.oxford-webchat .webchat-filters-body.filters-open {
    display: block;
}

.oxford-webchat .filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.oxford-webchat .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.oxford-webchat .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #8696a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oxford-webchat .filter-group select {
    padding: 8px 10px;
    border: 1px solid #e9edef;
    border-radius: 6px;
    font-size: 13px;
    color: #111b21;
    background: #fff;
    cursor: pointer;
}

.oxford-webchat .filter-group select:focus {
    outline: none;
    border-color: #00a884;
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
}

.oxford-webchat .filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.oxford-webchat .btn-apply-filters {
    padding: 8px 16px;
    background: #00a884;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.oxford-webchat .btn-apply-filters:hover {
    background: #008f6f;
}

.oxford-webchat .btn-clear-filters {
    padding: 8px 16px;
    background: transparent;
    color: #54656f;
    border: 1px solid #e9edef;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.oxford-webchat .btn-clear-filters:hover {
    background: #f5f6f6;
    color: #111b21;
}

.oxford-webchat .webchat-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 12px;
    background: #fff;
}

.oxford-webchat .active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e7f8f5;
    color: #00a884;
    font-size: 12px;
    font-weight: 500;
    border-radius: 16px;
}

.oxford-webchat .active-filter-tag .remove-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(0, 168, 132, 0.2);
    color: #00a884;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s;
}

.oxford-webchat .active-filter-tag .remove-filter:hover {
    background: rgba(0, 168, 132, 0.3);
}

.oxford-webchat .webchat-conversations-list {
    flex: 1;
    overflow-y: auto;
}

.oxford-webchat .webchat-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f0f2f5;
}

.oxford-webchat .webchat-conversation-item:hover {
    background: #f5f6f6;
}

.oxford-webchat .webchat-conversation-item.active {
    background: #f0f2f5;
    border-left: 4px solid #00a884;
    padding-left: 12px;
}

.oxford-webchat .webchat-conversation-item.active:hover {
    background: #e9ebee;
}

.oxford-webchat .webchat-conversation-item.has-unread {
    background: #e7f8f5;
}

.oxford-webchat .webchat-conversation-item.has-unread.active {
    background: #d8f3ed;
    border-left: 4px solid #00a884;
    padding-left: 12px;
}

.oxford-webchat .webchat-conversation-item.has-unread:hover {
    background: #d8f3ed;
}

.oxford-webchat .webchat-conversation-item .conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a884 0%, #25d366 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.oxford-webchat .webchat-conversation-item .conversation-details {
    flex: 1;
    min-width: 0;
}

.oxford-webchat .webchat-conversation-item .conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.oxford-webchat .webchat-conversation-item .conversation-name {
    font-size: 16px;
    font-weight: 500;
    color: #111b21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oxford-webchat .webchat-conversation-item .conversation-time {
    font-size: 12px;
    color: #667781;
    flex-shrink: 0;
}

.oxford-webchat .webchat-conversation-item.has-unread .conversation-time {
    color: #00a884;
}

.oxford-webchat .webchat-conversation-item .conversation-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oxford-webchat .webchat-conversation-item .conversation-preview {
    font-size: 14px;
    color: #667781;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.oxford-webchat .webchat-conversation-item .lead-consultor {
    background: #fff3e0;
    color: #e65100;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    flex-shrink: 0;
}

.oxford-webchat .webchat-conversation-item .unread-badge {
    background: #00a884;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.oxford-webchat .webchat-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #667781;
}

/* =====================================================
   MAIN - Chat Area (Center Panel)
   ===================================================== */

.oxford-webchat .webchat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #efeae2;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d1d7db' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-width: 0;
}

/* Chat Header */
.oxford-webchat .webchat-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f0f2f5;
    border-bottom: 1px solid #e9edef;
}

.oxford-webchat .btn-back-mobile {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: #54656f;
}

.oxford-webchat .chat-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a884 0%, #25d366 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
}

.oxford-webchat .chat-contact-info {
    flex: 1;
}

.oxford-webchat .chat-contact-info .contact-name {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #111b21;
}

.oxford-webchat .chat-contact-info .contact-phone {
    display: block;
    font-size: 13px;
    color: #667781;
}

.oxford-webchat .chat-header-actions {
    display: flex;
    gap: 8px;
}

/* Presence Indicator - shows who else is viewing */
.oxford-webchat .presence-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 168, 132, 0.1);
    border-radius: 12px;
    font-size: 12px;
    color: #00a884;
    margin-left: auto;
    margin-right: 8px;
    animation: presence-pulse 2s ease-in-out infinite;
}

.oxford-webchat .presence-indicator .presence-icon {
    font-size: 14px;
}

.oxford-webchat .presence-indicator .presence-users {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes presence-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Typing Indicator */
.oxford-webchat .typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 12px;
    margin: 8px 16px;
    width: fit-content;
    font-size: 13px;
    color: #667781;
}

.oxford-webchat .typing-indicator .typing-name {
    font-weight: 500;
    color: #111b21;
    margin-right: 4px;
}

.oxford-webchat .typing-indicator .typing-dots {
    display: flex;
    margin-left: 2px;
}

.oxford-webchat .typing-indicator .typing-dots span {
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.oxford-webchat .typing-indicator .typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Connection Status Indicator */
.oxford-webchat .webchat-connection-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    transition: background-color 0.3s ease;
}

.oxford-webchat .webchat-connection-indicator.connected {
    background-color: #00a32a;
    box-shadow: 0 0 4px rgba(0, 163, 42, 0.5);
}

.oxford-webchat .webchat-connection-indicator.disconnected {
    background-color: #dba617;
    animation: pulse-indicator 1.5s infinite;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* AI Toggle Switch */
.oxford-webchat .ai-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    margin-right: 8px;
}

.oxford-webchat .ai-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
}

.oxford-webchat .ai-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.oxford-webchat .ai-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.oxford-webchat .ai-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.oxford-webchat .ai-toggle input:checked + .ai-toggle-slider {
    background: #00a884;
}

.oxford-webchat .ai-toggle input:checked + .ai-toggle-slider::before {
    transform: translateX(16px);
}

.oxford-webchat .ai-toggle-label {
    font-size: 14px;
}

.oxford-webchat .ai-status-text {
    font-size: 12px;
    font-weight: 500;
    color: #54656f;
}

.oxford-webchat .ai-toggle-wrapper.ai-disabled .ai-status-text {
    color: #f59e0b;
}

.oxford-webchat .btn-toggle-info {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.15s;
}

.oxford-webchat .btn-toggle-info:hover {
    background: rgba(0, 0, 0, 0.05);
}

.oxford-webchat .btn-mark-unread {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.15s;
}

.oxford-webchat .btn-mark-unread:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Context Menu */
.oxford-webchat .webchat-context-menu {
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    z-index: 10000;
    padding: 6px 0;
    display: none;
}

.oxford-webchat .webchat-context-menu.active {
    display: block;
}

.oxford-webchat .webchat-context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1d2327;
    transition: background-color 0.15s;
}

.oxford-webchat .webchat-context-menu-item:hover {
    background: #f0f0f0;
}

.oxford-webchat .webchat-context-menu-item .menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Chat Messages */
.oxford-webchat .webchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.oxford-webchat .webchat-message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    margin-bottom: 2px;
}

.oxford-webchat .webchat-message-received {
    align-self: flex-start;
}

/* Audio messages need more width for the player controls */
.oxford-webchat .webchat-message:has(.audio-message) {
    max-width: 75%;
    min-width: 250px;
}

.oxford-webchat .webchat-message-sent {
    align-self: flex-end;
}

.oxford-webchat .webchat-message .message-bubble {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.oxford-webchat .webchat-message-received .message-bubble {
    background: #fff;
    color: #111b21;
    border-top-left-radius: 0;
}

.oxford-webchat .webchat-message-sent .message-bubble {
    background: #d9fdd3;
    color: #111b21;
    border-top-right-radius: 0;
}

.oxford-webchat .webchat-message .message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    margin-top: 2px;
}

.oxford-webchat .webchat-message .message-time {
    font-size: 11px;
    color: #667781;
}

/* Message Sender Badge */
.oxford-webchat .webchat-message .message-sender {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2px;
}

.oxford-webchat .message-sender-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.oxford-webchat .message-sender-badge.sender-ai {
    background: #e0f2fe;
    color: #0369a1;
}

.oxford-webchat .message-sender-badge.sender-consultant {
    background: #fef3c7;
    color: #92400e;
}

.oxford-webchat .webchat-empty-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #667781;
}

/* Chat Input */
.oxford-webchat .webchat-input-area {
    padding: 10px 16px;
    background: #f0f2f5;
}

/* Template Trigger Button */
.oxford-webchat .btn-template-trigger {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    animation: pulse-warning 2s infinite;
}

.oxford-webchat .btn-template-trigger:hover {
    background: #fde68a;
    transform: scale(1.05);
}

.oxford-webchat .template-trigger-icon {
    font-size: 18px;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* AI Duration Modal */
.oxford-webchat .webchat-ai-duration-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    overflow: visible;
}

.oxford-webchat .webchat-ai-duration-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.oxford-webchat .ai-duration-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.oxford-webchat .ai-duration-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

.oxford-webchat .ai-duration-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9edef;
}

.oxford-webchat .ai-duration-modal-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111b21;
}

.oxford-webchat .ai-duration-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #54656f;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.oxford-webchat .ai-duration-modal-close:hover {
    color: #111b21;
}

.oxford-webchat .ai-duration-modal-body {
    padding: 16px 20px;
}

.oxford-webchat .ai-duration-notice {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #54656f;
    line-height: 1.5;
}

.oxford-webchat .ai-duration-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.oxford-webchat .ai-duration-option {
    padding: 12px 16px;
    background: #f0f2f5;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #111b21;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.oxford-webchat .ai-duration-option:hover {
    background: #e4e6e9;
    border-color: #00a884;
}

.oxford-webchat .ai-duration-option:active {
    background: #dcfce7;
    border-color: #00a884;
}

.oxford-webchat .ai-duration-option.ai-duration-manual {
    grid-column: span 2;
    background: #fef3c7;
    color: #92400e;
}

.oxford-webchat .ai-duration-option.ai-duration-manual:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

/* Template Modal */
.oxford-webchat .webchat-template-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    overflow: visible;
}

.oxford-webchat .webchat-template-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.oxford-webchat .template-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.oxford-webchat .template-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oxford-webchat .template-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9edef;
}

.oxford-webchat .template-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111b21;
}

.oxford-webchat .template-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #54656f;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.oxford-webchat .template-modal-close:hover {
    color: #111b21;
}

.oxford-webchat .template-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.oxford-webchat .template-modal-notice {
    margin: 0 0 16px 0;
    padding: 12px;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.4;
}

/* Template List */
.oxford-webchat .template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oxford-webchat .template-item {
    border: 2px solid #e9edef;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.oxford-webchat .template-item:hover {
    border-color: #00a884;
    background: #f0fdf9;
}

.oxford-webchat .template-item.selected {
    border-color: #00a884;
    background: #dcfce7;
}

.oxford-webchat .template-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.oxford-webchat .template-name {
    font-size: 14px;
    font-weight: 600;
    color: #111b21;
}

.oxford-webchat .template-category {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oxford-webchat .template-category-utility {
    background: #dbeafe;
    color: #1e40af;
}

.oxford-webchat .template-category-service {
    background: #dcfce7;
    color: #166534;
}

.oxford-webchat .template-category-marketing {
    background: #fce7f3;
    color: #9d174d;
}

.oxford-webchat .template-preview {
    font-size: 13px;
    color: #54656f;
    line-height: 1.5;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.oxford-webchat .template-item-footer {
    font-size: 11px;
    color: #8696a0;
}

.oxford-webchat .template-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e9edef;
}

.oxford-webchat .template-modal-footer .btn-cancel {
    padding: 10px 20px;
    background: #f0f2f5;
    color: #54656f;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.oxford-webchat .template-modal-footer .btn-cancel:hover {
    background: #e4e6e9;
}

.oxford-webchat .template-modal-footer .btn-send-template {
    padding: 10px 20px;
    background: #00a884;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.oxford-webchat .template-modal-footer .btn-send-template:hover {
    background: #008f72;
}

.oxford-webchat .template-modal-footer .btn-send-template:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Form disabled state when window expired */
.oxford-webchat .webchat-form.window-expired {
    opacity: 1;
}

.oxford-webchat .webchat-form.window-expired textarea {
    background: #f3f4f6;
    cursor: not-allowed;
    flex: 1;
}

.oxford-webchat .webchat-form {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.oxford-webchat .webchat-form textarea {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    max-height: 100px;
    background: #fff;
}

.oxford-webchat .webchat-form textarea:focus {
    outline: none;
}

.oxford-webchat .webchat-form textarea::placeholder {
    color: #8696a0;
}

.oxford-webchat .webchat-form .btn-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #00a884;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.oxford-webchat .webchat-form .btn-send svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.oxford-webchat .webchat-form .btn-send:hover {
    background: #008f72;
}

.oxford-webchat .webchat-form .btn-send:disabled {
    background: #8696a0;
    cursor: not-allowed;
}

/* No Selection State */
.oxford-webchat .webchat-no-selection {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
}

.oxford-webchat .no-selection-content {
    text-align: center;
    padding: 40px;
}

.oxford-webchat .no-selection-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.oxford-webchat .no-selection-content h3 {
    font-size: 24px;
    font-weight: 300;
    color: #41525d;
    margin: 0 0 10px 0;
}

.oxford-webchat .no-selection-content p {
    font-size: 14px;
    color: #667781;
    margin: 0;
}

/* =====================================================
   INFO PANEL - Lead Details (Right Panel)
   ===================================================== */

.oxford-webchat .webchat-info-panel {
    width: 360px;
    min-width: 360px;
    background: #fff;
    border-left: 1px solid #e9edef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.oxford-webchat .info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f0f2f5;
    border-bottom: 1px solid #e9edef;
    gap: 12px;
}

.oxford-webchat .info-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111b21;
    flex: 1;
}

/* Hide back button on info panel by default (desktop) */
.oxford-webchat .info-panel-header .btn-back-mobile {
    display: none;
}

.oxford-webchat .btn-close-info {
    background: none;
    border: none;
    font-size: 24px;
    color: #54656f;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: none;
}

.oxford-webchat .info-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.oxford-webchat .lead-profile {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9edef;
    margin-bottom: 20px;
}

.oxford-webchat .lead-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a884 0%, #25d366 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 32px;
    margin: 0 auto 12px;
    text-transform: uppercase;
}

.oxford-webchat .lead-profile .lead-name {
    font-size: 18px;
    font-weight: 500;
    color: #111b21;
    margin: 0;
}

.oxford-webchat .lead-info-section {
    margin-bottom: 20px;
}

.oxford-webchat .lead-info-section h5 {
    font-size: 13px;
    font-weight: 400;
    color: #00a884;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oxford-webchat .info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
}

.oxford-webchat .info-item.full-width {
    flex-direction: column;
}

.oxford-webchat .info-item .info-label {
    font-size: 14px;
    color: #667781;
}

.oxford-webchat .info-item .info-value {
    font-size: 14px;
    color: #111b21;
    font-weight: 500;
}

.oxford-webchat .info-item .info-text {
    font-size: 14px;
    color: #111b21;
    line-height: 1.5;
    margin: 8px 0 0 0;
}

/* Agendamentos Section */
.oxford-webchat .lead-agendamentos {
    border: 1px solid #e9edef;
    border-radius: 8px;
    padding: 12px;
    background: #f8f9fa;
}

.oxford-webchat .lead-agendamentos h5 {
    margin-bottom: 12px;
}

.oxford-webchat .agendamento-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #8696a0;
}

.oxford-webchat .agendamento-item:last-child {
    margin-bottom: 0;
}

.oxford-webchat .agendamento-item.agendamento-futuro {
    border-left-color: #00a884;
}

.oxford-webchat .agendamento-item.agendamento-hoje {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.oxford-webchat .agendamento-item.agendamento-passado {
    border-left-color: #8696a0;
    opacity: 0.7;
}

.oxford-webchat .agendamento-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 4px 8px;
    background: #f0f2f5;
    border-radius: 4px;
}

.oxford-webchat .agendamento-dia {
    font-size: 13px;
    font-weight: 600;
    color: #111b21;
}

.oxford-webchat .agendamento-hora {
    font-size: 11px;
    color: #667781;
}

.oxford-webchat .agendamento-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.oxford-webchat .agendamento-tipo {
    font-size: 13px;
    font-weight: 500;
    color: #111b21;
}

.oxford-webchat .agendamento-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.oxford-webchat .agendamento-status-aberto {
    background: #e0f2fe;
    color: #0369a1;
}

.oxford-webchat .agendamento-status-confirmado {
    background: #dcfce7;
    color: #15803d;
}

.oxford-webchat .agendamento-status-realizado {
    background: #d1fae5;
    color: #047857;
}

.oxford-webchat .agendamento-status-cancelado {
    background: #fee2e2;
    color: #dc2626;
}

.oxford-webchat .agendamento-status-reagendado {
    background: #fef3c7;
    color: #d97706;
}

.oxford-webchat .agendamento-status-nao_compareceu {
    background: #fecaca;
    color: #b91c1c;
}

/* AI Status Section in Info Panel */
.oxford-webchat .lead-ai-status {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9edef;
}

.oxford-webchat .ai-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.oxford-webchat .ai-status-badge.ai-active {
    background: #dcfce7;
    color: #15803d;
}

.oxford-webchat .ai-status-badge.ai-disabled {
    background: #fef3c7;
    color: #d97706;
}

.oxford-webchat .ai-reactivation-time {
    font-family: monospace;
    background: #f0f2f5;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 24h Window Status */
.oxford-webchat .window-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.oxford-webchat .window-badge.active {
    background: #dcfce7;
    color: #15803d;
}

.oxford-webchat .window-badge.expired {
    background: #fee2e2;
    color: #dc2626;
}

/* Toast Notification */
.oxford-webchat .webchat-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.oxford-webchat .webchat-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.oxford-webchat .lead-actions {
    padding-top: 20px;
    border-top: 1px solid #e9edef;
}

.oxford-webchat .btn-view-lead {
    display: block;
    text-align: center;
    padding: 12px 20px;
    background: #f0f2f5;
    color: #00a884;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s;
}

.oxford-webchat .btn-view-lead:hover {
    background: #e9edef;
    color: #008f72;
}

/* Modal Overlay */
.oxford-webchat .webchat-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* =====================================================
   RESPONSIVE - Mobile Styles
   ===================================================== */

/* Tablet - Info panel as modal */
@media (max-width: 1024px) {
    .oxford-webchat .webchat-info-panel {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        width: 85%;
        max-width: 380px;
    }

    .oxford-webchat .webchat-info-panel.active {
        display: flex;
    }

    .oxford-webchat .btn-close-info {
        display: block;
    }

    .oxford-webchat .webchat-modal-overlay.active {
        display: block;
    }
}

/* Mobile - Single column view controlled by data-mobile-view */
@media (max-width: 768px) {
    .oxford-webchat {
        height: 100vh !important;
        min-height: 500px;
        border-radius: 0;
    }

    /* Hide all panels by default on mobile */
    .oxford-webchat .webchat-sidebar,
    .oxford-webchat .webchat-main,
    .oxford-webchat .webchat-info-panel {
        display: none;
    }

    /* Show sidebar when mobile-view is list */
    .oxford-webchat[data-mobile-view="list"] .webchat-sidebar {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 100%;
        height: 100%;
    }

    .oxford-webchat[data-mobile-view="list"] .webchat-main,
    .oxford-webchat[data-mobile-view="list"] .webchat-info-panel {
        display: none;
    }

    /* Show chat when mobile-view is chat */
    .oxford-webchat[data-mobile-view="chat"] .webchat-main {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
    }

    .oxford-webchat[data-mobile-view="chat"] .webchat-sidebar,
    .oxford-webchat[data-mobile-view="chat"] .webchat-info-panel {
        display: none;
    }

    /* Show info when mobile-view is info */
    .oxford-webchat[data-mobile-view="info"] .webchat-info-panel {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 100%;
        height: 100%;
        position: relative;
        border-left: none;
    }

    .oxford-webchat[data-mobile-view="info"] .webchat-sidebar,
    .oxford-webchat[data-mobile-view="info"] .webchat-main {
        display: none;
    }

    .oxford-webchat[data-mobile-view="info"] .btn-close-info {
        display: none;
    }

    .oxford-webchat[data-mobile-view="info"] .info-panel-header .btn-back-mobile {
        display: block;
    }

    /* Back button always visible on mobile when not on list */
    .oxford-webchat .btn-back-mobile {
        display: none;
    }

    .oxford-webchat[data-mobile-view="chat"] .btn-back-mobile,
    .oxford-webchat[data-mobile-view="info"] .btn-back-mobile {
        display: block;
    }

    /* Mobile adjustments */
    .oxford-webchat .webchat-messages {
        padding: 12px;
        flex: 1;
        overflow-y: auto;
    }

    .oxford-webchat .webchat-message {
        max-width: 85%;
    }

    .oxford-webchat .webchat-no-selection {
        display: none;
    }

    .oxford-webchat .webchat-conversations-list {
        flex: 1;
        overflow-y: auto;
    }

    /* Info panel content scrollable */
    .oxford-webchat .info-panel-content {
        flex: 1;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .oxford-webchat .webchat-sidebar-header {
        padding: 12px;
    }

    /* Compact tabs on small screens */
    .oxford-webchat .webchat-tab {
        padding: 6px 10px;
        font-size: 12px;
    }

    .oxford-webchat .webchat-tab .tab-label {
        display: none;
    }

    .oxford-webchat .webchat-tab .tab-icon {
        font-size: 16px;
    }

    .oxford-webchat .webchat-tab .tab-count {
        font-size: 10px;
        padding: 1px 6px;
    }

    .oxford-webchat .btn-enable-notifications {
        padding: 6px;
    }

    .oxford-webchat .btn-enable-notifications .notification-icon {
        font-size: 16px;
    }

    .oxford-webchat .webchat-conversation-item {
        padding: 10px 12px;
    }

    .oxford-webchat .webchat-conversation-item .conversation-avatar {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .oxford-webchat .webchat-chat-header {
        padding: 8px 12px;
    }

    .oxford-webchat .webchat-input-area {
        padding: 8px 12px;
    }
}

/* ==========================================
   EDITABLE FIELDS IN INFO PANEL
   ========================================== */

.oxford-webchat .lead-editable-section {
    border: 1px solid #e9edef;
    border-radius: 8px;
    padding: 12px;
    background: #fafbfc;
}

.oxford-webchat .info-item-editable {
    position: relative;
}

.oxford-webchat .info-value-editable {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.oxford-webchat .info-value-editable .info-value-display {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.oxford-webchat .info-value-editable .info-value-input {
    display: none;
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #d1d7db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #111b21;
}

.oxford-webchat .info-value-editable select.info-value-input {
    cursor: pointer;
}

.oxford-webchat .info-value-editable textarea.info-value-input {
    resize: vertical;
    min-height: 60px;
    width: 100%;
    font-family: inherit;
}

.oxford-webchat .info-value-editable input[type="datetime-local"].info-value-input {
    width: auto;
    min-width: 180px;
}

.oxford-webchat .info-value-editable .info-value-input:focus {
    outline: none;
    border-color: #00a884;
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
}

.oxford-webchat .btn-edit-field {
    background: #f0f2f5;
    border: 1px solid #d1d7db;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0.7;
    transition: all 0.2s ease;
    font-size: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.oxford-webchat .btn-edit-field:hover {
    opacity: 1;
    background: #e9edef;
    border-color: #8696a0;
    transform: scale(1.05);
}

.oxford-webchat .info-item-editable:hover .btn-edit-field {
    opacity: 1;
    background: #e0f7fa;
    border-color: #00a884;
}

.oxford-webchat .info-item-editable.editing .info-value-display {
    display: none;
}

.oxford-webchat .info-item-editable.editing .info-value-input {
    display: block;
}

.oxford-webchat .info-item-editable.editing .btn-edit-field {
    display: none;
}

.oxford-webchat .field-saving {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.oxford-webchat .info-item-editable.saving {
    opacity: 0.7;
    pointer-events: none;
}

/* Full width items (observacao, objecoes) */
.oxford-webchat .info-item-editable.full-width {
    flex-direction: column;
}

.oxford-webchat .info-item-editable.full-width .info-value-editable {
    width: 100%;
}

.oxford-webchat .info-item-editable.full-width .info-value-display {
    width: 100%;
}

.oxford-webchat .info-item-editable.full-width .info-text {
    margin: 0;
    font-size: 13px;
    color: #667781;
    line-height: 1.5;
    min-height: 20px;
}

/* Add Appointment Button */
.oxford-webchat .btn-add-appointment {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #00a884 0%, #25d366 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.oxford-webchat .btn-add-appointment:hover {
    background: linear-gradient(135deg, #008f6f 0%, #20bd5a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
}

.oxford-webchat .btn-add-appointment:active {
    transform: translateY(0);
}

/* ==========================================
   APPOINTMENT MODAL
   ========================================== */

.oxford-webchat .webchat-appointment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.oxford-webchat .webchat-appointment-modal.active {
    display: flex;
}

.oxford-webchat .appointment-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.oxford-webchat .appointment-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.oxford-webchat .webchat-appointment-modal.active .appointment-modal-content {
    transform: scale(1);
}

.oxford-webchat .appointment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9edef;
    background: #f8f9fa;
}

.oxford-webchat .appointment-modal-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111b21;
}

.oxford-webchat .appointment-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #667781;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.oxford-webchat .appointment-modal-close:hover {
    background: #e9edef;
    color: #111b21;
}

.oxford-webchat .appointment-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.oxford-webchat .appointment-modal-messages {
    margin-bottom: 16px;
}

.oxford-webchat .appointment-form-success {
    padding: 12px 16px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.oxford-webchat .appointment-form-error {
    padding: 12px 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.oxford-webchat .appointment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.oxford-webchat .appointment-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.oxford-webchat .appointment-form-group-full {
    grid-column: 1 / -1;
}

.oxford-webchat .appointment-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #111b21;
}

.oxford-webchat .appointment-input {
    padding: 10px 12px;
    border: 1px solid #d1d7db;
    border-radius: 8px;
    font-size: 14px;
    color: #111b21;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.oxford-webchat .appointment-input:focus {
    outline: none;
    border-color: #00a884;
    box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.1);
}

.oxford-webchat .appointment-input:disabled {
    background: #f5f6f7;
    color: #8696a0;
    cursor: not-allowed;
}

.oxford-webchat .appointment-input option {
    padding: 8px;
}

.oxford-webchat textarea.appointment-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.oxford-webchat .appointment-hint {
    font-size: 11px;
    color: #8696a0;
    margin-top: 2px;
}

.oxford-webchat .appointment-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e9edef;
    background: #f8f9fa;
}

.oxford-webchat .appointment-modal-footer .btn-cancel {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #d1d7db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #667781;
    cursor: pointer;
    transition: all 0.2s;
}

.oxford-webchat .appointment-modal-footer .btn-cancel:hover {
    background: #f5f6f7;
    border-color: #8696a0;
}

.oxford-webchat .btn-save-appointment {
    padding: 10px 24px;
    background: linear-gradient(135deg, #00a884 0%, #25d366 100%);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
}

.oxford-webchat .btn-save-appointment:hover:not(:disabled) {
    background: linear-gradient(135deg, #008f6f 0%, #20bd5a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
}

.oxford-webchat .btn-save-appointment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive for appointment modal */
@media (max-width: 600px) {
    .oxford-webchat .appointment-form-grid {
        grid-template-columns: 1fr;
    }

    .oxford-webchat .appointment-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .oxford-webchat .appointment-modal-footer {
        flex-direction: column-reverse;
    }

    .oxford-webchat .appointment-modal-footer .btn-cancel,
    .oxford-webchat .btn-save-appointment {
        width: 100%;
    }
}

/* Audio message styling */
.chat-message .audio-message,
.webchat-message .audio-message {
    padding: 2px 0;
}
.chat-message .audio-message audio,
.webchat-message .audio-message audio {
    display: block;
    width: 100%;
    min-width: 200px;
    max-width: 300px;
    height: 40px;
    border-radius: 20px;
}

/* Audio bubble should be wider to fit the player */
.oxford-webchat .webchat-message .message-bubble:has(.audio-message) {
    padding: 6px 8px;
    min-width: 220px;
}
.oxford-lizzy-chat-shortcode .message-bubble:has(.audio-message) {
    padding: 6px 8px;
    min-width: 220px;
}

.chat-message .audio-caption,
.webchat-message .audio-caption {
    margin: 4px 0 0;
    font-size: 12px;
    color: #666;
}

/* Media caption (shared for all media types) */
.chat-message .media-caption,
.webchat-message .media-caption {
    margin: 4px 0 0;
    font-size: 12px;
    color: #666;
}

/* Image messages */
.chat-message .image-message,
.webchat-message .image-message {
    padding: 2px 0;
}
.chat-message .message-image,
.webchat-message .message-image {
    max-width: 220px;
    max-height: 260px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}
.chat-message .message-image:hover,
.webchat-message .message-image:hover {
    opacity: 0.9;
}

/* Document messages */
.chat-message .document-message,
.webchat-message .document-message {
    padding: 4px 0;
}
.chat-message .document-link,
.webchat-message .document-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0073aa;
    text-decoration: none;
    padding: 6px 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    font-size: 12px;
    word-break: break-all;
}
.chat-message .document-link:hover,
.webchat-message .document-link:hover {
    background: rgba(0,0,0,0.1);
    text-decoration: none;
}

/* Video messages */
.chat-message .video-message,
.webchat-message .video-message {
    padding: 2px 0;
}
.chat-message .message-video,
.webchat-message .message-video {
    max-width: 260px;
    border-radius: 8px;
    display: block;
}

/* Wider bubbles for media messages */
.oxford-webchat .webchat-message:has(.image-message),
.oxford-webchat .webchat-message:has(.video-message),
.oxford-webchat .webchat-message:has(.document-message) {
    max-width: 75%;
}

/* Media placeholder (when media_url is missing) */
.chat-message .media-placeholder,
.webchat-message .media-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    min-width: 160px;
}
.media-placeholder-icon {
    font-size: 20px;
    line-height: 1;
}
.media-placeholder-text {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Attachment button */
.oxford-webchat .btn-attach-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: #666;
    flex-shrink: 0;
}
.oxford-webchat .btn-attach-media:hover {
    background: #f0f0f0;
    color: #333;
}

/* Media preview overlay for webchat */
.webchat-media-preview-overlay {
    padding: 12px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}
.webchat-media-preview-overlay .media-preview-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.webchat-media-preview-overlay #webchat-media-preview-content {
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.webchat-media-preview-overlay .media-caption-wrapper input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}
.webchat-media-preview-overlay .media-preview-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.webchat-media-preview-overlay #webchat-media-file-size {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: #888;
}

/* Webchat record audio button */
.oxford-webchat .btn-record-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: none;
    background: none;
    color: #54656f;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    transition: background-color 0.2s, color 0.2s;
}
.oxford-webchat .btn-record-audio:hover {
    background-color: #f0f2f5;
    color: #00a884;
}
.oxford-webchat .btn-record-audio:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.oxford-webchat .btn-record-audio.recording {
    color: #e53935;
    animation: webchat-pulse 1.2s infinite;
}

/* Webchat recording overlay */
.oxford-webchat .webchat-recording-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border-top: 1px solid #e9edef;
}
.oxford-webchat .webchat-recording-overlay .recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}
.oxford-webchat .webchat-recording-overlay .recording-dot {
    width: 10px;
    height: 10px;
    background: #e53935;
    border-radius: 50%;
    animation: webchat-pulse 1.2s infinite;
}
.oxford-webchat .webchat-recording-overlay .recording-timer {
    font-size: 14px;
    font-weight: 500;
    color: #e53935;
    font-variant-numeric: tabular-nums;
}
.oxford-webchat .webchat-recording-overlay .recording-actions {
    display: flex;
    gap: 8px;
}
.oxford-webchat .btn-cancel-recording {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #667781;
    border-radius: 18px;
    cursor: pointer;
    font-size: 13px;
}
.oxford-webchat .btn-cancel-recording:hover {
    background: #f5f5f5;
}
.oxford-webchat .btn-send-recording {
    padding: 6px 14px;
    border: none;
    background: #00a884;
    color: #fff;
    border-radius: 18px;
    cursor: pointer;
    font-size: 13px;
}
.oxford-webchat .btn-send-recording:hover {
    background: #008f72;
}

@keyframes webchat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}