/* Base styling is provided by the corporate theme. Keep only app-specific utilities here. */

:root {
    --bs-font-sans-serif: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;

    /* SharePoint-like density: smaller base typography */
    --bs-body-font-size: 0.875rem;
    --bs-body-line-height: 1.45;

    /* Ensure theme token vars keep the expected numeric format.
       `bootstrap-reali.css` defines `--rp-primary` as hex, but `components.css`
       uses `rgb(var(--rp-primary))`, which breaks button rendering.
    */
    --rp-primary: 46 116 203;
    --rp-primary-2: 45 96 164;
    --rp-primary-100: 172 203 232;
}

html {
    font-size: 14px;
}

/* Theme fixes:
   The corporate theme resets `.btn { border: none; }`, which makes outline buttons
   (and especially disabled ones) hard to see. Re-apply borders and improve
   disabled contrast.
*/

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-light,
.btn-outline-dark {
    border-width: 1px;
    border-style: solid;
}

.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    opacity: 0.75;
    cursor: not-allowed;
}

.btn-outline-primary:disabled,
.btn-outline-primary.disabled,
fieldset:disabled .btn-outline-primary {
    opacity: 1;
    color: rgba(var(--bs-primary-rgb), 0.65);
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled,
fieldset:disabled .btn-outline-secondary {
    opacity: 1;
    color: rgba(var(--bs-secondary-rgb), 0.65);
    border-color: rgba(var(--bs-secondary-rgb), 0.35);
    background-color: rgba(var(--bs-secondary-rgb), 0.08);
}

/* Alerts: add stronger visual separation so success/error/info messages are obvious */
.alert {
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--bs-box-shadow-sm);
}

.alert-success { border-left: 0.35rem solid var(--bs-success); }
.alert-danger { border-left: 0.35rem solid var(--bs-danger); }
.alert-warning { border-left: 0.35rem solid var(--bs-warning); }
.alert-info { border-left: 0.35rem solid var(--bs-info); }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* =====================================================
   FIX: Dropdowns/Selects com texto visível
   ===================================================== */

/* Corrigir cor do texto nos selects e options */
.form-select,
select.form-control {
    color: #212529 !important;
    background-color: #fff !important;
}

.form-select option,
select.form-control option {
    color: #212529 !important;
    background-color: #fff !important;
}

/* Hover e focus nos options */
.form-select option:hover,
.form-select option:focus,
.form-select option:checked,
select.form-control option:hover,
select.form-control option:focus,
select.form-control option:checked {
    color: #212529 !important;
    background-color: #e9ecef !important;
}

/* Dropdown aberto - garantir visibilidade */
.form-select:focus,
select.form-control:focus {
    color: #212529 !important;
    background-color: #fff !important;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* =====================================================
   Componente Autocomplete/Typeahead
   ===================================================== */

.autocomplete-container {
    position: relative;
}

.autocomplete-input {
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-top: 2px;
}

.autocomplete-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: #212529;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #e9ecef;
    color: #212529;
}

.autocomplete-item-selected {
    background-color: #0d6efd;
    color: #fff;
}

.autocomplete-item-selected:hover {
    background-color: #0b5ed7;
    color: #fff;
}

.autocomplete-no-results {
    padding: 0.5rem 1rem;
    color: #6c757d;
    font-style: italic;
}

/* Quill Editor customizations */
#emailReplyEditor {
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}

#emailReplyEditor .ql-editor {
    min-height: 200px;
    font-size: 0.9rem;
}

.ql-toolbar.ql-snow {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
}

.ql-container.ql-snow {
    border: none;
}

.ql-editor img {
    max-width: 100%;
    height: auto;
}

.autocomplete-loading {
    padding: 0.5rem 1rem;
    color: #6c757d;
    text-align: center;
}

.autocomplete-clear {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
}

.autocomplete-clear:hover {
    color: #dc3545;
}

/* =====================================================
   Ticket Details - UX improvements
   ===================================================== */

.ticket-details-hero {
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(var(--rp-primary), 0.12);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(var(--rp-primary), 0.08), rgba(255, 255, 255, 0.98));
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.06);
}

.ticket-hero-main {
    min-width: 0;
    flex: 1 1 24rem;
}

.ticket-actions-toolbar {
    flex: 1 1 22rem;
    justify-content: flex-end;
}

.ticket-quick-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ticket-details-layout .rp-widget {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.05);
    background: #fff;
}

.ticket-details-layout .rp-widget-header {
    background: linear-gradient(180deg, rgba(var(--rp-primary), 0.05), rgba(255, 255, 255, 0.96));
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.ticket-panel-body {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.7), #fff);
}

.ticket-scroll-panel {
    overflow: auto;
    padding-right: 0.35rem;
    scrollbar-width: thin;
}

.ticket-description-scroll {
    max-height: 18rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.75;
    padding: 1.25rem 1.5rem;
    border-radius: 0.65rem;
    background: linear-gradient(145deg, #f8fafc, #ffffff);
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 0.925rem;
    letter-spacing: 0.01em;
    color: #334155;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--rp-primary), 0.4) transparent;
}

/* Paragrafos na descricao */
.ticket-description-scroll p {
    margin-bottom: 1rem;
    text-align: justify;
    text-justify: inter-word;
}

.ticket-description-scroll p:last-child {
    margin-bottom: 0;
}

/* Primeira letra destacada do primeiro paragrafo */
.ticket-description-content p:first-child::first-letter,
.ticket-description-content::first-letter {
    font-size: 1.5em;
    font-weight: 600;
    color: #0f172a;
    float: left;
    line-height: 1;
    margin-right: 0.15em;
    margin-top: 0.1em;
}

/* Widget da descricao */
.ticket-description-widget .rp-widget-body {
    padding: 0;
}

.ticket-description-scroll::-webkit-scrollbar {
    width: 6px;
}

.ticket-description-scroll::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.ticket-description-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--rp-primary), 0.35);
    border-radius: 3px;
}

.ticket-description-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--rp-primary), 0.55);
}

/* Secao de Interacoes/Acoes */
.ticket-interactions-scroll {
    max-height: 420px;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--rp-primary), 0.4) transparent;
}

.ticket-interactions-scroll::-webkit-scrollbar {
    width: 6px;
}

.ticket-interactions-scroll::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.ticket-interactions-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--rp-primary), 0.35);
    border-radius: 3px;
}

.ticket-interactions-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--rp-primary), 0.55);
}

.ticket-chat-scroll {
    max-height: 380px;
}

.ticket-timeline-scroll {
    max-height: 350px;
}

.ticket-message-bubble {
    box-shadow: 0 0.25rem 0.6rem rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease;
}

.ticket-message-bubble:hover {
    box-shadow: 0 0.35rem 0.8rem rgba(15, 23, 42, 0.08);
}

.message-text-content {
    line-height: 1.6;
    word-wrap: break-word;
}

.ticket-sidebar-stack {
    position: sticky;
    top: 1rem;
}

/* ======================================
   LISTAGEM DE TICKETS - Layout Moderno
   ====================================== */

/* Card de filtros */
.tickets-filter-card {
    background: var(--bs-body-bg);
}

.tickets-filter-card .form-select-sm,
.tickets-filter-card .form-control-sm {
    font-size: 0.8rem;
}

/* Lista de tickets */
.tickets-list-card {
    overflow: hidden;
}

.tickets-table {
    font-size: 0.875rem;
}

.tickets-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    padding: 0.6rem 0.5rem;
    white-space: nowrap;
}

.ticket-row {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.ticket-row:hover {
    background-color: #f8fafc !important;
}

.ticket-row td {
    padding: 0.6rem 0.5rem;
    vertical-align: middle;
}

.ticket-row a {
    color: inherit;
}

.ticket-row a:hover {
    text-decoration: none;
}

/* Destaque para tickets com emails nao lidos */
.ticket-row-unread {
    background-color: #fef2f2 !important;
    border-left: 3px solid #ef4444;
}

.ticket-row-unread:hover {
    background-color: #fee2e2 !important;
}

/* Destaque para tickets urgentes */
.ticket-row-urgent {
    background-color: #fffbeb !important;
    border-left: 3px solid #f59e0b;
}

.ticket-row-urgent:hover {
    background-color: #fef3c7 !important;
}

/* Destaque para tickets com prioridade alta */
.ticket-row-high {
    background-color: #fefce8 !important;
}

.ticket-row-high:hover {
    background-color: #fef9c3 !important;
}

/* Avatar pequeno */
.avatar-xs {
    width: 26px;
    height: 26px;
    font-size: 0.6rem;
    font-weight: 600;
}

/* Badge pequeno */
.badge-sm {
    font-size: 0.6rem;
    padding: 0.15em 0.4em;
    font-weight: 500;
}

/* Assunto do ticket */
.ticket-subject {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.85rem;
}

/* Paginacao */
.pagination-sm .page-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* Widget compacto para sidebar */
.ticket-sidebar-column .rp-widget {
    font-size: 0.85rem;
}

.ticket-sidebar-column .rp-widget-header {
    padding: 0.65rem 0.85rem;
}

.ticket-sidebar-column .rp-widget-body {
    padding: 0.75rem 0.85rem;
}

.ticket-sidebar-column .rp-widget-title {
    font-size: 0.9rem;
}

/* Cards colapsaveis */
.ticket-collapsible-header {
    cursor: pointer;
    user-select: none;
}

.ticket-collapsible-header:hover {
    background: rgba(var(--rp-primary), 0.04);
}

.ticket-collapsible-header .collapse-icon {
    transition: transform 0.2s ease;
}

.ticket-collapsible-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* Toolbar de acoes mais compacta */
.ticket-actions-toolbar .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.ticket-actions-toolbar .form-select {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

/* Description widget mais clean */
.ticket-description-widget .rp-widget-header {
    padding: 0.5rem 0.85rem;
}

.ticket-description-widget .rp-widget-body {
    padding: 0.5rem;
}

@media (max-width: 1199.98px) {
    .ticket-actions-toolbar {
        justify-content: flex-start;
    }

    .ticket-sidebar-stack {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .ticket-details-hero {
        padding: 0.85rem;
        border-radius: 0.75rem;
    }

    .ticket-description-scroll {
        max-height: 12rem;
        padding: 0.75rem;
    }

    .ticket-actions-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ticket-actions-toolbar .btn,
    .ticket-actions-toolbar .form-select {
        width: 100% !important;
    }
}
 
 /* ============================= */
/* WhatsApp Chat Panel Styles    */
/* ============================= */
.whatsapp-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.whatsapp-chat-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    flex-shrink: 0;
}

.whatsapp-chat-body {
    flex: 1;
    overflow-y: auto;
    background: #e5ddd5;
    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='%23d4cfc4' fill-opacity='0.4'%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-height: 250px;
}

.whatsapp-chat-footer {
    background: #f0f0f0;
    flex-shrink: 0;
}

.whatsapp-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
}

.whatsapp-message-agent {
    background: #dcf8c6;
    border-bottom-right-radius: 0;
}

.whatsapp-message-client {
    background: #fff;
    border-bottom-left-radius: 0;
}

.whatsapp-message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.whatsapp-message-time {
    font-size: 0.7rem;
    color: #667781;
    text-align: right;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .whatsapp-chat-panel {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        max-height: 60vh;
    }
}
/* ============================= */
/* Chat Widget Modern Styles     */
/* ============================= */
.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.chat-widget.chat-minimized {
    max-height: 56px;
    cursor: pointer;
}

.chat-widget-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-widget-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-widget-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
}

.chat-widget-body {
    flex: 1;
    overflow-y: auto;
    background: #e5ddd5;
    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='%23d4cfc4' fill-opacity='0.3'%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-height: 280px;
    padding: 16px;
}

.chat-empty-icon {
    font-size: 3rem;
    color: #aaa;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    display: flex;
    max-width: 85%;
}

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

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

.chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.chat-message-sent .chat-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.chat-message-received .chat-bubble {
    background: #fff;
    border-bottom-left-radius: 4px;
}

.chat-bubble-content {
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    gap: 4px;
}

.chat-bubble-time {
    font-size: 0.7rem;
    color: #667781;
}

.chat-widget-footer {
    background: #f0f2f5;
    flex-shrink: 0;
    padding: 8px;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
    border-radius: 24px;
    padding: 8px 12px;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.9rem;
    max-height: 100px;
    min-height: 20px;
    background: transparent;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover:not(:disabled) {
    background: #128C7E;
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .chat-widget {
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chat-widget.chat-minimized {
        right: 16px;
        bottom: 16px;
        width: auto;
        border-radius: 28px;
    }
}
/* ============================= */
/* Chat Widget Modern Styles     */
/* ============================= */
.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.chat-widget.chat-minimized {
    max-height: 56px;
    cursor: pointer;
}

.chat-widget-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-widget-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-widget-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
}

.chat-widget-body {
    flex: 1;
    overflow-y: auto;
    background: #e5ddd5;
    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='%23d4cfc4' fill-opacity='0.3'%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-height: 280px;
    padding: 16px;
}

.chat-empty-icon {
    font-size: 3rem;
    color: #aaa;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    display: flex;
    max-width: 85%;
}

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

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

.chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.chat-message-sent .chat-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.chat-message-received .chat-bubble {
    background: #fff;
    border-bottom-left-radius: 4px;
}

.chat-bubble-content {
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    gap: 4px;
}

.chat-bubble-time {
    font-size: 0.7rem;
    color: #667781;
}

.chat-widget-footer {
    background: #f0f2f5;
    flex-shrink: 0;
    padding: 8px;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
    border-radius: 24px;
    padding: 8px 12px;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.9rem;
    max-height: 100px;
    min-height: 20px;
    background: transparent;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover:not(:disabled) {
    background: #128C7E;
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .chat-widget {
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chat-widget.chat-minimized {
        right: 16px;
        bottom: 16px;
        width: auto;
        border-radius: 28px;
    }
}

/* WhatsApp Interaction in Ticket */
.whatsapp-interaction {
    border-left: 3px solid #25D366 !important;
}

/* External Link Interaction (via link publico) */
.external-link-interaction {
    border-left: 3px solid #6c757d !important;
}

/* Web Panel Interaction (atendente via painel) */
.web-interaction {
    border-left: 3px solid #0d6efd !important;
}

/* Document Request Interaction */
.doc-request-interaction {
    border-left: 3px solid #dc3545 !important;
}

/* Attachment Interaction */
.attachment-interaction {
    border-left: 3px solid #6f42c1 !important;
}

/* Purple badge color for attachments */
.bg-purple-subtle {
    background-color: rgba(111, 66, 193, 0.1) !important;
}
.text-purple {
    color: #6f42c1 !important;
}

/* Teal color for client documents */
.bg-teal-subtle {
    background-color: rgba(32, 201, 151, 0.1) !important;
}
.text-teal {
    color: #20c997 !important;
}

/* === MODO HTML: descricao renderizando HTML original do email ===
   Sobrepoe os estilos de texto puro acima para que tags do email
   (paragrafos, tabelas, listas, imagens, citacoes) fiquem bem renderizadas. */
.ticket-description-scroll.ticket-description-html {
    white-space: normal;
    line-height: 1.55;
    max-height: 28rem;
    color: #1f2937;
}

/* Desativa drop-cap quando renderiza HTML */
.ticket-description-content.ticket-description-html::first-letter,
.ticket-description-content.ticket-description-html p:first-child::first-letter {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    float: none;
    margin: 0;
    line-height: inherit;
}

.ticket-description-html p {
    margin-bottom: 0.6rem;
    text-align: left;
    text-justify: auto;
}

.ticket-description-html img {
    max-width: 100%;
    height: auto;
    border-radius: 0.35rem;
}

.ticket-description-html a {
    color: rgb(var(--rp-primary));
    text-decoration: underline;
    word-break: break-word;
}

.ticket-description-html table {
    max-width: 100% !important;
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.ticket-description-html table td,
.ticket-description-html table th {
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: top;
}

.ticket-description-html blockquote {
    margin: 0.5rem 0 0.75rem 0;
    padding: 0.4rem 0.9rem;
    border-left: 3px solid rgba(var(--rp-primary), 0.4);
    background: rgba(15, 23, 42, 0.03);
    color: #475569;
}

.ticket-description-html ul,
.ticket-description-html ol {
    padding-left: 1.4rem;
    margin-bottom: 0.6rem;
}

.ticket-description-html pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 0.45rem;
    overflow-x: auto;
    font-size: 0.85rem;
}
