/* ===== MODAL CHAT ===== */
.modal-chat-v2 {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 60% !important;
    min-width: 400px !important;
    max-width: 800px !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Sobrescrever estilos do Ionic */
.modal-chat-v2.ion-modal-view {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
}

.container-msg {
    width: 100%;
    margin-left: 10px;
    max-width: 430px;
}

.container-msg-v2 {
    width: 100%;
    margin-left: 10px;
    max-width: 800px;
}

.modal-chat-v2 .modal {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
}

/* Garantir layout flex no modal para header + conteúdo + input sem sobreposição */
.modal-chat-v2 .modal,
ion-modal-view.modal-chat-v2 {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}
.modal-chat-v2 .modal > ion-content.messages-container,
ion-modal-view.modal-chat-v2 > ion-content.messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* Forçar posicionamento no lado direito */
.modal-chat-v2 {
    left: 40% !important;
    right: 0 !important;
}

/* Garantir que não haja sobreposição com sidebar */
.modal-chat-v2 {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.chat-header-v2 {
    background-color: #ffffff !important;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    min-height: 60px;
    flex: 0 0 auto !important;
}

.header-left-section {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    background: none;
    padding: 15px;
    border-radius: 8px;
    margin-right: 10px;
    min-height: 60px;
}

.ticket-info-v2 {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
}

.ticket-id-v2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.ticket-category-v2 {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    margin: 0;
    line-height: 1.2;
    max-width: 150px !important;
}

.header-divider-v2 {
    width: 1px;
    height: 30px;
    background: #d1d5db;
    margin: 0 15px;
}

.assunto-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    max-width: 120px;
}

.assunto-label-v2 {
    font-size: 11px;
    font-weight: 600;
    color: #1f1f1f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.assunto-content-v2 {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.participants-section-v2 {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.participants-label-v2 {
    font-size: 11px;
    font-weight: 600;
    color: #1f1f1f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.participants-content-v2 {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 300px;
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}

.participant-tag {
    font-size: 11px;
    font-weight: 400;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 350px;
    line-height: 1.2;
}

.see-more-link {
    font-size: 11px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
}

.see-more-link:hover {
    text-decoration: underline;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 30px;
    min-width: 100px;
}

.action-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
}

.action-button:hover {
    background: #f3f4f6;
}

.action-icon {
    font-size: 16px;
    color: #6b7280;
}

/* Animação oscilante entre ícones */
.icon-oscillate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.icon-oscillate .icon-info,
.icon-oscillate .icon-plus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #3b82f6;
    transition: opacity 1s ease-in-out;
}

.icon-oscillate .icon-info {
    animation: oscillateInfo 4s infinite;
}

.icon-oscillate .icon-plus {
    animation: oscillatePlus 4s infinite;
}

@keyframes oscillateInfo {

    0%,
    45% {
        opacity: 1;
    }

    50%,
    95% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes oscillatePlus {

    0%,
    45% {
        opacity: 0;
    }

    50%,
    95% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.close-button-v2 {
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 50%;
    padding: 6px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 500;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button-v2:hover {
    color: #374151;
    background-color: #f3f4f6;
}

/* ===== MESSAGES CONTAINER ===== */
/* Input está DENTRO do ion-content: layout flex evita qualquer sobreposição */
.modal-chat-v2 ion-content.messages-container,
.modal-chat-v2 .scroll-content.messages-container,
.messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    background: #f8fafc;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}
/* Scroll interno do Ionic: flex column para viewport + input */
.modal-chat-v2 ion-content.messages-container .scroll,
.modal-chat-v2 .scroll-content.messages-container .scroll {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}
.modal-chat-v2 ion-content.messages-container .scroll-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
.modal-chat-v2 ion-content.messages-container .scroll-view {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Área de mensagens: ocupa o espaço restante e faz scroll; nunca atrás do input */
.chat-messages-viewport {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px 50px 24px !important;
    box-sizing: border-box !important;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
}
.message-item:last-child .message-meta {
    margin-bottom: 0 !important;
}

.message-item.user-message {
    align-items: flex-end;
}

.message-item.agent-message {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message-bubble.user-message {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.agent-message {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    margin-bottom: 16px !important;
}

.message-time {
    font-weight: 500;
}

.message-sender {
    color: #3b82f6;
    font-weight: 500;
}

.message-status {
    color: #10b981;
    font-size: 10px;
}

/* ===== IMAGE MESSAGES ===== */
.message-image {
    max-width: 200px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-image:hover {
    transform: scale(1.02);
}

/* ===== FILE MESSAGES ===== */
.file-message {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 300px;
}

.file-icon {
    font-size: 24px;
    color: #ef4444;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.file-download {
    color: #3b82f6;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.file-download:hover {
    text-decoration: underline;
}

/* ===== RATING SECTION ===== */
.rating-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 24px;
}

.rating-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.rating-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.star {
    font-size: 24px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star.selected {
    color: #fbbf24;
}

.star.disabled {
    cursor: not-allowed;
}

.rating-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.rating-checkbox input {
    width: 16px;
    height: 16px;
}

.rating-checkbox label {
    font-size: 14px;
    color: #374151;
    margin: 0;
}

.rating-comment {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
}

.rating-msg-counter {
     margin-bottom: 16px;
}

.rating-submit {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rating-submit:hover {
    background: #2563eb;
}

/* ===== MESSAGE INPUT ===== */
.message-input-container {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 20px 24px;
    flex: 0 0 auto !important;
    width: 100%;
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.input-section {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  flex: 0 0 auto !important;
}

.container-msg{
  display: block;
  flex: 0 0 auto;
}

.message-input-chat {
  flex: 1 1 auto !important;
  min-width: 0 !important;            
  min-height: 40px !important;       
  max-height: 120px !important;
  padding: 8px 10px !important;
  line-height: 1.4 !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  resize: none !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.send-button-chat {
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
}

.message-input-chat:focus {
    border-color: #3b82f6;
}

.attachment-section {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap;
}

.attachment-button,
.attachment-name,
.remove-attachment {
  flex: 0 0 auto;
}

.modal-nova-mensagem {
max-width: 90%;
max-height: 85%;
}

.nova-mensagem-header {
background-color: #ffffff !important;
padding: 20px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e0e0e0;
}

.nova-mensagem-title {
font-size: 18px;
font-weight: bold;
color: #333;
margin: 0;
}

.nova-mensagem-close-modal {
background: transparent;
border: none;
font-size: 24px;
color: #333 !important;
cursor: pointer;
padding: 5px;
width: 35px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
opacity: 1 !important;
visibility: visible !important;
}

.nova-mensagem-close-modal:hover {
color: #000 !important;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 50%;
}

.nova-mensagem-content {
padding: 15px;
background-color: #f8f9fa;
min-height: 400px;
}

.canal-title {
font-size: 24px;
font-weight: bold;
color: #1a1a1a;
margin: 0 0 30px 0;
text-align: left;
}

.form-section {
margin-bottom: 5px;
}

.form-label {
display: block;
font-size: 14px;
font-weight: 600;
color: #374151;
margin-bottom: 8px;
}

.form-input {
width: 100%;
padding: 12px 16px;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 14px;
background: #ffffff;
transition: border-color 0.2s ease;
}

.form-input:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
width: 100%;
padding: 12px 16px;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 14px;
background: #ffffff;
resize: vertical;
min-height: 120px;
font-family: inherit;
transition: border-color 0.2s ease;
}

.form-textarea:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.assunto-row {
display: flex;
gap: 20px;
margin-bottom: 25px;
}

.assunto-row .form-section {
flex: 1;
margin-bottom: 0;
}

.ou-label {
font-size: 14px;
color: #6b7280;
margin: 0 10px;
align-self: flex-end;
padding-bottom: 8px;
font-weight: 500;
}

.attachment-section {
display: flex;
align-items: center;
gap: 12px;
margin-top: 10px;
}

.attachment-button {
background: #f3f4f6;
border: 1px solid #d1d5db;
border-radius: 8px;
padding: 10px 16px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
color: #374151;
transition: all 0.2s ease;
min-width: 120px;
justify-content: center;
}

.attachment-button:hover {
background: #e5e7eb;
border-color: #9ca3af;
}

.attachment-input {
flex: 1;
padding: 10px 16px;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 14px;
background: #f9fafb;
color: #6b7280;
}

.remove-attachment {
background: #ef4444;
color: white;
border: none;
border-radius: 8px;
padding: 10px 16px;
cursor: pointer;
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
min-width: 50px;
transition: background-color 0.2s ease;
}

.remove-attachment:hover {
background: #dc2626;
}

.remove-attachment:disabled {
background: #9ca3af;
cursor: not-allowed;
}

.send-button {
background: #3b82f6;
color: white;
border: none;
border-radius: 8px;
padding: 12px 24px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease;
width: 100%;
margin-top: 20px;
}

.send-button:hover {
background: #2563eb;
}

.send-button:disabled {
background: #9ca3af;
cursor: not-allowed;
}

/* Responsivo */
@media (max-width: 1024px) {
.modal-nova-mensagem {
    max-width: 95%;
    max-height: 90%;
}

.nova-mensagem-content {
    padding: 20px;
}

.canal-title {
    font-size: 20px;
    margin-bottom: 25px;
    margin-top: 15px !important;
}
}

@media (max-width: 768px) {
.modal-nova-mensagem {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
}

.nova-mensagem-header {
    padding: 15px;
    min-height: 60px;
}

.nova-mensagem-title {
    font-size: 16px;
}

.nova-mensagem-close-modal {
    font-size: 20px;
    width: 30px;
    height: 30px;
}

.nova-mensagem-content {
    padding: 15px;
    min-height: calc(100vh - 60px);
}

.canal-title {
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.3;
    margin-top: 15px !important;
}

.assunto-row {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.ou-label {
    align-self: flex-start;
    margin: 0 0 8px 0;
    padding-bottom: 0;
    text-align: center;
    width: 100%;
}

.form-section {
    margin-bottom: 20px;
}

.form-label {
    font-size: 13px;
    margin-bottom: 6px;
}

.form-input, .form-textarea {
    padding: 10px 12px;
    font-size: 13px;
}

.form-textarea {
    min-height: 100px;
}

.attachment-section {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.attachment-button {
    min-width: auto;
    justify-content: center;
    padding: 12px 16px;
}

.attachment-input {
    text-align: center;
}

.remove-attachment {
    min-width: auto;
    padding: 12px 16px;
}

.send-button {
    padding: 14px 24px;
    font-size: 15px;
    margin-top: 25px;
}
}

@media (max-width: 480px) {
.nova-mensagem-header {
    padding: 12px;
}

.nova-mensagem-content {
    padding: 12px;
}

.canal-title {
    font-size: 16px;
    margin-bottom: 15px;
    margin-top: 15px !important;
}

.form-section {
    margin-bottom: 15px;
}

.form-input, .form-textarea {
    padding: 8px 10px;
    font-size: 12px;
}

.form-textarea {
    min-height: 80px;
}

.attachment-button, .remove-attachment {
    padding: 10px 12px;
    font-size: 12px;
}

.send-button {
    padding: 12px 20px;
    font-size: 14px;
    margin-top: 20px;
}
}

/* Melhorias para tablets em landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
.modal-nova-mensagem {
    max-height: 95%;
}

.nova-mensagem-content {
    padding: 20px;
}

.assunto-row {
    gap: 15px;
}

.form-textarea {
    min-height: 100px;
}
}

/* Melhorias para telas muito pequenas */
@media (max-width: 320px) {
.nova-mensagem-header {
    padding: 10px;
}

.nova-mensagem-title {
    font-size: 14px;
}

.nova-mensagem-close-modal {
    font-size: 18px;
    width: 25px;
    height: 25px;
}

.nova-mensagem-content {
    padding: 10px;
}

.canal-title {
    font-size: 14px;
    margin-bottom: 12px;
}

.form-label {
    font-size: 12px;
}

.form-input, .form-textarea {
    padding: 6px 8px;
    font-size: 11px;
}

.form-textarea {
    min-height: 70px;
}

.attachment-button, .remove-attachment {
    padding: 8px 10px;
    font-size: 11px;
}

.send-button {
    padding: 10px 16px;
    font-size: 13px;
}
}

.attachment-button {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: center;
}

.attachment-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.attachment-input {
    display: none;
}

.attachment-name {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 12px;
    background: #f9fafb;
    color: #6b7280;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.remove-attachment {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    font-size: 12px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #f59e0b;
    margin-top: 8px;
}

.attachment-info i {
    color: #f59e0b;
    font-size: 14px;
}

/* ===== IMAGE MODAL ===== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #333;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .modal-chat-v2 {
        width: 70% !important;
        left: 30% !important;
    }

    .message-input-container {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
}

@media (max-width: 768px) {
    .modal-chat-v2 {
        width: 100% !important;
        height: 100vh;
        right: 0;
        left: 0 !important;
        top: 0;
        max-width: 100% !important;
        min-width: 100% !important;
    }

   .message-input-container {
        display: flex !important;
        flex-direction: column !important;  
        gap: 10px !important;
    }

    .chat-header-v2 {
        padding: 16px;
        min-height: 70px;
    }

    .header-left-section {
        gap: 1px;
        background-color: transparent !important;
    }

    .ticket-id-v2 {
        font-size: 18px;
    }

    .ticket-category-v2 {
        font-size: 12px;
        max-width: 150px !important;
    }

    .assunto-label-v2 {
        font-size: 11px;
    }

    .assunto-content-v2 {
        font-size: 13px;
    }

    .header-divider-v2 {
        height: 30px;
        margin: 0 8px;
    }

    .messages-container,
    .modal-chat-v2 ion-content.messages-container,
    .modal-chat-v2 .scroll-content.messages-container {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
    .chat-messages-viewport {
        padding: 16px 16px 80px 16px !important;
    }

    .message-bubble {
        max-width: 85%;
    }

    .message-input-container {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .assunto-section {
        display: none !important;
    }

    .assunto-section+.header-divider-v2 {
        display: none !important;
    }

    .chat-header-v2 {
        padding: 12px 16px;
        min-height: 65px;
    }

    .header-left-section {
        gap: 8px;
    }

    .ticket-id-v2 {
        font-size: 17px;
    }

    .ticket-category-v2 {
        font-size: 13px;
        max-width: 100px !important;
    }

    .participants-label-v2 {
        font-size: 11px;
    }

    .participants-content-v2 {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .chat-header-v2 {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        min-height: 60px;
    }

    .header-left-section {
        flex: 1;
        min-width: 0;
    }

    .header-actions {
        flex-shrink: 0;
    }

    .ticket-id-v2 {
        font-size: 16px;
    }

    .ticket-category-v2 {
        font-size: 12px;
        max-width: 100px !important;
    }

    .participants-label-v2 {
        font-size: 10px;
    }

    .participants-content-v2 {
        font-size: 11px;
    }

    .message-bubble {
        max-width: 90%;
    }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

/** Modal Novo Atendimento **/
/* Estilos para o modal de novo chat */
.modal-novo-chat {
    max-width: 90%;
    max-height: 85%;
}

.novo-chat-header {
    background-color: #ffffff !important;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
}

.novo-chat-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.novo-chat-close-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #333 !important;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
}

.novo-chat-close-modal:hover {
    color: #000 !important;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.novo-chat-content {
    padding: 30px 20px;
    background-color: #f8f9fa;
}

.canais-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.canais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.canal-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #275f8f;
}

.canal-card:active {
    transform: translateY(0);
}

.canal-nome {
    font-size: 14px;
    font-weight: 600;
    color: #275f8f;
    line-height: 1.4;
    word-wrap: break-word;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-text {
    font-size: 16px;
    margin: 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .canais-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .canal-card {
        padding: 20px 15px;
        min-height: 100px;
    }

    .canal-nome {
        font-size: 13px;
    }

    .novo-chat-content {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .canais-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .canal-card {
        padding: 15px 10px;
        min-height: 80px;
    }

    .canal-nome {
        font-size: 12px;
    }
}

/* Banner de orientações */
.orientacoes-banner {
  max-width: 800px;
  margin: 28px auto 0 auto;
  background: #f1f5f9; /* cinza claro */
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.orientacoes-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}
.orientacoes-text {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  word-wrap: break-word;
}
@media (max-width: 480px) {
  .orientacoes-banner { margin-top: 20px; padding: 14px; }
  .orientacoes-title { font-size: 13px; }
  .orientacoes-text { font-size: 12px; }
}

@media (max-width: 768px) {
  .modal-chat-v2 {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
  }

  .modal-chat-v2 .chat-header-v2 {
    flex: 0 0 auto !important;
  }

  /* Manter layout flex (input dentro do ion-content) em todas as resoluções */
  .modal-chat-v2 ion-content.messages-container,
  .modal-chat-v2 .scroll-content.messages-container,
  .messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .message-input-container {
    flex: 0 0 auto !important;
    width: 100% !important;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.04) !important;
  }
}

@media (max-width: 480px) {
  .modal-chat-v2 {
    height: 100vh !important;
  }

  .modal-chat-v2 ion-content.messages-container,
  .modal-chat-v2 .scroll-content.messages-container,
  .messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  .chat-messages-viewport {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  .message-input-container {
    flex: 0 0 auto !important;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.04) !important;
  }
}