
        /* ============================================================
           NUA CHAT – AGENT VIEW
           Scope: .nua-chat-agent
           ============================================================ */
        .nua-chat-agent {
            --nua-primary: #0B6EDA;
            --nua-primary-light: #3FB5FD;
            --nua-primary-dark: #020842;
            --nua-primary-bg: #F0F7FF;
            --nua-bg: #F3F8FF;
            --nua-white: #ffffff;
            --nua-gray-50: #f8f9fa;
            --nua-gray-100: #f0f2f5;
            --nua-gray-150: #eaecef;
            --nua-gray-200: #e4e7ec;
            --nua-gray-300: #cdd0d8;
            --nua-gray-400: #9aa2b1;
            --nua-gray-500: #6b7280;
            --nua-gray-600: #4b5563;
            --nua-gray-700: #374151;
            --nua-gray-800: #1f2937;
            --nua-gray-900: #111827;
            --nua-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
            --nua-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.07);
            --nua-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.10);
            --nua-radius: 12px;
            --nua-radius-sm: 8px;
            --nua-radius-full: 9999px;
            --nua-transition: 0.2s ease;
            --nua-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --nua-online: #2ECC71;
            --nua-offline: #9aa2b1;
            --nua-away: #F39C12;
            --nua-unread: #0B6EDA;
            --nua-msg-agent: #ffffff;
            --nua-msg-agent-bg: #ffffff;
            --nua-msg-customer: #0B6EDA;
            --nua-msg-customer-bg: #0B6EDA;
            --nua-msg-customer-text: #ffffff;
            --nua-msg-border: #e4e7ec;
            --nua-input-bg: #ffffff;
            --nua-input-border: #cdd0d8;
            --nua-input-focus: #0B6EDA;
            --nua-sidebar-width: 340px;
            --nua-sidebar-collapsed: 0px;
            --nua-header-height: 68px;
        }

        /* ---- Reset / Base (scoped) ---- */
        .nua-chat-agent *,
        .nua-chat-agent *::before,
        .nua-chat-agent *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        .nua-chat-agent {
            font-family: var(--nua-font);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
            color: var(--nua-gray-800);
        }

        /* ---- Dashboard Container ---- */
        .nua-chat-agent .nua-dashboard {
            width: 100%;
            max-width: 1360px;
            height: 820px;
            max-height: 92vh;
            background: var(--nua-white);
            border-radius: var(--nua-radius);
            box-shadow: var(--nua-shadow-lg);
            display: flex;
            overflow: hidden;
            border: 1px solid var(--nua-gray-200);
            position: relative;
        }

        /* ============================================================
           SIDEBAR (Customer List)
           ============================================================ */
        .nua-chat-agent .nua-sidebar {
            width: var(--nua-sidebar-width);
            min-width: var(--nua-sidebar-width);
            background: var(--nua-white);
            border-right: 1px solid var(--nua-gray-200);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            flex-shrink: 0;
            transition: width 0.25s ease, min-width 0.25s ease;
            position: relative;
            z-index: 2;
        }

        /* Sidebar Header */
        .nua-chat-agent .nua-sidebar-header {
            padding: 16px 18px 14px;
            border-bottom: 1px solid var(--nua-gray-200);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: var(--nua-white);
            min-height: var(--nua-header-height);
        }
        .nua-chat-agent .nua-sidebar-header .nua-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 700;
            font-size: 1.05rem;
            color: var(--nua-primary-dark);
            letter-spacing: -0.3px;
        }
        .nua-chat-agent .nua-sidebar-header .nua-brand i {
            color: var(--nua-primary);
            font-size: 1.2rem;
        }
        .nua-chat-agent .nua-sidebar-header .nua-brand span {
            font-weight: 400;
            color: var(--nua-gray-500);
            font-size: 0.75rem;
            background: var(--nua-gray-100);
            padding: 2px 10px;
            border-radius: var(--nua-radius-full);
            margin-left: 4px;
        }
        .nua-chat-agent .nua-sidebar-header .nua-sidebar-toggle {
            background: none;
            border: none;
            color: var(--nua-gray-500);
            font-size: 1rem;
            cursor: pointer;
            padding: 6px 8px;
            border-radius: var(--nua-radius-sm);
            transition: all var(--nua-transition);
            display: none;
        }
        .nua-chat-agent .nua-sidebar-header .nua-sidebar-toggle:hover {
            background: var(--nua-gray-100);
            color: var(--nua-gray-700);
        }

        /* Search */
        .nua-chat-agent .nua-sidebar-search {
            padding: 12px 18px 14px;
            flex-shrink: 0;
            position: relative;
        }
        .nua-chat-agent .nua-sidebar-search input {
            width: 100%;
            padding: 9px 14px 9px 38px;
            border: 1px solid var(--nua-gray-200);
            border-radius: var(--nua-radius-sm);
            font-family: var(--nua-font);
            font-size: 0.85rem;
            color: var(--nua-gray-800);
            background: var(--nua-gray-50);
            transition: all var(--nua-transition);
            outline: none;
        }
        .nua-chat-agent .nua-sidebar-search input:focus {
            border-color: var(--nua-primary);
            box-shadow: 0 0 0 3px rgba(11, 110, 218, 0.1);
            background: var(--nua-white);
        }
        .nua-chat-agent .nua-sidebar-search input::placeholder {
            color: var(--nua-gray-400);
        }
        .nua-chat-agent .nua-sidebar-search i {
            position: absolute;
            left: 30px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--nua-gray-400);
            font-size: 0.85rem;
            pointer-events: none;
        }

        /* Customer List */
        .nua-chat-agent .nua-customer-list {
            flex: 1;
            overflow-y: auto;
            padding: 4px 0 8px;
        }
        .nua-chat-agent .nua-customer-list::-webkit-scrollbar {
            width: 3px;
        }
        .nua-chat-agent .nua-customer-list::-webkit-scrollbar-track {
            background: transparent;
        }
        .nua-chat-agent .nua-customer-list::-webkit-scrollbar-thumb {
            background: var(--nua-gray-300);
            border-radius: 10px;
        }

        /* Customer Item */
        .nua-chat-agent .nua-customer-item {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            padding: 12px 18px;
            cursor: pointer;
            transition: all var(--nua-transition);
            position: relative;
            border: 0;
            border-left: 3px solid transparent;
            border-radius: 0;
            margin: 0;
            background: transparent;
            color: inherit;
            font: inherit;
            text-align: left;
            appearance: none;
            -webkit-appearance: none;
            box-shadow: none;
        }
        .nua-chat-agent .nua-customer-item:hover {
            background: var(--nua-gray-50);
        }
        .nua-chat-agent .nua-customer-item.nua-active {
            background: var(--nua-primary-bg);
            border-left-color: var(--nua-primary);
        }
        .nua-chat-agent .nua-customer-item.nua-active .nua-customer-name {
            color: var(--nua-primary-dark);
        }

        /* Customer Avatar */
        .nua-chat-agent .nua-customer-item .nua-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.9rem;
            color: #fff;
            position: relative;
            background: var(--nua-primary-light);
        }
        .nua-chat-agent .nua-customer-item .nua-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        .nua-chat-agent .nua-customer-item .nua-avatar .nua-status-dot {
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid var(--nua-white);
            background: var(--nua-offline);
        }
        .nua-chat-agent .nua-customer-item .nua-avatar .nua-status-dot.online {
            background: var(--nua-online);
        }
        .nua-chat-agent .nua-customer-item .nua-avatar .nua-status-dot.away {
            background: var(--nua-away);
        }

        /* Customer Info */
        .nua-chat-agent .nua-customer-item .nua-customer-info {
            flex: 1;
            min-width: 0;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-name {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--nua-gray-800);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-name .nua-service-tag {
            font-size: 0.6rem;
            font-weight: 500;
            padding: 1px 8px;
            border-radius: var(--nua-radius-full);
            background: var(--nua-gray-100);
            color: var(--nua-gray-500);
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-message {
            font-size: 0.8rem;
            color: var(--nua-gray-500);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 160px;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-message .nua-unread-dot {
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--nua-unread);
            margin-right: 4px;
            vertical-align: middle;
            flex-shrink: 0;
        }

        /* Customer Meta (right side) */
        .nua-chat-agent .nua-customer-item .nua-customer-meta {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
            flex-shrink: 0;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-meta .nua-time {
            font-size: 0.65rem;
            color: var(--nua-gray-400);
            font-weight: 500;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-meta .nua-unread-count {
            font-size: 0.65rem;
            font-weight: 600;
            background: var(--nua-unread);
            color: #fff;
            min-width: 20px;
            height: 20px;
            border-radius: var(--nua-radius-full);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 6px;
        }
        .nua-chat-agent .nua-customer-item .nua-customer-meta .nua-unread-count.nua-zero {
            background: transparent;
            color: transparent;
            min-width: 0;
            padding: 0;
        }

        /* ============================================================
           MAIN CHAT AREA
           ============================================================ */
        .nua-chat-agent .nua-chat-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--nua-bg);
            min-width: 0;
            position: relative;
        }

        /* Empty state (when no customer selected) */
        .nua-chat-agent .nua-chat-main .nua-empty-state {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--nua-gray-400);
            gap: 12px;
            padding: 40px;
        }
        .nua-chat-agent .nua-chat-main .nua-empty-state i {
            font-size: 3.5rem;
            opacity: 0.3;
        }
        .nua-chat-agent .nua-chat-main .nua-empty-state h3 {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--nua-gray-600);
        }
        .nua-chat-agent .nua-chat-main .nua-empty-state p {
            font-size: 0.9rem;
            color: var(--nua-gray-400);
        }

        /* ============================================================
           CHAT HEADER
           ============================================================ */
        .nua-chat-agent .nua-chat-header {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 22px;
            background: var(--nua-white);
            border-bottom: 1px solid var(--nua-gray-200);
            flex-shrink: 0;
            min-height: var(--nua-header-height);
        }
        .nua-chat-agent .nua-chat-header .nua-mobile-back {
            display: none;
            background: none;
            border: none;
            color: var(--nua-gray-500);
            font-size: 1.1rem;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: var(--nua-radius-sm);
            transition: background var(--nua-transition);
        }
        .nua-chat-agent .nua-chat-header .nua-mobile-back:hover {
            background: var(--nua-gray-100);
        }

        .nua-chat-agent .nua-chat-header .nua-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.85rem;
            color: #fff;
            position: relative;
            background: var(--nua-primary-light);
        }
        .nua-chat-agent .nua-chat-header .nua-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        .nua-chat-agent .nua-chat-header .nua-avatar .nua-status-dot {
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid var(--nua-white);
            background: var(--nua-offline);
        }
        .nua-chat-agent .nua-chat-header .nua-avatar .nua-status-dot.online {
            background: var(--nua-online);
        }
        .nua-chat-agent .nua-chat-header .nua-avatar .nua-status-dot.away {
            background: var(--nua-away);
        }

        .nua-chat-agent .nua-chat-header .nua-customer-details {
            flex: 1;
            min-width: 0;
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-name {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--nua-gray-800);
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-name .nua-service-badge {
            font-size: 0.6rem;
            font-weight: 500;
            padding: 2px 10px;
            border-radius: var(--nua-radius-full);
            background: var(--nua-primary-bg);
            color: var(--nua-primary);
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta {
            font-size: 0.75rem;
            color: var(--nua-gray-500);
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta .nua-status-text {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta .nua-status-text.online {
            color: var(--nua-online);
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta .nua-status-text.offline {
            color: var(--nua-offline);
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta .nua-divider {
            color: var(--nua-gray-300);
        }
        .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta .nua-order-ref {
            background: var(--nua-gray-50);
            padding: 1px 10px;
            border-radius: var(--nua-radius-full);
            font-size: 0.7rem;
            color: var(--nua-gray-600);
            border: 1px solid var(--nua-gray-200);
        }

        .nua-chat-agent .nua-chat-header .nua-header-actions {
            display: flex;
            gap: 2px;
            flex-shrink: 0;
        }
        .nua-chat-agent .nua-chat-header .nua-header-actions button {
            background: none;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--nua-gray-500);
            font-size: 1rem;
            cursor: pointer;
            transition: all var(--nua-transition);
        }
        .nua-chat-agent .nua-chat-header .nua-header-actions button:hover {
            background: var(--nua-gray-100);
            color: var(--nua-gray-700);
        }

        /* ============================================================
           MESSAGES AREA
           ============================================================ */
        .nua-chat-agent .nua-chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 18px 22px 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            scroll-behavior: smooth;
        }
        .nua-chat-agent .nua-chat-messages::-webkit-scrollbar {
            width: 4px;
        }
        .nua-chat-agent .nua-chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        .nua-chat-agent .nua-chat-messages::-webkit-scrollbar-thumb {
            background: var(--nua-gray-300);
            border-radius: 10px;
        }

        /* Date Divider */
        .nua-chat-agent .nua-chat-messages .nua-date-divider {
            text-align: center;
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--nua-gray-500);
            padding: 6px 0 14px;
            letter-spacing: 0.3px;
            text-transform: uppercase;
            position: relative;
        }
        .nua-chat-agent .nua-chat-messages .nua-date-divider::after {
            content: '';
            position: absolute;
            left: 20%;
            right: 20%;
            top: 50%;
            height: 1px;
            background: var(--nua-gray-200);
            z-index: 0;
        }
        .nua-chat-agent .nua-chat-messages .nua-date-divider span {
            background: var(--nua-bg);
            padding: 0 16px;
            position: relative;
            z-index: 1;
        }

        /* Message Row */
        .nua-chat-agent .nua-chat-messages .nua-msg-row {
            display: flex;
            flex-direction: column;
            max-width: 82%;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-customer {
            align-self: flex-start;
            align-items: flex-start;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-agent {
            align-self: flex-end;
            align-items: flex-end;
        }

        /* Message Bubble */
        .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-bubble {
            padding: 10px 16px;
            border-radius: var(--nua-radius-sm);
            font-size: 0.9rem;
            line-height: 1.55;
            word-wrap: break-word;
            max-width: 100%;
            box-shadow: var(--nua-shadow-sm);
            position: relative;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-customer .nua-msg-bubble {
            background: var(--nua-msg-customer-bg);
            color: var(--nua-msg-customer-text);
            border-bottom-left-radius: 4px;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-agent .nua-msg-bubble {
            background: var(--nua-msg-agent-bg);
            color: var(--nua-gray-800);
            border: 1px solid var(--nua-msg-border);
            border-bottom-right-radius: 4px;
        }

        /* Attachment Preview in message */
        .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-bubble .nua-attachment,
        .nua-chat-customer .nua-chat-messages .nua-msg-row .nua-msg-bubble .nua-attachment {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: rgba(0, 0, 0, 0.04);
            border-radius: var(--nua-radius-sm);
            margin-top: 8px;
            font-size: 0.8rem;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-customer .nua-msg-bubble .nua-attachment,
        .nua-chat-customer .nua-chat-messages .nua-msg-row.nua-msg-customer .nua-msg-bubble .nua-attachment {
            background: rgba(255, 255, 255, 0.15);
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-bubble .nua-attachment i,
        .nua-chat-customer .nua-chat-messages .nua-msg-row .nua-msg-bubble .nua-attachment i {
            font-size: 1.1rem;
            opacity: 0.7;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-bubble .nua-attachment span,
        .nua-chat-customer .nua-chat-messages .nua-msg-row .nua-msg-bubble .nua-attachment span {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* Message Meta */
        .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.65rem;
            color: var(--nua-gray-500);
            margin-top: 4px;
            padding: 0 4px;
            font-weight: 500;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-customer .nua-msg-meta {
            flex-direction: row;
        }
        .nua-chat-agent .nua-chat-messages .nua-msg-row.nua-msg-agent .nua-msg-meta {
            flex-direction: row-reverse;
        }

        /* ============================================================
           COMPOSER
           ============================================================ */
        .nua-chat-agent .nua-chat-composer {
            pointer-events: auto;
            z-index: 5;
            display: flex;
            align-items: flex-end;
            gap: 10px;
            padding: 12px 18px 16px;
            background: var(--nua-white);
            border-top: 1px solid var(--nua-gray-200);
            flex-shrink: 0;
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-actions {
            display: flex;
            gap: 2px;
            align-items: center;
            flex-shrink: 0;
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-actions button {
            background: none;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--nua-gray-500);
            font-size: 1.1rem;
            cursor: pointer;
            transition: all var(--nua-transition);
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-actions button:hover {
            background: var(--nua-gray-100);
            color: var(--nua-gray-700);
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-input {
            flex: 1;
            min-width: 0;
            position: relative;
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-input textarea {
            pointer-events: auto;
            width: 100%;
            padding: 9px 14px;
            border: 1px solid var(--nua-input-border);
            border-radius: var(--nua-radius-sm);
            font-family: var(--nua-font);
            font-size: 0.9rem;
            line-height: 1.5;
            color: var(--nua-gray-800);
            background: var(--nua-input-bg);
            resize: none;
            outline: none;
            transition: border-color var(--nua-transition), box-shadow var(--nua-transition);
            min-height: 40px;
            max-height: 110px;
            overflow-y: auto;
            scrollbar-width: thin;
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-input textarea:focus {
            border-color: var(--nua-input-focus);
            box-shadow: 0 0 0 3px rgba(11, 110, 218, 0.1);
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-input textarea::placeholder {
            color: var(--nua-gray-400);
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-input textarea::-webkit-scrollbar {
            width: 3px;
        }
        .nua-chat-agent .nua-chat-composer .nua-composer-input textarea::-webkit-scrollbar-thumb {
            background: var(--nua-gray-300);
            border-radius: 10px;
        }

        .nua-chat-agent .nua-chat-composer .nua-send-btn {
            flex-shrink: 0;
            width: 42px;
            height: 42px;
            border: none;
            border-radius: 50%;
            background: var(--nua-primary);
            color: #fff;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all var(--nua-transition);
            box-shadow: 0 2px 8px rgba(11, 110, 218, 0.2);
        }
        .nua-chat-agent .nua-chat-composer .nua-send-btn:hover {
            background: var(--nua-primary-light);
            transform: scale(1.04);
            box-shadow: 0 4px 16px rgba(11, 110, 218, 0.3);
        }
        .nua-chat-agent .nua-chat-composer .nua-send-btn:active {
            transform: scale(0.92);
        }
        .nua-chat-agent .nua-chat-composer .nua-send-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* ============================================================
           ANIMATIONS
           ============================================================ */
        @keyframes nuaFadeIn {
            from { opacity: 0; transform: translateY(6px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

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

        /* Tablet */
        @media (max-width: 1024px) {
            .nua-chat-agent .nua-dashboard {
                max-height: 95vh;
                border-radius: var(--nua-radius);
            }
            .nua-chat-agent .nua-sidebar {
                width: 300px;
                min-width: 300px;
            }
            .nua-chat-agent .nua-chat-messages .nua-msg-row {
                max-width: 88%;
            }
        }

        /* Mobile */
        @media (max-width: 768px) {
            .nua-chat-agent {
                padding: 0;
                align-items: stretch;
                min-height: 100vh;
                background: var(--nua-white);
            }
            .nua-chat-agent .nua-dashboard {
                max-width: 100%;
                height: 100vh;
                max-height: 100vh;
                border-radius: 0;
                box-shadow: none;
                border: none;
            }
            .nua-chat-agent .nua-sidebar {
                width: 100%;
                min-width: 100%;
                border-right: none;
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                z-index: 10;
                background: var(--nua-white);
                transition: transform 0.3s ease;
                transform: translateX(0);
            }
            .nua-chat-agent .nua-sidebar.nua-collapsed {
                transform: translateX(-100%);
            }
            .nua-chat-agent .nua-sidebar-header .nua-sidebar-toggle {
                display: flex;
            }
            .nua-chat-agent .nua-chat-header .nua-mobile-back {
                display: flex;
            }
            .nua-chat-agent .nua-chat-messages {
                padding: 14px 14px 12px;
                gap: 6px;
            }
            .nua-chat-agent .nua-chat-messages .nua-msg-row {
                max-width: 92%;
            }
            .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-bubble {
                font-size: 0.85rem;
                padding: 9px 13px;
            }
            .nua-chat-agent .nua-chat-header {
                padding: 12px 14px;
                gap: 10px;
            }
            .nua-chat-agent .nua-chat-header .nua-avatar {
                width: 36px;
                height: 36px;
                font-size: 0.75rem;
            }
            .nua-chat-agent .nua-chat-header .nua-customer-details .nua-name {
                font-size: 0.88rem;
            }
            .nua-chat-agent .nua-chat-header .nua-customer-details .nua-meta {
                font-size: 0.7rem;
                gap: 6px;
            }
            .nua-chat-agent .nua-chat-header .nua-header-actions button {
                width: 32px;
                height: 32px;
                font-size: 0.9rem;
            }
            .nua-chat-agent .nua-chat-composer {
                padding: 10px 12px 14px;
                gap: 8px;
            }
            .nua-chat-agent .nua-chat-composer .nua-composer-input textarea {
                font-size: 0.85rem;
                min-height: 36px;
                padding: 8px 12px;
            }
            .nua-chat-agent .nua-chat-composer .nua-send-btn {
                width: 38px;
                height: 38px;
                font-size: 1rem;
            }
            .nua-chat-agent .nua-chat-composer .nua-composer-actions button {
                width: 32px;
                height: 32px;
                font-size: 1rem;
            }
            .nua-chat-agent .nua-sidebar-search {
                padding: 10px 14px 12px;
            }
            .nua-chat-agent .nua-sidebar-search input {
                font-size: 0.82rem;
                padding: 8px 12px 8px 34px;
            }
            .nua-chat-agent .nua-sidebar-search i {
                left: 24px;
            }
            .nua-chat-agent .nua-customer-item {
                padding: 10px 14px;
                gap: 10px;
            }
            .nua-chat-agent .nua-customer-item .nua-avatar {
                width: 36px;
                height: 36px;
                font-size: 0.75rem;
            }
            .nua-chat-agent .nua-customer-item .nua-customer-name {
                font-size: 0.82rem;
            }
            .nua-chat-agent .nua-customer-item .nua-customer-message {
                font-size: 0.75rem;
                max-width: 120px;
            }
            .nua-chat-agent .nua-sidebar-header {
                padding: 12px 14px;
                min-height: 60px;
            }
            .nua-chat-agent .nua-sidebar-header .nua-brand {
                font-size: 0.95rem;
            }
        }

        @media (max-width: 480px) {
            .nua-chat-agent .nua-chat-messages .nua-msg-row {
                max-width: 96%;
            }
            .nua-chat-agent .nua-chat-messages .nua-msg-row .nua-msg-bubble {
                font-size: 0.82rem;
                padding: 8px 12px;
            }
            .nua-chat-agent .nua-chat-header .nua-customer-details .nua-name .nua-service-badge {
                font-size: 0.5rem;
                padding: 1px 8px;
            }
            .nua-chat-agent .nua-customer-item .nua-customer-message {
                max-width: 80px;
            }
        }

        /* ============================================================
           UTILITY (for demo / WordPress compatibility)
           ============================================================ */
        .nua-chat-agent .nua-hidden {
            display: none !important;
        }
        .nua-chat-agent .nua-auto-height {
            overflow: hidden;
        }
    


        /* ============================================================
           NUA CHAT – CUSTOMER VIEW
           Scope: .nua-chat-customer
           ============================================================ */
        .nua-chat-customer {
            --nua-primary: #0B6EDA;
            --nua-primary-light: #3FB5FD;
            --nua-primary-dark: #020842;
            --nua-bg: #F3F8FF;
            --nua-white: #ffffff;
            --nua-gray-100: #f0f2f5;
            --nua-gray-200: #e4e7ec;
            --nua-gray-300: #cdd0d8;
            --nua-gray-400: #9aa2b1;
            --nua-gray-500: #6b7280;
            --nua-gray-600: #4b5563;
            --nua-gray-700: #374151;
            --nua-gray-800: #1f2937;
            --nua-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
            --nua-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
            --nua-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
            --nua-radius: 16px;
            --nua-radius-sm: 10px;
            --nua-radius-full: 9999px;
            --nua-transition: 0.2s ease;
            --nua-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --nua-agent-avatar: #3FB5FD;
            --nua-agent-name: #020842;
            --nua-online: #2ECC71;
            --nua-offline: #9aa2b1;
            --nua-msg-agent: #ffffff;
            --nua-msg-agent-bg: #ffffff;
            --nua-msg-customer: #0B6EDA;
            --nua-msg-customer-bg: #0B6EDA;
            --nua-msg-customer-text: #ffffff;
            --nua-msg-border: #e4e7ec;
            --nua-input-bg: #ffffff;
            --nua-input-border: #cdd0d8;
            --nua-input-focus: #0B6EDA;
            --nua-send-bg: #0B6EDA;
            --nua-send-hover: #3FB5FD;
            --nua-send-text: #ffffff;
        }

        /* ---- Reset / Base (scoped) ---- */
        .nua-chat-customer *,
        .nua-chat-customer *::before,
        .nua-chat-customer *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        .nua-chat-customer {
            font-family: var(--nua-font);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
        }

        /* ---- Chat Container ---- */
        .nua-chat-container {
            width: 100%;
            max-width: none;
            height: 700px;
            max-height: 90vh;
            background: var(--nua-white);
            border-radius: var(--nua-radius);
            box-shadow: var(--nua-shadow-lg);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
            border: 1px solid rgba(0, 0, 0, 0.04);
        }

        /* ============================================================
           HEADER
           ============================================================ */
        .nua-chat-header {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 18px 22px;
            background: var(--nua-white);
            border-bottom: 1px solid var(--nua-gray-200);
            flex-shrink: 0;
            position: relative;
        }

        /* Back button (for mobile flow) */
        .nua-chat-header .nua-back-btn {
            display: none;
            background: none;
            border: none;
            font-size: 1.2rem;
            color: var(--nua-gray-600);
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 8px;
            transition: background var(--nua-transition);
        }
        .nua-chat-header .nua-back-btn:hover {
            background: var(--nua-gray-100);
        }

        /* Avatar */
        .nua-chat-header .nua-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: var(--nua-agent-avatar);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 600;
            font-size: 1.1rem;
            flex-shrink: 0;
            position: relative;
            box-shadow: 0 0 0 2px var(--nua-white), 0 0 0 3px var(--nua-gray-200);
        }
        .nua-chat-header .nua-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

        /* Status dot */
        .nua-chat-header .nua-avatar .nua-status-dot {
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid var(--nua-white);
            background: var(--nua-online);
        }
        .nua-chat-header .nua-avatar .nua-status-dot.nua-offline {
            background: var(--nua-offline);
        }

        /* Agent Info */
        .nua-chat-header .nua-agent-info {
            flex: 1;
            min-width: 0;
        }
        .nua-chat-header .nua-agent-info .nua-agent-name {
            font-weight: 600;
            font-size: 1rem;
            color: var(--nua-agent-name);
            letter-spacing: -0.01em;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .nua-chat-header .nua-agent-info .nua-agent-name .nua-badge {
            font-size: 0.6rem;
            font-weight: 600;
            padding: 2px 10px;
            border-radius: var(--nua-radius-full);
            background: var(--nua-primary-light);
            color: #fff;
            letter-spacing: 0.3px;
            text-transform: uppercase;
        }
        .nua-chat-header .nua-agent-info .nua-agent-status {
            font-size: 0.75rem;
            color: var(--nua-gray-500);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .nua-chat-header .nua-agent-info .nua-agent-status .nua-status-text {
            transition: color var(--nua-transition);
        }
        .nua-chat-header .nua-agent-info .nua-agent-status .nua-status-text.online {
            color: var(--nua-online);
        }
        .nua-chat-header .nua-agent-info .nua-agent-status .nua-status-text.offline {
            color: var(--nua-offline);
        }

        /* Header actions */
        .nua-chat-header .nua-header-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }
        .nua-chat-header .nua-header-actions button {
            background: none;
            border: none;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--nua-gray-500);
            font-size: 1.1rem;
            cursor: pointer;
            transition: all var(--nua-transition);
        }
        .nua-chat-header .nua-header-actions button:hover {
            background: var(--nua-gray-100);
            color: var(--nua-gray-700);
        }
        .nua-chat-header .nua-header-actions button:active {
            transform: scale(0.92);
        }

        /* ============================================================
           MESSAGES AREA
           ============================================================ */
        .nua-chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px 22px 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            background: var(--nua-bg);
            scroll-behavior: smooth;
        }

        /* Custom scrollbar */
        .nua-chat-messages::-webkit-scrollbar {
            width: 4px;
        }
        .nua-chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        .nua-chat-messages::-webkit-scrollbar-thumb {
            background: var(--nua-gray-300);
            border-radius: 10px;
        }
        .nua-chat-messages::-webkit-scrollbar-thumb:hover {
            background: var(--nua-gray-400);
        }

        /* ---- Date Divider ---- */
        .nua-chat-messages .nua-date-divider {
            text-align: center;
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--nua-gray-500);
            padding: 6px 0 14px;
            letter-spacing: 0.3px;
            text-transform: uppercase;
            position: relative;
        }
        .nua-chat-messages .nua-date-divider::after {
            content: '';
            position: absolute;
            left: 20%;
            right: 20%;
            top: 50%;
            height: 1px;
            background: var(--nua-gray-200);
            z-index: 0;
        }
        .nua-chat-messages .nua-date-divider span {
            background: var(--nua-bg);
            padding: 0 16px;
            position: relative;
            z-index: 1;
        }

        /* ---- Message Row ---- */
        .nua-chat-messages .nua-msg-row {
            display: flex;
            flex-direction: column;
            max-width: 88%;
            animation: nuaFadeIn 0.3s ease;
        }
        /* Agent Chat updates must remain visually stable; Customer Chat animation is unchanged. */
        .nua-chat-agent .nua-chat-messages .nua-msg-row {
            animation: none;
        }
        .nua-chat-messages .nua-msg-row.nua-msg-agent {
            align-self: flex-start;
            align-items: flex-start;
        }
        .nua-chat-messages .nua-msg-row.nua-msg-customer {
            align-self: flex-end;
            align-items: flex-end;
        }

        /* Message Bubble */
        .nua-chat-messages .nua-msg-row .nua-msg-bubble {
            padding: 12px 16px;
            border-radius: var(--nua-radius-sm);
            font-size: 0.92rem;
            line-height: 1.55;
            word-wrap: break-word;
            max-width: 100%;
            box-shadow: var(--nua-shadow-sm);
            transition: box-shadow var(--nua-transition);
            position: relative;
        }
        .nua-chat-messages .nua-msg-row.nua-msg-agent .nua-msg-bubble {
            background: var(--nua-msg-agent-bg);
            color: var(--nua-gray-800);
            border: 1px solid var(--nua-msg-border);
            border-bottom-left-radius: 4px;
        }
        .nua-chat-messages .nua-msg-row.nua-msg-customer .nua-msg-bubble {
            background: var(--nua-msg-customer-bg);
            color: var(--nua-msg-customer-text);
            border-bottom-right-radius: 4px;
        }

        /* Timestamp */
        .nua-chat-messages .nua-msg-row .nua-msg-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.65rem;
            color: var(--nua-gray-500);
            margin-top: 4px;
            padding: 0 4px;
            font-weight: 500;
            letter-spacing: 0.2px;
        }
        .nua-chat-messages .nua-msg-row.nua-msg-customer .nua-msg-meta {
            flex-direction: row-reverse;
        }
        .nua-chat-messages .nua-msg-row .nua-msg-meta .nua-msg-status {
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }
        .nua-chat-messages .nua-msg-row .nua-msg-meta .nua-msg-status i {
            font-size: 0.55rem;
            color: var(--nua-gray-400);
        }
        .nua-chat-messages .nua-msg-row .nua-msg-meta .nua-msg-status .nua-read {
            color: var(--nua-online);
        }

        /* Agent name label in message (for clarity) */
        .nua-chat-messages .nua-msg-row.nua-msg-agent .nua-msg-sender {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--nua-primary-dark);
            margin-bottom: 2px;
            padding-left: 2px;
        }

        /* ============================================================
           COMPOSER
           ============================================================ */
        .nua-chat-composer {
            display: flex;
            align-items: flex-end;
            gap: 10px;
            padding: 14px 18px 16px;
            background: var(--nua-white);
            border-top: 1px solid var(--nua-gray-200);
            flex-shrink: 0;
            position: relative;
        }

        .nua-chat-composer .nua-composer-actions {
            display: flex;
            gap: 2px;
            align-items: center;
            flex-shrink: 0;
        }
        .nua-chat-composer .nua-composer-actions button {
            background: none;
            border: none;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--nua-gray-500);
            font-size: 1.15rem;
            cursor: pointer;
            transition: all var(--nua-transition);
            flex-shrink: 0;
        }
        .nua-chat-composer .nua-composer-actions button:hover {
            background: var(--nua-gray-100);
            color: var(--nua-gray-700);
        }
        .nua-chat-composer .nua-composer-actions button:active {
            transform: scale(0.9);
        }

        .nua-chat-composer .nua-composer-input {
            flex: 1;
            min-width: 0;
            position: relative;
        }
        .nua-chat-composer .nua-composer-input textarea {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--nua-input-border);
            border-radius: var(--nua-radius-sm);
            font-family: var(--nua-font);
            font-size: 0.92rem;
            line-height: 1.5;
            color: var(--nua-gray-800);
            background: var(--nua-input-bg);
            resize: none;
            outline: none;
            transition: border-color var(--nua-transition), box-shadow var(--nua-transition);
            min-height: 44px;
            max-height: 120px;
            overflow-y: auto;
            scrollbar-width: thin;
        }
        .nua-chat-composer .nua-composer-input textarea:focus {
            border-color: var(--nua-input-focus);
            box-shadow: 0 0 0 3px rgba(11, 110, 218, 0.12);
        }
        .nua-chat-composer .nua-composer-input textarea::placeholder {
            color: var(--nua-gray-400);
            font-weight: 400;
        }
        /* Scrollbar for textarea */
        .nua-chat-composer .nua-composer-input textarea::-webkit-scrollbar {
            width: 3px;
        }
        .nua-chat-composer .nua-composer-input textarea::-webkit-scrollbar-thumb {
            background: var(--nua-gray-300);
            border-radius: 10px;
        }

        .nua-chat-composer .nua-send-btn {
            flex-shrink: 0;
            width: 44px;
            height: 44px;
            border: none;
            border-radius: 50%;
            background: var(--nua-send-bg);
            color: var(--nua-send-text);
            font-size: 1.15rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all var(--nua-transition);
            box-shadow: 0 2px 8px rgba(11, 110, 218, 0.25);
        }
        .nua-chat-composer .nua-send-btn:hover {
            background: var(--nua-send-hover);
            transform: scale(1.04);
            box-shadow: 0 4px 16px rgba(11, 110, 218, 0.35);
        }
        .nua-chat-composer .nua-send-btn:active {
            transform: scale(0.92);
        }
        .nua-chat-composer .nua-send-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* ============================================================
           ANIMATIONS
           ============================================================ */
        @keyframes nuaFadeIn {
            from {
                opacity: 0;
                transform: translateY(6px) scale(0.98);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* Typing indicator (simple) */
        .nua-chat-messages .nua-typing-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 16px;
            background: var(--nua-white);
            border-radius: var(--nua-radius-sm);
            border: 1px solid var(--nua-msg-border);
            align-self: flex-start;
            border-bottom-left-radius: 4px;
            box-shadow: var(--nua-shadow-sm);
        }
        .nua-chat-messages .nua-typing-indicator span {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--nua-gray-400);
            animation: nuaTyping 1.4s infinite both;
        }
        .nua-chat-messages .nua-typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }
        .nua-chat-messages .nua-typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }
        @keyframes nuaTyping {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
            30% { transform: translateY(-6px); opacity: 1; }
        }

        /* ============================================================
           RESPONSIVE
           ============================================================ */
        @media (max-width: 600px) {
            .nua-chat-customer {
                padding: 0;
                align-items: stretch;
                min-height: 100vh;
                background: var(--nua-white);
            }
            .nua-chat-container {
                max-width: 100%;
                height: 100vh;
                max-height: 100vh;
                border-radius: 0;
                box-shadow: none;
                border: none;
            }
            .nua-chat-header {
                padding: 14px 16px;
                gap: 10px;
            }
            .nua-chat-header .nua-back-btn {
                display: flex;
            }
            .nua-chat-header .nua-avatar {
                width: 38px;
                height: 38px;
                font-size: 0.9rem;
            }
            .nua-chat-header .nua-agent-info .nua-agent-name {
                font-size: 0.92rem;
            }
            .nua-chat-header .nua-agent-info .nua-agent-status {
                font-size: 0.7rem;
            }
            .nua-chat-header .nua-header-actions button {
                width: 34px;
                height: 34px;
                font-size: 0.95rem;
            }
            .nua-chat-messages {
                padding: 14px 14px 12px;
                gap: 8px;
            }
            .nua-chat-messages .nua-msg-row {
                max-width: 92%;
            }
            .nua-chat-messages .nua-msg-row .nua-msg-bubble {
                font-size: 0.88rem;
                padding: 10px 14px;
            }
            .nua-chat-composer {
                padding: 10px 12px 14px;
                gap: 8px;
            }
            .nua-chat-composer .nua-composer-input textarea {
                font-size: 0.88rem;
                min-height: 38px;
                padding: 8px 12px;
            }
            .nua-chat-composer .nua-send-btn {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }
            .nua-chat-composer .nua-composer-actions button {
                width: 34px;
                height: 34px;
                font-size: 1rem;
            }
        }

        @media (max-width: 400px) {
            .nua-chat-header .nua-agent-info .nua-agent-name .nua-badge {
                font-size: 0.5rem;
                padding: 1px 8px;
            }
            .nua-chat-messages .nua-msg-row {
                max-width: 96%;
            }
            .nua-chat-messages .nua-msg-row .nua-msg-bubble {
                font-size: 0.84rem;
                padding: 8px 12px;
            }
        }

        /* Tablet */
        @media (min-width: 601px) and (max-width: 1024px) {
            .nua-chat-container {
                height: 650px;
            }
            .nua-chat-header .nua-back-btn {
                display: none;
            }
        }

        /* Desktop (large) */
        @media (min-width: 1025px) {
            .nua-chat-container {
                height: 720px;
            }
            .nua-chat-header .nua-back-btn {
                display: none;
            }
            .nua-chat-messages .nua-msg-row {
                max-width: 82%;
            }
        }

        /* ============================================================
           UTILITY (for demo / WordPress compatibility)
           ============================================================ */
        .nua-chat-customer .nua-hidden {
            display: none !important;
        }

        /* Styling for attachment/emoji buttons (icon only) */
        .nua-chat-customer .nua-btn-icon {
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
            color: inherit;
            font-size: inherit;
        }

        /* Small helper to keep textarea height auto */
        .nua-chat-customer .nua-auto-height {
            overflow: hidden;
        }
    /* NUA v1.0.46: keep customer composer fully interactive */
.nua-chat-customer .nua-chat-composer,
.nua-chat-customer .nua-composer-actions,
.nua-chat-customer .nua-composer-actions button,
.nua-chat-customer .nua-composer-input,
.nua-chat-customer .nua-composer-input textarea,
.nua-chat-customer .nua-send-btn {
    pointer-events: auto !important;
}
.nua-chat-customer .nua-chat-composer { position: relative !important; z-index: 100 !important; }
.nua-chat-customer .nua-composer-input textarea { position: relative !important; z-index: 101 !important; opacity: 1 !important; cursor: text !important; }
.nua-chat-customer .nua-composer-actions button,
.nua-chat-customer .nua-send-btn { position: relative !important; z-index: 102 !important; cursor: pointer !important; }

/* v1.0.51: Agent composer uses the same professional customer-chat composer design. */
.nua-chat-agent-admin .nua-chat-composer {
    padding: 14px 18px 16px;
}
.nua-chat-agent-admin .nua-chat-composer .nua-composer-actions button {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
}
.nua-chat-agent-admin .nua-chat-composer .nua-composer-actions button:active {
    transform: scale(0.9);
}
.nua-chat-agent-admin .nua-chat-composer .nua-composer-input textarea {
    padding: 10px 14px;
    font-size: 0.92rem;
    min-height: 44px;
    max-height: 120px;
    pointer-events: auto;
}
.nua-chat-agent-admin .nua-chat-composer .nua-composer-input textarea:focus {
    box-shadow: 0 0 0 3px rgba(11, 110, 218, 0.12);
}
.nua-chat-agent-admin .nua-chat-composer .nua-send-btn {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    background: var(--nua-send-bg);
    color: var(--nua-send-text);
    box-shadow: 0 2px 8px rgba(11, 110, 218, 0.25);
}
.nua-chat-agent-admin .nua-chat-composer .nua-send-btn:hover {
    background: var(--nua-send-hover);
    box-shadow: 0 4px 16px rgba(11, 110, 218, 0.35);
}

/* NUA v1.0.66: Customer chat with 75% conversation / 25% order sidebar. */
.nua-chat-customer .nua-customer-chat-layout {
    width: 100%;
    max-width: none;
    display: flex;
    gap: 18px;
    align-items: stretch;
}
.nua-chat-customer .nua-customer-chat-layout > .nua-chat-container {
    width: calc(75% - 9px);
    flex: 0 0 calc(75% - 9px);
    min-width: 0;
}
.nua-chat-customer .nua-customer-chat-layout > .nua-chat-container .nua-chat-messages {
    width: 100%;
}
.nua-chat-customer .nua-customer-chat-layout > .nua-customer-orders-sidebar {
    width: calc(25% - 9px);
    flex: 0 0 calc(25% - 9px);
}
.nua-chat-customer .nua-customer-orders-sidebar {
    height: 720px;
    max-height: 90vh;
    background: var(--nua-white);
    border: 1px solid var(--nua-gray-200);
    border-radius: var(--nua-radius);
    box-shadow: var(--nua-shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nua-chat-customer .nua-customer-orders-sidebar-head {
    padding: 20px;
    border-bottom: 1px solid var(--nua-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}
.nua-chat-customer .nua-customer-orders-sidebar-head > div > span {
    display: block;
    color: var(--nua-primary);
    font-size: .68rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.nua-chat-customer .nua-customer-orders-sidebar-head h2 {
    margin: 0;
    color: var(--nua-primary-dark);
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 700;
}
.nua-chat-customer .nua-customer-orders-count {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: var(--nua-radius-full);
    background: #edf6ff;
    color: var(--nua-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}
.nua-chat-customer .nua-customer-orders-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--nua-gray-300) transparent;
}
.nua-chat-customer .nua-customer-orders-list::-webkit-scrollbar { width: 5px; }
.nua-chat-customer .nua-customer-orders-list::-webkit-scrollbar-track { background: transparent; }
.nua-chat-customer .nua-customer-orders-list::-webkit-scrollbar-thumb { background: var(--nua-gray-300); border-radius: 10px; }
.nua-chat-customer .nua-customer-order-card {
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--nua-gray-200);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--nua-shadow-sm);
}
.nua-chat-customer .nua-customer-order-card:last-child { margin-bottom: 0; }
.nua-chat-customer .nua-customer-order-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.nua-chat-customer .nua-customer-order-number {
    color: var(--nua-primary-dark);
    font-size: .82rem;
    line-height: 1.4;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.nua-chat-customer .nua-customer-order-category {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-top: 1px solid #eef2f7;
}
.nua-chat-customer .nua-customer-order-category > i {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #edf6ff;
    color: var(--nua-primary);
    font-size: .78rem;
}
.nua-chat-customer .nua-customer-order-category small,
.nua-chat-customer .nua-customer-order-category strong {
    display: block;
}
.nua-chat-customer .nua-customer-order-category small {
    color: var(--nua-gray-500);
    font-size: .66rem;
    margin-bottom: 2px;
}
.nua-chat-customer .nua-customer-order-category strong {
    color: var(--nua-gray-800);
    font-size: .78rem;
    line-height: 1.35;
    font-weight: 600;
}
.nua-chat-customer .nua-chat-order-countdown {
    margin: 0;
    padding: 11px 12px;
    border-radius: 10px;
    background: #f0f7ff;
    color: var(--nua-primary);
    display: block;
}
.nua-chat-customer .nua-chat-order-countdown span,
.nua-chat-customer .nua-chat-order-countdown strong {
    display: block;
}
.nua-chat-customer .nua-chat-order-countdown span {
    font-size: .66rem;
    font-weight: 600;
    margin-bottom: 3px;
}
.nua-chat-customer .nua-chat-order-countdown strong {
    font-size: .86rem;
    line-height: 1.35;
    font-weight: 700;
    white-space: nowrap;
}
.nua-chat-customer .nua-customer-orders-empty {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 25px 15px;
    color: var(--nua-gray-500);
}
.nua-chat-customer .nua-customer-orders-empty i { color: var(--nua-primary-light); font-size: 1.5rem; margin-bottom: 4px; }
.nua-chat-customer .nua-customer-orders-empty strong { color: var(--nua-gray-800); font-size: .9rem; }
.nua-chat-customer .nua-customer-orders-empty span { font-size: .75rem; }
@media (max-width: 900px) {
    .nua-chat-customer .nua-customer-chat-layout { flex-direction: column; }
    .nua-chat-customer .nua-customer-chat-layout > .nua-chat-container,
    .nua-chat-customer .nua-customer-chat-layout > .nua-customer-orders-sidebar { width: 100%; flex: 0 0 auto; }
    .nua-chat-customer .nua-customer-orders-sidebar { height: auto; max-height: 430px; order: 2; }
}
@media (max-width: 600px) {
    .nua-chat-customer .nua-customer-chat-layout { gap: 14px; }
    .nua-chat-customer .nua-customer-orders-sidebar { border-radius: 12px; max-height: 400px; }
}

/* Agent customer orders: right-side panel remains inside the existing dashboard. */
.nua-chat-agent .nua-agent-orders-sidebar{width:300px;min-width:300px;background:var(--nua-white);border-left:1px solid var(--nua-gray-200);display:flex;flex-direction:column;overflow:hidden;flex-shrink:0}
.nua-chat-agent .nua-agent-orders-sidebar-head{padding:18px;border-bottom:1px solid var(--nua-gray-200);display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}
.nua-chat-agent .nua-agent-orders-sidebar-head>div>span{display:block;color:var(--nua-primary);font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;margin-bottom:4px}
.nua-chat-agent .nua-agent-orders-sidebar-head h2{font-size:17px;line-height:1.25;margin:0;color:var(--nua-gray-900)}
.nua-chat-agent .nua-agent-orders-count{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 10px;border-radius:999px;background:#edf6ff;color:var(--nua-primary);font-weight:700}
.nua-chat-agent .nua-agent-orders-list{padding:14px;overflow-y:auto;scrollbar-width:thin;min-height:0;flex:1}
.nua-chat-agent .nua-agent-order-card{border:1px solid var(--nua-gray-200);border-radius:12px;padding:14px;margin-bottom:12px;background:var(--nua-white)}
.nua-chat-agent .nua-agent-order-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--nua-gray-100)}
.nua-chat-agent .nua-agent-order-number{font-size:12px;font-weight:700;color:var(--nua-gray-900)}
.nua-chat-agent .nua-agent-order-category{display:flex;align-items:center;gap:10px;padding:13px 0}
.nua-chat-agent .nua-agent-order-category>i{width:34px;height:34px;border-radius:9px;background:#edf6ff;color:var(--nua-primary);display:flex;align-items:center;justify-content:center}
.nua-chat-agent .nua-agent-order-category small,.nua-chat-agent .nua-agent-order-category strong{display:block}.nua-chat-agent .nua-agent-order-category small{font-size:11px;color:var(--nua-gray-500);margin-bottom:2px}.nua-chat-agent .nua-agent-order-category strong{font-size:13px;color:var(--nua-gray-900)}
.nua-chat-agent .nua-agent-order-countdown{display:block;margin:0;padding:11px 12px;border-radius:9px;background:#edf6ff;color:var(--nua-primary)}
.nua-chat-agent .nua-agent-order-countdown span,.nua-chat-agent .nua-agent-order-countdown strong{display:block}.nua-chat-agent .nua-agent-order-countdown span{font-size:11px;margin-bottom:3px}.nua-chat-agent .nua-agent-order-countdown strong{font-size:13px;color:var(--nua-gray-900)}
.nua-chat-agent .nua-agent-orders-empty{height:100%;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--nua-gray-400);gap:6px;padding:20px}.nua-chat-agent .nua-agent-orders-empty i{font-size:28px;opacity:.5}.nua-chat-agent .nua-agent-orders-empty strong{color:var(--nua-gray-600)}.nua-chat-agent .nua-agent-orders-empty span{font-size:12px}
@media(max-width:1180px){.nua-chat-agent .nua-agent-orders-sidebar{width:260px;min-width:260px}}
@media(max-width:900px){.nua-chat-agent .nua-agent-orders-sidebar{display:none}}

/* Emoji selector: customer and agent chat composers. */
.nua-chat-customer .nua-composer-actions,.nua-chat-agent .nua-composer-actions{position:relative}
.nua-emoji-picker{position:absolute;bottom:calc(100% + 10px);left:0;z-index:1000;width:220px;padding:8px;display:grid;grid-template-columns:repeat(5,1fr);gap:4px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 10px 30px rgba(15,23,42,.14)}
.nua-emoji-picker[hidden]{display:none!important}
.nua-emoji-picker .nua-emoji-option{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:7px;background:transparent;font-size:20px;line-height:1;cursor:pointer}
.nua-emoji-picker .nua-emoji-option:hover,.nua-emoji-picker .nua-emoji-option:focus{background:#f1f5f9;outline:none}

/* Agent admin fixes: retain the existing card and composer layout. */
.nua-chat-agent-admin {
    --nua-send-bg: var(--nua-primary);
    --nua-send-hover: var(--nua-primary-light);
    --nua-send-text: #ffffff;
}
.nua-chat-agent-admin .nua-agent-order-card .nua-agent-order-thumbnail {
    display: block;
    visibility: visible;
    opacity: 1;
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
    max-height: 34px;
    flex: 0 0 34px;
    object-fit: cover;
    border: 0;
    border-radius: 9px;
    margin: 0;
    padding: 0;
    float: none;
}
.nua-chat-agent-admin .nua-customer-item .nua-customer-meta .nua-unread-count { background: #25d366; color: #083d21; font-variant-numeric: tabular-nums; }
.nua-chat-agent-admin .nua-customer-item .nua-customer-meta .nua-unread-count[hidden] { display: none; }
.nua-chat-agent-admin .nua-chat-composer .nua-composer-actions > button > i.fas,
.nua-chat-agent-admin .nua-chat-composer .nua-send-btn > i.fas {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    color: inherit;
    flex-shrink: 0;
    text-indent: 0;
}

/* Agent order offers */
.nua-offer-modal{position:fixed;inset:0;z-index:100000;background:rgba(15,23,42,.52);display:flex;align-items:center;justify-content:center;padding:24px}.nua-offer-modal[hidden]{display:none}.nua-offer-dialog{width:min(680px,96vw);max-height:86vh;background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.25);overflow:hidden;display:flex;flex-direction:column}.nua-offer-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid #e5e7eb}.nua-offer-head h2{margin:0;font-size:20px}.nua-offer-head button{border:0;background:transparent;font-size:28px;cursor:pointer}.nua-offer-body{padding:22px;overflow:auto}.nua-offer-step h3{margin:0 0 16px}.nua-offer-search input,.nua-offer-form input,.nua-offer-form textarea,.nua-offer-form select{width:100%;box-sizing:border-box;border:1px solid #d7dee8;border-radius:9px;padding:10px 12px}.nua-offer-search{margin-bottom:12px}.nua-offer-service-result,.nua-offer-package-option{width:100%;display:flex;align-items:center;gap:12px;text-align:left;border:1px solid #e3e8ef;background:#fff;border-radius:10px;padding:11px;margin:8px 0;cursor:pointer}.nua-offer-service-result:hover,.nua-offer-package-option:hover{border-color:#3fb5fd;background:#f7fbff}.nua-offer-service-result img,.nua-offer-thumb{width:48px;height:48px;border-radius:8px;object-fit:cover;background:#eef6ff;display:flex;align-items:center;justify-content:center}.nua-offer-service-result span span,.nua-offer-service-result span{display:flex;flex-direction:column}.nua-offer-service-result small,.nua-offer-selected small{color:#64748b;margin-top:3px}.nua-offer-package-option{flex-direction:column;align-items:flex-start}.nua-offer-package-option span{color:#64748b}.nua-offer-back{border:0;background:transparent;color:#0b6eda;cursor:pointer;margin-bottom:12px}.nua-offer-selected{padding:12px;background:#f8fafc;border-radius:9px;display:flex;flex-direction:column;margin-bottom:12px}.nua-offer-form{display:grid;gap:12px}.nua-offer-form label{font-weight:600;font-size:13px;display:grid;gap:6px}.nua-offer-submit{width:100%;margin-top:18px;border:0;border-radius:9px;background:#0b6eda;color:#fff;font-weight:700;padding:12px 16px;cursor:pointer}.nua-offer-review{border:1px solid #e3e8ef;border-radius:12px;padding:16px}.nua-offer-card{min-width:min(360px,70vw)}.nua-offer-service{display:flex;gap:10px;align-items:center;padding-bottom:10px;border-bottom:1px solid rgba(148,163,184,.25)}.nua-offer-service img{width:44px;height:44px;border-radius:8px;object-fit:cover}.nua-offer-service div{display:flex;flex-direction:column}.nua-offer-service small,.nua-offer-facts small{font-size:11px;opacity:.7}.nua-offer-package{padding:10px 0}.nua-offer-package p{margin:5px 0 0}.nua-offer-facts{display:flex;gap:16px;flex-wrap:wrap}.nua-offer-facts span{display:flex;flex-direction:column}.nua-offer-status{display:inline-block;margin-top:12px;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700;background:#fff3cd;color:#8a6100}.nua-offer-status.nua-offer-accepted{background:#dcfce7;color:#166534}.nua-offer-status.nua-offer-declined{background:#fee2e2;color:#991b1b}.nua-offer-actions{display:flex;gap:8px;margin-top:12px}.nua-offer-actions button{border:0;border-radius:8px;padding:8px 13px;font-weight:700;cursor:pointer}.nua-offer-actions button[data-decision="accept"]{background:#16a34a;color:#fff}.nua-offer-actions button[data-decision="decline"]{background:#e5e7eb;color:#334155}

/* System sender labels match support typography without altering other messages. */
.nua-chat-messages .nua-msg-row .nua-msg-sender.nua-msg-system-sender{font-family:inherit;font-size:.7rem;font-weight:600;line-height:1.5;color:var(--nua-primary-dark,#0b6eda);margin-bottom:2px;padding-left:2px;text-transform:none;letter-spacing:normal}

/* The same in-progress badge in customer and agent order sidebars. */
.nua-chat-customer .nua-customer-order-card .nua-order-status.in_progress,.nua-chat-agent .nua-agent-orders-sidebar .nua-order-status.in_progress{display:inline-block;background:#eef2ff;color:#3858e9;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:400;line-height:1.5;letter-spacing:normal;text-transform:none;white-space:nowrap;height:max-content}
.nua-chat-agent #nuaAgentOrdersSidebar .nua-order-status.completed{display:inline-block;box-sizing:border-box;background:#ecfdf5;color:#166534;border:0;box-shadow:inset 0 0 0 1px #bbf7d0;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:400;line-height:1.5;letter-spacing:normal;text-transform:none;white-space:nowrap;height:max-content;vertical-align:middle}
.nua-chat-agent #nuaAgentOrdersSidebar .nua-order-status.cancelled{display:inline-block;box-sizing:border-box;background:#fef2f2;color:#991b1b;border:0;box-shadow:inset 0 0 0 1px #fecaca;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:400;line-height:1.5;letter-spacing:normal;text-transform:none;white-space:nowrap;height:max-content;vertical-align:middle}
